Files
a.montask/public/vendor/rich-text-laravel/lexxy.esm.js
T
2026-04-25 11:46:02 +00:00

268 lines
573 KiB
JavaScript
Executable File

var AA=Object.create;var lc=Object.defineProperty;var wA=Object.getOwnPropertyDescriptor;var vA=Object.getOwnPropertyNames;var OA=Object.getPrototypeOf,kA=Object.prototype.hasOwnProperty;var LA=(n,e,t)=>e in n?lc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var RA=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Lt=(n,e)=>{for(var t in e)lc(n,t,{get:e[t],enumerable:!0})},MA=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vA(e))!kA.call(n,o)&&o!==t&&lc(n,o,{get:()=>e[o],enumerable:!(r=wA(e,o))||r.enumerable});return n};var cc=(n,e,t)=>(t=n!=null?AA(OA(n)):{},MA(e||!n||!n.__esModule?lc(t,"default",{value:n,enumerable:!0}):t,n));var nn=(n,e,t)=>(LA(n,typeof e!="symbol"?e+"":e,t),t),Tg=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var R=(n,e,t)=>(Tg(n,e,"read from private field"),t?t.call(n):e.get(n)),k=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},ra=(n,e,t,r)=>(Tg(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);var L=(n,e,t)=>(Tg(n,e,"access private method"),t);var oa=RA((ZM,uc)=>{var DA=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var j=function(n){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},o={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function p(m){return m instanceof s?new s(m.type,p(m.content),m.alias):Array.isArray(m)?m.map(p):m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++t}),p.__id},clone:function p(m,_){_=_||{};var C,x;switch(o.util.type(m)){case"Object":if(x=o.util.objId(m),_[x])return _[x];C={},_[x]=C;for(var y in m)m.hasOwnProperty(y)&&(C[y]=p(m[y],_));return C;case"Array":return x=o.util.objId(m),_[x]?_[x]:(C=[],_[x]=C,m.forEach(function(S,b){C[b]=p(S,_)}),C);default:return m}},getLanguage:function(p){for(;p;){var m=e.exec(p.className);if(m)return m[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,m){p.className=p.className.replace(RegExp(e,"gi"),""),p.classList.add("language-"+m)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT"&&1<2)return document.currentScript;try{throw new Error}catch(C){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(p){var m=document.getElementsByTagName("script");for(var _ in m)if(m[_].src==p)return m[_]}return null}},isActive:function(p,m,_){for(var C="no-"+m;p;){var x=p.classList;if(x.contains(m))return!0;if(x.contains(C))return!1;p=p.parentElement}return!!_}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(p,m){var _=o.util.clone(o.languages[p]);for(var C in m)_[C]=m[C];return _},insertBefore:function(p,m,_,C){C=C||o.languages;var x=C[p],y={};for(var S in x)if(x.hasOwnProperty(S)){if(S==m)for(var b in _)_.hasOwnProperty(b)&&(y[b]=_[b]);_.hasOwnProperty(S)||(y[S]=x[S])}var N=C[p];return C[p]=y,o.languages.DFS(o.languages,function(A,O){O===N&&A!=p&&(this[A]=y)}),y},DFS:function p(m,_,C,x){x=x||{};var y=o.util.objId;for(var S in m)if(m.hasOwnProperty(S)){_.call(m,S,m[S],C||S);var b=m[S],N=o.util.type(b);N==="Object"&&!x[y(b)]?(x[y(b)]=!0,p(b,_,null,x)):N==="Array"&&!x[y(b)]&&(x[y(b)]=!0,p(b,_,S,x))}}},plugins:{},highlightAll:function(p,m){o.highlightAllUnder(document,p,m)},highlightAllUnder:function(p,m,_){var C={callback:_,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),o.hooks.run("before-all-elements-highlight",C);for(var x=0,y;y=C.elements[x++];)o.highlightElement(y,m===!0,C.callback)},highlightElement:function(p,m,_){var C=o.util.getLanguage(p),x=o.languages[C];o.util.setLanguage(p,C);var y=p.parentElement;y&&y.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(y,C);var S=p.textContent,b={element:p,language:C,grammar:x,code:S};function N(O){b.highlightedCode=O,o.hooks.run("before-insert",b),b.element.innerHTML=b.highlightedCode,o.hooks.run("after-highlight",b),o.hooks.run("complete",b),_&&_.call(b.element)}if(o.hooks.run("before-sanity-check",b),y=b.element.parentElement,y&&y.nodeName.toLowerCase()==="pre"&&!y.hasAttribute("tabindex")&&y.setAttribute("tabindex","0"),!b.code){o.hooks.run("complete",b),_&&_.call(b.element);return}if(o.hooks.run("before-highlight",b),!b.grammar){N(o.util.encode(b.code));return}if(m&&n.Worker){var A=new Worker(o.filename);A.onmessage=function(O){N(O.data)},A.postMessage(JSON.stringify({language:b.language,code:b.code,immediateClose:!0}))}else N(o.highlight(b.code,b.grammar,b.language))},highlight:function(p,m,_){var C={code:p,grammar:m,language:_};if(o.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=o.tokenize(C.code,C.grammar),o.hooks.run("after-tokenize",C),s.stringify(o.util.encode(C.tokens),C.language)},tokenize:function(p,m){var _=m.rest;if(_){for(var C in _)m[C]=_[C];delete m.rest}var x=new l;return c(x,x.head,p),a(p,x,m,x.head,0),d(x)},hooks:{all:{},add:function(p,m){var _=o.hooks.all;_[p]=_[p]||[],_[p].push(m)},run:function(p,m){var _=o.hooks.all[p];if(!(!_||!_.length))for(var C=0,x;x=_[C++];)x(m)}},Token:s};n.Prism=o;function s(p,m,_,C){this.type=p,this.content=m,this.alias=_,this.length=(C||"").length|0}s.stringify=function p(m,_){if(typeof m=="string")return m;if(Array.isArray(m)){var C="";return m.forEach(function(N){C+=p(N,_)}),C}var x={type:m.type,content:p(m.content,_),tag:"span",classes:["token",m.type],attributes:{},language:_},y=m.alias;y&&(Array.isArray(y)?Array.prototype.push.apply(x.classes,y):x.classes.push(y)),o.hooks.run("wrap",x);var S="";for(var b in x.attributes)S+=" "+b+'="'+(x.attributes[b]||"").replace(/"/g,"&quot;")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+S+">"+x.content+"</"+x.tag+">"};function i(p,m,_,C){p.lastIndex=m;var x=p.exec(_);if(x&&C&&x[1]){var y=x[1].length;x.index+=y,x[0]=x[0].slice(y)}return x}function a(p,m,_,C,x,y){for(var S in _)if(!(!_.hasOwnProperty(S)||!_[S])){var b=_[S];b=Array.isArray(b)?b:[b];for(var N=0;N<b.length;++N){if(y&&y.cause==S+","+N)return;var A=b[N],O=A.inside,P=!!A.lookbehind,I=!!A.greedy,z=A.alias;if(I&&!A.pattern.global){var G=A.pattern.toString().match(/[imsuy]*$/)[0];A.pattern=RegExp(A.pattern.source,G+"g")}for(var q=A.pattern||A,K=C.next,le=x;K!==m.tail&&!(y&&le>=y.reach);le+=K.value.length,K=K.next){var ie=K.value;if(m.length>p.length)return;if(!(ie instanceof s)){var pe=1,xe;if(I){if(xe=i(q,le,p,P),!xe||xe.index>=p.length)break;var ke=xe.index,ht=xe.index+xe[0].length,fe=le;for(fe+=K.value.length;ke>=fe;)K=K.next,fe+=K.value.length;if(fe-=K.value.length,le=fe,K.value instanceof s)continue;for(var Wt=K;Wt!==m.tail&&(fe<ht||typeof Wt.value=="string");Wt=Wt.next)pe++,fe+=Wt.value.length;pe--,ie=p.slice(le,fe),xe.index-=le}else if(xe=i(q,0,ie,P),!xe)continue;var ke=xe.index,kt=xe[0],ge=ie.slice(0,ke),Qe=ie.slice(ke+kt.length),en=le+ie.length;y&&en>y.reach&&(y.reach=en);var ne=K.prev;ge&&(ne=c(m,ne,ge),le+=ge.length),u(m,ne,pe);var Ue=new s(S,O?o.tokenize(kt,O):kt,z,kt);if(K=c(m,ne,Ue),Qe&&c(m,K,Qe),pe>1){var Ve={cause:S+","+N,reach:en};a(p,m,_,K.prev,le,Ve),y&&Ve.reach>y.reach&&(y.reach=Ve.reach)}}}}}}function l(){var p={value:null,prev:null,next:null},m={value:null,prev:p,next:null};p.next=m,this.head=p,this.tail=m,this.length=0}function c(p,m,_){var C=m.next,x={value:_,prev:m,next:C};return m.next=x,C.prev=x,p.length++,x}function u(p,m,_){for(var C=m.next,x=0;x<_&&C!==p.tail;x++)C=C.next;m.next=C,C.prev=m,p.length-=x}function d(p){for(var m=[],_=p.head.next;_!==p.tail;)m.push(_.value),_=_.next;return m}if(!n.document)return n.addEventListener&&(o.disableWorkerMessageHandler||n.addEventListener("message",function(p){var m=JSON.parse(p.data),_=m.language,C=m.code,x=m.immediateClose;n.postMessage(o.highlight(C,o.languages[_],_)),x&&n.close()},!1)),o;var h=o.util.currentScript();h&&(o.filename=h.src,h.hasAttribute("data-manual")&&(o.manual=!0));function g(){o.manual||o.highlightAll()}if(!o.manual){var f=document.readyState;f==="loading"||f==="interactive"&&h&&h.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return o}(DA);typeof uc<"u"&&uc.exports&&(uc.exports=j);typeof global<"u"&&(global.Prism=j);j.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]};j.languages.markup.tag.inside["attr-value"].inside.entity=j.languages.markup.entity;j.languages.markup.doctype.inside["internal-subset"].inside=j.languages.markup;j.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(j.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:j.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+t]={pattern:/[\s\S]+/,inside:j.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:o},j.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(j.languages.markup.tag,"addAttribute",{value:function(n,e){j.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[e,"language-"+e],inside:j.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});j.languages.html=j.languages.markup;j.languages.mathml=j.languages.markup;j.languages.svg=j.languages.markup;j.languages.xml=j.languages.extend("markup",{});j.languages.ssml=j.languages.xml;j.languages.atom=j.languages.xml;j.languages.rss=j.languages.xml;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(j);j.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:/[{}[\];(),.:]/};j.languages.javascript=j.languages.extend("clike",{"class-name":[j.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}|\?\?=?|\?\.?|[~:]/});j.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;j.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:j.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:j.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:j.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:j.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:j.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});j.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:j.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"}});j.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});j.languages.markup&&(j.languages.markup.tag.addInlined("script","javascript"),j.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"));j.languages.js=j.languages.javascript;(function(){if(typeof j>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading\u2026",e=function(h,g){return"\u2716 Error "+h+" while fetching file: "+g},t="\u2716 Error: File does not exist or is empty",r={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",s="loading",i="loaded",a="failed",l="pre[data-src]:not(["+o+'="'+i+'"]):not(['+o+'="'+s+'"])';function c(h,g,f){var p=new XMLHttpRequest;p.open("GET",h,!0),p.onreadystatechange=function(){p.readyState==4&&(p.status<400&&p.responseText?g(p.responseText):p.status>=400?f(e(p.status,p.statusText)):f(t))},p.send(null)}function u(h){var g=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(g){var f=Number(g[1]),p=g[2],m=g[3];return p?m?[f,Number(m)]:[f,void 0]:[f,f]}}j.hooks.add("before-highlightall",function(h){h.selector+=", "+l}),j.hooks.add("before-sanity-check",function(h){var g=h.element;if(g.matches(l)){h.code="",g.setAttribute(o,s);var f=g.appendChild(document.createElement("CODE"));f.textContent=n;var p=g.getAttribute("data-src"),m=h.language;if(m==="none"){var _=(/\.(\w+)$/.exec(p)||[,"none"])[1];m=r[_]||_}j.util.setLanguage(f,m),j.util.setLanguage(g,m);var C=j.plugins.autoloader;C&&C.loadLanguages(m),c(p,function(x){g.setAttribute(o,i);var y=u(g.getAttribute("data-range"));if(y){var S=x.split(/\r\n?|\n/g),b=y[0],N=y[1]==null?S.length:y[1];b<0&&(b+=S.length),b=Math.max(0,Math.min(b-1,S.length)),N<0&&(N+=S.length),N=Math.max(0,Math.min(N,S.length)),x=S.slice(b,N).join(`
`),g.hasAttribute("data-start")||g.setAttribute("data-start",String(b+1))}f.textContent=x,j.highlightElement(f)},function(x){g.setAttribute(o,a),f.textContent=x})}}),j.plugins.fileHighlight={highlight:function(g){for(var f=(g||document).querySelectorAll(l),p=0,m;m=f[p++];)j.highlightElement(m)}};var d=!1;j.fileHighlight=function(){d||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),d=!0),j.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var vP=cc(oa(),1);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){function e(t,r){return"___"+t.toUpperCase()+r+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,r,o,s){if(t.language===r){var i=t.tokenStack=[];t.code=t.code.replace(o,function(a){if(typeof s=="function"&&!s(a))return a;for(var l=i.length,c;t.code.indexOf(c=e(r,l))!==-1;)++l;return i[l]=a,c}),t.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(t,r){if(t.language!==r||!t.tokenStack)return;t.grammar=n.languages[r];var o=0,s=Object.keys(t.tokenStack);function i(a){for(var l=0;l<a.length&&!(o>=s.length);l++){var c=a[l];if(typeof c=="string"||c.content&&typeof c.content=="string"){var u=s[o],d=t.tokenStack[u],h=typeof c=="string"?c:c.content,g=e(r,u),f=h.indexOf(g);if(f>-1){++o;var p=h.substring(0,f),m=new n.Token(r,n.tokenize(d,t.grammar),"language-"+r,d),_=h.substring(f+g.length),C=[];p&&C.push.apply(C,i([p])),C.push(m),_&&C.push.apply(C,i([_])),typeof c=="string"?a.splice.apply(a,[l,1].concat(C)):c.content=C}}else c.content&&i(c.content)}return a}i(t.tokens)}}})})(Prism);(function(n){n.languages.ruby=n.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:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var e={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var t="(?:"+[/([^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;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+t+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:e,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:e,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:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+t),greedy:!0,inside:{interpolation:e,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:e,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:e,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+t),greedy:!0,inside:{interpolation:e,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:e,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.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)/}),n.languages.rb=n.languages.ruby})(Prism);(function(n){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{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},/\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,o=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,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:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:o,punctuation:s};var i={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},a=[{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;|([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:i}},{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:i}}];n.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:e,string:a,"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:t,number:r,operator:o,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(l){if(!!/<\?/.test(l.code)){var c=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(l,"php",c)}}),n.hooks.add("after-tokenize",function(l){n.languages["markup-templating"].tokenizePlaceholders(l,"php")})})(Prism);Prism.languages.go=Prism.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.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];(function(n){var e="\\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",t={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:t,environment:{pattern:RegExp("\\$"+e),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("(\\{)"+e),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})/};n.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;|&]|[<>]\\()"+e),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:t}},{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("\\$?"+e),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}},t.inside=n.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],s=r.variable[1].inside,i=0;i<o.length;i++)s[o[i]]=n.languages.bash[o[i]];n.languages.sh=n.languages.bash,n.languages.shell=n.languages.bash})(Prism);Prism.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.languages.webmanifest=Prism.languages.json;(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],o=[];/^\w+$/.test(t)||o.push(/\w+/.exec(t)[0]),t==="diff"&&o.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
?|
|(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);var{entries:bC,setPrototypeOf:gC,isFrozen:IA,getPrototypeOf:$A,getOwnPropertyDescriptor:PA}=Object,{freeze:Mt,seal:pn,create:kg}=Object,{apply:Lg,construct:Rg}=typeof Reflect<"u"&&Reflect;Mt||(Mt=function(e){return e});pn||(pn=function(e){return e});Lg||(Lg=function(e,t){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return e.apply(t,o)});Rg||(Rg=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return new e(...r)});var dc=Dt(Array.prototype.forEach),FA=Dt(Array.prototype.lastIndexOf),fC=Dt(Array.prototype.pop),sa=Dt(Array.prototype.push),BA=Dt(Array.prototype.splice),gc=Dt(String.prototype.toLowerCase),Ng=Dt(String.prototype.toString),Eg=Dt(String.prototype.match),ia=Dt(String.prototype.replace),HA=Dt(String.prototype.indexOf),zA=Dt(String.prototype.trim),Tn=Dt(Object.prototype.hasOwnProperty),Rt=Dt(RegExp.prototype.test),aa=KA(TypeError);function Dt(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return Lg(n,e,r)}}function KA(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Rg(n,t)}}function ce(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gc;gC&&gC(n,null);let r=e.length;for(;r--;){let o=e[r];if(typeof o=="string"){let s=t(o);s!==o&&(IA(e)||(e[r]=s),o=s)}n[o]=!0}return n}function UA(n){for(let e=0;e<n.length;e++)Tn(n,e)||(n[e]=null);return n}function Gn(n){let e=kg(null);for(let[t,r]of bC(n))Tn(n,t)&&(Array.isArray(r)?e[t]=UA(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Gn(r):e[t]=r);return e}function la(n,e){for(;n!==null;){let r=PA(n,e);if(r){if(r.get)return Dt(r.get);if(typeof r.value=="function")return Dt(r.value)}n=$A(n)}function t(){return null}return t}var pC=Mt(["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"]),Ag=Mt(["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"]),wg=Mt(["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"]),WA=Mt(["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"]),vg=Mt(["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"]),GA=Mt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mC=Mt(["#text"]),_C=Mt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","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","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Og=Mt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","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-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"]),CC=Mt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),hc=Mt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),VA=pn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),YA=pn(/<%[\w\W]*|[\w\W]*%>/gm),jA=pn(/\$\{[\w\W]*/gm),qA=pn(/^data-[\-\w.\u00B7-\uFFFF]+$/),ZA=pn(/^aria-[\-\w]+$/),SC=pn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),JA=pn(/^(?:\w+script|data):/i),XA=pn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TC=pn(/^html$/i),QA=pn(/^[a-z][.\w]*(-[.\w]+)+$/i),xC=Object.freeze({__proto__:null,ARIA_ATTR:ZA,ATTR_WHITESPACE:XA,CUSTOM_ELEMENT:QA,DATA_ATTR:qA,DOCTYPE_NAME:TC,ERB_EXPR:YA,IS_ALLOWED_URI:SC,IS_SCRIPT_OR_DATA:JA,MUSTACHE_EXPR:VA,TMPLIT_EXPR:jA}),ca={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ew=function(){return typeof window>"u"?null:window},tw=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(r=t.getAttribute(o));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},yC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function NC(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ew(),e=J=>NC(J);if(e.version="3.3.1",e.removed=[],!n||!n.document||n.document.nodeType!==ca.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n,r=t,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:i,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:g}=n,f=l.prototype,p=la(f,"cloneNode"),m=la(f,"remove"),_=la(f,"nextSibling"),C=la(f,"childNodes"),x=la(f,"parentNode");if(typeof i=="function"){let J=t.createElement("template");J.content&&J.content.ownerDocument&&(t=J.content.ownerDocument)}let y,S="",{implementation:b,createNodeIterator:N,createDocumentFragment:A,getElementsByTagName:O}=t,{importNode:P}=r,I=yC();e.isSupported=typeof bC=="function"&&typeof x=="function"&&b&&b.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:z,ERB_EXPR:G,TMPLIT_EXPR:q,DATA_ATTR:K,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:ie,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:xe}=xC,{IS_ALLOWED_URI:ht}=xC,fe=null,Wt=ce({},[...pC,...Ag,...wg,...vg,...mC]),ke=null,kt=ce({},[..._C,...Og,...CC,...hc]),ge=Object.seal(kg(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}})),Qe=null,en=null,ne=Object.seal(kg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ue=!0,Ve=!0,Qi=!1,Vs=!0,fn=!1,Qr=!0,Cr=!1,tn=!1,ea=!1,eo=!1,to=!1,no=!1,rc=!0,J_=!1,CA="user-content-",pg=!0,ta=!1,Ys={},Un=null,mg=ce({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),X_=null,Q_=ce({},["audio","video","img","source","image","track"]),_g=null,eC=ce({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oc="http://www.w3.org/1998/Math/MathML",sc="http://www.w3.org/2000/svg",xr="http://www.w3.org/1999/xhtml",js=xr,Cg=!1,xg=null,xA=ce({},[oc,sc,xr],Ng),ic=ce({},["mi","mo","mn","ms","mtext"]),ac=ce({},["annotation-xml"]),yA=ce({},["title","style","font","a","script"]),na=null,bA=["application/xhtml+xml","text/html"],SA="text/html",et=null,qs=null,TA=t.createElement("form"),tC=function(E){return E instanceof RegExp||E instanceof Function},yg=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(qs&&qs===E)){if((!E||typeof E!="object")&&(E={}),E=Gn(E),na=bA.indexOf(E.PARSER_MEDIA_TYPE)===-1?SA:E.PARSER_MEDIA_TYPE,et=na==="application/xhtml+xml"?Ng:gc,fe=Tn(E,"ALLOWED_TAGS")?ce({},E.ALLOWED_TAGS,et):Wt,ke=Tn(E,"ALLOWED_ATTR")?ce({},E.ALLOWED_ATTR,et):kt,xg=Tn(E,"ALLOWED_NAMESPACES")?ce({},E.ALLOWED_NAMESPACES,Ng):xA,_g=Tn(E,"ADD_URI_SAFE_ATTR")?ce(Gn(eC),E.ADD_URI_SAFE_ATTR,et):eC,X_=Tn(E,"ADD_DATA_URI_TAGS")?ce(Gn(Q_),E.ADD_DATA_URI_TAGS,et):Q_,Un=Tn(E,"FORBID_CONTENTS")?ce({},E.FORBID_CONTENTS,et):mg,Qe=Tn(E,"FORBID_TAGS")?ce({},E.FORBID_TAGS,et):Gn({}),en=Tn(E,"FORBID_ATTR")?ce({},E.FORBID_ATTR,et):Gn({}),Ys=Tn(E,"USE_PROFILES")?E.USE_PROFILES:!1,Ue=E.ALLOW_ARIA_ATTR!==!1,Ve=E.ALLOW_DATA_ATTR!==!1,Qi=E.ALLOW_UNKNOWN_PROTOCOLS||!1,Vs=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fn=E.SAFE_FOR_TEMPLATES||!1,Qr=E.SAFE_FOR_XML!==!1,Cr=E.WHOLE_DOCUMENT||!1,eo=E.RETURN_DOM||!1,to=E.RETURN_DOM_FRAGMENT||!1,no=E.RETURN_TRUSTED_TYPE||!1,ea=E.FORCE_BODY||!1,rc=E.SANITIZE_DOM!==!1,J_=E.SANITIZE_NAMED_PROPS||!1,pg=E.KEEP_CONTENT!==!1,ta=E.IN_PLACE||!1,ht=E.ALLOWED_URI_REGEXP||SC,js=E.NAMESPACE||xr,ic=E.MATHML_TEXT_INTEGRATION_POINTS||ic,ac=E.HTML_INTEGRATION_POINTS||ac,ge=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&tC(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ge.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&tC(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ge.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ge.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),fn&&(Ve=!1),to&&(eo=!0),Ys&&(fe=ce({},mC),ke=[],Ys.html===!0&&(ce(fe,pC),ce(ke,_C)),Ys.svg===!0&&(ce(fe,Ag),ce(ke,Og),ce(ke,hc)),Ys.svgFilters===!0&&(ce(fe,wg),ce(ke,Og),ce(ke,hc)),Ys.mathMl===!0&&(ce(fe,vg),ce(ke,CC),ce(ke,hc))),E.ADD_TAGS&&(typeof E.ADD_TAGS=="function"?ne.tagCheck=E.ADD_TAGS:(fe===Wt&&(fe=Gn(fe)),ce(fe,E.ADD_TAGS,et))),E.ADD_ATTR&&(typeof E.ADD_ATTR=="function"?ne.attributeCheck=E.ADD_ATTR:(ke===kt&&(ke=Gn(ke)),ce(ke,E.ADD_ATTR,et))),E.ADD_URI_SAFE_ATTR&&ce(_g,E.ADD_URI_SAFE_ATTR,et),E.FORBID_CONTENTS&&(Un===mg&&(Un=Gn(Un)),ce(Un,E.FORBID_CONTENTS,et)),E.ADD_FORBID_CONTENTS&&(Un===mg&&(Un=Gn(Un)),ce(Un,E.ADD_FORBID_CONTENTS,et)),pg&&(fe["#text"]=!0),Cr&&ce(fe,["html","head","body"]),fe.table&&(ce(fe,["tbody"]),delete Qe.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw aa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw aa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=E.TRUSTED_TYPES_POLICY,S=y.createHTML("")}else y===void 0&&(y=tw(g,o)),y!==null&&typeof S=="string"&&(S=y.createHTML(""));Mt&&Mt(E),qs=E}},nC=ce({},[...Ag,...wg,...WA]),rC=ce({},[...vg,...GA]),NA=function(E){let $=x(E);(!$||!$.tagName)&&($={namespaceURI:js,tagName:"template"});let V=gc(E.tagName),$e=gc($.tagName);return xg[E.namespaceURI]?E.namespaceURI===sc?$.namespaceURI===xr?V==="svg":$.namespaceURI===oc?V==="svg"&&($e==="annotation-xml"||ic[$e]):Boolean(nC[V]):E.namespaceURI===oc?$.namespaceURI===xr?V==="math":$.namespaceURI===sc?V==="math"&&ac[$e]:Boolean(rC[V]):E.namespaceURI===xr?$.namespaceURI===sc&&!ac[$e]||$.namespaceURI===oc&&!ic[$e]?!1:!rC[V]&&(yA[V]||!nC[V]):!!(na==="application/xhtml+xml"&&xg[E.namespaceURI]):!1},Wn=function(E){sa(e.removed,{element:E});try{x(E).removeChild(E)}catch{m(E)}},Jo=function(E,$){try{sa(e.removed,{attribute:$.getAttributeNode(E),from:$})}catch{sa(e.removed,{attribute:null,from:$})}if($.removeAttribute(E),E==="is")if(eo||to)try{Wn($)}catch{}else try{$.setAttribute(E,"")}catch{}},oC=function(E){let $=null,V=null;if(ea)E="<remove></remove>"+E;else{let qe=Eg(E,/^[\r\n\t ]+/);V=qe&&qe[0]}na==="application/xhtml+xml"&&js===xr&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");let $e=y?y.createHTML(E):E;if(js===xr)try{$=new h().parseFromString($e,na)}catch{}if(!$||!$.documentElement){$=b.createDocument(js,"template",null);try{$.documentElement.innerHTML=Cg?S:$e}catch{}}let St=$.body||$.documentElement;return E&&V&&St.insertBefore(t.createTextNode(V),St.childNodes[0]||null),js===xr?O.call($,Cr?"html":"body")[0]:Cr?$.documentElement:St},sC=function(E){return N.call(E.ownerDocument||E,E,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bg=function(E){return E instanceof d&&(typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof u)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},iC=function(E){return typeof a=="function"&&E instanceof a};function yr(J,E,$){dc(J,V=>{V.call(e,E,$,qs)})}let aC=function(E){let $=null;if(yr(I.beforeSanitizeElements,E,null),bg(E))return Wn(E),!0;let V=et(E.nodeName);if(yr(I.uponSanitizeElement,E,{tagName:V,allowedTags:fe}),Qr&&E.hasChildNodes()&&!iC(E.firstElementChild)&&Rt(/<[/\w!]/g,E.innerHTML)&&Rt(/<[/\w!]/g,E.textContent)||E.nodeType===ca.progressingInstruction||Qr&&E.nodeType===ca.comment&&Rt(/<[/\w]/g,E.data))return Wn(E),!0;if(!(ne.tagCheck instanceof Function&&ne.tagCheck(V))&&(!fe[V]||Qe[V])){if(!Qe[V]&&cC(V)&&(ge.tagNameCheck instanceof RegExp&&Rt(ge.tagNameCheck,V)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(V)))return!1;if(pg&&!Un[V]){let $e=x(E)||E.parentNode,St=C(E)||E.childNodes;if(St&&$e){let qe=St.length;for(let Gt=qe-1;Gt>=0;--Gt){let br=p(St[Gt],!0);br.__removalCount=(E.__removalCount||0)+1,$e.insertBefore(br,_(E))}}}return Wn(E),!0}return E instanceof l&&!NA(E)||(V==="noscript"||V==="noembed"||V==="noframes")&&Rt(/<\/no(script|embed|frames)/i,E.innerHTML)?(Wn(E),!0):(fn&&E.nodeType===ca.text&&($=E.textContent,dc([z,G,q],$e=>{$=ia($,$e," ")}),E.textContent!==$&&(sa(e.removed,{element:E.cloneNode()}),E.textContent=$)),yr(I.afterSanitizeElements,E,null),!1)},lC=function(E,$,V){if(rc&&($==="id"||$==="name")&&(V in t||V in TA))return!1;if(!(Ve&&!en[$]&&Rt(K,$))){if(!(Ue&&Rt(le,$))){if(!(ne.attributeCheck instanceof Function&&ne.attributeCheck($,E))){if(!ke[$]||en[$]){if(!(cC(E)&&(ge.tagNameCheck instanceof RegExp&&Rt(ge.tagNameCheck,E)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(E))&&(ge.attributeNameCheck instanceof RegExp&&Rt(ge.attributeNameCheck,$)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck($,E))||$==="is"&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&Rt(ge.tagNameCheck,V)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(V))))return!1}else if(!_g[$]){if(!Rt(ht,ia(V,pe,""))){if(!(($==="src"||$==="xlink:href"||$==="href")&&E!=="script"&&HA(V,"data:")===0&&X_[E])){if(!(Qi&&!Rt(ie,ia(V,pe,"")))){if(V)return!1}}}}}}}return!0},cC=function(E){return E!=="annotation-xml"&&Eg(E,xe)},uC=function(E){yr(I.beforeSanitizeAttributes,E,null);let{attributes:$}=E;if(!$||bg(E))return;let V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke,forceKeepAttr:void 0},$e=$.length;for(;$e--;){let St=$[$e],{name:qe,namespaceURI:Gt,value:br}=St,Zs=et(qe),Sg=br,gt=qe==="value"?Sg:zA(Sg);if(V.attrName=Zs,V.attrValue=gt,V.keepAttr=!0,V.forceKeepAttr=void 0,yr(I.uponSanitizeAttribute,E,V),gt=V.attrValue,J_&&(Zs==="id"||Zs==="name")&&(Jo(qe,E),gt=CA+gt),Qr&&Rt(/((--!?|])>)|<\/(style|title|textarea)/i,gt)){Jo(qe,E);continue}if(Zs==="attributename"&&Eg(gt,"href")){Jo(qe,E);continue}if(V.forceKeepAttr)continue;if(!V.keepAttr){Jo(qe,E);continue}if(!Vs&&Rt(/\/>/i,gt)){Jo(qe,E);continue}fn&&dc([z,G,q],hC=>{gt=ia(gt,hC," ")});let dC=et(E.nodeName);if(!lC(dC,Zs,gt)){Jo(qe,E);continue}if(y&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Gt)switch(g.getAttributeType(dC,Zs)){case"TrustedHTML":{gt=y.createHTML(gt);break}case"TrustedScriptURL":{gt=y.createScriptURL(gt);break}}if(gt!==Sg)try{Gt?E.setAttributeNS(Gt,qe,gt):E.setAttribute(qe,gt),bg(E)?Wn(E):fC(e.removed)}catch{Jo(qe,E)}}yr(I.afterSanitizeAttributes,E,null)},EA=function J(E){let $=null,V=sC(E);for(yr(I.beforeSanitizeShadowDOM,E,null);$=V.nextNode();)yr(I.uponSanitizeShadowNode,$,null),aC($),uC($),$.content instanceof s&&J($.content);yr(I.afterSanitizeShadowDOM,E,null)};return e.sanitize=function(J){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,V=null,$e=null,St=null;if(Cg=!J,Cg&&(J="<!-->"),typeof J!="string"&&!iC(J))if(typeof J.toString=="function"){if(J=J.toString(),typeof J!="string")throw aa("dirty is not a string, aborting")}else throw aa("toString is not a function");if(!e.isSupported)return J;if(tn||yg(E),e.removed=[],typeof J=="string"&&(ta=!1),ta){if(J.nodeName){let br=et(J.nodeName);if(!fe[br]||Qe[br])throw aa("root node is forbidden and cannot be sanitized in-place")}}else if(J instanceof a)$=oC("<!---->"),V=$.ownerDocument.importNode(J,!0),V.nodeType===ca.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?$=V:$.appendChild(V);else{if(!eo&&!fn&&!Cr&&J.indexOf("<")===-1)return y&&no?y.createHTML(J):J;if($=oC(J),!$)return eo?null:no?S:""}$&&ea&&Wn($.firstChild);let qe=sC(ta?J:$);for(;$e=qe.nextNode();)aC($e),uC($e),$e.content instanceof s&&EA($e.content);if(ta)return J;if(eo){if(to)for(St=A.call($.ownerDocument);$.firstChild;)St.appendChild($.firstChild);else St=$;return(ke.shadowroot||ke.shadowrootmode)&&(St=P.call(r,St,!0)),St}let Gt=Cr?$.outerHTML:$.innerHTML;return Cr&&fe["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Rt(TC,$.ownerDocument.doctype.name)&&(Gt="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
`+Gt),fn&&dc([z,G,q],br=>{Gt=ia(Gt,br," ")}),y&&no?y.createHTML(Gt):Gt},e.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yg(J),tn=!0},e.clearConfig=function(){qs=null,tn=!1},e.isValidAttribute=function(J,E,$){qs||yg({});let V=et(J),$e=et(E);return lC(V,$e,$)},e.addHook=function(J,E){typeof E=="function"&&sa(I[J],E)},e.removeHook=function(J,E){if(E!==void 0){let $=FA(I[J],E);return $===-1?void 0:BA(I[J],$,1)[0]}return fC(I[J])},e.removeHooks=function(J){I[J]=[]},e.removeAllHooks=function(){I=yC()},e}var fc=NC();var Xf={};Lt(Xf,{$addUpdateTag:()=>Py,$applyNodeReplacement:()=>Ma,$caretFromPoint:()=>mo,$caretRangeFromSelection:()=>mf,$cloneWithProperties:()=>Gf,$cloneWithPropertiesEphemeral:()=>Iv,$comparePointCaretNext:()=>qf,$copyNode:()=>Uf,$create:()=>Pv,$createLineBreakNode:()=>oi,$createNodeSelection:()=>vf,$createParagraphNode:()=>Or,$createPoint:()=>On,$createRangeSelection:()=>my,$createRangeSelectionFromDom:()=>cv,$createTabNode:()=>Kc,$createTextNode:()=>st,$extendCaretToRange:()=>Yf,$findMatchingParent:()=>_a,$getAdjacentChildCaret:()=>ai,$getAdjacentNode:()=>Iy,$getAdjacentSiblingOrParentSiblingCaret:()=>Gv,$getCaretInDirection:()=>_o,$getCaretRange:()=>po,$getCaretRangeInDirection:()=>Jf,$getCharacterOffsets:()=>uf,$getChildCaret:()=>$r,$getChildCaretAtIndex:()=>Jy,$getChildCaretOrSelf:()=>Vy,$getCollapsedCaretRange:()=>Yy,$getCommonAncestor:()=>Ca,$getCommonAncestorResultBranchOrder:()=>Zf,$getEditor:()=>Wf,$getNearestNodeFromDOMNode:()=>jc,$getNearestRootOrShadowRoot:()=>By,$getNodeByKey:()=>nt,$getNodeByKeyOrThrow:()=>Hy,$getNodeFromDOMNode:()=>$f,$getPreviousSelection:()=>us,$getRoot:()=>sn,$getSelection:()=>me,$getSiblingCaret:()=>dt,$getState:()=>Nc,$getStateChange:()=>Dw,$getTextContent:()=>hv,$getTextNodeOffset:()=>vn,$getTextPointCaret:()=>fo,$getTextPointCaretSlice:()=>pf,$getWritableNodeState:()=>xf,$hasAncestor:()=>Fc,$hasUpdateTag:()=>kv,$insertNodes:()=>dv,$isBlockElementNode:()=>lv,$isChildCaret:()=>wn,$isDecoratorNode:()=>Me,$isEditorState:()=>mv,$isElementNode:()=>M,$isExtendableTextPointCaret:()=>Zy,$isInlineElementOrDecoratorNode:()=>Lv,$isLeafNode:()=>wv,$isLineBreakNode:()=>es,$isNodeCaret:()=>Hv,$isNodeSelection:()=>Uc,$isParagraphNode:()=>Ty,$isRangeSelection:()=>Q,$isRootNode:()=>ut,$isRootOrShadowRoot:()=>kn,$isSiblingCaret:()=>cs,$isTabNode:()=>wf,$isTextNode:()=>Y,$isTextPointCaret:()=>Lr,$isTextPointCaretSlice:()=>Wv,$isTokenOrSegmented:()=>Er,$isTokenOrTab:()=>so,$nodesOfType:()=>Ov,$normalizeCaret:()=>En,$normalizeSelection__EXPERIMENTAL:()=>Ec,$onUpdate:()=>Fy,$parseSerializedNode:()=>pv,$removeTextFromCaretRange:()=>qy,$rewindSiblingCaret:()=>di,$selectAll:()=>vv,$setCompositionKey:()=>at,$setPointFromCaret:()=>li,$setSelection:()=>Yt,$setSelectionFromCaretRange:()=>jy,$setState:()=>Iw,$splitAtPointCaretNext:()=>jv,$splitNode:()=>Rv,$updateRangeSelectionFromCaretRange:()=>xa,ArtificialNode__DO_NOT_USE:()=>Ic,BLUR_COMMAND:()=>Zx,CAN_REDO_COMMAND:()=>Yw,CAN_UNDO_COMMAND:()=>jw,CLEAR_EDITOR_COMMAND:()=>Gw,CLEAR_HISTORY_COMMAND:()=>Vw,CLICK_COMMAND:()=>Rx,COLLABORATION_TAG:()=>ay,COMMAND_PRIORITY_CRITICAL:()=>Sv,COMMAND_PRIORITY_EDITOR:()=>Cv,COMMAND_PRIORITY_HIGH:()=>bv,COMMAND_PRIORITY_LOW:()=>xv,COMMAND_PRIORITY_NORMAL:()=>yv,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ei,COPY_COMMAND:()=>Nf,CUT_COMMAND:()=>Ef,DELETE_CHARACTER_COMMAND:()=>Ea,DELETE_LINE_COMMAND:()=>wa,DELETE_WORD_COMMAND:()=>Aa,DRAGEND_COMMAND:()=>jx,DRAGOVER_COMMAND:()=>Yx,DRAGSTART_COMMAND:()=>Vx,DROP_COMMAND:()=>Gx,DecoratorNode:()=>va,ElementNode:()=>uo,FOCUS_COMMAND:()=>qx,FORMAT_ELEMENT_COMMAND:()=>Ww,FORMAT_TEXT_COMMAND:()=>ro,HISTORIC_TAG:()=>Jw,HISTORY_MERGE_TAG:()=>bc,HISTORY_PUSH_TAG:()=>Xw,INDENT_CONTENT_COMMAND:()=>Kw,INSERT_LINE_BREAK_COMMAND:()=>ga,INSERT_PARAGRAPH_COMMAND:()=>ef,INSERT_TAB_COMMAND:()=>zw,INTERNAL_$isBlock:()=>vr,IS_ALL_FORMATTING:()=>fw,IS_BOLD:()=>aw,IS_CODE:()=>dw,IS_HIGHLIGHT:()=>_f,IS_ITALIC:()=>lw,IS_STRIKETHROUGH:()=>cw,IS_SUBSCRIPT:()=>hw,IS_SUPERSCRIPT:()=>gw,IS_UNDERLINE:()=>uw,KEY_ARROW_DOWN_COMMAND:()=>Bx,KEY_ARROW_LEFT_COMMAND:()=>$x,KEY_ARROW_RIGHT_COMMAND:()=>Dx,KEY_ARROW_UP_COMMAND:()=>Fx,KEY_BACKSPACE_COMMAND:()=>zx,KEY_DELETE_COMMAND:()=>Ux,KEY_DOWN_COMMAND:()=>Mx,KEY_ENTER_COMMAND:()=>kc,KEY_ESCAPE_COMMAND:()=>Kx,KEY_MODIFIER_COMMAND:()=>Jx,KEY_SPACE_COMMAND:()=>Hx,KEY_TAB_COMMAND:()=>Wx,LineBreakNode:()=>lo,MOVE_TO_END:()=>Ix,MOVE_TO_START:()=>Px,NODE_STATE_KEY:()=>vw,OUTDENT_CONTENT_COMMAND:()=>Uw,PASTE_COMMAND:()=>bf,PASTE_TAG:()=>Qw,ParagraphNode:()=>go,REDO_COMMAND:()=>Tf,REMOVE_TEXT_COMMAND:()=>tf,RootNode:()=>ho,SELECTION_CHANGE_COMMAND:()=>yf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>Hw,SELECT_ALL_COMMAND:()=>nf,SKIP_COLLAB_TAG:()=>ev,SKIP_DOM_SELECTION_TAG:()=>cy,SKIP_SCROLL_INTO_VIEW_TAG:()=>ly,SKIP_SELECTION_FOCUS_TAG:()=>uy,TEXT_TYPE_TO_FORMAT:()=>Tt,TabNode:()=>co,TextNode:()=>Rr,UNDO_COMMAND:()=>Sf,buildImportMap:()=>Zw,configExtension:()=>Zv,createCommand:()=>re,createEditor:()=>Tv,createSharedNodeState:()=>Ax,createState:()=>Mw,declarePeerDependency:()=>Jv,defineExtension:()=>qv,flipDirection:()=>Co,getDOMOwnerDocument:()=>zf,getDOMSelection:()=>jn,getDOMSelectionFromTarget:()=>zy,getDOMTextNode:()=>is,getEditorPropertyFromDOMNode:()=>La,getNearestEditorFromDOMNode:()=>If,getRegisteredNode:()=>Mf,getRegisteredNodeOrThrow:()=>Rf,getStaticNodeConfig:()=>Da,getTextDirection:()=>Av,getTransformSetFromKlass:()=>Ey,isBlockDomNode:()=>gf,isCurrentlyReadOnlyMode:()=>ci,isDOMDocumentNode:()=>wy,isDOMNode:()=>ui,isDOMTextNode:()=>qn,isDOMUnmanaged:()=>Gy,isDocumentFragment:()=>Ky,isExactShortcutMatch:()=>Ne,isHTMLAnchorElement:()=>Mv,isHTMLElement:()=>It,isInlineDomNode:()=>Uy,isLexicalEditor:()=>Vc,isModifierMatch:()=>Dy,isSelectionCapturedInDecoratorInput:()=>Df,isSelectionWithinEditor:()=>ka,makeStepwiseIterator:()=>jf,removeFromParent:()=>io,resetRandomKey:()=>Nv,safeCast:()=>Xv,setDOMUnmanaged:()=>$v,setNodeIndentFromDOM:()=>Wy,shallowMergeConfig:()=>Qv});function D(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function _x(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Ln=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,nw=Ln&&"documentMode"in document?document.documentMode:null,Nn=Ln&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ns=Ln&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tc=!(!Ln||!("InputEvent"in window)||nw)&&"getTargetRanges"in new window.InputEvent("input"),ya=Ln&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ri=Ln&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,rw=Ln&&/Android/.test(navigator.userAgent),Cx=Ln&&/^(?=.*Chrome).*/i.test(navigator.userAgent),EC=Ln&&rw&&Cx,ba=Ln&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Nn&&!Cx;function xx(...n){let e=[];for(let t of n)if(t&&typeof t=="string")for(let[r]of t.matchAll(/\S+/g))e.push(r);return e}var ow=0,sw=1,iw=2,aw=1,lw=2,cw=4,uw=8,dw=16,hw=32,gw=64,_f=128,fw=2047,pw=1,mw=2,_w=3,Cw=4,xw=5,yw=6,Hc=ya||ri||ba?"\xA0":"\u200B",ao=`
`,bw=ns?"\xA0":Hc,yx="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",bx="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Sw=new RegExp("^[^"+bx+"]*["+yx+"]"),Tw=new RegExp("^[^"+yx+"]*["+bx+"]"),Tt={bold:1,capitalize:1024,code:16,highlight:_f,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Nw={directionless:1,unmergeable:2},AC={center:2,end:6,justify:4,left:1,right:3,start:5},Ew={[mw]:"center",[yw]:"end",[Cw]:"justify",[pw]:"left",[_w]:"right",[xw]:"start"},Aw={normal:0,segmented:2,token:1},ww={[ow]:"normal",[iw]:"segmented",[sw]:"token"},vw="$",wC="$config";function Sx(n,e,t,r,o,s){let i=n.getFirstChild();for(;i!==null;){let a=i.__key;i.__parent===e&&(M(i)&&Sx(i,a,t,r,o,s),t.has(a)||s.delete(a),o.push(a)),i=i.getNextSibling()}}var Gg=!1,Cf=0;function Ow(n){Cf=n.timeStamp}function Mg(n,e,t){let r=n.nodeName==="BR",o=e.__lexicalLineBreak;return o&&(n===o||r&&n.previousSibling===o)||r&&Yc(n,t)!==void 0}function kw(n,e,t){let r=jn(mn(t)),o=null,s=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,s=r.focusOffset);let i=n.nodeValue;i!==null&&Bf(e,i,o,s,!1)}function Lw(n,e,t){if(Q(n)){let r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return qn(e)&&t.isAttached()}function Rw(n,e,t,r){for(let o=n;o&&!Gy(o);o=Ra(o)){let s=Yc(o,e);if(s!==void 0){let i=nt(s,t);if(i)return Me(i)||!It(o)?void 0:[o,i]}else if(o===r)return[r,ky(t)]}}function Tx(n,e,t){Gg=!0;let r=performance.now()-Cf>100;try{rn(n,()=>{let o=me()||function(h){return h.getEditorState().read(()=>{let g=me();return g!==null?g.clone():null})}(n),s=new Map,i=n.getRootElement(),a=n._editorState,l=n._blockCursorElement,c=!1,u="";for(let h=0;h<e.length;h++){let g=e[h],f=g.type,p=g.target,m=Rw(p,n,a,i);if(!m)continue;let[_,C]=m;if(f==="characterData")r&&Y(C)&&qn(p)&&Lw(o,p,C)&&kw(p,C,n);else if(f==="childList"){c=!0;let x=g.addedNodes;for(let b=0;b<x.length;b++){let N=x[b],A=$f(N),O=N.parentNode;if(O!=null&&N!==l&&A===null&&!Mg(N,O,n)){if(ns){let P=(It(N)?N.innerText:null)||N.nodeValue;P&&(u+=P)}O.removeChild(N)}}let y=g.removedNodes,S=y.length;if(S>0){let b=0;for(let N=0;N<S;N++){let A=y[N];(Mg(A,p,n)||l===A)&&(p.appendChild(A),b++)}S!==b&&s.set(_,C)}}}if(s.size>0)for(let[h,g]of s)g.reconcileObservedMutation(h,n);let d=t.takeRecords();if(d.length>0){for(let h=0;h<d.length;h++){let g=d[h],f=g.addedNodes,p=g.target;for(let m=0;m<f.length;m++){let _=f[m],C=_.parentNode;C==null||_.nodeName!=="BR"||Mg(_,p,n)||C.removeChild(_)}}t.takeRecords()}o!==null&&(c&&Yt(o),ns&&$y(n)&&o.insertRawText(u))})}finally{Gg=!1}}function Nx(n){let e=n._observer;e!==null&&Tx(n,e.takeRecords(),e)}function Ex(n){(function(e){Cf===0&&mn(e).addEventListener("textInput",Ow,!0)})(n),n._observer=new MutationObserver((e,t)=>{Tx(n,e,t)})}var Vg=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||$w).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Mw(n,e){return new Vg(n,e)}function Nc(n,e,t="latest"){let r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function Dw(n,e,t){let r=Nc(n,t,"direct"),o=Nc(e,t,"direct");return t.isEqual(r,o)?null:[r,o]}function Iw(n,e,t){let r;if(it(),typeof t=="function"){let s=n.getLatest(),i=Nc(s,e);if(r=t(i),e.isEqual(i,r))return s}else r=t;let o=n.getWritable();return xf(o).updateFromKnown(e,r),o}function Ax(n){let e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:o}=Da(r);if(o&&o.stateConfigs)for(let s of o.stateConfigs){let i;"stateConfig"in s?(i=s.stateConfig,s.flat&&t.add(i.key)):i=s,e.set(i.key,i)}}return{flatKeys:t,sharedConfigMap:e}}var Sa=class{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,o=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=o;let{sharedConfigMap:i}=this.sharedNodeState,a=s!==void 0?s:function(l,c,u){let d=u.size;if(c)for(let h in c){let g=l.get(h);g&&u.has(g)||d++}return d}(i,r,o);this.size=a}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let o=this.unknownState[e.key];o!==void 0&&(r=e.parse(o)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(o);for(let r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return vC(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:r}=this,o=new Map(this.knownState);return new Sa(e,t,function(s,i,a){let l;if(a)for(let[c,u]of Object.entries(a)){let d=s.get(c);d?i.has(d)||i.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l}(t.sharedConfigMap,o,r),o,this.size)}updateFromKnown(e,t){let r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);let{knownState:o,unknownState:s}=this;o.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=vC(s)),this.size++),o.set(e,t)}updateFromUnknown(e,t){let r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[r,o]of Object.entries(e))this.updateFromUnknown(r,o)}};function xf(n){let e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Sa(e,wx(e));return e.__state=t,t}function wx(n){return n.__state?n.__state.sharedNodeState:Rf(Wf(),n.getType()).sharedNodeState}function vC(n){if(n)for(let e in n)return n}function $w(n){return n}function OC(n,e,t){for(let[r,o]of e.knownState){if(n.has(r.key))continue;n.add(r.key);let s=t?t.getValue(r):r.defaultValue;if(s!==o&&!r.isEqual(s,o))return!0}return!1}function kC(n,e,t){let{unknownState:r}=e,o=t?t.unknownState:void 0;if(r){for(let[s,i]of Object.entries(r))if(!n.has(s)&&(n.add(s),i!==(o?o[s]:void 0)))return!0}return!1}function LC(n,e){let t=n.__state;return t&&t.node===n?t.getWritable(e):t}function RC(n,e){let t=n.__mode,r=n.__format,o=n.__style,s=e.__mode,i=e.__format,a=e.__style,l=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===i)&&(o===null||o===a)&&(n.__state===null||l===c||function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;let h=new Set;return!(u&&OC(h,u,d)||d&&OC(h,d,u)||u&&kC(h,u,d)||d&&kC(h,d,u))}(l,c))}function MC(n,e){let t=n.mergeWithSibling(e),r=Pe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function DC(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&Y(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(RC(e,r)){r=MC(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&Y(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(RC(r,t)){r=MC(r,t);break}break}t.remove()}}else r.remove()}function Ec(n){return IC(n.anchor),IC(n.focus),n}function IC(n){for(;n.type==="element";){let e=n.getNode(),t=n.offset,r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),Y(r)){n.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!M(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}var rs,Nt,Ta,zc,Yg,jg,os,An,qg,Na,tt="",Vn=null,Yn="",Ar="",Js=!1,Ac=!1;function wc(n,e){let t=os.get(n);if(e!==null){let r=Qg(n);r.parentNode===e&&e.removeChild(r)}if(An.has(n)||Nt._keyToDOMMap.delete(n),M(t)){let r=Oc(t,os);Zg(r,0,r.length-1,null)}t!==void 0&&Hf(Na,Ta,zc,t,"destroyed")}function Zg(n,e,t,r){let o=e;for(;o<=t;++o){let s=n[o];s!==void 0&&wc(s,r)}}function Xo(n,e){n.setProperty("text-align",e)}var Pw="40px";function vx(n,e){let t=rs.theme.indent;if(typeof t=="string"){let o=n.classList.contains(t);e>0&&!o?n.classList.add(t):e<1&&o&&n.classList.remove(t)}let r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Pw;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Ox(n,e){let t=n.style;e===0?Xo(t,""):e===1?Xo(t,"left"):e===2?Xo(t,"center"):e===3?Xo(t,"right"):e===4?Xo(t,"justify"):e===5?Xo(t,"start"):e===6&&Xo(t,"end")}function Jg(n,e){let t=function(r){let o=r.__dir;if(o!==null)return o;if(ut(r))return null;let s=r.getParentOrThrow();return ut(s)&&s.__dir===null?"auto":null}(e);t!==null?n.dir=t:n.removeAttribute("dir")}function vc(n,e){let t=An.get(n);t===void 0&&D(60);let r=t.createDOM(rs,Nt);if(function(o,s,i){let a=i._keyToDOMMap;(function(l,c,u){let d=`__lexicalKey_${c._key}`;l[d]=u})(s,i,o),a.set(o,s)}(n,r,Nt),Y(t)?r.setAttribute("data-lexical-text","true"):Me(t)&&r.setAttribute("data-lexical-decorator","true"),M(t)){let o=t.__indent,s=t.__size;if(Jg(r,t),o!==0&&vx(r,o),s!==0){let a=s-1;Xg(Oc(t,An),t,0,a,t.getDOMSlot(r))}let i=t.__format;i!==0&&Ox(r,i),t.isInline()||kx(null,t,r),qc(t)&&(tt+=ao,Ar+=ao)}else{let o=t.getTextContent();if(Me(t)){let s=t.decorate(Nt,rs);s!==null&&Lx(n,s),r.contentEditable="false"}tt+=o,Ar+=o}return e!==null&&e.insertChild(r),Hf(Na,Ta,zc,t,"created"),r}function Xg(n,e,t,r,o){let s=tt;tt="";let i=t;for(;i<=r;++i){vc(n[i],o);let a=An.get(n[i]);a!==null&&Y(a)&&(Vn===null&&(Vn=a.getFormat()),Yn===""&&(Yn=a.getStyle()))}qc(e)&&(tt+=ao),o.element.__lexicalTextContent=tt,tt=s+tt}function $C(n,e){if(n){let t=n.__last;if(t){let r=e.get(t);if(r)return es(r)?"line-break":Me(r)&&r.isInline()?"decorator":null}return"empty"}return null}function kx(n,e,t){let r=$C(n,os),o=$C(e,An);r!==o&&e.getDOMSlot(t).setManagedLineBreak(o)}function Fw(n,e,t){var r;Vn=null,Yn="",function(o,s,i){let a=tt,l=o.__size,c=s.__size;tt="";let u=i.element;if(l===1&&c===1){let d=o.__first,h=s.__first;if(d===h)ha(d,u);else{let f=Qg(d),p=vc(h,null);try{u.replaceChild(p,f)}catch(m){if(typeof m=="object"&&m!=null){let _=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${h}}, old child: {tag: ${f.tagName}, key: ${d}}.`;throw new Error(_)}throw m}wc(d,null)}let g=An.get(h);Y(g)&&(Vn===null&&(Vn=g.getFormat()),Yn===""&&(Yn=g.getStyle()))}else{let d=Oc(o,os),h=Oc(s,An);if(d.length!==l&&D(227),h.length!==c&&D(228),l===0)c!==0&&Xg(h,s,0,c-1,i);else if(c===0){if(l!==0){let g=i.after==null&&i.before==null&&i.element.__lexicalLineBreak==null;Zg(d,0,l-1,g?null:u),g&&(u.textContent="")}}else(function(g,f,p,m,_,C){let x=m-1,y=_-1,S,b,N=C.getFirstChild(),A=0,O=0;for(;A<=x&&O<=y;){let z=f[A],G=p[O];if(z===G)N=Dg(ha(G,C.element)),A++,O++;else{S===void 0&&(S=new Set(f)),b===void 0&&(b=new Set(p));let K=b.has(z),le=S.has(G);if(K)if(le){let ie=as(Nt,G);ie===N?N=Dg(ha(G,C.element)):(C.withBefore(N).insertChild(ie),ha(G,C.element)),A++,O++}else vc(G,C.withBefore(N)),O++;else N=Dg(Qg(z)),wc(z,C.element),A++}let q=An.get(G);q!==null&&Y(q)&&(Vn===null&&(Vn=q.getFormat()),Yn===""&&(Yn=q.getStyle()))}let P=A>x,I=O>y;if(P&&!I){let z=p[y+1],G=z===void 0?null:Nt.getElementByKey(z);Xg(p,g,O,y,C.withBefore(G))}else I&&!P&&Zg(f,A,x,C.element)})(s,d,h,l,c,i)}qc(s)&&(tt+=ao),u.__lexicalTextContent=tt,tt=a+tt}(n,e,e.getDOMSlot(t)),r=e,Vn==null||Vn===r.__textFormat||Ac||r.setTextFormat(Vn),function(o){Yn===""||Yn===o.__textStyle||Ac||o.setTextStyle(Yn)}(e)}function Oc(n,e){let t=[],r=n.__first;for(;r!==null;){let o=e.get(r);o===void 0&&D(101),t.push(r),r=o.__next}return t}function ha(n,e){let t=os.get(n),r=An.get(n);t!==void 0&&r!==void 0||D(61);let o=Js||jg.has(n)||Yg.has(n),s=as(Nt,n);if(t===r&&!o){if(M(t)){let i=s.__lexicalTextContent;i!==void 0&&(tt+=i,Ar+=i)}else{let i=t.getTextContent();Ar+=i,tt+=i}return s}if(t!==r&&o&&Hf(Na,Ta,zc,r,"updated"),r.updateDOM(t,s,rs)){let i=vc(n,null);return e===null&&D(62),e.replaceChild(i,s),wc(n,null),i}if(M(t)&&M(r)){let i=r.__indent;(Js||i!==t.__indent)&&vx(s,i);let a=r.__format;if((Js||a!==t.__format)&&Ox(s,a),o&&(Fw(t,r,s),ut(r)||r.isInline()||kx(t,r,s)),qc(r)&&(tt+=ao,Ar+=ao),(Js||r.__dir!==t.__dir)&&(Jg(s,r),ut(r)&&!Js))for(let l of r.getChildren())M(l)&&Jg(as(Nt,l.getKey()),l)}else{let i=r.getTextContent();if(Me(r)){let a=r.decorate(Nt,rs);a!==null&&Lx(n,a)}tt+=i,Ar+=i}if(!Ac&&ut(r)&&r.__cachedText!==Ar){let i=r.getWritable();i.__cachedText=Ar,r=i}return s}function Lx(n,e){let t=Nt._pendingDecorators,r=Nt._decorators;if(t===null){if(r[n]===e)return;t=Oy(Nt)}t[n]=e}function Dg(n){let e=n.nextSibling;return e!==null&&e===Nt._blockCursorElement&&(e=e.nextSibling),e}function Bw(n,e,t,r,o,s){tt="",Ar="",Js=r===2,Nt=t,rs=t._config,Ta=t._nodes,zc=Nt._listeners.mutation,Yg=o,jg=s,os=n._nodeMap,An=e._nodeMap,Ac=e._readOnly,qg=new Map(t._keyToDOMMap);let i=new Map;return Na=i,ha("root",null),Nt=void 0,Ta=void 0,Yg=void 0,jg=void 0,os=void 0,An=void 0,rs=void 0,qg=void 0,Na=void 0,i}function Qg(n){let e=qg.get(n);return e===void 0&&D(75,n),e}function re(n){return{type:n}}var yf=re("SELECTION_CHANGE_COMMAND"),Hw=re("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Rx=re("CLICK_COMMAND"),Ea=re("DELETE_CHARACTER_COMMAND"),ga=re("INSERT_LINE_BREAK_COMMAND"),ef=re("INSERT_PARAGRAPH_COMMAND"),ei=re("CONTROLLED_TEXT_INSERTION_COMMAND"),bf=re("PASTE_COMMAND"),tf=re("REMOVE_TEXT_COMMAND"),Aa=re("DELETE_WORD_COMMAND"),wa=re("DELETE_LINE_COMMAND"),ro=re("FORMAT_TEXT_COMMAND"),Sf=re("UNDO_COMMAND"),Tf=re("REDO_COMMAND"),Mx=re("KEYDOWN_COMMAND"),Dx=re("KEY_ARROW_RIGHT_COMMAND"),Ix=re("MOVE_TO_END"),$x=re("KEY_ARROW_LEFT_COMMAND"),Px=re("MOVE_TO_START"),Fx=re("KEY_ARROW_UP_COMMAND"),Bx=re("KEY_ARROW_DOWN_COMMAND"),kc=re("KEY_ENTER_COMMAND"),Hx=re("KEY_SPACE_COMMAND"),zx=re("KEY_BACKSPACE_COMMAND"),Kx=re("KEY_ESCAPE_COMMAND"),Ux=re("KEY_DELETE_COMMAND"),Wx=re("KEY_TAB_COMMAND"),zw=re("INSERT_TAB_COMMAND"),Kw=re("INDENT_CONTENT_COMMAND"),Uw=re("OUTDENT_CONTENT_COMMAND"),Gx=re("DROP_COMMAND"),Ww=re("FORMAT_ELEMENT_COMMAND"),Vx=re("DRAGSTART_COMMAND"),Yx=re("DRAGOVER_COMMAND"),jx=re("DRAGEND_COMMAND"),Nf=re("COPY_COMMAND"),Ef=re("CUT_COMMAND"),nf=re("SELECT_ALL_COMMAND"),Gw=re("CLEAR_EDITOR_COMMAND"),Vw=re("CLEAR_HISTORY_COMMAND"),Yw=re("CAN_REDO_COMMAND"),jw=re("CAN_UNDO_COMMAND"),qx=re("FOCUS_COMMAND"),Zx=re("BLUR_COMMAND"),Jx=re("KEY_MODIFIER_COMMAND"),Sr=Object.freeze({}),rf=[["keydown",function(n,e){if(fa=n.timeStamp,Xx=n.key,!e.isComposing()&&!H(e,Mx,n)&&n.key!=null){if(Ig&&dx(n))return rn(e,()=>{pc(e,$g)}),Ig=!1,void($g="");if(function(t){return Ne(t,"ArrowRight",{shiftKey:"any"})}(n))H(e,Dx,n);else if(function(t){return Ne(t,"ArrowRight",Nr)}(n))H(e,Ix,n);else if(function(t){return Ne(t,"ArrowLeft",{shiftKey:"any"})}(n))H(e,$x,n);else if(function(t){return Ne(t,"ArrowLeft",Nr)}(n))H(e,Px,n);else if(function(t){return Ne(t,"ArrowUp",{altKey:"any",shiftKey:"any"})}(n))H(e,Fx,n);else if(function(t){return Ne(t,"ArrowDown",{altKey:"any",shiftKey:"any"})}(n))H(e,Bx,n);else if(function(t){return Ne(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(n))pa=!0,H(e,kc,n);else if(function(t){return t.key===" "}(n))H(e,Hx,n);else if(function(t){return Nn&&Ne(t,"o",{ctrlKey:!0})}(n))n.preventDefault(),pa=!0,H(e,ga,!0);else if(function(t){return Ne(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(n))pa=!1,H(e,kc,n);else if(function(t){return Ne(t,"Backspace",{shiftKey:"any"})||Nn&&Ne(t,"h",{ctrlKey:!0})}(n))dx(n)?H(e,zx,n):(n.preventDefault(),H(e,Ea,!0));else if(function(t){return t.key==="Escape"}(n))H(e,Kx,n);else if(function(t){return Ne(t,"Delete",{})||Nn&&Ne(t,"d",{ctrlKey:!0})}(n))(function(t){return t.key==="Delete"})(n)?H(e,Ux,n):(n.preventDefault(),H(e,Ea,!1));else if(function(t){return Ne(t,"Backspace",ux)}(n))n.preventDefault(),H(e,Aa,!0);else if(function(t){return Ne(t,"Delete",ux)}(n))n.preventDefault(),H(e,Aa,!1);else if(function(t){return Nn&&Ne(t,"Backspace",{metaKey:!0})}(n))n.preventDefault(),H(e,wa,!0);else if(function(t){return Nn&&(Ne(t,"Delete",{metaKey:!0})||Ne(t,"k",{ctrlKey:!0}))}(n))n.preventDefault(),H(e,wa,!1);else if(function(t){return Ne(t,"b",Nr)}(n))n.preventDefault(),H(e,ro,"bold");else if(function(t){return Ne(t,"u",Nr)}(n))n.preventDefault(),H(e,ro,"underline");else if(function(t){return Ne(t,"i",Nr)}(n))n.preventDefault(),H(e,ro,"italic");else if(function(t){return Ne(t,"Tab",{shiftKey:"any"})}(n))H(e,Wx,n);else if(function(t){return Ne(t,"z",Nr)}(n))n.preventDefault(),H(e,Sf,void 0);else if(function(t){return Nn?Ne(t,"z",{metaKey:!0,shiftKey:!0}):Ne(t,"y",{ctrlKey:!0})||Ne(t,"z",{ctrlKey:!0,shiftKey:!0})}(n))n.preventDefault(),H(e,Tf,void 0);else{let t=e._editorState._selection;t===null||Q(t)?hx(n)&&(n.preventDefault(),H(e,nf,n)):function(r){return Ne(r,"c",Nr)}(n)?(n.preventDefault(),H(e,Nf,n)):function(r){return Ne(r,"x",Nr)}(n)?(n.preventDefault(),H(e,Ef,n)):hx(n)&&(n.preventDefault(),H(e,nf,n))}(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&H(e,Jx,n)}}],["pointerdown",function(n,e){let t=n.target,r=n.pointerType;ui(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&rn(e,()=>{ax(t)||(af=!0)})}],["compositionstart",function(n,e){rn(e,()=>{let t=me();if(Q(t)&&!e.isComposing()){let r=t.anchor,o=t.anchor.getNode();at(r.key),(n.timeStamp<fa+30||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||Y(o)&&o.getStyle()!==t.style)&&H(e,ei,bw)}})}],["compositionend",function(n,e){ns?ua=!0:ri||!ya&&!ba?rn(e,()=>{pc(e,n.data)}):(Ig=!0,$g=n.data)}],["input",function(n,e){n.stopPropagation(),rn(e,()=>{if(It(n.target)&&ax(n.target))return;let t=me(),r=n.data,o=ry(n);if(r!=null&&Q(t)&&ty(t,o,r,n.timeStamp,!1)){ua&&(pc(e,r),ua=!1);let s=t.anchor.getNode(),i=jn(mn(e));if(i===null)return;let a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;Tc&&!t.isCollapsed()&&Y(s)&&i.anchorNode!==null&&s.getTextContent().slice(0,l)+r+s.getTextContent().slice(l+c)===My(i.anchorNode)||H(e,ei,r);let u=r.length;ns&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),ya||ri||ba||!e.isComposing()||(fa=0,at(null))}else Ff(!1,e,r!==null?r:void 0),ua&&(pc(e,r||void 0),ua=!1);(function(){it();let s=Pe();Nx(s)})()},{event:n}),Xs=null}],["click",function(n,e){rn(e,()=>{let t=me(),r=jn(mn(e)),o=us();if(r){if(Q(t)){let s=t.anchor,i=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!ut(i)&&sn().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()){let a=_a(i,l=>M(l)&&!l.isInline());M(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){let s=r.anchorNode;(It(s)||qn(s))&&Yt(Wc(o,r,e,n))}}H(e,Rx,n)})}],["cut",Sr],["copy",Sr],["dragstart",Sr],["dragover",Sr],["dragend",Sr],["paste",Sr],["focus",Sr],["blur",Sr],["drop",Sr]];Tc&&rf.push(["beforeinput",(n,e)=>function(t,r){let o=t.inputType,s=ry(t);o==="deleteCompositionText"||ns&&$y(r)||o!=="insertCompositionText"&&rn(r,()=>{let i=me();if(o==="deleteContentBackward"){if(i===null){let g=us();if(!Q(g))return;Yt(g.clone())}if(Q(i)){let g=i.anchor.key===i.focus.key;if(a=t.timeStamp,Xx==="MediaLast"&&a<fa+30&&r.isComposing()&&g){if(at(null),fa=0,setTimeout(()=>{rn(r,()=>{at(null)})},30),Q(i)){let f=i.anchor.getNode();f.markDirty(),Y(f)||D(142),ny(i,f)}}else{at(null),t.preventDefault();let f=i.anchor.getNode(),p=f.getTextContent(),m=f.canInsertTextAfter(),_=i.anchor.offset===0&&i.focus.offset===p.length,C=EC&&g&&!_&&m;if(C&&i.isCollapsed()&&(C=!Me(Iy(i.anchor,!0))),!C){H(r,Ea,!0);let x=me();EC&&Q(x)&&x.isCollapsed()&&(Qo=x,setTimeout(()=>Qo=null))}}return}}var a;if(!Q(i))return;let l=t.data;Xs!==null&&Ff(!1,r,Xs),i.dirty&&Xs===null||!i.isCollapsed()||ut(i.anchor.getNode())||s===null||i.applyDOMRange(s),Xs=null;let c=i.anchor,u=i.focus,d=c.getNode(),h=u.getNode();if(o!=="insertText"&&o!=="insertTranspose")switch(t.preventDefault(),o){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":H(r,ei,t);break;case"insertFromComposition":at(null),H(r,ei,t);break;case"insertLineBreak":at(null),H(r,ga,!1);break;case"insertParagraph":at(null),pa&&!ri?(pa=!1,H(r,ga,!1)):H(r,ef,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":H(r,bf,t);break;case"deleteByComposition":(function(g,f){return g!==f||M(g)||M(f)||!so(g)||!so(f)})(d,h)&&H(r,tf,t);break;case"deleteByDrag":case"deleteByCut":H(r,tf,t);break;case"deleteContent":H(r,Ea,!1);break;case"deleteWordBackward":H(r,Aa,!0);break;case"deleteWordForward":H(r,Aa,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":H(r,wa,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":H(r,wa,!1);break;case"formatStrikeThrough":H(r,ro,"strikethrough");break;case"formatBold":H(r,ro,"bold");break;case"formatItalic":H(r,ro,"italic");break;case"formatUnderline":H(r,ro,"underline");break;case"historyUndo":H(r,Sf,void 0);break;case"historyRedo":H(r,Tf,void 0)}else{if(l===`
`)t.preventDefault(),H(r,ga,!1);else if(l===ao)t.preventDefault(),H(r,ef,void 0);else if(l==null&&t.dataTransfer){let g=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(g)}else l!=null&&ty(i,s,l,t.timeStamp,!0)?(t.preventDefault(),H(r,ei,l)):Xs=l;Qx=t.timeStamp}})}(n,e)]);var fa=0,Xx=null,Qx=0,Xs=null,of=new WeakMap,Lc=new WeakMap,sf=!1,af=!1,pa=!1,ua=!1,Ig=!1,$g="",Qo=null,ey=[0,"",0,"root",0];function ty(n,e,t,r,o){let s=n.anchor,i=n.focus,a=s.getNode(),l=Pe(),c=jn(mn(l)),u=c!==null?c.anchorNode:null,d=s.key,h=l.getElementByKey(d),g=t.length;return d!==i.key||!Y(a)||(!o&&(!Tc||Qx<r+50)||a.isDirty()&&g<2||Ly(t))&&s.offset!==i.offset&&!a.isComposing()||Er(a)||a.isDirty()&&g>1||(o||!Tc)&&h!==null&&!a.isComposing()&&u!==is(h)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||function(f,p){if(p.isSegmented())return!0;if(!f.isCollapsed())return!1;let m=f.anchor.offset,_=p.getParentOrThrow(),C=so(p);return m===0?!p.canInsertTextBefore()||!_.canInsertTextBefore()&&!p.isComposing()||C||function(x){let y=x.getPreviousSibling();return(Y(y)||M(y)&&y.isInline())&&!y.canInsertTextAfter()}(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!_.canInsertTextAfter()&&!p.isComposing()||C)}(n,a)}function PC(n,e){return qn(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function FC(n,e,t){let{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:i}=n;sf&&(sf=!1,PC(r,o)&&PC(s,i)&&!Qo)||rn(e,()=>{if(!t)return void Yt(null);if(!ka(e,r,s))return;let a=me();if(Qo&&Q(a)&&a.isCollapsed()){let l=a.anchor,c=Qo.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=Qo.clone(),Yt(a))}if(Qo=null,Q(a)){let l=a.anchor,c=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);let u=mn(e).event,d=u?u.timeStamp:performance.now(),[h,g,f,p,m]=ey,_=sn(),C=e.isComposing()===!1&&_.getTextContent()==="";if(d<m+200&&l.offset===f&&l.key===p)yc(a,h,g);else if(l.type==="text")Y(c)||D(141),ny(a,c);else if(l.type==="element"&&!C){M(c)||D(259);let x=l.getNode();x.isEmpty()?function(y,S){let b=S.getTextFormat(),N=S.getTextStyle();yc(y,b,N)}(a,x):yc(a,0,"")}}else{let u=l.key,d=a.focus.key,h=a.getNodes(),g=h.length,f=a.isBackward(),p=f?i:o,m=f?o:i,_=f?d:u,C=f?u:d,x=2047,y=!1;for(let S=0;S<g;S++){let b=h[S],N=b.getTextContentSize();if(Y(b)&&N!==0&&!(S===0&&b.__key===_&&p===N||S===g-1&&b.__key===C&&m===0)&&(y=!0,x&=b.getFormat(),x===0))break}a.format=y?x:0}}H(e,yf,void 0)})}function yc(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function ny(n,e){yc(n,e.getFormat(),e.getStyle())}function ry(n){if(!n.getTargetRanges)return null;let e=n.getTargetRanges();return e.length===0?null:e[0]}function pc(n,e){let t=n._compositionKey;if(at(null),t!==null&&e!=null){if(e===""){let r=nt(t),o=is(n.getElementByKey(t));return void(o!==null&&o.nodeValue!==null&&Y(r)&&Bf(r,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
`){let r=me();if(Q(r)){let o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void H(n,kc,null)}}}Ff(!0,n,e)}function oy(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}var ti=new Map;function sy(n){let e=zy(n.target);if(e===null)return;let t=If(e.anchorNode);if(t===null)return;af&&(af=!1,rn(t,()=>{let l=us(),c=e.anchorNode;(It(c)||qn(c))&&Yt(Wc(l,e,t,n))}));let r=Pf(t),o=r[r.length-1],s=o._key,i=ti.get(s),a=i||o;a!==t&&FC(e,a,!1),FC(e,t,!0),t!==o?ti.set(s,t):i&&ti.delete(s)}function BC(n){n._lexicalHandled=!0}function HC(n){return n._lexicalHandled===!0}var zC=()=>{};function qw(n){let e=of.get(n);if(e===void 0)return void zC();let t=Lc.get(e);if(t===void 0)return void zC();let r=t-1;r>=0||D(164),of.delete(n),Lc.set(e,r),r===0&&e.removeEventListener("selectionchange",sy);let o=La(n);Vc(o)?(function(i){if(i._parentEditor!==null){let a=Pf(i),l=a[a.length-1]._key;ti.get(l)===i&&ti.delete(l)}else ti.delete(i._key)}(o),n.__lexicalEditor=null):o&&D(198);let s=oy(n);for(let i=0;i<s.length;i++)s[i]();n.__lexicalEventHandles=[]}function lf(n,e,t){it();let r=n.__key,o=n.getParent();if(o===null)return;let s=function(a){let l=me();if(!Q(l)||!M(a))return l;let{anchor:c,focus:u}=l,d=c.getNode(),h=u.getNode();return Fc(d,a)&&c.set(a.__key,0,"element"),Fc(h,a)&&u.set(a.__key,0,"element"),l}(n),i=!1;if(Q(s)&&e){let a=s.anchor,l=s.focus;a.key===r&&(Dc(a,n,o,n.getPreviousSibling(),n.getNextSibling()),i=!0),l.key===r&&(Dc(l,n,o,n.getPreviousSibling(),n.getNextSibling()),i=!0)}else Uc(s)&&e&&n.isSelected()&&n.selectPrevious();if(Q(s)&&e&&!i){let a=n.getIndexWithinParent();io(n),Mc(s,o,a,-1)}else io(n);t||kn(o)||o.canBeEmpty()||!o.isEmpty()||lf(o,e),e&&s&&ut(o)&&o.isEmpty()&&o.selectEnd()}function Zw(n){return n}var iy=Symbol.for("ephemeral");function Rc(n){return n[iy]||!1}var on=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Da(this);return e===void 0&&D(64,this.name),e}static clone(e){D(65,this.name)}$config(){return{}}config(e,t){let r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,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))}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}),vy(this,e)}getType(){return this.__type}isInline(){D(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let t=nt(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||me();if(t==null)return!1;let r=t.getNodes().some(o=>o.__key===this.__key);if(Y(this))return r;if(Q(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;let o=this.getParent();if(Me(this)&&this.isInline()&&o){let s=t.isBackward()?t.focus:t.anchor;if(o.is(s.getNode())&&s.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:nt(e)}getParentOrThrow(){let e=this.getParent();return e===null&&D(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(kn(t))return M(e)||e===this&&Me(e)||D(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&D(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:nt(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:nt(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=M(this)?this:this.getParent(),r=M(e)?e:e.getParent(),o=t&&r?Ca(t,r):null;return o?o.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Ca(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?Zf(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&D(279),!1)))}isParentOf(e){let t=Ca(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){let t=this.isBefore(e),r=[],o=new Set,s=this;for(;s!==null;){let i=s.__key;if(o.has(i)||(o.add(i),r.push(s)),s===e)break;let a=M(s)?t?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}let l=t?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}let c=s.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&D(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||o.has(d.__key)||r.push(d)}while(u===null);s=u}return t||r.reverse(),r}isDirty(){let e=Pe()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Rc(this))return this;let e=nt(this.__key);return e===null&&D(113),e}getWritable(){if(Rc(this))return this;it();let e=Pr(),t=Pe(),r=e._nodeMap,o=this.__key,s=this.getLatest(),i=t._cloneNotNeeded,a=me();if(a!==null&&a.setCachedNodes(null),i.has(o))return Pc(s),s;let l=Gf(s);return i.add(o),Pc(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){D(70)}updateDOM(e,t,r){D(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){D(18,this.name)}updateFromJSON(e){return function(t,r){let o=t.getWritable(),s=r.$,i=s;for(let a of wx(o).flatKeys)a in r&&(i!==void 0&&i!==s||(i={...s}),i[a]=r[a]);return(o.__state||i)&&xf(t).updateFromJSON(i),o}(this,e)}static transform(){return null}remove(e){lf(this,!0,e)}replace(e,t){it();let r=me();r!==null&&(r=r.clone()),Kg(this,e);let o=this.getLatest(),s=this.__key,i=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;io(a);let u=o.getPreviousSibling(),d=o.getNextSibling(),h=o.__prev,g=o.__next,f=o.__parent;if(lf(o,!1,!0),u===null?l.__first=i:u.getWritable().__next=i,a.__prev=h,d===null?l.__last=i:d.getWritable().__prev=i,a.__next=g,a.__parent=f,l.__size=c,t&&(M(this)&&M(a)||D(139),this.getChildren().forEach(p=>{a.append(p)})),Q(r)){Yt(r);let p=r.anchor,m=r.focus;p.key===s&&GC(p,a),m.key===s&&GC(m,a)}return oo()===s&&at(i),a}insertAfter(e,t=!0){it(),Kg(this,e);let r=this.getWritable(),o=e.getWritable(),s=o.getParent(),i=me(),a=!1,l=!1;if(s!==null){let g=e.getIndexWithinParent();if(io(o),Q(i)){let f=s.__key,p=i.anchor,m=i.focus;a=p.type==="element"&&p.key===f&&p.offset===g+1,l=m.type==="element"&&m.key===f&&m.offset===g+1}}let c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=o.__key,h=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,o.__next=h,o.__prev=r.__key,o.__parent=r.__parent,t&&Q(i)){let g=this.getIndexWithinParent();Mc(i,u,g+1);let f=u.__key;a&&i.anchor.set(f,g+2,"element"),l&&i.focus.set(f,g+2,"element")}return e}insertBefore(e,t=!0){it(),Kg(this,e);let r=this.getWritable(),o=e.getWritable(),s=o.__key;io(o);let i=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();i===null?a.__first=s:i.getWritable().__next=s,a.__size++,r.__prev=s,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;let u=me();return t&&Q(u)&&Mc(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Or()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){it();let r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(M(r))return r.select();if(!Y(r)){let s=r.getIndexWithinParent()+1;return o.select(s,s)}return r.select(e,t)}selectNext(e,t){it();let r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(M(r))return r.select(0,0);if(!Y(r)){let s=r.getIndexWithinParent();return o.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};nn(on,"importDOM");var Jw="historic",Xw="history-push",bc="history-merge",Qw="paste",ay="collaboration",ev="skip-collab",ly="skip-scroll-into-view",cy="skip-dom-selection",uy="skip-selection-focus",lo=class extends on{static getType(){return"linebreak"}static clone(e){return new lo(e.__key)}constructor(e){super(e)}getTextContent(){return`
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(t){let r=t.parentElement;if(r!==null&&gf(r)){let o=r.firstChild;if(o===t||o.nextSibling===t&&mc(o)){let s=r.lastChild;if(s===t||s.previousSibling===t&&mc(s))return!0}}return!1}(e)||function(t){let r=t.parentElement;if(r!==null&&gf(r)){let o=r.firstChild;if(o===t||o.nextSibling===t&&mc(o))return!1;let s=r.lastChild;if(s===t||s.previousSibling===t&&mc(s))return!0}return!1}(e)?null:{conversion:tv,priority:0}}}static importJSON(e){return oi().updateFromJSON(e)}};function tv(n){return{node:oi()}}function oi(){return Ma(new lo)}function es(n){return n instanceof lo}function mc(n){return qn(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Pg(n,e){return 16&e?"code":e&_f?"mark":32&e?"sub":64&e?"sup":null}function Fg(n,e){return 1&e?"strong":2&e?"em":"span"}function dy(n,e,t,r,o){let s=r.classList,i=ni(o,"base");i!==void 0&&s.add(...i),i=ni(o,"underlineStrikethrough");let a=!1,l=8&e&&4&e;i!==void 0&&(8&t&&4&t?(a=!0,l||s.add(...i)):l&&s.remove(...i));for(let c in Tt){let u=Tt[c];if(i=ni(o,c),i!==void 0)if(t&u){if(a&&(c==="underline"||c==="strikethrough")){e&u&&s.remove(...i);continue}((e&u)===0||l&&c==="underline"||c==="strikethrough")&&s.add(...i)}else e&u&&s.remove(...i)}}function hy(n,e,t){let r=e.firstChild,o=t.isComposing(),s=n+(o?Hc:"");if(r==null)e.textContent=s;else{let i=r.nodeValue;if(i!==s)if(o||ns){let[a,l,c]=function(u,d){let h=u.length,g=d.length,f=0,p=0;for(;f<h&&f<g&&u[f]===d[f];)f++;for(;p+f<h&&p+f<g&&u[h-p-1]===d[g-p-1];)p++;return[f,h-f-p,d.slice(f,g-p)]}(i,s);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=s}}function KC(n,e,t,r,o,s){hy(o,n,e);let i=s.theme.text;i!==void 0&&dy(0,0,r,n,i)}function _c(n,e){let t=document.createElement(e);return t.appendChild(n),t}var Rr=class extends on{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Rr(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(){let e=this.getLatest();return ww[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===oo()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Tt[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return $c(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let r=this.__format,o=Pg(0,r),s=Fg(0,r),i=o===null?s:o,a=document.createElement(i),l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(s),a.appendChild(l)),KC(l,this,0,r,this.__text,e);let c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(e,t,r){let o=this.__text,s=e.__format,i=this.__format,a=Pg(0,s),l=Pg(0,i),c=Fg(0,s),u=Fg(0,i);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){let p=t.firstChild;p==null&&D(48);let m=document.createElement(u);return KC(m,this,0,i,o,r),t.replaceChild(m,p),!1}let d=t;l!==null&&a!==null&&(d=t.firstChild,d==null&&D(49)),hy(o,d,this);let h=r.theme.text;h!==void 0&&s!==i&&dy(0,s,i,d,h);let g=e.__style,f=this.__style;return g!==f&&(t.style.cssText=f),!1}static importDOM(){return{"#text":()=>({conversion:sv,priority:0}),b:()=>({conversion:rv,priority:0}),code:()=>({conversion:Tr,priority:0}),em:()=>({conversion:Tr,priority:0}),i:()=>({conversion:Tr,priority:0}),mark:()=>({conversion:Tr,priority:0}),s:()=>({conversion:Tr,priority:0}),span:()=>({conversion:nv,priority:0}),strong:()=>({conversion:Tr,priority:0}),sub:()=>({conversion:Tr,priority:0}),sup:()=>({conversion:Tr,priority:0}),u:()=>({conversion:Tr,priority:0})}}static importJSON(e){return st().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return It(t)||D(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=_c(t,"b")),this.hasFormat("italic")&&(t=_c(t,"i")),this.hasFormat("strikethrough")&&(t=_c(t,"s")),this.hasFormat("underline")&&(t=_c(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e=="string"?Tt[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e=="string"?Nw[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=$c(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Aw[e];if(this.__mode===t)return this;let r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){it();let r=e,o=t,s=me(),i=this.getTextContent(),a=this.__key;if(typeof i=="string"){let l=i.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!Q(s))return py(a,r,a,o,"text","text");{let l=oo();l!==s.anchor.key&&l!==s.focus.key||at(a),s.setTextNodeRange(this,r,this,o)}return s}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){let s=this.getWritable(),i=s.__text,a=r.length,l=e;l<0&&(l=a+l,l<0&&(l=0));let c=me();if(o&&Q(c)){let d=e+a;c.setTextNodeRange(s,d,s,d)}let u=i.slice(0,l)+r+i.slice(l+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){it();let t=this.getLatest(),r=t.getTextContent();if(r==="")return[];let o=t.__key,s=oo(),i=r.length;e.sort((A,O)=>A-O),e.push(i);let a=[],l=e.length;for(let A=0,O=0;A<i&&O<=l;O++){let P=e[O];P>A&&(a.push(r.slice(A,P)),A=P)}let c=a.length;if(c===1)return[t];let u=a[0],d=t.getParent(),h,g=t.getFormat(),f=t.getStyle(),p=t.__detail,m=!1,_=null,C=null,x=me();if(Q(x)){let[A,O]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];A.type==="text"&&A.key===o&&(_=A),O.type==="text"&&O.key===o&&(C=O)}t.isSegmented()?(h=st(u),h.__format=g,h.__style=f,h.__detail=p,h.__state=LC(t,h),m=!0):h=t.setTextContent(u);let y=[h];for(let A=1;A<c;A++){let O=st(a[A]);O.__format=g,O.__style=f,O.__detail=p,O.__state=LC(t,O);let P=O.__key;s===o&&at(P),y.push(O)}let S=_?_.offset:null,b=C?C.offset:null,N=0;for(let A of y){if(!_&&!C)break;let O=N+A.getTextContentSize();if(_!==null&&S!==null&&S<=O&&S>=N&&(_.set(A.getKey(),S-N,"text"),S<O&&(_=null)),C!==null&&b!==null&&b<=O&&b>=N){C.set(A.getKey(),b-N,"text");break}N=O}if(d!==null){(function(P){let I=P.getPreviousSibling(),z=P.getNextSibling();I!==null&&Pc(I),z!==null&&Pc(z)})(this);let A=d.getWritable(),O=this.getIndexWithinParent();m?(A.splice(O,0,y),this.remove()):A.splice(O,1,y),Q(x)&&Mc(x,d,O,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||D(50);let r=this.__key,o=e.__key,s=this.__text,i=s.length;oo()===o&&at(r);let a=me();if(Q(a)){let d=a.anchor,h=a.focus;d!==null&&d.key===o&&XC(d,t,r,e,i),h!==null&&h.key===o&&XC(h,t,r,e,i)}let l=e.__text,c=t?l+s:s+l;this.setTextContent(c);let u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}};function nv(n){return{forChild:Af(n.style),node:null}}function rv(n){let e=n,t=e.style.fontWeight==="normal";return{forChild:Af(e.style,t?void 0:"bold"),node:null}}var UC=new WeakMap;function ov(n){if(!It(n))return!1;if(n.nodeName==="PRE")return!0;let e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function sv(n){let e=n;n.parentElement===null&&D(129);let t=e.textContent||"";if(function(r){let o,s=r.parentNode,i=[r];for(;s!==null&&(o=UC.get(s))===void 0&&!ov(s);)i.push(s),s=s.parentNode;let a=o===void 0?s:o;for(let l=0;l<i.length;l++)UC.set(i[l],a);return a}(e)!==null){let r=t.split(/(\r?\n|\t)/),o=[],s=r.length;for(let i=0;i<s;i++){let a=r[i];a===`
`||a===`\r
`?o.push(oi()):a===" "?o.push(Kc()):a!==""&&o.push(st(a))}return{node:o}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,o=!0;for(;r!==null&&(r=WC(r,!1))!==null;){let s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),o=!1;break}}o&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=WC(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:st(t)}}function WC(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){let s=t.parentElement;if(s===null)return null;t=s}if(t=r,It(t)){let s=t.style.display;if(s===""&&!Uy(t)||s!==""&&!s.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(qn(t))return t;if(t.nodeName==="BR")return null}}var iv={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Tr(n){let e=iv[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Af(n.style,e),node:null}}function st(n=""){return Ma(new Rr(n))}function Y(n){return n instanceof Rr}function Af(n,e){let t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",s=r.includes("line-through"),i=n.fontStyle==="italic",a=r.includes("underline"),l=n.verticalAlign;return c=>(Y(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),s&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),i&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}var co=class extends Rr{static getType(){return"tab"}static clone(e){return new co(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),r=ni(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return Kc().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&_x(126),super.setTextContent(" ")}spliceText(e,t,r,o){return r===""&&t===0||r===" "&&t===1||D(286),this}setDetail(e){return e!==2&&D(127),this}setMode(e){return e!=="normal"&&D(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Kc(){return Ma(new co)}function wf(n){return n instanceof co}var cf=class{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}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:qf(En(mo(this,"next")),En(mo(e,"next")))<0}getNode(){let e=nt(this.key);return e===null&&D(20),e}set(e,t,r,o){let s=this._selection,i=this.key;o&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,ci()||(oo()===i&&at(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}};function On(n,e,t){return new cf(n,e,t)}function Bg(n,e){let t=e.__key,r=n.offset,o="element";if(Y(e)){o="text";let s=e.getTextContentSize();r>s&&(r=s)}else if(!M(e)){let s=e.getNextSibling();if(Y(s))t=s.__key,r=0,o="text";else{let i=e.getParent();i&&(t=i.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function GC(n,e){if(M(e)){let t=e.getLastDescendant();M(t)||Y(t)?Bg(n,t):Bg(n,e)}else Bg(n,e)}var si=class{_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(!Uc(e))return!1;let t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(o=>r.has(o))}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)}clone(){return new si(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),r=t.length,o=t[r-1],s;if(Y(o))s=o.select();else{let i=o.getIndexWithinParent()+1;s=o.getParentOrThrow().select(i,i)}s.insertNodes(e);for(let i=0;i<r;i++)t[i].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,r=[];for(let o of t){let s=nt(o);s!==null&&r.push(s)}return ci()||(this._cachedNodes=r),r}getTextContent(){let e=this.getNodes(),t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((me()||us())===this&&e[0]){let t=dt(e[0],"next");jy(po(t,t))}for(let t of e)t.remove()}};function Q(n){return n instanceof Mr}var Mr=class{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Q(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(){let e=this._cachedNodes;if(e!==null)return e;let t=function(r){let o=[],[s,i]=r.getTextSlices();s&&o.push(s.caret.origin);let a=new Set,l=new Set;for(let c of r)if(wn(c)){let{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{let{origin:u}=c;M(u)&&l.has(u)||o.push(u)}if(i&&o.push(i.caret.origin),cs(r.focus)&&M(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=$r(r.focus.origin,"previous");wn(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=ai(c))a.delete(c.origin),o.pop();for(;o.length>1;){let c=o[o.length-1];if(!M(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){let c=En(r.anchor),u=En(r.anchor.getFlipped()),d=g=>Lr(g)?g.origin:g.getNodeAtCaret(),h=d(c)||d(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(h)}return o}(Jf(mf(this),"next"));return ci()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,o){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let t=e[0],r=e[e.length-1],o=this.anchor,s=this.focus,i=o.isBefore(s),[a,l]=uf(this),c="",u=!0;for(let d=0;d<e.length;d++){let h=e[d];if(M(h)&&!h.isInline())u||(c+=`
`),u=!h.isEmpty();else if(u=!1,Y(h)){let g=h.getTextContent();h===t?h===r?o.type==="element"&&s.type==="element"&&s.offset!==o.offset||(g=a<l?g.slice(a,l):g.slice(l,a)):g=i?g.slice(a):g.slice(l):h===r&&(g=i?g.slice(0,l):g.slice(0,a)),c+=g}else!Me(h)&&!es(h)||h===r&&this.isCollapsed()||(c+=h.getTextContent())}return c}applyDOMRange(e){let t=Pe(),r=t.getEditorState()._selection,o=fy(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(o===null)return;let[s,i]=o;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(i.key,i.offset,i.type,!0),Ec(this)}clone(){let e=this.anchor,t=this.focus;return new Mr(On(e.key,e.offset,e.type),On(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=$c(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){let t=Tt[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let s=0;s<o;s++){let i=t[s];i===`
`||i===`\r
`?r.push(oi()):i===" "?r.push(Kc()):r.push(st(i))}this.insertNodes(r)}insertText(e){let t=this.anchor,r=this.focus,o=this.format,s=this.style,i=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(i=r,a=t),i.type==="element"&&function(m,_,C,x){let y=m.getNode(),S=y.getChildAtIndex(m.offset),b=st();if(b.setFormat(C),b.setStyle(x),Ty(S))S.splice(0,0,[b]);else{let N=ut(y)?Or().append(b):b;S===null?y.append(N):S.insertBefore(N)}m.is(_)&&_.set(b.__key,0,"text"),m.set(b.__key,0,"text")}(i,a,o,s),a.type==="element"&&li(a,En(mo(a,"next")));let l=i.offset,c=a.offset,u=this.getNodes(),d=u.length,h=u[0];Y(h)||D(26);let g=h.getTextContent().length,f=h.getParentOrThrow(),p=u[d-1];if(d===1&&a.type==="element"&&(c=g,a.set(i.key,c,"text")),this.isCollapsed()&&l===g&&(Er(h)||!h.canInsertTextAfter()||!f.canInsertTextAfter()&&h.getNextSibling()===null)){let m=h.getNextSibling();if(Y(m)&&m.canInsertTextBefore()&&!Er(m)||(m=st(),m.setFormat(o),m.setStyle(s),f.canInsertTextAfter()?h.insertAfter(m):f.insertAfter(m)),m.select(0,0),h=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(Er(h)||!h.canInsertTextBefore()||!f.canInsertTextBefore()&&h.getPreviousSibling()===null)){let m=h.getPreviousSibling();if(Y(m)&&!Er(m)||(m=st(),m.setFormat(o),f.canInsertTextBefore()?h.insertBefore(m):f.insertBefore(m)),m.select(),h=m,e!=="")return void this.insertText(e)}else if(h.isSegmented()&&l!==g){let m=st(h.getTextContent());m.setFormat(o),h.replace(m),h=m}else if(!this.isCollapsed()&&e!==""){let m=p.getParent();if(!f.canInsertTextBefore()||!f.canInsertTextAfter()||M(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),gy(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(so(h)){let x=st(e);return x.select(),void h.replace(x)}let m=h.getFormat(),_=h.getStyle();if(l!==c||m===o&&_===s){if(wf(h)){let x=st(e);return x.setFormat(o),x.setStyle(s),x.select(),void h.replace(x)}}else{if(h.getTextContent()!==""){let x=st(e);if(x.setFormat(o),x.setStyle(s),x.select(),l===0)h.insertBefore(x,!1);else{let[y]=h.splitText(l);y.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}h.setFormat(o),h.setStyle(s)}let C=c-l;h=h.spliceText(l,C,e,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(h.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=_))}else{let m=new Set([...h.getParentKeys(),...p.getParentKeys()]),_=M(h)?h:h.getParentOrThrow(),C=M(p)?p:p.getParentOrThrow(),x=p;if(!_.is(C)&&C.isInline())do x=C,C=C.getParentOrThrow();while(C.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(Y(p)&&!so(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){let A=st(p.getTextContent());p.replace(A),p=A}ut(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{let A=p.getParentOrThrow();A.canBeEmpty()||A.getChildrenSize()!==1?p.remove():A.remove()}else m.add(p.__key);let y=C.getChildren(),S=new Set(u),b=_.is(C),N=_.isInline()&&h.getNextSibling()===null?_:h;for(let A=y.length-1;A>=0;A--){let O=y[A];if(O.is(h)||M(O)&&O.isParentOf(h))break;O.isAttached()&&(!S.has(O)||O.is(x)?b||N.insertAfter(O,!1):O.remove())}if(!b){let A=C,O=null;for(;A!==null;){let P=A.getChildren(),I=P.length;(I===0||P[I-1].is(O))&&(m.delete(A.__key),O=A),A=A.getParent()}}if(so(h))if(l===g)h.select();else{let A=st(e);A.select(),h.replace(A)}else h=h.spliceText(l,g-l,e,!0),h.getTextContent()===""?h.remove():h.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let A=1;A<d;A++){let O=u[A],P=O.__key;m.has(P)||O.remove()}}}removeText(){let e=me()===this;xa(this,qy(mf(this))),e&&me()!==this&&Yt(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void at(null);let r=this.getNodes(),o=[];for(let y of r)Y(y)&&o.push(y);let s=y=>{r.forEach(S=>{if(M(S)){let b=S.getFormatFlags(e,y);S.setTextFormat(b)}})},i=o.length;if(i===0)return this.toggleFormat(e),at(null),void s(t);let a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,d=c?a:l,h=0,g=o[0],f=u.type==="element"?0:u.offset;if(u.type==="text"&&f===g.getTextContentSize()&&(h=1,g=o[1],f=0),g==null)return;let p=g.getFormatFlags(e,t);s(p);let m=i-1,_=o[m],C=d.type==="text"?d.offset:_.getTextContentSize();if(g.is(_)){if(f===C)return;if(Er(g)||f===0&&C===g.getTextContentSize())g.setFormat(p);else{let y=g.splitText(f,C),S=f===0?y[0]:y[1];S.setFormat(p),u.type==="text"&&u.set(S.__key,0,"text"),d.type==="text"&&d.set(S.__key,C-f,"text")}return void(this.format=p)}f===0||Er(g)||([,g]=g.splitText(f),f=0),g.setFormat(p);let x=_.getFormatFlags(e,p);C>0&&(C===_.getTextContentSize()||Er(_)||([_]=_.splitText(C)),_.setFormat(x));for(let y=h+1;y<m;y++){let S=o[y],b=S.getFormatFlags(e,x);S.setFormat(b)}u.type==="text"&&u.set(g.__key,f,"text"),d.type==="text"&&d.set(_.__key,C,"text"),this.format=p|x}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let f=me();return Q(f)||D(134),f.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),r=_a(t,vr),o=e[e.length-1];if(M(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let f=Hg(this);r.splice(f,0,e),o.selectEnd()}return}if(!e.some(f=>(M(f)||Me(f))&&!f.isInline())){M(r)||D(211,t.constructor.name,t.getType());let f=Hg(this);return r.splice(f,0,e),void o.selectEnd()}let s=function(f){let p=Or(),m=null;for(let _=0;_<f.length;_++){let C=f[_],x=es(C);if(x||Me(C)&&C.isInline()||M(C)&&C.isInline()||Y(C)||C.isParentRequired()){if(m===null&&(m=C.createParentElementNode(),p.append(m),x))continue;m!==null&&m.append(C)}else p.append(C),m=null}return p}(e),i=s.getLastDescendant(),a=s.getChildren(),l=!M(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1],u=a[0];var d;M(d=u)&&vr(d)&&!d.isEmpty()&&M(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(M(r)||D(211,t.constructor.name,t.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&D(212,t.constructor.name,t.getType()),function(f,p){let m=p.getParentOrThrow().getLastChild(),_=p,C=[p];for(;_!==m;)_.getNextSibling()||D(140),_=_.getNextSibling(),C.push(_);let x=f;for(let y of C)x=x.insertAfter(y)}(r,u));let h=_a(i,vr);l&&M(h)&&(l.canMergeWhenEmpty()||vr(c))&&(h.append(...l.getChildren()),l.remove()),M(r)&&r.isEmpty()&&r.remove(),i.selectEnd();let g=M(r)?r.getLastChild():null;es(g)&&h!==r&&g.remove()}insertParagraph(){if(this.anchor.key==="root"){let i=Or();return sn().splice(this.anchor.offset,0,[i]),i.select(),i}let e=Hg(this),t=_a(this.anchor.getNode(),vr);M(t)||D(213);let r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...o),s.selectStart(),s):null}insertLineBreak(e){let t=oi();if(this.insertNodes([t]),e){let r=t.getParentOrThrow(),o=t.getIndexWithinParent();r.select(o,o)}}extract(){let e=[...this.getNodes()],t=e.length,r=e[0],o=e[t-1],[s,i]=uf(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=a?[i,s]:[s,i];if(t===0)return[];if(t===1){if(Y(r)&&!this.isCollapsed()){let h=r.splitText(u,d),g=u===0?h[0]:h[1];return g?(l.set(g.getKey(),0,"text"),c.set(g.getKey(),g.getTextContentSize(),"text"),[g]):[]}return[r]}if(Y(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,l.set(r.getKey(),0,"text"))),Y(o)){let h=o.getTextContent().length;d===0?e.pop():d!==h&&([o]=o.splitText(d),e[e.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return e}modify(e,t,r){if(QC(this,e,t,r))return;let o=e==="move",s=Pe(),i=jn(mn(s));if(!i)return;let a=s._blockCursorElement,l=s._rootElement,c=this.focus.getNode();if(l===null||a===null||!M(c)||c.isInline()||c.canBeEmpty()||hf(a,s,l),this.dirty){let u=as(s,this.anchor.key),d=as(s,this.focus.key);this.anchor.type==="text"&&(u=is(u)),this.focus.type==="text"&&(d=is(d)),u&&d&&_y(i,u,this.anchor.offset,d,this.focus.offset)}if(function(u,d,h,g){u.modify(d,h,g)}(i,e,t?"backward":"forward",r),i.rangeCount>0){let u=i.getRangeAt(0),d=this.anchor.getNode(),h=ut(d)?d:By(d);if(this.applyDOMRange(u),this.dirty=!0,!o){let g=this.getNodes(),f=[],p=!1;for(let m=0;m<g.length;m++){let _=g[m];Fc(_,h)?f.push(_):p=!0}if(p&&f.length>0)if(t){let m=f[0];M(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{let m=f[f.length-1];M(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}i.anchorNode===u.startContainer&&i.anchorOffset===u.startOffset||function(m){let _=m.focus,C=m.anchor,x=C.key,y=C.offset,S=C.type;C.set(_.key,_.offset,_.type,!0),_.set(x,y,S,!0)}(this)}}r==="lineboundary"&&QC(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&M(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){let o=t.getParent(),s=t.getNextSibling()||(o===null?null:o.getNextSibling());if(M(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let r=this.anchor,o=r.getNode();if(this.forwardDeletion(r,o,e))return;let s=Yf(mo(r,e?"previous":"next"));if(s.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(let l of s.iterNodeCarets("shadowRoot"))if(wn(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(M(s.anchor.origin)&&s.anchor.origin.isEmpty()){let c=En(l);xa(this,po(c,c)),s.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(cs(l)){if(M(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(s.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Me(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&M(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();let c=vf();c.add(l.origin.getKey()),Yt(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){let{caret:l,block:c}=a;return xa(this,po(!l.origin.isEmpty()&&c.isEmpty()?di(dt(c,l.direction)):s.anchor,l)),this.removeText()}}let i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&YC(this,r.getNode()))return}else{let a=i.type==="text"?i.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){let l=i.offset,c=a.getTextContentSize();if(a.is(o)||e&&l!==c||!e&&l!==0)return void jC(a,e,l)}else if(o!==null&&o.isSegmented()){let l=r.offset,c=o.getTextContentSize();if(o.is(a)||e&&l!==0||!e&&l!==c)return void jC(o,e,l)}(function(l,c){let u=l.anchor,d=l.focus,h=u.getNode(),g=d.getNode();if(h===g&&u.type==="text"&&d.type==="text"){let f=u.offset,p=d.offset,m=f<p,_=m?f:p,C=m?p:f,x=C-1;_!==x&&function(y){return!(Ly(y)||av(y))}(h.getTextContent().slice(_,C))&&(c?d.set(d.key,x,d.type):u.set(u.key,x,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let r=this.anchor.getNode();r.isEmpty()&&ut(r.getParent())&&r.getPreviousSibling()===null&&YC(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Uc(n){return n instanceof si}function VC(n){let e=n.offset;if(n.type==="text")return e;let t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function uf(n){let e=n.getStartEndPoints();if(e===null)return[0,0];let[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[VC(t),VC(r)]}function YC(n,e){for(let t=e;t;t=t.getParent()){if(M(t)){if(t.collapseAtStart(n))return!0;if(kn(t))break}if(t.getPreviousSibling())break}return!1}var av=(()=>{try{let n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("\u2764\uFE0F")&&e("#\uFE0F\u20E3")&&e("\u{1F44D}"))return e}catch{}return()=>!1})();function jC(n,e,t){let r=n,o=r.getTextContent().split(/(?=\s)/g),s=o.length,i=0,a=0;for(let c=0;c<s;c++){let u=c===s-1;if(a=i,i+=o[c].length,e&&i===t||i>t||u){o.splice(c,1),u&&(a=void 0);break}}let l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function qC(n,e,t,r){let o,s=e;if(It(n)){let i=!1,a=n.childNodes,l=a.length,c=r._blockCursorElement;s===l&&(i=!0,s=l-1);let u=a[s],d=!1;if(u===c)u=a[s+1],d=!0;else if(c!==null){let h=c.parentNode;n===h&&e>Array.prototype.indexOf.call(h.children,c)&&s--}if(o=Qs(u),Y(o))s=vn(o,i?"next":"previous");else{let h=Qs(n);if(h===null)return null;if(M(h)){let g=r.getElementByKey(h.getKey());g===null&&D(214),[h,s]=h.getDOMSlot(g).resolveChildIndex(h,g,n,e),M(h)||D(215),i&&s>=h.getChildrenSize()&&(s=Math.max(0,h.getChildrenSize()-1));let p=h.getChildAtIndex(s);if(M(p)&&function(m,_,C){let x=m.getParent();return C===null||x===null||!x.canBeEmpty()||x!==C.getNode()}(p,0,t)){let m=i?p.getLastDescendant():p.getFirstDescendant();m===null?h=p:(p=m,h=M(p)?p:p.getParentOrThrow()),s=0}Y(p)?(o=p,h=null,s=vn(p,i?"next":"previous")):p!==h&&i&&!d&&(M(h)||D(216),s=Math.min(h.getChildrenSize(),s+1))}else{let g=h.getIndexWithinParent();s=e===0&&Me(h)&&Qs(n)===h?g:g+1,h=h.getParentOrThrow()}if(M(h))return On(h.__key,s,"element")}}else o=Qs(n);return Y(o)?On(o.__key,vn(o,s,"clamp"),"text"):null}function ZC(n,e,t){let r=n.offset,o=n.getNode();if(r===0){let s=o.getPreviousSibling(),i=o.getParent();if(e){if((t||!e)&&s===null&&M(i)&&i.isInline()){let a=i.getPreviousSibling();Y(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else M(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):Y(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===o.getTextContent().length){let s=o.getNextSibling(),i=o.getParent();if(e&&M(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&M(i)&&i.isInline()&&!i.canInsertTextAfter()){let a=i.getNextSibling();Y(a)&&n.set(a.__key,0,"text")}}}function gy(n,e,t){if(n.type==="text"&&e.type==="text"){let r=n.isBefore(e),o=n.is(e);ZC(n,r,o),ZC(e,!r,o),o&&e.set(n.key,n.offset,n.type);let s=Pe();if(s.isComposing()&&s._compositionKey!==n.key&&Q(t)){let i=t.anchor,a=t.focus;n.set(i.key,i.offset,i.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function fy(n,e,t,r,o,s){if(n===null||t===null||!ka(o,n,t))return null;let i=qC(n,e,Q(s)?s.anchor:null,o);if(i===null)return null;let a=qC(t,r,Q(s)?s.focus:null,o);if(a===null)return null;if(i.type==="element"&&a.type==="element"){let l=Qs(n),c=Qs(t);if(Me(l)&&Me(c))return null}return gy(i,a,s),[i,a]}function lv(n){return M(n)&&!n.isInline()}function py(n,e,t,r,o,s){let i=Pr(),a=new Mr(On(n,e,o),On(t,r,s),0,"");return a.dirty=!0,i._selection=a,a}function my(){let n=On("root",0,"element"),e=On("root",0,"element");return new Mr(n,e,0,"")}function vf(){return new si(new Set)}function cv(n,e){return Wc(null,n,e,null)}function Wc(n,e,t,r){let o=t._window;if(o===null)return null;let s=r||o.event,i=s?s.type:void 0,a=i==="selectionchange",l=!Gg&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,h;if(Q(n)&&!l)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,h=e.focusOffset,(a||i===void 0)&&Q(n)&&!ka(t,c,u))return n.clone();let g=fy(c,d,u,h,t,n);if(g===null)return null;let[f,p]=g;return new Mr(f,p,Q(n)?n.format:0,Q(n)?n.style:"")}function me(){return Pr()._selection}function us(){return Pe()._editorState._selection}function Mc(n,e,t,r=1){let o=n.anchor,s=n.focus,i=o.getNode(),a=s.getNode();if(!e.is(i)&&!e.is(a))return;let l=e.__key;if(n.isCollapsed()){let c=o.offset;if(t<=c&&r>0||t<c&&r<0){let u=Math.max(0,c+r);o.set(l,u,"element"),s.set(l,u,"element"),JC(n)}}else{let c=n.isBackward(),u=c?s:o,d=u.getNode(),h=c?o:s,g=h.getNode();if(e.is(d)){let f=u.offset;(t<=f&&r>0||t<f&&r<0)&&u.set(l,Math.max(0,f+r),"element")}if(e.is(g)){let f=h.offset;(t<=f&&r>0||t<f&&r<0)&&h.set(l,Math.max(0,f+r),"element")}}JC(n)}function JC(n){let e=n.anchor,t=e.offset,r=n.focus,o=r.offset,s=e.getNode(),i=r.getNode();if(n.isCollapsed()){if(!M(s))return;let a=s.getChildrenSize(),l=t>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(M(s)){let a=s.getChildrenSize(),l=t>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(M(i)){let a=i.getChildrenSize(),l=o>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(o);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Dc(n,e,t,r,o){let s=null,i=0,a=null;r!==null?(s=r.__key,Y(r)?(i=r.getTextContentSize(),a="text"):M(r)&&(i=r.getChildrenSize(),a="element")):o!==null&&(s=o.__key,Y(o)?a="text":M(o)&&(a="element")),s!==null&&a!==null?n.set(s,i,a):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),n.set(t.__key,i,"element"))}function XC(n,e,t,r,o){n.type==="text"?n.set(t,n.offset+(e?0:o),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function _y(n,e,t,r,o){try{n.setBaseAndExtent(e,t,r,o)}catch{}}function uv(n,e,t,r,o,s,i){let a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(o.has(ay)&&d!==s||d!==null&&Df(d))return;if(!Q(e))return void(n!==null&&ka(t,a,l)&&r.removeAllRanges());let h=e.anchor,g=e.focus,f=h.key,p=g.key,m=as(t,f),_=as(t,p),C=h.offset,x=g.offset,y=e.format,S=e.style,b=e.isCollapsed(),N=m,A=_,O=!1;if(h.type==="text"){N=is(m);let K=h.getNode();O=K.getFormat()!==y||K.getStyle()!==S}else Q(n)&&n.anchor.type==="text"&&(O=!0);var P,I,z,G,q;if(g.type==="text"&&(A=is(_)),N!==null&&A!==null&&(b&&(n===null||O||Q(n)&&(n.format!==y||n.style!==S))&&(P=y,I=S,z=C,G=f,q=performance.now(),ey=[P,I,z,G,q]),c!==C||u!==x||a!==N||l!==A||r.type==="Range"&&b||(d!==null&&s.contains(d)||o.has(uy)||s.focus({preventScroll:!0}),h.type==="element"))){if(_y(r,N,C,A,x),!o.has(ly)&&e.isCollapsed()&&s!==null&&s===document.activeElement){let K=Q(e)&&e.anchor.type==="element"?N.childNodes[C]||null:r.rangeCount>0?r.getRangeAt(0):null;if(K!==null){let le;if(K instanceof Text){let ie=document.createRange();ie.selectNode(K),le=ie.getBoundingClientRect()}else le=K.getBoundingClientRect();(function(ie,pe,xe){let ht=zf(xe),fe=Kf(ht);if(ht===null||fe===null)return;let{top:Wt,bottom:ke}=pe,kt=0,ge=0,Qe=xe;for(;Qe!==null;){let en=Qe===ht.body;if(en)kt=0,ge=mn(ie).innerHeight;else{let Ue=Qe.getBoundingClientRect();kt=Ue.top,ge=Ue.bottom}let ne=0;if(Wt<kt?ne=-(kt-Wt):ke>ge&&(ne=ke-ge),ne!==0)if(en)fe.scrollBy(0,ne);else{let Ue=Qe.scrollTop;Qe.scrollTop+=ne;let Ve=Qe.scrollTop-Ue;Wt-=Ve,ke-=Ve}if(en)break;Qe=Ra(Qe)}})(t,le,s)}}sf=!0}}function dv(n){let e=me()||us();e===null&&(e=sn().selectEnd()),e.insertNodes(n)}function hv(){let n=me();return n===null?"":n.getTextContent()}function Hg(n){let e=n;n.isCollapsed()||e.removeText();let t=me();Q(t)&&(e=t),Q(e)||D(161);let r=e.anchor,o=r.getNode(),s=r.offset;for(;!vr(o);){let i=o;if([o,s]=gv(o,s),i.is(o))break}return s}function gv(n,e){let t=n.getParent();if(!t){let o=Or();return sn().append(o),o.select(),[sn(),0]}if(Y(n)){let o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];let s=e===0?0:1;return[t,o[0].getIndexWithinParent()+s]}if(!M(n)||e===0)return[t,n.getIndexWithinParent()];let r=n.getChildAtIndex(e);if(r){let o=new Mr(On(n.__key,e,"element"),On(n.__key,e,"element"),0,""),s=n.insertNewAfter(o);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function QC(n,e,t,r,o="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){let[u,d]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return d.set(u.key,u.offset,u.type),!0}let s=mo(n.focus,t?"previous":"next"),i=r==="lineboundary",a=e==="move",l=s,c=o==="decorators-and-blocks";if(!Zy(l)){for(let u of l){c=!1;let{origin:d}=u;if(!Me(d)||d.isIsolated()||(l=u,!i||!d.isInline()))break}if(c)for(let u of Yf(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(wn(u))u.origin.isInline()||(l=u);else{if(M(u.origin))continue;Me(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===s)return!1;if(a&&!i&&Me(l.origin)&&l.origin.isKeyboardSelectable()){let u=vf();return u.add(l.origin.getKey()),Yt(u),!0}return l=En(l),a&&li(n.anchor,l),li(n.focus,l),c||!i}var lt=null,ct=null,Vt=!1,zg=!1,Sc=0,ex={characterData:!0,childList:!0,subtree:!0};function ci(){return Vt||lt!==null&&lt._readOnly}function it(){Vt&&D(13)}function Cy(){Sc>99&&D(14)}function Pr(){return lt===null&&D(195,xy()),lt}function Pe(){return ct===null&&D(196,xy()),ct}function xy(){let n=0,e=new Set,t=kr.version;if(typeof window<"u")for(let o of document.querySelectorAll("[contenteditable]")){let s=La(o);if(Vc(s))n++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function fv(){return ct}function tx(n,e,t){let r=e.__type,o=Rf(n,r),s=t.get(r);s===void 0&&(s=Array.from(o.transforms),t.set(r,s));let i=s.length;for(let a=0;a<i&&(s[a](e),e.isAttached());a++);}function nx(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function yy(n,e){if(!e)return;let t=n._updateTags,r=e;Array.isArray(e)||(r=[e]);for(let o of r)t.add(o)}function pv(n){return Of(n,Pe()._nodes)}function Of(n,e){let t=n.type,r=e.get(t);r===void 0&&D(17,t);let o=r.klass;n.type!==o.getType()&&D(18,o.name);let s=o.importJSON(n),i=n.children;if(M(s)&&Array.isArray(i))for(let a=0;a<i.length;a++){let l=Of(i[a],e);s.append(l)}return s}function rx(n,e,t){let r=lt,o=Vt,s=ct;lt=e,Vt=!0,ct=n;try{return t()}finally{lt=r,Vt=o,ct=s}}function wr(n,e){let t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;let s=n._editorState,i=s._selection,a=t._selection,l=n._dirtyType!==0,c=lt,u=Vt,d=ct,h=n._updating,g=n._observer,f=null;if(n._pendingEditorState=null,n._editorState=t,!o&&l&&g!==null){ct=n,lt=t,Vt=!1,n._updating=!0;try{let b=n._dirtyType,N=n._dirtyElements,A=n._dirtyLeaves;g.disconnect(),f=Bw(s,t,n,b,N,A)}catch(b){if(b instanceof Error&&n._onError(b),zg)throw b;return Ny(n,null,r,t),Ex(n),n._dirtyType=2,zg=!0,wr(n,s),void(zg=!1)}finally{g.observe(r,ex),n._updating=h,lt=c,Vt=u,ct=d}}t._readOnly||(t._readOnly=!0);let p=n._dirtyLeaves,m=n._dirtyElements,_=n._normalizedNodes,C=n._updateTags,x=n._deferred;l&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(b,N){let A=b._decorators,O=b._pendingDecorators||A,P=N._nodeMap,I;for(I in O)P.has(I)||(O===A&&(O=Oy(b)),delete O[I])}(n,t);let y=o?null:jn(mn(n));if(n._editable&&y!==null&&(l||a===null||a.dirty||!a.is(i))&&r!==null&&!C.has(cy)){ct=n,lt=t;try{if(g!==null&&g.disconnect(),l||a===null||a.dirty){let b=n._blockCursorElement;b!==null&&hf(b,n,r),uv(i,a,n,y,C,r)}(function(b,N,A){let O=b._blockCursorElement;if(Q(A)&&A.isCollapsed()&&A.anchor.type==="element"&&N.contains(document.activeElement)){let P=A.anchor,I=P.getNode(),z=P.offset,G=!1,q=null;if(z===I.getChildrenSize())Ug(I.getChildAtIndex(z-1))&&(G=!0);else{let K=I.getChildAtIndex(z);if(K!==null&&Ug(K)){let le=K.getPreviousSibling();(le===null||Ug(le))&&(G=!0,q=b.getElementByKey(K.__key))}}if(G){let K=b.getElementByKey(I.__key);return O===null&&(b._blockCursorElement=O=function(le){let ie=le.theme,pe=document.createElement("div");pe.contentEditable="false",pe.setAttribute("data-lexical-cursor","true");let xe=ie.blockCursor;if(xe!==void 0){if(typeof xe=="string"){let ht=xx(xe);xe=ie.blockCursor=ht}xe!==void 0&&pe.classList.add(...xe)}return pe}(b._config)),N.style.caretColor="transparent",void(q===null?K.appendChild(O):K.insertBefore(O,q))}}O!==null&&hf(O,b,N)})(n,r,a)}finally{g!==null&&g.observe(r,ex),ct=d,lt=c}}f!==null&&function(b,N,A,O,P){let I=Array.from(b._listeners.mutation),z=I.length;for(let G=0;G<z;G++){let[q,K]=I[G];for(let le of K){let ie=N.get(le);ie!==void 0&&q(ie,{dirtyLeaves:O,prevEditorState:P,updateTags:A})}}}(n,f,C,p,s),Q(a)||a===null||i!==null&&i.is(a)||n.dispatchCommand(yf,void 0);let S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,ma("decorator",n,!0,S)),function(b,N,A){let O=lx(N),P=lx(A);O!==P&&ma("textcontent",b,!0,P)}(n,e||s,t),ma("update",n,!0,{dirtyElements:m,dirtyLeaves:p,editorState:t,mutatedNodes:f,normalizedNodes:_,prevEditorState:e||s,tags:C}),function(b,N){if(b._deferred=[],N.length!==0){let A=b._updating;b._updating=!0;try{for(let O=0;O<N.length;O++)N[O]()}finally{b._updating=A}}}(n,x),function(b){let N=b._updates;if(N.length!==0){let A=N.shift();if(A){let[O,P]=A;Gc(b,O,P)}}}(n)}function ma(n,e,t,...r){let o=e._updating;e._updating=t;try{let s=Array.from(e._listeners[n]);for(let i=0;i<s.length;i++)s[i].apply(null,r)}finally{e._updating=o}}function ox(n,e){let t=n._updates,r=e||!1;for(;t.length!==0;){let o=t.shift();if(o){let[s,i]=o,a=n._pendingEditorState,l;i!==void 0&&(l=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&D(191),a._flushSync=!0),l&&n._deferred.push(l),yy(n,i.tag)),a==null?Gc(n,s,i):s()}}return r}function Gc(n,e,t){let r=n._updateTags,o,s=!1,i=!1;t!==void 0&&(o=t.onUpdate,yy(n,t.tag),s=t.skipTransforms||!1,i=t.discrete||!1),o&&n._deferred.push(o);let a=n._editorState,l=n._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=by(l||a),c=!0),l._flushSync=i;let u=lt,d=Vt,h=ct,g=n._updating;lt=l,Vt=!1,n._updating=!0,ct=n;let f=n._headless||n.getRootElement()===null;Lf(null);try{c&&(f?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=function(C,x){let y=C.getEditorState()._selection,S=jn(mn(C));return Q(y)||y==null?Wc(y,S,C,x):y.clone()}(n,t&&t.event||null));let m=n._compositionKey;e(),s=ox(n,s),function(C,x){let y=x.getEditorState()._selection,S=C._selection;if(Q(S)){let b=S.anchor,N=S.focus,A;if(b.type==="text"&&(A=b.getNode(),A.selectionTransform(y,S)),N.type==="text"){let O=N.getNode();A!==O&&O.selectionTransform(y,S)}}}(l,n),n._dirtyType!==0&&(s?function(C,x){let y=x._dirtyLeaves,S=C._nodeMap;for(let b of y){let N=S.get(b);Y(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&DC(N)}}(l,n):function(C,x){let y=x._dirtyLeaves,S=x._dirtyElements,b=C._nodeMap,N=oo(),A=new Map,O=y,P=O.size,I=S,z=I.size;for(;P>0||z>0;){if(P>0){x._dirtyLeaves=new Set;for(let G of O){let q=b.get(G);Y(q)&&q.isAttached()&&q.isSimpleText()&&!q.isUnmergeable()&&DC(q),q!==void 0&&nx(q,N)&&tx(x,q,A),y.add(G)}if(O=x._dirtyLeaves,P=O.size,P>0){Sc++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,I.delete("root")&&I.set("root",!0);for(let G of I){let q=G[0],K=G[1];if(S.set(q,K),!K)continue;let le=b.get(q);le!==void 0&&nx(le,N)&&tx(x,le,A)}O=x._dirtyLeaves,P=O.size,I=x._dirtyElements,z=I.size,Sc++}x._dirtyLeaves=y,x._dirtyElements=S}(l,n),ox(n),function(C,x,y,S){let b=C._nodeMap,N=x._nodeMap,A=[];for(let[O]of S){let P=N.get(O);P!==void 0&&(P.isAttached()||(M(P)&&Sx(P,O,b,N,A,S),b.has(O)||S.delete(O),A.push(O)))}for(let O of A)N.delete(O);for(let O of y){let P=N.get(O);P===void 0||P.isAttached()||(b.has(O)||y.delete(O),N.delete(O))}}(a,l,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(l._flushSync=!0);let _=l._selection;if(Q(_)){let C=l._nodeMap,x=_.anchor.key,y=_.focus.key;C.get(x)!==void 0&&C.get(y)!==void 0||D(19)}else Uc(_)&&_._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void wr(n)}finally{lt=u,Vt=d,ct=h,n._updating=g,Sc=0}n._dirtyType!==0||n._deferred.length>0||function(m,_){let C=_.getEditorState()._selection,x=m._selection;if(x!==null){if(x.dirty||!x.is(C))return!0}else if(C!==null)return!0;return!1}(l,n)?l._flushSync?(l._flushSync=!1,wr(n)):c&&Ev(()=>{wr(n)}):(l._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function rn(n,e,t){ct===n&&t===void 0?e():Gc(n,e,t)}var ts=class{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new ts(this.element,e,this.after)}withAfter(e){return new ts(this.element,this.before,e)}withElement(e){return this.element===e?this:new ts(e,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&D(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&D(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&D(224),this.element.replaceChild(e,t),this}getFirstChild(){let 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(e===null)this.removeManagedLineBreak();else{let t=e==="decorator"&&(ba||ri||ya);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}let r=this.element,o=this.before,s=document.createElement("br");if(r.insertBefore(s,o),e){let i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",r.insertBefore(i,s),r.__lexicalLineBreak=i}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,o){if(r===this.element){let l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,o))]}let s=sx(t,r);s.push(o);let i=sx(t,this.element),a=e.getIndexWithinParent();for(let l=0;l<i.length;l++){let c=s[l],u=i[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[e.getParentOrThrow(),a]}};function sx(n,e){let t=[],r=e;for(;r!==n&&r!==null;r=r.parentNode){let o=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)o++;t.push(o)}return r!==n&&D(225),t.reverse()}var uo=class extends on{__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(){let e=this.getFormat();return Ew[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=Pe()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(Y(t)&&e.push(t),M(t)){let r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;M(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;M(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),r=t.length;if(e>=r){let s=t[r-1];return M(s)&&s.getLastDescendant()||s||null}let o=t[e];return M(o)&&o.getFirstDescendant()||o||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:nt(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&D(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:nt(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&D(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),r,o;if(e<t/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=e;){if(o===e)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=t-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="",t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){let s=t[o];e+=s.getTextContent(),M(s)&&o!==r-1&&!s.isInline()&&(e+=ao)}return e}getTextContentSize(){let e=0,t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){let s=t[o];e+=s.getTextContentSize(),M(s)&&o!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let t=AC[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Tt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return $c(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){it();let r=me(),o=e,s=t,i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let l=this.getFirstChild();if(Y(l)||M(l))return l.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){let l=this.getLastChild();if(Y(l)||M(l))return l.select()}}o===void 0&&(o=i),s===void 0&&(s=i);let a=this.__key;return Q(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,s,"element"),r.dirty=!0,r):py(a,o,a,s,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?AC[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){Rc(this)&&D(324,this.__key,this.__type);let o=this.getChildrenSize(),s=this.getWritable();e+t<=o||D(226,String(e),String(t),String(o));let i=s.__key,a=[],l=[],c=this.getChildAtIndex(e+t),u=null,d=o-t+r.length;if(e!==0)if(e===o)u=this.getLastChild();else{let g=this.getChildAtIndex(e);g!==null&&(u=g.getPreviousSibling())}if(t>0){let g=u===null?this.getFirstChild():u.getNextSibling();for(let f=0;f<t;f++){g===null&&D(100);let p=g.getNextSibling(),m=g.__key;io(g.getWritable()),l.push(m),g=p}}let h=u;for(let g of r){h!==null&&g.is(h)&&(u=h=h.getPreviousSibling());let f=g.getWritable();f.__parent===i&&d--,io(f);let p=g.__key;if(h===null)s.__first=p,f.__prev=null;else{let m=h.getWritable();m.__next=p,f.__prev=m.__key}g.__key===i&&D(76),f.__parent=i,a.push(p),h=g}if(e+t===o)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(c!==null){let g=c.getWritable();if(h!==null){let f=h.getWritable();g.__prev=h.__key,f.__next=c.__key}else g.__prev=null}if(s.__size=d,l.length){let g=me();if(Q(g)){let f=new Set(l),p=new Set(a),{anchor:m,focus:_}=g;ix(m,f,p)&&Dc(m,m.getNode(),this,u,c),ix(_,f,p)&&Dc(_,_.getNode(),this,u,c),d!==0||this.canBeEmpty()||kn(this)||this.remove()}}return s}getDOMSlot(e){return new ts(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(It(t)){let r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");let o=this.getDirection();o&&(t.dir=o)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r),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,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let r=this.getDOMSlot(e),o=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){let i=t.getElementByKey(s.getKey());i!==null&&(o==null?(r.insertChild(i),o=i):o!==i&&r.replaceChild(i,o),o=o.nextSibling)}}};function M(n){return n instanceof uo}function ix(n,e,t){let r=n.getNode();for(;r;){let o=r.__key;if(e.has(o)&&!t.has(o))return!0;r=r.getParent()}return!1}var va=class extends on{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Me(n){return n instanceof va}var ho=class extends uo{__cachedText;static getType(){return"root"}static clone(){return new ho}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){D(51)}getTextContent(){let e=this.__cachedText;return!ci()&&Pe()._dirtyType!==0||e===null?super.getTextContent():e}remove(){D(52)}replace(e){D(53)}insertBefore(e){D(54)}insertAfter(e){D(55)}updateDOM(e,t){return!1}splice(e,t,r){for(let o of r)M(o)||Me(o)||D(282);return super.splice(e,t,r)}static importJSON(e){return sn().updateFromJSON(e)}collapseAtStart(){return!0}};function ut(n){return n instanceof ho}function by(n){return new ss(new Map(n._nodeMap))}function kf(){return new ss(new Map([["root",new ho]]))}function Sy(n){let e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&D(130,t.name),M(n)){let r=e.children;Array.isArray(r)||D(59,t.name);let o=n.getChildren();for(let s=0;s<o.length;s++){let i=Sy(o[s]);r.push(i)}}return e}function mv(n){return n instanceof ss}var ss=class{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return rx(t&&t.editor||null,this,e)}clone(e){let t=new ss(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return rx(null,this,()=>({root:Sy(sn())}))}},Ic=class extends uo{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}},go=class extends uo{static getType(){return"paragraph"}static clone(e){return new go(e.__key)}createDOM(e){let t=document.createElement("p"),r=ni(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:_v,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(It(t)){this.isEmpty()&&t.append(document.createElement("br"));let r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return Or().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){let r=Or();r.setTextFormat(e.format),r.setTextStyle(e.style);let o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||Y(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function _v(n){let e=Or();return n.style&&(e.setFormat(n.style.textAlign),Wy(n,e)),{node:e}}function Or(){return Ma(new go)}function Ty(n){return n instanceof go}var Cv=0,xv=1,yv=2,bv=3,Sv=4;function Ny(n,e,t,r){let o=n._keyToDOMMap;o.clear(),n._editorState=kf(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;let s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function Ey(n){let e=new Set,t=new Set,r=n;for(;r;){let{ownNodeConfig:o}=Da(r),s=r.transform;if(!t.has(s)){t.add(s);let i=r.transform();i&&e.add(i)}if(o){let i=o.$transform;i&&e.add(i),r=o.extends}else{let i=Object.getPrototypeOf(r);r=i.prototype instanceof on&&i!==on?i:void 0}}return e}function Tv(n){let e=n||{},t=fv(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,i=kf(),a=e.namespace||(o!==null?o._config.namespace:Ry()),l=e.editorState,c=[ho,Rr,lo,co,go,Ic,...e.nodes||[]],{onError:u,html:d}=e,h=e.editable===void 0||e.editable,g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let p=0;p<c.length;p++){let m=c[p],_=null,C=null;if(typeof m!="function"){let S=m;m=S.replace,_=S.with,C=S.withKlass||null}Da(m);let x=m.getType(),y=Ey(m);g.set(x,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:_,replaceWithKlass:C,sharedNodeState:Ax(c[p]),transforms:y})}}let f=new kr(i,o,g,{disableEvents:s,namespace:a,theme:r},u||console.error,function(p,m){let _=new Map,C=new Set,x=y=>{Object.keys(y).forEach(S=>{let b=_.get(S);b===void 0&&(b=[],_.set(S,b)),b.push(y[S])})};return p.forEach(y=>{let S=y.klass.importDOM;if(S==null||C.has(S))return;C.add(S);let b=S.call(y.klass);b!==null&&x(b)}),m&&x(m),_}(g,d?d.import:void 0),h,n);return l!==void 0&&(f._pendingEditorState=l,f._dirtyType=2),f}var kr=class{_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,r,o,s,i,a,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 Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,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=Ry(),this._onError=s,this._htmlConversions=i,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&D(35);let o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);let s=o.get(e);s===void 0&&D(36,String(e));let i=s[r];return i.add(t),()=>{i.delete(t),s.every(a=>a.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){let o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation,i=s.get(t);i===void 0&&(i=new Set,s.set(t,i)),i.add(o);let a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,o),()=>{i.delete(o),i.size===0&&s.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&D(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let r=this._editorState,o=ff(r).get(t.getType());if(!o)return;let s=new Map;for(let i of o.keys())s.set(i,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){let r=this.registerNodeTransformToKlass(e,t),o=[r],s=r.replaceWithKlass;if(s!=null){let i=this.registerNodeTransformToKlass(s,t);o.push(i)}return function(i,a){let l=ff(i.getEditorState()),c=[];for(let u of a){let d=l.get(u);d&&c.push(d)}c.length!==0&&i.update(()=>{for(let u of c)for(let d of u.keys()){let h=nt(d);h&&h.markDirty()}},i._pendingEditorState===null?{tag:bc}:void 0)}(this,o.map(i=>i.klass.getType())),()=>{o.forEach(i=>i.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return H(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let r=ni(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,Ny(this,t,e,o),t!==null&&(this._config.disableEvents||qw(t),r!=null&&t.classList.remove(...r)),e!==null){let s=Kf(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,Ex(this),this._updateTags.add(bc),wr(this),this._config.disableEvents||function(a,l){let c=a.ownerDocument;of.set(a,c);let u=Lc.get(c)??0;u<1&&c.addEventListener("selectionchange",sy),Lc.set(c,u+1),a.__lexicalEditor=l;let d=oy(a);for(let h=0;h<rf.length;h++){let[g,f]=rf[h],p=typeof f=="function"?m=>{HC(m)||(BC(m),(l.isEditable()||g==="click")&&f(m,l))}:m=>{if(HC(m))return;BC(m);let _=l.isEditable();switch(g){case"cut":return _&&H(l,Ef,m);case"copy":return H(l,Nf,m);case"paste":return _&&H(l,bf,m);case"dragstart":return _&&H(l,Vx,m);case"dragover":return _&&H(l,Yx,m);case"dragend":return _&&H(l,jx,m);case"focus":return _&&H(l,qx,m);case"blur":return _&&H(l,Zx,m);case"drop":return _&&H(l,Gx,m)}};a.addEventListener(g,p),d.push(()=>{a.removeEventListener(g,p)})}}(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(bc),wr(this);ma("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&D(38);let r=e;r._readOnly&&(r=by(e),r._selection=e._selection?e._selection.clone():null),Nx(this);let o=this._pendingEditorState,s=this._updateTags,i=t!==void 0?t.tag:null;o===null||o.isEmpty()||(i!=null&&s.add(i),wr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&s.add(i),this._updating||wr(this)}parseEditorState(e,t){return function(r,o,s){let i=kf(),a=lt,l=Vt,c=ct,u=o._dirtyElements,d=o._dirtyLeaves,h=o._cloneNotNeeded,g=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,lt=i,Vt=!1,ct=o,Lf(null);try{let f=o._nodes;Of(r.root,f),s&&s(),i._readOnly=!0}catch(f){f instanceof Error&&o._onError(f)}finally{o._dirtyElements=u,o._dirtyLeaves=d,o._cloneNotNeeded=h,o._dirtyType=g,lt=a,Vt=l,ct=c}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return wr(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,o,s){r._updating?r._updates.push([o,s]):Gc(r,o,s)})(this,e,t)}focus(e,t={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),rn(this,()=>{let o=me(),s=sn();o!==null?o.dirty||Yt(o.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Py("focus"),Fy(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=jn(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ma("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};nn(kr,"version");kr.version="0.38.2+prod.esm";var df=null;function Lf(n){df=n}var Ay=1;function Nv(){Ay=1}function Rf(n,e){let t=Mf(n,e);return t===void 0&&D(30,e),t}function Mf(n,e){return n._nodes.get(e)}var Ev=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function ax(n){return Me(jc(n))}function Df(n){let e=document.activeElement;if(!It(e))return!1;let t=e.nodeName;return Me(jc(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&La(e)==null)}function ka(n,e,t){let r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Df(e)&&If(e)===n}catch{return!1}}function Vc(n){return n instanceof kr}function If(n){let e=n;for(;e!=null;){let t=La(e);if(Vc(t))return t;e=Ra(e)}return null}function La(n){return n?n.__lexicalEditor:null}function Av(n){return Sw.test(n)?"rtl":Tw.test(n)?"ltr":null}function so(n){return wf(n)||n.isToken()}function Er(n){return so(n)||n.isSegmented()}function qn(n){return ui(n)&&n.nodeType===3}function wy(n){return ui(n)&&n.nodeType===9}function is(n){let e=n;for(;e!=null;){if(qn(e))return e;e=e.firstChild}return null}function $c(n,e,t){let r=Tt[e];if(t!==null&&(n&r)===(t&r))return n;let o=n^r;return e==="subscript"?o&=~Tt.superscript:e==="superscript"?o&=~Tt.subscript:e==="lowercase"?(o&=~Tt.uppercase,o&=~Tt.capitalize):e==="uppercase"?(o&=~Tt.lowercase,o&=~Tt.capitalize):e==="capitalize"&&(o&=~Tt.lowercase,o&=~Tt.uppercase),o}function wv(n){return Y(n)||es(n)||Me(n)}function vy(n,e){let t=function(){let i=df;return df=null,i}();if((e=e||t&&t.__key)!=null)return void(n.__key=e);it(),Cy();let r=Pe(),o=Pr(),s=""+Ay++;o._nodeMap.set(s,n),M(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function io(n){let e=n.getParent();if(e!==null){let t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),s=n.getNextSibling(),i=s!==null?s.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=s!==null?s.getWritable():null;o===null&&(r.__first=i),s===null&&(r.__last=a),l!==null&&(l.__next=i),c!==null&&(c.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function Pc(n){Cy(),Rc(n)&&D(323,n.__key,n.__type);let e=n.getLatest(),t=e.__parent,r=Pr(),o=Pe(),s=r._nodeMap,i=o._dirtyElements;t!==null&&function(l,c,u){let d=l;for(;d!==null;){if(u.has(d))return;let h=c.get(d);if(h===void 0)break;u.set(d,!1),d=h.__parent}}(t,s,i);let a=e.__key;o._dirtyType=1,M(n)?i.set(a,!0):o._dirtyLeaves.add(a)}function at(n){it();let e=Pe(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){let r=nt(t);r!==null&&r.getWritable()}if(n!==null){let r=nt(n);r!==null&&r.getWritable()}}}function oo(){return ci()?null:Pe()._compositionKey}function nt(n,e){let t=(e||Pr())._nodeMap.get(n);return t===void 0?null:t}function $f(n,e){let t=Yc(n,Pe());return t!==void 0?nt(t,e):null}function Yc(n,e){return n[`__lexicalKey_${e._key}`]}function jc(n,e){let t=n;for(;t!=null;){let r=$f(t,e);if(r!==null)return r;t=Ra(t)}return null}function Oy(n){let e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function lx(n){return n.read(()=>sn().getTextContent())}function sn(){return ky(Pr())}function ky(n){return n._nodeMap.get("root")}function Yt(n){it();let e=Pr();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Qs(n){let e=Pe(),t=function(r,o){let s=r;for(;s!=null;){let i=Yc(s,o);if(i!==void 0)return i;s=Ra(s)}return null}(n,e);return t===null?n===e.getRootElement()?nt("root"):null:nt(t)}function Ly(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Pf(n){let e=[],t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ry(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function My(n){return qn(n)?n.nodeValue:null}function Ff(n,e,t){let r=jn(mn(e));if(r===null)return;let o=r.anchorNode,{anchorOffset:s,focusOffset:i}=r;if(o!==null){let a=My(o),l=jc(o);if(a!==null&&Y(l)){if(a===Hc&&t){let c=t.length;a=t,s=c,i=c}a!==null&&Bf(l,a,s,i,n)}}}function Bf(n,e,t,r,o){let s=n;if(s.isAttached()&&(o||!s.isDirty())){let i=s.isComposing(),a=e;(i||o)&&e[e.length-1]===Hc&&(a=e.slice(0,-1));let l=s.getTextContent();if(o||a!==l){if(a===""){if(at(null),ya||ri||ba)s.remove();else{let p=Pe();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}let c=s.getParent(),u=us(),d=s.getTextContentSize(),h=oo(),g=s.getKey();if(s.isToken()||h!==null&&g===h&&!i||Q(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!i||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!i))return void s.markDirty();let f=me();if(!Q(f)||t===null||r===null)return void cx(s,a,f);if(f.setTextNodeRange(s,t,s,r),s.isSegmented()){let p=st(s.getTextContent());s.replace(p),s=p}cx(s,a,f)}}}function cx(n,e,t){if(n.setTextContent(e),Q(t)){let r=n.getKey();for(let o of["anchor","focus"]){let s=t[o];s.type==="text"&&s.key===r&&(s.offset=vn(n,s.offset,"clamp"))}}}function Cc(n,e,t){let r=e[t]||!1;return r==="any"||r===n[t]}function Dy(n,e){return Cc(n,e,"altKey")&&Cc(n,e,"ctrlKey")&&Cc(n,e,"shiftKey")&&Cc(n,e,"metaKey")}function Ne(n,e,t){return Dy(n,t)&&n.key.toLowerCase()===e.toLowerCase()}var Nr={ctrlKey:!Nn,metaKey:Nn},ux={altKey:Nn,ctrlKey:!Nn};function dx(n){return n.key==="Backspace"}function hx(n){return Ne(n,"a",Nr)}function vv(n){let e=sn();if(Q(n)){let t=n.anchor,r=n.focus,o=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Ec(n),n}{let t=e.select(0,e.getChildrenSize());return Yt(Ec(t)),t}}function ni(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});let t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;let o=n[e];if(typeof o=="string"){let s=xx(o);return t[e]=s,s}return o}function Hf(n,e,t,r,o){if(t.size===0)return;let s=r.__type,i=r.__key,a=e.get(s);a===void 0&&D(33,s);let l=a.klass,c=n.get(l);c===void 0&&(c=new Map,n.set(l,c));let u=c.get(i),d=u==="destroyed"&&o==="created";(u===void 0||d)&&c.set(i,d?"updated":o)}function Ov(n){let e=n.getType(),t=Pr();if(t._readOnly){let s=ff(t).get(e);return s?Array.from(s.values()):[]}let r=t._nodeMap,o=[];for(let[,s]of r)s instanceof n&&s.__type===e&&s.isAttached()&&o.push(s);return o}function gx(n,e,t){let r=n.getParent(),o=t,s=n;return r!==null&&(e&&t===0?(o=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(o=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?o-1:o)}function Iy(n,e){let t=n.offset;if(n.type==="element")return gx(n.getNode(),e,t);{let r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){let o=e?r.getPreviousSibling():r.getNextSibling();return o===null?gx(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function $y(n){let e=mn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function H(n,e,t){return function(r,o,s){let i=Pf(r);for(let a=4;a>=0;a--)for(let l=0;l<i.length;l++){let c=i[l],u=c._commands.get(o);if(u!==void 0){let d=u[a];if(d!==void 0){let h=Array.from(d),g=h.length,f=!1;if(rn(c,()=>{for(let p=0;p<g;p++)if(h[p](s,r))return void(f=!0)}),f)return f}}}return!1}(n,e,t)}function qc(n){return!ut(n)&&!n.isLastChild()&&!n.isInline()}function as(n,e){let t=n._keyToDOMMap.get(e);return t===void 0&&D(75,e),t}function Ra(n){let e=n.assignedSlot||n.parentElement;return Ky(e)?e.host:e}function zf(n){return wy(n)?n:It(n)?n.ownerDocument:null}function kv(n){return Pe()._updateTags.has(n)}function Py(n){it(),Pe()._updateTags.add(n)}function Fy(n){it(),Pe()._deferred.push(n)}function Fc(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Kf(n){let e=zf(n);return e?e.defaultView:null}function mn(n){let e=n._window;return e===null&&D(78),e}function Lv(n){return M(n)&&n.isInline()||Me(n)&&n.isInline()}function By(n){let e=n.getParentOrThrow();for(;e!==null;){if(kn(e))return e;e=e.getParentOrThrow()}return e}function kn(n){return ut(n)||M(n)&&n.isShadowRoot()}function Uf(n){let e=n.constructor.clone(n);return vy(e,null),e.afterCloneFrom(n),e}function Ma(n){let e=Pe(),t=n.getType(),r=Mf(e,t);r===void 0&&D(200,n.constructor.name,t);let{replace:o,replaceWithKlass:s}=r;if(o!==null){let i=o(n),a=i.constructor;return s!==null?i instanceof s||D(201,s.name,s.getType(),a.name,a.getType(),n.constructor.name,t):i instanceof n.constructor&&a!==n.constructor||D(202,a.name,a.getType(),n.constructor.name,t),i.__key===n.__key&&D(203,n.constructor.name,t,a.name,a.getType()),i}return n}function Kg(n,e){!ut(n.getParent())||M(e)||Me(e)||D(99)}function Hy(n){let e=nt(n);return e===null&&D(63,n),e}function Ug(n){return(Me(n)||M(n)&&!n.canBeEmpty())&&!n.isInline()}function hf(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;let r=n.parentElement;r!==null&&r.removeChild(n)}function jn(n){return Ln?(n||window).getSelection():null}function zy(n){let e=Kf(n);return e?e.getSelection():null}function Rv(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),kn(n)&&D(102);let r=i=>{let a=i.getParentOrThrow(),l=kn(a),c=i!==t||l?Uf(i):i;if(l)return M(i)&&M(c)||D(133),i.insertAfter(c),[i,c,c];{let[u,d,h]=r(a),g=i.getNextSiblings();return h.append(c,...g),[u,d,c]}},[o,s]=r(t);return[o,s]}function Mv(n){return It(n)&&n.tagName==="A"}function It(n){return ui(n)&&n.nodeType===1}function ui(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Ky(n){return ui(n)&&n.nodeType===11}function Uy(n){let e=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 n.nodeName.match(e)!==null}function gf(n){let e=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 n.nodeName.match(e)!==null}function vr(n){if(Me(n)&&!n.isInline())return!0;if(!M(n)||kn(n))return!1;let e=n.getFirstChild(),t=e===null||es(e)||Y(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Wf(){return Pe()}var fx=new WeakMap,Dv=new Map;function ff(n){if(!n._readOnly&&n.isEmpty())return Dv;n._readOnly||D(192);let e=fx.get(n);return e||(e=function(t){let r=new Map;for(let[o,s]of t._nodeMap){let i=s.__type,a=r.get(i);a||(a=new Map,r.set(i,a)),a.set(o,s)}return r}(n),fx.set(n,e)),e}function Gf(n){let e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Iv(n){return(e=Gf(n))[iy]=!0,e;var e}function Wy(n,e){let t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function $v(n){n.__lexicalUnmanaged=!0}function Gy(n){return n.__lexicalUnmanaged===!0}function da(n,e){return function(t,r){return Object.prototype.hasOwnProperty.call(t,r)}(n,e)&&n[e]!==on[e]}function Da(n){let e=wC in n.prototype?n.prototype[wC]():void 0,t=function(i){if(!(i===on||i.prototype instanceof on)){let a="<unknown>",l="<unknown>";try{a=i.getType()}catch{}try{kr.version&&(l=JSON.parse(kr.version))}catch{}D(290,i.name,a,l)}return i===va||i===uo||i===on}(n),r=!t&&da(n,"getType")?n.getType():void 0,o,s=r;if(e)if(r)o=e[r];else for(let[i,a]of Object.entries(e))s=i,o=a;if(!t&&s&&(da(n,"getType")||(n.getType=()=>s),da(n,"clone")||(n.clone=i=>(Lf(i),new n)),da(n,"importJSON")||(n.importJSON=o&&o.$importJSON||(i=>new n().updateFromJSON(i))),!da(n,"importDOM")&&o)){let{importDOM:i}=o;i&&(n.importDOM=()=>i)}return{ownNodeConfig:o,ownNodeType:s}}function Pv(n){let e=Wf();return it(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}var _a=(n,e)=>{let t=n;for(;t!=null&&!ut(t);){if(e(t))return t;t=t.getParent()}return null},Fv={next:"previous",previous:"next"},ii=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return jf({hasNext:cs,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return dt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return dt(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){let o=r===this.direction?t:Array.from(t).reverse(),s=this,i=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){let c=l.origin.getWritable();a.set(c.getKey(),c)}for(let l of o){if(a.size>0){let c=s.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||s.origin.is(l))){let u=l.getParent();u&&u.is(i)&&l.remove(),c.replace(l)}}else c===null&&D(263,Array.from(a).join(" "))}else s.insert(l);s=dt(l,this.direction)}for(let l of a.values())l.remove();return this}},ls=class extends ii{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:$r(e,this.direction)}getParentCaret(e="root"){return dt(Vf(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Co(this.direction);return dt(this.getNodeAtCaret(),e)||$r(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof ls&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Bv={root:ut,shadowRoot:kn};function Co(n){return Fv[n]}function Vf(n,e="root"){return Bv[e](n)?null:n}var Dr=class extends ii{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:dt(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return M(this.origin)?$r(this.origin,this.direction):null}getParentCaret(e="root"){return dt(Vf(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Co(this.direction);return dt(this.getNodeAtCaret(),e)||$r(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Dr&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Dr||e instanceof Ir)&&this.direction===e.direction&&this.origin.is(e.origin)}},Ir=class extends ii{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:fo(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return dt(Vf(this.getParentAtCaret(),e),this.direction)}getFlipped(){return fo(this.origin,Co(this.direction),this.offset)}isSamePointCaret(e){return e instanceof Ir&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Dr||e instanceof Ir)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return dt(this.origin,this.direction)}};function Lr(n){return n instanceof Ir}function Hv(n){return n instanceof ii}function cs(n){return n instanceof Dr}function wn(n){return n instanceof ls}var zv={next:class extends Ir{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Ir{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Kv={next:class extends Dr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Dr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Uv={next:class extends ls{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends ls{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function dt(n,e){return n?new Kv[e](n):null}function fo(n,e,t){return n?new zv[e](n,vn(n,t)):null}function vn(n,e,t="error"){let r=n.getTextContentSize(),o=e==="next"?r:e==="previous"?0:e;return(o<0||o>r)&&(t!=="clamp"&&_x(284,String(e),String(r),n.getKey()),o=o<0?0:r),o}function pf(n,e){return new Bc(n,e)}function $r(n,e){return M(n)?new Uv[e](n):null}function Vy(n){return n&&n.getChildCaret()||n}function ai(n){return n&&Vy(n.getAdjacentCaret())}var Oa=class{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Oa(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=o=>{let s=this[o].getLatest();return Lr(s)?function(i,a){let{direction:l,origin:c}=i,u=vn(c,a==="focus"?Co(l):l);return pf(i,u-i.offset)}(s,o):null},t=e("anchor"),r=e("focus");if(t&&r){let{caret:o}=t,{caret:s}=r;if(o.isSameNodeCaret(s))return[pf(o,s.offset-o.offset),null]}return[t,r]}iterNodeCarets(e="root"){let t=Lr(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Lr(r),s=i=>i.isSameNodeCaret(r)?null:ai(i)||i.getParentCaret(e);return jf({hasNext:i=>i!==null&&!(o&&r.isSameNodeCaret(i)),initial:t.isSameNodeCaret(r)?null:s(t),map:i=>i,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Bc=class{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[r,o]=this.getSliceIndices(),s=e.getTextContent();return fo(e.setTextContent(s.slice(0,r)+s.slice(o)),t,r)}};function Wv(n){return n instanceof Bc}function Yf(n){return po(n,dt(sn(),n.direction))}function Yy(n){return po(n,n)}function po(n,e){return n.direction!==e.direction&&D(265),new Oa(n,e,n.direction)}function jf(n){let{initial:e,hasNext:t,step:r,map:o}=n,s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};let i={done:!1,value:o(s)};return s=r(s),i}}}function qf(n,e){let t=Ca(n.origin,e.origin);switch(t===null&&D(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{let r=n.type==="text",o=e.type==="text";return r&&o?function(s,i){return Math.sign(s-i)}(n.offset,e.offset):n.type===e.type?0:r?-1:o?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return Zf(t)}}function Zf(n){let{a:e,b:t}=n,r=e.__key,o=t.__key,s=e,i=t;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===o)return-1;if(i.__key===r)return 1}return s===null?1:-1}function xc(n,e){return e.is(n)}function px(n){return M(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function Ca(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};let t=new Map;for(let[r,o]=px(n);r;o=r,r=r.getParent())t.set(r,o);for(let[r,o]=px(e);r;o=r,r=r.getParent()){let s=t.get(r);if(s!==void 0)return s===null?(xc(n,r)||D(276),{commonAncestor:r,type:"ancestor"}):o===null?(xc(e,r)||D(277),{commonAncestor:r,type:"descendant"}):((M(s)||xc(n,s))&&(M(o)||xc(e,o))&&r.is(s.getParent())&&r.is(o.getParent())||D(278),{a:s,b:o,commonAncestor:r,type:"branch"})}return null}function mo(n,e){let{type:t,key:r,offset:o}=n,s=Hy(n.key);return t==="text"?(Y(s)||D(266,s.getType(),r),fo(s,e,o)):(M(s)||D(267,s.getType(),r),Jy(s,n.offset,e))}function li(n,e){let{origin:t,direction:r}=e,o=r==="next";Lr(e)?n.set(t.getKey(),e.offset,"text"):cs(e)?Y(t)?n.set(t.getKey(),vn(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(o?1:0),"element"):(wn(e)&&M(t)||D(268),n.set(t.getKey(),o?0:t.getChildrenSize(),"element"))}function jy(n){let e=me(),t=Q(e)?e:my();return xa(t,n),Yt(t),t}function xa(n,e){li(n.anchor,e.anchor),li(n.focus,e.focus)}function mf(n){let{anchor:e,focus:t}=n,r=mo(e,"next"),o=mo(t,"next"),s=qf(r,o)<=0?"next":"previous";return po(_o(r,s),_o(o,s))}function di(n){let{direction:e,origin:t}=n,r=dt(t,Co(e)).getNodeAtCaret();return r?dt(r,e):$r(t.getParentOrThrow(),e)}function mx(n,e="root"){let t=[n];for(let r=wn(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(di(r));return t}function Wg(n){return!!n&&n.origin.isAttached()}function qy(n,e="removeEmptySlices"){if(n.isCollapsed())return n;let t="root",r="next",o=e,s=Jf(n,r),i=mx(s.anchor,t),a=mx(s.focus.getFlipped(),t),l=new Set,c=[];for(let f of s.iterNodeCarets(t))if(wn(f))l.add(f.origin.getKey());else if(cs(f)){let{origin:p}=f;M(p)&&!l.has(p.getKey())||c.push(p)}for(let f of c)f.remove();for(let f of s.getTextSlices()){if(!f)continue;let{origin:p}=f.caret,m=p.getTextContentSize(),_=di(dt(p,r)),C=p.getMode();if(Math.abs(f.distance)===m&&o==="removeEmptySlices"||C==="token"&&f.distance!==0)_.remove();else if(f.distance!==0){o="removeEmptySlices";let x=f.removeTextSlice(),y=f.caret.origin;if(C==="segmented"){let S=x.origin,b=st(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());_.replaceOrInsert(b),x=fo(b,r,x.offset)}y.is(i[0].origin)&&(i[0]=x),y.is(a[0].origin)&&(a[0]=x.getFlipped())}}let u,d;for(let f of i)if(Wg(f)){u=En(f);break}for(let f of a)if(Wg(f)){d=En(f);break}let h=function(f,p,m){if(!f||!p)return null;let _=f.getParentAtCaret(),C=p.getParentAtCaret();if(!_||!C)return null;let x=_.getParents().reverse();x.push(_);let y=C.getParents().reverse();y.push(C);let S=Math.min(x.length,y.length),b;for(b=0;b<S&&x[b]===y[b];b++);let N=(P,I)=>{let z;for(let G=b;G<P.length;G++){let q=P[G];if(kn(q))return;!z&&I(q)&&(z=q)}return z},A=N(x,vr),O=A&&N(y,P=>m.has(P.getKey())&&vr(P));return A&&O?[A,O]:null}(u,d,l);if(h){let[f,p]=h;$r(f,"previous").splice(0,p.getChildren()),p.remove()}let g=[u,d,...i,...a].find(Wg);if(g)return Yy(_o(En(g),n.direction));D(269,JSON.stringify(i.map(f=>f.origin.__key)))}function En(n){let e=function(o){let s=o;for(;wn(s);){let i=ai(s);if(!wn(i))break;s=i}return s}(n.getLatest()),{direction:t}=e;if(Y(e.origin))return Lr(e)?e:fo(e.origin,t,t);let r=e.getAdjacentCaret();return cs(r)&&Y(r.origin)?fo(r.origin,t,Co(t)):e}function Zy(n){return Lr(n)&&n.offset!==vn(n.origin,n.direction)}function _o(n,e){return n.direction===e?n:n.getFlipped()}function Jf(n,e){return n.direction===e?n:po(_o(n.focus,e),_o(n.anchor,e))}function Jy(n,e,t){let r=$r(n,"next");for(let o=0;o<e;o++){let s=r.getAdjacentCaret();if(s===null)break;r=s}return _o(r,t)}function Gv(n,e="root"){let t=0,r=n,o=ai(r);for(;o===null;){if(t--,o=r.getParentCaret(e),!o)return null;r=o,o=ai(r)}return o&&[o,t]}function Vv(n){let{origin:e,offset:t,direction:r}=n;if(t===vn(e,r))return n.getSiblingCaret();if(t===vn(e,Co(r)))return di(n.getSiblingCaret());let[o]=e.splitText(t);return Y(o)||D(281),_o(dt(o,"next"),r)}function Yv(n,e){return!0}function jv(n,{$copyElementNode:e=Uf,$splitTextPointCaretNext:t=Vv,rootMode:r="shadowRoot",$shouldSplit:o=Yv}={}){if(Lr(n))return t(n);let s=n.getParentCaret(r);if(s){let{origin:i}=s;if(wn(n)&&(!i.canBeEmpty()||!o(i,"first")))return di(s);let a=function(l){let c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c}(n);(a.length>0||i.canBeEmpty()&&o(i,"last"))&&s.insert(e(i).splice(0,0,a))}return s}function qv(n){return n}function Zv(...n){return n}function Jv(n,e){return[n,e]}function Xv(n){return n}function Qv(n,e){if(!e||n===e)return n;for(let t in e)if(n[t]!==e[t])return{...n,...e};return n}var T=Xf,Xy=T.$addUpdateTag,ft=T.$applyNodeReplacement,xo=T.$caretFromPoint,Qy=T.$caretRangeFromSelection,Zc=T.$cloneWithProperties,e1=T.$cloneWithPropertiesEphemeral,oD=T.$comparePointCaretNext,sD=T.$copyNode,hi=T.$create,pt=T.$createLineBreakNode,Jc=T.$createNodeSelection,U=T.$createParagraphNode,Rn=T.$createPoint,Zn=T.$createRangeSelection,t1=T.$createRangeSelectionFromDom,an=T.$createTabNode,ye=T.$createTextNode,Ia=T.$extendCaretToRange,yo=T.$findMatchingParent,$a=T.$getAdjacentChildCaret,Qf=T.$getAdjacentNode,ds=T.$getAdjacentSiblingOrParentSiblingCaret,ep=T.$getCaretInDirection,Pa=T.$getCaretRange,tp=T.$getCaretRangeInDirection,n1=T.$getCharacterOffsets,ln=T.$getChildCaret,iD=T.$getChildCaretAtIndex,np=T.$getChildCaretOrSelf,r1=T.$getCollapsedCaretRange,aD=T.$getCommonAncestor,lD=T.$getCommonAncestorResultBranchOrder,Fr=T.$getEditor,We=T.$getNearestNodeFromDOMNode,o1=T.$getNearestRootOrShadowRoot,Fe=T.$getNodeByKey,cD=T.$getNodeByKeyOrThrow,s1=T.$getNodeFromDOMNode,Br=T.$getPreviousSelection,Be=T.$getRoot,w=T.$getSelection,mt=T.$getSiblingCaret,gi=T.$getState,uD=T.$getStateChange,dD=T.$getTextContent,hD=T.$getTextNodeOffset,rp=T.$getTextPointCaret,gD=T.$getTextPointCaretSlice,fD=T.$getWritableNodeState,i1=T.$hasAncestor,a1=T.$hasUpdateTag,Fa=T.$insertNodes,fi=T.$isBlockElementNode,bo=T.$isChildCaret,Et=T.$isDecoratorNode,l1=T.$isEditorState,F=T.$isElementNode,Xc=T.$isExtendableTextPointCaret,c1=T.$isInlineElementOrDecoratorNode,Ba=T.$isLeafNode,be=T.$isLineBreakNode,pD=T.$isNodeCaret,Ke=T.$isNodeSelection,rt=T.$isParagraphNode,v=T.$isRangeSelection,Hr=T.$isRootNode,Ze=T.$isRootOrShadowRoot,Qc=T.$isSiblingCaret,_t=T.$isTabNode,B=T.$isTextNode,eu=T.$isTextPointCaret,mD=T.$isTextPointCaretSlice,op=T.$isTokenOrSegmented,_D=T.$isTokenOrTab,CD=T.$nodesOfType,Mn=T.$normalizeCaret,zr=T.$normalizeSelection__EXPERIMENTAL,xD=T.$onUpdate,u1=T.$parseSerializedNode,yD=T.$removeTextFromCaretRange,d1=T.$rewindSiblingCaret,pi=T.$selectAll,bD=T.$setCompositionKey,So=T.$setPointFromCaret,De=T.$setSelection,Ha=T.$setSelectionFromCaretRange,To=T.$setState,h1=T.$splitAtPointCaretNext,tu=T.$splitNode,SD=T.$updateRangeSelectionFromCaretRange,sp=T.ArtificialNode__DO_NOT_USE,TD=T.BLUR_COMMAND,za=T.CAN_REDO_COMMAND,Ka=T.CAN_UNDO_COMMAND,nu=T.CLEAR_EDITOR_COMMAND,ru=T.CLEAR_HISTORY_COMMAND,No=T.CLICK_COMMAND,g1=T.COLLABORATION_TAG,Jn=T.COMMAND_PRIORITY_CRITICAL,W=T.COMMAND_PRIORITY_EDITOR,Je=T.COMMAND_PRIORITY_HIGH,de=T.COMMAND_PRIORITY_LOW,cn=T.COMMAND_PRIORITY_NORMAL,mi=T.CONTROLLED_TEXT_INSERTION_COMMAND,_i=T.COPY_COMMAND,Ci=T.CUT_COMMAND,un=T.DELETE_CHARACTER_COMMAND,hs=T.DELETE_LINE_COMMAND,xi=T.DELETE_WORD_COMMAND,ND=T.DRAGEND_COMMAND,f1=T.DRAGOVER_COMMAND,ou=T.DRAGSTART_COMMAND,su=T.DROP_COMMAND,Eo=T.DecoratorNode,Ye=T.ElementNode,p1=T.FOCUS_COMMAND,iu=T.FORMAT_ELEMENT_COMMAND,Kr=T.FORMAT_TEXT_COMMAND,yi=T.HISTORIC_TAG,gs=T.HISTORY_MERGE_TAG,m1=T.HISTORY_PUSH_TAG,$t=T.INDENT_CONTENT_COMMAND,bi=T.INSERT_LINE_BREAK_COMMAND,Xn=T.INSERT_PARAGRAPH_COMMAND,Ao=T.INSERT_TAB_COMMAND,Ua=T.INTERNAL_$isBlock,ED=T.IS_ALL_FORMATTING,AD=T.IS_BOLD,wD=T.IS_CODE,vD=T.IS_HIGHLIGHT,OD=T.IS_ITALIC,kD=T.IS_STRIKETHROUGH,LD=T.IS_SUBSCRIPT,RD=T.IS_SUPERSCRIPT,MD=T.IS_UNDERLINE,dn=T.KEY_ARROW_DOWN_COMMAND,Qn=T.KEY_ARROW_LEFT_COMMAND,wo=T.KEY_ARROW_RIGHT_COMMAND,Pt=T.KEY_ARROW_UP_COMMAND,vo=T.KEY_BACKSPACE_COMMAND,Si=T.KEY_DELETE_COMMAND,_1=T.KEY_DOWN_COMMAND,Ur=T.KEY_ENTER_COMMAND,Ti=T.KEY_ESCAPE_COMMAND,DD=T.KEY_MODIFIER_COMMAND,Ni=T.KEY_SPACE_COMMAND,_n=T.KEY_TAB_COMMAND,C1=T.LineBreakNode,au=T.MOVE_TO_END,Wa=T.MOVE_TO_START,ID=T.NODE_STATE_KEY,hn=T.OUTDENT_CONTENT_COMMAND,Oo=T.PASTE_COMMAND,Wr=T.PASTE_TAG,Ga=T.ParagraphNode,lu=T.REDO_COMMAND,cu=T.REMOVE_TEXT_COMMAND,Va=T.RootNode,er=T.SELECTION_CHANGE_COMMAND,Ya=T.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,uu=T.SELECT_ALL_COMMAND,$D=T.SKIP_COLLAB_TAG,ip=T.SKIP_DOM_SELECTION_TAG,x1=T.SKIP_SCROLL_INTO_VIEW_TAG,PD=T.SKIP_SELECTION_FOCUS_TAG,y1=T.TEXT_TYPE_TO_FORMAT,b1=T.TabNode,Ft=T.TextNode,du=T.UNDO_COMMAND,ap=T.buildImportMap,hu=T.configExtension,Ct=T.createCommand,S1=T.createEditor,FD=T.createSharedNodeState,gu=T.createState,T1=T.declarePeerDependency,ue=T.defineExtension,BD=T.flipDirection,HD=T.getDOMOwnerDocument,ko=T.getDOMSelection,zD=T.getDOMSelectionFromTarget,N1=T.getDOMTextNode,KD=T.getEditorPropertyFromDOMNode,fu=T.getNearestEditorFromDOMNode,E1=T.getRegisteredNode,UD=T.getRegisteredNodeOrThrow,WD=T.getStaticNodeConfig,lp=T.getTextDirection,GD=T.getTransformSetFromKlass,A1=T.isBlockDomNode,w1=T.isCurrentlyReadOnlyMode,v1=T.isDOMDocumentNode,jt=T.isDOMNode,VD=T.isDOMTextNode,YD=T.isDOMUnmanaged,cp=T.isDocumentFragment,jD=T.isExactShortcutMatch,O1=T.isHTMLAnchorElement,fs=T.isHTMLElement,ja=T.isInlineDomNode,qD=T.isLexicalEditor,ZD=T.isModifierMatch,k1=T.isSelectionCapturedInDecoratorInput,L1=T.isSelectionWithinEditor,up=T.makeStepwiseIterator,JD=T.removeFromParent,XD=T.resetRandomKey,xt=T.safeCast,R1=T.setDOMUnmanaged,dp=T.setNodeIndentFromDOM,Lo=T.shallowMergeConfig;var Cp={};Lt(Cp,{$addNodeStyle:()=>sO,$cloneWithProperties:()=>Zc,$copyBlockFormatIndent:()=>z1,$ensureForwardRangeSelection:()=>H1,$forEachSelectedTextNode:()=>B1,$getComputedStyleForElement:()=>pp,$getComputedStyleForParent:()=>mp,$getSelectionStyleValueForProperty:()=>gO,$isAtNodeEnd:()=>oO,$isParentElementRTL:()=>_p,$isParentRTL:()=>nO,$moveCaretSelection:()=>W1,$moveCharacter:()=>dO,$patchStyleText:()=>iO,$selectAll:()=>pi,$setBlocksType:()=>aO,$shouldOverrideDefaultCharacterSelection:()=>uO,$sliceSelectedTextNodeContent:()=>rO,$trimTextContentFromAnchor:()=>F1,$wrapNodes:()=>cO,createDOMRange:()=>eO,createRectsFromDOMRange:()=>tO,getCSSFromStyleObject:()=>P1,getStyleObjectFromCSS:()=>mu,trimTextContentFromAnchor:()=>fO});function fp(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var pu=new Map;function M1(n){let e=n;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function D1(n){let e=n.parentNode;if(e==null)throw new Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(n)]}function eO(n,e,t,r,o){let s=e.getKey(),i=r.getKey(),a=document.createRange(),l=n.getElementByKey(s),c=n.getElementByKey(i),u=t,d=o;if(B(e)&&(l=M1(l)),B(r)&&(c=M1(c)),e===void 0||r===void 0||l===null||c===null)return null;l.nodeName==="BR"&&([l,u]=D1(l)),c.nodeName==="BR"&&([c,d]=D1(c));let h=l.firstChild;l===c&&h!=null&&h.nodeName==="BR"&&u===0&&d===0&&(d=1);try{a.setStart(l,u),a.setEnd(c,d)}catch{return null}return!a.collapsed||u===d&&s===i||(a.setStart(c,d),a.setEnd(l,u)),a}function tO(n,e){let t=n.getRootElement();if(t===null)return[];let r=t.getBoundingClientRect(),o=getComputedStyle(t),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(e.getClientRects()),a,l=i.length;i.sort((c,u)=>{let d=c.top-u.top;return Math.abs(d)<=3?c.left-u.left:d});for(let c=0;c<l;c++){let u=i[c],d=a&&a.top<=u.top&&a.top+a.height>u.top&&a.left+a.width>u.left,h=u.width+s===r.width;d||h?(i.splice(c--,1),l--):a=u}return i}function $1(n){let e={};if(!n)return e;let t=n.split(";");for(let r of t)if(r!==""){let[o,s]=r.split(/:([^]+)/);o&&s&&(e[o.trim()]=s.trim())}return e}function mu(n){let e=pu.get(n);return e===void 0&&(e=$1(n),pu.set(n,e)),e}function P1(n){let e="";for(let t in n)t&&(e+=`${t}: ${n[t]};`);return e}function pp(n){let e=Fr().getElementByKey(n.getKey());if(e===null)return null;let t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function mp(n){return pp(Hr(n)?n:n.getParentOrThrow())}function nO(n){let e=mp(n);return e!==null&&e.direction==="rtl"}function rO(n,e,t="self"){let r=n.getStartEndPoints();if(e.isSelected(n)&&!op(e)&&r!==null){let[o,s]=r,i=n.isBackward(),a=o.getNode(),l=s.getNode(),c=e.is(a),u=e.is(l);if(c||u){let[d,h]=n1(n),g=a.is(l),f=e.is(i?l:a),p=e.is(i?a:l),m,_=0;g?(_=d>h?h:d,m=d>h?d:h):f?(_=i?h:d,m=void 0):p&&(_=0,m=i?d:h);let C=e.__text.slice(_,m);C!==e.__text&&(t==="clone"&&(e=e1(e)),e.__text=C)}}return e}function oO(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();let e=n.getNode();return F(e)||fp(177),n.offset===e.getChildrenSize()}function F1(n,e,t){let r=e.getNode(),o=t;if(F(r)){let s=r.getDescendantByIndex(e.offset);s!==null&&(r=s)}for(;o>0&&r!==null;){if(F(r)){let c=r.getLastDescendant();c!==null&&(r=c)}let s=r.getPreviousSibling(),i=0;if(s===null){let c=r.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){s=null;break}u=c.getPreviousSibling()}c!==null&&(i=c.isInline()?0:2,s=u)}let a=r.getTextContent();a===""&&F(r)&&!r.isInline()&&(a=`
`);let l=a.length;if(!B(r)||o>=l){let c=r.getParent();r.remove(),c==null||c.getChildrenSize()!==0||Hr(c)||c.remove(),o-=l+i,r=s}else{let c=r.getKey(),u=n.getEditorState().read(()=>{let g=Fe(c);return B(g)&&g.isSimpleText()?g.getTextContent():null}),d=l-o,h=a.slice(0,d);if(u!==null&&u!==a){let g=Br(),f=r;if(r.isSimpleText())r.setTextContent(u);else{let p=ye(u);r.replace(p),f=p}if(v(g)&&g.isCollapsed()){let p=g.anchor.offset;f.select(p,p)}}else if(r.isSimpleText()){let g=e.key===c,f=e.offset;f<o&&(f=l);let p=g?f-o:0,m=g?f:d;if(g&&p===0){let[_]=r.splitText(p,m);_.remove()}else{let[,_]=r.splitText(p,m);_.remove()}}else{let g=ye(h);r.replace(g)}o=0}}}function sO(n){let e=n.getStyle(),t=$1(e);pu.set(e,t)}function hp(n,e){(v(n)?n.isCollapsed():B(n)||F(n))||fp(280);let t=mu(v(n)?n.style:B(n)?n.getStyle():n.getTextStyle()),r=Object.entries(e).reduce((s,[i,a])=>(typeof a=="function"?s[i]=a(t[i],n):a===null?delete s[i]:s[i]=a,s),{...t}),o=P1(r);v(n)||B(n)?n.setStyle(o):n.setTextStyle(o),pu.set(o,r)}function iO(n,e){if(v(n)&&n.isCollapsed()){hp(n,e);let t=n.anchor.getNode();F(t)&&t.isEmpty()&&hp(t,e)}B1(t=>{hp(t,e)})}function B1(n){let e=w();if(!e)return;let t=new Map,r=s=>t.get(s.getKey())||[0,s.getTextContentSize()];if(v(e))for(let s of Qy(e).getTextSlices())s&&t.set(s.caret.origin.getKey(),s.getSliceIndices());let o=e.getNodes();for(let s of o){if(!B(s)||!s.canHaveFormat())continue;let[i,a]=r(s);a!==i&&(op(s)||i===0&&a===s.getTextContentSize()?n(s):n(s.splitText(i,a)[i===0?0:1]))}v(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&H1(e)}function H1(n){if(n.isBackward()){let{anchor:e,focus:t}=n,{key:r,offset:o,type:s}=e;e.set(t.key,t.offset,t.type),t.set(r,o,s)}}function z1(n,e){let t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function aO(n,e,t=z1){if(n===null)return;let r=n.getStartEndPoints(),o=new Map,s=null;if(r){let[i,a]=r;s=Zn(),s.anchor.set(i.key,i.offset,i.type),s.focus.set(a.key,a.offset,a.type);let l=yo(i.getNode(),Ua),c=yo(a.getNode(),Ua);F(l)&&o.set(l.getKey(),l),F(c)&&o.set(c.getKey(),c)}for(let i of n.getNodes())if(F(i)&&Ua(i))o.set(i.getKey(),i);else if(r===null){let a=yo(i,Ua);F(a)&&o.set(a.getKey(),a)}for(let[i,a]of o){let l=e();t(a,l),a.replace(l,!0),s&&(i===s.anchor.key&&s.anchor.set(l.getKey(),s.anchor.offset,s.anchor.type),i===s.focus.key&&s.focus.set(l.getKey(),s.focus.offset,s.focus.type))}s&&n.is(w())&&De(s)}function I1(n){return n.getNode().isAttached()}function lO(n){let e=n;for(;e!==null&&!Ze(e);){let t=e.getLatest(),r=e.getParent();t.getChildrenSize()===0&&e.remove(!0),e=r}}function cO(n,e,t=null){let r=n.getStartEndPoints(),o=r?r[0]:null,s=n.getNodes(),i=s.length;if(o!==null&&(i===0||i===1&&o.type==="element"&&o.getNode().getChildrenSize()===0)){let c=o.type==="text"?o.getNode().getParentOrThrow():o.getNode(),u=c.getChildren(),d=e();return d.setFormat(c.getFormatType()),d.setIndent(c.getIndent()),u.forEach(h=>d.append(h)),t&&(d=t.append(d)),void c.replace(d)}let a=null,l=[];for(let c=0;c<i;c++){let u=s[c];Ze(u)?(gp(n,l,l.length,e,t),l=[],a=u):a===null||a!==null&&i1(u,a)?l.push(u):(gp(n,l,l.length,e,t),l=[u])}gp(n,l,l.length,e,t)}function gp(n,e,t,r,o=null){if(e.length===0)return;let s=e[0],i=new Map,a=[],l=F(s)?s:s.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let c=!1;for(;l!==null;){let f=l.getPreviousSibling();if(f!==null){l=f,c=!0;break}if(l=l.getParentOrThrow(),Ze(l))break}let u=new Set;for(let f=0;f<t;f++){let p=e[f];F(p)&&p.getChildrenSize()===0&&u.add(p.getKey())}let d=new Set;for(let f=0;f<t;f++){let p=e[f],m=p.getParent();if(m!==null&&m.isInline()&&(m=m.getParent()),m!==null&&Ba(p)&&!d.has(p.getKey())){let _=m.getKey();if(i.get(_)===void 0){let C=r();C.setFormat(m.getFormatType()),C.setIndent(m.getIndent()),a.push(C),i.set(_,C),m.getChildren().forEach(x=>{C.append(x),d.add(x.getKey()),F(x)&&x.getChildrenKeys().forEach(y=>d.add(y))}),lO(m)}}else if(u.has(p.getKey())){F(p)||fp(179);let _=r();_.setFormat(p.getFormatType()),_.setIndent(p.getIndent()),a.push(_),p.remove(!0)}}if(o!==null)for(let f=0;f<a.length;f++){let p=a[f];o.append(p)}let h=null;if(Ze(l))if(c)if(o!==null)l.insertAfter(o);else for(let f=a.length-1;f>=0;f--){let p=a[f];l.insertAfter(p)}else{let f=l.getFirstChild();if(F(f)&&(l=f),f===null)if(o)l.append(o);else for(let p=0;p<a.length;p++){let m=a[p];l.append(m),h=m}else if(o!==null)f.insertBefore(o);else for(let p=0;p<a.length;p++){let m=a[p];f.insertBefore(m),h=m}}else if(o)l.insertAfter(o);else for(let f=a.length-1;f>=0;f--){let p=a[f];l.insertAfter(p),h=p}let g=Br();v(g)&&I1(g.anchor)&&I1(g.focus)?De(g.clone()):h!==null?h.selectEnd():n.dirty=!0}function K1(n){let e=U1(n);return e!==null&&e.writingMode==="vertical-rl"}function U1(n){let e=n.anchor.getNode();return F(e)?pp(e):mp(e)}function uO(n,e){let t=K1(n)?!e:e;_p(n)&&(t=!t);let r=xo(n.focus,t?"previous":"next");if(Xc(r))return!1;for(let o of Ia(r)){if(bo(o))return!o.origin.isInline();if(!F(o.origin)){if(Et(o.origin))return!0;break}}return!1}function W1(n,e,t,r){n.modify(e?"extend":"move",t,r)}function _p(n){let e=U1(n);return e!==null&&e.direction==="rtl"}function dO(n,e,t){let r=_p(n),o;o=K1(n)||r?!t:t,W1(n,e,o,"character")}function hO(n,e,t){let r=mu(n.getStyle());return r!==null&&r[e]||t}function gO(n,e,t=""){let r=null,o=n.getNodes(),s=n.anchor,i=n.focus,a=n.isBackward(),l=a?i.offset:s.offset,c=a?i.getNode():s.getNode();if(v(n)&&n.isCollapsed()&&n.style!==""){let u=mu(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<o.length;u++){let d=o[u];if((u===0||l!==0||!d.is(c))&&B(d)){let h=hO(d,e,t);if(r===null)r=h;else if(r!==h){r="";break}}}return r===null?t:r}var fO=F1;var Ie=Cp,G1=Ie.$addNodeStyle,nI=Ie.$cloneWithProperties,rI=Ie.$copyBlockFormatIndent,oI=Ie.$ensureForwardRangeSelection,sI=Ie.$forEachSelectedTextNode,iI=Ie.$getComputedStyleForElement,aI=Ie.$getComputedStyleForParent,_u=Ie.$getSelectionStyleValueForProperty,V1=Ie.$isAtNodeEnd,lI=Ie.$isParentElementRTL,xp=Ie.$isParentRTL,cI=Ie.$moveCaretSelection,Ei=Ie.$moveCharacter,Y1=Ie.$patchStyleText,uI=Ie.$selectAll,dI=Ie.$setBlocksType,Ai=Ie.$shouldOverrideDefaultCharacterSelection,Cu=Ie.$sliceSelectedTextNodeContent,hI=Ie.$trimTextContentFromAnchor,gI=Ie.$wrapNodes,fI=Ie.createDOMRange,j1=Ie.createRectsFromDOMRange,xu=Ie.getCSSFromStyleObject,ps=Ie.getStyleObjectFromCSS,pI=Ie.trimTextContentFromAnchor;var Tp={};Lt(Tp,{$descendantsMatching:()=>XO,$dfs:()=>IO,$dfsIterator:()=>sb,$filter:()=>YO,$findMatchingParent:()=>yo,$firstToLastIterator:()=>QO,$getAdjacentCaret:()=>$O,$getAdjacentSiblingOrParentSiblingCaret:()=>ds,$getDepth:()=>ab,$getNearestBlockElementAncestorOrThrow:()=>zO,$getNearestNodeOfType:()=>HO,$getNextRightPreorderNode:()=>BO,$getNextSiblingOrParentSibling:()=>FO,$insertFirst:()=>jO,$insertNodeToNearestRoot:()=>WO,$insertNodeToNearestRootAtCaret:()=>cb,$isEditorIsNestedEditor:()=>ZO,$lastToFirstIterator:()=>Sp,$restoreEditorState:()=>UO,$reverseDfs:()=>PO,$reverseDfsIterator:()=>lb,$splitNode:()=>tu,$unwrapAndFilterDescendants:()=>JO,$unwrapNode:()=>ek,$wrapNodeInElement:()=>GO,CAN_USE_BEFORE_INPUT:()=>NO,CAN_USE_DOM:()=>nb,IS_ANDROID:()=>EO,IS_ANDROID_CHROME:()=>AO,IS_APPLE:()=>wO,IS_APPLE_WEBKIT:()=>vO,IS_CHROME:()=>OO,IS_FIREFOX:()=>rb,IS_IOS:()=>kO,IS_SAFARI:()=>LO,addClassNamesToElement:()=>RO,calculateZoomLevel:()=>qO,isBlockDomNode:()=>A1,isHTMLAnchorElement:()=>O1,isHTMLElement:()=>fs,isInlineDomNode:()=>ja,isMimeType:()=>ob,makeStateWrapper:()=>tk,markSelection:()=>tb,mediaFileReader:()=>DO,mergeRegister:()=>Q1,objectKlassEquals:()=>VO,positionNodeOnRange:()=>eb,registerNestedElementResolver:()=>KO,removeClassNamesFromElement:()=>MO,selectionAlwaysOnDisplay:()=>TO});function yu(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Dn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,pO=Dn&&"documentMode"in document?document.documentMode:null,Z1=Dn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),mO=Dn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_O=!(!Dn||!("InputEvent"in window)||pO)&&"getTargetRanges"in new window.InputEvent("input"),CO=Dn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),xO=Dn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,J1=Dn&&/Android/.test(navigator.userAgent),bp=Dn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yO=Dn&&J1&&bp,bO=Dn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Z1&&!bp;function X1(...n){let e=[];for(let t of n)if(t&&typeof t=="string")for(let[r]of t.matchAll(/\S+/g))e.push(r);return e}function Q1(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function tr(n){return`${n}px`}var SO={attributes:!0,characterData:!0,childList:!0,subtree:!0};function eb(n,e,t){let r=null,o=null,s=null,i=[],a=document.createElement("div");function l(){r===null&&yu(182),o===null&&yu(183);let{left:d,top:h}=o.getBoundingClientRect(),g=j1(n,e);var f,p;a.isConnected||(p=a,(f=o).insertBefore(p,f.firstChild));let m=!1;for(let _=0;_<g.length;_++){let C=g[_],x=i[_]||document.createElement("div"),y=x.style;y.position!=="absolute"&&(y.position="absolute",m=!0);let S=tr(C.left-d);y.left!==S&&(y.left=S,m=!0);let b=tr(C.top-h);y.top!==b&&(x.style.top=b,m=!0);let N=tr(C.width);y.width!==N&&(x.style.width=N,m=!0);let A=tr(C.height);y.height!==A&&(x.style.height=A,m=!0),x.parentNode!==a&&(a.append(x),m=!0),i[_]=x}for(;i.length>g.length;)i.pop();m&&t(i)}function c(){o=null,r=null,s!==null&&s.disconnect(),s=null,a.remove();for(let d of i)d.remove();i=[]}a.style.position="relative";let u=n.registerRootListener(function d(){let h=n.getRootElement();if(h===null)return c();let g=h.parentElement;if(!fs(g))return c();c(),r=h,o=g,s=new MutationObserver(f=>{let p=n.getRootElement(),m=p&&p.parentElement;if(p!==r||m!==o)return d();for(let _ of f)if(!a.contains(_.target))return l()}),s.observe(g,SO),l()});return()=>{u(),c()}}function q1(n,e,t){if(n.type!=="text"&&F(e)){let r=e.getDOMSlot(t);return[r.element,r.getFirstChildOffset()+n.offset]}return[N1(t)||t,n.offset]}function tb(n,e){let t=null,r=null,o=null,s=null,i=null,a=null,l=()=>{};function c(u){u.read(()=>{let d=w();if(!v(d))return t=null,o=null,s=null,a=null,l(),void(l=()=>{});let[h,g]=function(A){let O=A.getStartEndPoints();return A.isBackward()?[O[1],O[0]]:O}(d),f=h.getNode(),p=f.getKey(),m=h.offset,_=g.getNode(),C=_.getKey(),x=g.offset,y=n.getElementByKey(p),S=n.getElementByKey(C),b=t===null||y!==r||m!==o||p!==t.getKey(),N=s===null||S!==i||x!==a||C!==s.getKey();if((b||N)&&y!==null&&S!==null){let A=function(O,P,I,z,G,q,K){let le=(O._window?O._window.document:document).createRange();return le.setStart(...q1(P,I,z)),le.setEnd(...q1(G,q,K)),le}(n,h,f,y,g,_,S);l(),l=eb(n,A,O=>{if(e===void 0)for(let P of O){let I=P.style;I.background!=="Highlight"&&(I.background="Highlight"),I.color!=="HighlightText"&&(I.color="HighlightText"),I.marginTop!==tr(-1.5)&&(I.marginTop=tr(-1.5)),I.paddingTop!==tr(4)&&(I.paddingTop=tr(4)),I.paddingBottom!==tr(0)&&(I.paddingBottom=tr(0))}else e(O)})}t=f,r=y,o=m,s=_,i=S,a=x})}return c(n.getEditorState()),Q1(n.registerUpdateListener(({editorState:u})=>c(u)),()=>{l()})}function TO(n){let e=null,t=()=>{let r=getSelection(),o=r&&r.anchorNode,s=n.getRootElement();o!==null&&s!==null&&s.contains(o)?e!==null&&(e(),e=null):e===null&&(e=tb(n))};return document.addEventListener("selectionchange",t),()=>{e!==null&&e(),document.removeEventListener("selectionchange",t)}}var NO=_O,nb=Dn,EO=J1,AO=yO,wO=Z1,vO=bO,OO=bp,rb=mO,kO=xO,LO=CO;function RO(n,...e){let t=X1(...e);t.length>0&&n.classList.add(...t)}function MO(n,...e){let t=X1(...e);t.length>0&&n.classList.remove(...t)}function ob(n,e){for(let t of e)if(n.type.startsWith(t))return!0;return!1}function DO(n,e){let t=n[Symbol.iterator]();return new Promise((r,o)=>{let s=[],i=()=>{let{done:a,value:l}=t.next();if(a)return r(s);let c=new FileReader;c.addEventListener("error",o),c.addEventListener("load",()=>{let u=c.result;typeof u=="string"&&s.push({file:l,result:u}),i()}),ob(l,e)?c.readAsDataURL(l):i()};i()})}function IO(n,e){return Array.from(sb(n,e))}function $O(n){return n?n.getAdjacentCaret():null}function PO(n,e){return Array.from(lb(n,e))}function sb(n,e){return ib("next",n,e)}function ib(n,e,t){let r=Be(),o=e||r,s=F(o)?ln(o,n):mt(o,n),i=ab(o),a=t?$a(np(mt(t,n))):function(c,u){let d=ds(mt(c,u));return d&&d[0]}(o,n),l=i;return up({hasNext:c=>c!==null,initial:s,map:c=>({depth:l,node:c.origin}),step:c=>{if(c.isSameNodeCaret(a))return null;bo(c)&&l++;let u=ds(c);return!u||u[0].isSameNodeCaret(a)?null:(l+=u[1],u[0])}})}function FO(n){let e=ds(mt(n,"next"));return e&&[e[0].origin,e[1]]}function ab(n){let e=-1;for(let t=n;t!==null;t=t.getParent())e++;return e}function BO(n){let e=np(mt(n,"previous")),t=ds(e,"root");return t&&t[0].origin}function lb(n,e){return ib("previous",n,e)}function HO(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function zO(n){let e=yo(n,t=>F(t)&&!t.isInline());return F(e)||yu(4,n.__key),e}function KO(n,e,t,r){let o=s=>s instanceof e;return n.registerNodeTransform(e,s=>{let i=(a=>{let l=a.getChildren();for(let d=0;d<l.length;d++){let h=l[d];if(o(h))return null}let c=a,u=a;for(;c!==null;)if(u=c,c=c.getParent(),o(c))return{child:u,parent:c};return null})(s);if(i!==null){let{child:a,parent:l}=i;if(a.is(s)){r(l,s);let c=a.getNextSiblings(),u=c.length;if(l.insertAfter(a),u!==0){let d=t(l);a.insertAfter(d);for(let h=0;h<u;h++)d.append(c[h])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function UO(n,e){let t=new Map,r=n._pendingEditorState;for(let[s,i]of e._nodeMap)t.set(s,Zc(i));r&&(r._nodeMap=t),n._dirtyType=2;let o=e._selection;De(o===null?null:o.clone())}function WO(n){let e=w()||Br(),t;if(v(e))t=xo(e.focus,"next");else{if(e!=null){let i=e.getNodes(),a=i[i.length-1];a&&(t=mt(a,"next"))}t=t||ln(Be(),"previous").getFlipped().insert(U())}let r=cb(n,t),o=$a(r),s=bo(o)?Mn(o):r;return Ha(r1(s)),n.getLatest()}function cb(n,e,t){let r=ep(e,"next");for(let o=r;o;o=h1(o,t))r=o;return eu(r)&&yu(283),r.insert(n.isInline()?U().append(n):n),ep(mt(n.getLatest(),"next"),e.direction)}function GO(n,e){let t=e();return n.replace(t),t.append(n),t}function VO(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function YO(n,e){let t=[];for(let r=0;r<n.length;r++){let o=e(n[r]);o!==null&&t.push(o)}return t}function jO(n,e){ln(n,"next").insert(e)}var yp=!(rb||!nb)&&void 0;function qO(n){let e=1;if(function(){if(yp===void 0){let t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);let r=t.getBoundingClientRect();t.style.setProperty("zoom","2"),yp=t.getBoundingClientRect().width===r.width,document.body.removeChild(t)}return yp}())for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}function ZO(n){return n._parentEditor!==null}function JO(n,e){return ub(n,e,null)}function ub(n,e,t){let r=!1;for(let o of Sp(n))e(o)?t!==null&&t(o):(r=!0,F(o)&&ub(o,e,t||(s=>o.insertAfter(s))),o.remove());return r}function XO(n,e){let t=[],r=Array.from(n).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(e(o))t.push(o);else if(F(o))for(let s of Sp(o))r.push(s);return t}function QO(n){return db(ln(n,"next"))}function Sp(n){return db(ln(n,"previous"))}function db(n){return up({hasNext:Qc,initial:n.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function ek(n){d1(mt(n,"next")).splice(1,n.getChildren())}function tk(n){let e=r=>gi(r,n),t=(r,o)=>To(r,n,o);return{$get:e,$set:t,accessors:[e,t],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(r){return t(this,r)},stateConfig:n}}var te=Tp,wi=te.$descendantsMatching,yI=te.$dfs,bI=te.$dfsIterator,hb=te.$filter,oe=te.$findMatchingParent,Np=te.$firstToLastIterator,bu=te.$getAdjacentCaret,SI=te.$getAdjacentSiblingOrParentSiblingCaret,TI=te.$getDepth,qa=te.$getNearestBlockElementAncestorOrThrow,nr=te.$getNearestNodeOfType,NI=te.$getNextRightPreorderNode,EI=te.$getNextSiblingOrParentSibling,Za=te.$insertFirst,gb=te.$insertNodeToNearestRoot,AI=te.$insertNodeToNearestRootAtCaret,wI=te.$isEditorIsNestedEditor,vI=te.$lastToFirstIterator,OI=te.$restoreEditorState,kI=te.$reverseDfs,LI=te.$reverseDfsIterator,RI=te.$splitNode,Ja=te.$unwrapAndFilterDescendants,MI=te.$unwrapNode,Su=te.$wrapNodeInElement,DI=te.CAN_USE_BEFORE_INPUT,II=te.CAN_USE_DOM,$I=te.IS_ANDROID,PI=te.IS_ANDROID_CHROME,FI=te.IS_APPLE,BI=te.IS_APPLE_WEBKIT,HI=te.IS_CHROME,zI=te.IS_FIREFOX,KI=te.IS_IOS,UI=te.IS_SAFARI,_e=te.addClassNamesToElement,fb=te.calculateZoomLevel,Ep=te.isBlockDomNode,Tu=te.isHTMLAnchorElement,Xe=te.isHTMLElement,WI=te.isInlineDomNode,GI=te.isMimeType,VI=te.makeStateWrapper,YI=te.markSelection,jI=te.mediaFileReader,Ee=te.mergeRegister,At=te.objectKlassEquals,qI=te.positionNodeOnRange,ZI=te.registerNestedElementResolver,wt=te.removeClassNamesFromElement,JI=te.selectionAlwaysOnDisplay;var Bp={};Lt(Bp,{$createHorizontalRuleNode:()=>Fp,$isHorizontalRuleNode:()=>Mb,AutoFocusExtension:()=>ok,ClearEditorExtension:()=>sk,EditorStateExtension:()=>wu,HorizontalRuleExtension:()=>_k,HorizontalRuleNode:()=>Gr,INSERT_HORIZONTAL_RULE_COMMAND:()=>pk,InitialStateExtension:()=>Lb,LexicalBuilder:()=>rr,NodeSelectionExtension:()=>Dp,TabIndentationExtension:()=>Ck,batch:()=>yb,buildEditorFromExtensions:()=>uk,computed:()=>Tb,configExtension:()=>hu,declarePeerDependency:()=>T1,defineExtension:()=>ue,effect:()=>Mo,getExtensionDependencyFromEditor:()=>hk,getKnownTypesAndNodes:()=>ik,getPeerDependencyFromEditor:()=>Rb,getPeerDependencyFromEditorOrThrow:()=>gk,namedSignals:()=>Ou,registerClearEditor:()=>Ab,registerTabIndentation:()=>Db,safeCast:()=>xt,shallowMergeConfig:()=>Lo,signal:()=>ki,untracked:()=>kp,watchedSignal:()=>$p});var nk=Symbol.for("preact-signals");function vu(){if(Ro>1)return void Ro--;let n,e=!1;for(;Qa!==void 0;){let t=Qa;for(Qa=void 0,Lp++;t!==void 0;){let r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&bb(t))try{t.c()}catch(o){e||(n=o,e=!0)}t=r}}if(Lp=0,Ro--,e)throw n}function yb(n){if(Ro>0)return n();Ro++;try{return n()}finally{vu()}}var Ae,Qa;function kp(n){let e=Ae;Ae=void 0;try{return n()}finally{Ae=e}}var Ro=0,Lp=0,Au=0;function pb(n){if(Ae===void 0)return;let e=n.n;return e===void 0||e.t!==Ae?(e={i:0,S:n,p:Ae.s,n:void 0,t:Ae,e:void 0,x:void 0,r:e},Ae.s!==void 0&&(Ae.s.n=e),Ae.s=e,n.n=e,32&Ae.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ae.s,e.n=void 0,Ae.s.n=e,Ae.s=e),e):void 0}function Bt(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function ki(n,e){return new Bt(n,e)}function bb(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function mb(n){for(let e=n.s;e!==void 0;e=e.n){let t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Sb(n){let e,t=n.s;for(;t!==void 0;){let r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function ms(n,e){Bt.call(this,void 0),this.x=n,this.s=void 0,this.g=Au-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Tb(n,e){return new ms(n,e)}function Nb(n){let e=n.u;if(n.u=void 0,typeof e=="function"){Ro++;let t=Ae;Ae=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,Ip(n),r}finally{Ae=t,vu()}}}function Ip(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Nb(n)}function rk(n){if(Ae!==this)throw new Error("Out-of-order effect");Sb(this),Ae=n,this.f&=-2,8&this.f&&Ip(this),vu()}function Oi(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function Mo(n,e){let t=new Oi(n,e);try{t.c()}catch(o){throw t.d(),o}let r=t.d.bind(t);return r[Symbol.dispose]=r,r}function Ou(n,e={}){let t={};for(let r in n){let o=e[r],s=ki(o===void 0?n[r]:o);t[r]=s}return t}Bt.prototype.brand=nk,Bt.prototype.h=function(){return!0},Bt.prototype.S=function(n){let e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:kp(()=>{var t;(t=this.W)==null||t.call(this)}))},Bt.prototype.U=function(n){if(this.t!==void 0){let e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&kp(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Bt.prototype.subscribe=function(n){return Mo(()=>{let e=this.value,t=Ae;Ae=void 0;try{n(e)}finally{Ae=t}},{name:"sub"})},Bt.prototype.valueOf=function(){return this.value},Bt.prototype.toString=function(){return this.value+""},Bt.prototype.toJSON=function(){return this.value},Bt.prototype.peek=function(){let n=Ae;Ae=void 0;try{return this.value}finally{Ae=n}},Object.defineProperty(Bt.prototype,"value",{get(){let n=pb(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(Lp>100)throw new Error("Cycle detected");this.v=n,this.i++,Au++,Ro++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{vu()}}}}),ms.prototype=new Bt,ms.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Au))return!0;if(this.g=Au,this.f|=1,this.i>0&&!bb(this))return this.f&=-2,!0;let n=Ae;try{mb(this),Ae=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Ae=n,Sb(this),this.f&=-2,!0},ms.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Bt.prototype.S.call(this,n)},ms.prototype.U=function(n){if(this.t!==void 0&&(Bt.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ms.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(ms.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let n=pb(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Oi.prototype.c=function(){let n=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Oi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Nb(this),mb(this),Ro++;let n=Ae;return Ae=this,rk.bind(this,n)},Oi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Qa,Qa=this)},Oi.prototype.d=function(){this.f|=8,1&this.f||Ip(this)},Oi.prototype.dispose=function(){this.d()};var ok=ue({build:(n,e,t)=>Ou(e),config:xt({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(n,e,t){let r=t.getOutput();return Mo(()=>r.disabled.value?void 0:n.registerRootListener(o=>{n.focus(()=>{let s=document.activeElement;o===null||s!==null&&o.contains(s)||o.focus({preventScroll:!0})},{defaultSelection:r.defaultSelection.peek()})}))}});function Eb(){let n=Be(),e=w(),t=U();n.clear(),n.append(t),e!==null&&t.select(),v(e)&&(e.format=0)}function Ab(n,e=Eb){return n.registerCommand(nu,t=>(n.update(e),!0),W)}var sk=ue({build:(n,e,t)=>Ou(e),config:xt({$onClear:Eb}),name:"@lexical/extension/ClearEditor",register(n,e,t){let{$onClear:r}=t.getOutput();return Mo(()=>Ab(n,r.value))}});function ik(n){let e=new Set,t=new Set;for(let r of wb(n)){let o=typeof r=="function"?r:r.replace;e.add(o.getType()),t.add(o)}return{nodes:t,types:e}}function wb(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function $p(n,e){let t;return ki(n(),{unwatched(){t&&(t(),t=void 0)},watched(){this.value=n(),t=e(this)}})}var wu=ue({build:n=>$p(()=>n.getEditorState(),e=>n.registerUpdateListener(t=>{e.value=t.editorState})),name:"@lexical/extension/EditorState"});function ve(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function vb(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){let t=n,r=e;for(let o in r)t[o]=vb(t[o],r[o]);return n}return e}var Pp=0,Rp=1,Ob=2,Ap=3,Nu=4,vi=5,wp=6,Xa=7;function vp(n){return n.id===Pp}function kb(n){return n.id===Ob}function ak(n){return function(e){return e.id===Rp}(n)||ve(305,String(n.id),String(Rp)),Object.assign(n,{id:Ob})}var lk=new Set,Mp=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Pp}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Lo;for(let r of this.configs)e=t(e,r);return e}init(e){let t=this.state;kb(t)||ve(306,String(t.id));let r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=function(a,l,c){return Object.assign(a,{config:l,id:Ap,registerState:c})}(t,this.mergeConfigs(),r),i;this.state=s,this.extension.init&&(i=this.extension.init(e,s.config,r)),this.state=function(a,l,c){return Object.assign(a,{id:Nu,initResult:l,registerState:c})}(s,i,o)}build(e){let t=this.state,r;t.id!==Nu&&ve(307,String(t.id),String(vi)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));let o={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=function(s,i,a){return Object.assign(s,{id:vi,output:i,registerState:a})}(t,r,o)}register(e,t){this._signal=t;let r=this.state;r.id!==vi&&ve(308,String(r.id),String(vi));let o=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=function(s){return Object.assign(s,{id:wp})}(r),()=>{let s=this.state;s.id!==Xa&&ve(309,String(r.id),String(Xa)),this.state=function(i){return Object.assign(i,{id:vi})}(s),o&&o()}}afterRegistration(e){let t=this.state,r;return t.id!==wp&&ve(310,String(t.id),String(wp)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(o){return Object.assign(o,{id:Xa})}(t),r}getSignal(){return this._signal===void 0&&ve(311),this._signal}getInitResult(){this.extension.init===void 0&&ve(312,this.extension.name);let e=this.state;return function(t){return t.id>=Nu}(e)||ve(313,String(e.id),String(Nu)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(t){return t.id>=Ap}(e)||ve(314,String(e.id),String(Ap)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&ve(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&ve(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(t){return t.id>=Xa}(e)||ve(316,String(e.id),String(Xa)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||lk}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(t){return t.id>=vi})(e)||ve(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},_b={tag:gs};function ck(){let n=Be();n.isEmpty()&&n.append(U())}var Lb=ue({config:xt({setOptions:_b,updateOptions:_b}),init:({$initialEditorState:n=ck})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){let o=r.getInitResult();if(!o.initialized){o.initialized=!0;let{$initialEditorState:s}=o;if(l1(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){let i=n.parseEditorState(s);n.setEditorState(i,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Va,Ft,C1,b1,Ga]}),Cb=Symbol.for("@lexical/extension/LexicalBuilder");function uk(...n){return rr.fromExtensions(n).buildEditor()}function xb(){}function dk(n){throw n}function Eu(n){return Array.isArray(n)?n:[n]}var Op="0.38.2+prod.esm",rr=class{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=Op,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(e){let t=[Eu(Lb)];for(let r of e)t.push(Eu(r));return new rr(t)}static maybeFromEditor(e){let t=e[Cb];return t&&(t.PACKAGE_VERSION!==Op&&ve(292,t.PACKAGE_VERSION,Op),t instanceof rr||ve(293)),t}static fromEditor(e){let t=rr.maybeFromEditor(e);return t===void 0&&ve(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),o=Object.assign(S1({...r,...t?{onError:s=>{t(s,o)}}:{}}),{[Cb]:this});for(let s of this.sortedExtensionReps())s.build(o);return o}buildEditor(){let e=xb;function t(){try{e()}finally{e=xb}}let r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Ee(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ve(295,e.name),t}addEdge(e,t,r){let o=this.outgoingConfigEdges.get(e);o?o.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));let s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ve(296);let t=Eu(e),[r]=t;typeof r.name!="string"&&ve(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&ve(298,r.name),!o){o=new Mp(this,r),this.extensionNameMap.set(r.name,o);let s=this.conflicts.get(r.name);typeof s=="string"&&ve(299,r.name,s);for(let i of r.conflictsWith||[])this.extensionNameMap.has(i)&&ve(299,r.name,i),this.conflicts.set(i,r.name);for(let i of r.dependencies||[]){let a=Eu(i);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(let[i,a]of r.peerDependencies||[])this.addEdge(r.name,i,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(r,o)=>{let s=r.state;if(kb(s))return;let i=r.extension.name;var a;vp(s)||ve(300,i,o||"[unknown]"),vp(a=s)||ve(304,String(a.id),String(Pp)),s=Object.assign(a,{id:Rp}),r.state=s;let l=this.outgoingConfigEdges.get(i);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&t(u,i)}s=ak(s),r.state=s,e.push(r)};for(let r of this.extensionNameMap.values())vp(r.state)&&t(r);for(let r of e)for(let[o,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){let i=this.extensionNameMap.get(o);if(i)for(let a of s)i.configs.add(a)}for(let[r,...o]of this.roots)if(o.length>0){let s=this.extensionNameMap.get(r.name);s===void 0&&ve(301,r.name);for(let i of o)s.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],s=r.signal;for(let i of t){let a=i.register(e,s);a&&o.push(a)}for(let i of t){let a=i.afterRegistration(e);a&&o.push(a)}return Ee(...o)}buildCreateEditorArgs(){let e={},t=new Set,r=new Map,o=new Map,s={},i={},a=this.sortedExtensionReps();for(let u of a){let{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(let h of wb(d)){if(typeof h!="function"){let g=r.get(h.replace);g&&ve(302,d.name,h.replace.name,g.extension.name),r.set(h.replace,u)}t.add(h)}if(d.html){if(d.html.export)for(let[h,g]of d.html.export.entries())o.set(h,g);d.html.import&&Object.assign(s,d.html.import)}d.theme&&vb(i,d.theme)}Object.keys(i).length>0&&(e.theme=i),t.size&&(e.nodes=[...t]);let l=Object.keys(s).length>0,c=o.size>0;(l||c)&&(e.html={},l&&(e.html.import=s),c&&(e.html.export=o));for(let u of a)u.init(e);return e.onError||(e.onError=dk),e}};function hk(n,e){let t=rr.fromEditor(n).getExtensionRep(e);return t===void 0&&ve(303,e.name),t.getExtensionDependency()}function Rb(n,e){let t=rr.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function gk(n,e){let t=Rb(n,e);return t===void 0&&ve(291,e),t}var fk=new Set,Dp=ue({build(n,e,t){let r=t.getDependency(wu).output,o=ki({watchedNodeKeys:new Map}),s=$p(()=>{},()=>Mo(()=>{let i=s.peek(),{watchedNodeKeys:a}=o.value,l,c=!1;r.value.read(()=>{if(w())for(let[u,d]of a.entries()){if(d.size===0){a.delete(u);continue}let h=Fe(u),g=h&&h.isSelected()||!1;c=c||g!==(!!i&&i.has(u)),g&&(l=l||new Set,l.add(u))}}),!c&&l&&i&&l.size===i.size||(s.value=l)}));return{watchNodeKey:function(i){let a=Tb(()=>(s.value||fk).has(i)),{watchedNodeKeys:l}=o.peek(),c=l.get(i),u=c!==void 0;return c=c||new Set,c.add(a),u||(l.set(i,c),o.value={watchedNodeKeys:l}),a}}},dependencies:[wu],name:"@lexical/extension/NodeSelection"}),pk=Ct("INSERT_HORIZONTAL_RULE_COMMAND"),Gr=class extends Eo{static getType(){return"horizontalrule"}static clone(e){return new Gr(e.__key)}static importJSON(e){return Fp().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:mk,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return _e(t,e.theme.hr),t}getTextContent(){return`
`}isInline(){return!1}updateDOM(){return!1}};function mk(){return{node:Fp()}}function Fp(){return hi(Gr)}function Mb(n){return n instanceof Gr}var _k=ue({dependencies:[wu,Dp],name:"@lexical/extension/HorizontalRule",nodes:[Gr],register(n,e,t){let{watchNodeKey:r}=t.getDependency(Dp).output,o=ki({nodeSelections:new Map}),s=n._config.theme.hrSelected??"selected";return Ee(n.registerCommand(No,i=>{if(jt(i.target)){let a=s1(i.target);if(Mb(a))return function(l,c=!1){let u=w(),d=l.isSelected(),h=l.getKey(),g;c&&Ke(u)?g=u:(g=Jc(),De(g)),d?g.delete(h):g.add(h)}(a,i.shiftKey),!0}return!1},de),n.registerMutationListener(Gr,(i,a)=>{yb(()=>{let l=!1,{nodeSelections:c}=o.peek();for(let[u,d]of i.entries())if(d==="destroyed")c.delete(u),l=!0;else{let h=c.get(u),g=n.getElementByKey(u);h?h.domNode.value=g:(l=!0,c.set(u,{domNode:ki(g),selectedSignal:r(u)}))}l&&(o.value={nodeSelections:c})})}),Mo(()=>{let i=[];for(let{domNode:a,selectedSignal:l}of o.value.nodeSelections.values())i.push(Mo(()=>{let c=a.value;c&&(l.value?_e(c,s):wt(c,s))}));return Ee(...i)}))}});function Db(n,e){return Ee(n.registerCommand(_n,t=>{let r=w();if(!v(r))return!1;t.preventDefault();let o=function(s){let i=s.getNodes();if(hb(i,h=>fi(h)&&h.canIndent()?h:null).length>0)return!0;let a=s.anchor,l=s.focus,c=l.isBefore(a)?l:a,u=c.getNode(),d=qa(u);if(d.canIndent()){let h=d.getKey(),g=Zn();if(g.anchor.set(h,0,"element"),g.focus.set(h,0,"element"),g=zr(g),g.anchor.is(c))return!0}return!1}(r)?t.shiftKey?hn:$t:Ao;return n.dispatchCommand(o,void 0)},W),n.registerCommand($t,()=>{let t=typeof e=="number"?e:e?e.peek():null;if(t==null)return!1;let r=w();if(!v(r))return!1;let o=r.getNodes().map(s=>qa(s).getIndent());return Math.max(...o)+1>=t},Jn))}var Ck=ue({build:(n,e,t)=>Ou(e),config:xt({disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(n,e,t){let{disabled:r,maxIndent:o}=t.getOutput();return Mo(()=>{if(!r.value)return Db(n,o)})}});var Se=Bp,n$=Se.$createHorizontalRuleNode,r$=Se.$isHorizontalRuleNode,o$=Se.AutoFocusExtension,s$=Se.ClearEditorExtension,i$=Se.EditorStateExtension,a$=Se.HorizontalRuleExtension,l$=Se.HorizontalRuleNode,c$=Se.INSERT_HORIZONTAL_RULE_COMMAND,u$=Se.InitialStateExtension,d$=Se.LexicalBuilder,h$=Se.NodeSelectionExtension,g$=Se.TabIndentationExtension,Ib=Se.batch,$b=Se.buildEditorFromExtensions,f$=Se.computed,p$=Se.configExtension,m$=Se.declarePeerDependency,_$=Se.defineExtension,Ht=Se.effect,C$=Se.getExtensionDependencyFromEditor,x$=Se.getKnownTypesAndNodes,Pb=Se.getPeerDependencyFromEditor,y$=Se.getPeerDependencyFromEditorOrThrow,In=Se.namedSignals,b$=Se.registerClearEditor,S$=Se.registerTabIndentation,T$=Se.safeCast,N$=Se.shallowMergeConfig,E$=Se.signal,A$=Se.untracked,w$=Se.watchedSignal;var Wp={};Lt(Wp,{$createListItemNode:()=>gn,$createListNode:()=>qt,$getListDepth:()=>ku,$handleListInsertParagraph:()=>qb,$insertList:()=>el,$isListItemNode:()=>he,$isListNode:()=>ae,$removeList:()=>Up,CheckListExtension:()=>Ak,INSERT_CHECK_LIST_COMMAND:()=>Zb,INSERT_ORDERED_LIST_COMMAND:()=>tS,INSERT_UNORDERED_LIST_COMMAND:()=>eS,ListExtension:()=>sS,ListItemNode:()=>Io,ListNode:()=>Cs,REMOVE_LIST_COMMAND:()=>nS,UPDATE_LIST_START_COMMAND:()=>Qb,insertList:()=>Nk,registerCheckList:()=>Jb,registerList:()=>rS,registerListStrictIndentTransform:()=>oS,removeList:()=>Ek});function Do(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ku(n){let e=1,t=n.getParent();for(;t!=null;){if(he(t)){let r=t.getParent();if(ae(r)){e++,t=r.getParent();continue}Do(40)}return e}return e}function Hp(n){let e=n.getParent();ae(e)||Do(40);let t=e;for(;t!==null;)t=t.getParent(),ae(t)&&(e=t);return e}function Vb(n){let e=[],t=n.getChildren().filter(he);for(let r=0;r<t.length;r++){let o=t[r],s=o.getFirstChild();ae(s)?e=e.concat(Vb(s)):e.push(o)}return e}function or(n){return he(n)&&ae(n.getFirstChild())}function Fb(n){return gn().append(n)}function Yb(n,e){return he(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function el(n){let e=w();if(e!==null){let t=e.getNodes();if(v(e)){let o=e.getStartEndPoints();o===null&&Do(143);let[s]=o,i=s.getNode(),a=i.getParent();if(Ze(i)){let l=i.getFirstChild();if(l)t=l.selectStart().getNodes();else{let c=U();i.append(c),t=c.select().getNodes()}}else if(Yb(i,t)){let l=qt(n);if(Ze(a)){i.replace(l);let c=gn();F(i)&&(c.setFormat(i.getFormatType()),c.setIndent(i.getIndent())),l.append(c)}else if(he(i)){let c=i.getParentOrThrow();_s(l,c.getChildren()),c.replace(l)}return}}let r=new Set;for(let o=0;o<t.length;o++){let s=t[o];if(F(s)&&s.isEmpty()&&!he(s)&&!r.has(s.getKey())){Bb(s,n);continue}let i=Ba(s)?s.getParent():he(s)&&s.isEmpty()?s:null;for(;i!=null;){let a=i.getKey();if(ae(i)){if(!r.has(a)){let l=qt(n);_s(l,i.getChildren()),i.replace(l),r.add(a)}break}{let l=i.getParent();if(Ze(l)&&!r.has(a)){r.add(a),Bb(i,n);break}i=l}}}}}function _s(n,e){n.splice(n.getChildrenSize(),0,e)}function Bb(n,e){if(ae(n))return n;let t=n.getPreviousSibling(),r=n.getNextSibling(),o=gn(),s;if(_s(o,n.getChildren()),ae(t)&&e===t.getListType())t.append(o),ae(r)&&e===r.getListType()&&(_s(t,r.getChildren()),r.remove()),s=t;else if(ae(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(o),s=r;else{let i=qt(e);i.append(o),n.replace(i),s=i}return o.setFormat(n.getFormatType()),o.setIndent(n.getIndent()),n.remove(),s}function Kp(n,e){let t=n.getLastChild(),r=e.getFirstChild();t&&r&&or(t)&&or(r)&&(Kp(t.getFirstChild(),r.getFirstChild()),r.remove());let o=e.getChildren();o.length>0&&n.append(...o),e.remove()}function Up(){let n=w();if(v(n)){let e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Yb(r,t))e.add(Hp(r));else for(let o=0;o<t.length;o++){let s=t[o];if(Ba(s)){let i=nr(s,Io);i!=null&&e.add(Hp(i))}}for(let o of e){let s=o,i=Vb(o);for(let a of i){let l=U().setTextStyle(n.style).setTextFormat(n.format);_s(l,a.getChildren()),s.insertAfter(l),s=l,a.__key===n.anchor.key&&So(n.anchor,Mn(ln(l,"next"))),a.__key===n.focus.key&&So(n.focus,Mn(ln(l,"next"))),a.remove()}o.remove()}}}function jb(n){let e=n.getListType()!=="check",t=n.getStart();for(let r of n.getChildren())he(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),ae(r.getFirstChild())||t++)}function xk(n){let e=new Set;if(or(n)||e.has(n.getKey()))return;let t=n.getParent(),r=n.getNextSibling(),o=n.getPreviousSibling();if(or(r)&&or(o)){let s=o.getFirstChild();if(ae(s)){s.append(n);let i=r.getFirstChild();ae(i)&&(_s(s,i.getChildren()),r.remove(),e.add(r.getKey()))}}else if(or(r)){let s=r.getFirstChild();if(ae(s)){let i=s.getFirstChild();i!==null&&i.insertBefore(n)}}else if(or(o)){let s=o.getFirstChild();ae(s)&&s.append(n)}else if(ae(t)){let s=gn().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),i=qt(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(i),i.append(n),o?o.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function yk(n){if(or(n))return;let e=n.getParent(),t=e?e.getParent():void 0;if(ae(t?t.getParent():void 0)&&he(t)&&ae(e)){let r=e?e.getFirstChild():void 0,o=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(o))t.insertAfter(n),e.isEmpty()&&t.remove();else{let s=e.getListType(),i=gn(),a=qt(s);i.append(a),n.getPreviousSiblings().forEach(u=>a.append(u));let l=gn(),c=qt(s);l.append(c),_s(c,n.getNextSiblings()),t.insertBefore(i),t.insertAfter(l),t.replace(n)}}}function qb(){let n=w();if(!v(n)||!n.isCollapsed())return!1;let e=n.anchor.getNode();if(!he(e)||e.getChildrenSize()!==0)return!1;let t=Hp(e),r=e.getParent();ae(r)||Do(40);let o=r.getParent(),s;if(Ze(o))s=U(),t.insertAfter(s);else{if(!he(o))return!1;s=gn(),o.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();let i=e.getNextSiblings();if(i.length>0){let a=qt(r.getListType());if(he(s)){let l=gn();l.append(a),s.insertAfter(l)}else s.insertAfter(a);a.append(...i)}return function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){let c=l.getParent();if(c==null||!he(c)&&!ae(c))break;l=c}l.remove()}(e),!0}function Lu(...n){let e=[];for(let t of n)if(t&&typeof t=="string")for(let[r]of t.matchAll(/\S+/g))e.push(r);return e}var Io=class extends Ye{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();ae(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:Ye,importDOM:ap({li:()=>({conversion:bk,priority:0})})})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(i,a,l){let c=a.getParent();!ae(c)||c.getListType()!=="check"||ae(a.getFirstChild())?(i.removeAttribute("role"),i.removeAttribute("tabIndex"),i.removeAttribute("aria-checked")):(i.setAttribute("role","checkbox"),i.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||i.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,function(i,a,l){let c=[],u=[],d=a.list,h=d?d.listitem:void 0,g;if(d&&d.nested&&(g=d.nested.listitem),h!==void 0&&c.push(...Lu(h)),d){let f=l.getParent(),p=ae(f)&&f.getListType()==="check",m=l.getChecked();p&&!m||u.push(d.listitemUnchecked),p&&m||u.push(d.listitemChecked),p&&c.push(m?d.listitemChecked:d.listitemUnchecked)}if(g!==void 0){let f=Lu(g);l.getChildren().some(p=>ae(p))?c.push(...f):u.push(...f)}u.length>0&&wt(i,...u),c.length>0&&_e(i,...c)}(t,r.theme,this);let o=e?e.__style:"",s=this.__style;o!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),function(i,a,l){let c=ps(a.__textStyle);for(let u in c)i.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(let u in ps(l.__textStyle))u in c||i.style.removeProperty(`--listitem-marker-${u}`)}(t,this,e)}updateDOM(e,t,r){let o=t;return this.updateListItemDOM(e,o,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);let o=this.getDirection();return o&&(t.dir=o),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let r=e[t];if(F(r)&&this.canMergeWith(r)){let o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(e,t){if(he(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!ae(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let o=qt(r.getListType()),s=this.getNextSibling();for(;s;){let i=s;s=s.getNextSibling(),o.append(i)}r.insertAfter(e),e.insertAfter(o)}return t&&(F(e)||Do(139),this.getChildren().forEach(o=>{e.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){let r=this.getParentOrThrow();if(ae(r)||Do(39),he(e))return super.insertAfter(e,t);let o=this.getNextSiblings();if(r.insertAfter(e,t),o.length!==0){let s=qt(r.getListType());o.forEach(i=>s.append(i)),e.insertAfter(s,t)}return e}remove(e){let t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&or(t)&&or(r)&&(Kp(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){let r=gn().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){let t=U();this.getChildren().forEach(i=>t.append(i));let r=this.getParentOrThrow(),o=r.getParentOrThrow(),s=he(o);if(r.getChildrenSize()===1)if(s)r.remove(),o.select();else{r.insertBefore(t),r.remove();let i=e.anchor,a=e.focus,l=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(l,i.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,r=this.getParent();return ae(r)&&(t=r.getListType()),t==="check"?Boolean(e.__checked):void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;he(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Do(117),(e=Math.floor(e))>=0||Do(199);let t=this.getIndent();for(;t!==e;)t<e?(xk(this),t++):(yk(this),t--);return this}canInsertAfter(e){return he(e)}canReplaceWith(e){return he(e)}canMergeWith(e){return he(e)||rt(e)}extractWithChild(e,t){if(!v(t))return!1;let r=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return qt("bullet")}canMergeWhenEmpty(){return!0}};function bk(n){if(n.classList.contains("task-list-item")){for(let t of n.children)if(t.tagName==="INPUT")return Hb(t)}if(n.classList.contains("joplin-checkbox")){for(let t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Hb(t.children[0])}let e=n.getAttribute("aria-checked");return{node:gn(e==="true"||e!=="false"&&void 0)}}function Hb(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:gn(n.hasAttribute("checked"))}}function gn(n){return ft(new Io(void 0,n))}function he(n){return n instanceof Io}var Cs=class extends Ye{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){let r=t.getNextSibling();ae(r)&&t.getListType()===r.getListType()&&Kp(t,r)})(e),jb(e)},extends:Ye,importDOM:ap({ol:()=>({conversion:Kb,priority:0}),ul:()=>({conversion:Kb,priority:0})})})}constructor(e="number",t=1,r){super(r);let o=Tk[e]||e;this.__listType=o,this.__tag=o==="number"?"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){let t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,zb(o,e.theme,this),o}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(zb(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return Xe(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&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,r){let o=r;for(let s=0;s<r.length;s++){let i=r[s];he(i)||(o===r&&(o=[...r]),o[s]=gn().append(!F(i)||ae(i)||i.isInline()?i:ye(i.getTextContent())))}return super.splice(e,t,o)}extractWithChild(e){return he(e)}};function zb(n,e,t){let r=[],o=[],s=e.list;if(s!==void 0){let i=s[`${t.__tag}Depth`]||[],a=ku(t)-1,l=a%i.length,c=i[l],u=s[t.__tag],d,h=s.nested,g=s.checklist;if(h!==void 0&&h.list&&(d=h.list),u!==void 0&&r.push(u),g!==void 0&&t.__listType==="check"&&r.push(g),c!==void 0){r.push(...Lu(c));for(let f=0;f<i.length;f++)f!==l&&o.push(t.__tag+f)}if(d!==void 0){let f=Lu(d);a>1?r.push(...f):o.push(...f)}}o.length>0&&wt(n,...o),r.length>0&&_e(n,...r)}function Sk(n){let e=[];for(let t=0;t<n.length;t++){let r=n[t];if(he(r)){e.push(r);let o=r.getChildren();o.length>1&&o.forEach(s=>{ae(s)&&e.push(Fb(s))})}else e.push(Fb(r))}return e}function Kb(n){let e=n.nodeName.toLowerCase(),t=null;return e==="ol"?t=qt("number",n.start):e==="ul"&&(t=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(let o of r.childNodes)if(Xe(o)&&o.hasAttribute("aria-checked"))return!0;return!1}(n)?qt("check"):qt("bullet")),{after:Sk,node:t}}var Tk={ol:"number",ul:"bullet"};function qt(n="number",e=1){return ft(new Cs(n,e))}function ae(n){return n instanceof Cs}var Zb=Ct("INSERT_CHECK_LIST_COMMAND");function Jb(n){return Ee(n.registerCommand(Zb,()=>(el("check"),!0),de),n.registerCommand(dn,e=>Gb(e,n,!1),de),n.registerCommand(Pt,e=>Gb(e,n,!0),de),n.registerCommand(Ti,()=>{if(zp()!=null){let e=n.getRootElement();return e?.focus(),!0}return!1},de),n.registerCommand(Ni,e=>{let t=zp();return!(t==null||!n.isEditable())&&(n.update(()=>{let r=We(t);he(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},de),n.registerCommand(Qn,e=>n.getEditorState().read(()=>{let t=w();if(v(t)&&t.isCollapsed()){let{anchor:r}=t,o=r.type==="element";if(o||r.offset===0){let s=r.getNode(),i=oe(s,a=>F(a)&&!a.isInline());if(he(i)){let a=i.getParent();if(ae(a)&&a.getListType()==="check"&&(o||i.getFirstDescendant()===s)){let l=n.getElementByKey(i.__key);if(l!=null&&document.activeElement!==l)return l.focus(),e.preventDefault(),!0}}}}return!1}),de),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",Ub),e.addEventListener("pointerdown",Wb)),t!==null&&(t.removeEventListener("click",Ub),t.removeEventListener("pointerdown",Wb))}))}function Xb(n,e){let t=n.target;if(!Xe(t))return;let r=t.firstChild;if(Xe(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;let o=t.parentNode;if(!o||o.__lexicalListType!=="check")return;let s=t.getBoundingClientRect(),i=fb(t),a=n.clientX/i,l=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},c=parseFloat(l.width),u=n.pointerType==="touch"?32:0;(t.dir==="rtl"?a<s.right+u&&a>s.right-c-u:a>s.left-u&&a<s.left+c+u)&&e()}function Ub(n){Xb(n,()=>{if(Xe(n.target)){let e=n.target,t=fu(e);t!=null&&t.isEditable()&&t.update(()=>{let r=We(e);he(r)&&(e.focus(),r.toggleChecked())})}})}function Wb(n){Xb(n,()=>{n.preventDefault()})}function zp(){let n=document.activeElement;return Xe(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function Gb(n,e,t){let r=zp();return r!=null&&e.update(()=>{let o=We(r);if(!he(o))return;let s=function(i,a){let l=a?i.getPreviousSibling():i.getNextSibling(),c=i;for(;l==null&&he(c);)c=c.getParentOrThrow().getParent(),c!=null&&(l=a?c.getPreviousSibling():c.getNextSibling());for(;he(l);){let u=a?l.getLastChild():l.getFirstChild();if(!ae(u))return l;l=a?u.getLastChild():u.getFirstChild()}return null}(o,t);if(s!=null){s.selectStart();let i=e.getElementByKey(s.__key);i!=null&&(n.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}var Qb=Ct("UPDATE_LIST_START_COMMAND"),eS=Ct("INSERT_UNORDERED_LIST_COMMAND"),tS=Ct("INSERT_ORDERED_LIST_COMMAND"),nS=Ct("REMOVE_LIST_COMMAND");function rS(n){return Ee(n.registerCommand(tS,()=>(el("number"),!0),de),n.registerCommand(Qb,e=>{let{listNodeKey:t,newStart:r}=e,o=Fe(t);return!!ae(o)&&(o.getListType()==="number"&&(o.setStart(r),jb(o)),!0)},de),n.registerCommand(eS,()=>(el("bullet"),!0),de),n.registerCommand(nS,()=>(Up(),!0),de),n.registerCommand(Xn,()=>qb(),de),n.registerNodeTransform(Io,e=>{let t=e.getFirstChild();if(t){if(B(t)){let r=t.getStyle(),o=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==o&&e.setTextFormat(o)}}else{let r=w();v(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Ft,e=>{let t=e.getParent();if(he(t)&&e.is(t.getFirstChild())){let r=e.getStyle(),o=e.getFormat();r===t.getTextStyle()&&o===t.getTextFormat()||t.setTextStyle(r).setTextFormat(o)}}))}function oS(n){let e=t=>{let r=t.getParent();if(ae(t.getFirstChild())||!ae(r))return;let o=oe(t,s=>he(s)&&ae(s.getParent())&&he(s.getPreviousSibling()));if(o===null&&t.getIndent()>0)t.setIndent(0);else if(he(o)){let s=o.getPreviousSibling();if(he(s)){let i=function(l){let c=l,u=c.getFirstChild();for(;ae(u);){let d=u.getLastChild();if(!he(d))break;c=d,u=c.getFirstChild()}return c}(s),a=i.getParent();if(ae(a)){let l=ku(a);l+1<ku(r)&&t.setIndent(l)}}}};return n.registerNodeTransform(Cs,t=>{let r=[t];for(;r.length>0;){let o=r.shift();if(ae(o)){for(let s of o.getChildren())if(he(s)){e(s);let i=s.getFirstChild();ae(i)&&r.push(i)}}}})}function Nk(n,e){n.update(()=>el(e))}function Ek(n){n.update(()=>Up())}var sS=ue({build:(n,e,t)=>In(e),config:xt({hasStrictIndent:!1}),name:"@lexical/list/List",nodes:[Cs,Io],register(n,e,t){let r=t.getOutput();return Ee(rS(n),Ht(()=>r.hasStrictIndent.value?oS(n):void 0))}}),Ak=ue({dependencies:[sS],name:"@lexical/list/CheckList",register:Jb});var Ge=Wp,iS=Ge.$createListItemNode,Ru=Ge.$createListNode,aS=Ge.$getListDepth,M$=Ge.$handleListInsertParagraph,D$=Ge.$insertList,$o=Ge.$isListItemNode,zt=Ge.$isListNode,I$=Ge.$removeList,$$=Ge.CheckListExtension,P$=Ge.INSERT_CHECK_LIST_COMMAND,lS=Ge.INSERT_ORDERED_LIST_COMMAND,cS=Ge.INSERT_UNORDERED_LIST_COMMAND,F$=Ge.ListExtension,Po=Ge.ListItemNode,Fo=Ge.ListNode,B$=Ge.REMOVE_LIST_COMMAND,H$=Ge.UPDATE_LIST_START_COMMAND,z$=Ge.insertList,K$=Ge.registerCheckList,uS=Ge.registerList,U$=Ge.registerListStrictIndentTransform,W$=Ge.removeList;var qp={};Lt(qp,{$createAutoLinkNode:()=>Du,$createLinkNode:()=>xs,$isAutoLinkNode:()=>ir,$isLinkNode:()=>sr,$toggleLink:()=>tl,AutoLinkExtension:()=>$k,AutoLinkNode:()=>ys,ClickableLinkExtension:()=>kk,LinkExtension:()=>jp,LinkNode:()=>Vr,TOGGLE_LINK_COMMAND:()=>Iu,createLinkMatcherWithRegExp:()=>Lk,formatUrl:()=>Vp,registerAutoLink:()=>xS,registerClickableLink:()=>gS,registerLink:()=>hS,toggleLink:()=>Pk});var wk=new Set(["http:","https:","mailto:","sms:","tel:"]),Vr=class extends Ye{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Vr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);let{target:o=null,rel:s=null,title:i=null}=t;this.__url=e,this.__target=o,this.__rel=s,this.__title=i}createDOM(e){let t=document.createElement("a");return this.updateLinkDOM(null,t,e),_e(t,e.theme.link),t}updateLinkDOM(e,t,r){if(Tu(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let o of["target","rel","title"]){let s=`__${o}`,i=this[s];e&&e[s]===i||(i?t[o]=i:t.removeAttribute(o))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:vk,priority:1})}}static importJSON(e){return xs().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=Vp(e);try{let t=new URL(Vp(e));if(!wk.has(t.protocol))return"about:blank"}catch{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){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let r=xs(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!v(t))return!1;let o=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(o)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function vk(n){let e=null;if(Tu(n)){let t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=xs(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function xs(n="",e){return ft(new Vr(n,e))}function sr(n){return n instanceof Vr}var ys=class extends Vr{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new ys(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Du().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){let r=this.getParentOrThrow().insertNewAfter(e,t);if(F(r)){let o=Du(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}};function Du(n="",e){return ft(new ys(n,e))}function ir(n){return n instanceof ys}var Iu=Ct("TOGGLE_LINK_COMMAND");function dS(n,e){if(n.type==="element"){let t=n.getNode();return F(t)||function(r,...o){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",r);for(let a of o)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),t.getChildren()[n.offset+e]||null}return null}function tl(n,e={}){let t;if(n&&typeof n=="object"){let{url:u,...d}=n;t=u,e={...d,...e}}else t=n;let{target:r,title:o}=e,s=e.rel===void 0?"noreferrer":e.rel,i=w();if(i===null||!v(i)&&!Ke(i))return;if(Ke(i)){let u=i.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(t===null){let h=oe(d,g=>!ir(g)&&sr(g));h&&(h.insertBefore(d),h.getChildren().length===0&&h.remove())}else{let h=oe(d,g=>!ir(g)&&sr(g));if(h)h.setURL(t),r!==void 0&&h.setTarget(r),s!==void 0&&h.setRel(s);else{let g=xs(t,{rel:s,target:r});d.insertBefore(g),g.append(d)}}})}let a=i.extract();if(t===null){let u=new Set;return void a.forEach(d=>{let h=d.getParent();if(sr(h)&&!ir(h)){let g=h.getKey();if(u.has(g))return;(function(f,p){let m=new Set(p.filter(N=>f.isParentOf(N)).map(N=>N.getKey())),_=f.getChildren(),C=_.filter(N=>m.has(N.getKey()));if(C.length===_.length)return _.forEach(N=>f.insertBefore(N)),void f.remove();let x=_.findIndex(N=>m.has(N.getKey())),y=_.findLastIndex(N=>m.has(N.getKey())),S=x===0,b=y===_.length-1;if(S)C.forEach(N=>f.insertBefore(N));else if(b)for(let N=C.length-1;N>=0;N--)f.insertAfter(C[N]);else{for(let A=C.length-1;A>=0;A--)f.insertAfter(C[A]);let N=_.slice(y+1);if(N.length>0){let A=xs(f.getURL(),{rel:f.getRel(),target:f.getTarget(),title:f.getTitle()});C[C.length-1].insertAfter(A),N.forEach(O=>A.append(O))}}})(h,a),u.add(g)}})}let l=new Set,c=u=>{l.has(u.getKey())||(l.add(u.getKey()),u.setURL(t),r!==void 0&&u.setTarget(r),s!==void 0&&u.setRel(s),o!==void 0&&u.setTitle(o))};if(a.length===1){let u=a[0],d=oe(u,sr);if(d!==null)return c(d)}(function(u){let d=w();if(!v(d))return u();let h=zr(d),g=h.isBackward(),f=dS(h.anchor,g?-1:0),p=dS(h.focus,g?0:-1),m=u();if(f||p){let _=w();if(v(_)){let C=_.clone();if(f){let x=f.getParent();x&&C.anchor.set(x.getKey(),f.getIndexWithinParent()+(g?1:0),"element")}if(p){let x=p.getParent();x&&C.focus.set(x.getKey(),p.getIndexWithinParent()+(g?0:1),"element")}De(zr(C))}}})(()=>{let u=null;for(let d of a){if(!d.isAttached())continue;let h=oe(d,sr);if(h){c(h);continue}if(F(d)){if(!d.isInline())continue;if(sr(d)){if(!(ir(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(let f of d.getChildren())d.insertBefore(f);d.remove();continue}}let g=d.getPreviousSibling();sr(g)&&g.is(u)?g.append(d):(u=xs(t,{rel:s,target:r,title:o}),d.insertAfter(u),u.append(d))}})}var Ok=/^\+?[0-9\s()-]{5,}$/;function Vp(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Ok.test(n)?`tel:${n}`:`https://${n}`}function hS(n,e){return Ee(Ht(()=>n.registerCommand(Iu,t=>{let r=e.validateUrl.peek(),o=e.attributes.peek();if(t===null)return tl(null),!0;if(typeof t=="string")return!(r!==void 0&&!r(t))&&(tl(t,o),!0);{let{url:s,target:i,rel:a,title:l}=t;return tl(s,{...o,rel:a,target:i,title:l}),!0}},de)),Ht(()=>{let t=e.validateUrl.value;if(!t)return;let r=e.attributes.value;return n.registerCommand(Oo,o=>{let s=w();if(!v(s)||s.isCollapsed()||!At(o,ClipboardEvent)||o.clipboardData===null)return!1;let i=o.clipboardData.getData("text");return!!t(i)&&!s.getNodes().some(a=>F(a))&&(n.dispatchCommand(Iu,{...r,url:i}),o.preventDefault(),!0)},de)}))}var jp=ue({build:(n,e,t)=>In(e),config:{attributes:void 0,validateUrl:void 0},mergeConfig(n,e){let t=Lo(n,e);return n.attributes&&(t.attributes=Lo(n.attributes,t.attributes)),t},name:"@lexical/link/Link",nodes:[Vr],register:(n,e,t)=>hS(n,t.getOutput())});function gS(n,e,t={}){let r=s=>{let i=s.target;if(!jt(i))return;let a=fu(i);if(a===null)return;let l=null,c=null;if(a.update(()=>{let h=We(i);if(h!==null){let g=oe(h,F);if(!e.disabled.peek())if(sr(g))l=g.sanitizeUrl(g.getURL()),c=g.getTarget();else{let f=function(p,m){let _=p;for(;_!=null;){if(m(_))return _;_=_.parentNode}return null}(i,Tu);f!==null&&(l=f.href,c=f.target)}}}),l===null||l==="")return;let u=n.getEditorState().read(w);if(v(u)&&!u.isCollapsed())return void s.preventDefault();let d=s.type==="auxclick"&&s.button===1;window.open(l,e.newTab.peek()||d||s.metaKey||s.ctrlKey||c==="_blank"?"_blank":"_self"),s.preventDefault()},o=s=>{s.button===1&&r(s)};return n.registerRootListener((s,i)=>{i!==null&&(i.removeEventListener("click",r),i.removeEventListener("mouseup",o)),s!==null&&(s.addEventListener("click",r,t),s.addEventListener("mouseup",o,t))})}var kk=ue({build:(n,e,t)=>In(e),config:xt({disabled:!1,newTab:!1}),dependencies:[jp],name:"@lexical/link/ClickableLink",register:(n,e,t)=>gS(n,t.getOutput())});function Lk(n,e=t=>t){return t=>{let r=n.exec(t);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function fS(n,e){for(let t=0;t<e.length;t++){let r=e[t](n);if(r)return r}return null}var Rk=/[.,;\s]/;function $u(n){return Rk.test(n)}function pS(n){return $u(n[n.length-1])}function Yp(n){return $u(n[0])}function mS(n){let e=n.getPreviousSibling();return F(e)&&(e=e.getLastDescendant()),e===null||be(e)||B(e)&&pS(e.getTextContent())}function _S(n){let e=n.getNextSibling();return F(e)&&(e=e.getFirstDescendant()),e===null||be(e)||B(e)&&Yp(e.getTextContent())}function Mk(n,e,t,r){return(n>0?$u(t[n-1]):mS(r[0]))?e<t.length?$u(t[e]):_S(r[r.length-1]):!1}function Dk(n,e,t){let r=[],o=[],s=[],i=0,a=0,l=[...n];for(;l.length>0;){let c=l[0],u=c.getTextContent().length,d=a;a+u<=e?(r.push(c),i+=u):d>=t?s.push(c):o.push(c),a+=u,l.shift()}return[i,r,o,s]}function Ik(n,e,t,r){let o=Du(r.url,r.attributes);if(n.length===1){let s,i=n[0];e===0?[s,i]=i.splitText(t):[,s,i]=i.splitText(e,t);let a=ye(r.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),o.append(a),s.replace(o),i}if(n.length>1){let s=n[0],i,a=s.getTextContent().length;e===0?i=s:[,i]=s.splitText(e);let l=[],c;for(let g=1;g<n.length;g++){let f=n[g],p=f.getTextContent().length,m=a;if(m<t)if(a+p<=t)l.push(f);else{let[_,C]=f.splitText(t-m);l.push(_),c=C}a+=p}let u=w(),d=u?u.getNodes().find(B):void 0,h=ye(i.getTextContent());return h.setFormat(i.getFormat()),h.setDetail(i.getDetail()),h.setStyle(i.getStyle()),o.append(h,...l),d&&d===i&&(v(u)?h.select(u.anchor.offset,u.focus.offset):Ke(u)&&h.select(0,h.getTextContent().length)),i.replace(o),c}}function Gp(n,e,t){let r=n.getChildren(),o=r.length;for(let l=0;l<o;l++){let c=r[l];if(!B(c)||!c.isSimpleText())return Mu(n),void t(null,n.getURL())}let s=n.getTextContent(),i=fS(s,e);if(i===null||i.text!==s||!mS(n)||!_S(n))return Mu(n),void t(null,n.getURL());let a=n.getURL();if(a!==i.url&&(n.setURL(i.url),t(i.url,a)),i.attributes){let l=n.getRel();l!==i.attributes.rel&&(n.setRel(i.attributes.rel||null),t(i.attributes.rel||null,l));let c=n.getTarget();c!==i.attributes.target&&(n.setTarget(i.attributes.target||null),t(i.attributes.target||null,c))}}function Mu(n){let e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}var CS={changeHandlers:[],matchers:[]};function xS(n,e=CS){let{matchers:t,changeHandlers:r}=e,o=(s,i)=>{for(let a of r)a(s,i)};return Ee(n.registerNodeTransform(Ft,s=>{let i=s.getParentOrThrow(),a=s.getPreviousSibling();if(ir(i)&&!i.getIsUnlinked())Gp(i,t,o);else if(!sr(i)){if(s.isSimpleText()&&(Yp(s.getTextContent())||!ir(a))){let l=function(c){let u=[c],d=c.getNextSibling();for(;d!==null&&B(d)&&d.isSimpleText()&&(u.push(d),!/[\s]/.test(d.getTextContent()));)d=d.getNextSibling();return u}(s);(function(c,u,d){let h=[...c],g=h.map(_=>_.getTextContent()).join(""),f,p=g,m=0;for(;(f=fS(p,u))&&f!==null;){let _=f.index,C=_+f.length;if(Mk(m+_,m+C,g,h)){let[x,,y,S]=Dk(h,m+_,m+C),b=Ik(y,m+_-x,m+C-x,f);h=b?[b,...S]:S,d(f.url,null),m=0}else m+=C;p=p.substring(C)}})(l,t,o)}(function(l,c,u){let d=l.getPreviousSibling(),h=l.getNextSibling(),g=l.getTextContent();var f;!ir(d)||d.getIsUnlinked()||Yp(g)&&(f=g,!(d.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(f):/^\.[a-zA-Z0-9]{1,}/.test(f)))||(d.append(l),Gp(d,c,u),u(null,d.getURL())),!ir(h)||h.getIsUnlinked()||pS(g)||(Mu(h),Gp(h,c,u),u(null,h.getURL()))})(s,t,o)}}),n.registerCommand(Iu,s=>{let i=w();return s!==null||!v(i)||i.extract().forEach(a=>{let l=a.getParent();ir(l)&&(l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty())}),!1},de))}var $k=ue({config:CS,dependencies:[jp],mergeConfig(n,e){let t=Lo(n,e);for(let r of["matchers","changeHandlers"]){let o=e[r];Array.isArray(o)&&(t[r]=[...n[r],...o])}return t},name:"@lexical/link/AutoLink",register:xS}),Pk=tl;var yt=qp,yS=yt.$createAutoLinkNode,Pu=yt.$createLinkNode,bS=yt.$isAutoLinkNode,Fu=yt.$isLinkNode,Li=yt.$toggleLink,q$=yt.AutoLinkExtension,SS=yt.AutoLinkNode,Z$=yt.ClickableLinkExtension,J$=yt.LinkExtension,nl=yt.LinkNode,X$=yt.TOGGLE_LINK_COMMAND,Q$=yt.createLinkMatcherWithRegExp,e5=yt.formatUrl,t5=yt.registerAutoLink,n5=yt.registerClickableLink,r5=yt.registerLink,o5=yt.toggleLink;var Zp={};Lt(Zp,{$generateHtmlFromNodes:()=>Bk,$generateNodesFromDOM:()=>Fk});function Fk(n,e){let t=v1(e)?e.body.childNodes:e.childNodes,r=[],o=[];for(let s of t)if(!NS.has(s.nodeName)){let i=ES(s,n,o,!1);i!==null&&(r=r.concat(i))}return function(s){for(let i of s)i.getNextSibling()instanceof sp&&i.insertAfter(pt());for(let i of s){let a=i.getChildren();for(let l of a)i.insertBefore(l);i.remove()}}(o),r}function Bk(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let t=document.createElement("div"),r=Be().getChildren();for(let o=0;o<r.length;o++)TS(n,r[o],t,e);return t.innerHTML}function TS(n,e,t,r=null){let o=r===null||e.isSelected(r),s=F(e)&&e.excludeFromCopy("html"),i=e;r!==null&&B(e)&&(i=Cu(r,e,"clone"));let a=F(i)?i.getChildren():[],l=E1(n,i.getType()),c;c=l&&l.exportDOM!==void 0?l.exportDOM(n,i):i.exportDOM(n);let{element:u,after:d}=c;if(!u)return!1;let h=document.createDocumentFragment();for(let g=0;g<a.length;g++){let f=a[g],p=TS(n,f,h,r);!o&&F(e)&&p&&e.extractWithChild(f,r,"html")&&(o=!0)}if(o&&!s){if((Xe(u)||cp(u))&&u.append(h),t.append(u),d){let g=d.call(i,u);g&&(cp(u)?u.replaceChildren(g):u.replaceWith(g))}}else t.append(h);return o}var NS=new Set(["STYLE","SCRIPT"]);function ES(n,e,t,r,o=new Map,s){let i=[];if(NS.has(n.nodeName))return i;let a=null,l=function(f,p){let{nodeName:m}=f,_=p._htmlConversions.get(m.toLowerCase()),C=null;if(_!==void 0)for(let x of _){let y=x(f);y!==null&&(C===null||(C.priority||0)<=(y.priority||0))&&(C=y)}return C!==null?C.conversion:null}(n,e),c=l?l(n):null,u=null;if(c!==null){u=c.after;let f=c.node;if(a=Array.isArray(f)?f[f.length-1]:f,a!==null){for(let[,p]of o)if(a=p(a,s),!a)break;a&&i.push(...Array.isArray(f)?f:[a])}c.forChild!=null&&o.set(n.nodeName,c.forChild)}let d=n.childNodes,h=[],g=(a==null||!Ze(a))&&(a!=null&&fi(a)||r);for(let f=0;f<d.length;f++)h.push(...ES(d[f],e,t,g,new Map(o),a));return u!=null&&(h=u(h)),Ep(n)&&(h=Hk(n,h,g?()=>{let f=new sp;return t.push(f),f}:U)),a==null?h.length>0?i=i.concat(h):Ep(n)&&function(f){return f.nextSibling==null||f.previousSibling==null?!1:ja(f.nextSibling)&&ja(f.previousSibling)}(n)&&(i=i.concat(pt())):F(a)&&a.append(...h),i}function Hk(n,e,t){let r=n.style.textAlign,o=[],s=[];for(let i=0;i<e.length;i++){let a=e[i];if(fi(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(s.push(a),i===e.length-1||i<e.length-1&&fi(e[i+1])){let l=t();l.setFormat(r),l.append(...s),o.push(l),s=[]}}return o}var AS=Zp,Bu=AS.$generateHtmlFromNodes,bs=AS.$generateNodesFromDOM;var Xp={};Lt(Xp,{$generateJSONFromSelectedNodes:()=>LS,$generateNodesFromSerializedNodes:()=>RS,$getClipboardDataFromSelection:()=>DS,$getHtmlContent:()=>vS,$getLexicalContent:()=>OS,$insertDataTransferForPlainText:()=>zk,$insertDataTransferForRichText:()=>Kk,$insertGeneratedNodes:()=>Jp,copyToClipboard:()=>Uk,setLexicalClipboardDataTransfer:()=>IS});function Hu(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function vS(n,e=w()){return e==null&&Hu(166),v(e)&&e.isCollapsed()||e.getNodes().length===0?"":Bu(n,e)}function OS(n,e=w()){return e==null&&Hu(166),v(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(LS(n,e))}function zk(n,e){let t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function Kk(n,e,t){let r=n.getData("application/x-lexical-editor");if(r)try{let a=JSON.parse(r);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return Jp(t,RS(a.nodes),e)}catch(a){console.error(a)}let o=n.getData("text/html"),s=n.getData("text/plain");if(o&&s!==o)try{let a=new DOMParser().parseFromString(function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l}(o),"text/html");return Jp(t,bs(t,a),e)}catch(a){console.error(a)}let i=s||n.getData("text/uri-list");if(i!=null)if(v(e)){let a=i.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){let c=w();if(v(c)){let u=a[l];u===`
`||u===`\r
`?c.insertParagraph():u===" "?c.insertNodes([an()]):c.insertText(u)}}}else e.insertRawText(i)}function Jp(n,e,t){n.dispatchCommand(Ya,{nodes:e,selection:t})||(t.insertNodes(e),function(r){if(v(r)&&r.isCollapsed()){let o=r.anchor,s=null,i=xo(o,"previous");if(i)if(eu(i))s=i.origin;else{let a=Pa(i,ln(Be(),"next").getFlipped());for(let l of a){if(B(l.origin)){s=l.origin;break}if(F(l.origin)&&!l.origin.isInline())break}}if(s&&B(s)){let a=s.getFormat(),l=s.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}}(t))}function kS(n,e,t,r=[]){let o=e===null||t.isSelected(e),s=F(t)&&t.excludeFromCopy("html"),i=t;e!==null&&B(i)&&(i=Cu(e,i,"clone"));let a=F(i)?i.getChildren():[],l=function(c){let u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Hu(58,d.name),F(c)){let h=u.children;Array.isArray(h)||Hu(59,d.name)}return u}(i);B(i)&&i.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){let u=a[c],d=kS(n,e,u,l.children);!o&&F(t)&&d&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!s)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){let u=l.children[c];r.push(u)}return o}function LS(n,e){let t=[],r=Be().getChildren();for(let o=0;o<r.length;o++)kS(n,e,r[o],t);return{namespace:n._config.namespace,nodes:t}}function RS(n){let e=[];for(let t=0;t<n.length;t++){let r=n[t],o=u1(r);B(o)&&G1(o),e.push(o)}return e}var Ri=null;async function Uk(n,e,t){if(Ri!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(wS(n,e,t))})});let r=n.getRootElement(),o=n._window||window,s=o.document,i=ko(o);if(r===null||i===null)return!1;let a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),r.append(a);let l=new Range;return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise((c,u)=>{let d=n.registerCommand(_i,h=>(At(h,ClipboardEvent)&&(d(),Ri!==null&&(o.clearTimeout(Ri),Ri=null),c(wS(n,h,t))),!0),Jn);Ri=o.setTimeout(()=>{d(),Ri=null,c(!1)},50),s.execCommand("copy"),a.remove()})}function wS(n,e,t){if(t===void 0){let o=ko(n._window),s=w();if(!s||s.isCollapsed()||!o)return!1;let i=o.anchorNode,a=o.focusNode;if(i!==null&&a!==null&&!L1(n,i,a))return!1;t=DS(s)}e.preventDefault();let r=e.clipboardData;return r!==null&&(IS(r,t),!0)}var MS=[["text/html",vS],["application/x-lexical-editor",OS]];function DS(n=w()){let e={"text/plain":n?n.getTextContent():""};if(n){let t=Fr();for(let[r,o]of MS){let s=o(t,n);s!==null&&(e[r]=s)}}return e}function IS(n,e){for(let[t]of MS)e[t]===void 0&&n.setData(t,"");for(let t in e){let r=e[t];r!==void 0&&n.setData(t,r)}}var ar=Xp,f5=ar.$generateJSONFromSelectedNodes,p5=ar.$generateNodesFromSerializedNodes,$S=ar.$getClipboardDataFromSelection,PS=ar.$getHtmlContent,m5=ar.$getLexicalContent,Qp=ar.$insertDataTransferForPlainText,rl=ar.$insertDataTransferForRichText,_5=ar.$insertGeneratedNodes,ol=ar.copyToClipboard,C5=ar.setLexicalClipboardDataTransfer;var em={};Lt(em,{DragonExtension:()=>Wk,registerDragonSupport:()=>FS});function FS(n){let e=window.location.origin,t=r=>{if(r.origin!==e)return;let o=n.getRootElement();if(document.activeElement!==o)return;let s=r.data;if(typeof s=="string"){let i;try{i=JSON.parse(s)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){let a=i.payload;if(a&&a.functionId==="makeChanges"){let l=a.args;if(l){let[c,u,d,h,g]=l;n.update(()=>{let f=w();if(v(f)){let p=f.anchor,m=p.getNode(),_=0,C=0;if(B(m)&&c>=0&&u>=0&&(_=c,C=c+u,f.setTextNodeRange(m,_,m,C)),_===C&&d===""||(f.insertRawText(d),m=p.getNode()),B(m)){_=h,C=h+g;let x=m.getTextContentSize();_=_>x?x:_,C=C>x?x:C,f.setTextNodeRange(m,_,m,C)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}var Wk=ue({build:(n,e,t)=>In(e),config:xt({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(n,e,t)=>Ht(()=>t.getOutput().disabled.value?void 0:FS(n))});var BS=em,zu=BS.DragonExtension,S5=BS.registerDragonSupport;var tm={};Lt(tm,{PlainTextExtension:()=>Jk,registerPlainText:()=>KS});var Ss=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Gk=Ss&&"documentMode"in document?document.documentMode:null,Vk=Ss&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Yk=!(!Ss||!("InputEvent"in window)||Gk)&&"getTargetRanges"in new window.InputEvent("input"),jk=Ss&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),HS=Ss&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,qk=Ss&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Zk=Ss&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Vk&&!qk;function zS(n,e){e.update(()=>{if(n!==null){let t=At(n,KeyboardEvent)?null:n.clipboardData,r=w();if(r!==null&&!r.isCollapsed()&&t!=null){n.preventDefault();let o=PS(e);o!==null&&t.setData("text/html",o),t.setData("text/plain",r.getTextContent())}}})}function KS(n){return Ee(n.registerCommand(un,e=>{let t=w();return!!v(t)&&(t.deleteCharacter(e),!0)},W),n.registerCommand(xi,e=>{let t=w();return!!v(t)&&(t.deleteWord(e),!0)},W),n.registerCommand(hs,e=>{let t=w();return!!v(t)&&(t.deleteLine(e),!0)},W),n.registerCommand(mi,e=>{let t=w();if(!v(t))return!1;if(typeof e=="string")t.insertText(e);else{let r=e.dataTransfer;if(r!=null)Qp(r,t);else{let o=e.data;o&&t.insertText(o)}}return!0},W),n.registerCommand(cu,()=>{let e=w();return!!v(e)&&(e.removeText(),!0)},W),n.registerCommand(bi,e=>{let t=w();return!!v(t)&&(t.insertLineBreak(e),!0)},W),n.registerCommand(Xn,()=>{let e=w();return!!v(e)&&(e.insertLineBreak(),!0)},W),n.registerCommand(Qn,e=>{let t=w();if(!v(t))return!1;let r=e,o=r.shiftKey;return!!Ai(t,!0)&&(r.preventDefault(),Ei(t,o,!0),!0)},W),n.registerCommand(wo,e=>{let t=w();if(!v(t))return!1;let r=e,o=r.shiftKey;return!!Ai(t,!1)&&(r.preventDefault(),Ei(t,o,!1),!0)},W),n.registerCommand(vo,e=>{let t=w();return!!v(t)&&(!HS||navigator.language!=="ko-KR")&&(e.preventDefault(),n.dispatchCommand(un,!0))},W),n.registerCommand(Si,e=>{let t=w();return!!v(t)&&(e.preventDefault(),n.dispatchCommand(un,!1))},W),n.registerCommand(Ur,e=>{let t=w();if(!v(t))return!1;if(e!==null){if((HS||jk||Zk)&&Yk)return!1;e.preventDefault()}return n.dispatchCommand(bi,!1)},W),n.registerCommand(uu,()=>(pi(),!0),W),n.registerCommand(_i,e=>{let t=w();return!!v(t)&&(zS(e,n),!0)},W),n.registerCommand(Ci,e=>{let t=w();return!!v(t)&&(function(r,o){zS(r,o),o.update(()=>{let s=w();v(s)&&s.removeText()})}(e,n),!0)},W),n.registerCommand(Oo,e=>{let t=w();return!!v(t)&&(function(r,o){r.preventDefault(),o.update(()=>{let s=w(),i=At(r,ClipboardEvent)?r.clipboardData:null;i!=null&&v(s)&&Qp(i,s)},{tag:Wr})}(e,n),!0)},W),n.registerCommand(su,e=>{let t=w();return!!v(t)&&(e.preventDefault(),!0)},W),n.registerCommand(ou,e=>{let t=w();return!!v(t)&&(e.preventDefault(),!0)},W))}var Jk=ue({conflictsWith:["@lexical/rich-text"],dependencies:[zu],name:"@lexical/plain-text",register:KS});var US=tm,O5=US.PlainTextExtension,WS=US.registerPlainText;var sm={};Lt(sm,{$createHeadingNode:()=>Di,$createQuoteNode:()=>om,$isHeadingNode:()=>iL,$isQuoteNode:()=>oL,DRAG_DROP_PASTE:()=>rm,HeadingNode:()=>Ho,QuoteNode:()=>Bo,RichTextExtension:()=>aL,eventFiles:()=>sl,registerRichText:()=>ZS});function GS(n,e){if(document.caretRangeFromPoint!==void 0){let t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){let t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}var Ts=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Xk=Ts&&"documentMode"in document?document.documentMode:null,Qk=Ts&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),eL=!(!Ts||!("InputEvent"in window)||Xk)&&"getTargetRanges"in new window.InputEvent("input"),tL=Ts&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),VS=Ts&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,nL=Ts&&/^(?=.*Chrome).*/i.test(navigator.userAgent),rL=Ts&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Qk&&!nL,rm=Ct("DRAG_DROP_PASTE_FILE"),Bo=class extends Ye{static getType(){return"quote"}static clone(e){return new Bo(e.__key)}createDOM(e){let t=document.createElement("blockquote");return _e(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:sL,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Xe(t)){this.isEmpty()&&t.append(document.createElement("br"));let r=this.getFormatType();r&&(t.style.textAlign=r);let o=this.getDirection();o&&(t.dir=o)}return{element:t}}static importJSON(e){return om().updateFromJSON(e)}insertNewAfter(e,t){let r=U(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,t),r}collapseAtStart(){let e=U();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function om(){return ft(new Bo)}function oL(n){return n instanceof Bo}var Ho=class extends Ye{__tag;static getType(){return"heading"}static clone(e){return new Ho(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,r=document.createElement(t),o=e.theme.heading;if(o!==void 0){let s=o[t];_e(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Mi,priority:0}),h2:e=>({conversion:Mi,priority:0}),h3:e=>({conversion:Mi,priority:0}),h4:e=>({conversion:Mi,priority:0}),h5:e=>({conversion:Mi,priority:0}),h6:e=>({conversion:Mi,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&YS(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>YS(e)?{conversion:t=>({node:Di("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Xe(t)){this.isEmpty()&&t.append(document.createElement("br"));let r=this.getFormatType();r&&(t.style.textAlign=r);let o=this.getDirection();o&&(t.dir=o)}return{element:t}}static importJSON(e){return Di(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let r=e?e.anchor.offset:0,o=this.getLastDescendant(),s=!o||e&&e.anchor.key===o.getKey()&&r===o.getTextContentSize()||!e?U():Di(this.getTag()),i=this.getDirection();if(s.setDirection(i),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){let a=U();a.select(),this.replace(a,!0)}return s}collapseAtStart(){let e=this.isEmpty()?U():Di(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function YS(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Mi(n){let e=n.nodeName.toLowerCase(),t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Di(e),n.style!==null&&(dp(n,t),t.setFormat(n.style.textAlign))),{node:t}}function sL(n){let e=om();return n.style!==null&&(e.setFormat(n.style.textAlign),dp(n,e)),{node:e}}function Di(n="h1"){return ft(new Ho(n))}function iL(n){return n instanceof Ho}function sl(n){let e=null;if(At(n,DragEvent)?e=n.dataTransfer:At(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];let t=e.types,r=t.includes("Files"),o=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),o]}function jS(n){let e=w();if(!v(e))return!1;let t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){let s=r[o],i=s.getKey();if(t.has(i))continue;let a=oe(s,c=>F(c)&&!c.isInline());if(a===null)continue;let l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function qS(n){let e=We(n);return Et(e)}function nm(n){for(let e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function ZS(n){return Ee(n.registerCommand(No,e=>{let t=w();return!!Ke(t)&&(t.clear(),!0)},W),n.registerCommand(un,e=>{let t=w();return v(t)?(t.deleteCharacter(e),!0):!!Ke(t)&&(t.deleteNodes(),!0)},W),n.registerCommand(xi,e=>{let t=w();return!!v(t)&&(t.deleteWord(e),!0)},W),n.registerCommand(hs,e=>{let t=w();return!!v(t)&&(t.deleteLine(e),!0)},W),n.registerCommand(mi,e=>{let t=w();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;let r=e.dataTransfer;if(r!=null)rl(r,t,n);else if(v(t)){let o=e.data;return o&&t.insertText(o),!0}}return!0},W),n.registerCommand(cu,()=>{let e=w();return!!v(e)&&(e.removeText(),!0)},W),n.registerCommand(Kr,e=>{let t=w();return!!v(t)&&(t.formatText(e),!0)},W),n.registerCommand(iu,e=>{let t=w();if(!v(t)&&!Ke(t))return!1;let r=t.getNodes();for(let o of r){let s=oe(o,i=>F(i)&&!i.isInline());s!==null&&s.setFormat(e)}return!0},W),n.registerCommand(bi,e=>{let t=w();return!!v(t)&&(t.insertLineBreak(e),!0)},W),n.registerCommand(Xn,()=>{let e=w();return!!v(e)&&(e.insertParagraph(),!0)},W),n.registerCommand(Ao,()=>(Fa([an()]),!0),W),n.registerCommand($t,()=>jS(e=>{let t=e.getIndent();e.setIndent(t+1)}),W),n.registerCommand(hn,()=>jS(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),W),n.registerCommand(Pt,e=>{let t=w();if(Ke(t)){let r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(v(t)){let r=Qf(t.focus,!0);if(!e.shiftKey&&Et(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},W),n.registerCommand(dn,e=>{let t=w();if(Ke(t)){let r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(v(t)){if(function(o){let s=o.focus;return s.key==="root"&&s.offset===Be().getChildrenSize()}(t))return e.preventDefault(),!0;let r=Qf(t.focus,!1);if(!e.shiftKey&&Et(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},W),n.registerCommand(Qn,e=>{let t=w();if(Ke(t)){let r=t.getNodes();if(r.length>0)return e.preventDefault(),xp(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!v(t))return!1;if(Ai(t,!0)){let r=e.shiftKey;return e.preventDefault(),Ei(t,r,!0),!0}return!1},W),n.registerCommand(wo,e=>{let t=w();if(Ke(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),xp(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!v(t))return!1;let r=e.shiftKey;return!!Ai(t,!1)&&(e.preventDefault(),Ei(t,r,!1),!0)},W),n.registerCommand(vo,e=>{if(qS(e.target))return!1;let t=w();if(v(t)){if(function(r){if(!r.isCollapsed())return!1;let{anchor:o}=r;if(o.offset!==0)return!1;let s=o.getNode();if(Hr(s))return!1;let i=qa(s);return i.getIndent()>0&&(i.is(s)||s.is(i.getFirstDescendant()))}(t))return e.preventDefault(),n.dispatchCommand(hn,void 0);if(VS&&navigator.language==="ko-KR")return!1}else if(!Ke(t))return!1;return e.preventDefault(),n.dispatchCommand(un,!0)},W),n.registerCommand(Si,e=>{if(qS(e.target))return!1;let t=w();return!(!v(t)&&!Ke(t))&&(e.preventDefault(),n.dispatchCommand(un,!1))},W),n.registerCommand(Ur,e=>{let t=w();if(!v(t))return!1;if(nm(t),e!==null){if((VS||tL||rL)&&eL)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(bi,!1)}return n.dispatchCommand(Xn,void 0)},W),n.registerCommand(Ti,()=>{let e=w();return!!v(e)&&(n.blur(),!0)},W),n.registerCommand(su,e=>{let[,t]=sl(e);if(t.length>0){let o=GS(e.clientX,e.clientY);if(o!==null){let{offset:s,node:i}=o,a=We(i);if(a!==null){let l=Zn();if(B(a))l.anchor.set(a.getKey(),s,"text"),l.focus.set(a.getKey(),s,"text");else{let u=a.getParentOrThrow().getKey(),d=a.getIndexWithinParent()+1;l.anchor.set(u,d,"element"),l.focus.set(u,d,"element")}let c=zr(l);De(c)}n.dispatchCommand(rm,t)}return e.preventDefault(),!0}let r=w();return!!v(r)},W),n.registerCommand(ou,e=>{let[t]=sl(e),r=w();return!(t&&!v(r))},W),n.registerCommand(f1,e=>{let[t]=sl(e),r=w();if(t&&!v(r))return!1;let o=GS(e.clientX,e.clientY);if(o!==null){let s=We(o.node);Et(s)&&e.preventDefault()}return!0},W),n.registerCommand(uu,()=>(pi(),!0),W),n.registerCommand(_i,e=>(ol(n,At(e,ClipboardEvent)?e:null),!0),W),n.registerCommand(Ci,e=>(async function(t,r){await ol(r,At(t,ClipboardEvent)?t:null),r.update(()=>{let o=w();v(o)?o.removeText():Ke(o)&&o.getNodes().forEach(s=>s.remove())})}(e,n),!0),W),n.registerCommand(Oo,e=>{let[,t,r]=sl(e);return t.length>0&&!r?(n.dispatchCommand(rm,t),!0):jt(e.target)&&k1(e.target)?!1:w()!==null&&(function(o,s){o.preventDefault(),s.update(()=>{let i=w(),a=At(o,InputEvent)||At(o,KeyboardEvent)?null:o.clipboardData;a!=null&&i!==null&&rl(a,i,s)},{tag:Wr})}(e,n),!0)},W),n.registerCommand(Ni,e=>{let t=w();return v(t)&&nm(t),!1},W),n.registerCommand(_n,e=>{let t=w();return v(t)&&nm(t),!1},W))}var aL=ue({conflictsWith:["@lexical/plain-text"],dependencies:[zu],name:"@lexical/rich-text",nodes:[Ho,Bo],register:ZS});var lr=sm,il=lr.$createHeadingNode,Ii=lr.$createQuoteNode,al=lr.$isHeadingNode,$n=lr.$isQuoteNode,$5=lr.DRAG_DROP_PASTE,Ku=lr.HeadingNode,Uu=lr.QuoteNode,JS=lr.RichTextExtension,P5=lr.eventFiles,XS=lr.registerRichText;var z5=cc(oa(),1);Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.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:n.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(r),inside:n.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(r),alias:"important",inside:n.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(u){["url","bold","italic","strike","code-snippet"].forEach(function(d){u!==d&&(n.languages.markdown[u].inside.content.inside[d]=n.languages.markdown[d])})}),n.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function d(h){if(!(!h||typeof h=="string"))for(var g=0,f=h.length;g<f;g++){var p=h[g];if(p.type!=="code"){d(p.content);continue}var m=p.content[1],_=p.content[3];if(m&&_&&m.type==="code-language"&&_.type==="code-block"&&typeof m.content=="string"){var C=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase();var x="language-"+C;_.alias?typeof _.alias=="string"?_.alias=[_.alias,x]:_.alias.push(x):_.alias=[x]}}}d(u.tokens)}),n.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var d="",h=0,g=u.classes.length;h<g;h++){var f=u.classes[h],p=/language-(.+)/.exec(f);if(p){d=p[1];break}}var m=n.languages[d];if(m)u.content=n.highlight(c(u.content),m,d);else if(d&&d!=="none"&&n.plugins.autoloader){var _="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=_,n.plugins.autoloader.loadLanguages(d,function(){var C=document.getElementById(_);C&&(C.innerHTML=n.highlight(C.textContent,n.languages[d],d))})}}});var i=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var d=u.replace(i,"");return d=d.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(h,g){if(g=g.toLowerCase(),g[0]==="#"){var f;return g[1]==="x"?f=parseInt(g.slice(2),16):f=Number(g.slice(1)),l(f)}else{var p=a[g];return p||h}}),d}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.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}})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism);Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});(function(n){n.languages.typescript=n.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/}),n.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 n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.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:e}}}}),n.languages.ts=n.languages.typescript})(Prism);(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[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:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[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+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.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/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.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:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\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 e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(n){var e=/\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/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.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:e,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/}),n.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 t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism);function t0(n,e){for(let t of n.childNodes){if(Xe(t)&&t.tagName===e)return!0;t0(t,e)}return!1}var cl="data-language",ll="data-highlight-language",Wu="data-theme",Ns=class extends Ye{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new Ns(e.__language,e.__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){let t=document.createElement("code");_e(t,e.theme.code),t.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(t.setAttribute(cl,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(ll,r));let o=this.getTheme();o&&t.setAttribute(Wu,o);let s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){let o=this.__language,s=e.__language;o?o!==s&&t.setAttribute(cl,o):s&&t.removeAttribute(cl);let i=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?i&&o?o!==s&&t.setAttribute(ll,o):t.removeAttribute(ll):i&&o&&t.setAttribute(ll,o);let l=this.__theme,c=e.__theme;l?l!==c&&t.setAttribute(Wu,l):c&&t.removeAttribute(Wu);let u=this.__style,d=e.__style;return u?u!==d&&t.setAttribute("style",u):d&&t.removeAttribute("style"),!1}exportDOM(e){let t=document.createElement("pre");_e(t,e._config.theme.code),t.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(t.setAttribute(cl,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(ll,r));let o=this.getTheme();o&&t.setAttribute(Wu,o);let s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||t0(e,"BR"))?{conversion:QS,priority:1}:null,div:()=>({conversion:cL,priority:1}),pre:()=>({conversion:QS,priority:0}),table:e=>im(e)?{conversion:uL,priority:3}:null,td:e=>{let t=e,r=t.closest("table");return hL(t)||r&&im(r)?{conversion:e0,priority:3}:null},tr:e=>{let r=e.closest("table");return r&&im(r)?{conversion:e0,priority:3}:null}}}static importJSON(e){return ul().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){let r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
`&&r[o-2].getTextContent()===`
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===o){r[o-1].remove(),r[o-2].remove();let c=U();return this.insertAfter(c,t),c}let{anchor:s,focus:i}=e,l=(s.isBefore(i)?s:i).getNode();if(B(l)){let c=fL(l),u=[];for(;;)if(_t(c))u.push(an()),c=c.getNextSibling();else if(o0(c)){let _=0,C=c.getTextContent(),x=c.getTextContentSize();for(;_<x&&C[_]===" ";)_++;if(_!==0&&u.push(r0(" ".repeat(_))),_!==x)break;c=c.getNextSibling()}else break;let d=l.splitText(s.offset)[0],h=s.offset===0?0:1,g=d.getIndexWithinParent()+h,f=l.getParentOrThrow(),p=[pt(),...u];f.splice(g,0,p);let m=u[u.length-1];m?m.select():s.offset===0?d.selectPrevious():d.getNextSibling().selectNext(0,0)}if(lL(l)){let{offset:c}=e.anchor;l.splice(c,0,[pt()]),l.select(c+1,c+1)}return null}canIndent(){return!1}collapseAtStart(){let e=U();return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function ul(n,e){return hi(Ns).setLanguage(n).setTheme(e)}function lL(n){return n instanceof Ns}function QS(n){let e=n.getAttribute(cl);return{node:ul(e)}}function cL(n){let e=n,t=n0(e);return!t&&!dL(e)?{node:null}:{node:t?ul():null}}function uL(){return{node:ul()}}function e0(){return{node:null}}function n0(n){return n.style.fontFamily.match("monospace")!==null}function dL(n){let e=n.parentElement;for(;e!==null;){if(n0(e))return!0;e=e.parentElement}return!1}function hL(n){return n.classList.contains("js-file-line")}function im(n){return n.classList.contains("js-file-line-container")}var Es=class extends Ft{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new Es(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e),r=am(e.theme,this.__highlightType);return _e(t,r),t}updateDOM(e,t,r){let o=super.updateDOM(e,t,r),s=am(r.theme,e.__highlightType),i=am(r.theme,this.__highlightType);return s!==i&&(s&&wt(t,s),i&&_e(t,i)),o}static importJSON(e){return r0().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 ul()}};function am(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function r0(n="",e){return ft(new Es(n,e))}function o0(n){return n instanceof Es}function gL(n,e){let t=n;for(let r=mt(n,e);r&&(o0(r.origin)||_t(r.origin));r=bu(r))t=r.origin;return t}function fL(n){return gL(n,"previous")}var r2=ue({name:"@lexical/code",nodes:[Ns,Es]});(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],o=[];/^\w+$/.test(t)||o.push(/\w+/.exec(t)[0]),t==="diff"&&o.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
?|
|(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);var o2=globalThis.Prism||window.Prism;var _m={};Lt(_m,{$createCodeHighlightNode:()=>Yu,$createCodeNode:()=>$i,$getCodeLineDirection:()=>p0,$getEndOfCodeInLine:()=>pm,$getFirstCodeNodeOfLine:()=>Yr,$getLastCodeNodeOfLine:()=>zo,$getStartOfCodeInLine:()=>fm,$isCodeHighlightNode:()=>je,$isCodeNode:()=>Fn,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>mm,CODE_LANGUAGE_MAP:()=>m0,CodeExtension:()=>CL,CodeHighlightNode:()=>cr,CodeNode:()=>Pn,DEFAULT_CODE_LANGUAGE:()=>gm,PrismTokenizer:()=>C0,getCodeLanguageOptions:()=>bL,getCodeLanguages:()=>yL,getCodeThemeOptions:()=>SL,getDefaultCodeLanguage:()=>pL,getEndOfCodeInLine:()=>vL,getFirstCodeNodeOfLine:()=>AL,getLanguageFriendlyName:()=>xL,getLastCodeNodeOfLine:()=>wL,getStartOfCodeInLine:()=>OL,normalizeCodeLang:()=>_0,normalizeCodeLanguage:()=>_0,registerCodeHighlighting:()=>EL});var l2=cc(oa(),1);function Vu(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var gm="javascript",pL=()=>gm;function g0(n,e){for(let t of n.childNodes){if(Xe(t)&&t.tagName===e)return!0;g0(t,e)}return!1}var hl="data-language",dl="data-highlight-language",Gu="data-theme",Pn=class extends Ye{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new Pn(e.__language,e.__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){let t=document.createElement("code");_e(t,e.theme.code),t.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(t.setAttribute(hl,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(dl,r));let o=this.getTheme();o&&t.setAttribute(Gu,o);let s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){let o=this.__language,s=e.__language;o?o!==s&&t.setAttribute(hl,o):s&&t.removeAttribute(hl);let i=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?i&&o?o!==s&&t.setAttribute(dl,o):t.removeAttribute(dl):i&&o&&t.setAttribute(dl,o);let a=this.__theme,l=e.__theme;a?a!==l&&t.setAttribute(Gu,a):l&&t.removeAttribute(Gu);let c=this.__style,u=e.__style;return c?c!==u&&t.setAttribute("style",c):u&&t.removeAttribute("style"),!1}exportDOM(e){let t=document.createElement("pre");_e(t,e._config.theme.code),t.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(t.setAttribute(hl,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(dl,r));let o=this.getTheme();o&&t.setAttribute(Gu,o);let s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||g0(e,"BR"))?{conversion:s0,priority:1}:null,div:()=>({conversion:mL,priority:1}),pre:()=>({conversion:s0,priority:0}),table:e=>lm(e)?{conversion:_L,priority:3}:null,td:e=>{let t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&lm(r)?{conversion:i0,priority:3}:null},tr:e=>{let t=e.closest("table");return t&&lm(t)?{conversion:i0,priority:3}:null}}}static importJSON(e){return $i().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){let r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
`&&r[o-2].getTextContent()===`
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===o){r[o-1].remove(),r[o-2].remove();let l=U();return this.insertAfter(l,t),l}let{anchor:s,focus:i}=e,a=(s.isBefore(i)?s:i).getNode();if(B(a)){let l=Yr(a),c=[];for(;;)if(_t(l))c.push(an()),l=l.getNextSibling();else{if(!je(l))break;{let m=0,_=l.getTextContent(),C=l.getTextContentSize();for(;m<C&&_[m]===" ";)m++;if(m!==0&&c.push(Yu(" ".repeat(m))),m!==C)break;l=l.getNextSibling()}}let u=a.splitText(s.offset)[0],d=s.offset===0?0:1,h=u.getIndexWithinParent()+d,g=a.getParentOrThrow(),f=[pt(),...c];g.splice(h,0,f);let p=c[c.length-1];p?p.select():s.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Fn(a)){let{offset:l}=e.anchor;a.splice(l,0,[pt()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){let e=U();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function $i(n,e){return hi(Pn).setLanguage(n).setTheme(e)}function Fn(n){return n instanceof Pn}function s0(n){return{node:$i(n.getAttribute(hl))}}function mL(n){let e=n,t=a0(e);return t||function(r){let o=r.parentElement;for(;o!==null;){if(a0(o))return!0;o=o.parentElement}return!1}(e)?{node:t?$i():null}:{node:null}}function _L(){return{node:$i()}}function i0(){return{node:null}}function a0(n){return n.style.fontFamily.match("monospace")!==null}function lm(n){return n.classList.contains("js-file-line-container")}var cr=class extends Ft{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new cr(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e),r=cm(e.theme,this.__highlightType);return _e(t,r),t}updateDOM(e,t,r){let o=super.updateDOM(e,t,r),s=cm(r.theme,e.__highlightType),i=cm(r.theme,this.__highlightType);return s!==i&&(s&&wt(t,s),i&&_e(t,i)),o}static importJSON(e){return Yu().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()}};function cm(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function Yu(n="",e){return ft(new cr(n,e))}function je(n){return n instanceof cr}function f0(n,e){let t=n;for(let r=mt(n,e);r&&(je(r.origin)||_t(r.origin));r=bu(r))t=r.origin;return t}function Yr(n){return f0(n,"previous")}function zo(n){return f0(n,"next")}function p0(n){let e=Yr(n),t=zo(n),r=e;for(;r!==null;){if(je(r)){let s=lp(r.getTextContent());if(s!==null)return s}if(r===t)break;r=r.getNextSibling()}let o=e.getParent();if(F(o)){let s=o.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function fm(n,e){let t=null,r=null,o=n,s=e,i=n.getTextContent();for(;;){if(s===0){if(o=o.getPreviousSibling(),o===null)break;if(je(o)||_t(o)||be(o)||Vu(167),be(o)){t={node:o,offset:1};break}s=Math.max(0,o.getTextContentSize()-1),i=o.getTextContent()}else s--;let l=i[s];je(o)&&l!==" "&&(r={node:o,offset:s})}if(r!==null)return r;let a=null;if(e<n.getTextContentSize())je(n)&&(a=n.getTextContent()[e]);else{let l=n.getNextSibling();je(l)&&(a=l.getTextContent()[0])}if(a!==null&&a!==" ")return t;{let l=function(c,u){let d=c,h=u,g=c.getTextContent(),f=c.getTextContentSize();for(;;){if(!je(d)||h===f){if(d=d.getNextSibling(),d===null||be(d))return null;je(d)&&(h=0,g=d.getTextContent(),f=d.getTextContentSize())}if(je(d)){if(g[h]!==" ")return{node:d,offset:h};h++}}}(n,e);return l!==null?l:t}}function pm(n){let e=zo(n);return be(e)&&Vu(168),e}var CL=ue({name:"@lexical/code",nodes:[Pn,cr]});(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],o=[];/^\w+$/.test(t)||o.push(/\w+/.exec(t)[0]),t==="diff"&&o.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
?|
|(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);var Cn=globalThis.Prism||window.Prism,mm={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"},m0={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function _0(n){return m0[n]||n}function xL(n){let e=_0(n);return mm[e]||e}var yL=()=>Object.keys(Cn.languages).filter(n=>typeof Cn.languages[n]!="function").sort();function bL(){let n=[];for(let[e,t]of Object.entries(mm))n.push([e,t]);return n}function SL(){return[]}function dm(n){return typeof n=="string"?n:Array.isArray(n)?n.map(dm).join(""):dm(n.content)}function TL(n,e){let t=/^diff-([\w-]+)/i.exec(e),r=n.getTextContent(),o=Cn.tokenize(r,Cn.languages[t?"diff":e]);return t&&(o=function(s,i){let a=i,l=Cn.languages[a],c={tokens:s},u=Cn.languages.diff.PREFIXES;for(let d of c.tokens){if(typeof d=="string"||!(d.type in u)||!Array.isArray(d.content))continue;let h=d.type,g=0,f=()=>(g++,new Cn.Token("prefix",u[h],h.replace(/^(\w+).*/,"$1"))),p=d.content.filter(S=>typeof S=="string"||S.type!=="prefix"),m=d.content.length-p.length,_=Cn.tokenize(dm(p),l);_.unshift(f());let C=/\r\n|\n/g,x=S=>{let b=[];C.lastIndex=0;let N,A=0;for(;g<m&&(N=C.exec(S));){let O=N.index+N[0].length;b.push(S.slice(A,O)),A=O,b.push(f())}if(b.length!==0)return A<S.length&&b.push(S.slice(A)),b},y=S=>{for(let b=0;b<S.length&&g<m;b++){let N=S[b];if(typeof N=="string"){let A=x(N);A&&(S.splice(b,1,...A),b+=A.length-1)}else if(typeof N.content=="string"){let A=x(N.content);A&&(N.content=A)}else Array.isArray(N.content)?y(N.content):y([N.content])}};y(_),g<m&&_.push(f()),d.content=_}return c.tokens}(o,t[1])),hm(o)}function hm(n,e){let t=[];for(let r of n)if(typeof r=="string"){let o=r.split(/(\n|\t)/),s=o.length;for(let i=0;i<s;i++){let a=o[i];a===`
`||a===`\r
`?t.push(pt()):a===" "?t.push(an()):a.length>0&&t.push(Yu(a,e))}}else{let{content:o,alias:s}=r;typeof o=="string"?t.push(...hm([o],r.type==="prefix"&&typeof s=="string"?s:r.type)):Array.isArray(o)&&t.push(...hm(o,r.type==="unchanged"?void 0:r.type))}return t}var C0={$tokenize(n,e){return TL(n,e||this.defaultLanguage)},defaultLanguage:gm,tokenize(n,e){return Cn.tokenize(n,Cn.languages[e||""]||Cn.languages[this.defaultLanguage])}};function l0(n,e,t){let r=n.getParent();Fn(r)?x0(r,e,t):je(n)&&n.replace(ye(n.__text))}function NL(n,e){let t=e.getElementByKey(n.getKey());if(t===null)return;let r=n.getChildren(),o=r.length;if(o===t.__cachedChildrenLength)return;t.__cachedChildrenLength=o;let s="1",i=1;for(let a=0;a<o;a++)be(r[a])&&(s+=`
`+ ++i);t.setAttribute("data-gutter",s)}var um=new Set;function x0(n,e,t){let r=n.getKey();n.getLanguage()===void 0&&n.setLanguage(t.defaultLanguage);let o=n.getLanguage()||t.defaultLanguage;if(!function(s){let i=function(l){let c=/^diff-([\w-]+)/i.exec(l);return c?c[1]:null}(s),a=i||s;try{return!!a&&Cn.languages.hasOwnProperty(a)}catch{return!1}}(o))return n.getIsSyntaxHighlightSupported()&&n.setIsSyntaxHighlightSupported(!1),void async function(){}();n.getIsSyntaxHighlightSupported()||n.setIsSyntaxHighlightSupported(!0),um.has(r)||(um.add(r),e.update(()=>{(function(s,i){let a=Fe(s);if(!Fn(a)||!a.isAttached())return;let l=w();if(!v(l))return void i();let c=l.anchor,u=c.offset,d=c.type==="element"&&be(a.getChildAtIndex(c.offset-1)),h=0;if(!d){let g=c.getNode();h=u+g.getPreviousSiblings().reduce((f,p)=>f+p.getTextContentSize(),0)}if(!!i()){if(d)return void c.getNode().select(u,u);a.getChildren().some(g=>{let f=B(g);if(f||be(g)){let p=g.getTextContentSize();if(f&&p>=h)return g.select(h,h),!0;h-=p}return!1})}})(r,()=>{let s=Fe(r);if(!Fn(s)||!s.isAttached())return!1;let i=s.getLanguage()||t.defaultLanguage,a=t.$tokenize(s,i),l=function(h,g){let f=0;for(;f<h.length&&c0(h[f],g[f]);)f++;let p=h.length,m=g.length,_=Math.min(p,m)-f,C=0;for(;C<_;)if(C++,!c0(h[p-C],g[m-C])){C--;break}let x=f,y=p-C,S=g.slice(f,m-C);return{from:x,nodesForReplacement:S,to:y}}(s.getChildren(),a),{from:c,to:u,nodesForReplacement:d}=l;return!(c===u&&!d.length)&&(n.splice(c,u-c,d),!0)})},{onUpdate:()=>{um.delete(r)},skipTransforms:!0}))}function c0(n,e){return je(n)&&je(e)&&n.__text===e.__text&&n.__highlightType===e.__highlightType||_t(n)&&_t(e)||be(n)&&be(e)}function As(n){if(!v(n))return!1;let e=n.anchor.getNode(),t=Fn(e)?e:e.getParent(),r=n.focus.getNode(),o=Fn(r)?r:r.getParent();return Fn(t)&&t.is(o)}function y0(n){let e=n.getNodes(),t=[];if(e.length===1&&Fn(e[0]))return t;let r=[];for(let o=0;o<e.length;o++){let s=e[o];je(s)||_t(s)||be(s)||Vu(169),be(s)?r.length>0&&(t.push(r),r=[]):r.push(s)}if(r.length>0){let o=n.isBackward()?n.anchor:n.focus,s=Rn(r[0].getKey(),0,"text");o.is(s)||t.push(r)}return t}function u0(n){let e=w();if(!v(e)||!As(e))return!1;let t=y0(e),r=t.length;if(r===0&&e.isCollapsed())return n===$t&&e.insertNodes([an()]),!0;if(r===0&&n===$t&&e.getTextContent()===`
`){let o=an(),s=pt(),i=e.isBackward()?"previous":"next";return e.insertNodes([o,s]),Ha(tp(Pa(rp(o,"next",0),Mn(mt(s,"next"))),i)),!0}for(let o=0;o<r;o++){let s=t[o];if(s.length>0){let i=s[0];if(o===0&&(i=Yr(i)),n===$t){let a=an();if(i.insertBefore(a),o===0){let l=e.isBackward()?"focus":"anchor",c=Rn(i.getKey(),0,"text");e[l].is(c)&&e[l].set(a.getKey(),0,"text")}}else _t(i)&&i.remove()}}return!0}function d0(n,e){let t=w();if(!v(t))return!1;let{anchor:r,focus:o}=t,s=r.offset,i=o.offset,a=r.getNode(),l=o.getNode(),c=n===Pt;if(!As(t)||!je(a)&&!_t(a)||!je(l)&&!_t(l))return!1;if(!e.altKey){if(t.isCollapsed()){let _=a.getParentOrThrow();if(c&&s===0&&a.getPreviousSibling()===null){if(_.getPreviousSibling()===null)return _.selectPrevious(),e.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&a.getNextSibling()===null&&_.getNextSibling()===null)return _.selectNext(),e.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=Yr(a),d=zo(l)):(u=Yr(l),d=zo(a)),u==null||d==null)return!1;let h=u.getNodesBetween(d);for(let _=0;_<h.length;_++){let C=h[_];if(!je(C)&&!_t(C)&&!be(C))return!1}e.preventDefault(),e.stopPropagation();let g=c?u.getPreviousSibling():d.getNextSibling();if(!be(g))return!0;let f=c?g.getPreviousSibling():g.getNextSibling();if(f==null)return!0;let p=je(f)||_t(f)||be(f)?c?Yr(f):zo(f):null,m=p??f;return g.remove(),h.forEach(_=>_.remove()),n===Pt?(h.forEach(_=>m.insertBefore(_)),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach(_=>{m.insertAfter(_),m=_})),t.setTextNodeRange(a,s,l,i),!0}function h0(n,e){let t=w();if(!v(t))return!1;let{anchor:r,focus:o}=t,s=r.getNode(),i=o.getNode(),a=n===Wa;if(!As(t)||!je(s)&&!_t(s)||!je(i)&&!_t(i))return!1;let l=i;if(p0(l)==="rtl"?!a:a){let c=fm(l,o.offset);if(c!==null){let{node:u,offset:d}=c;be(u)?u.selectNext(0,0):t.setTextNodeRange(u,d,u,d)}else l.getParentOrThrow().selectStart()}else pm(l).select();return e.preventDefault(),e.stopPropagation(),!0}function EL(n,e){if(!n.hasNodes([Pn,cr]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");e==null&&(e=C0);let t=[];return n._headless!==!0&&t.push(n.registerMutationListener(Pn,r=>{n.getEditorState().read(()=>{for(let[o,s]of r)if(s!=="destroyed"){let i=Fe(o);i!==null&&NL(i,n)}})},{skipInitialization:!1})),t.push(n.registerNodeTransform(Pn,r=>x0(r,n,e)),n.registerNodeTransform(Ft,r=>l0(r,n,e)),n.registerNodeTransform(cr,r=>l0(r,n,e)),n.registerCommand(_n,r=>{let o=function(s){let i=w();if(!v(i)||!As(i))return null;let a=s?hn:$t,l=s?hn:Ao,c=i.anchor,u=i.focus;if(c.is(u))return l;let d=y0(i);if(d.length!==1)return a;let h=d[0],g,f;h.length===0&&Vu(285),i.isBackward()?(g=u,f=c):(g=c,f=u);let p=Yr(h[0]),m=zo(h[0]),_=Rn(p.getKey(),0,"text"),C=Rn(m.getKey(),m.getTextContentSize(),"text");return g.isBefore(_)||C.isBefore(f)?a:_.isBefore(g)||f.isBefore(C)?l:a}(r.shiftKey);return o!==null&&(r.preventDefault(),n.dispatchCommand(o,void 0),!0)},de),n.registerCommand(Ao,()=>!!As(w())&&(Fa([an()]),!0),de),n.registerCommand($t,r=>u0($t),de),n.registerCommand(hn,r=>u0(hn),de),n.registerCommand(Pt,r=>{let o=w();if(!v(o))return!1;let{anchor:s}=o,i=s.getNode();return!!As(o)&&(o.isCollapsed()&&s.offset===0&&i.getPreviousSibling()===null&&Fn(i.getParentOrThrow())?(r.preventDefault(),!0):d0(Pt,r))},de),n.registerCommand(dn,r=>{let o=w();if(!v(o))return!1;let{anchor:s}=o,i=s.getNode();return!!As(o)&&(o.isCollapsed()&&s.offset===i.getTextContentSize()&&i.getNextSibling()===null&&Fn(i.getParentOrThrow())?(r.preventDefault(),!0):d0(dn,r))},de),n.registerCommand(Wa,r=>h0(Wa,r),de),n.registerCommand(au,r=>h0(au,r),de)),Ee(...t)}var AL=Yr,wL=zo,vL=pm,OL=fm;var Le=_m,E2=Le.$createCodeHighlightNode,gl=Le.$createCodeNode,A2=Le.$getCodeLineDirection,w2=Le.$getEndOfCodeInLine,v2=Le.$getFirstCodeNodeOfLine,O2=Le.$getLastCodeNodeOfLine,k2=Le.$getStartOfCodeInLine,L2=Le.$isCodeHighlightNode,Ko=Le.$isCodeNode,b0=Le.CODE_LANGUAGE_FRIENDLY_NAME_MAP,R2=Le.CODE_LANGUAGE_MAP,M2=Le.CodeExtension,S0=Le.CodeHighlightNode,Uo=Le.CodeNode,D2=Le.DEFAULT_CODE_LANGUAGE,I2=Le.PrismTokenizer,$2=Le.getCodeLanguageOptions,P2=Le.getCodeLanguages,F2=Le.getCodeThemeOptions,B2=Le.getDefaultCodeLanguage,H2=Le.getEndOfCodeInLine,z2=Le.getFirstCodeNodeOfLine,K2=Le.getLanguageFriendlyName,U2=Le.getLastCodeNodeOfLine,W2=Le.getStartOfCodeInLine,Cm=Le.normalizeCodeLang,G2=Le.normalizeCodeLanguage,T0=Le.registerCodeHighlighting;var Em={};Lt(Em,{$convertFromMarkdownString:()=>KL,$convertToMarkdownString:()=>UL,BOLD_ITALIC_STAR:()=>U0,BOLD_ITALIC_UNDERSCORE:()=>W0,BOLD_STAR:()=>G0,BOLD_UNDERSCORE:()=>V0,CHECK_LIST:()=>HL,CODE:()=>F0,ELEMENT_TRANSFORMERS:()=>J0,HEADING:()=>$0,HIGHLIGHT:()=>K0,INLINE_CODE:()=>z0,ITALIC_STAR:()=>j0,ITALIC_UNDERSCORE:()=>q0,LINK:()=>Z0,MULTILINE_ELEMENT_TRANSFORMERS:()=>X0,ORDERED_LIST:()=>H0,QUOTE:()=>P0,STRIKETHROUGH:()=>Y0,TEXT_FORMAT_TRANSFORMERS:()=>Q0,TEXT_MATCH_TRANSFORMERS:()=>eT,TRANSFORMERS:()=>Xu,UNORDERED_LIST:()=>B0,registerMarkdownShortcuts:()=>zL});function xm(n,e){let t={};for(let r of n){let o=e(r);o&&(t[o]?t[o].push(r):t[o]=[r])}return t}function Tm(n){let e=xm(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}var qu=/[!-/:-@[-`{-~\s]/,kL=/^\s{0,3}$/;function ym(n){if(!rt(n))return!1;let e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&B(e)&&kL.test(e.getTextContent())}function LL(n,e,t,r){for(let o of e){if(!o.export)continue;let s=o.export(n,i=>Zu(i,t,r));if(s!=null)return s}return F(n)?Zu(n,t,r):Et(n)?n.getTextContent():null}function Zu(n,e,t,r,o){let s=[],i=n.getChildren();r||(r=[]),o||(o=[]);e:for(let a of i){for(let l of t){if(!l.export)continue;let c=l.export(a,u=>Zu(u,e,t,r,[...o,...r]),(u,d)=>N0(u,d,e,r,o));if(c!=null){s.push(c);continue e}}be(a)?s.push(`
`):B(a)?s.push(N0(a,a.getTextContent(),e,r,o)):F(a)?s.push(Zu(a,e,t,r,o)):Et(a)&&s.push(a.getTextContent())}return s.join("")}function N0(n,e,t,r,o){let s=n.getFormat()===0?e:function(h){return h.replace(/^\s+|\s+$/g,g=>[...g].map(f=>"&#"+f.codePointAt(0)+";").join(""))}(e);n.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let i="",a="",l="",c=E0(n,!0),u=E0(n,!1),d=new Set;for(let h of t){let g=h.format[0],f=h.tag;ju(n,g)&&!d.has(g)&&(d.add(g),ju(c,g)&&r.find(p=>p.tag===f)||(r.push({format:g,tag:f}),i+=f))}for(let h=0;h<r.length;h++){let g=ju(n,r[h].format),f=ju(u,r[h].format);if(g&&f)continue;let p=[...r];for(;p.length>h;){let m=p.pop();o&&m&&o.find(_=>_.tag===m.tag)||(m&&typeof m.tag=="string"&&(g?f||(l+=m.tag):a+=m.tag),r.pop())}break}return s=i+s+l,a+s}function E0(n,e){let t=e?n.getPreviousSibling():n.getNextSibling();if(!t){let r=n.getParentOrThrow();r.isInline()&&(t=e?r.getPreviousSibling():r.getNextSibling())}for(;t;){if(F(t)){if(!t.isInline())break;let r=e?t.getLastDescendant():t.getFirstDescendant();if(B(r))return r;t=e?t.getPreviousSibling():t.getNextSibling()}if(B(t))return t;if(!F(t))return null}return null}function ju(n,e){return B(n)&&n.hasFormat(e)}function RL(n,e){let t=function(o,s){let i=o.match(s.openTagsRegExp);if(i==null)return null;for(let a of i){let l=a.replace(/^\s/,""),c=s.fullMatchRegExpByTag[l];if(c==null)continue;let u=o.match(c),d=s.transformersByTag[l];if(u!=null&&d!=null){if(d.intraword!==!1)return u;let{index:h=0}=u,g=o[h-1],f=o[h+u[0].length];if((!g||qu.test(g))&&(!f||qu.test(f)))return u}}return null}(n.getTextContent(),e);if(!t)return null;let r=t.index||0;return{endIndex:r+t[0].length,match:t,startIndex:r,transformer:e.transformersByTag[t[1]]}}function ws(n){return B(n)&&!n.hasFormat("code")}function vs(n,e,t){let r=RL(n,e),o=function(i,a){let l=i,c,u,d,h;for(let g of a){if(!g.replace||!g.importRegExp)continue;let f=l.getTextContent().match(g.importRegExp);if(!f)continue;let p=f.index||0,m=g.getEndIndex?g.getEndIndex(l,f):p+f[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,d=g,h=f)}return c===void 0||u===void 0||d===void 0||h===void 0?null:{endIndex:u,match:h,startIndex:c,transformer:d}}(n,t);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){let i=function(a,l,c,u,d){let h=a.getTextContent(),g,f,p;if(d[0]===h?g=a:l===0?[g,f]=a.splitText(c):[p,g,f]=a.splitText(l,c),g.setTextContent(d[2]),u)for(let m of u.format)g.hasFormat(m)||g.toggleFormat(m);return{nodeAfter:f,nodeBefore:p,transformedNode:g}}(n,r.startIndex,r.endIndex,r.transformer,r.match);ws(i.nodeAfter)&&vs(i.nodeAfter,e,t),ws(i.nodeBefore)&&vs(i.nodeBefore,e,t),ws(i.transformedNode)&&vs(i.transformedNode,e,t)}else if(o){let i=function(a,l,c,u,d){let h,g,f;return l===0?[h,g]=a.splitText(c):[f,h,g]=a.splitText(l,c),u.replace?{nodeAfter:g,nodeBefore:f,transformedNode:u.replace(h,d)||void 0}:null}(n,o.startIndex,o.endIndex,o.transformer,o.match);if(!i)return;ws(i.nodeAfter)&&vs(i.nodeAfter,e,t),ws(i.nodeBefore)&&vs(i.nodeBefore,e,t),ws(i.transformedNode)&&vs(i.transformedNode,e,t)}let s=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(i,a)=>String.fromCodePoint(a));n.setTextContent(s)}function ML(n,e=!1){let t=Tm(n),r=function(o){let s={},i={},a=[],l="(?<![\\\\])";for(let c of o){let{tag:u}=c;s[u]=c;let d=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(d),u.length===1?i[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${d}])(${d})((\\\\${d})?.*?[^${d}\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?![\\\\${d}])`):i[u]=new RegExp(`(?<!\\\\)(${d})((\\\\${d})?.*?[^\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?!\\\\)`)}return{fullMatchRegExpByTag:i,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:s}}(t.textFormat);return(o,s)=>{let i=o.split(`
`),a=i.length,l=s||Be();l.clear();for(let u=0;u<a;u++){let d=i[u],[h,g]=DL(i,u,t.multilineElement,l);h?u=g:IL(d,l,t.element,r,t.textMatch,e)}let c=l.getChildren();for(let u of c)!e&&ym(u)&&l.getChildrenSize()>1&&u.remove();w()!==null&&l.selectStart()}}function DL(n,e,t,r){for(let o of t){let{handleImportAfterStartMatch:s,regExpEnd:i,regExpStart:a,replace:l}=o,c=n[e].match(a);if(!c)continue;if(s){let f=s({lines:n,rootNode:r,startLineIndex:e,startMatch:c,transformer:o});if(f===null)continue;if(f)return f}let u=typeof i=="object"&&"regExp"in i?i.regExp:i,d=i&&typeof i=="object"&&"optional"in i?i.optional:!i,h=e,g=n.length;for(;h<g;){let f=u?n[h].match(u):null;if(!f&&(!d||d&&h<g-1)){h++;continue}if(f&&e===h&&f.index===c.index){h++;continue}let p=[];if(f&&e===h)p.push(n[e].slice(c[0].length,-f[0].length));else for(let m=e;m<=h;m++)if(m===e){let _=n[m].slice(c[0].length);p.push(_)}else if(m===h&&f){let _=n[m].slice(0,-f[0].length);p.push(_)}else p.push(n[m]);if(l(r,null,c,f,p,!0)!==!1)return[!0,h];break}}return[!1,e]}function IL(n,e,t,r,o,s){let i=ye(n),a=U();a.append(i),e.append(a);for(let{regExp:l,replace:c}of t){let u=n.match(l);if(u&&(i.setTextContent(n.slice(u[0].length)),c(a,[i],u,!0)!==!1))break}if(vs(i,r,o),a.isAttached()&&n.length>0){let l=a.getPreviousSibling();if(!s&&(rt(l)||$n(l)||zt(l))){let c=l;if(zt(l)){let u=l.getLastDescendant();c=u==null?null:oe(u,$o)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[pt(),...a.getChildren()]),a.remove())}}}function $L(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var k0=/^(\s*)(\d{1,})\.\s/,L0=/^(\s*)[-*+]\s/,R0=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,bm=/^(#{1,6})\s/,M0=/^>\s/,D0=/^[ \t]*```([\w-]+)?/,Sm=/[ \t]*```$/,PL=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,FL=/^(?:\|)(.+)(?:\|)\s?$/,BL=/^(\| ?:?-*:? ?)+\|\s?$/,A0=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,w0=/^<\/[a-z_][\w-]*\s*>/i,v0=n=>new RegExp(`(?:${n.source})$`,n.flags),fl=gu("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),I0=n=>(e,t,r,o)=>{let s=n(r);s.append(...t),e.replace(s),o||s.select(0,0)},Nm=n=>(e,t,r,o)=>{let s=e.getPreviousSibling(),i=e.getNextSibling(),a=iS(n==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=n!=="bullet"&&n!=="check"||l!==fl.parse(l)?void 0:l;if(zt(i)&&i.getListType()===n){c&&To(i,fl,c);let d=i.getFirstChild();d!==null?d.insertBefore(a):i.append(a),e.remove()}else if(zt(s)&&s.getListType()===n)c&&To(s,fl,c),s.append(a),e.remove();else{let d=Ru(n,n==="number"?Number(r[2]):void 0);c&&To(d,fl,c),d.append(a),e.replace(d)}a.append(...t),o||a.select(0,0);let u=function(d){let h=d.match(/\t/g),g=d.match(/ /g),f=0;return h&&(f+=h.length),g&&(f+=Math.floor(g.length/4)),f}(r[1]);u&&a.setIndent(u)},Ju=(n,e,t)=>{let r=[],o=n.getChildren(),s=0;for(let i of o)if($o(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(zt(d)){r.push(Ju(d,e,t+1));continue}}let a=" ".repeat(4*t),l=n.getListType(),c=gi(n,fl),u=l==="number"?`${n.getStart()+s}. `:l==="check"?`${c} [${i.getChecked()?"x":" "}] `:c+" ";r.push(a+u+e(i)),s++}return r.join(`
`)},$0={dependencies:[Ku],export:(n,e)=>{if(!al(n))return null;let t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:bm,replace:I0(n=>{let e="h"+n[1].length;return il(e)}),type:"element"},P0={dependencies:[Uu],export:(n,e)=>{if(!$n(n))return null;let t=e(n).split(`
`),r=[];for(let o of t)r.push("> "+o);return r.join(`
`)},regExp:M0,replace:(n,e,t,r)=>{if(r){let s=n.getPreviousSibling();if($n(s))return s.splice(s.getChildrenSize(),0,[pt(),...e]),void n.remove()}let o=Ii();o.append(...e),n.replace(o),r||o.select(0,0)},type:"element"},F0={dependencies:[Uo],export:n=>{if(!Ko(n))return null;let e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:Sm},regExpStart:D0,replace:(n,e,t,r,o,s)=>{let i,a;if(!e&&o){if(o.length===1)r?(i=gl(),a=t[1]+o[0]):(i=gl(t[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(i=gl(t[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
`)}let l=ye(a);i.append(l),n.append(i)}else e&&I0(l=>gl(l?l[1]:void 0))(n,e,t,s)},type:"multiline-element"},B0={dependencies:[Fo,Po],export:(n,e)=>zt(n)?Ju(n,e,0):null,regExp:L0,replace:Nm("bullet"),type:"element"},HL={dependencies:[Fo,Po],export:(n,e)=>zt(n)?Ju(n,e,0):null,regExp:R0,replace:Nm("check"),type:"element"},H0={dependencies:[Fo,Po],export:(n,e)=>zt(n)?Ju(n,e,0):null,regExp:k0,replace:Nm("number"),type:"element"},z0={format:["code"],tag:"`",type:"text-format"},K0={format:["highlight"],tag:"==",type:"text-format"},U0={format:["bold","italic"],tag:"***",type:"text-format"},W0={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},G0={format:["bold"],tag:"**",type:"text-format"},V0={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Y0={format:["strikethrough"],tag:"~~",type:"text-format"},j0={format:["italic"],tag:"*",type:"text-format"},q0={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Z0={dependencies:[nl],export:(n,e,t)=>{if(!Fu(n)||bS(n))return null;let r=n.getTitle(),o=e(n);return r?`[${o}](${n.getURL()} "${r}")`:`[${o}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{let[,t,r,o]=e,s=Pu(r,{title:o}),i=t.split("[").length-1,a=t.split("]").length-1,l=t,c="";if(i<a)return;if(i>a){let d=t.split("[");c="["+d[0],l=d.slice(1).join("[")}let u=ye(l);return u.setFormat(n.getFormat()),s.append(u),n.replace(s),c&&s.insertBefore(ye(c)),u},trigger:")",type:"text-match"},J0=[$0,P0,B0,H0],X0=[F0],Q0=[z0,U0,W0,G0,V0,K0,j0,q0,Y0],eT=[Z0],Xu=[...J0,...X0,...Q0,...eT];function O0(n,e,t){let r=t.length;for(let o=e;o>=r;o--){let s=o-r;if(tT(n,s,t,0,r)&&n[s+r]!==" ")return s}return-1}function tT(n,e,t,r,o){for(let s=0;s<o;s++)if(n[e+s]!==t[r+s])return!1;return!0}function zL(n,e=Xu){let t=Tm(e),r=xm(t.textFormat,({tag:i})=>i[i.length-1]),o=xm(t.textMatch,({trigger:i})=>i);for(let i of e){let a=i.type;if(a==="element"||a==="text-match"||a==="multiline-element"){let l=i.dependencies;for(let c of l)n.hasNode(c)||$L(173,c.getType())}}let s=(i,a,l)=>{(function(c,u,d,h){let g=c.getParent();if(!Ze(g)||c.getFirstChild()!==u)return!1;let f=u.getTextContent();if(f[d-1]!==" ")return!1;for(let{regExp:p,replace:m}of h){let _=f.match(p);if(_&&_[0].length===(_[0].endsWith(" ")?d:d-1)){let C=u.getNextSiblings(),[x,y]=u.splitText(d);if(m(c,y?[y,...C]:C,_,!1)!==!1)return x.remove(),!0}}return!1})(i,a,l,t.element)||function(c,u,d,h){let g=c.getParent();if(!Ze(g)||c.getFirstChild()!==u)return!1;let f=u.getTextContent();if(f[d-1]!==" ")return!1;for(let{regExpStart:p,replace:m,regExpEnd:_}of h){if(_&&!("optional"in _)||_&&"optional"in _&&!_.optional)continue;let C=f.match(p);if(C&&C[0].length===(C[0].endsWith(" ")?d:d-1)){let x=u.getNextSiblings(),[y,S]=u.splitText(d);if(m(c,S?[S,...x]:x,C,null,null,!1)!==!1)return y.remove(),!0}}return!1}(i,a,l,t.multilineElement)||function(c,u,d){let h=c.getTextContent(),g=d[h[u-1]];if(g==null)return!1;u<h.length&&(h=h.slice(0,u));for(let f of g){if(!f.replace||!f.regExp)continue;let p=h.match(f.regExp);if(p===null)continue;let m=p.index||0,_=m+p[0].length,C;return m===0?[C]=c.splitText(_):[,C]=c.splitText(m,_),C.selectNext(0,0),f.replace(C,p),!0}return!1}(a,l,o)||function(c,u,d){let h=c.getTextContent(),g=u-1,f=h[g],p=d[f];if(!p)return!1;for(let m of p){let{tag:_}=m,C=_.length,x=g-C+1;if(C>1&&!tT(h,x,_,0,C)||h[x-1]===" ")continue;let y=h[g+1];if(m.intraword===!1&&y&&!qu.test(y))continue;let S=c,b=S,N=O0(h,x,_),A=b;for(;N<0&&(A=A.getPreviousSibling())&&!be(A);)if(B(A)){if(A.hasFormat("code"))continue;let ie=A.getTextContent();b=A,N=O0(ie,ie.length,_)}if(N<0||b===S&&N+C===x)continue;let O=b.getTextContent();if(N>0&&O[N-1]===f)continue;let P=O[N-1];if(m.intraword===!1&&P&&!qu.test(P))continue;let I=S.getTextContent(),z=I.slice(0,x)+I.slice(g+1);S.setTextContent(z);let G=b===S?z:O;b.setTextContent(G.slice(0,N)+G.slice(N+C));let q=w(),K=Zn();De(K);let le=g-C*(b===S?2:1)+1;K.anchor.set(b.__key,N,"text"),K.focus.set(S.__key,le,"text");for(let ie of m.format)K.hasFormat(ie)||K.formatText(ie);K.anchor.set(K.focus.key,K.focus.offset,K.focus.type);for(let ie of m.format)K.hasFormat(ie)&&K.toggleFormat(ie);return v(q)&&(K.format=q.format),!0}}(a,l,r)};return n.registerUpdateListener(({tags:i,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(i.has(g1)||i.has(yi)||n.isComposing())return;let u=l.read(w),d=c.read(w);if(!v(d)||!v(u)||!u.isCollapsed()||u.is(d))return;let h=u.anchor.key,g=u.anchor.offset,f=l._nodeMap.get(h);!B(f)||!a.has(h)||g!==1&&g>d.anchor.offset+1||n.update(()=>{if(!ws(f))return;let p=f.getParent();p===null||Ko(p)||s(p,f,u.anchor.offset)})})}function KL(n,e=Xu,t,r=!1,o=!1){let s=r?n:function(i,a=!1){let l=i.split(`
`),c=!1,u=[];for(let d=0;d<l.length;d++){let h=l[d].trimEnd(),g=u[u.length-1];PL.test(h)?u.push(h):D0.test(h)||Sm.test(h)?(c=!c,u.push(h)):c||h===""||g===""||!g||bm.test(g)||bm.test(h)||M0.test(h)||k0.test(h)||L0.test(h)||R0.test(h)||FL.test(h)||BL.test(h)||!a||A0.test(h)||w0.test(h)||v0(w0).test(g)||v0(A0).test(g)||Sm.test(g)?u.push(h):u[u.length-1]=g+" "+h.trimStart()}return u.join(`
`)}(n,o);return ML(e,r)(s,t)}function UL(n=Xu,e,t=!1){return function(o,s=!1){let i=Tm(o),a=[...i.multilineElement,...i.element],l=!s,c=i.textFormat.filter(u=>u.format.length===1).sort((u,d)=>Number(u.format.includes("code"))-Number(d.format.includes("code")));return u=>{let d=[],h=(u||Be()).getChildren();for(let g=0;g<h.length;g++){let f=h[g],p=LL(f,a,c,i.textMatch);p!=null&&d.push(l&&g>0&&!ym(f)&&!ym(h[g-1])?`
`.concat(p):p)}return d.join(`
`)}}(n,t)(e)}var He=Em,Q2=He.$convertFromMarkdownString,e3=He.$convertToMarkdownString,t3=He.BOLD_ITALIC_STAR,n3=He.BOLD_ITALIC_UNDERSCORE,r3=He.BOLD_STAR,o3=He.BOLD_UNDERSCORE,s3=He.CHECK_LIST,i3=He.CODE,a3=He.ELEMENT_TRANSFORMERS,l3=He.HEADING,c3=He.HIGHLIGHT,u3=He.INLINE_CODE,d3=He.ITALIC_STAR,h3=He.ITALIC_UNDERSCORE,g3=He.LINK,f3=He.MULTILINE_ELEMENT_TRANSFORMERS,p3=He.ORDERED_LIST,m3=He.QUOTE,_3=He.STRIKETHROUGH,C3=He.TEXT_FORMAT_TRANSFORMERS,x3=He.TEXT_MATCH_TRANSFORMERS,nT=He.TRANSFORMERS,y3=He.UNORDERED_LIST,rT=He.registerMarkdownShortcuts;var Am={};Lt(Am,{HistoryExtension:()=>Qu,SharedHistoryExtension:()=>VL,createEmptyHistoryState:()=>iT,registerHistory:()=>sT});function WL(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return 0;let s=e._selection,i=n._selection;if(o)return 1;if(!(v(s)&&v(i)&&i.isCollapsed()&&s.isCollapsed()))return 0;let a=function(_,C,x){let y=_._nodeMap,S=[];for(let b of C){let N=y.get(b);N!==void 0&&S.push(N)}for(let[b,N]of x){if(!N)continue;let A=y.get(b);A===void 0||Hr(A)||S.push(A)}return S}(e,t,r);if(a.length===0)return 0;if(a.length>1){let _=e._nodeMap,C=_.get(s.anchor.key),x=_.get(i.anchor.key);return C&&x&&!n._nodeMap.has(C.__key)&&B(C)&&C.__text.length===1&&s.anchor.offset===1?2:0}let l=a[0],c=n._nodeMap.get(l.__key);if(!B(c)||!B(l)||c.__mode!==l.__mode)return 0;let u=c.__text,d=l.__text;if(u===d)return 0;let h=s.anchor,g=i.anchor;if(h.key!==g.key||h.type!=="text")return 0;let f=h.offset,p=g.offset,m=d.length-u.length;return m===1&&p===f-1?2:m===-1&&p===f+1?3:m===-1&&p===f?4:0}function GL(n,e){let t=Date.now(),r=0;return(o,s,i,a,l,c)=>{let u=Date.now();if(c.has(yi))return r=0,t=u,2;let d=WL(o,s,a,l,n.isComposing()),h=(()=>{let g=i===null||i.editor===n,f=c.has(m1);if(!f&&g&&c.has(gs))return 0;if(o===null)return 1;let p=s._selection;if(!(a.size>0||l.size>0))return p!==null?0:2;let m=typeof e=="number"?e:e.peek();return f===!1&&d!==0&&d===r&&u<t+m&&g||a.size===1&&function(_,C,x){let y=C._nodeMap.get(_),S=x._nodeMap.get(_),b=C._selection,N=x._selection;return!(v(b)&&v(N)&&b.anchor.type==="element"&&b.focus.type==="element"&&N.anchor.type==="text"&&N.focus.type==="text"||!B(y)||!B(S)||y.__parent!==S.__parent)&&JSON.stringify(C.read(()=>y.exportJSON()))===JSON.stringify(x.read(()=>S.exportJSON()))}(Array.from(a)[0],o,s)?0:1})();return t=u,r=d,h}}function oT(n){n.undoStack=[],n.redoStack=[],n.current=null}function sT(n,e,t){let r=GL(n,t);return Ee(n.registerCommand(du,()=>(function(s,i){let a=i.redoStack,l=i.undoStack;if(l.length!==0){let c=i.current,u=l.pop();c!==null&&(a.push(c),s.dispatchCommand(za,!0)),l.length===0&&s.dispatchCommand(Ka,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:yi})}}(n,e),!0),W),n.registerCommand(lu,()=>(function(s,i){let a=i.redoStack,l=i.undoStack;if(a.length!==0){let c=i.current;c!==null&&(l.push(c),s.dispatchCommand(Ka,!0));let u=a.pop();a.length===0&&s.dispatchCommand(za,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:yi})}}(n,e),!0),W),n.registerCommand(nu,()=>(oT(e),!1),W),n.registerCommand(ru,()=>(oT(e),n.dispatchCommand(za,!1),n.dispatchCommand(Ka,!1),!0),W),n.registerUpdateListener(({editorState:s,prevEditorState:i,dirtyLeaves:a,dirtyElements:l,tags:c})=>{let u=e.current,d=e.redoStack,h=e.undoStack,g=u===null?null:u.editorState;if(u!==null&&s===g)return;let f=r(i,s,u,a,l,c);if(f===1)d.length!==0&&(e.redoStack=[],n.dispatchCommand(za,!1)),u!==null&&(h.push({...u}),n.dispatchCommand(Ka,!0));else if(f===2)return;e.current={editor:n,editorState:s}}))}function iT(){return{current:null,redoStack:[],undoStack:[]}}var Qu=ue({build:(n,{delay:e,createInitialHistoryState:t,disabled:r})=>In({delay:e,disabled:r,historyState:t(n)}),config:xt({createInitialHistoryState:iT,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(n,e,t)=>{let r=t.getOutput();return Ht(()=>r.disabled.value?void 0:sT(n,r.historyState.value,r.delay))}}),VL=ue({dependencies:[hu(Qu,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(n,e,t){let{output:r}=t.getDependency(Qu),o=function(i){return i?Pb(i,Qu.name):null}(n._parentEditor);if(!o)return()=>{};let s=o.output;return Ht(()=>Ib(()=>{r.delay.value=s.delay.value,r.historyState.value=s.historyState.value,r.disabled.value=s.disabled.value}))}});var ed=Am,E3=ed.HistoryExtension,A3=ed.SharedHistoryExtension,aT=ed.createEmptyHistoryState,lT=ed.registerHistory;var wm=cc(oa(),1);function se(n,e,t=""){let r=document.createElement(n);for(let[o,s]of Object.entries(e||{}))o in r?r[o]=s:s!=null&&r.setAttribute(o,s);return t&&(r.innerHTML=t),r}function Os(n){return new DOMParser().parseFromString(n,"text/html")}function cT(n,e,t){let r=t?t.split(".").pop().toLowerCase():"unknown";return se("figure",{className:`attachment attachment--${e?"preview":"file"} attachment--${r}`,"data-content-type":n})}function vm(n){return n.startsWith("image/")&&!n.includes("svg")}function jr(n,e,t=null,r=!1){return n.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t,cancelable:r}))}function uT(n){let e=n.querySelectorAll("body > :not(h1, h2, h3, h4, h5, h6) + *");for(let t of e){let r=n.createElement("p");r.appendChild(n.createElement("br")),t.before(r)}}function td(n){let e=Math.random().toString(36).slice(2,10);return`${n}-${e}`}function dT(){document.querySelectorAll("pre[data-language]").forEach(e=>{YL(e)})}function YL(n){let e=n.getAttribute("data-language"),t=n.innerHTML.replace(/<br\s*\/?>/gi,`
`),r=wm.default.languages?.[e];if(!r)return;t=new DOMParser().parseFromString(t,"text/html").body.textContent||"";let o=wm.default.highlight(t,r,e),s=se("code",{"data-language":e,innerHTML:o});n.replaceWith(s)}var Ym={};Lt(Ym,{$computeTableMap:()=>bt,$computeTableMapSkipCellCheck:()=>Zr,$createTableCellNode:()=>Zt,$createTableNode:()=>ld,$createTableNodeWithDimensions:()=>bT,$createTableRowNode:()=>Rs,$createTableSelection:()=>Um,$createTableSelectionFrom:()=>OT,$deleteTableColumn:()=>oR,$deleteTableColumnAtSelection:()=>AT,$deleteTableColumn__EXPERIMENTAL:()=>iR,$deleteTableRowAtSelection:()=>ET,$deleteTableRow__EXPERIMENTAL:()=>sR,$findCellNode:()=>Bi,$findTableNode:()=>Ls,$getElementForTableNode:()=>IT,$getNodeTriplet:()=>ot,$getTableAndElementByKey:()=>Wm,$getTableCellNodeFromLexicalNode:()=>ZL,$getTableCellNodeRect:()=>Dm,$getTableColumnIndexFromTableCellNode:()=>XL,$getTableNodeFromLexicalNodeOrThrow:()=>ad,$getTableRowIndexFromTableCellNode:()=>JL,$getTableRowNodeFromTableCellNodeOrThrow:()=>zm,$insertTableColumn:()=>nR,$insertTableColumnAtSelection:()=>NT,$insertTableColumn__EXPERIMENTAL:()=>rR,$insertTableRow:()=>eR,$insertTableRowAtSelection:()=>TT,$insertTableRow__EXPERIMENTAL:()=>tR,$isScrollableTablesActive:()=>Cl,$isTableCellNode:()=>X,$isTableNode:()=>ze,$isTableRowNode:()=>Oe,$isTableSelection:()=>Te,$mergeCells:()=>wT,$removeTableRowAtIndex:()=>QL,$unmergeCell:()=>lR,INSERT_TABLE_COMMAND:()=>yT,TableCellHeaderStates:()=>Re,TableCellNode:()=>xn,TableExtension:()=>SR,TableNode:()=>yn,TableObserver:()=>id,TableRowNode:()=>Jr,applyTableHandlers:()=>kT,getDOMCellFromTarget:()=>_l,getTableElement:()=>Wo,getTableObserverFromTableElement:()=>$m,registerTableCellUnmergeTransform:()=>$T,registerTablePlugin:()=>FT,registerTableSelectionObserver:()=>PT,setScrollableTablesActive:()=>DT});var Bm=/^(\d+(?:\.\d+)?)px$/,Re={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},xn=class extends Ye{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(e){return new xn(e.__headerState,e.__colSpan,e.__width,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign}static importDOM(){return{td:e=>({conversion:hT,priority:0}),th:e=>({conversion:hT,priority:0})}}static importJSON(e){return Zt().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=Re.NO_STATUS,t=1,r,o){super(o),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let 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),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),km(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),_e(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(fs(t.element)){let r=t.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...km(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){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=Re.BOTH){let r=this.getWritable();return r.__headerState=e&t|r.__headerState&~t,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let 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!==Re.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}};function km(n){return n==="middle"||n==="bottom"}function hT(n){let e=n,t=n.nodeName.toLowerCase(),r;Bm.test(e.style.width)&&(r=parseFloat(e.style.width));let o=Zt(t==="th"?Re.ROW:Re.NO_STATUS,e.colSpan,r);o.__rowSpan=e.rowSpan;let s=e.style.backgroundColor;s!==""&&(o.__backgroundColor=s);let i=e.style.verticalAlign;km(i)&&(o.__verticalAlign=i);let a=e.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),d=a.fontStyle==="italic",h=l.includes("underline");return{after:g=>{let f=[],p=null,m=()=>{if(p){let _=p.getFirstChild();be(_)&&p.getChildrenSize()===1&&_.remove()}};for(let _ of g)c1(_)||B(_)||be(_)?(B(_)&&(c&&_.toggleFormat("bold"),u&&_.toggleFormat("strikethrough"),d&&_.toggleFormat("italic"),h&&_.toggleFormat("underline")),p?p.append(_):(p=U().append(_),f.push(p))):(f.push(_),m(),p=null);return m(),f.length===0&&f.push(U()),f},node:o}}function Zt(n=Re.NO_STATUS,e=1,t){return ft(new xn(n,e,t))}function X(n){return n instanceof xn}var yT=Ct("INSERT_TABLE_COMMAND");function Z(n,...e){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(let o of e)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Jr=class extends Ye{__height;static getType(){return"tablerow"}static clone(e){return new Jr(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:jL,priority:0})}}static importJSON(e){return Rs().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){let t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),_e(t,e.theme.tableRow),t}extractWithChild(e,t,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){let 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}};function jL(n){let e=n,t;return Bm.test(e.style.height)&&(t=parseFloat(e.style.height)),{after:r=>wi(r,X),node:Rs(t)}}function Rs(n){return ft(new Jr(n))}function Oe(n){return n instanceof Jr}var Hm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,qL=Hm&&"documentMode"in document?document.documentMode:null,gT=Hm&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function bT(n,e,t=!0){let r=ld();for(let o=0;o<n;o++){let s=Rs();for(let i=0;i<e;i++){let a=Re.NO_STATUS;typeof t=="object"?(o===0&&t.rows&&(a|=Re.ROW),i===0&&t.columns&&(a|=Re.COLUMN)):t&&(o===0&&(a|=Re.ROW),i===0&&(a|=Re.COLUMN));let l=Zt(a),c=U();c.append(ye()),l.append(c),s.append(l)}r.append(s)}return r}function ZL(n){let e=oe(n,t=>X(t));return X(e)?e:null}function zm(n){let e=oe(n,t=>Oe(t));if(Oe(e))return e;throw new Error("Expected table cell to be inside of table row.")}function ad(n){let e=oe(n,t=>ze(t));if(ze(e))return e;throw new Error("Expected table cell to be inside of table.")}function JL(n){let e=zm(n);return ad(e).getChildren().findIndex(t=>t.is(e))}function XL(n){return zm(n).getChildren().findIndex(e=>e.is(n))}function ST(n,e){let t=ad(n),{x:r,y:o}=t.getCordsFromCellNode(n,e);return{above:t.getCellNodeFromCords(r,o-1,e),below:t.getCellNodeFromCords(r,o+1,e),left:t.getCellNodeFromCords(r-1,o,e),right:t.getCellNodeFromCords(r+1,o,e)}}function QL(n,e){let t=n.getChildren();if(e>=t.length||e<0)throw new Error("Expected table cell to be inside of table row.");return t[e].remove(),n}function eR(n,e,t=!0,r,o){let s=n.getChildren();if(e>=s.length||e<0)throw new Error("Table row target index out of range");let i=s[e];if(!Oe(i))throw new Error("Row before insertion index does not exist.");for(let a=0;a<r;a++){let l=i.getChildren(),c=l.length,u=Rs();for(let d=0;d<c;d++){let h=l[d];X(h)||Z(12);let{above:g,below:f}=ST(h,o),p=Re.NO_STATUS,m=g&&g.getWidth()||f&&f.getWidth()||void 0;(g&&g.hasHeaderState(Re.COLUMN)||f&&f.hasHeaderState(Re.COLUMN))&&(p|=Re.COLUMN);let _=Zt(p,1,m);_.append(U()),u.append(_)}t?i.insertAfter(u):i.insertBefore(u)}return n}Hm&&"InputEvent"in window&&!qL&&new window.InputEvent("input");var Lm=(n,e)=>n===Re.BOTH||n===e?e:Re.NO_STATUS;function TT(n=!0){let e=w();v(e)||Te(e)||Z(188);let t=e.anchor.getNode(),r=e.focus.getNode(),[o]=ot(t),[s,,i]=ot(r),[,a,l]=bt(i,s,o),{startRow:c}=l,{startRow:u}=a;return n?Rm(c+o.__rowSpan>u+s.__rowSpan?o:s,!0):Rm(u<c?s:o,!1)}var tR=TT;function Rm(n,e=!0){let[,,t]=ot(n),[r,o]=bt(t,n,n),s=r[0].length,{startRow:i}=o,a=null;if(e){let l=i+n.__rowSpan-1,c=r[l],u=Rs();for(let h=0;h<s;h++){let{cell:g,startRow:f}=c[h];if(f+g.__rowSpan-1<=l){let p=c[h].cell.__headerState,m=Lm(p,Re.COLUMN);u.append(Zt(m).append(U()))}else g.setRowSpan(g.__rowSpan+1)}let d=t.getChildAtIndex(l);Oe(d)||Z(256),d.insertAfter(u),a=u}else{let l=i,c=r[l],u=Rs();for(let h=0;h<s;h++){let{cell:g,startRow:f}=c[h];if(f===l){let p=c[h].cell.__headerState,m=Lm(p,Re.COLUMN);u.append(Zt(m).append(U()))}else g.setRowSpan(g.__rowSpan+1)}let d=t.getChildAtIndex(l);Oe(d)||Z(257),d.insertBefore(u),a=u}return a}function nR(n,e,t=!0,r,o){let s=n.getChildren(),i=[];for(let a=0;a<s.length;a++){let l=s[a];if(Oe(l))for(let c=0;c<r;c++){let u=l.getChildren();if(e>=u.length||e<0)throw new Error("Table column target index out of range");let d=u[e];X(d)||Z(12);let{left:h,right:g}=ST(d,o),f=Re.NO_STATUS;(h&&h.hasHeaderState(Re.ROW)||g&&g.hasHeaderState(Re.ROW))&&(f|=Re.ROW);let p=Zt(f);p.append(U()),i.push({newTableCell:p,targetCell:d})}}return i.forEach(({newTableCell:a,targetCell:l})=>{t?l.insertAfter(a):l.insertBefore(a)}),n}function NT(n=!0){let e=w();v(e)||Te(e)||Z(188);let t=e.anchor.getNode(),r=e.focus.getNode(),[o]=ot(t),[s,,i]=ot(r),[,a,l]=bt(i,s,o),{startColumn:c}=l,{startColumn:u}=a;return n?Mm(c+o.__colSpan>u+s.__colSpan?o:s,!0):Mm(u<c?s:o,!1)}var rR=NT;function Mm(n,e=!0,t=!0){let[,,r]=ot(n),[o,s]=bt(r,n,n),i=o.length,{startColumn:a}=s,l=e?a+n.__colSpan-1:a-1,c=r.getFirstChild();Oe(c)||Z(120);let u=null;function d(f=Re.NO_STATUS){let p=Zt(f).append(U());return u===null&&(u=p),p}let h=c;e:for(let f=0;f<i;f++){if(f!==0){let S=h.getNextSibling();Oe(S)||Z(121),h=S}let p=o[f],m=p[l<0?0:l].cell.__headerState,_=Lm(m,Re.ROW);if(l<0){Km(h,d(_));continue}let{cell:C,startColumn:x,startRow:y}=p[l];if(x+C.__colSpan-1<=l){let S=C,b=y,N=l;for(;b!==f&&S.__rowSpan>1;){if(N-=C.__colSpan,!(N>=0)){h.append(d(_));continue e}{let{cell:A,startRow:O}=p[N];S=A,b=O}}S.insertAfter(d(_))}else C.setColSpan(C.__colSpan+1)}u!==null&&t&&ml(u);let g=r.getColWidths();if(g){let f=[...g],p=l<0?0:l,m=f[p];f.splice(p,0,m),r.setColWidths(f)}return u}function oR(n,e){let t=n.getChildren();for(let r=0;r<t.length;r++){let o=t[r];if(Oe(o)){let s=o.getChildren();if(e>=s.length||e<0)throw new Error("Table column target index out of range");s[e].remove()}}return n}function ET(){let n=w();v(n)||Te(n)||Z(188);let[e,t]=n.isBackward()?[n.focus.getNode(),n.anchor.getNode()]:[n.anchor.getNode(),n.focus.getNode()],[r,,o]=ot(e),[s]=ot(t),[i,a,l]=bt(o,r,s),{startRow:c}=a,{startRow:u}=l,d=u+s.__rowSpan-1;if(i.length===d-c+1)return void o.remove();let h=i[0].length,g=i[d+1],f=o.getChildAtIndex(d+1);for(let p=d;p>=c;p--){for(let _=h-1;_>=0;_--){let{cell:C,startRow:x,startColumn:y}=i[p][_];if(y===_){if(x<c||x+C.__rowSpan-1>d){let S=Math.max(x,c),b=Math.min(C.__rowSpan+x-1,d),N=S<=b?b-S+1:0;C.setRowSpan(C.__rowSpan-N)}if(x>=c&&x+C.__rowSpan-1>d&&p===d){f===null&&Z(122);let S=null;for(let b=0;b<_;b++){let N=g[b],A=N.cell;N.startRow===p+1&&(S=A),A.__colSpan>1&&(b+=A.__colSpan-1)}S===null?Km(f,C):S.insertAfter(C)}}}let m=o.getChildAtIndex(p);Oe(m)||Z(206,String(p)),m.remove()}if(g!==void 0){let{cell:p}=g[0];ml(p)}else{let p=i[c-1],{cell:m}=p[0];ml(m)}}var sR=ET;function AT(){let n=w();v(n)||Te(n)||Z(188);let e=n.anchor.getNode(),t=n.focus.getNode(),[r,,o]=ot(e),[s]=ot(t),[i,a,l]=bt(o,r,s),{startColumn:c}=a,{startRow:u,startColumn:d}=l,h=Math.min(c,d),g=Math.max(c+r.__colSpan-1,d+s.__colSpan-1),f=g-h+1;if(i[0].length===g-h+1)return o.selectPrevious(),void o.remove();let p=i.length;for(let x=0;x<p;x++)for(let y=h;y<=g;y++){let{cell:S,startColumn:b}=i[x][y];if(b<h){if(y===h){let N=h-b;S.setColSpan(S.__colSpan-Math.min(f,S.__colSpan-N))}}else if(b+S.__colSpan-1>g){if(y===g){let N=g-b+1;S.setColSpan(S.__colSpan-N)}}else S.remove()}let m=i[u],_=c>d?m[c+r.__colSpan]:m[d+s.__colSpan];if(_!==void 0){let{cell:x}=_;ml(x)}else{let x=d<c?m[d-1]:m[c-1],{cell:y}=x;ml(y)}let C=o.getColWidths();if(C){let x=[...C];x.splice(h,f),o.setColWidths(x)}}var iR=AT;function ml(n){let e=n.getFirstDescendant();e==null?n.selectStart():e.getParentOrThrow().selectStart()}function Km(n,e){let t=n.getFirstChild();t!==null?t.insertBefore(e):n.append(e)}function wT(n){if(n.length===0)return null;let e=ad(n[0]),[t]=Zr(e,null,null),r=1/0,o=-1/0,s=1/0,i=-1/0,a=new Set;for(let g of t)for(let f of g){if(!f||!f.cell)continue;let p=f.cell.getKey();if(!a.has(p)&&n.some(m=>m.is(f.cell))){a.add(p);let m=f.startRow,_=f.startColumn,C=f.cell.__rowSpan||1,x=f.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+C-1),s=Math.min(s,_),i=Math.max(i,_+x-1)}}if(r===1/0||s===1/0)return null;let l=o-r+1,c=i-s+1,u=t[r][s];if(!u.cell)return null;let d=u.cell;d.setColSpan(c),d.setRowSpan(l);let h=new Set([d.getKey()]);for(let g=r;g<=o;g++)for(let f=s;f<=i;f++){let p=t[g][f];if(!p.cell)continue;let m=p.cell,_=m.getKey();h.has(_)||(h.add(_),aR(m)||d.append(...m.getChildren()),m.remove())}return d.getChildrenSize()===0&&d.append(U()),d}function aR(n){if(n.getChildrenSize()!==1)return!1;let e=n.getFirstChildOrThrow();return!(!rt(e)||!e.isEmpty())}function lR(){let n=w();v(n)||Te(n)||Z(188);let e=n.anchor.getNode(),t=oe(e,X);return X(t)||Z(148),vT(t)}function vT(n){let[e,t,r]=ot(n),o=e.__colSpan,s=e.__rowSpan;if(o===1&&s===1)return;let[i,a]=bt(r,e,e),{startColumn:l,startRow:c}=a,u=e.__headerState&Re.COLUMN,d=Array.from({length:o},(f,p)=>{let m=u;for(let _=0;m!==0&&_<i.length;_++)m&=i[_][p+l].cell.__headerState;return m}),h=e.__headerState&Re.ROW,g=Array.from({length:s},(f,p)=>{let m=h;for(let _=0;m!==0&&_<i[0].length;_++)m&=i[p+c][_].cell.__headerState;return m});if(o>1){for(let f=1;f<o;f++)e.insertAfter(Zt(d[f]|g[0]).append(U()));e.setColSpan(1)}if(s>1){let f;for(let p=1;p<s;p++){let m=c+p,_=i[m];f=(f||t).getNextSibling(),Oe(f)||Z(125);let C=null;for(let x=0;x<l;x++){let y=_[x],S=y.cell;y.startRow===m&&(C=S),S.__colSpan>1&&(x+=S.__colSpan-1)}if(C===null)for(let x=o-1;x>=0;x--)Km(f,Zt(d[x]|g[p]).append(U()));else for(let x=o-1;x>=0;x--)C.insertAfter(Zt(d[x]|g[p]).append(U()))}e.setRowSpan(1)}}function bt(n,e,t){let[r,o,s]=Zr(n,e,t);return o===null&&Z(207),s===null&&Z(208),[r,o,s]}function Zr(n,e,t){let r=[],o=null,s=null;function i(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}let a=n.getChildren();for(let l=0;l<a.length;l++){let c=a[l];Oe(c)||Z(209);let u=i(l);for(let d=c.getFirstChild(),h=0;d!=null;d=d.getNextSibling()){for(X(d)||Z(147);u[h]!==void 0;)h++;let g={cell:d,startColumn:h,startRow:l},{__rowSpan:f,__colSpan:p}=d;for(let m=0;m<f&&!(l+m>=a.length);m++){let _=i(l+m);for(let C=0;C<p;C++)_[h+C]=g}e!==null&&o===null&&e.is(d)&&(o=g),t!==null&&s===null&&t.is(d)&&(s=g)}}return[r,o,s]}function ot(n){let e;if(n instanceof xn)e=n;else if("__type"in n){let o=oe(n,X);X(o)||Z(148),e=o}else{let o=oe(n.getNode(),X);X(o)||Z(148),e=o}let t=e.getParent();Oe(t)||Z(149);let r=t.getParent();return ze(r)||Z(210),[e,t,r]}function sd(n,e,t){let r,o=Math.min(e.startColumn,t.startColumn),s=Math.min(e.startRow,t.startRow),i=Math.max(e.startColumn+e.cell.__colSpan-1,t.startColumn+t.cell.__colSpan-1),a=Math.max(e.startRow+e.cell.__rowSpan-1,t.startRow+t.cell.__rowSpan-1);do{r=!1;for(let l=0;l<n.length;l++)for(let c=0;c<n[0].length;c++){let u=n[l][c];if(!u)continue;let d=u.startColumn+u.cell.__colSpan-1,h=u.startRow+u.cell.__rowSpan-1,g=u.startColumn<=i&&d>=o,f=u.startRow<=a&&h>=s;if(g&&f){let p=Math.min(o,u.startColumn),m=Math.max(i,d),_=Math.min(s,u.startRow),C=Math.max(a,h);p===o&&m===i&&_===s&&C===a||(o=p,i=m,s=_,a=C,r=!0)}}}while(r);return{maxColumn:i,maxRow:a,minColumn:o,minRow:s}}function Dm(n){let[e,,t]=ot(n),r=t.getChildren(),o=r.length,s=r[0].getChildren().length,i=new Array(o);for(let a=0;a<o;a++)i[a]=new Array(s);for(let a=0;a<o;a++){let l=r[a].getChildren(),c=0;for(let u=0;u<l.length;u++){for(;i[a][c];)c++;let d=l[u],h=d.__rowSpan||1,g=d.__colSpan||1;for(let f=0;f<h;f++)for(let p=0;p<g;p++)i[a+f][c+p]=d;if(e===d)return{colSpan:g,columnIndex:c,rowIndex:a,rowSpan:h};c+=g}}return null}function fT(n){let[[e,t,r,o],[s,i,a,l]]=["anchor","focus"].map(c=>{let u=n[c].getNode(),d=oe(u,X);X(d)||Z(238,c,u.getKey(),u.getType());let h=d.getParent();Oe(h)||Z(239,c);let g=h.getParent();return ze(g)||Z(240,c),[u,d,h,g]});return o.is(l)||Z(241),{anchorCell:t,anchorNode:e,anchorRow:r,anchorTable:o,focusCell:i,focusNode:s,focusRow:a,focusTable:l}}var zi=class{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,r){this.anchor=t,this.focus=r,t._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;let e=Fe(this.tableKey),t=Fe(this.anchor.key),r=Fe(this.focus.key);return e!==null&&t!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return Te(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,r){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=r,this._cachedNodes=null}clone(){return new zi(this.tableKey,Rn(this.anchor.key,this.anchor.offset,this.anchor.type),Rn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(X).forEach(o=>{let s=o.getFirstChild();rt(s)&&(t|=s.getTextFormat())});let r=y1[e];return(t&r)!==0}insertNodes(e){let t=this.focus.getNode();F(t)||Z(151),zr(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=fT(this),r=Dm(e);r===null&&Z(153);let o=Dm(t);o===null&&Z(155);let s=Math.min(r.columnIndex,o.columnIndex),i=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(s,i),fromY:Math.min(a,l),toX:Math.max(s,i),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:r,focusCell:o}=fT(this),s=o.getParents()[1];if(s!==t){if(t.isParentOf(o)){let m=s.getParent();m==null&&Z(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{let m=t.getParent();m==null&&Z(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}let[i,a,l]=bt(t,r,o),{minColumn:c,maxColumn:u,minRow:d,maxRow:h}=sd(i,a,l),g=new Map([[t.getKey(),t]]),f=null;for(let m=d;m<=h;m++)for(let _=c;_<=u;_++){let{cell:C}=i[m][_],x=C.getParent();Oe(x)||Z(160),x!==f&&(g.set(x.getKey(),x),f=x),g.has(C.getKey())||cR(C,y=>{g.set(y.getKey(),y)})}let p=Array.from(g.values());return w1()||(this._cachedNodes=p),p}getTextContent(){let e=this.getNodes().filter(r=>X(r)),t="";for(let r=0;r<e.length;r++){let o=e[r],s=o.__parent,i=(e[r+1]||{}).__parent;t+=o.getTextContent()+(i!==s?`
`:" ")}return t}};function Te(n){return n instanceof zi}function Um(){let n=Rn("root",0,"element"),e=Rn("root",0,"element");return new zi("root",n,e)}function OT(n,e,t){n.getKey(),e.getKey(),t.getKey();let r=w(),o=Te(r)?r.clone():Um();return o.set(n.getKey(),e.getKey(),t.getKey()),o}function cR(n,e){let t=[[n]];for(let r=t.at(-1);r!==void 0&&t.length>0;r=t.at(-1)){let o=r.pop();o===void 0?t.pop():e(o)!==!1&&F(o)&&t.push(o.getChildren())}}function Wm(n,e=Fr()){let t=Fe(n);ze(t)||Z(231,n);let r=Wo(t,e.getElementByKey(n));return r===null&&Z(232,n),{tableElement:r,tableNode:t}}var id=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;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.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return Wm(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(t=>{this.editor.getEditorState().read(()=>{let r=!1;for(let i=0;i<t.length;i++){let a=t[i].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;let{tableNode:o,tableElement:s}=this.$lookup();this.table=Hi(o,s)},{editor:this.editor})});this.editor.getEditorState().read(()=>{let{tableNode:t,tableElement:r}=this.$lookup();this.table=Hi(t,r),e.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){let e=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();let{tableNode:t,tableElement:r}=this.$lookup();nd(e,Hi(t,r),null),w()!==null&&(De(null),e.dispatchCommand(er,void 0))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();wt(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();_e(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&Z(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),nd(t,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=ko(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let r=this.editor,{tableNode:o}=this.$lookup(),s=e.x,i=e.y;if(this.focusCell=e,this.isHighlightingCells||this.anchorX===s&&this.anchorY===i&&!t){if(s===this.focusX&&i===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=s,this.focusY=i,this.isHighlightingCells){let a=Pm(o,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=OT(o,this.$getAnchorTableCellOrThrow(),a),De(this.tableSelection),r.dispatchCommand(er,void 0),nd(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Fe(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&Z(234),e}$getFocusTableCell(){return this.focusCellNodeKey?Fe(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&Z(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y;let{tableNode:t}=this.$lookup(),r=Pm(t,e.elem);if(r!==null){let o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():Um(),this.anchorCellNodeKey=o}}$formatCells(e){let t=w();Te(t)||Z(236);let r=Zn(),o=r.anchor,s=r.focus,i=t.getNodes().filter(X);i.length>0||Z(237);let a=i[0].getFirstChild(),l=rt(a)?a.getFormatFlags(e,null):null;i.forEach(c=>{o.set(c.getKey(),0,"element"),s.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(e,l)}),De(t),this.editor.dispatchCommand(er,void 0)}$clearText(){let{editor:e}=this,t=Fe(this.tableNodeKey);if(!ze(t))throw new Error("Expected TableNode.");let r=w();Te(r)||Z(253);let o=r.getNodes().filter(X),s=t.getFirstChild(),i=t.getLastChild();if(o.length>0&&s!==null&&i!==null&&Oe(s)&&Oe(i)&&o[0]===s.getFirstChild()&&o[o.length-1]===i.getLastChild()){t.selectPrevious();let a=t.getParent();return t.remove(),void(Hr(a)&&a.isEmpty()&&e.dispatchCommand(Xn,void 0))}o.forEach(a=>{if(F(a)){let l=U(),c=ye();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),nd(e,this.table,null),De(null),e.dispatchCommand(er,void 0)}},Im="__lexicalTableSelection";function Fi(n){return fs(n)&&n.nodeName==="TABLE"}function Wo(n,e){if(!e)return e;let t=Fi(e)?e:n.getDOMSlot(e).element;return t.nodeName!=="TABLE"&&Z(245,e.nodeName),t}function Gm(n){return n._window}function pl(n,e){for(let t=e,r=null;t!==null;t=t.getParent()){if(n.is(t))return r;X(t)&&(r=t)}return null}var uR=[[dn,"down"],[Pt,"up"],[Qn,"backward"],[wo,"forward"]],dR=[xi,hs,un],hR=[vo,Si];function kT(n,e,t,r){let o=t.getRootElement(),s=Gm(t);o!==null&&s!==null||Z(246);let i=new id(t,n.getKey()),a=Wo(n,e);(function(g,f){$m(g)!==null&&Z(205),g[Im]=f})(a,i),i.listenersToRemove.add(()=>function(g,f){$m(g)===f&&delete g[Im]}(a,i));let l=g=>{if(i.pointerType=g.pointerType,g.button!==0||!jt(g.target)||!s)return;let f=_l(g.target);f!==null&&t.update(()=>{let p=Br();if(gT&&g.shiftKey&&ur(p,n)&&(v(p)||Te(p))){let m=p.anchor.getNode(),_=pl(n,p.anchor.getNode());_?(i.$setAnchorCellForSelection(ks(i,_)),i.$setFocusCellForSelection(f),qr(g)):(n.isBefore(m)?n.selectStart():n.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else g.pointerType!=="touch"&&i.$setAnchorCellForSelection(f)}),(()=>{if(i.isSelecting)return;let p=()=>{i.isSelecting=!1,s.removeEventListener("pointerup",p),s.removeEventListener("pointermove",m)},m=_=>{if(1&~_.buttons&&i.isSelecting)return i.isSelecting=!1,s.removeEventListener("pointerup",p),void s.removeEventListener("pointermove",m);if(!jt(_.target))return;let C=null,x=!(gT||a.contains(_.target));if(x)C=pT(a,_.target);else for(let y of document.elementsFromPoint(_.clientX,_.clientY))if(C=pT(a,y),C)break;!C||i.focusCell!==null&&C.elem===i.focusCell.elem||(i.setNextFocus({focusCell:C,override:x}),t.dispatchCommand(er,void 0))};i.isSelecting=!0,s.addEventListener("pointerup",p,i.listenerOptions),s.addEventListener("pointermove",m,i.listenerOptions)})()};a.addEventListener("pointerdown",l,i.listenerOptions),i.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});let c=g=>{g.detail>=3&&jt(g.target)&&_l(g.target)!==null&&g.preventDefault()};a.addEventListener("mousedown",c,i.listenerOptions),i.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});let u=g=>{let f=g.target;g.button===0&&jt(f)&&t.update(()=>{let p=w();Te(p)&&p.tableKey===i.tableNodeKey&&o.contains(f)&&i.$clearHighlight()})};s.addEventListener("pointerdown",u,i.listenerOptions),i.listenersToRemove.add(()=>{s.removeEventListener("pointerdown",u)});for(let[g,f]of uR)i.listenersToRemove.add(t.registerCommand(g,p=>MT(t,p,f,n,i),Je));i.listenersToRemove.add(t.registerCommand(Ti,g=>{let f=w();if(Te(f)){let p=pl(n,f.focus.getNode());if(p!==null)return qr(g),p.selectEnd(),!0}return!1},Je));let d=g=>()=>{let f=w();if(!ur(f,n))return!1;if(Te(f))return i.$clearText(),!0;if(v(f)){if(!X(pl(n,f.anchor.getNode())))return!1;let p=f.anchor.getNode(),m=f.focus.getNode(),_=n.isParentOf(p),C=n.isParentOf(m);if(_&&!C||C&&!_)return i.$clearText(),!0;let x=oe(f.anchor.getNode(),S=>F(S)),y=x&&oe(x,S=>F(S)&&X(S.getParent()));if(!F(y)||!F(x))return!1;if(g===hs&&y.getPreviousSibling()===null)return!0}return!1};for(let g of dR)i.listenersToRemove.add(t.registerCommand(g,d(g),Je));let h=g=>{let f=w();if(!Te(f)&&!v(f))return!1;let p=n.isParentOf(f.anchor.getNode());if(p!==n.isParentOf(f.focus.getNode())){let m=p?"anchor":"focus",_=p?"focus":"anchor",{key:C,offset:x,type:y}=f[_];return n[f[m].isBefore(f[_])?"selectPrevious":"selectNext"]()[_].set(C,x,y),!1}return!!ur(f,n)&&!!Te(f)&&(g&&(g.preventDefault(),g.stopPropagation()),i.$clearText(),!0)};for(let g of hR)i.listenersToRemove.add(t.registerCommand(g,h,Je));return i.listenersToRemove.add(t.registerCommand(Ci,g=>{let f=w();if(f){if(!Te(f)&&!v(f))return!1;ol(t,At(g,ClipboardEvent)?g:null,$S(f));let p=h(g);return v(f)?(f.removeText(),!0):p}return!1},Je)),i.listenersToRemove.add(t.registerCommand(Kr,g=>{let f=w();if(!ur(f,n))return!1;if(Te(f))return i.$formatCells(g),!0;if(v(f)){let p=oe(f.anchor.getNode(),m=>X(m));if(!X(p))return!1}return!1},Je)),i.listenersToRemove.add(t.registerCommand(iu,g=>{let f=w();if(!Te(f)||!ur(f,n))return!1;let p=f.anchor.getNode(),m=f.focus.getNode();if(!X(p)||!X(m))return!1;if(function(O,P){if(Te(O)){let I=O.anchor.getNode(),z=O.focus.getNode();if(P&&I&&z){let[G]=bt(P,I,z);return I.getKey()===G[0][0].cell.getKey()&&z.getKey()===G[G.length-1].at(-1).cell.getKey()}}return!1}(f,n))return n.setFormat(g),!0;let[_,C,x]=bt(n,p,m),y=Math.max(C.startRow+C.cell.__rowSpan-1,x.startRow+x.cell.__rowSpan-1),S=Math.max(C.startColumn+C.cell.__colSpan-1,x.startColumn+x.cell.__colSpan-1),b=Math.min(C.startRow,x.startRow),N=Math.min(C.startColumn,x.startColumn),A=new Set;for(let O=b;O<=y;O++)for(let P=N;P<=S;P++){let I=_[O][P].cell;if(A.has(I))continue;A.add(I),I.setFormat(g);let z=I.getChildren();for(let G=0;G<z.length;G++){let q=z[G];F(q)&&!q.isInline()&&q.setFormat(g)}}return!0},Je)),i.listenersToRemove.add(t.registerCommand(mi,g=>{let f=w();if(!ur(f,n))return!1;if(Te(f))return i.$clearHighlight(),!1;if(v(f)){let p=oe(f.anchor.getNode(),m=>X(m));if(!X(p))return!1;if(typeof g=="string"){let m=CT(t,f,n);if(m)return _T(m,n,[ye(g)]),!0}}return!1},Je)),r&&i.listenersToRemove.add(t.registerCommand(_n,g=>{let f=w();if(!v(f)||!f.isCollapsed()||!ur(f,n))return!1;let p=Bi(f.anchor.getNode());return!(p===null||!n.is(Ls(p)))&&(qr(g),function(m,_){let C=_==="next"?"getNextSibling":"getPreviousSibling",x=_==="next"?"getFirstChild":"getLastChild",y=m[C]();if(F(y))return y.selectEnd();let S=oe(m,Oe);S===null&&Z(247);for(let N=S[C]();Oe(N);N=N[C]()){let A=N[x]();if(F(A))return A.selectEnd()}let b=oe(S,ze);b===null&&Z(248),_==="next"?b.selectNext():b.selectPrevious()}(p,g.shiftKey?"previous":"next"),!0)},Je)),i.listenersToRemove.add(t.registerCommand(p1,g=>n.isSelected(),Je)),i.listenersToRemove.add(t.registerCommand(Ya,(g,f)=>{if(t!==f)return!1;let{nodes:p,selection:m}=g,_=m.getStartEndPoints(),C=Te(m),x=v(m)&&oe(m.anchor.getNode(),ne=>X(ne))!==null&&oe(m.focus.getNode(),ne=>X(ne))!==null||C;if(p.length!==1||!ze(p[0])||!x||_===null)return!1;let[y,S]=_,[b,N,A]=ot(y),O=oe(S.getNode(),ne=>X(ne));if(!(X(b)&&X(O)&&Oe(N)&&ze(A)))return!1;let P=p[0],[I,z,G]=bt(A,b,O),[q]=Zr(P,null,null),K=I.length,le=K>0?I[0].length:0,ie=z.startRow,pe=z.startColumn,xe=q.length,ht=xe>0?q[0].length:0;if(C){let ne=sd(I,z,G),Ue=ne.maxRow-ne.minRow+1,Ve=ne.maxColumn-ne.minColumn+1;ie=ne.minRow,pe=ne.minColumn,xe=Math.min(xe,Ue),ht=Math.min(ht,Ve)}let fe=!1,Wt=Math.min(K,ie+xe)-1,ke=Math.min(le,pe+ht)-1,kt=new Set;for(let ne=ie;ne<=Wt;ne++)for(let Ue=pe;Ue<=ke;Ue++){let Ve=I[ne][Ue];kt.has(Ve.cell.getKey())||Ve.cell.__rowSpan===1&&Ve.cell.__colSpan===1||(vT(Ve.cell),kt.add(Ve.cell.getKey()),fe=!0)}let[ge]=Zr(A.getWritable(),null,null),Qe=xe-K+ie;for(let ne=0;ne<Qe;ne++)Rm(ge[K-1][0].cell);let en=ht-le+pe;for(let ne=0;ne<en;ne++)Mm(ge[0][le-1].cell,!0,!1);[ge]=Zr(A.getWritable(),null,null);for(let ne=ie;ne<ie+xe;ne++)for(let Ue=pe;Ue<pe+ht;Ue++){let Ve=ne-ie,Qi=Ue-pe,Vs=q[Ve][Qi];if(Vs.startRow!==Ve||Vs.startColumn!==Qi)continue;let fn=Vs.cell;if(fn.__rowSpan!==1||fn.__colSpan!==1){let tn=[],ea=Math.min(ne+fn.__rowSpan,ie+xe)-1,eo=Math.min(Ue+fn.__colSpan,pe+ht)-1;for(let to=ne;to<=ea;to++)for(let no=Ue;no<=eo;no++){let rc=ge[to][no];tn.push(rc.cell)}wT(tn),fe=!0}let{cell:Qr}=ge[ne][Ue],Cr=Qr.getChildren();fn.getChildren().forEach(tn=>{B(tn)&&U().append(tn),Qr.append(tn)}),Cr.forEach(tn=>tn.remove())}if(C&&fe){let[ne]=Zr(A.getWritable(),null,null);ne[z.startRow][z.startColumn].cell.selectEnd()}return!0},Je)),i.listenersToRemove.add(t.registerCommand(er,()=>{let g=w(),f=Br(),p=i.getAndClearNextFocus();if(p!==null){let{focusCell:m}=p;if(Te(g)&&g.tableKey===i.tableNodeKey)return(m.x!==i.focusX||m.y!==i.focusY)&&(i.$setFocusCellForSelection(m),!0);if(m!==i.anchorCell&&ur(g,n))return i.$setFocusCellForSelection(m),!0}if(i.getAndClearShouldCheckSelection()&&v(f)&&v(g)&&g.isCollapsed()){let m=g.anchor.getNode(),_=n.getFirstChild(),C=Bi(m);if(C!==null&&Oe(_)){let x=_.getFirstChild();if(X(x)&&n.is(oe(C,y=>y.is(n)||y.is(x))))return x.selectStart(),!0}}if(v(g)){let{anchor:m,focus:_}=g,C=m.getNode(),x=_.getNode(),y=Bi(C),S=Bi(x),b=!(!y||!n.is(Ls(y))),N=!(!S||!n.is(Ls(S))),A=b!==N,O=b&&N,P=g.isBackward();if(A){let I=g.clone();if(N){let[z]=bt(n,S,S),G=z[0][0].cell,q=z[z.length-1].at(-1).cell;I.focus.set(P?G.getKey():q.getKey(),P?G.getChildrenSize():q.getChildrenSize(),"element")}else if(b){let[z]=bt(n,y,y),G=z[0][0].cell,q=z[z.length-1].at(-1).cell;I.anchor.set(P?q.getKey():G.getKey(),P?q.getChildrenSize():0,"element")}De(I),mT(t,i)}else if(O&&(y.is(S)||(i.$setAnchorCellForSelection(ks(i,y)),i.$setFocusCellForSelection(ks(i,S),!0)),i.pointerType==="touch"&&i.isSelecting&&g.isCollapsed()&&v(f)&&f.isCollapsed())){let I=Bi(f.anchor.getNode());I&&!I.is(S)&&(i.$setAnchorCellForSelection(ks(i,I)),i.$setFocusCellForSelection(ks(i,S),!0),i.pointerType=null)}}else if(g&&Te(g)&&g.is(f)&&g.tableKey===n.getKey()){let m=ko(s);if(m&&m.anchorNode&&m.focusNode){let _=We(m.focusNode),C=_&&!n.isParentOf(_),x=We(m.anchorNode),y=x&&n.isParentOf(x);if(C&&y&&m.rangeCount>0){let S=t1(m,t);S&&(S.anchor.set(n.getKey(),g.isBackward()?n.getChildrenSize():0,"element"),m.removeAllRanges(),De(S))}}}return g&&!g.is(f)&&(Te(g)||Te(f))&&i.tableSelection&&!i.tableSelection.is(f)?(Te(g)&&g.tableKey===i.tableNodeKey?i.$updateTableTableSelection(g):!Te(g)&&Te(f)&&f.tableKey===i.tableNodeKey&&i.$updateTableTableSelection(null),!1):(i.hasHijackedSelectionStyles&&!n.isSelected()?function(m,_){_.$enableHighlightStyle(),Vm(_.table,C=>{let x=C.elem;C.highlighted=!1,RT(m,C),x.getAttribute("style")||x.removeAttribute("style")})}(t,i):!i.hasHijackedSelectionStyles&&n.isSelected()&&mT(t,i),!1)},Je)),i.listenersToRemove.add(t.registerCommand(Xn,()=>{let g=w();if(!v(g)||!g.isCollapsed()||!ur(g,n))return!1;let f=CT(t,g,n);return!!f&&(_T(f,n),!0)},Je)),i}function $m(n){return n[Im]||null}function _l(n){let e=n;for(;e!=null;){let t=e.nodeName;if(t==="TD"||t==="TH"){let r=e._cell;return r===void 0?null:r}e=e.parentNode}return null}function pT(n,e){if(!n.contains(e))return null;let t=null;for(let r=e;r!=null;r=r.parentNode){if(r===n)return t;let o=r.nodeName;o!=="TD"&&o!=="TH"||(t=r._cell||null)}return null}function Hi(n,e){let t=[],r={columns:0,domRows:t,rows:0},o=Wo(n,e).querySelector("tr"),s=0,i=0;for(t.length=0;o!=null;){let a=o.nodeName;if(a==="TD"||a==="TH"){let u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:s,y:i};o._cell=u;let d=t[i];d===void 0&&(d=t[i]=[]),d[s]=u}else{let u=o.firstChild;if(u!=null){o=u;continue}}let l=o.nextSibling;if(l!=null){s++,o=l;continue}let c=o.parentNode;if(c!=null){let u=c.nextSibling;if(u==null)break;i++,s=0,o=u}}return r.columns=s+1,r.rows=i+1,r}function nd(n,e,t){let r=new Set(t?t.getNodes():[]);Vm(e,(o,s)=>{let i=o.elem;r.has(s)?(o.highlighted=!0,LT(n,o)):(o.highlighted=!1,RT(n,o),i.getAttribute("style")||i.removeAttribute("style"))})}function Vm(n,e){let{domRows:t}=n;for(let r=0;r<t.length;r++){let o=t[r];if(o)for(let s=0;s<o.length;s++){let i=o[s];if(!i)continue;let a=We(i.elem);a!==null&&e(i,a,{x:s,y:r})}}}function mT(n,e){e.$disableHighlightStyle(),Vm(e.table,t=>{t.highlighted=!0,LT(n,t)})}var gR=(n,e,t,r,o)=>{let s=o==="forward";switch(o){case"backward":case"forward":return t!==(s?n.table.columns-1:0)?od(e.getCellNodeFromCordsOrThrow(t+(s?1:-1),r,n.table),s):r!==(s?n.table.rows-1:0)?od(e.getCellNodeFromCordsOrThrow(s?0:n.table.columns-1,r+(s?1:-1),n.table),s):s?e.selectNext():e.selectPrevious(),!0;case"up":return r!==0?od(e.getCellNodeFromCordsOrThrow(t,r-1,n.table),!1):e.selectPrevious(),!0;case"down":return r!==n.table.rows-1?od(e.getCellNodeFromCordsOrThrow(t,r+1,n.table),!0):e.selectNext(),!0;default:return!1}};function Om(n,e){let t,r;if(e.startColumn===n.minColumn)t="minColumn";else{if(e.startColumn+e.cell.__colSpan-1!==n.maxColumn)return null;t="maxColumn"}if(e.startRow===n.minRow)r="minRow";else{if(e.startRow+e.cell.__rowSpan-1!==n.maxRow)return null;r="maxRow"}return[t,r]}function rd([n,e]){return[n==="minColumn"?"maxColumn":"minColumn",e==="minRow"?"maxRow":"minRow"]}function Pi(n,e,[t,r]){let o=e[r],s=n[o];s===void 0&&Z(250,r,String(o));let i=e[t],a=s[i];return a===void 0&&Z(250,t,String(i)),a}function fR(n,e,t,r,o){let s=sd(e,t,r),i=function(b,N){let{minColumn:A,maxColumn:O,minRow:P,maxRow:I}=N,z=1,G=1,q=1,K=1,le=b[P],ie=b[I];for(let pe=A;pe<=O;pe++)z=Math.max(z,le[pe].cell.__rowSpan),K=Math.max(K,ie[pe].cell.__rowSpan);for(let pe=P;pe<=I;pe++)G=Math.max(G,b[pe][A].cell.__colSpan),q=Math.max(q,b[pe][O].cell.__colSpan);return{bottomSpan:K,leftSpan:G,rightSpan:q,topSpan:z}}(e,s),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=i,d=function(b,N){let A=Om(b,N);return A===null&&Z(249,N.cell.getKey()),A}(s,t),[h,g]=rd(d),f=s[h],p=s[g];o==="forward"?f+=h==="maxColumn"?1:l:o==="backward"?f-=h==="minColumn"?1:u:o==="down"?p+=g==="maxRow"?1:a:o==="up"&&(p-=g==="minRow"?1:c);let m=e[p];if(m===void 0)return!1;let _=m[f];if(_===void 0)return!1;let[C,x]=function(b,N,A){let O=sd(b,N,A),P=Om(O,N);if(P)return[Pi(b,O,P),Pi(b,O,rd(P))];let I=Om(O,A);if(I)return[Pi(b,O,rd(I)),Pi(b,O,I)];let z=["minColumn","minRow"];return[Pi(b,O,z),Pi(b,O,rd(z))]}(e,t,_),y=ks(n,C.cell),S=ks(n,x.cell);return n.$setAnchorCellForSelection(y),n.$setFocusCellForSelection(S,!0),!0}function ur(n,e){if(v(n)||Te(n)){let t=e.isParentOf(n.anchor.getNode()),r=e.isParentOf(n.focus.getNode());return t&&r}return!1}function od(n,e){e?n.selectStart():n.selectEnd()}function LT(n,e){let t=e.elem,r=n._config.theme;X(We(t))||Z(131),_e(t,r.tableCellSelected)}function RT(n,e){let t=e.elem;X(We(t))||Z(131);let r=n._config.theme;wt(t,r.tableCellSelected)}function Bi(n){let e=oe(n,X);return X(e)?e:null}function Ls(n){let e=oe(n,ze);return ze(e)?e:null}function pR(n,e,t,r,o,s,i){let a=xo(t.focus,o?"previous":"next");if(Xc(a))return!1;let l=a;for(let m of Ia(a).iterNodeCarets("shadowRoot")){if(!Qc(m)||!F(m.origin))return!1;l=m}let c=l.getParentAtCaret();if(!X(c))return!1;let u=c,d=function(m){for(let _ of Ia(m).iterNodeCarets("root")){let{origin:C}=_;if(X(C)){if(bo(_))return ln(C,m.direction)}else if(!Oe(C))break}return null}(mt(u,l.direction)),h=oe(u,ze);if(!h||!h.is(s))return!1;let g=n.getElementByKey(u.getKey()),f=_l(g);if(!g||!f)return!1;let p=IT(n,h);if(i.table=p,d)if(r==="extend"){let m=_l(n.getElementByKey(d.origin.getKey()));if(!m)return!1;i.$setAnchorCellForSelection(f),i.$setFocusCellForSelection(m,!0)}else{let m=Mn(d);So(t.anchor,m),So(t.focus,m)}else if(r==="extend")i.$setAnchorCellForSelection(f),i.$setFocusCellForSelection(f,!0);else{let m=function(_){let C=$a(_);return bo(C)?Mn(C):_}(mt(h,a.direction));So(t.anchor,m),So(t.focus,m)}return qr(e),!0}function MT(n,e,t,r,o){if((t==="up"||t==="down")&&function(i){let a=i.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1}(n))return!1;let s=w();if(!ur(s,r)){if(v(s)){if(t==="backward"){if(s.focus.offset>0)return!1;let i=function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(F(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null}(s.focus.getNode());if(!i)return!1;let a=i.getPreviousSibling();return!!ze(a)&&(qr(e),e.shiftKey?s.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(e.shiftKey&&(t==="up"||t==="down")){let i=s.focus.getNode();if(!s.isCollapsed()&&(t==="up"&&!s.isBackward()||t==="down"&&s.isBackward())){let a=oe(i,h=>ze(h));if(X(a)&&(a=oe(a,ze)),a!==r||!a)return!1;let l=t==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;t==="up"&&F(l)&&(c=l.getChildrenSize());let u=l;t==="up"&&F(l)&&(u=l.getLastChild()||l,c=B(u)?u.getTextContentSize():0);let d=s.clone();return d.focus.set(u.getKey(),c,B(u)?"text":"element"),De(d),qr(e),!0}if(Ze(i)){let a=t==="up"?s.getNodes()[s.getNodes().length-1]:s.getNodes()[0];if(a&&pl(r,a)!==null){let l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;let[u]=ot(l),[d]=ot(c),h=r.getCordsFromCellNode(u,o.table),g=r.getCordsFromCellNode(d,o.table),f=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table),p=r.getDOMCellFromCordsOrThrow(g.x,g.y,o.table);return o.$setAnchorCellForSelection(f),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=oe(i,c=>F(c)&&!c.isInline());if(X(a)&&(a=oe(a,ze)),!a)return!1;let l=t==="down"?a.getNextSibling():a.getPreviousSibling();if(ze(l)&&o.tableNodeKey===l.getKey()){let c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;let[d]=ot(c),[h]=ot(u),g=s.clone();return g.focus.set((t==="up"?d:h).getKey(),t==="up"?0:h.getChildrenSize(),"element"),qr(e),De(g),!0}}}}return t==="down"&&Cl(n)&&o.setShouldCheckSelection(),!1}if(v(s)){if(t==="backward"||t==="forward")return pR(n,e,s,e.shiftKey?"extend":"move",t==="backward",r,o);if(s.isCollapsed()){let{anchor:i,focus:a}=s,l=oe(i.getNode(),X),c=oe(a.getNode(),X);if(!X(l)||!l.is(c))return!1;let u=Ls(l);if(u!==r&&u!=null){let _=Wo(u,n.getElementByKey(u.getKey()));if(_!=null)return o.table=Hi(u,_),MT(n,e,t,u,o)}let d=n.getElementByKey(l.__key),h=n.getElementByKey(i.key);if(h==null||d==null)return!1;let g;if(i.type==="element")g=h.getBoundingClientRect();else{let _=ko(Gm(n));if(_===null||_.rangeCount===0)return!1;g=_.getRangeAt(0).getBoundingClientRect()}let f=t==="up"?l.getFirstChild():l.getLastChild();if(f==null)return!1;let p=n.getElementByKey(f.__key);if(p==null)return!1;let m=p.getBoundingClientRect();if(t==="up"?m.top>g.top-g.height:g.bottom+g.height>m.bottom){qr(e);let _=r.getCordsFromCellNode(l,o.table);if(!e.shiftKey)return gR(o,r,_.x,_.y,t);{let C=r.getDOMCellFromCordsOrThrow(_.x,_.y,o.table);o.$setAnchorCellForSelection(C),o.$setFocusCellForSelection(C,!0)}return!0}}}else if(Te(s)){let{anchor:i,focus:a}=s,l=oe(i.getNode(),X),c=oe(a.getNode(),X),[u]=s.getNodes();ze(u)||Z(251);let d=Wo(u,n.getElementByKey(u.getKey()));if(!X(l)||!X(c)||!ze(u)||d==null)return!1;o.$updateTableTableSelection(s);let h=Hi(u,d),g=r.getCordsFromCellNode(l,h),f=r.getDOMCellFromCordsOrThrow(g.x,g.y,h);if(o.$setAnchorCellForSelection(f),qr(e),e.shiftKey){let[p,m,_]=bt(r,l,c);return fR(o,p,m,_,t)}return c.selectEnd(),!0}return!1}function qr(n){n.preventDefault(),n.stopImmediatePropagation(),n.stopPropagation()}function _T(n,e,t){let r=U();n==="first"?e.insertBefore(r):e.insertAfter(r),r.append(...t||[]),r.selectEnd()}function CT(n,e,t){let r=t.getParent();if(!r)return;let o=ko(Gm(n));if(!o)return;let s=o.anchorNode,i=n.getElementByKey(r.getKey()),a=Wo(t,n.getElementByKey(t.getKey()));if(!s||!i||!a||!i.contains(s)||a.contains(s))return;let l=oe(e.anchor.getNode(),C=>X(C));if(!l)return;let c=oe(l,C=>ze(C));if(!ze(c)||!c.is(t))return;let[u,d]=bt(t,l,l),h=u[0][0],g=u[u.length-1][u[0].length-1],{startRow:f,startColumn:p}=d,m=f===h.startRow&&p===h.startColumn,_=f===g.startRow&&p===g.startColumn;return m?"first":_?"last":void 0}function ks(n,e){let{tableNode:t}=n.$lookup(),r=t.getCordsFromCellNode(e,n.table);return t.getDOMCellFromCordsOrThrow(r.x,r.y,n.table)}function Pm(n,e,t){return pl(n,We(e,t))}function xT(n,e,t){if(!e.theme.tableAlignment)return;let r=[],o=[];for(let s of["center","right"]){let i=e.theme.tableAlignment[s];i&&(s===t?o:r).push(i)}wt(n,...r),_e(n,...o)}var Fm=new WeakSet;function Cl(n=Fr()){return Fm.has(n)}function DT(n,e){e?Fm.add(n):Fm.delete(n)}var yn=class extends Ye{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new yn(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:e=>({conversion:mR,priority:1})}}static importJSON(e){return ld().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,r){return r==="html"}getDOMSlot(e){let t=Fi(e)?e:e.querySelector("table");return Fi(t)||Z(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){let r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);let o=document.createElement("colgroup");if(r.appendChild(o),R1(o),_e(r,e.theme.table),this.updateTableElement(null,r,e),Cl(t)){let s=document.createElement("div"),i=e.theme.tableScrollableWrapper;return i?_e(s,i):s.style.cssText="overflow-x: auto;",s.appendChild(r),this.updateTableWrapper(null,s,r,e),s}return r}updateTableWrapper(e,t,r,o){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(s,i,a,l){l>0?(_e(s,a.theme.tableFrozenColumn),i.setAttribute("data-lexical-frozen-column","true")):(wt(s,a.theme.tableFrozenColumn),i.removeAttribute("data-lexical-frozen-column"))}(t,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(s,i,a,l){l>0?(_e(s,a.theme.tableFrozenRow),i.setAttribute("data-lexical-frozen-row","true")):(wt(s,a.theme.tableFrozenRow),i.removeAttribute("data-lexical-frozen-row"))}(t,r,o,this.__frozenRowCount)}updateTableElement(e,t,r){this.__style!==(e?e.__style:"")&&(t.style.cssText=this.__style),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(o,s,i){i?(_e(o,s.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(wt(o,s.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))}(t,r,this.__rowStriping),function(o,s,i,a){let l=o.querySelector("colgroup");if(!l)return;let c=[];for(let u=0;u<i;u++){let d=document.createElement("col"),h=a&&a[u];h&&(d.style.width=`${h}px`),c.push(d)}l.replaceChildren(...c)}(t,0,this.getColumnCount(),this.getColWidths()),xT(t,r,this.getFormatType())}updateDOM(e,t,r){let o=this.getDOMSlot(t).element;return t===o===Cl()||(Xe(s=t)&&s.nodeName==="DIV"&&this.updateTableWrapper(e,t,o,r),this.updateTableElement(e,o,r),!1);var s}exportDOM(e){let t=super.exportDOM(e),{element:r}=t;return{after:o=>{if(t.after&&(o=t.after(o)),!Fi(o)&&Xe(o)&&(o=o.querySelector("table")),!Fi(o))return null;xT(o,e._config,this.getFormatType());let[s]=Zr(this,null,null),i=new Map;for(let u of s)for(let d of u){let h=d.cell.getKey();i.has(h)||i.set(h,{colSpan:d.cell.getColSpan(),startColumn:d.startColumn})}let a=new Set;for(let u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let d=u.getAttribute("data-temporary-table-cell-lexical-key");if(d){let h=i.get(d);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),h){i.delete(d);for(let g=0;g<h.colSpan;g++)a.add(g+h.startColumn)}}}let l=o.querySelector(":scope > colgroup");if(l){let u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((d,h)=>a.has(h));l.replaceChildren(...u)}let c=o.querySelectorAll(":scope > tr");if(c.length>0){let u=document.createElement("tbody");for(let d of c)u.appendChild(d);o.append(u)}return o},element:!Fi(r)&&Xe(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:r,domRows:o}=t;for(let s=0;s<r;s++){let i=o[s];if(i!=null)for(let a=0;a<i.length;a++){let l=i[a];if(l==null)continue;let{elem:c}=l,u=Pm(this,c);if(u!==null&&e.is(u))return{x:a,y:s}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,r){let{domRows:o}=r,s=o[t];if(s==null)return null;let i=s[e<s.length?e:s.length-1];return i??null}getDOMCellFromCordsOrThrow(e,t,r){let o=this.getDOMCellFromCords(e,t,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(e,t,r){let o=this.getDOMCellFromCords(e,t,r);if(o==null)return null;let s=We(o.elem);return X(s)?s:null}getCellNodeFromCordsOrThrow(e,t,r){let o=this.getCellNodeFromCords(e,t,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!e)return 0;let t=0;return e.getChildren().forEach(r=>{X(r)&&(t+=r.getColSpan())}),t}};function IT(n,e){let t=n.getElementByKey(e.getKey());return t===null&&Z(230),Hi(e,t)}function mR(n){let e=ld();n.hasAttribute("data-lexical-row-striping")&&e.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&e.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&e.setFrozenRows(1);let t=n.querySelector(":scope > colgroup");if(t){let r=[];for(let o of t.querySelectorAll(":scope > col")){let s=o.style.width||"";if(!Bm.test(s)&&(s=o.getAttribute("width")||"",!/^\d+$/.test(s))){r=void 0;break}r.push(parseFloat(s))}r&&e.setColWidths(r)}return{after:r=>wi(r,Oe),node:e}}function ld(){return ft(new yn)}function ze(n){return n instanceof yn}function _R({rows:n,columns:e,includeHeaders:t}){let r=w()||Br();if(!r||!v(r)||Ls(r.anchor.getNode()))return!1;let o=bT(Number(n),Number(e),t);gb(o);let s=o.getFirstDescendant();return B(s)&&s.select(),!0}function CR(n){Oe(n.getParent())?n.isEmpty()&&n.append(U()):n.remove()}function xR(n){ze(n.getParent())?Ja(n,X):n.remove()}function yR(n){Ja(n,Oe);let[e]=Zr(n,null,null),t=e.reduce((o,s)=>Math.max(o,s.length),0),r=n.getChildren();for(let o=0;o<e.length;++o){let s=r[o];if(!s)continue;Oe(s)||Z(254,s.constructor.name,s.getType());let i=e[o].reduce((a,l)=>l?1+a:a,0);if(i!==t)for(let a=i;a<t;++a){let l=Zt();l.append(U()),s.append(l)}}}function bR(n){if(n.detail<3||!jt(n.target))return!1;let e=We(n.target);if(e===null)return!1;let t=oe(e,r=>F(r)&&!r.isInline());return t===null?!1:!!X(t.getParent())&&(t.select(0),!0)}function $T(n){return n.registerNodeTransform(xn,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=ot(e),[r]=bt(t,e,e),o=r.length,s=r[0].length,i=t.getFirstChild();Oe(i)||Z(175);let a=[];for(let l=0;l<o;l++){l!==0&&(i=i.getNextSibling(),Oe(i)||Z(175));let c=null;for(let u=0;u<s;u++){let d=r[l][u],h=d.cell;if(d.startRow===l&&d.startColumn===u)c=h,a.push(h);else if(h.getColSpan()>1||h.getRowSpan()>1){X(h)||Z(176);let g=Zt(h.__headerState);c!==null?c.insertAfter(g):Za(i,g)}}}for(let l of a)l.setColSpan(1),l.setRowSpan(1)}})}function PT(n,e=!0){let t=new Map,r=(s,i,a)=>{let l=Wo(s,a),c=kT(s,l,n,e);t.set(i,[c,l])},o=n.registerMutationListener(yn,s=>{n.getEditorState().read(()=>{for(let[i,a]of s){let l=t.get(i);if(a==="created"||a==="updated"){let{tableNode:c,tableElement:u}=Wm(i);l===void 0?r(c,i,u):u!==l[1]&&(l[0].removeListeners(),t.delete(i),r(c,i,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),t.delete(i))}},{editor:n})},{skipInitialization:!1});return()=>{o();for(let[,[s]]of t)s.removeListeners()}}function FT(n){return n.hasNodes([yn])||Z(255),Ee(n.registerCommand(yT,_R,W),n.registerCommand(Ya,({nodes:e,selection:t},r)=>n!==r||!v(t)?!1:Ls(t.anchor.getNode())!==null&&e.some(ze),W),n.registerCommand(No,bR,W),n.registerNodeTransform(yn,yR),n.registerNodeTransform(Jr,xR),n.registerNodeTransform(xn,CR))}var SR=ue({build:(n,e,t)=>In(e),config:xt({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasTabHandler:!0}),name:"@lexical/table/Table",nodes:[yn,Jr,xn],register(n,e,t){let r=t.getOutput();return Ee(Ht(()=>{let o=r.hasHorizontalScroll.value;Cl(n)!==o&&(DT(n,o),n.registerNodeTransform(yn,()=>{})())}),FT(n),Ht(()=>PT(n,r.hasTabHandler.value)),Ht(()=>r.hasCellMerge.value?void 0:$T(n)),Ht(()=>r.hasCellBackgroundColor.value?void 0:n.registerNodeTransform(xn,o=>{o.getBackgroundColor()!==null&&o.setBackgroundColor(null)})))}});var ee=Ym,M3=ee.$computeTableMap,D3=ee.$computeTableMapSkipCellCheck,I3=ee.$createTableCellNode,$3=ee.$createTableNode,P3=ee.$createTableNodeWithDimensions,F3=ee.$createTableRowNode,B3=ee.$createTableSelection,H3=ee.$createTableSelectionFrom,z3=ee.$deleteTableColumn,BT=ee.$deleteTableColumnAtSelection,K3=ee.$deleteTableColumn__EXPERIMENTAL,HT=ee.$deleteTableRowAtSelection,U3=ee.$deleteTableRow__EXPERIMENTAL,jm=ee.$findCellNode,qm=ee.$findTableNode,zT=ee.$getElementForTableNode,W3=ee.$getNodeTriplet,G3=ee.$getTableAndElementByKey,xl=ee.$getTableCellNodeFromLexicalNode,V3=ee.$getTableCellNodeRect,KT=ee.$getTableColumnIndexFromTableCellNode,Y3=ee.$getTableNodeFromLexicalNodeOrThrow,UT=ee.$getTableRowIndexFromTableCellNode,j3=ee.$getTableRowNodeFromTableCellNodeOrThrow,q3=ee.$insertTableColumn,Zm=ee.$insertTableColumnAtSelection,Z3=ee.$insertTableColumn__EXPERIMENTAL,J3=ee.$insertTableRow,Jm=ee.$insertTableRowAtSelection,X3=ee.$insertTableRow__EXPERIMENTAL,Q3=ee.$isScrollableTablesActive,eP=ee.$isTableCellNode,tP=ee.$isTableNode,nP=ee.$isTableRowNode,rP=ee.$isTableSelection,oP=ee.$mergeCells,sP=ee.$removeTableRowAtIndex,iP=ee.$unmergeCell,WT=ee.INSERT_TABLE_COMMAND,dr=ee.TableCellHeaderStates,Ki=ee.TableCellNode,aP=ee.TableExtension,yl=ee.TableNode,lP=ee.TableObserver,GT=ee.TableRowNode,cP=ee.applyTableHandlers,uP=ee.getDOMCellFromTarget,dP=ee.getTableElement,hP=ee.getTableObserverFromTableElement,gP=ee.registerTableCellUnmergeTransform,VT=ee.registerTablePlugin,YT=ee.registerTableSelectionObserver,jT=ee.setScrollableTablesActive;function t_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ds=t_();function tN(n){Ds=n}var Nl={exec:()=>null};function Ce(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(o,s)=>{let i=typeof s=="string"?s:s.source;return i=i.replace(Kt.caret,"$1"),t=t.replace(o,i),r},getRegex:()=>new RegExp(t,e)};return r}var TR=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Kt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},NR=/^(?:[ \t]*(?:\n|$))+/,ER=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,AR=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,El=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wR=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,n_=/(?:[*+-]|\d{1,9}[.)])/,nN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rN=Ce(nN).replace(/bull/g,n_).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(),vR=Ce(nN).replace(/bull/g,n_).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(),r_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,OR=/^[^\n]+/,o_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,kR=Ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",o_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),LR=Ce(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,n_).getRegex(),fd="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",s_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,RR=Ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",s_).replace("tag",fd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oN=Ce(r_).replace("hr",El).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",fd).getRegex(),MR=Ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oN).getRegex(),i_={blockquote:MR,code:ER,def:kR,fences:AR,heading:wR,hr:El,html:RR,lheading:rN,list:LR,newline:NR,paragraph:oN,table:Nl,text:OR},qT=Ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",El).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fd).getRegex(),DR={...i_,lheading:vR,table:qT,paragraph:Ce(r_).replace("hr",El).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qT).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",fd).getRegex()},IR={...i_,html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",s_).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:Nl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ce(r_).replace("hr",El).replace("heading",` *#{1,6} *[^
]`).replace("lheading",rN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$R=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sN=/^( {2,}|\\)\n(?!\s*$)/,FR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pd=/[\p{P}\p{S}]/u,a_=/[\s\p{P}\p{S}]/u,iN=/[^\s\p{P}\p{S}]/u,BR=Ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,a_).getRegex(),aN=/(?!~)[\p{P}\p{S}]/u,HR=/(?!~)[\s\p{P}\p{S}]/u,zR=/(?:[^\s\p{P}\p{S}]|~)/u,KR=Ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",TR?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),lN=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,UR=Ce(lN,"u").replace(/punct/g,pd).getRegex(),WR=Ce(lN,"u").replace(/punct/g,aN).getRegex(),cN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",GR=Ce(cN,"gu").replace(/notPunctSpace/g,iN).replace(/punctSpace/g,a_).replace(/punct/g,pd).getRegex(),VR=Ce(cN,"gu").replace(/notPunctSpace/g,zR).replace(/punctSpace/g,HR).replace(/punct/g,aN).getRegex(),YR=Ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,iN).replace(/punctSpace/g,a_).replace(/punct/g,pd).getRegex(),jR=Ce(/\\(punct)/,"gu").replace(/punct/g,pd).getRegex(),qR=Ce(/^<(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(),ZR=Ce(s_).replace("(?:-->|$)","-->").getRegex(),JR=Ce("^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",ZR).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,XR=Ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",dd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),uN=Ce(/^!?\[(label)\]\[(ref)\]/).replace("label",dd).replace("ref",o_).getRegex(),dN=Ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",o_).getRegex(),QR=Ce("reflink|nolink(?!\\()","g").replace("reflink",uN).replace("nolink",dN).getRegex(),ZT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,l_={_backpedal:Nl,anyPunctuation:jR,autolink:qR,blockSkip:KR,br:sN,code:PR,del:Nl,emStrongLDelim:UR,emStrongRDelimAst:GR,emStrongRDelimUnd:YR,escape:$R,link:XR,nolink:dN,punctuation:BR,reflink:uN,reflinkSearch:QR,tag:JR,text:FR,url:Nl},eM={...l_,link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",dd).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",dd).getRegex()},Xm={...l_,emStrongRDelimAst:VR,emStrongLDelim:WR,url:Ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ZT).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:Ce(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ZT).getRegex()},tM={...Xm,br:Ce(sN).replace("{2,}","*").getRegex(),text:Ce(Xm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},cd={normal:i_,gfm:DR,pedantic:IR},bl={normal:l_,gfm:Xm,breaks:tM,pedantic:eM},nM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},JT=n=>nM[n];function hr(n,e){if(e){if(Kt.escapeTest.test(n))return n.replace(Kt.escapeReplace,JT)}else if(Kt.escapeTestNoEncode.test(n))return n.replace(Kt.escapeReplaceNoEncode,JT);return n}function XT(n){try{n=encodeURI(n).replace(Kt.percentDecode,"%")}catch{return null}return n}function QT(n,e){let t=n.replace(Kt.findPipe,(s,i,a)=>{let l=!1,c=i;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=t.split(Kt.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(Kt.slashPipe,"|");return r}function Sl(n,e,t){let r=n.length;if(r===0)return"";let o=0;for(;o<r;){let s=n.charAt(r-o-1);if(s===e&&!t)o++;else if(s!==e&&t)o++;else break}return n.slice(0,r-o)}function rM(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function eN(n,e,t,r,o){let s=e.href,i=e.title||null,a=n[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function oM(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let o=r[1];return e.split(`
`).map(s=>{let i=s.match(t.other.beginningSpace);if(i===null)return s;let[a]=i;return a.length>=o.length?s.slice(o.length):s}).join(`
`)}var hd=class{options;rules;lexer;constructor(n){this.options=n||Ds}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Sl(t,`
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=oM(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=Sl(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Sl(e[0],`
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Sl(e[0],`
`).split(`
`),r="",o="",s=[];for(;t.length>0;){let i=!1,a=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),i=!0;else if(!i)a.push(t[l]);else break;t=t.slice(l);let c=a.join(`
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
${c}`:c,o=o?`${o}
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=d,t.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let g=h,f=g.raw+`
`+t.join(`
`),p=this.blockquote(f);s[s.length-1]=p,r=r.substring(0,r.length-g.raw.length)+p.raw,o=o.substring(0,o.length-g.text.length)+p.text;break}else if(h?.type==="list"){let g=h,f=g.raw+`
`+t.join(`
`),p=this.list(f);s[s.length-1]=p,r=r.substring(0,r.length-h.raw.length)+p.raw,o=o.substring(0,o.length-g.raw.length)+p.raw,t=f.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:o}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),r=t.length>1,o={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let s=this.rules.other.listItemRegex(t),i=!1;for(;n;){let l=!1,c="",u="";if(!(e=s.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let d=e[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,_=>" ".repeat(3*_.length)),h=n.split(`
`,1)[0],g=!d.trim(),f=0;if(this.options.pedantic?(f=2,u=d.trimStart()):g?f=e[1].length+1:(f=e[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,u=d.slice(f),f+=e[1].length),g&&this.rules.other.blankLine.test(h)&&(c+=h+`
`,n=n.substring(h.length+1),l=!0),!l){let _=this.rules.other.nextBulletRegex(f),C=this.rules.other.hrRegex(f),x=this.rules.other.fencesBeginRegex(f),y=this.rules.other.headingBeginRegex(f),S=this.rules.other.htmlBeginRegex(f);for(;n;){let b=n.split(`
`,1)[0],N;if(h=b,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),N=h):N=h.replace(this.rules.other.tabCharGlobal," "),x.test(h)||y.test(h)||S.test(h)||_.test(h)||C.test(h))break;if(N.search(this.rules.other.nonSpaceChar)>=f||!h.trim())u+=`
`+N.slice(f);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(d)||y.test(d)||C.test(d))break;u+=`
`+h}!g&&!h.trim()&&(g=!0),c+=b+`
`,n=n.substring(b.length+1),d=N.slice(f)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let p=null,m;this.options.gfm&&(p=this.rules.other.listIsTask.exec(u),p&&(m=p[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!p,checked:m,loose:!1,text:u,tokens:[]}),o.raw+=c}let a=o.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l=0;l<o.items.length;l++)if(this.lexer.state.top=!1,o.items[l].tokens=this.lexer.blockTokens(o.items[l].text,[]),!o.loose){let c=o.items[l].tokens.filter(d=>d.type==="space"),u=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));o.loose=u}if(o.loose)for(let l=0;l<o.items.length;l++)o.items[l].loose=!0;return o}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:o}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=QT(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?s.align.push("right"):this.rules.other.tableAlignCenter.test(i)?s.align.push("center"):this.rules.other.tableAlignLeft.test(i)?s.align.push("left"):s.align.push(null);for(let i=0;i<t.length;i++)s.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:s.align[i]});for(let i of o)s.rows.push(QT(i,s.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[l]})));return s}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let s=Sl(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{let s=rM(e[2],"()");if(s===-2)return;if(s>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let r=e[2],o="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],o=s[3])}else o=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),eN(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[r.toLowerCase()];if(!o){let s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return eN(t,o,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!t||this.rules.inline.punctuation.exec(t))){let o=[...r[0]].length-1,s,i,a=o,l=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+o);(r=c.exec(e))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(i=[...s].length,r[3]||r[4]){a+=i;continue}else if((r[5]||r[6])&&o%3&&!((o+i)%3)){l+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+l);let u=[...r[0]][0].length,d=n.slice(0,o+r.index+u+i);if(Math.min(o,i)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),o=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&o&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let o;do o=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(o!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Bn=class Qm{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ds,this.options.tokenizer=this.options.tokenizer||new hd,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:Kt,block:cd.normal,inline:bl.normal};this.options.pedantic?(t.block=cd.pedantic,t.inline=bl.pedantic):this.options.gfm&&(t.block=cd.gfm,this.options.breaks?t.inline=bl.breaks:t.inline=bl.gfm),this.tokenizer.rules=t}static get rules(){return{block:cd,inline:bl}}static lex(e,t){return new Qm(t).lex(e)}static lexInline(e,t){return new Qm(t).inlineTokens(e)}lex(e){e=e.replace(Kt.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(Kt.tabCharGlobal," ").replace(Kt.spaceLine,""));e;){let o;if(this.options.extensions?.block?.some(i=>(o=i.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let i=t.at(-1);o.raw.length===1&&i!==void 0?i.raw+=`
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+o.raw,i.text+=`
`+o.text,this.inlineQueue.at(-1).src=i.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+o.raw,i.text+=`
`+o.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},t.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startBlock){let i=1/0,a=e.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(s=e.substring(0,i+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let i=t.at(-1);r&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+o.raw,i.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(o),r=s.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let i=t.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+o.raw,i.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(o);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=o[2]?o[2].length:0,r=r.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,a="";for(;e;){i||(a=""),i=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let u=t.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,r,a)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,d=e.slice(1),h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},d),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(l=this.tokenizer.inlineText(c)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),i=!0;let u=t.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):t.push(l);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}},gd=class{options;parser;constructor(n){this.options=n||Ds}space(n){return""}code({text:n,lang:e,escaped:t}){let r=(e||"").match(Kt.notSpaceStart)?.[0],o=n.replace(Kt.endingNewline,"")+`
`;return r?'<pre><code class="language-'+hr(r)+'">'+(t?o:hr(o,!0))+`</code></pre>
`:"<pre><code>"+(t?o:hr(o,!0))+`</code></pre>
`}blockquote({tokens:n}){return`<blockquote>
${this.parser.parse(n)}</blockquote>
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
`}hr(n){return`<hr>
`}list(n){let e=n.ordered,t=n.start,r="";for(let i=0;i<n.items.length;i++){let a=n.items[i];r+=this.listitem(a)}let o=e?"ol":"ul",s=e&&t!==1?' start="'+t+'"':"";return"<"+o+s+`>
`+r+"</"+o+`>
`}listitem(n){let e="";if(n.task){let t=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=t+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=t+" "+hr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
`}table(n){let e="",t="";for(let o=0;o<n.header.length;o++)t+=this.tablecell(n.header[o]);e+=this.tablerow({text:t});let r="";for(let o=0;o<n.rows.length;o++){let s=n.rows[o];t="";for(let i=0;i<s.length;i++)t+=this.tablecell(s[i]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+r+`</table>
`}tablerow({text:n}){return`<tr>
${n}</tr>
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${hr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),o=XT(n);if(o===null)return r;n=o;let s='<a href="'+n+'"';return e&&(s+=' title="'+hr(e)+'"'),s+=">"+r+"</a>",s}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let o=XT(n);if(o===null)return hr(t);n=o;let s=`<img src="${n}" alt="${t}"`;return e&&(s+=` title="${hr(e)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:hr(n.text)}},c_=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Hn=class e_{options;renderer;textRenderer;constructor(e){this.options=e||Ds,this.options.renderer=this.options.renderer||new gd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new c_}static parse(e,t){return new e_(t).parse(e)}static parseInline(e,t){return new e_(t).parseInline(e)}parse(e,t=!0){let r="";for(let o=0;o<e.length;o++){let s=e[o];if(this.options.extensions?.renderers?.[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){r+=l||"";continue}}let i=s;switch(i.type){case"space":{r+=this.renderer.space(i);continue}case"hr":{r+=this.renderer.hr(i);continue}case"heading":{r+=this.renderer.heading(i);continue}case"code":{r+=this.renderer.code(i);continue}case"table":{r+=this.renderer.table(i);continue}case"blockquote":{r+=this.renderer.blockquote(i);continue}case"list":{r+=this.renderer.list(i);continue}case"html":{r+=this.renderer.html(i);continue}case"def":{r+=this.renderer.def(i);continue}case"paragraph":{r+=this.renderer.paragraph(i);continue}case"text":{let a=i,l=this.renderer.text(a);for(;o+1<e.length&&e[o+1].type==="text";)a=e[++o],l+=`
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let o=0;o<e.length;o++){let s=e[o];if(this.options.extensions?.renderers?.[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let i=s;switch(i.type){case"escape":{r+=t.text(i);break}case"html":{r+=t.html(i);break}case"link":{r+=t.link(i);break}case"image":{r+=t.image(i);break}case"strong":{r+=t.strong(i);break}case"em":{r+=t.em(i);break}case"codespan":{r+=t.codespan(i);break}case"br":{r+=t.br(i);break}case"del":{r+=t.del(i);break}case"text":{r+=t.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ud,Tl=(ud=class{options;block;constructor(n){this.options=n||Ds}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Bn.lex:Bn.lexInline}provideParser(){return this.block?Hn.parse:Hn.parseInline}},nn(ud,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),nn(ud,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ud),sM=class{defaults=t_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Hn;Renderer=gd;TextRenderer=c_;Lexer=Bn;Tokenizer=hd;Hooks=Tl;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let o=r;for(let s of o.header)t=t.concat(this.walkTokens(s.tokens,e));for(let s of o.rows)for(let i of s)t=t.concat(this.walkTokens(i.tokens,e));break}case"list":{let o=r;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=r;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(s=>{let i=o[s].flat(1/0);t=t.concat(this.walkTokens(i,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let s=e.renderers[o.name];s?e.renderers[o.name]=function(...i){let a=o.renderer.apply(this,i);return a===!1&&(a=s.apply(this,i)),a}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[o.level];s?s.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),r.extensions=e),t.renderer){let o=this.defaults.renderer||new gd(this.defaults);for(let s in t.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let i=s,a=t.renderer[i],l=o[i];o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u||""}}r.renderer=o}if(t.tokenizer){let o=this.defaults.tokenizer||new hd(this.defaults);for(let s in t.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let i=s,a=t.tokenizer[i],l=o[i];o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.tokenizer=o}if(t.hooks){let o=this.defaults.hooks||new Tl;for(let s in t.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let i=s,a=t.hooks[i],l=o[i];Tl.passThroughHooks.has(s)?o[i]=c=>{if(this.defaults.async&&Tl.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await a.call(o,c);return l.call(o,d)})();let u=a.call(o,c);return l.call(o,u)}:o[i]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(o,c);return d===!1&&(d=await l.apply(o,c)),d})();let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.hooks=o}if(t.walkTokens){let o=this.defaults.walkTokens,s=t.walkTokens;r.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),o&&(a=a.concat(o.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return Bn.lex(n,e??this.defaults)}parser(n,e){return Hn.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},o={...this.defaults,...r},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let i=o.hooks?await o.hooks.preprocess(e):e,a=await(o.hooks?await o.hooks.provideLexer():n?Bn.lex:Bn.lexInline)(i,o),l=o.hooks?await o.hooks.processAllTokens(a):a;o.walkTokens&&await Promise.all(this.walkTokens(l,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser():n?Hn.parse:Hn.parseInline)(l,o);return o.hooks?await o.hooks.postprocess(c):c})().catch(s);try{o.hooks&&(e=o.hooks.preprocess(e));let i=(o.hooks?o.hooks.provideLexer():n?Bn.lex:Bn.lexInline)(e,o);o.hooks&&(i=o.hooks.processAllTokens(i)),o.walkTokens&&this.walkTokens(i,o.walkTokens);let a=(o.hooks?o.hooks.provideParser():n?Hn.parse:Hn.parseInline)(i,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(i){return s(i)}}}onError(n,e){return t=>{if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+hr(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},Ms=new sM;function we(n,e){return Ms.parse(n,e)}we.options=we.setOptions=function(n){return Ms.setOptions(n),we.defaults=Ms.defaults,tN(we.defaults),we};we.getDefaults=t_;we.defaults=Ds;we.use=function(...n){return Ms.use(...n),we.defaults=Ms.defaults,tN(we.defaults),we};we.walkTokens=function(n,e){return Ms.walkTokens(n,e)};we.parseInline=Ms.parseInline;we.Parser=Hn;we.parser=Hn.parse;we.Renderer=gd;we.TextRenderer=c_;we.Lexer=Bn;we.lexer=Bn.lex;we.Tokenizer=hd;we.Hooks=Tl;we.parse=we;var pP=we.options,mP=we.setOptions,_P=we.use,CP=we.walkTokens,xP=we.parseInline;var yP=Hn.parse,bP=Bn.lex;window.Prism=window.Prism||{};window.Prism.manual=!0;function TN(n,e){let t={...n,...e};for(let[r,o]of Object.entries(e))iM(n[r],o)&&(t[r]=TN(n[r],o));return t}function iM(...n){return n.every(e=>e&&e.constructor==Object)}var Dl=class{#e={};constructor(...e){this.merge(...e)}merge(...e){return this.#e=e.reduce(TN,this.#e)}get(e){return e.split(".").reduce((r,o)=>r[o],this.#e)}};function hN(n,e){return[...Array(1+e-n).keys()].map(t=>t+n)}var gN=new Dl({attachmentTagName:"action-text-attachment",attachmentContentTypeNamespace:"actiontext",authenticatedUploads:!1,extensions:[]}),fN=new Dl({default:{attachments:!0,markdown:!0,multiLine:!0,richText:!0,toolbar:!0,highlight:{buttons:{color:hN(1,9).map(n=>`var(--highlight-${n})`),"background-color":hN(1,9).map(n=>`var(--highlight-bg-${n})`)},permit:{color:[],"background-color":[]}}}}),zn={global:gN,presets:fN,configure({global:n,...e}){n&&gN.merge(n),fN.merge(e)}},aM=["a","b","blockquote","br","code","div","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","li","mark","ol","p","pre","q","s","strong","ul","table","tbody","tr","th","td"],lM=["alt","caption","class","content","content-type","contenteditable","data-direct-upload-id","data-sgid","filename","filesize","height","href","presentation","previewable","sgid","src","style","title","url","width"],cM=["color","background-color"];function uM(n,e){if(e.attrName==="style"&&e.attrValue){let t={...ps(e.attrValue)},r={};for(let o in t)cM.includes(o)&&(r[o]=t[o]);Object.keys(r).length?e.attrValue=xu(r):e.keepAttr=!1}}fc.addHook("uponSanitizeAttribute",uM);fc.addHook("uponSanitizeElement",(n,e)=>{(e.tagName==="strong"||e.tagName==="em")&&n.removeAttribute("class")});function dM(){return{ALLOWED_TAGS:aM.concat(zn.global.get("attachmentTagName")),ALLOWED_ATTR:lM,ADD_URI_SAFE_ATTR:["caption","filename"],SAFE_FOR_XML:!1}}function fg(){return document.head.querySelector("meta[name=csp-nonce]")?.content}function NN(n,e){let t=document.activeElement;n.includes(t)&&new h_(n,e.key).selectNext(t)&&e.preventDefault()}var h_=class{constructor(e,t){this.elements=e,this.key=t}selectNext(e){let t=this.#e(e);if(t){let r=this.elements.filter(o=>o!==t);return this.#a(r),this.#o(t),!0}return!1}#e(e){switch(this.key){case"ArrowRight":case"ArrowDown":return this.#r(e);case"ArrowLeft":case"ArrowUp":return this.#s(e);case"Home":return this.#t();case"End":return this.#n()}}#t(e=this.elements){return e.find(u_)}#n(e=this.elements){return e.findLast(u_)}#r(e){let t=this.elements.slice(this.#i(e)+1);return this.#t(t)}#s(e){let t=this.elements.slice(0,this.#i(e));return this.#n(t)}#i(e){return this.elements.indexOf(e)}#o(e){u_(e)&&(e.tabIndex=0,e.focus())}#a(e){e.forEach(t=>t.tabIndex=-1)}};function u_(n){return n&&!n.disabled&&n.checkVisibility()}var vt={bold:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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 10.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"/>
</svg>`,italic:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,strikethrough:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<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"/>
</svg>`,heading:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,highlight:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,link:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<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"/>
</svg>`,quote:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,code:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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.5975 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"/>
<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"/>
</svg>`,ul:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,ol:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<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"/>
<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"/>
<path d="M2.84155 6V3.01367H2.79053L1.85596 3.64478V2.79614L2.84155 2.12476H3.82715V6H2.84155Z"/>
</svg>`,attachment:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,table:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,hr:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,undo:`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,redo:`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<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" />
</svg>`,overflow:`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`},Ld,EN,Rd,AN,Md,wN,Dd,vN,Id,ON,$d,kN,Pd,LN,Fd,RN,Bd,MN,Hd,DN,$l,zd,IN,Kd,$N,Ud,PN,Pl,Fl,Bl,Hl,g_,Wd,FN,Gd,BN,zl,f_,Vd,HN,Xt,bn,Kl,p_,Yd,zN,Vi,jd,KN,qd,UN,Yi,Cd,Zd,WN,Ul,m_,Jd,GN,Fs,Al,Xr,Is,Xd,VN,ji,xd,Qd,YN,Ll=class extends HTMLElement{constructor(){super();k(this,Ld);k(this,Rd);k(this,Md);k(this,Dd);k(this,Id);k(this,$d);k(this,Pd);k(this,Fd);k(this,Bd);k(this,Hd);k(this,zd);k(this,Kd);k(this,Ud);k(this,Hl);k(this,Wd);k(this,Gd);k(this,zl);k(this,Vd);k(this,Xt);k(this,Kl);k(this,Yd);k(this,jd);k(this,qd);k(this,Yi);k(this,Zd);k(this,Ul);k(this,Jd);k(this,Fs);k(this,Xr);k(this,Xd);k(this,ji);k(this,Qd);k(this,$l,t=>{this.querySelectorAll("[data-hotkey]").forEach(o=>{o.dataset.hotkey.toLowerCase().split(/\s+/).includes(L(this,zd,IN).call(this,t))&&(t.preventDefault(),t.stopPropagation(),o.click())})});k(this,Pl,()=>{R(this,ji,xd)[0].tabIndex=0});k(this,Fl,()=>{L(this,Hl,g_).call(this),L(this,Ul,m_).call(this)});k(this,Bl,t=>{NN(R(this,ji,xd),t)});k(this,Vi,()=>{L(this,qd,UN).call(this),L(this,jd,KN).call(this),R(this,Fs,Al).style.display=R(this,Xr,Is).children.length?"block":"none",R(this,Fs,Al).setAttribute("nonce",fg());let t=R(this,Xr,Is).children.length>0;this.toggleAttribute("overflowing",t),R(this,Xr,Is).toggleAttribute("disabled",!t)});this.internals=this.attachInternals(),this.internals.role="toolbar",L(this,Rd,AN).call(this)}connectedCallback(){requestAnimationFrame(()=>R(this,Vi).call(this)),this.setAttribute("role","toolbar"),L(this,Md,wN).call(this)}disconnectedCallback(){L(this,Dd,vN).call(this),L(this,Hd,DN).call(this),L(this,Ud,PN).call(this)}attributeChangedCallback(t,r,o){t==="connected"&&this.isConnected&&r!=null&&r!==o&&requestAnimationFrame(()=>L(this,Ld,EN).call(this))}setEditor(t){this.editorElement=t,this.editor=t.editor,this.selection=t.selection,L(this,Id,ON).call(this),L(this,Bd,MN).call(this),L(this,Hl,g_).call(this),L(this,Zd,WN).call(this),L(this,Wd,FN).call(this),L(this,Gd,BN).call(this),R(this,Vi).call(this),L(this,Kd,$N).call(this),this.resolveEditorPromise(t),this.toggleAttribute("connected",!0)}async getEditorElement(){return this.editorElement||await this.editorPromise}static get defaultTemplate(){return`
<button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">
${vt.bold}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">
${vt.italic}
</button>
<button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">
${vt.strikethrough}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">
${vt.heading}
</button>
<details class="lexxy-editor__toolbar-dropdown" name="lexxy-dropdown">
<summary class="lexxy-editor__toolbar-button" name="highlight" title="Color highlight">
${vt.highlight}
</summary>
<lexxy-highlight-dropdown class="lexxy-editor__toolbar-dropdown-content">
<div class="lexxy-highlight-colors"></div>
<button data-command="removeHighlight" class="lexxy-editor__toolbar-button lexxy-editor__toolbar-dropdown-reset">Remove all coloring</button>
</lexxy-highlight-dropdown>
</details>
<details class="lexxy-editor__toolbar-dropdown" name="lexxy-dropdown">
<summary class="lexxy-editor__toolbar-button" name="link" title="Link" data-hotkey="cmd+k ctrl+k">
${vt.link}
</summary>
<lexxy-link-dropdown class="lexxy-editor__toolbar-dropdown-content">
<form method="dialog">
<input type="url" placeholder="Enter a URL\u2026" class="input">
<div class="lexxy-editor__toolbar-dropdown-actions">
<button type="submit" class="lexxy-editor__toolbar-button" value="link">Link</button>
<button type="button" class="lexxy-editor__toolbar-button" value="unlink">Unlink</button>
</div>
</form>
</lexxy-link-dropdown>
</details>
<button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">
${vt.quote}
</button>
<button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="code" data-command="insertCodeBlock" title="Code">
${vt.code}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">
${vt.ul}
</button>
<button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">
${vt.ol}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">
${vt.attachment}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="table" data-command="insertTable" title="Insert a table">
${vt.table}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="divider" data-command="insertHorizontalDivider" title="Insert a divider">
${vt.hr}
</button>
<div class="lexxy-editor__toolbar-spacer" role="separator"></div>
<button class="lexxy-editor__toolbar-button" type="button" name="undo" data-command="undo" title="Undo">
${vt.undo}
</button>
<button class="lexxy-editor__toolbar-button" type="button" name="redo" data-command="redo" title="Redo">
${vt.redo}
</button>
<details class="lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-overflow" name="lexxy-dropdown">
<summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">${vt.overflow}</summary>
<div class="lexxy-editor__toolbar-dropdown-content lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>
</details>
`}};Ld=new WeakSet,EN=function(){this.disconnectedCallback(),this.connectedCallback()},Rd=new WeakSet,AN=function(){this.editorPromise=new Promise(t=>{this.resolveEditorPromise=t})},Md=new WeakSet,wN=function(){this.resizeObserver=new ResizeObserver(()=>R(this,Vi).call(this)),this.resizeObserver.observe(this)},Dd=new WeakSet,vN=function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},Id=new WeakSet,ON=function(){this.addEventListener("click",L(this,$d,kN).bind(this))},$d=new WeakSet,kN=function(t){L(this,Pd,LN).call(this,t,"[data-command]",L(this,Fd,RN).bind(this))},Pd=new WeakSet,LN=function(t,r,o){let s=t.target.closest(r);s&&o(t,s)},Fd=new WeakSet,RN=function(t,{dataset:{command:r,payload:o}}){let s=t instanceof PointerEvent&&t.pointerId===-1;this.editor.update(()=>{this.editor.dispatchCommand(r,o)},{tag:s?ip:void 0})},Bd=new WeakSet,MN=function(){this.editorElement.addEventListener("keydown",R(this,$l))},Hd=new WeakSet,DN=function(){this.editorElement?.removeEventListener("keydown",R(this,$l))},$l=new WeakMap,zd=new WeakSet,IN=function(t){let r=t.key.toLowerCase();return[...[t.ctrlKey?"ctrl":null,t.metaKey?"cmd":null,t.altKey?"alt":null,t.shiftKey?"shift":null].filter(Boolean),r].join("+")},Kd=new WeakSet,$N=function(){this.editorElement.addEventListener("lexxy:focus",R(this,Pl)),this.editorElement.addEventListener("lexxy:blur",R(this,Fl)),this.addEventListener("keydown",R(this,Bl))},Ud=new WeakSet,PN=function(){this.editorElement.removeEventListener("lexxy:focus",R(this,Pl)),this.editorElement.removeEventListener("lexxy:blur",R(this,Fl)),this.removeEventListener("keydown",R(this,Bl))},Pl=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,Hl=new WeakSet,g_=function(){R(this,ji,xd).forEach(t=>{t.tabIndex=-1})},Wd=new WeakSet,FN=function(){this.editor.registerUpdateListener(()=>{this.editor.getEditorState().read(()=>{L(this,Vd,HN).call(this),L(this,Ul,m_).call(this)})})},Gd=new WeakSet,BN=function(){this.editor.registerUpdateListener(()=>{L(this,zl,f_).call(this)})},zl=new WeakSet,f_=function(){this.editor.getEditorState().read(()=>{let t=this.editorElement.historyState;t&&(L(this,Kl,p_).call(this,"undo",t.undoStack.length===0),L(this,Kl,p_).call(this,"redo",t.redoStack.length===0))})},Vd=new WeakSet,HN=function(){let t=w();if(!v(t)||!t.anchor.getNode().getParent())return;let{isBold:o,isItalic:s,isStrikethrough:i,isHighlight:a,isInLink:l,isInQuote:c,isInHeading:u,isInCode:d,isInList:h,listType:g,isInTable:f}=this.selection.getFormat();L(this,Xt,bn).call(this,"bold",o),L(this,Xt,bn).call(this,"italic",s),L(this,Xt,bn).call(this,"strikethrough",i),L(this,Xt,bn).call(this,"highlight",a),L(this,Xt,bn).call(this,"link",l),L(this,Xt,bn).call(this,"quote",c),L(this,Xt,bn).call(this,"heading",u),L(this,Xt,bn).call(this,"code",d),L(this,Xt,bn).call(this,"unordered-list",h&&g==="bullet"),L(this,Xt,bn).call(this,"ordered-list",h&&g==="number"),L(this,Xt,bn).call(this,"table",f),L(this,zl,f_).call(this)},Xt=new WeakSet,bn=function(t,r){let o=this.querySelector(`[name="${t}"]`);o&&o.setAttribute("aria-pressed",r.toString())},Kl=new WeakSet,p_=function(t,r){let o=this.querySelector(`[name="${t}"]`);o&&(o.disabled=r,o.setAttribute("aria-disabled",r.toString()))},Yd=new WeakSet,zN=function(){return this.scrollWidth-R(this,Fs,Al).clientWidth>this.clientWidth+1},Vi=new WeakMap,jd=new WeakSet,KN=function(){let t=R(this,Xd,VN).reverse(),r=!1;for(let o of t)if(L(this,Yd,zN).call(this))R(this,Xr,Is).prepend(o),r=!0;else{r&&R(this,Xr,Is).prepend(o);break}},qd=new WeakSet,UN=function(){let t=Array.from(R(this,Xr,Is).children);t.sort((r,o)=>L(this,Yi,Cd).call(this,o)-L(this,Yi,Cd).call(this,r)),t.forEach(r=>{let o=this.querySelector(`[data-position="${L(this,Yi,Cd).call(this,r)+1}"]`)??R(this,Fs,Al);this.insertBefore(r,o)})},Yi=new WeakSet,Cd=function(t){return parseInt(t.dataset.position??"999")},Zd=new WeakSet,WN=function(){R(this,Qd,YN).forEach((t,r)=>{t.dataset.position===void 0&&(t.dataset.position=r)})},Ul=new WeakSet,m_=function(){R(this,Jd,GN).forEach(t=>{t.open=!1})},Jd=new WeakSet,GN=function(){return this.querySelectorAll("details")},Fs=new WeakSet,Al=function(){return this.querySelector(".lexxy-editor__toolbar-overflow")},Xr=new WeakSet,Is=function(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")},Xd=new WeakSet,VN=function(){return Array.from(this.querySelectorAll(":scope > button"))},ji=new WeakSet,xd=function(){return Array.from(this.querySelectorAll(":scope button, :scope > details > summary"))},Qd=new WeakSet,YN=function(){return Array.from(this.querySelectorAll(":scope > *:not(.lexxy-editor__toolbar-overflow)"))},nn(Ll,"observedAttributes",["connected"]);var $s={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:"code-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"}},Zo=class extends Eo{static getType(){return"horizontal_divider"}static clone(e){return new Zo(e.__key)}static importJSON(e){return new Zo}static importDOM(){return{hr:e=>({conversion:()=>({node:new Zo}),priority:1})}}constructor(e){super(e)}createDOM(){let e=se("figure",{className:"horizontal-divider"}),t=se("hr");e.appendChild(t);let r=se("lexxy-node-delete-button");return e.appendChild(r),e}updateDOM(){return!0}getTextContent(){return`\u2504
`}isInline(){return!1}exportDOM(){return{element:se("hr")}}exportJSON(){return{type:"horizontal_divider",version:1}}decorate(){return null}},md=[gs,x1];function hM(...n){let e=Jc();return n.forEach(t=>e.add(t.getKey())),e}function gM(n){if(B(n))return Su(n,U);if(n.isParentRequired()){let e=n.createRequiredParent();return Su(n,e)}else return n}function __(n){return nr(n,Fo)?.getListType()??null}function Nd(n,e=null){return e===null?Nd(n,!0)||Nd(n,!1):e?fM(n):V1(n)}function fM(n){return n.offset===0}function wl(n,...e){return jN(Ft,n,(t,r)=>({...t,forChild:(o,s)=>{let a=(t?.forChild??(l=>l))(o,s);if(B(a))return a=e.reduce((l,c)=>c(l,r)??l,a),a}}))}function jN(n,e,t=r=>r){return r=>{let o=n.importDOM()?.[e]?.(r);if(!o)return null;let s=o.conversion(r);return s&&(t(s,r)??s)}}function pM(n){return v(n)?n.isCollapsed()?qN(n.style):n.hasFormat("highlight"):!1}function qN(n){let e=typeof n=="string"?ps(n):n;return!!(e.color||e["background-color"])}function mM(n,e=[]){return e.reduce((t,r)=>r.applyCanonicalization(t),n)}var Ed=class{constructor(e,t=[]){this._property=e,this._allowedValues=t,this._canonicalValues=this.#e}applyCanonicalization(e){let t={...ps(e)};return t[this._property]=this.getCanonicalAllowedValue(t[this._property]),t[this._property]||delete t[this._property],xu(t)}getCanonicalAllowedValue(e){return this._canonicalValues[e]||=this.#t(e)}get#e(){return this._allowedValues.reduce((e,t)=>({...e,[t]:t}),{})}#t(e){let t=this.#n.indexOf(e);return t||=this.#n.indexOf(pN(this._property,e)),t===-1?null:this._allowedValues[t]}get#n(){return this._computedAllowedValues||=this._allowedValues.map(e=>pN(this._property,e))}};function pN(n,e){let t=`${n}: ${e};`,r=document.body.appendChild(se("span",{style:"display: none;"+t})),o=window.getComputedStyle(r).getPropertyValue(n);return r.remove(),o}var Ks=class{#e;constructor(e){this.#e=e}get editorElement(){return this.#e}get editorConfig(){return this.#e.config}get enabled(){return!0}get lexicalExtension(){return null}initializeToolbar(e){}},ZN=Ct(),JN=Ct(),_M={color:null,"background-color":null},XN=gu("hasPastedStyles",{parse:n=>n||!1}),C_=class extends Ks{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return[ue({dependencies:[JS],name:"lexxy/highlight",config:{color:{buttons:[],permit:[]},"background-color":{buttons:[],permit:[]}},html:{import:{mark:CM}},register(t,r){let o=xM(r);return Ee(t.registerCommand(ZN,mN,cn),t.registerCommand(JN,()=>mN(_M),cn),t.registerNodeTransform(Ft,bM),t.registerNodeTransform(Ft,s=>SM(s,o)))}}),this.editorConfig.get("highlight")]}};function vl(n,e){let t={color:e.style?.color,"background-color":e.style?.backgroundColor};a1(Wr)&&QN(n);let r=xu(t);if(r.length)return n.setStyle(n.getStyle()+r)}function CM(){return{conversion:wl("mark",vl),priority:1}}function xM(n){return[new Ed("color",[...n.buttons.color,...n.permit.color]),new Ed("background-color",[...n.buttons["background-color"],...n.permit["background-color"]])]}function mN(n){let e=w();if(!v(e))return;let t={};for(let r in n){let o=_u(e,r);t[r]=yM(o,n[r])}Y1(e,t)}function yM(n,e){return n===e?null:e}function bM(n){qN(n.getStyle())!==n.hasFormat("highlight")&&n.toggleFormat("highlight")}function SM(n,e=[]){if(TM(n)){QN(n,!1);let t=mM(n.getStyle(),e);n.setStyle(t);let r=w();n.isSelected(r)&&(r.setStyle(n.getStyle()),r.setFormat(n.getFormat()))}}function QN(n,e=!0){To(n,XN,e)}function TM(n){return gi(n,XN)}var NM=["bold","italic","strikethrough","link","unlink","toggleHighlight","removeHighlight","rotateHeadingFormat","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","insertHorizontalDivider","uploadAttachments","insertTable","undo","redo"],Il=class{static configureFor(e){new Il(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#e(),this.#n(),this.#r()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(Kr,"bold")}dispatchItalic(){this.editor.dispatchCommand(Kr,"italic")}dispatchStrikethrough(){this.editor.dispatchCommand(Kr,"strikethrough")}dispatchToggleHighlight(e){this.editor.dispatchCommand(ZN,e)}dispatchRemoveHighlight(){this.editor.dispatchCommand(JN)}dispatchLink(e){this.editor.update(()=>{let t=w();if(!!v(t))if(t.isCollapsed()){let r=yS(e),o=ye(e);r.append(o),t.insertNodes([r])}else Li(e)})}dispatchUnlink(){this.#d(null)}dispatchInsertUnorderedList(){let e=w();if(!e)return;let t=e.anchor.getNode();this.selection.isInsideList&&t&&__(t)==="bullet"?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(cS,void 0)}dispatchInsertOrderedList(){let e=w();if(!e)return;let t=e.anchor.getNode();this.selection.isInsideList&&t&&__(t)==="number"?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(lS,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedNodes(e=>$n(e),()=>Ii())}dispatchInsertCodeBlock(){this.editor.update(()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(Kr,"code"):this.contents.toggleNodeWrappingAllSelectedLines(e=>Ko(e),()=>new Uo("plain"))})}dispatchInsertHorizontalDivider(){this.contents.insertAtCursorEnsuringLineBelow(new Zo),this.editor.focus()}dispatchRotateHeadingFormat(){let e=w();if(!v(e))return;if(Ze(e.anchor.getNode())){e.insertNodes([il("h2")]);return}let t=e.anchor.getNode().getTopLevelElementOrThrow(),r="h2";if(al(t)){let o=t.getTag();o==="h2"?r="h3":o==="h3"?r="h4":o==="h4"?r=null:r="h2"}r?this.contents.insertNodeWrappingEachSelectedLine(()=>il(r)):this.contents.removeFormattingFromSelectedLines()}dispatchUploadAttachments(){let e=se("input",{type:"file",multiple:!0,style:"display: none;",onchange:({target:{files:t}})=>{this.contents.uploadFiles(t,{selectLast:!0})}});this.editorElement.appendChild(e),e.click(),setTimeout(()=>e.remove(),1e3)}dispatchInsertTable(){this.editor.dispatchCommand(WT,{rows:3,columns:3,includeHeaders:!0})}dispatchUndo(){this.editor.dispatchCommand(du,void 0)}dispatchRedo(){this.editor.dispatchCommand(lu,void 0)}#e(){for(let e of NM){let t=`dispatch${EM(e)}`;this.#t(e,0,this[t].bind(this))}this.#t(Oo,de,this.dispatchPaste.bind(this))}#t(e,t,r){this.editor.registerCommand(e,r,t)}#n(){this.editor.registerCommand(_n,this.#u.bind(this),cn)}#r(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#o.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#a.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#s.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#i.bind(this)))}#s(e){this.dragCounter++,this.dragCounter===1&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#i(e){this.dragCounter--,this.dragCounter===0&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#o(e){e.preventDefault()}#a(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");let t=e.dataTransfer;if(!t)return;let r=Array.from(t.files);!r.length||(this.contents.uploadFiles(r,{selectLast:!0}),this.editor.focus())}#u(e){return this.selection.isInsideList?this.#l(e):this.selection.isInsideCodeBlock?this.#c():!1}#l(e){if(e.shiftKey&&!this.selection.isIndentedList)return!1;e.preventDefault();let t=e.shiftKey?hn:$t;return this.editor.dispatchCommand(t)}#c(){let e=w();return v(e)&&e.isCollapsed()}#d(e){this.editor.update(()=>{e===null?Li(null):Li(e)})}};function EM(n){return n.charAt(0).toUpperCase()+n.slice(1)}function AM(n,e){let t;return(...r)=>(clearTimeout(t),new Promise((o,s)=>{t=setTimeout(async()=>{try{let i=await n(...r);o(i)}catch(i){s(i)}},e)}))}function Us(){return new Promise(requestAnimationFrame)}function eE(n){if(n===0)return"0 B";let e=["B","KB","MB","GB","TB","PB"],t=Math.floor(Math.log(n)/Math.log(1024));return`${(n/Math.pow(1024,t)).toFixed(2)} ${e[t]}`}function wM(n){return n.split("/").pop()}var Ut=class extends Eo{static getType(){return"action_text_attachment"}static clone(e){return new Ut({...e},e.__key)}static importJSON(e){return new Ut({...e})}static importDOM(){return{[this.TAG_NAME]:()=>({conversion:e=>({node:new Ut({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=>{let t=wM(e.getAttribute("src")??"");return{node:new Ut({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=>{let t=e.getAttribute("src")||e.querySelector("source")?.src,r=t?.split("/")?.pop(),o=e.querySelector("source")?.getAttribute("content-type")||"video/*";return{node:new Ut({src:t,fileName:r,contentType:o})}},priority:1})}}static get TAG_NAME(){return zn.global.get("attachmentTagName")}constructor({tagName:e,sgid:t,src:r,previewable:o,altText:s,caption:i,contentType:a,fileName:l,fileSize:c,width:u,height:d},h){super(h),this.tagName=e||Ut.TAG_NAME,this.sgid=t,this.src=r,this.previewable=o,this.altText=s||"",this.caption=i||"",this.contentType=a||"",this.fileName=l||"",this.fileSize=c,this.width=u,this.height=d,this.editor=Fr()}createDOM(){let e=this.createAttachmentFigure();return this.isPreviewableAttachment?(e.appendChild(this.#e()),e.appendChild(this.#s())):(e.appendChild(this.#n()),e.appendChild(this.#r())),e}updateDOM(e,t){let r=t.querySelector("figcaption textarea");return r&&this.caption&&(r.value=this.caption),!1}getTextContent(){return`[${this.caption||this.fileName}]
`}isInline(){return this.isAttached()&&!this.getParent().is(o1(this))}exportDOM(){return{element:se(this.tagName,{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,tagName:this.tagName,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){let e=cT(this.contentType,this.isPreviewableAttachment,this.fileName),t=se("lexxy-node-delete-button");return e.appendChild(t),e}get isPreviewableAttachment(){return this.isPreviewableImage||this.previewable}get isPreviewableImage(){return vm(this.contentType)}#e(e={}){let t=se("img",{src:this.src,draggable:!1,alt:this.altText,...this.#t,...e}),r=se("div",{className:"attachment__container"});return r.appendChild(t),r}get#t(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#n(){let e=this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown";return se("span",{className:"attachment__icon",textContent:`${e}`})}#r(){let e=se("figcaption",{className:"attachment__caption"}),t=se("strong",{className:"attachment__name",textContent:this.caption||this.fileName});if(e.appendChild(t),this.fileSize){let r=se("span",{className:"attachment__size",textContent:eE(this.fileSize)});e.appendChild(r)}return e}#s(){let e=se("figcaption",{className:"attachment__caption"}),t=se("textarea",{value:this.caption,placeholder:this.fileName,rows:"1"});return t.addEventListener("focusin",()=>t.placeholder="Add caption..."),t.addEventListener("blur",r=>this.#i(r)),t.addEventListener("keydown",r=>this.#a(r)),e.appendChild(t),e}#i(e){this.#o(e.target)}#o(e){e.placeholder=this.fileName,this.editor.update(()=>{this.getWritable().caption=e.value})}#a(e){e.key==="Enter"&&(e.preventDefault(),e.stopPropagation(),e.target.blur(),this.editor.update(()=>{this.selectNext(0,0)},{tag:gs}))}};function tF(...n){return new Ut(...n)}function Ad(n){return n instanceof Ut}var x_=class{constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#n(),this.#t(),this.#r()}set current(e){this.editor.update(()=>{this.#s()})}get hasNodeSelection(){return this.editor.getEditorState().read(()=>{let e=w();return e!==null&&Ke(e)})}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read(()=>{let t=this.#T();if(!t)return;let r=this.#N(t);!r||(e=this.#O(r,t))}),e}placeCursorAtTheEnd(){this.editor.update(()=>{let e=Be(),t=e.getLastDescendant();t&&B(t)?t.selectEnd():e.selectEnd()})}selectedNodeWithOffset(){let e=w();if(!e)return{node:null,offset:0};if(v(e))return{node:e.anchor.getNode(),offset:e.anchor.offset};if(Ke(e)){let[t]=e.getNodes();return{node:t,offset:0}}return{node:null,offset:0}}preservingSelection(e){let t=null;this.editor.getEditorState().read(()=>{let r=w();r&&v(r)&&(t={anchor:{key:r.anchor.key,offset:r.anchor.offset},focus:{key:r.focus.key,offset:r.focus.offset}})}),e(),t&&this.editor.update(()=>{let r=w();r&&v(r)&&(r.anchor.set(t.anchor.key,t.anchor.offset,"text"),r.focus.set(t.focus.key,t.focus.offset,"text"))})}getFormat(){let e=w();if(!v(e))return{};let t=e.anchor.getNode();if(!t.getParent())return{};let r=t.getTopLevelElementOrThrow(),o=__(t);return{isBold:e.hasFormat("bold"),isItalic:e.hasFormat("italic"),isStrikethrough:e.hasFormat("strikethrough"),isHighlight:pM(e),isInLink:nr(t,nl)!==null,isInQuote:$n(r),isInHeading:al(r),isInCode:e.hasFormat("code")||nr(t,Uo)!==null,isInList:o!==null,listType:o,isInTable:xl(t)!==null}}nearestNodeOfType(e){let t=w()?.anchor?.getNode();return nr(t,e)}get hasSelectedWordsInSingleLine(){let e=w();if(!v(e)||e.isCollapsed())return!1;let t=e.anchor.getNode(),r=e.focus.getNode();if(t.getTopLevelElement()!==r.getTopLevelElement()||!t.getTopLevelElement())return!1;let s=e.getNodes();for(let i of s)if(be(i))return!1;return!0}get isInsideList(){return this.nearestNodeOfType(Po)}get isIndentedList(){let e=this.nearestNodeOfType(Fo);return e&&aS(e)>1}get isInsideCodeBlock(){return this.nearestNodeOfType(Uo)!==null}get isTableCellSelected(){return this.nearestNodeOfType(Ki)!==null}get isOnPreviewableImage(){let t=w()?.getNodes().at(0);return Ad(t)&&t.isPreviewableImage}get nodeAfterCursor(){let{anchorNode:e,offset:t}=this.#b();return e?B(e)?this.#L(e,t):F(e)?this.#I(e,t):this.#R(e):null}get topLevelNodeAfterCursor(){let{anchorNode:e,offset:t}=this.#b();return e?B(e)?this.#D(e):F(e)?this.#I(e,t):this.#R(e):null}get nodeBeforeCursor(){let{anchorNode:e,offset:t}=this.#b();return e?B(e)?this.#F(e,t):F(e)?this.#P(e,t):this.#M(e):null}get topLevelNodeBeforeCursor(){let{anchorNode:e,offset:t}=this.#b();return e?B(e)?this.#$(e):F(e)?this.#P(e,t):this.#M(e):null}get#e(){if(this.currentlySelectedKeys)return this.currentlySelectedKeys;this.currentlySelectedKeys=new Set;let e=w();if(e&&Ke(e))for(let t of e.getNodes())this.currentlySelectedKeys.add(t.getKey());return this.currentlySelectedKeys}#t(){this.editor.registerCommand(Qn,this.#a.bind(this),de),this.editor.registerCommand(wo,this.#u.bind(this),de),this.editor.registerCommand(Pt,this.#l.bind(this),de),this.editor.registerCommand(dn,this.#c.bind(this),de),this.editor.registerCommand(un,this.#y.bind(this),de),this.editor.registerCommand(er,()=>{this.current=w()},de)}#n(){this.editor.registerCommand(No,({target:e})=>{if(!jt(e))return!1;let t=We(e);return Et(t)&&this.#C(t)},de),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",e=>{this.#m()})}#r(){this.editorContentElement.addEventListener("keydown",e=>{if(e.key==="ArrowUp"){let t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let r=t.previousElementSibling;for(;r&&r.hasAttribute("data-lexical-cursor");)r=r.previousElementSibling;r||e.preventDefault()}}if(e.key==="ArrowDown"){let t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let r=t.nextElementSibling;for(;r&&r.hasAttribute("data-lexical-cursor");)r=r.nextElementSibling;r||e.preventDefault()}}},!0)}#s(){this.#i(),this.#o(),this.previouslySelectedKeys=this.#e,this.currentlySelectedKeys=null}#i(){for(let e of this.previouslySelectedKeys)if(!this.#e.has(e)){let t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#o(){for(let e of this.#e)if(!this.previouslySelectedKeys.has(e)){let t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#a(){return this.hasNodeSelection?await this.#d(e=>e.selectPrevious()):this.#C(this.nodeBeforeCursor)}async#u(){return this.hasNodeSelection?await this.#d(e=>e.selectNext(0,0)):this.#C(this.nodeAfterCursor)}async#l(){return this.hasNodeSelection?await this.#d(e=>e.getTopLevelElement().selectPrevious()):this.#C(this.topLevelNodeBeforeCursor)}async#c(){return this.hasNodeSelection?await this.#d(e=>e.getTopLevelElement().selectNext(0,0)):this.#C(this.topLevelNodeAfterCursor)}async#d(e){await Us(),this.hasNodeSelection&&this.editor.update(()=>{e(w().getNodes()[0]),this.editor.focus()})}async#m(){this.editor.update(()=>{let e=this.#p();!e||this.#g(e)})}#p(){let e=w();return e?Ke(e)?this.#_(e):v(e)?this.#h(e):null:null}#_(e){let t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#h(e){return e.anchor.getNode().getTopLevelElement()}#g(e){let t=e.getNextSibling();t?t.selectStart():this.#f()}#f(){let e=Be(),t=U();e.append(t),t.selectStart()}#C(e){if(Et(e)){let t=hM(e);return De(t),t}else return!1}#y(e){let t=e?this.nodeBeforeCursor:this.nodeAfterCursor;if(!Et(t))return!1;this.#x();let r=this.#C(t);return Boolean(r)}#x(e=w()?.anchor){let t=e?.getNode();F(t)&&t?.isEmpty()&&t.remove()}#T(){let e=w();if(!e||!e.isCollapsed())return null;let t=window.getSelection();return!t||t.rangeCount===0?null:t.getRangeAt(0)}#N(e){let t=e.getBoundingClientRect();if(this.#E(t)){let r=this.#A(e);t=r.getBoundingClientRect(),this.#w(r),r.remove()}return t}#E(e){return e.width===0&&e.height===0||e.top===0&&e.left===0}#A(e){let t=this.#S();return e.insertNode(t),t}#S(){let 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",fg()),e}#w(e){let t=window.getSelection();t.removeAllRanges();let r=document.createRange();r.setStartAfter(e),r.collapse(!0),t.addRange(r)}#O(e,t){let r=this.editor.getRootElement().getBoundingClientRect(),o=e.left-r.left,s=e.top-r.top,i=this.#k(t);return isNaN(i)||(s+=i),{x:o,y:s,fontSize:i}}#k(e){let r=window.getSelection().anchorNode,o=this.#v(r);if(o instanceof HTMLElement){let s=window.getComputedStyle(o);return parseFloat(s.fontSize)}return 0}#v(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#b(){let e=w();if(!v(e)||!e.isCollapsed())return{anchorNode:null,offset:0};let{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#L(e,t){return t===e.getTextContentSize()?this.#D(e):null}#D(e){if(e.getNextSibling()instanceof Eo)return e.getNextSibling();let t=e.getParent();return t?t.getNextSibling():null}#I(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#R(e)}#F(e,t){return t===0?this.#$(e):null}#$(e){return e.getPreviousSibling()instanceof Eo?e.getPreviousSibling():e.getParent().getPreviousSibling()}#P(e,t){return t>0?e.getChildAtIndex(t-1):this.#M(e)}#R(e){let t=e;for(;t&&t.getNextSibling()==null;)t=t.getParent();return t?t.getNextSibling():null}#M(e){let t=e;for(;t&&t.getPreviousSibling()==null;)t=t.getParent();return t?t.getPreviousSibling():null}};function vM(n){return fc.sanitize(n,dM())}function OM(n){return n.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function _N(n){try{return new URL(n),!0}catch{return!1}}function CN(n){return n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function kM(n,e){return CN(n).includes(CN(e))}function xN(n){return n.charAt(0).toUpperCase()+n.slice(1)}var y_=class{#e;#t;constructor(e){this.#e=e,this.#t=new Dl(zn.presets.get("default"),zn.presets.get(e.preset),this.#n)}get(e){return this.#t.get(e)}get#n(){let e={};for(let t of this.#r){let r=OM(t);this.#e.hasAttribute(r)&&(e[t]=this.#s(r))}return e}get#r(){return Object.keys(zn.presets.get("default"))}#s(e){let t=this.#e.getAttribute(e);try{return JSON.parse(t)}catch{return t}}},mr=class extends Eo{static getType(){return"custom_action_text_attachment"}static clone(e){return new mr({...e},e.__key)}static importJSON(e){return new mr({...e})}static importDOM(){return{[this.TAG_NAME]:e=>e.getAttribute("content")?{conversion:t=>{let r=[],o=t.previousSibling;return o&&o.nodeType===Node.TEXT_NODE&&/\s$/.test(o.textContent)&&r.push(ye(" ")),r.push(new mr({sgid:t.getAttribute("sgid"),innerHtml:JSON.parse(t.getAttribute("content")),contentType:t.getAttribute("content-type")})),r.push(ye(" ")),{node:r}},priority:2}:null}}static get TAG_NAME(){return zn.global.get("attachmentTagName")}constructor({tagName:e,sgid:t,contentType:r,innerHtml:o},s){super(s);let i=zn.global.get("attachmentContentTypeNamespace");this.tagName=e||mr.TAG_NAME,this.sgid=t,this.contentType=r||`application/vnd.${i}.unknown`,this.innerHtml=o}createDOM(){let e=se(this.tagName,{"content-type":this.contentType,"data-lexxy-decorator":!0});e.insertAdjacentHTML("beforeend",this.innerHtml);let t=se("lexxy-node-delete-button");return e.appendChild(t),e}updateDOM(){return!1}getTextContent(){return this.createDOM().textContent.trim()||`[${this.contentType}]`}isInline(){return!0}exportDOM(){return{element:se(this.tagName,{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,tagName:this.tagName,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}},b_=class{constructor(e){this.editorElement=e,this.editor=e.editor}monitor(){this.editor.registerCommand(Ur,e=>this.#e(e),Je)}#e(e){let t=w();if(!v(t))return!1;let r=t.anchor.getNode();return this.#r(r)?this.#t(e,r)||this.#n(e,r):!1}#t(e,t){return this.#s(t)||this.#i(t)?(e.preventDefault(),this.#u(t),!0):!1}#n(e,t){return this.#l(t)?(e.preventDefault(),this.#d(t),!0):!1}#r(e){let t=e;for(;t;){if($n(t))return!0;t=t.getParent()}return!1}#s(e){let t=this.#a(e);return t?this.#o(t):!1}#i(e){let t=this.#c(e);if(!t||!this.#o(t))return!1;let r=t.getParent();return r&&$o(r)}#o(e){if(e.getTextContent().trim()!=="")return!1;let t=e.getChildren();return t.length===0?!0:t.every(r=>be(r)?!0:this.#o(r))}#a(e){let t=e;for(;t;){if($o(t))return t;t=t.getParent()}return null}#u(e){let t=this.#a(e);if(!t)return;let r=t.getParent();if(!r||!zt(r))return;let o=r.getParent();if(o&&$n(o)){let l=this.#p(t).filter(c=>!this.#o(c));if(l.length>0){this.#_(o,r,t,l);return}}let i=U();r.insertAfter(i),t.remove(),i.selectStart()}#l(e){let t=this.#c(e);if(!t||!this.#o(t))return!1;let r=t.getParent();return r&&$n(r)}#c(e){let t=e;for(;t;){if(rt(t))return t;t=t.getParent()}return null}#d(e){let t=this.#c(e);if(!t)return;let r=t.getParent();if(!r||!$n(r))return;let s=this.#m(t).filter(i=>!this.#o(i));if(s.length>0)this.#f(r,t,s);else{let i=U();r.insertAfter(i),t.remove(),i.selectStart()}}#m(e){let t=[],r=e.getNextSibling();for(;r;)t.push(r),r=r.getNextSibling();return t}#p(e){let t=[],r=e.getNextSibling();for(;r;)$o(r)&&t.push(r),r=r.getNextSibling();return t}#_(e,t,r,o){let i=this.#m(t).filter(u=>!this.#o(u)),a=U();e.insertAfter(a);let l=Ru(t.getListType()),c=Ii();a.insertAfter(c),c.append(l),o.forEach(u=>{l.append(u)}),i.forEach(u=>{c.append(u)}),r.remove(),this.#h(t),this.#g(c),t.getChildrenSize()===0?(t.remove(),e.getChildrenSize()===0&&e.remove()):this.#g(e),a.selectStart()}#h(e){let t=e.getChildren();for(let r=t.length-1;r>=0;r--){let o=t[r];if($o(o)&&this.#o(o))o.remove();else break}}#g(e){let t=e.getChildren();for(let r=t.length-1;r>=0;r--){let o=t[r];if(this.#o(o))o.remove();else break}}#f(e,t,r){let o=U();e.insertAfter(o);let s=Ii();o.insertAfter(s),r.forEach(i=>{s.append(i)}),t.remove(),this.#g(e),this.#g(s),o.selectStart()}};async function LM(n,e){return new Promise(t=>{let r=new FileReader;e.addEventListener("load",()=>{t(e)}),r.onload=o=>{e.src=o.target.result||null},r.readAsDataURL(n)})}var Ws=class extends Ut{static getType(){return"action_text_attachment_upload"}static clone(e){return new Ws({...e},e.__key)}static importJSON(e){return new Ws({...e})}static importDOM(){return null}constructor(e,t){let{file:r,uploadUrl:o,blobUrlTemplate:s,progress:i,width:a,height:l,uploadError:c}=e;super({...e,contentType:r.type},t),this.file=r,this.uploadUrl=o,this.blobUrlTemplate=s,this.progress=i??null,this.width=a,this.height=l,this.uploadError=c}createDOM(){if(this.uploadError)return this.#t();this.#l();let e=this.createAttachmentFigure();if(this.isPreviewableAttachment){let t=e.appendChild(this.#n());LM(this.file,t).then(r=>this.#a(r))}else e.appendChild(this.#r());return e.appendChild(this.#i()),e.appendChild(this.#o()),e}updateDOM(e,t){if(this.uploadError!==e.uploadError)return!0;if(e.progress!==this.progress){let r=t.querySelector("progress");r.value=this.progress??0}return!1}exportDOM(){return{element:null}}exportJSON(){return{...super.exportJSON(),type:"action_text_attachment_upload",version:1,uploadUrl:this.uploadUrl,blobUrlTemplate:this.blobUrlTemplate,progress:this.progress,width:this.width,height:this.height,uploadError:this.uploadError}}get#e(){return this.progress!==null}#t(){let e=this.createAttachmentFigure();return e.classList.add("attachment--error"),e.appendChild(se("div",{innerText:`Error uploading ${this.file?.name??"file"}`})),e}#n(){return se("img")}#r(){let e=this.#s();return se("span",{className:"attachment__icon",textContent:e})}#s(){return this.file.name.split(".").pop().toLowerCase()}#i(){let e=se("figcaption",{className:"attachment__caption"}),t=se("span",{className:"attachment__name",textContent:this.file.name||""}),r=se("span",{className:"attachment__size",textContent:eE(this.file.size)});return e.appendChild(t),e.appendChild(r),e}#o(){return se("progress",{value:this.progress??0,max:100})}#a({width:e,height:t}){this.#u||this.editor.update(()=>{let r=this.getWritable();r.width=e,r.height=t},{tag:md})}get#u(){return Boolean(this.width&&this.height)}async#l(){if(this.#e)return;this.#d();let{DirectUpload:e}=await import("@rails/activestorage"),t=new e(this.file,this.uploadUrl,this);t.delegate=this.#c(),this.#f("lexxy:upload-start",{file:this.file}),t.create((r,o)=>{r?(this.#f("lexxy:upload-end",{file:this.file,error:r}),this.#_(r)):(this.#f("lexxy:upload-end",{file:this.file,error:null}),this.#h(o))})}#c(){let e=zn.global.get("authenticatedUploads");return{directUploadWillCreateBlobWithXHR:t=>{e&&(t.withCredentials=!0)},directUploadWillStoreFileWithXHR:t=>{e&&(t.withCredentials=!0);let r=o=>this.#m(o);t.upload.addEventListener("progress",r)}}}#d(){this.#p(1)}#m(e){let t=Math.round(e.loaded/e.total*100);this.#p(t),this.#f("lexxy:upload-progress",{file:this.file,progress:t})}#p(e){this.editor.update(()=>{this.getWritable().progress=e},{tag:md})}#_(e){console.warn(`Upload error for ${this.file?.name??"file"}: ${e}`),this.editor.update(()=>{this.getWritable().uploadError=!0},{tag:md})}#h(e){this.editor.update(()=>{this.replace(this.#g(e))},{tag:md})}#g(e){return new S_(this,e).toAttachmentNode()}#f(e,t){let r=this.editor.getElementByKey(this.getKey());r&&jr(r,e,t)}},S_=class{constructor(e,t){this.uploadNode=e,this.blob=t}toAttachmentNode(){return new Ut({...this.uploadNode,...this.#e,src:this.#t})}get#e(){let{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}}get#t(){return this.blob.previewable?this.blob.url:this.#n}get#n(){return this.uploadNode.blobUrlTemplate.replace(":signed_id",this.blob.signed_id).replace(":filename",encodeURIComponent(this.blob.filename))}};function RM(...n){return new Ws(...n)}var eh,tE,th,nE,qi,yd,Ml=class extends Ye{constructor(){super(...arguments);k(this,th);k(this,qi)}$config(){return this.config("image_gallery",{extends:Ye})}static transform(){return t=>{t.unwrapEmptyNode()||t.replaceWithSingularChild()||t.splitAroundInvalidChild()}}static importDOM(){return{div:t=>t.querySelector(`:scope > :is(${R(this,eh,tE).join()})`)?{conversion:()=>({node:wd(),after:o=>wi(o,this.isValidChild)}),priority:2}:null}}static canCollapseWith(t){return Z_(t)||this.isValidChild(t)}static isValidChild(t){return Ad(t)&&t.isPreviewableImage}createDOM(){let t=document.createElement("div");return t.className=R(this,qi,yd),t}updateDOM(t,r){return r.className=R(this,qi,yd),!1}canBeEmpty(){return!0}collapseAtStart(t){return!0}insertNewAfter(t,r){if(t.anchor.getNode().is(this)&&t.anchor.offset==this.getChildrenSize()-1){let i=U();return this.insertAfter(i,!1),i.insertAfter(this.getLastChild(),!1),i.selectEnd(),null}let s=wd();return this.insertAfter(s,r),s}getImageAttachments(){return this.getChildren().filter(Ad)}exportDOM(){let t=document.createElement("div");return t.className=R(this,qi,yd),{element:t}}collapseWith(t,r){return Ml.canCollapseWith(t)?(r?Za(this,t):this.append(t),Ja(this,Ml.isValidChild),!0):!1}unwrapEmptyNode(){if(this.isEmpty()){let t=U();return this.replace(t)}}replaceWithSingularChild(){if(R(this,th,nE)){let t=this.getFirstChild();return this.replace(t)}}splitAroundInvalidChild(){for(let t of Np(this)){if(Ml.isValidChild(t))continue;let r=gM(t),[o,s]=this.splitAtIndex(r.getIndexWithinParent());o.insertAfter(r),r.selectEnd(),s.isEmpty()&&s.remove();break}}splitAtIndex(t){return tu(this,t)}},Kn=Ml;eh=new WeakSet,tE=function(){return Object.keys(Ut.importDOM())},th=new WeakSet,nE=function(){return this.getChildrenSize()===1},qi=new WeakSet,yd=function(){return`attachment-gallery attachment-gallery--${this.getChildrenSize()}`},k(Kn,eh);function wd(){return new Kn}function Z_(n){return n instanceof Kn}function rE(n){return Kn.canCollapseWith(n)?nr(n,Kn)??Su(n,wd):null}var Gs=class{#e;static for(e,t){let r=Gi.handle(e,t)?Gi:Gs;return new r(e,t)}constructor(e,t){this.#e=t,this.editorElement=e,this.contents=e.contents,this.selection=e.selection}get files(){return Array.from(this.#e)}$uploadFiles(){this.$createUploadNodes(),this.$insertUploadNodes()}$createUploadNodes(){this.nodes=this.files.map(e=>RM({...this.#t,file:e,contentType:e.type}))}$insertUploadNodes(){this.nodes.forEach(this.contents.insertAtCursor)}get#t(){return{uploadUrl:this.editorElement.directUploadUrl,blobUrlTemplate:this.editorElement.blobUrlTemplate}}},gr,nh,oE,rh,sE,oh,iE,Wl,T_,sh,aE,ih,lE,ah,cE,lh,uE,ch,dE,Gi=class extends Gs{constructor(){super(...arguments);k(this,oh);k(this,Wl);k(this,sh);k(this,ih);k(this,ah);k(this,lh);k(this,ch);k(this,gr,void 0)}static handle(t,r){return L(this,nh,oE).call(this,r)||L(this,rh,sE).call(this,t.selection)}$insertUploadNodes(){L(this,oh,iE).call(this),L(this,lh,uE).call(this),L(this,ch,dE).call(this)}};gr=new WeakMap,nh=new WeakSet,oE=function(t){let r=0;for(let o of t)if(vm(o.type)&&r++,r>1)return!0;return!1},rh=new WeakSet,sE=function(t){if(t.isOnPreviewableImage)return!0;let{node:r}=t.selectedNodeWithOffset();return nr(r,Kn)!==null},oh=new WeakSet,iE=function(){this.selection.isOnPreviewableImage?ra(this,gr,rE(R(this,Wl,T_))):(ra(this,gr,wd()),this.contents.insertAtCursor(R(this,gr)))},Wl=new WeakSet,T_=function(){let{node:t}=this.selection.selectedNodeWithOffset();return t},sh=new WeakSet,aE=function(){let t=w()?.anchor;if(t?.getNode().is(R(this,gr)))return t.offset;let o=R(this,Wl,T_),s=R(this,gr).isParentOf(o)&&o.getIndexWithinParent();return s!==!1?s+1:0},ih=new WeakSet,lE=function(){return this.nodes.filter(t=>Kn.isValidChild(t))},ah=new WeakSet,cE=function(){return this.nodes.filter(t=>!Kn.isValidChild(t))},lh=new WeakSet,uE=function(){R(this,gr).splice(R(this,sh,aE),0,R(this,ih,lE))},ch=new WeakSet,dE=function(){let t=R(this,gr);for(let r of R(this,ah,cE))t.insertAfter(r),t=r},k(Gi,nh),k(Gi,rh);var N_=class{constructor(e){this.editorElement=e,this.editor=e.editor,new b_(e).monitor()}insertHtml(e,{tag:t}={}){this.insertDOM(Os(e),{tag:t})}insertDOM(e,{tag:t}={}){this.editor.update(()=>{let r=w();if(!v(r))return;let o=bs(this.editor,e);this.#e(o)||r.insertNodes(o)},{tag:t})}insertAtCursor(e){let t=w()??Be().selectEnd(),r=t?.getNodes();v(t)?t.insertNodes([e]):Ke(t)&&r.length>0&&r.at(-1).insertAfter(e)}insertAtCursorEnsuringLineBelow(e){this.insertAtCursor(e),this.#t(e)}insertNodeWrappingEachSelectedLine(e){this.editor.update(()=>{let t=w();if(!v(t))return;t.extract().forEach(o=>{if(!o.getParent())return;let i=o.getTopLevelElementOrThrow(),a=e();a.append(...i.getChildren()),i.replace(a)})})}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update(()=>{let r=w();if(!v(r))return;let o=r.anchor.getNode().getTopLevelElementOrThrow();e(o)?this.removeFormattingFromSelectedLines():this.#a(t)})}toggleNodeWrappingAllSelectedNodes(e,t){this.editor.update(()=>{let r=w();if(!v(r))return;let o=r.anchor.getNode().getTopLevelElement();o&&e(o)?this.#n(o):this.#r(t)})}removeFormattingFromSelectedLines(){this.editor.update(()=>{let e=w();if(!v(e))return;let t=e.anchor.getNode().getTopLevelElementOrThrow(),r=U();r.append(...t.getChildren()),t.replace(r)})}hasSelectedText(){let e=!1;return this.editor.read(()=>{let t=w();e=v(t)&&!t.isCollapsed()}),e}unwrapSelectedListItems(){this.editor.update(()=>{let e=w();if(!v(e))return;let{listItems:t,parentLists:r}=this.#g(e);if(t.size>0){let o=this.#f(t);this.#T(r),this.#N(o)}})}createLink(e){let t=null;return this.editor.update(()=>{let r=ye(e),o=Pu(e);o.append(r);let s=w();v(s)&&(s.insertNodes([o]),t=o.getKey())}),t}createLinkWithSelectedText(e){!this.hasSelectedText()||this.editor.update(()=>{Li(null),Li(e)})}textBackUntil(e){let t="";return this.editor.getEditorState().read(()=>{let r=w();if(!r||!r.isCollapsed())return;let o=r.anchor,s=o.getNode();if(!B(s))return;let i=s.getTextContent(),a=o.offset,l=i.slice(0,a),c=l.lastIndexOf(e);c!==-1&&(t=l.slice(c+e.length))}),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read(()=>{let r=w();if(!r||!r.isCollapsed())return;let o=r.anchor,s=o.getNode();if(!B(s))return;let i=s.getTextContent(),a=o.offset;t=i.slice(0,a).includes(e)}),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update(()=>{let{anchorNode:r,offset:o}=this.#A();if(!r)return;let s=this.#S(r,o,e);s!==-1&&this.#w(r,o,s,t)})}createParagraphAfterNode(e,t){let r=U();e.insertAfter(r),r.selectStart(),t&&(r.append(ye(t)),r.select(1,1))}createParagraphBeforeNode(e,t){let r=U();e.insertBefore(r),r.selectStart(),t&&(r.append(ye(t)),r.select(1,1))}uploadFiles(e,{selectLast:t}={}){if(!this.editorElement.supportsAttachments){console.warn("This editor does not supports attachments (it's configured with [attachments=false])");return}let r=Array.from(e).filter(this.#L.bind(this));this.editor.update(()=>{let o=Gs.for(this.editorElement,r);o.$uploadFiles(),t&&o.nodes?.length&&o.nodes.at(-1).selectEnd()})}replaceNodeWithHTML(e,t,r={}){this.editor.update(()=>{let o=Fe(e);if(!o)return;let s=w(),i=!1;if(v(s)){let l=s.getNodes();i=l.includes(o)||l.some(c=>c.getParent()===o),i&&De(null)}let a=r.attachment?this.#v(t,r.attachment):this.#b(t);o.replace(a),i&&a.selectEnd()})}insertHTMLBelowNode(e,t,r={}){this.editor.update(()=>{let o=Fe(e);if(!o)return;let s=o.getTopLevelElement()||o,i=r.attachment?this.#v(t,r.attachment):this.#b(t);s.insertAfter(i)})}#e(e){if(e.every(Ad)){let t=Gs.for(this.editorElement,[]);return t.nodes=e,t.$insertUploadNodes(),!0}}#t(e){this.editor.update(()=>{if(!e.getNextSibling()){let r=U();e.insertAfter(r),r.selectStart()}})}#n(e){let t=e.getChildren();t.length==0?e.insertBefore(U()):t.forEach(r=>{if(B(r)&&r.getTextContent().trim()!==""){let o=U();o.append(r),e.insertBefore(o)}else be(r)||e.insertBefore(r)}),e.remove()}#r(e){this.editor.update(()=>{let t=w();if(!v(t))return;let r=t.extract();if(r.length===0)return;let o=new Set;r.forEach(a=>{let l=a.getTopLevelElementOrThrow();o.add(l)});let s=this.#s(Array.from(o));if(s.length===0){this.#o(),this.insertAtCursor(e());return}let i=e();s[0].insertBefore(i),s.forEach(a=>{i.append(a)})})}#s(e){let t=e.length-1;for(;t>=0;){let r=e[t];if(!rt(r)||!this.#i(r))break;t--}return e.slice(0,t+1)}#i(e){if(e.getTextContent().trim()!=="")return!1;let t=e.getChildren();return t.length===0||t.every(r=>be(r))}#o(){let e=Be();if(e.getChildrenSize()===1){let t=e.getFirstChild();t&&rt(t)&&this.#i(t)&&t.remove()}}#a(e){this.editor.update(()=>{let t=w();!v(t)||(t.isCollapsed()?this.#u(t,e):this.#l(t,e))})}#u(e,t){let o=e.anchor.getNode().getTopLevelElementOrThrow();if(o.getTextContent()){let s=t();s.append(...o.getChildren()),o.replace(s)}else e.insertNodes([t()])}#l(e,t){let r=this.#c(e);if(r.length===0)return;let{lineSet:o,nodesToDelete:s}=this.#m(r);if(o.size===0)return;let i=this.#p(t,o);this.#_(e,i),this.#h(s)}#c(e){let r=e.extract().map(o=>this.#d(o)).filter(Boolean);return De(null),r}#d(e){return rt(e)?e:B(e)&&e.getParent()&&rt(e.getParent())?e.getParent():null}#m(e){let t=new Set,r=new Set;return e.forEach(o=>{let s=o.getTextContent();s&&s.split(`
`).forEach(i=>{i.trim()&&t.add(i)}),r.add(o)}),{lineSet:t,nodesToDelete:r}}#p(e,t){let r=e(),o=Array.from(t);return o.forEach((s,i)=>{r.append(ye(s)),i<o.length-1&&r.append(pt())}),r}#_(e,t){let o=e.anchor.getNode().getParent();o&&o.replace(t)}#h(e){e.forEach(t=>t.remove())}#g(e){let t=e.getNodes(),r=new Set,o=new Set;for(let s of t){let i=nr(s,Po);if(i){r.add(i);let a=i.getParent();a&&zt(a)&&o.add(a)}}return{listItems:r,parentLists:o}}#f(e){let t=[];for(let r of e){let o=this.#C(r);o&&t.push(o)}return t}#C(e){let t=e.getParent();if(!t||!zt(t))return null;let r=U(),o=this.#y(e,r);return e.insertAfter(r),this.#x(r,o),e.remove(),r}#y(e,t){let r=[];return e.getChildren().forEach(o=>{zt(o)?r.push(o):t.append(o)}),r}#x(e,t){t.forEach(r=>{e.insertAfter(r)})}#T(e){for(let t of e)zt(t)&&t.getChildrenSize()===0&&t.remove()}#N(e){if(e.length===0)return;let t=e[0],r=e[e.length-1];e.length===1?t.selectEnd():this.#E(t,r)}#E(e,t){e.selectStart();let r=w();r&&v(r)&&(r.anchor.set(e.getKey(),0,"element"),r.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#A(){let e=w();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};let t=e.anchor,r=t.getNode();return B(r)?{anchorNode:r,offset:t.offset}:{anchorNode:null,offset:0}}#S(e,t,r){return e.getTextContent().slice(0,t).lastIndexOf(r)}#w(e,t,r,o){let s=e.getTextContent(),i=s.slice(0,r),a=s.slice(t),l=ye(i),c=ye(a||" ");e.replace(l),this.#O(l,o).insertAfter(c),this.#k(c.getParentOrThrow());let d=a?0:1;c.select(d,d)}#O(e,t){let r=e;for(let o of t)r.insertAfter(o),r=o;return r}#k(e){if(rt(e)&&this.editorElement.supportsMultiLine){let t=e.getChildren(),r=t[t.length-1],o=t[t.length-2];B(r)&&r.getTextContent()===""&&o&&!B(o)&&e.append(pt())}}#v(e,t={}){let r=typeof t=="object"?t:{};return new mr({sgid:r.sgid||null,contentType:"text/html",innerHtml:e})}#b(e){return bs(this.editor,Os(e))[0]||U()}#L(e){return jr(this.editorElement,"lexxy:file-accept",{file:e},!0)}},E_=class{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){let t=e.clipboardData;return!t||this.#r()?!1:this.#e(t)?(this.#s(t),e.preventDefault(),!0):this.#u(t)}#e(e){return this.#t(e)||this.#n(e)}#t(e){let t=Array.from(e.types);return t.length===1&&t[0]==="text/plain"}#n(e){let t=Array.from(e.types);return t.length===2&&t.includes("text/uri-list")&&t.includes("text/plain")}#r(){let e=!1;return this.editor.getEditorState().read(()=>{let t=w();if(!v(t))return;let r=t.anchor.getNode();for(;r;){if(Ko(r)){e=!0;return}r=r.getParent()}}),e}#s(e){e.items[0].getAsString(r=>{if(_N(r)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(r);else if(_N(r)){let o=this.contents.createLink(r);this.#i(o,{url:r})}else this.editorElement.supportsMarkdown?this.#o(r):this.#a(e)})}#i(e,t){let r={replaceLinkWith:(o,s)=>this.contents.replaceNodeWithHTML(e,o,s),insertBelowLink:(o,s)=>this.contents.insertHTMLBelowNode(e,o,s)};jr(this.editorElement,"lexxy:insert-link",{...t,...r})}#o(e){let t=we(e),r=Os(t),o=Object.freeze({markdown:e,document:r,addBlockSpacing:()=>uT(r)});jr(this.editorElement,"lexxy:insert-markdown",o),this.contents.insertDOM(r,{tag:Wr})}#a(e){this.editor.update(()=>{let t=w();rl(e,t,this.editor)},{tag:Wr})}#u(e){if(!this.editorElement.supportsAttachments)return!1;let t=e.getData("text/html");return t?(this.contents.insertHtml(t,{tag:Wr}),!0):(this.#l(()=>{let r=e.files;r.length&&this.contents.uploadFiles(r,{selectLast:!0})}),!0)}async#l(e){let t=window.scrollY,r=window.scrollX;e(),await Us(),window.scrollTo(r,t),this.editor.focus()}},A_=class{constructor(e){this.lexxyElement=e,this.enabledExtensions=this.#r()}get lexicalExtensions(){return this.enabledExtensions.map(e=>e.lexicalExtension).filter(Boolean)}initializeToolbars(){this.#e&&this.enabledExtensions.forEach(e=>e.initializeToolbar(this.#e))}get#e(){return this.lexxyElement.toolbar}get#t(){return this.lexxyElement.baseExtensions}get#n(){return zn.global.get("extensions")}#r(){return this.#t.concat(this.#n).map(t=>new t(this.lexxyElement)).filter(t=>t.enabled)}},_r=class extends Ga{$config(){return this.config("provisonal_paragraph",{extends:Ga,importDOM:()=>null,$transform:e=>{e.concretizeIfEdited(e),e.removeUnlessRequired(e)}})}static neededBetween(e,t){return!yN(e,"next")&&!yN(t,"previous")}createDOM(e){let t=super.createDOM(e),r=this.isSelected(w());return t.classList.add("provisional-paragraph"),t.classList.toggle("hidden",!r),t}updateDOM(e,t){let r=this.isSelected(w());return t.classList.toggle("hidden",!r),!1}getTextContent(){return""}exportDOM(){return{element:null}}isSelected(e=null){return(e||w())?.getNodes().some(r=>r.is(this)||this.isParentOf(r))}removeUnlessRequired(e=this.getLatest()){e.required||e.remove()}concretizeIfEdited(e=this.getLatest()){e.getTextContentSize()>0&&e.replace(U(),!0)}get required(){return this.isDirectRootChild&&_r.neededBetween(...this.immediateSiblings)}get isDirectRootChild(){let e=this.getParent();return Ze(e)}get immediateSiblings(){return[this.getPreviousSibling(),this.getNextSibling()]}};function MM(n){return n instanceof _r}function yN(n,e){return F(n)&&(e==="next"?n.canInsertTextBefore():n.canInsertTextAfter())}var w_=class extends Ks{get lexicalExtension(){return ue({name:"lexxy/provisional-paragraph",nodes:[_r],register(e){return Ee(e.registerNodeTransform(Va,DM),e.registerNodeTransform(Va,IM),e.registerCommand(er,$M,Je))}})}};function DM(n){let e=n.getFirstChild();_r.neededBetween(null,e)&&Za(n,new _r);for(let t of Np(n)){let r=t.getNextSibling();_r.neededBetween(t,r)&&t.insertAfter(new _r)}}function IM(n){for(let e of hE(n))e.removeUnlessRequired()}function $M(){for(let n of hE())n.markDirty()}function hE(n=Be()){return wi(n.getChildren(),MM)}var gE="language",v_=class extends Ks{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return ue({name:"lexxy/trix-content",html:{import:{em:e=>d_(e,{conversion:wl("i",vl),priority:1}),span:e=>d_(e,{conversion:wl("mark",vl),priority:1}),strong:e=>d_(e,{conversion:wl("b",vl),priority:1}),del:()=>({conversion:wl("s",PM,vl),priority:1}),pre:e=>FM(e,{conversion:jN(Uo,"pre",BM),priority:1})}}})}};function d_(n,e){return n.style.color!==""||n.style.backgroundColor!==""?e:null}function PM(n){return n.hasFormat("strikethrough")||n.toggleFormat("strikethrough"),n}function FM(n,e){return n.hasAttribute(gE)?e:null}function BM(n,e){let t=Cm(e.getAttribute(gE));n.node.setLanguage(t)}var Rl=class extends yl{$config(){return this.config("wrapped_table_node",{extends:yl})}static importDOM(){return super.importDOM()}exportDOM(e){let t=super.exportDOM(e);return{...t,after:r=>{if(t.after){r=t.after(r);let o=r.cloneNode(!0);return se("figure",{className:"lexxy-content__table-wrapper"},o.outerHTML)}return r}}}},O_=class extends Ks{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return ue({name:"lexxy/tables",nodes:[Rl,{replace:yl,with:()=>new Rl,withKlass:Rl},Ki,GT],register(e){return Ee(VT(e),YT(e,!0),jT(e,!0),e.registerNodeTransform(Ki,t=>{t.getBackgroundColor()===null&&t.setBackgroundColor("")}),e.registerNodeTransform(Ki,t=>{let r=t.getHeaderStyles();if(r!==dr.ROW)return;let o=t.getParent(),s=o?.getParent();if(!s)return;let i=s.getChildren(),a=o.getChildren().indexOf(t),c=o.getChildren().every(h=>h.getHeaderStyles()!==dr.NO_STATUS),u=i.every(h=>{let g=h.getChildren()[a];return g&&g.getHeaderStyles()!==dr.NO_STATUS}),d=dr.NO_STATUS;c&&(d|=dr.ROW),u&&(d|=dr.COLUMN),d!==r&&t.setHeaderStyles(d,dr.BOTH)}),e.registerCommand("insertTableRowAfter",()=>{Jm(!0)},cn),e.registerCommand("insertTableRowBefore",()=>{Jm(!1)},cn),e.registerCommand("insertTableColumnAfter",()=>{Zm(!0)},cn),e.registerCommand("insertTableColumnBefore",()=>{Zm(!1)},cn),e.registerCommand("deleteTableRow",()=>{HT()},cn),e.registerCommand("deleteTableColumn",()=>{BT()},cn),e.registerCommand("deleteTable",()=>{let t=w();if(!v(t))return!1;qm(t.anchor.getNode())?.remove()},cn))}})}},k_=class extends Ks{get enabled(){return this.editorElement.supportsAttachments}get lexicalExtension(){return ue({name:"lexxy/action-text-attachments",nodes:[Ut,Ws,Kn],register(e){return Ee(e.registerCommand(un,HM,cn))}})}};function HM(n){let e=w()?.anchor;return e?KM(e,n)?!0:n?zM(e)||UM(e):!1:!1}function zM(n){let e=n.getNode();if(!e)return!1;let t=rt(e)&&e.isEmpty(),r=e.getPreviousSibling(),o=rE(r),s=o?.getChildrenSize();return t&&o?.collapseWith(e.getNextSibling())?(o.select(s,s),e.remove(),!0):!1}function KM(n,e){let t=n.getNode();if(!Z_(t))return!1;let r=Nd(n,e),o=e?t.getPreviousSibling():t.getNextSibling();if(r&&t.collapseWith(o,e)){let s=e?1:t.getChildrenSize()-1;return t.select(s,s),!0}else return!1}function UM(n){let e=n.getNode().getPreviousSibling();return!Z_(n.getNode())||!Nd(n,!0)||!e||Et(e)?!1:(e.isEmpty()?e.remove():e.selectEnd(),!0)}var Gl,Yo,uh,fE,dh,pE,hh,mE,gh,_E,fh,CE,ph,xE,mh,yE,_h,bE,Ch,SE,zs,TE,L_,xh,NE,yh,EE,Vl,bh,AE,Sh,wE,Th,vE,Nh,OE,Eh,kE,Ah,LE,wh,RE,vh,ME,Oh,DE,kh,IE,Lh,$E,Yl,R_,Rh,PE,Mh,FE,Dh,BE,Ih,HE,$h,zE,jl,M_,Ph,KE,ql,D_,Zl,I_,Jl,$_,Fh,UE,Ps=class extends HTMLElement{constructor(){super();k(this,uh);k(this,dh);k(this,hh);k(this,gh);k(this,fh);k(this,ph);k(this,mh);k(this,_h);k(this,Ch);k(this,zs);k(this,xh);k(this,yh);k(this,bh);k(this,Sh);k(this,Th);k(this,Nh);k(this,Eh);k(this,Ah);k(this,wh);k(this,vh);k(this,Oh);k(this,kh);k(this,Lh);k(this,Yl);k(this,Rh);k(this,Mh);k(this,Dh);k(this,Ih);k(this,$h);k(this,jl);k(this,Ph);k(this,ql);k(this,Zl);k(this,Jl);k(this,Fh);k(this,Gl,"");k(this,Yo,document.createElement("textarea"));k(this,Vl,t=>{L(this,Jl,$_).call(this)});this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=td("lexxy-editor"),this.config=new y_(this),this.extensions=new A_(this),this.editor=L(this,fh,CE).call(this),this.contents=new N_(this),this.selection=new x_(this),this.clipboard=new E_(this),Il.configureFor(this),L(this,gh,_E).call(this),requestAnimationFrame(()=>jr(this,"lexxy:initialize")),this.toggleAttribute("connected",!0),L(this,Mh,FE).call(this),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,L(this,Jl,$_).call(this)}attributeChangedCallback(t,r,o){t==="connected"&&this.isConnected&&r!=null&&r!==o&&requestAnimationFrame(()=>L(this,Fh,UE).call(this)),t==="required"&&this.isConnected&&(R(this,Yo).required=this.hasAttribute("required"),L(this,Zl,I_).call(this))}formResetCallback(){this.value=R(this,Gl),this.editor.dispatchCommand(ru,void 0)}toString(){return this.cachedStringValue||this.editor?.getEditorState().read(()=>{this.cachedStringValue=Be().getTextContent()}),this.cachedStringValue}get form(){return this.internals.form}get name(){return this.getAttribute("name")}get toolbarElement(){return R(this,jl,M_)?(this.toolbar=this.toolbar||L(this,$h,zE).call(this),this.toolbar):null}get baseExtensions(){return[w_,C_,v_,O_,k_]}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isEmpty(){return["<p><br></p>","<p></p>",""].includes(this.value.trim())}get isBlank(){return this.isEmpty||this.toString().match(/^\s*$/g)!==null}get hasOpenPrompt(){return this.querySelector(".lexxy-prompt-menu.lexxy-prompt-menu--visible")!==null}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")}get isSingleLineMode(){return this.hasAttribute("single-line")}get contentTabIndex(){return parseInt(this.editorContentElement?.getAttribute("tabindex")??"0")}focus(){this.editor.focus(()=>L(this,Rh,PE).call(this))}get value(){return this.cachedValue||this.editor?.getEditorState().read(()=>{this.cachedValue=vM(Bu(this.editor,null))}),this.cachedValue}set value(t){this.editor.update(()=>{Xy(ip);let r=Be();r.clear(),r.append(...L(this,uh,fE).call(this,t)),r.selectEnd(),L(this,ql,D_).call(this),requestAnimationFrame(()=>this.editor?.update(()=>{}))})}};Gl=new WeakMap,Yo=new WeakMap,uh=new WeakSet,fE=function(t){return t||(t="<p></p>"),bs(this.editor,Os(`${t}`)).map(L(this,dh,pE)).map(L(this,hh,mE))},dh=new WeakSet,pE=function(t){if(!B(t))return t;let r=U();return r.append(t),r},hh=new WeakSet,mE=function(t){if(rt(t)&&t.getChildrenSize()===1){let r=t.getFirstChild();if(Et(r)&&!r.isInline())return r}return t},gh=new WeakSet,_E=function(){L(this,bh,AE).call(this),L(this,Eh,kE).call(this),L(this,vh,ME).call(this),L(this,Oh,DE).call(this),L(this,Dh,BE).call(this),L(this,Ih,HE).call(this),L(this,xh,NE).call(this),L(this,yh,EE).call(this)},fh=new WeakSet,CE=function(){this.editorContentElement||=L(this,mh,yE).call(this);let t=$b({name:"lexxy/core",namespace:"Lexxy",theme:$s,nodes:R(this,ph,xE)},...this.extensions.lexicalExtensions);return t.setRootElement(this.editorContentElement),t},ph=new WeakSet,xE=function(){let t=[mr];return this.supportsRichText&&t.push(Uu,Ku,Fo,Po,Uo,S0,nl,SS,Zo),t},mh=new WeakSet,yE=function(){let t=se("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":R(this,_h,bE),placeholder:this.getAttribute("placeholder")});return t.id=`${this.id}-content`,R(this,Ch,SE).forEach(r=>t.setAttribute(r.name,r.value)),this.appendChild(t),this.getAttribute("tabindex")?(t.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):t.setAttribute("tabindex",0),t},_h=new WeakSet,bE=function(){return Array.from(this.internals.labels).map(t=>t.textContent).join(" ")},Ch=new WeakSet,SE=function(){return Array.from(this.attributes).filter(t=>t.name.startsWith("aria-"))},zs=new WeakSet,TE=function(t){let r=R(this,zs,L_)!==void 0&&R(this,zs,L_)!==this.value;this.internals.setFormValue(t),this._internalFormValue=t,R(this,Yo).value=this.isEmpty?"":t,r&&jr(this,"lexxy:change")},L_=function(){return this._internalFormValue},xh=new WeakSet,NE=function(){let t=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=ra(this,Gl,t)},yh=new WeakSet,EE=function(){document.addEventListener("turbo:before-cache",R(this,Vl))},Vl=new WeakMap,bh=new WeakSet,AE=function(){L(this,Th,vE).call(this,this.editor.registerUpdateListener(({editorState:t})=>{L(this,Sh,wE).call(this),ra(this,zs,this.value,TE),L(this,ql,D_).call(this),L(this,Zl,I_).call(this)}))},Sh=new WeakSet,wE=function(){this.cachedValue=null,this.cachedStringValue=null},Th=new WeakSet,vE=function(t){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(t)},Nh=new WeakSet,OE=function(){this.unregisterHandlers?.forEach(t=>{t()}),this.unregisterHandlers=null},Eh=new WeakSet,kE=function(){this.supportsRichText?(XS(this.editor),uS(this.editor),L(this,Ah,LE).call(this),L(this,wh,RE).call(this),this.supportsMarkdown&&rT(this.editor,nT)):WS(this.editor),this.historyState=aT(),lT(this.editor,this.historyState,20)},Ah=new WeakSet,LE=function(){this.tableTools=se("lexxy-table-tools"),this.append(this.tableTools)},wh=new WeakSet,RE=function(){T0(this.editor),this.codeLanguagePicker=se("lexxy-code-language-picker"),this.append(this.codeLanguagePicker)},vh=new WeakSet,ME=function(){this.editor.registerCommand(Ur,t=>t.ctrlKey||t.metaKey||!this.supportsMultiLine?(t.preventDefault(),!0):!1,cn)},Oh=new WeakSet,DE=function(){this.addEventListener("focusin",L(this,kh,IE)),this.addEventListener("focusout",L(this,Lh,$E))},kh=new WeakSet,IE=function(t){L(this,Yl,R_).call(this,t.target)&&!this.currentlyFocused&&(jr(this,"lexxy:focus"),this.currentlyFocused=!0)},Lh=new WeakSet,$E=function(t){L(this,Yl,R_).call(this,t.relatedTarget)||(jr(this,"lexxy:blur"),this.currentlyFocused=!1)},Yl=new WeakSet,R_=function(t){return this.contains(t)||this.toolbarElement?.contains(t)},Rh=new WeakSet,PE=function(){this.isEmpty&&this.selection.placeCursorAtTheEnd()},Mh=new WeakSet,FE=function(){document.querySelector(":focus")||this.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===this&&this.focus()},Dh=new WeakSet,BE=function(){},Ih=new WeakSet,HE=function(){R(this,jl,M_)&&(this.toolbarElement.setEditor(this),this.extensions.initializeToolbars())},$h=new WeakSet,zE=function(){let t=this.config.get("toolbar");return t&&t!==!0?document.getElementById(t):L(this,Ph,KE).call(this)},jl=new WeakSet,M_=function(){return this.supportsRichText&&this.config.get("toolbar")},Ph=new WeakSet,KE=function(){let t=se("lexxy-toolbar");return t.innerHTML=Ll.defaultTemplate,t.setAttribute("data-attachments",this.supportsAttachments),this.prepend(t),t},ql=new WeakSet,D_=function(){this.classList.toggle("lexxy-editor--empty",this.isEmpty)},Zl=new WeakSet,I_=function(){R(this,Yo).validity.valid?this.internals.setValidity({}):this.internals.setValidity(R(this,Yo).validity,R(this,Yo).validationMessage,this.editorContentElement)},Jl=new WeakSet,$_=function(){L(this,Nh,OE).call(this),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.codeLanguagePicker&&(this.codeLanguagePicker.remove(),this.codeLanguagePicker=null),this.tableHandler&&(this.tableHandler.remove(),this.tableHandler=null),this.selection=null,document.removeEventListener("turbo:before-cache",R(this,Vl))},Fh=new WeakSet,UE=function(){this.disconnectedCallback(),this.valueBeforeDisconnect=null,this.connectedCallback()},nn(Ps,"formAssociated",!0),nn(Ps,"debug",!1),nn(Ps,"commands",["bold","italic","strikethrough"]),nn(Ps,"observedAttributes",["connected","required"]);var vd=class extends HTMLElement{connectedCallback(){this.container=this.closest("details"),this.container.addEventListener("toggle",this.#t.bind(this)),this.container.addEventListener("keydown",this.#r.bind(this)),this.#e(this.initialize.bind(this))}disconnectedCallback(){this.container.removeEventListener("keydown",this.#r.bind(this))}get toolbar(){return this.closest("lexxy-toolbar")}get editorElement(){return this.toolbar.editorElement}get editor(){return this.toolbar.editor}initialize(){}close(){this.editor.focus(),this.container.open=!1}async#e(e){await this.toolbar.editorConnected,e()}#t(){this.container.open&&this.#n()}async#n(){this.#i[0].focus(),this.#s()}#r(e){e.key==="Escape"&&(e.stopPropagation(),this.close())}async#s(){await Us(),this.#o.forEach((e,t)=>{e.setAttribute("tabindex",t===0?0:"-1")})}get#i(){return Array.from(this.querySelectorAll("button, input"))}get#o(){return Array.from(this.querySelectorAll("button"))}},P_=class extends vd{connectedCallback(){super.connectedCallback(),this.input=this.querySelector("input"),this.#e()}#e(){this.container.addEventListener("toggle",this.#t.bind(this)),this.addEventListener("submit",this.#n.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#r.bind(this))}#t({newState:e}){this.input.value=this.#s,this.input.required=e==="open"}#n(e){let t=e.submitter?.value;this.editor.dispatchCommand(t,this.input.value),this.close()}#r(){this.editor.dispatchCommand("unlink"),this.close()}get#s(){let e="";return this.editor.getEditorState().read(()=>{let t=w();if(!v(t))return;let r=t.getNodes()[0];for(;r&&r.getParent();){if(Fu(r)){e=r.getURL();break}r=r.getParent()}}),e}},bN="button.lexxy-highlight-button",SN="[data-command='removeHighlight']",_d=Symbol("no_style"),F_=class extends vd{connectedCallback(){super.connectedCallback(),this.#e()}initialize(){this.#n(),this.#t()}#e(){this.container.addEventListener("toggle",this.#i.bind(this))}#t(){this.#c.forEach(e=>e.addEventListener("click",this.#o.bind(this))),this.querySelector(SN).addEventListener("click",this.#a.bind(this))}#n(){let e=this.editorElement.config.get("highlight.buttons");this.#r("color",e.color),this.#r("background-color",e["background-color"]);let t=Math.max(e.color.length,e["background-color"].length);this.style.setProperty("--max-colors",t)}#r(e,t){t.forEach((r,o)=>{this.#l.appendChild(this.#s(e,r,o))})}#s(e,t,r){let o=document.createElement("button");return o.dataset.style=e,o.style.setProperty(e,t),o.dataset.value=t,o.classList.add("lexxy-editor__toolbar-button","lexxy-highlight-button"),o.name=e+"-"+r,o}#i({newState:e}){e==="open"&&this.editor.getEditorState().read(()=>{this.#u(w())})}#o(e){e.preventDefault();let t=e.target.closest(bN);if(!t)return;let r=t.dataset.style,o=t.dataset.value;this.editor.dispatchCommand("toggleHighlight",{[r]:o}),this.close()}#a(e){e.preventDefault(),this.editor.dispatchCommand("removeHighlight"),this.close()}#u(e){if(!v(e))return;let t=_u(e,"color",_d),r=_u(e,"background-color",_d);this.#c.forEach(s=>{let i=s.dataset.value===t||s.dataset.value===r;s.setAttribute("aria-pressed",i)});let o=t!==_d||r!==_d;this.querySelector(SN).disabled=!o}get#l(){return this.querySelector(".lexxy-highlight-colors")}get#c(){return Array.from(this.querySelectorAll(bN))}},Od=class{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){let r=e.querySelector("template[type='menu']").content.cloneNode(!0),o=se("li",{role:"option",id:td("prompt-item"),tabindex:"0"});return o.classList.add("lexxy-prompt-menu__item"),o.appendChild(r),o}async loadPromptItemsFromUrl(e){try{let r=await(await fetch(e)).text(),o=Os(r).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(o))}catch(t){return Promise.reject(t)}}},kd=class extends Od{async buildListItems(e=""){let t=await this.fetchPromptItems();return this.#e(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#e(e,t){let r=[];return this.promptItemByListItem=new WeakMap,e.forEach(o=>{let s=o.getAttribute("search");if(!t||kM(s,t)){let i=this.buildListItemElementFor(o);this.promptItemByListItem.set(i,o),r.push(i)}}),r}},B_=class extends kd{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}},H_=class extends kd{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}},WM=200,z_=class extends Od{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=AM(this.fetchFilteredListItems.bind(this),WM)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){let t=await this.loadPromptItemsFromUrl(this.#e(e));return this.#t(t)}#e(e){let t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#t(e){let t=[];this.promptItemByListItem=new WeakMap;for(let r of e){let o=this.buildListItemElementFor(r);this.promptItemByListItem.set(o,r),t.push(o)}return t}},GM="Nothing found",Bh,WE,Hh,GE,Xl,K_,zh,VE,Kh,YE,Qt,Sn,Ot,Jt,Bs,Ol,Uh,jE,Wh,qE,Gh,ZE,Vh,JE,Ql,U_,fr,Go,Hs,kl,ec,W_,Yh,XE,jh,QE,jo,Ui,qh,eA,Zi,Zh,tA,Jh,nA,Xh,rA,Qh,oA,tc,eg,sA,tg,iA,Ji,Sd,ng,aA,Xi,Td,nc,G_,rg,lA,og,cA,sg,uA,ig,dA,ag,hA,lg,gA,cg,fA,ug,pA,qo,Wi,pr,Vo,dg,mA,hg,gg,_A,bd=class extends HTMLElement{constructor(){super();k(this,Bh);k(this,Hh);k(this,Xl);k(this,zh);k(this,Kh);k(this,Qt);k(this,Ot);k(this,Bs);k(this,Uh);k(this,Wh);k(this,Gh);k(this,Vh);k(this,Ql);k(this,fr);k(this,Hs);k(this,ec);k(this,Yh);k(this,jh);k(this,jo);k(this,qh);k(this,Zh);k(this,Jh);k(this,Xh);k(this,Qh);k(this,eg);k(this,tg);k(this,Ji);k(this,ng);k(this,Xi);k(this,nc);k(this,rg);k(this,og);k(this,sg);k(this,ig);k(this,ag);k(this,lg);k(this,cg);k(this,ug);k(this,qo);k(this,pr);k(this,dg);k(this,gg);k(this,Zi,async()=>{if(this.initialPrompt){this.initialPrompt=!1;return}R(this,qo,Wi).containsTextBackUntil(this.trigger)?(await L(this,Zh,tA).call(this),await Us(),L(this,Yh,XE).call(this)):L(this,jo,Ui).call(this)});k(this,tc,t=>{t.key==="Escape"&&(L(this,jo,Ui).call(this),R(this,Ot,Jt).focus(),t.stopPropagation())});k(this,hg,t=>{let r=t.target.closest(".lexxy-prompt-menu__item");r&&(L(this,Hs,kl).call(this,r),L(this,nc,G_).call(this))});this.keyListeners=[]}connectedCallback(){this.source=L(this,Hh,GE).call(this),L(this,Xl,K_).call(this),this.toggleAttribute("connected",!0)}disconnectedCallback(){this.source=null,this.popoverElement=null}attributeChangedCallback(t,r,o){t==="connected"&&this.isConnected&&r!=null&&r!==o&&requestAnimationFrame(()=>L(this,gg,_A).call(this))}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get open(){return this.popoverElement?.classList?.contains("lexxy-prompt-menu--visible")}get closed(){return!this.open}};Bh=new WeakSet,WE=function(){return!this.supportsSpaceInSearches},Hh=new WeakSet,GE=function(){let t=this.getAttribute("src");return t?this.hasAttribute("remote-filtering")?new z_(t):new H_(t):new B_(this.querySelectorAll("lexxy-prompt-item"))},Xl=new WeakSet,K_=function(){let t=R(this,Qt,Sn).registerUpdateListener(({editorState:r})=>{r.read(()=>{let{node:o,offset:s}=R(this,Bs,Ol).selectedNodeWithOffset();if(!!o&&B(o)){let i=o.getTextContent(),a=this.trigger.length;if(s>=a&&i.slice(s-a,s)===this.trigger){let c=s===a,u=s>a?i[s-a-1]:null;(c||(u===" "||u===`
`))&&(t(),L(this,Uh,jE).call(this))}}})})},zh=new WeakSet,VE=function(){this.cursorPositionListener=R(this,Qt,Sn).registerUpdateListener(()=>{this.closed||R(this,Qt,Sn).read(()=>{let{node:t,offset:r}=R(this,Bs,Ol).selectedNodeWithOffset();if(!!t)if(B(t)&&r>0){let i=t.getTextContent().slice(0,r).lastIndexOf(this.trigger),a=i+this.trigger.length-1;(i===-1||r<=a)&&L(this,jo,Ui).call(this)}else L(this,jo,Ui).call(this)})})},Kh=new WeakSet,YE=function(){this.cursorPositionListener&&(this.cursorPositionListener(),this.cursorPositionListener=null)},Qt=new WeakSet,Sn=function(){return R(this,Ot,Jt).editor},Ot=new WeakSet,Jt=function(){return this.closest("lexxy-editor")},Bs=new WeakSet,Ol=function(){return R(this,Ot,Jt).selection},Uh=new WeakSet,jE=async function(){this.popoverElement??=await L(this,dg,mA).call(this),L(this,jh,QE).call(this),await R(this,Zi).call(this),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),L(this,Ql,U_).call(this),R(this,Ot,Jt).addEventListener("keydown",R(this,tc)),R(this,Ot,Jt).addEventListener("lexxy:change",R(this,Zi)),L(this,Wh,qE).call(this),L(this,zh,VE).call(this)},Wh=new WeakSet,qE=function(){this.keyListeners.push(R(this,Qt,Sn).registerCommand(Ur,L(this,Xi,Td).bind(this),Jn)),this.keyListeners.push(R(this,Qt,Sn).registerCommand(_n,L(this,Xi,Td).bind(this),Jn)),R(this,Bh,WE)&&this.keyListeners.push(R(this,Qt,Sn).registerCommand(Ni,L(this,Xi,Td).bind(this),Jn)),this.keyListeners.push(R(this,Qt,Sn).registerCommand(Pt,L(this,Gh,ZE).bind(this),Jn)),this.keyListeners.push(R(this,Qt,Sn).registerCommand(dn,L(this,Vh,JE).bind(this),Jn))},Gh=new WeakSet,ZE=function(t){return L(this,tg,iA).call(this),t.preventDefault(),!0},Vh=new WeakSet,JE=function(t){return L(this,eg,sA).call(this),t.preventDefault(),!0},Ql=new WeakSet,U_=function(){let t=R(this,fr,Go)[0];t&&L(this,Hs,kl).call(this,t)},fr=new WeakSet,Go=function(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))},Hs=new WeakSet,kl=function(t){L(this,ec,W_).call(this),t.toggleAttribute("aria-selected",!0),t.scrollIntoView({block:"nearest",behavior:"smooth"}),t.focus(),R(this,Bs,Ol).preservingSelection(()=>{R(this,Ot,Jt).focus()}),R(this,pr,Vo).setAttribute("aria-controls",this.popoverElement.id),R(this,pr,Vo).setAttribute("aria-activedescendant",t.id),R(this,pr,Vo).setAttribute("aria-haspopup","listbox")},ec=new WeakSet,W_=function(){R(this,fr,Go).forEach(t=>{t.toggleAttribute("aria-selected",!1)}),R(this,pr,Vo).removeAttribute("aria-controls"),R(this,pr,Vo).removeAttribute("aria-activedescendant"),R(this,pr,Vo).removeAttribute("aria-haspopup")},Yh=new WeakSet,XE=function(){let{x:t,y:r,fontSize:o}=R(this,Bs,Ol).cursorPosition,s=R(this,Ot,Jt).getBoundingClientRect(),a=R(this,pr,Vo).getBoundingClientRect().top-s.top;this.popoverElement.hasAttribute("data-anchored")||(this.popoverElement.style.left=`${t}px`,this.popoverElement.toggleAttribute("data-anchored",!0)),this.popoverElement.style.top=`${r+a}px`,this.popoverElement.style.bottom="auto";let l=this.popoverElement.getBoundingClientRect();(l.bottom>window.innerHeight||this.popoverElement.hasAttribute("data-clipped-at-bottom"))&&(this.popoverElement.style.top=`${r+a-l.height-o}px`,this.popoverElement.style.bottom="auto",this.popoverElement.toggleAttribute("data-clipped-at-bottom",!0))},jh=new WeakSet,QE=function(){this.popoverElement.removeAttribute("data-clipped-at-bottom"),this.popoverElement.removeAttribute("data-anchored")},jo=new WeakSet,Ui=async function(){L(this,ec,W_).call(this),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),R(this,Ot,Jt).removeEventListener("lexxy:change",R(this,Zi)),R(this,Ot,Jt).removeEventListener("keydown",R(this,tc)),L(this,qh,eA).call(this),L(this,Kh,YE).call(this),await Us(),L(this,Xl,K_).call(this)},qh=new WeakSet,eA=function(){this.keyListeners.forEach(t=>t()),this.keyListeners=[]},Zi=new WeakMap,Zh=new WeakSet,tA=async function(){let t=R(this,qo,Wi).textBackUntil(this.trigger),r=await this.source.buildListItems(t);this.popoverElement.innerHTML="",r.length>0?L(this,Jh,nA).call(this,r):L(this,Xh,rA).call(this),L(this,Ql,U_).call(this)},Jh=new WeakSet,nA=function(t){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...t)},Xh=new WeakSet,rA=function(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");let t=se("li",{innerHTML:R(this,Qh,oA)});t.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(t)},Qh=new WeakSet,oA=function(){return this.getAttribute("empty-results")||GM},tc=new WeakMap,eg=new WeakSet,sA=function(){let t=R(this,Ji,Sd)+1;t<R(this,fr,Go).length&&L(this,Hs,kl).call(this,R(this,fr,Go)[t])},tg=new WeakSet,iA=function(){let t=R(this,Ji,Sd)-1;t>=0&&L(this,Hs,kl).call(this,R(this,fr,Go)[t])},Ji=new WeakSet,Sd=function(){return R(this,fr,Go).findIndex(t=>t.hasAttribute("aria-selected"))},ng=new WeakSet,aA=function(){return R(this,fr,Go)[R(this,Ji,Sd)]},Xi=new WeakSet,Td=function(t){return t.preventDefault(),t.stopPropagation(),L(this,nc,G_).call(this),!0},nc=new WeakSet,G_=function(){L(this,rg,lA).call(this),L(this,jo,Ui).call(this),R(this,Ot,Jt).focus()},rg=new WeakSet,lA=function(){let t=this.source.promptItemFor(R(this,ng,aA));if(!t)return;let r=Array.from(t.querySelectorAll("template[type='editor']")),o=`${this.trigger}${R(this,qo,Wi).textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?L(this,og,cA).call(this,r,o):L(this,ig,dA).call(this,r,o,t.getAttribute("sgid"))},og=new WeakSet,cA=function(t,r){R(this,Qt,Sn).update(()=>{let o=t.flatMap(s=>L(this,sg,uA).call(this,s));R(this,qo,Wi).replaceTextBackUntil(r,o)})},sg=new WeakSet,uA=function(t){return bs(R(this,Qt,Sn),Os(`${t.innerHTML}`))},ig=new WeakSet,dA=function(t,r,o=null){R(this,Qt,Sn).update(()=>{let i=L(this,ag,hA).call(this,t,o).flatMap(a=>[a,L(this,lg,gA).call(this)]).slice(0,-1);R(this,qo,Wi).replaceTextBackUntil(r,i)})},ag=new WeakSet,hA=function(t,r=null){return t.map(o=>L(this,ug,pA).call(this,o.innerHTML,o.getAttribute("content-type")||R(this,cg,fA),o.getAttribute("sgid")||r))},lg=new WeakSet,gA=function(){return ye(" ")},cg=new WeakSet,fA=function(){return`application/vnd.${zn.global.get("attachmentContentTypeNamespace")}.${this.name}`},ug=new WeakSet,pA=function(t,r,o){return new mr({sgid:o,contentType:r,innerHtml:t})},qo=new WeakSet,Wi=function(){return R(this,Ot,Jt).contents},pr=new WeakSet,Vo=function(){return R(this,Ot,Jt).editorContentElement},dg=new WeakSet,mA=async function(){let t=se("ul",{role:"listbox",id:td("prompt-popover")});return t.classList.add("lexxy-prompt-menu"),t.style.position="absolute",t.setAttribute("nonce",fg()),t.append(...await this.source.buildListItems()),t.addEventListener("click",R(this,hg)),R(this,Ot,Jt).appendChild(t),t},hg=new WeakMap,gg=new WeakSet,_A=function(){this.disconnectedCallback(),this.connectedCallback()},nn(bd,"observedAttributes",["connected"]);var V_=class extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.classList.add("lexxy-floating-controls"),this.#e(),this.#c(),this.#s()}disconnectedCallback(){this.unregisterUpdateListener?.(),this.unregisterUpdateListener=null}#e(){this.languagePickerElement=this.#t(),this.languagePickerElement.addEventListener("change",()=>{this.#r(this.languagePickerElement.value)}),this.languagePickerElement.setAttribute("nonce",fg()),this.appendChild(this.languagePickerElement)}#t(){let e=se("select",{className:"lexxy-code-language-picker","aria-label":"Pick a language\u2026",name:"lexxy-code-language"});for(let[t,r]of Object.entries(this.#n)){let o=document.createElement("option");o.value=t,o.textContent=r,e.appendChild(o)}return e}get#n(){let e={...b0};e.ruby||(e.ruby="Ruby"),e.php||(e.php="PHP"),e.go||(e.go="Go"),e.bash||(e.bash="Bash"),e.json||(e.json="JSON"),e.diff||(e.diff="Diff");let t=Object.entries(e).sort(([,s],[,i])=>s.localeCompare(i)),r=t.findIndex(([s])=>s==="plain"),o=t.splice(r,1)[0];return Object.fromEntries([o,...t])}#r(e){this.editor.update(()=>{let t=this.#i();t&&t.setLanguage(e)})}#s(){this.unregisterUpdateListener=this.editor.registerUpdateListener(()=>{this.editor.getEditorState().read(()=>{let e=this.#i();e?this.#o(e):this.#c()})})}#i(){let e=w();if(!v(e))return null;let t=e.anchor.getNode(),r=t.getParent();return Ko(t)?t:Ko(r)?r:null}#o(e){let t=e.getLanguage();this.#a(t),this.#l(),this.#u(e)}#a(e){if(this.languagePickerElement&&e){let t=Cm(e);this.languagePickerElement.value=t}}#u(e){let t=this.editor.getElementByKey(e.getKey());if(!t)return;let r=t.getBoundingClientRect(),o=this.editorElement.getBoundingClientRect(),s=r.top-o.top,i=o.right-r.right;this.style.top=`${s}px`,this.style.right=`${i}px`}#l(){this.hidden=!1}#c(){this.hidden=!0}},VM=`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,Y_=class extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.classList.add("lexxy-floating-controls"),this.deleteButton||this.#e()}disconnectedCallback(){this.deleteButton&&this.handleDeleteClick&&this.deleteButton.removeEventListener("click",this.handleDeleteClick),this.handleDeleteClick=null,this.deleteButton=null,this.editor=null,this.editorElement=null}#e(){let e=se("div",{className:"lexxy-floating-controls__group"});this.deleteButton=se("button",{className:"lexxy-node-delete",type:"button","aria-label":"Remove"}),this.deleteButton.tabIndex=-1,this.deleteButton.innerHTML=VM,this.handleDeleteClick=()=>this.#t(),this.deleteButton.addEventListener("click",this.handleDeleteClick),e.appendChild(this.deleteButton),this.appendChild(e)}#t(){this.editor.update(()=>{We(this)?.remove()})}},j_=class{constructor(e){this.editor=e.editor,this.contents=e.contents,this.selection=e.selection,this.currentTableNodeKey=null,this.currentCellKey=null,this.#f()}destroy(){this.currentTableNodeKey=null,this.currentCellKey=null,this.#C()}get currentCell(){return this.currentCellKey?this.editor.getEditorState().read(()=>{let e=Fe(this.currentCellKey);return e instanceof Ki?e:null}):null}get currentTableNode(){return this.currentTableNodeKey?this.editor.getEditorState().read(()=>{let e=Fe(this.currentTableNodeKey);return e instanceof yl?e:null}):null}get currentRowCells(){let e=this.currentRowIndex,t=this.tableRows;return t?this.editor.getEditorState().read(()=>t[e]?.getChildren()??null)??null:null}get currentRowIndex(){let e=this.currentCell;return e?this.editor.getEditorState().read(()=>UT(e))??0:0}get currentColumnCells(){let e=this.currentColumnIndex,t=this.tableRows;return t?this.editor.getEditorState().read(()=>t.map(r=>r.getChildAtIndex(e)))??null:null}get currentColumnIndex(){let e=this.currentCell;return e?this.editor.getEditorState().read(()=>KT(e))??0:0}get tableRows(){return this.editor.getEditorState().read(()=>this.currentTableNode?.getChildren())??null}updateSelectedTable(){let e=null,t=null;this.editor.getEditorState().read(()=>{let r=w();if(!r||!this.selection.isTableCellSelected)return;let o=r.getNodes()[0];e=jm(o),t=qm(o)}),this.currentCellKey=e?.getKey()??null,this.currentTableNodeKey=t?.getKey()??null}executeTableCommand(e,t=null){if(e.action==="delete"&&e.childType==="table"){this.#n();return}if(e.action==="toggle"){this.#t(e);return}this.#e(e,t)}#e(e,t=null){this.#r(),this.editor.dispatchCommand(this.#s(e)),this.#a(e,t)}#t(e){let t=e.childType,r=null,o=null;t==="row"?(r=this.currentRowCells,o=dr.ROW):t==="column"&&(r=this.currentColumnCells,o=dr.COLUMN),!(!r||r.length===0)&&this.editor.update(()=>{let s=xl(r[0]);if(!s)return;let a=s.getHeaderStyles()^o;r.forEach(l=>{this.#i(l,a,o)})})}#n(){this.#r(),this.editor.dispatchCommand("deleteTable")}#r(){this.editor.update(()=>{let e=w();if(!e)return;let t=e.getNodes()[0];jm(t)?.selectEnd()})}#s(e){let{action:t,childType:r,direction:o}=e,s=xN(r),i=t=="insert"?xN(o):"";return`${t}Table${s}${i}`}#i(e,t,r){xl(e)?.setHeaderStyles(t,r)}async#o(e,t){if(await Us(),!this.currentTableNode)return;let r=this.tableRows;if(!r)return;let o=r[e];!o||this.editor.update(()=>{xl(o.getChildAtIndex(t))?.selectEnd()})}#a(e,t=null){let{childType:r,direction:o}=e,s=this.currentRowIndex,i=t!==null?t:this.currentColumnIndex,a=e.action==="delete"?-1:0,l=o==="after"?1:a;r==="row"?s+=l:r==="column"&&(i+=l),this.#o(s,i)}#u(){let e=this.tableRows;if(!e)return;let t=e.at(this.currentRowIndex+1);!t||this.editor.update(()=>{t.getChildAtIndex(this.currentColumnIndex)?.selectEnd()})}#l(){let e=this.currentCell;!e||this.editor.update(()=>{e.selectPrevious()})}#c(){this.executeTableCommand({action:"insert",childType:"row",direction:"after"},0)}#d(){this.executeTableCommand({action:"delete",childType:"row"},-1)}#m(){let e=this.currentTableNode;this.executeTableCommand({action:"delete",childType:"row"}),this.editor.update(()=>{let t=e?.getNextSibling();if(rt(t))t.selectStart();else{let r=U();this.currentTableNode.insertAfter(r),r.selectStart()}})}#p(){if(!this.currentTableNode)return!1;let e=this.currentCell;return e?e.getTextContent().trim()==="":!1}#_(){if(!this.currentTableNode)return!1;let e=this.tableRows;return e?e.length===this.currentRowIndex+1:!1}#h(){if(!this.currentTableNode)return!1;let e=this.currentRowCells;return e?e.every(t=>t.getTextContent().trim()===""):!1}#g(){if(!this.currentTableNode)return!1;let e=this.currentRowCells;return e?e.indexOf(this.currentCell)===0:!1}#f(){this.unregisterBackspaceKeyHandler=this.editor.registerCommand(vo,e=>this.#y(e),Je),this.unregisterEnterKeyHandler=this.editor.registerCommand(Ur,e=>this.#x(e),Je)}#C(){this.unregisterBackspaceKeyHandler?.(),this.unregisterEnterKeyHandler?.(),this.unregisterBackspaceKeyHandler=null,this.unregisterEnterKeyHandler=null}#y(e){return this.currentTableNode?this.#h()&&this.#g()?(e.preventDefault(),this.#d(),!0):this.#p()&&!this.#g()?(e.preventDefault(),this.#l(),!0):!1:!1}#x(e){return e.ctrlKey||e.metaKey||e.shiftKey||!this.currentTableNode||this.selection.isInsideList||this.selection.isInsideCodeBlock?!1:(e.preventDefault(),this.#_()&&this.#h()?this.#m():this.#_()?this.#c():this.#u(),!0)}},YM={"insert-row-before":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<path d="M4.5 4.5H7.5V7.5H9V4.5H12L12 3L9 3V6.55671e-08L7.5 0V3L4.5 3V4.5Z"/>
</svg>`,"insert-row-after":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<path d="M7.5 15V18H9V15H12V13.5H9V10.5H7.5V13.5H4.5V15H7.5Z"/>
</svg>`,"delete-row":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<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"/>
</svg>`,"toggle-row":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,"insert-column-before":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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 15 0H4.5ZM15 15H10.5V1.5H15V15Z"/>
<path d="M3 7.5H0V9H3V12H4.5V9H7.5V7.5H4.5V4.5H3V7.5Z"/>
</svg>`,"insert-column-after":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<path d="M15 7.5H18V9H15V12H13.5V9H10.5V7.5H13.5V4.5H15V7.5Z"/>
</svg>`,"delete-column":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
<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"/>
</svg>`,"toggle-column":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`,"delete-table":`<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>`},q_=class extends HTMLElement{connectedCallback(){this.tableController=new j_(this.#t),this.classList.add("lexxy-floating-controls"),this.#r(),this.#y(),this.#g(),this.#c()}disconnectedCallback(){this.#d(),this.unregisterUpdateListener?.(),this.unregisterUpdateListener=null,this.removeEventListener("keydown",this.#p),this.tableController?.destroy(),this.tableController=null}get#e(){return this.#t.editor}get#t(){return this.closest("lexxy-editor")}get#n(){return Array.from(this.querySelectorAll("button, details > summary"))}#r(){this.appendChild(this.#i()),this.appendChild(this.#o()),this.appendChild(this.#u()),this.addEventListener("keydown",this.#p)}#s(e,t,r){let o=se("div",{className:`lexxy-floating-controls__group lexxy-table-control lexxy-table-control--${e}`}),s=this.#l(`Add ${e}`,{action:"insert",childType:e,direction:"after"},"+"),i=this.#l(`Remove ${e}`,{action:"delete",childType:e},"\u2212"),a=se("details",{className:"lexxy-table-control__more-menu"});a.setAttribute("name","lexxy-dropdown"),a.tabIndex=-1;let l=se("summary",{},`_ ${e}s`);return t(l),a.appendChild(l),a.appendChild(r),o.appendChild(i),o.appendChild(a),o.appendChild(s),o}#i(){return this.#s("row",e=>{this.rowCount=e},this.#a("row"))}#o(){return this.#s("column",e=>{this.columnCount=e},this.#a("column"))}#a(e){let t=se("div",{className:"lexxy-floating-controls__group lexxy-table-control__more-menu-details"}),r=this.#l(`Add ${e} before`,{action:"insert",childType:e,direction:"before"}),o=this.#l(`Add ${e} after`,{action:"insert",childType:e,direction:"after"}),s=this.#l(`Toggle ${e} style`,{action:"toggle",childType:e}),i=this.#l(`Remove ${e}`,{action:"delete",childType:e});return t.appendChild(r),t.appendChild(o),t.appendChild(s),t.appendChild(i),t}#u(){let e=se("div",{className:"lexxy-table-control lexxy-floating-controls__group"}),t=this.#l("Delete this table?",{action:"delete",childType:"table"});return t.classList.add("lexxy-table-control__button--delete-table"),e.appendChild(t),this.deleteContainer=e,e}#l(e,t={},r=this.#w(t)){let o=se("button",{className:"lexxy-table-control__button","aria-label":e,type:"button"});return o.tabIndex=-1,o.innerHTML=`${r} <span>${e}</span>`,o.dataset.action=t.action,o.dataset.childType=t.childType,o.dataset.direction=t.direction,o.addEventListener("click",()=>this.#f(t)),o.addEventListener("mouseover",()=>this.#h()),o.addEventListener("focus",()=>this.#h()),o.addEventListener("mouseout",()=>this.#h()),o}#c(){this.unregisterKeyboardShortcuts=this.#e.registerCommand(_1,this.#m,Je)}#d(){this.unregisterKeyboardShortcuts?.(),this.unregisterKeyboardShortcuts=null}#m=e=>{(e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key==="F10"&&this.querySelector("button, [tabindex]:not([tabindex='-1'])")?.focus()};#p=e=>{e.key==="Escape"?this.#_():NN(this.#n,e)};#_(){let e=this.tableController.currentCell;!e||(this.#e.update(()=>{e.select(),this.#e.focus()}),this.#x())}async#h(){await Us(),this.#S();let e=this.querySelector("button:hover, button:focus");if(!e)return;let t={action:e.dataset.action,childType:e.dataset.childType,direction:e.dataset.direction},r=null;switch(t.childType){case"row":r=this.tableController.currentRowCells;break;case"column":r=this.tableController.currentColumnCells;break;case"table":r=this.tableController.tableRows;break}!r||r.forEach(o=>{let s=this.#e.getElementByKey(o.getKey());!s||(s.classList.toggle($s.tableCellHighlight,!0),Object.assign(s.dataset,t))})}#g(){this.unregisterUpdateListener=this.#e.registerUpdateListener(()=>{this.tableController.updateSelectedTable(),this.tableController.currentTableNode?this.#C():this.#y()})}#f(e){this.tableController.executeTableCommand(e),this.#x()}#C(){this.style.display="flex",this.#x()}#y(){this.style.display="none",this.#S()}#x(){this.#N(),this.#E(),this.#T(),this.#h()}#T(){this.querySelector("details[open]")?.removeAttribute("open")}#N(){let e=this.tableController.currentTableNode;if(!e)return;let t=this.#e.getElementByKey(e.getKey());if(!t)return;let r=t.getBoundingClientRect(),o=this.#t.getBoundingClientRect(),s=r.top-o.top,i=(r.left+r.right)/2-o.left;this.style.top=`${s}px`,this.style.left=`${i}px`}#E(){let e=this.tableController.currentTableNode;if(!e)return;let t=zT(this.#e,e);if(!t)return;let r=t.rows,o=t.columns;this.rowCount.textContent=`${r} row${r===1?"":"s"}`,this.columnCount.textContent=`${o} column${o===1?"":"s"}`}#A(){let e=this.tableController.currentCell;if(!e)return;let t=this.#e.getElementByKey(e.getKey());!t||t.classList.add($s.tableCellFocus)}#S(){this.#t.querySelectorAll(`.${$s.tableCellFocus}`)?.forEach(e=>{e.classList.remove($s.tableCellFocus)}),this.#t.querySelectorAll(`.${$s.tableCellHighlight}`)?.forEach(e=>{e.classList.remove($s.tableCellHighlight),e.removeAttribute("data-action"),e.removeAttribute("data-child-type"),e.removeAttribute("data-direction")}),this.#A()}#w(e){let{action:t,childType:r}=e,o=t=="insert"?e.direction:null,s=[t,r,o].filter(Boolean).join("-");return YM[s]}};function jM(){Object.entries({"lexxy-toolbar":Ll,"lexxy-editor":Ps,"lexxy-link-dropdown":P_,"lexxy-highlight-dropdown":F_,"lexxy-prompt":bd,"lexxy-code-language-picker":V_,"lexxy-node-delete-button":Y_,"lexxy-table-tools":q_}).forEach(([e,t])=>{customElements.define(e,t)})}var nF=zn.configure;setTimeout(jM,0);export{tF as $createActionTextAttachmentNode,RM as $createActionTextAttachmentUploadNode,Ad as $isActionTextAttachmentNode,Ut as ActionTextAttachmentNode,Ws as ActionTextAttachmentUploadNode,mr as CustomActionTextAttachmentNode,Ks as Extension,Zo as HorizontalDividerNode,nF as configure,dT as highlightAll,dT as highlightCode};
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/