Files
a.montask/public/vendor/rich-text-laravel/lexxy.esm.js
T

268 lines
573 KiB
JavaScript
Raw Normal View History

2026-04-23 14:00:39 +03:30
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&
`),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;(
?|
|(?![\\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
`+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
`,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)f
`)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
`}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}),su
`||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
`),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
`);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
`}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.g
`||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"&&w
`&&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!==n
?|
|(?![\\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.getCodeLanguag
`):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
`),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/SharedHi
`),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 thi
`:" ")}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.focus
]`).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("p
`).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.toke
`),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[
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
`}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.ed
`}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.getTopLevelElem
`).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_pa
`))&&(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(th
<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.se
<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.sty
/*! @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
*/