@shumai-one/shumai 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/chunk-02b5bcmc.js +1 -0
- package/bin/{chunk-m0q2cgfg.js → chunk-09mj32d7.js} +1 -1
- package/bin/{chunk-b7bnp021.js → chunk-09mpcg9x.js} +2 -2
- package/bin/{chunk-257dcd2f.js → chunk-0a298n62.js} +2 -2
- package/bin/{chunk-cz13a82m.js → chunk-0rgbxp24.js} +2 -2
- package/bin/{chunk-mwktrwtx.js → chunk-19zbh4fr.js} +1 -1
- package/bin/{chunk-v05rrxp5.js → chunk-1e1q1hyg.js} +2 -2
- package/bin/{chunk-fatmqnp1.js → chunk-1ja2zw4w.js} +1 -1
- package/bin/chunk-1tar0x8s.js +7 -0
- package/bin/{chunk-1nvd90g2.js → chunk-1y6h4vge.js} +1 -1
- package/bin/{chunk-tekwpkjf.js → chunk-20bamhwa.js} +2 -2
- package/bin/{chunk-8mqbztj8.js → chunk-20w1w9x7.js} +2 -2
- package/bin/{chunk-qwpkcp8d.js → chunk-25npafhz.js} +2 -2
- package/bin/{chunk-km4gn6b6.js → chunk-2qgagdb7.js} +1 -1
- package/bin/chunk-2t6g3pny.js +3 -0
- package/bin/{chunk-ns33grgx.js → chunk-34f64q0q.js} +1 -1
- package/bin/{chunk-1wfg56z3.js → chunk-3hgrw1m0.js} +4 -4
- package/bin/{chunk-p3f5aevs.js → chunk-3s2ga6mt.js} +1 -1
- package/bin/{chunk-hzkjgcre.js → chunk-3vpz5nat.js} +1 -1
- package/bin/{chunk-2jj4j8cn.js → chunk-4p31kxjh.js} +2 -2
- package/bin/{chunk-9t3p4xp6.js → chunk-4vjgdj0h.js} +1 -1
- package/bin/{chunk-96qpjght.js → chunk-50pfmxt1.js} +2 -2
- package/bin/{chunk-2cdxm1cp.js → chunk-5ddg5ezb.js} +9 -9
- package/bin/chunk-5ngftxjb.js +218 -0
- package/bin/{chunk-r1xer8gn.js → chunk-6f3zhq64.js} +3 -3
- package/bin/chunk-6nqqe7w9.js +1 -0
- package/bin/{chunk-h1n7jqnw.js → chunk-6t525bmg.js} +1 -1
- package/bin/{chunk-01052ssf.js → chunk-7546ptwg.js} +11 -11
- package/bin/{chunk-82tps5n1.js → chunk-7jz3cmq6.js} +1 -1
- package/bin/{chunk-v5cn90cf.js → chunk-7kah3zb5.js} +2 -2
- package/bin/{chunk-73yncv54.js → chunk-7mawxsk3.js} +2 -2
- package/bin/chunk-8ww98y1m.js +2 -0
- package/bin/{chunk-55h9ze53.js → chunk-9405hzv2.js} +2 -2
- package/bin/{chunk-cgmebxx6.js → chunk-95b4mwyq.js} +1 -1
- package/bin/chunk-9vxmgvc8.js +2 -0
- package/bin/{chunk-knj2s8mg.js → chunk-9x42vgeq.js} +5 -5
- package/bin/{chunk-7sgrtxbt.js → chunk-a859y4e1.js} +2 -2
- package/bin/{chunk-y241cxff.js → chunk-addssm8d.js} +1 -1
- package/bin/{chunk-f6avg5qe.js → chunk-ajq9sxg0.js} +33 -33
- package/bin/chunk-amp9h878.js +2 -0
- package/bin/{chunk-yk12hydf.js → chunk-atdfqdkj.js} +4 -4
- package/bin/{chunk-5wapd171.js → chunk-atpt99h4.js} +10 -10
- package/bin/chunk-awshe30f.js +1 -0
- package/bin/chunk-b3t7gbhm.js +2 -0
- package/bin/{chunk-e4f56spj.js → chunk-bbxwyhz3.js} +3 -3
- package/bin/{chunk-a411xhmm.js → chunk-bd3v8mp1.js} +4 -4
- package/bin/{chunk-167z646e.js → chunk-brgns7hv.js} +1 -1
- package/bin/{chunk-576nj64j.js → chunk-c02727j9.js} +2 -2
- package/bin/{chunk-8yjsmr7g.js → chunk-c1wvs81k.js} +1 -1
- package/bin/chunk-c8frmqsk.js +2 -0
- package/bin/{chunk-xc54vhfz.js → chunk-cagzye3j.js} +1 -1
- package/bin/{chunk-s9ksftq2.js → chunk-cp96e9pq.js} +1 -1
- package/bin/{chunk-q5vkxee3.js → chunk-d55138xx.js} +2 -2
- package/bin/{chunk-7v7mypc6.js → chunk-ddmf9gqv.js} +2 -2
- package/bin/chunk-djb65frk.js +1 -0
- package/bin/{chunk-q83h0hkx.js → chunk-dkhdn92k.js} +2 -2
- package/bin/chunk-dx9f5wab.js +1 -0
- package/bin/{chunk-f25fe9th.js → chunk-dygj751y.js} +11 -11
- package/bin/{chunk-m9adtgzk.js → chunk-e55sgg8t.js} +1 -1
- package/bin/{chunk-q8w4mbw4.js → chunk-enax4303.js} +2 -2
- package/bin/{chunk-vcrmjtcz.js → chunk-erfkd3z9.js} +2 -2
- package/bin/{chunk-8cjet7pp.js → chunk-esj0kwe5.js} +5 -5
- package/bin/{chunk-atfz7g7e.js → chunk-etrm28sy.js} +1 -1
- package/bin/chunk-ex3174e3.js +2 -0
- package/bin/{chunk-9n1w5dw1.js → chunk-ezjxx44x.js} +3 -3
- package/bin/{chunk-cf5axr8c.js → chunk-f4xnx4n6.js} +1 -1
- package/bin/{chunk-7naa7tpn.js → chunk-f8hgy69t.js} +2 -2
- package/bin/chunk-fakph5jp.js +1 -0
- package/bin/{chunk-kvhf12b4.js → chunk-femnbfkj.js} +1 -1
- package/bin/{chunk-ah8fjb6f.js → chunk-ffjdkdcv.js} +2 -2
- package/bin/{chunk-vkzasgxw.js → chunk-gd016e9p.js} +2 -2
- package/bin/{chunk-ympbfzz4.js → chunk-gyv3yrhj.js} +1 -1
- package/bin/{chunk-jzgbxqdg.js → chunk-h2bphev9.js} +2 -2
- package/bin/chunk-h3atwgx2.js +1 -0
- package/bin/chunk-h7xny3de.js +2 -0
- package/bin/{chunk-m82tkhaa.js → chunk-hg3rkp41.js} +5 -5
- package/bin/{chunk-3z85zxkn.js → chunk-hpzk9k55.js} +1 -1
- package/bin/{chunk-9zsv6d2f.js → chunk-hsyfrzdd.js} +1 -1
- package/bin/chunk-hvyy8vct.js +3 -0
- package/bin/{chunk-b5rhvzv9.js → chunk-j2txsbxz.js} +2 -2
- package/bin/chunk-j6x53e33.js +1 -0
- package/bin/chunk-jacanzp7.js +1 -0
- package/bin/{chunk-g6sdezec.js → chunk-jc7dycy6.js} +1 -1
- package/bin/{chunk-cwat1jwx.js → chunk-k7vbk8v4.js} +1 -1
- package/bin/{chunk-zrszykjf.js → chunk-mn0kt3p6.js} +1 -1
- package/bin/chunk-mn71dffh.js +4 -0
- package/bin/{chunk-vp3czaeh.js → chunk-npeapp7e.js} +2 -2
- package/bin/{chunk-2nhgdqdg.js → chunk-p2vsdnd1.js} +2 -2
- package/bin/chunk-pdw77q09.js +2 -0
- package/bin/{chunk-zezje74z.js → chunk-pq6kdp83.js} +3 -3
- package/bin/chunk-ptcz4ed3.js +2 -0
- package/bin/{chunk-z1p13dnc.js → chunk-q1fzgqsv.js} +2 -2
- package/bin/chunk-q4ny4hpt.js +2 -0
- package/bin/{chunk-mzsw9var.js → chunk-q5x0yywj.js} +2 -2
- package/bin/{chunk-g22wmpk1.js → chunk-q8xr1a8j.js} +2 -2
- package/bin/chunk-q8ysc5ex.js +1 -0
- package/bin/{chunk-1ktk6764.js → chunk-qm50g4n5.js} +4 -4
- package/bin/{chunk-q2bew2vc.js → chunk-qvp24w0q.js} +2 -2
- package/bin/{chunk-9xhjy897.js → chunk-r6t0j0jx.js} +3 -3
- package/bin/chunk-s1j4v33x.js +2 -0
- package/bin/{chunk-yq32evnn.js → chunk-s6pk2zyg.js} +5 -5
- package/bin/{chunk-hnkcgvcj.js → chunk-s74g9vsk.js} +1 -1
- package/bin/{chunk-gxepkvt2.js → chunk-sz19nn1x.js} +1 -1
- package/bin/{chunk-hpbn0k9n.js → chunk-sz5zawfw.js} +1 -1
- package/bin/chunk-t68y25gf.js +1 -0
- package/bin/{chunk-mcw198kg.js → chunk-te484xtb.js} +8 -8
- package/bin/{chunk-jt0ykktx.js → chunk-tfrevef9.js} +1 -1
- package/bin/chunk-thpw6tcj.js +2 -0
- package/bin/{chunk-02fvcrej.js → chunk-v0yevesp.js} +7 -7
- package/bin/chunk-vj4gamdn.js +2 -0
- package/bin/{chunk-p4s95471.js → chunk-vmwys2ch.js} +1 -1
- package/bin/{chunk-e4yscwen.js → chunk-vnmggrd6.js} +7 -7
- package/bin/{chunk-hpwv4am3.js → chunk-vv0m0m2f.js} +4 -4
- package/bin/{chunk-x03jwaga.js → chunk-w6g84d59.js} +4 -4
- package/bin/{chunk-3ckkwdjx.js → chunk-wgvgtttc.js} +3 -3
- package/bin/chunk-xy9qpn6b.js +1 -0
- package/bin/{chunk-mcj1xpcc.js → chunk-y3haqtr8.js} +2 -2
- package/bin/chunk-y5dv67mg.js +2 -0
- package/bin/{chunk-4mws03es.js → chunk-yb4mzqrd.js} +2 -2
- package/bin/{chunk-x8mjh387.js → chunk-z0de127n.js} +4 -4
- package/bin/chunk-z8t6e0ee.js +1 -0
- package/bin/chunk-zfg4yy3c.js +2 -0
- package/bin/{chunk-hw6czrya.js → chunk-zkvezz89.js} +1 -1
- package/bin/chunk-zrrnvdxq.js +3 -0
- package/bin/{chunk-srxp5jav.js → chunk-zx1c4vm5.js} +30 -30
- package/bin/chunk-zzqse5qc.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +328 -328
- package/package.json +7 -7
- package/bin/chunk-0bj887zm.js +0 -2
- package/bin/chunk-26qn7fek.js +0 -2
- package/bin/chunk-2ne2b54t.js +0 -2
- package/bin/chunk-2vbeqczj.js +0 -1
- package/bin/chunk-37p6bcx2.js +0 -1
- package/bin/chunk-3knfx6dm.js +0 -1
- package/bin/chunk-54tbfvya.js +0 -2
- package/bin/chunk-56kh5fxc.js +0 -1
- package/bin/chunk-6cnqjngz.js +0 -1
- package/bin/chunk-7g46e1wy.js +0 -3
- package/bin/chunk-84x8p7v5.js +0 -1
- package/bin/chunk-8fyg9dy4.js +0 -2
- package/bin/chunk-8gtfgkrn.js +0 -2
- package/bin/chunk-8xb6yz11.js +0 -2
- package/bin/chunk-91rb0jpb.js +0 -2
- package/bin/chunk-9f1xk1nt.js +0 -1
- package/bin/chunk-9mk9cvbk.js +0 -1
- package/bin/chunk-9nw5w8vh.js +0 -1
- package/bin/chunk-dk42gf7v.js +0 -2
- package/bin/chunk-eb7mzbfm.js +0 -1
- package/bin/chunk-er14d498.js +0 -3
- package/bin/chunk-fvx9k1dc.js +0 -2
- package/bin/chunk-gtf19jc1.js +0 -2
- package/bin/chunk-hfm82066.js +0 -2
- package/bin/chunk-kj6h5j5a.js +0 -4
- package/bin/chunk-ny1kbmxt.js +0 -2
- package/bin/chunk-p3j6ydk1.js +0 -1
- package/bin/chunk-pk406dgy.js +0 -2
- package/bin/chunk-s1e4qy3q.js +0 -14
- package/bin/chunk-swtwaaqe.js +0 -1
- package/bin/chunk-tagdrg7p.js +0 -1
- package/bin/chunk-twtxnzbv.js +0 -2
- package/bin/chunk-v5mcjwxy.js +0 -2
- package/bin/chunk-x342vzdx.js +0 -2
- package/bin/chunk-xvkwbczx.js +0 -3
- package/bin/chunk-zarz3sqn.js +0 -211
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import{xi,oa,Rt,J,Q,Zt,S,nt,G,M,w,Z,Y,a,g,ie,X,ee,We,Js,Rn,R,z,qe,ps,Pn,Ge,F,mb,hb,$A,gb,Nl,K0,Jh,Ie,Xt,qr,Zn,Bo,ar,Ir,Fr}from"./chunk-zarz3sqn.js";import{va}from"./chunk-ah8fjb6f.js";import{Jr}from"./chunk-q5vkxee3.js";import{al}from"./chunk-b5rhvzv9.js";import{cu}from"./chunk-8xb6yz11.js";import{Wl}from"./chunk-7sgrtxbt.js";import{rc}from"./chunk-257dcd2f.js";import{_r}from"./chunk-ny1kbmxt.js";import{se,L,Ye}from"./chunk-2jj4j8cn.js";var om=L(function(pH,Pd){var iI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},he=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function _(x){if(x instanceof s)return new s(x.type,_(x.content),x.alias);else if(Array.isArray(x))return x.map(_);else return x.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){if(!_.__id)Object.defineProperty(_,"__id",{value:++n});return _.__id},clone:function _(x,C){C=C||{};var y,N;switch(r.util.type(x)){case"Object":if(N=r.util.objId(x),C[N])return C[N];y={},C[N]=y;for(var E in x)if(x.hasOwnProperty(E))y[E]=_(x[E],C);return y;case"Array":if(N=r.util.objId(x),C[N])return C[N];return y=[],C[N]=y,x.forEach(function(v,b){y[b]=_(v,C)}),y;default:return x}},getLanguage:function(_){while(_){var x=t.exec(_.className);if(x)return x[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,x){_.className=_.className.replace(RegExp(t,"gi"),""),_.classList.add("language-"+x)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(y){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(_){var x=document.getElementsByTagName("script");for(var C in x)if(x[C].src==_)return x[C]}return null}},isActive:function(_,x,C){var y="no-"+x;while(_){var N=_.classList;if(N.contains(x))return!0;if(N.contains(y))return!1;_=_.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(_,x){var C=r.util.clone(r.languages[_]);for(var y in x)C[y]=x[y];return C},insertBefore:function(_,x,C,y){y=y||r.languages;var N=y[_],E={};for(var v in N)if(N.hasOwnProperty(v)){if(v==x){for(var b in C)if(C.hasOwnProperty(b))E[b]=C[b]}if(!C.hasOwnProperty(v))E[v]=N[v]}var A=y[_];return y[_]=E,r.languages.DFS(r.languages,function(O,D){if(D===A&&O!=_)this[O]=E}),E},DFS:function _(x,C,y,N){N=N||{};var E=r.util.objId;for(var v in x)if(x.hasOwnProperty(v)){C.call(x,v,x[v],y||v);var b=x[v],A=r.util.type(b);if(A==="Object"&&!N[E(b)])N[E(b)]=!0,_(b,C,null,N);else if(A==="Array"&&!N[E(b)])N[E(b)]=!0,_(b,C,v,N)}}},plugins:{},highlightAll:function(_,x){r.highlightAllUnder(document,_,x)},highlightAllUnder:function(_,x,C){var y={callback:C,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),r.hooks.run("before-all-elements-highlight",y);for(var N=0,E;E=y.elements[N++];)r.highlightElement(E,x===!0,y.callback)},highlightElement:function(_,x,C){var y=r.util.getLanguage(_),N=r.languages[y];r.util.setLanguage(_,y);var E=_.parentElement;if(E&&E.nodeName.toLowerCase()==="pre")r.util.setLanguage(E,y);var v=_.textContent,b={element:_,language:y,grammar:N,code:v};function A(D){b.highlightedCode=D,r.hooks.run("before-insert",b),b.element.innerHTML=b.highlightedCode,r.hooks.run("after-highlight",b),r.hooks.run("complete",b),C&&C.call(b.element)}if(r.hooks.run("before-sanity-check",b),E=b.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex"))E.setAttribute("tabindex","0");if(!b.code){r.hooks.run("complete",b),C&&C.call(b.element);return}if(r.hooks.run("before-highlight",b),!b.grammar){A(r.util.encode(b.code));return}if(x&&e.Worker){var O=new Worker(r.filename);O.onmessage=function(D){A(D.data)},O.postMessage(JSON.stringify({language:b.language,code:b.code,immediateClose:!0}))}else A(r.highlight(b.code,b.grammar,b.language))},highlight:function(_,x,C){var y={code:_,grammar:x,language:C};if(r.hooks.run("before-tokenize",y),!y.grammar)throw Error('The language "'+y.language+'" has no grammar.');return y.tokens=r.tokenize(y.code,y.grammar),r.hooks.run("after-tokenize",y),s.stringify(r.util.encode(y.tokens),y.language)},tokenize:function(_,x){var C=x.rest;if(C){for(var y in C)x[y]=C[y];delete x.rest}var N=new c;return u(N,N.head,_),l(_,N,x,N.head,0),f(N)},hooks:{all:{},add:function(_,x){var C=r.hooks.all;C[_]=C[_]||[],C[_].push(x)},run:function(_,x){var C=r.hooks.all[_];if(!C||!C.length)return;for(var y=0,N;N=C[y++];)N(x)}},Token:s};e.Prism=r;function s(_,x,C,y){this.type=_,this.content=x,this.alias=C,this.length=(y||"").length|0}s.stringify=function _(x,C){if(typeof x=="string")return x;if(Array.isArray(x)){var y="";return x.forEach(function(A){y+=_(A,C)}),y}var N={type:x.type,content:_(x.content,C),tag:"span",classes:["token",x.type],attributes:{},language:C},E=x.alias;if(E)if(Array.isArray(E))Array.prototype.push.apply(N.classes,E);else N.classes.push(E);r.hooks.run("wrap",N);var v="";for(var b in N.attributes)v+=" "+b+'="'+(N.attributes[b]||"").replace(/"/g,""")+'"';return"<"+N.tag+' class="'+N.classes.join(" ")+'"'+v+">"+N.content+"</"+N.tag+">"};function i(_,x,C,y){_.lastIndex=x;var N=_.exec(C);if(N&&y&&N[1]){var E=N[1].length;N.index+=E,N[0]=N[0].slice(E)}return N}function l(_,x,C,y,N,E){for(var v in C){if(!C.hasOwnProperty(v)||!C[v])continue;var b=C[v];b=Array.isArray(b)?b:[b];for(var A=0;A<b.length;++A){if(E&&E.cause==v+","+A)return;var O=b[A],D=O.inside,H=!!O.lookbehind,k=!!O.greedy,q=O.alias;if(k&&!O.pattern.global){var j=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,j+"g")}var oe=O.pattern||O;for(var B=y.next,de=N;B!==x.tail;de+=B.value.length,B=B.next){if(E&&de>=E.reach)break;var xe=B.value;if(x.length>_.length)return;if(xe instanceof s)continue;var ve=1,te;if(k){if(te=i(oe,de,_,H),!te||te.index>=_.length)break;var Me=te.index,ae=te.index+te[0].length,ce=de;ce+=B.value.length;while(Me>=ce)B=B.next,ce+=B.value.length;if(ce-=B.value.length,de=ce,B.value instanceof s)continue;for(var Re=B;Re!==x.tail&&(ce<ae||typeof Re.value==="string");Re=Re.next)ve++,ce+=Re.value.length;ve--,xe=_.slice(de,ce),te.index-=de}else if(te=i(oe,0,xe,H),!te)continue;var Me=te.index,gt=te[0],Jt=xe.slice(0,Me),ke=xe.slice(Me+gt.length),ht=de+xe.length;if(E&&ht>E.reach)E.reach=ht;var Gt=B.prev;if(Jt)Gt=u(x,Gt,Jt),de+=Jt.length;d(x,Gt,ve);var Cr=new s(v,D?r.tokenize(gt,D):gt,q,gt);if(B=u(x,Gt,Cr),ke)u(x,B,ke);if(ve>1){var Jo={cause:v+","+A,reach:ht};if(l(_,x,C,B.prev,de,Jo),E&&Jo.reach>E.reach)E.reach=Jo.reach}}}}}function c(){var _={value:null,prev:null,next:null},x={value:null,prev:_,next:null};_.next=x,this.head=_,this.tail=x,this.length=0}function u(_,x,C){var y=x.next,N={value:C,prev:x,next:y};return x.next=N,y.prev=N,_.length++,N}function d(_,x,C){var y=x.next;for(var N=0;N<C&&y!==_.tail;N++)y=y.next;x.next=y,y.prev=x,_.length-=N}function f(_){var x=[],C=_.head.next;while(C!==_.tail)x.push(C.value),C=C.next;return x}if(!e.document){if(!e.addEventListener)return r;if(!r.disableWorkerMessageHandler)e.addEventListener("message",function(_){var x=JSON.parse(_.data),{language:C,code:y,immediateClose:N}=x;if(e.postMessage(r.highlight(y,r.languages[C],C)),N)e.close()},!1);return r}var p=r.util.currentScript();if(p){if(r.filename=p.src,p.hasAttribute("data-manual"))r.manual=!0}function h(){if(!r.manual)r.highlightAll()}if(!r.manual){var m=document.readyState;if(m==="loading"||m==="interactive"&&p&&p.defer)document.addEventListener("DOMContentLoaded",h);else if(window.requestAnimationFrame)window.requestAnimationFrame(h);else window.setTimeout(h,16)}return r}(iI);if(typeof Pd<"u"&&Pd.exports)Pd.exports=he;if(typeof global<"u")global.Prism=he;he.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]};he.languages.markup.tag.inside["attr-value"].inside.entity=he.languages.markup.entity;he.languages.markup.doctype.inside["internal-subset"].inside=he.languages.markup;he.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&/,"&")});Object.defineProperty(he.languages.markup.tag,"addInlined",{value:function(t,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:he.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:he.languages[n]};var s={};s[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},he.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(he.languages.markup.tag,"addAttribute",{value:function(e,t){he.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:he.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});he.languages.html=he.languages.markup;he.languages.mathml=he.languages.markup;he.languages.svg=he.languages.markup;he.languages.xml=he.languages.extend("markup",{});he.languages.ssml=he.languages.xml;he.languages.atom=he.languages.xml;he.languages.rss=he.languages.xml;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(he);he.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:/[{}[\];(),.:]/};he.languages.javascript=he.languages.extend("clike",{"class-name":[he.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});he.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;he.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:he.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:he.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:he.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:he.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:he.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});he.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:he.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});he.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(he.languages.markup)he.languages.markup.tag.addInlined("script","javascript"),he.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");he.languages.js=he.languages.javascript;(function(){if(typeof he>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var e="Loading…",t=function(p,h){return"✖ Error "+p+" while fetching file: "+h},n="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",s="loading",i="loaded",l="failed",c="pre[data-src]:not(["+r+'="'+i+'"]):not(['+r+'="'+s+'"])';function u(p,h,m){var _=new XMLHttpRequest;_.open("GET",p,!0),_.onreadystatechange=function(){if(_.readyState==4)if(_.status<400&&_.responseText)h(_.responseText);else if(_.status>=400)m(t(_.status,_.statusText));else m(n)},_.send(null)}function d(p){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(h){var m=Number(h[1]),_=h[2],x=h[3];if(!_)return[m,m];if(!x)return[m,void 0];return[m,Number(x)]}return}he.hooks.add("before-highlightall",function(p){p.selector+=", "+c}),he.hooks.add("before-sanity-check",function(p){var h=p.element;if(h.matches(c)){p.code="",h.setAttribute(r,s);var m=h.appendChild(document.createElement("CODE"));m.textContent=e;var _=h.getAttribute("data-src"),x=p.language;if(x==="none"){var C=(/\.(\w+)$/.exec(_)||[,"none"])[1];x=o[C]||C}he.util.setLanguage(m,x),he.util.setLanguage(h,x);var y=he.plugins.autoloader;if(y)y.loadLanguages(x);u(_,function(N){h.setAttribute(r,i);var E=d(h.getAttribute("data-range"));if(E){var v=N.split(/\r\n?|\n/g),b=E[0],A=E[1]==null?v.length:E[1];if(b<0)b+=v.length;if(b=Math.max(0,Math.min(b-1,v.length)),A<0)A+=v.length;if(A=Math.max(0,Math.min(A,v.length)),N=v.slice(b,A).join(`
|
|
2
|
-
`),!h.hasAttribute("data-start"))h.setAttribute("data-start",String(b+1))}m.textContent=N,he.highlightElement(m)},function(N){h.setAttribute(r,l),m.textContent=N})}}),he.plugins.fileHighlight={highlight:function(h){var m=(h||document).querySelectorAll(c);for(var _=0,x;x=m[_++];)he.highlightElement(x)}};var f=!1;he.fileHighlight=function(){if(!f)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),f=!0;he.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var qd={};Ye(qd,{LexicalComposerContext:()=>Xm,createLexicalComposerContext:()=>KO,useLexicalComposerContext:()=>zO});var Fg={};Ye(Fg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>Xa,$assumeActiveEditor:()=>cR,$caretFromPoint:()=>$r,$caretRangeFromSelection:()=>Ff,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>YR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>XR,$createChildrenArray:()=>Fa,$createLineBreakNode:()=>Pc,$createNodeSelection:()=>bc,$createParagraphNode:()=>bn,$createPoint:()=>ho,$createRangeSelection:()=>CC,$createRangeSelectionFromDom:()=>sR,$createTabNode:()=>iC,$createTextNode:()=>hn,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>yr,$formatText:()=>uC,$fullReconcile:()=>EC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>di,$getAdjacentNode:()=>HC,$getAdjacentSiblingOrParentSiblingCaret:()=>iM,$getCaretInDirection:()=>ko,$getCaretRange:()=>Dr,$getCaretRangeInDirection:()=>Ig,$getCharacterOffsets:()=>Rf,$getChildCaret:()=>sr,$getChildCaretAtIndex:()=>Ey,$getChildCaretOrSelf:()=>xy,$getCollapsedCaretRange:()=>Cy,$getCommonAncestor:()=>kc,$getCommonAncestorResultBranchOrder:()=>kg,$getDOMSlot:()=>On,$getDOMTextNode:()=>or,$getDocument:()=>_n,$getEditor:()=>_o,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>YC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>vn,$getSelection:()=>Fe,$getSiblingCaret:()=>Ct,$getSlot:()=>Ar,$getSlotFrame:()=>gy,$getSlotHost:()=>Kn,$getSlotNameWithinHost:()=>fy,$getSlotNames:()=>Hn,$getState:()=>mc,$getStateChange:()=>CA,$getTextContent:()=>aR,$getTextNodeOffset:()=>po,$getTextPointCaret:()=>Mr,$getTextPointCaretSlice:()=>Lf,$getWritableNodeState:()=>Wf,$hasAncestor:()=>Ia,$hasUpdateTag:()=>IR,$insertNodeToNearestRootAtCaret:()=>by,$insertNodes:()=>iR,$isBlockElementNode:()=>_C,$isChildCaret:()=>Wn,$isDecoratorNode:()=>Ve,$isEditorState:()=>fR,$isElementDOMSlot:()=>ry,$isElementNode:()=>P,$isExtendableTextPointCaret:()=>Ny,$isInlineElementOrDecoratorNode:()=>jC,$isInlineFormattable:()=>Tc,$isLeafNode:()=>DR,$isLexicalNode:()=>og,$isLineBreakNode:()=>wo,$isNodeCaret:()=>tM,$isNodeSelection:()=>fi,$isParagraphNode:()=>DC,$isRangeSelection:()=>fe,$isRootNode:()=>Ft,$isRootOrShadowRoot:()=>vt,$isSelectionCapturedInDecoratorInput:()=>Kc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>Rr,$isSlotChild:()=>Or,$isSlotHost:()=>Ro,$isTabNode:()=>sg,$isTextNode:()=>V,$isTextPointCaret:()=>go,$isTextPointCaretSlice:()=>sM,$isTokenOrSegmented:()=>Un,$isTokenOrTab:()=>ka,$markSlotEditable:()=>cy,$needsBlockCursorBeside:()=>gc,$nodesOfType:()=>kR,$normalizeCaret:()=>Mo,$normalizeSelection__EXPERIMENTAL:()=>ni,$onUpdate:()=>GC,$parseSerializedNode:()=>uR,$removeFromParent:()=>Bn,$removeSlot:()=>my,$removeTextFromCaretRange:()=>Sy,$rewindSiblingCaret:()=>Ts,$selectAll:()=>wR,$setCompositionKey:()=>Lt,$setDirectionFromDOM:()=>iy,$setFormatFromDOM:()=>ay,$setPointFromCaret:()=>Ba,$setSelection:()=>en,$setSelectionFromCaretRange:()=>yy,$setSlot:()=>Og,$setState:()=>yA,$setTextFormat:()=>oR,$splitAtPointCaretNext:()=>Ty,$splitNode:()=>PR,$updateDOMSelection:()=>yC,$updateRangeSelectionFromCaretRange:()=>_a,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>jf,BLUR_COMMAND:()=>Wx,CAN_REDO_COMMAND:()=>IA,CAN_UNDO_COMMAND:()=>LA,CAN_USE_BEFORE_INPUT:()=>xa,CAN_USE_DOM:()=>jn,CLEAR_EDITOR_COMMAND:()=>wA,CLEAR_HISTORY_COMMAND:()=>kA,CLICK_COMMAND:()=>vx,COLLABORATION_TAG:()=>Qx,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>TR,COMMAND_PRIORITY_BEFORE_EDITOR:()=>yR,COMMAND_PRIORITY_BEFORE_HIGH:()=>ER,COMMAND_PRIORITY_BEFORE_LOW:()=>SR,COMMAND_PRIORITY_BEFORE_NORMAL:()=>NR,COMMAND_PRIORITY_CRITICAL:()=>CR,COMMAND_PRIORITY_EDITOR:()=>ti,COMMAND_PRIORITY_HIGH:()=>xR,COMMAND_PRIORITY_LOW:()=>mR,COMMAND_PRIORITY_NORMAL:()=>_R,COMPOSITION_END_COMMAND:()=>Xf,COMPOSITION_END_TAG:()=>Ec,COMPOSITION_START_COMMAND:()=>Vf,COMPOSITION_START_TAG:()=>nC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ii,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>VA,DEFAULT_EDITOR_DOM_CONFIG:()=>wa,DELETE_CHARACTER_COMMAND:()=>Oa,DELETE_LINE_COMMAND:()=>Ra,DELETE_WORD_COMMAND:()=>Aa,DRAGEND_COMMAND:()=>zx,DRAGOVER_COMMAND:()=>Kx,DRAGSTART_COMMAND:()=>Bx,DROP_COMMAND:()=>Px,DecoratorNode:()=>Fc,ElementNode:()=>$o,FOCUS_COMMAND:()=>Hx,FORMAT_ELEMENT_COMMAND:()=>DA,FORMAT_TEXT_COMMAND:()=>Sr,HISTORIC_TAG:()=>GA,HISTORY_MERGE_TAG:()=>uc,HISTORY_PUSH_TAG:()=>jA,INDENT_CONTENT_COMMAND:()=>RA,INPUT_COMMAND:()=>Yf,INSERT_LINE_BREAK_COMMAND:()=>ha,INSERT_PARAGRAPH_COMMAND:()=>Nf,INSERT_TAB_COMMAND:()=>AA,INTERNAL_$isBlock:()=>pn,IS_ALL_FORMATTING:()=>QO,IS_ANDROID:()=>Pf,IS_ANDROID_CHROME:()=>Ca,IS_APPLE:()=>Ln,IS_APPLE_WEBKIT:()=>za,IS_BOLD:()=>jO,IS_CHROME:()=>Bf,IS_CODE:()=>qO,IS_FIREFOX:()=>Do,IS_HIGHLIGHT:()=>Kf,IS_IOS:()=>fs,IS_ITALIC:()=>YO,IS_SAFARI:()=>Ka,IS_STRIKETHROUGH:()=>VO,IS_SUBSCRIPT:()=>JO,IS_SUPERSCRIPT:()=>ZO,IS_UNDERLINE:()=>XO,KEY_ARROW_DOWN_COMMAND:()=>$x,KEY_ARROW_LEFT_COMMAND:()=>Rx,KEY_ARROW_RIGHT_COMMAND:()=>Ox,KEY_ARROW_UP_COMMAND:()=>Dx,KEY_BACKSPACE_COMMAND:()=>kx,KEY_DELETE_COMMAND:()=>Lx,KEY_DOWN_COMMAND:()=>Qf,KEY_ENTER_COMMAND:()=>xc,KEY_ESCAPE_COMMAND:()=>Ix,KEY_MODIFIER_COMMAND:()=>Gx,KEY_SPACE_COMMAND:()=>wx,KEY_TAB_COMMAND:()=>Fx,LineBreakNode:()=>Ga,MOVE_TO_END:()=>Ax,MOVE_TO_START:()=>Mx,NODE_STATE_DIRECT:()=>ff,NODE_STATE_KEY:()=>fA,NODE_STATE_LATEST:()=>gf,OUTDENT_CONTENT_COMMAND:()=>MA,PASTE_COMMAND:()=>qf,PASTE_TAG:()=>YA,ParagraphNode:()=>ja,REDO_COMMAND:()=>Zf,REMOVE_TEXT_COMMAND:()=>ac,RootNode:()=>Ha,SELECTION_CHANGE_COMMAND:()=>Gf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>vA,SELECT_ALL_COMMAND:()=>Ux,SET_TEXT_FORMAT_COMMAND:()=>OA,SKIP_COLLAB_TAG:()=>XA,SKIP_DOM_SELECTION_TAG:()=>tC,SKIP_SCROLL_INTO_VIEW_TAG:()=>eC,SKIP_SELECTION_FOCUS_TAG:()=>Nc,TEXT_TYPE_TO_FORMAT:()=>jt,TabNode:()=>Ua,TextNode:()=>ms,UNDO_COMMAND:()=>Jf,addClassNamesToElement:()=>pM,buildImportMap:()=>WA,configExtension:()=>uM,createCommand:()=>Ne,createEditor:()=>bR,createRefCountedRegistry:()=>jx,createSharedNodeState:()=>mx,createState:()=>xA,declarePeerDependency:()=>dM,defineExtension:()=>cM,findAllLexicalElementsDeep:()=>qC,flipDirection:()=>wr,getActiveElement:()=>wc,getActiveElementDeep:()=>ui,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>hi,getDOMOwnerDocument:()=>Uc,getDOMSelection:()=>Yn,getDOMSelectionFromTarget:()=>VC,getDOMSelectionPoints:()=>Gn,getDOMSelectionRange:()=>ZC,getDOMSelectionRangeAndPoints:()=>FR,getDOMShadowRoots:()=>XC,getDOMTextNode:()=>IC,getDeclaredSlots:()=>py,getEditorPropertyFromDOMNode:()=>Va,getNearestEditorFromDOMNode:()=>ds,getParentElement:()=>Es,getRegisteredNode:()=>Bc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>VR,getRootOwnerDocument:()=>JC,getStaticNodeConfig:()=>qa,getStyleObjectFromCSS:()=>Of,getTextDirection:()=>MR,getTransformSetFromKlass:()=>wC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>br,isDOMCapturingSelection:()=>La,isDOMDocumentNode:()=>gi,isDOMNode:()=>mi,isDOMShadowRoot:()=>rr,isDOMTextNode:()=>mo,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>ny,isExactShortcutMatch:()=>Ze,isHTMLAnchorElement:()=>BR,isHTMLElement:()=>_t,isHTMLTableCellElement:()=>zR,isHTMLTableRowElement:()=>KR,isInlineDomNode:()=>oy,isLastChildInBlockNode:()=>MC,isLexicalEditor:()=>zc,isModifierMatch:()=>UC,isOnlyChildInBlockNode:()=>RC,isSelectionCapturedInDecoratorInput:()=>RR,isSelectionWithinEditor:()=>Ya,iterStaticNodeConfigChain:()=>Ja,makeStepwiseIterator:()=>$g,mergeRegister:()=>Lg,mountSlotContainer:()=>WR,normalizeClassNames:()=>Qa,registerEventListener:()=>ng,registerEventListeners:()=>mM,removeClassNamesFromElement:()=>hM,removeFromParent:()=>$R,resetRandomKey:()=>OR,safeCast:()=>fM,setDOMStyleFromCSS:()=>Af,setDOMStyleObject:()=>JA,setDOMUnmanaged:()=>ly,setNodeIndentFromDOM:()=>sy,shallowMergeConfig:()=>gM,stopLexicalPropagation:()=>bf,toggleTextFormatType:()=>vr,tokenizeRawText:()=>SC,unmountSlotContainer:()=>GR});var Jg={};Ye(Jg,{LexicalComposer:()=>xM});var Zg={};Ye(Zg,{useLexicalEditable:()=>NM});var rp={};Ye(rp,{$addNodeStyle:()=>RM,$cloneWithProperties:()=>Wc,$copyBlockFormatIndent:()=>IS,$ensureForwardRangeSelection:()=>kS,$forEachSelectedTextNode:()=>wS,$getComputedStyleForElement:()=>tp,$getComputedStyleForParent:()=>np,$getSelectionStyleValueForProperty:()=>FM,$isAtEdgeOfElement:()=>LS,$isAtNodeEnd:()=>AM,$isParentElementRTL:()=>op,$isParentRTL:()=>vM,$moveCaretSelection:()=>BS,$moveCharacter:()=>IM,$patchStyleText:()=>MM,$selectAll:()=>zr,$setBlocksType:()=>DM,$shouldOverrideDefaultCharacterSelection:()=>kM,$sliceSelectedTextNodeContent:()=>OM,$trimTextContentFromAnchor:()=>$S,$wrapNodes:()=>wM,createDOMRange:()=>TM,createRectsFromDOMRange:()=>bM,getCSSFromStyleObject:()=>DS,getStyleObjectFromCSS:()=>PM,trimTextContentFromAnchor:()=>BM});var hp={};Ye(hp,{$descendantsMatching:()=>gD,$dfs:()=>GM,$dfsIterator:()=>YS,$dfsWithSlots:()=>VM,$dfsWithSlotsIterator:()=>VS,$filter:()=>aD,$findMatchingParent:()=>pe,$firstToLastIterator:()=>pD,$getAdjacentCaret:()=>jM,$getAdjacentSiblingOrParentSiblingCaret:()=>vs,$getDepth:()=>XS,$getNearestBlockElementAncestorOrThrow:()=>QM,$getNearestNodeOfType:()=>ZM,$getNextRightPreorderNode:()=>qM,$getNextSiblingOrParentSibling:()=>XM,$handleIndentAndOutdent:()=>lD,$insertFirst:()=>cD,$insertNodeIntoLeaf:()=>rD,$insertNodeToNearestRoot:()=>oD,$insertNodeToNearestRootAtCaret:()=>Pr,$isAtEndOfNode:()=>nN,$isAtStartOfNode:()=>tN,$isBlockFullySelected:()=>eD,$isEditorIsNestedEditor:()=>dD,$lastToFirstIterator:()=>pp,$onEscapeDown:()=>xD,$onEscapeUp:()=>_D,$restoreEditorState:()=>nD,$reverseDfs:()=>YM,$reverseDfsIterator:()=>qS,$reverseDfsWithSlots:()=>JM,$reverseDfsWithSlotsIterator:()=>JS,$splitNode:()=>Hy,$unwrapAndFilterDescendants:()=>fD,$unwrapNode:()=>hD,$wrapNodeInElement:()=>sD,CAN_USE_BEFORE_INPUT:()=>cl,CAN_USE_DOM:()=>un,IS_ANDROID:()=>Qy,IS_ANDROID_CHROME:()=>eS,IS_APPLE:()=>dl,IS_APPLE_WEBKIT:()=>du,IS_CHROME:()=>tS,IS_FIREFOX:()=>$s,IS_IOS:()=>gl,IS_SAFARI:()=>fu,addClassNamesToElement:()=>Qe,calculateZoomLevel:()=>uD,dedupeSelectionRects:()=>HS,eventFiles:()=>iD,getScrollParent:()=>HM,isBlockDomNode:()=>Is,isHTMLAnchorElement:()=>wi,isHTMLElement:()=>Ce,isInlineDomNode:()=>ki,isMimeType:()=>jS,makeStateWrapper:()=>mD,markSelection:()=>GS,mediaFileReader:()=>WM,mergeRegister:()=>Oe,objectKlassEquals:()=>gp,positionNodeOnRange:()=>WS,registerNestedElementResolver:()=>tD,removeClassNamesFromElement:()=>nn,selectionAlwaysOnDisplay:()=>UM});var wp={};Ye(wp,{$applyFormatToDom:()=>OD,$createHorizontalRuleNode:()=>$p,$defaultShouldInsertAfter:()=>SN,$getExtensionDependency:()=>$N,$getExtensionOutput:()=>BD,$getPeerDependency:()=>KD,$isDecoratorTextNode:()=>bD,$isHorizontalRuleNode:()=>kN,AutoFocusExtension:()=>ND,ClearEditorExtension:()=>ED,ClickAfterLastBlockExtension:()=>TD,DecoratorTextExtension:()=>MD,DecoratorTextNode:()=>Wu,EditorStateExtension:()=>Uu,HorizontalRuleExtension:()=>HD,HorizontalRuleNode:()=>Ki,IMEExtension:()=>WD,INSERT_HORIZONTAL_RULE_COMMAND:()=>wN,InitialStateExtension:()=>MN,LexicalBuilder:()=>dr,NestedEditorExtension:()=>GD,NodeSelectionDataSelectedExtension:()=>jD,NodeSelectionExtension:()=>Op,NormalizeInlineElementsExtension:()=>YD,NormalizeTripleClickSelectionExtension:()=>XD,PreventSelectAllExtension:()=>Ap,RootElementExtension:()=>JD,SelectBlockExtension:()=>ZD,SelectionAlwaysOnDisplayExtension:()=>QD,TabIndentationExtension:()=>e$,WatchEditableExtension:()=>t$,applyFormatFromStyle:()=>vD,applyFormatToDom:()=>TN,batch:()=>pN,buildEditorFromExtensions:()=>LD,computed:()=>_N,configExtension:()=>tn,declarePeerDependency:()=>uS,defineExtension:()=>me,effect:()=>qt,getExtensionDependencyFromEditor:()=>DN,getKnownTypesAndNodes:()=>NN,getPeerDependencyFromEditor:()=>Dp,getPeerDependencyFromEditorOrThrow:()=>PD,namedSignals:()=>So,registerClearEditor:()=>yN,registerTabIndentation:()=>LN,safeCast:()=>Be,shallowMergeConfig:()=>Pt,signal:()=>Zr,untracked:()=>Tp,watchedSignal:()=>Ol});var Ip={};Ye(Ip,{ReactProviderExtension:()=>n$});var Fp={};Ye(Fp,{$canShowPlaceholder:()=>XN,$canShowPlaceholderCurry:()=>s$,$findTextIntersectionFromCharacters:()=>i$,$isRootTextContentEmpty:()=>Lp,$isRootTextContentEmptyCurry:()=>r$,$rootTextContent:()=>VN,registerLexicalTextEntity:()=>l$});var Pp={};Ye(Pp,{DragonExtension:()=>g$,installDragonSupport:()=>u$,registerDragonSupport:()=>ZN});var th={};Ye(th,{$appendNodeToHTML:()=>pw,$distributeInlineWrapper:()=>kE,$generateDOMFromNodes:()=>jE,$generateDOMFromRoot:()=>fw,$generateHtmlFromNodes:()=>gw,$generateNodesFromDOM:()=>dw,$generateNodesFromDOMViaExtension:()=>aw,$getImportContextValue:()=>wE,$getRenderContextValue:()=>x$,$getSessionDOMRenderConfig:()=>ed,$inlineStylesFromStyleSheets:()=>pE,$isBlockLevel:()=>Hi,$propagateTextAlignToBlockChildren:()=>IE,$setRenderContextValue:()=>C$,$updateRenderContextValue:()=>y$,$withImportContext:()=>Jp,$withRenderContext:()=>qp,BlockSchema:()=>FE,CoreImportExtension:()=>WE,CoreImportRules:()=>KE,DOMImportExtension:()=>eh,DOMRenderExtension:()=>k$,HorizontalRuleImportExtension:()=>cw,HorizontalRuleImportRules:()=>lw,ImportOverlays:()=>ME,ImportSource:()=>z$,ImportSourceDataTransfer:()=>U$,ImportTextFormat:()=>Ju,ImportTextStyle:()=>vE,ImportWhitespaceConfig:()=>RE,InlineSchema:()=>H$,NestedBlockSchema:()=>W$,RenderContextExport:()=>Vp,RenderContextRoot:()=>_E,RootSchema:()=>PE,contextUpdater:()=>m$,contextValue:()=>Al,createImportState:()=>Hs,createRenderState:()=>Yp,defaultIsInline:()=>AE,defaultPreservesWhitespace:()=>OE,defineImportRule:()=>gr,defineOverlayRules:()=>ow,domOverride:()=>S$,isElementOfTag:()=>B$,parseSelector:()=>bE,sel:()=>uw});var uh={};Ye(uh,{$exportMimeTypeFromSelection:()=>Tw,$generateJSONFromSelectedNodes:()=>fT,$generateNodesFromSerializedNodes:()=>gT,$getClipboardDataFromSelection:()=>pT,$getHtmlContent:()=>lh,$getLexicalContent:()=>ch,$handlePlainTextDrop:()=>Sw,$handleRichTextDrop:()=>yw,$insertDataTransferForPlainText:()=>lT,$insertDataTransferForRichText:()=>cT,$insertGeneratedNodes:()=>id,$writeDragSourceToDataTransfer:()=>Cw,ClipboardDOMImportExtension:()=>xw,ClipboardImportExtension:()=>ah,DEFAULT_IMPORT_MIME_TYPE:()=>sd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>rd,GetClipboardDataExtension:()=>CT,caretFromPoint:()=>sT,copyToClipboard:()=>Nw,setLexicalClipboardDataTransfer:()=>hT});var gh={};Ye(gh,{$createHeadingNode:()=>Xi,$createQuoteNode:()=>wl,$isHeadingNode:()=>$w,$isQuoteNode:()=>Mw,DRAG_DROP_PASTE:()=>fh,HeadingNode:()=>kl,QuoteNode:()=>$l,RichTextExtension:()=>DT,RichTextImportExtension:()=>Rw,RichTextImportRules:()=>MT,ShadowRootQuoteRule:()=>Ow,eventFiles:()=>Ps,quoteShadowRootState:()=>fd,registerRichText:()=>$T});var hh={};Ye(hh,{RichTextPlugin:()=>Fw});var mh={};Ye(mh,{ContentEditable:()=>zw,ContentEditableElement:()=>PT});var _h={};Ye(_h,{HistoryExtension:()=>xd,SharedHistoryExtension:()=>jw,createEmptyHistoryState:()=>HT,registerHistory:()=>UT});var xh={};Ye(xh,{HistoryPlugin:()=>Yw,createEmptyHistoryState:()=>yd});var Eh={};Ye(Eh,{$createListItemNode:()=>Eo,$createListNode:()=>No,$getListDepth:()=>Sd,$handleListInsertParagraph:()=>s0,$insertList:()=>Nd,$isListItemNode:()=>De,$isListNode:()=>Ae,$removeList:()=>o0,CheckListExtension:()=>tk,INSERT_CHECK_LIST_COMMAND:()=>a0,INSERT_ORDERED_LIST_COMMAND:()=>h0,INSERT_UNORDERED_LIST_COMMAND:()=>p0,ListExtension:()=>Nh,ListImportExtension:()=>nk,ListImportRules:()=>f0,ListItemNode:()=>js,ListNode:()=>qi,ListSchema:()=>ek,REMOVE_LIST_COMMAND:()=>m0,UPDATE_LIST_START_COMMAND:()=>g0,registerCheckList:()=>l0,registerList:()=>_0,registerListStrictIndentTransform:()=>x0});var vh={};Ye(vh,{ListPlugin:()=>ok});var Oh={};Ye(Oh,{CheckListPlugin:()=>sk});var Ah={};Ye(Ah,{TabIndentationPlugin:()=>ak,registerTabIndentation:()=>Yu});var wh={};Ye(wh,{$createAutoLinkNode:()=>$h,$createLinkNode:()=>Fl,$isAutoLinkNode:()=>fn,$isLinkNode:()=>In,$toggleLink:()=>Td,AutoLinkExtension:()=>Ck,AutoLinkNode:()=>Pl,ClickableLinkExtension:()=>fk,LinkExtension:()=>Od,LinkImportExtension:()=>dk,LinkImportRules:()=>I0,LinkNode:()=>ns,TOGGLE_LINK_COMMAND:()=>bd,autoLinkEmailMatcher:()=>hk,autoLinkUrlMatcher:()=>pk,createLinkMatcherWithRegExp:()=>P0,formatUrl:()=>Rh,registerAutoLink:()=>G0,registerClickableLink:()=>F0,registerLink:()=>L0});var Ih={};Ye(Ih,{LinkPlugin:()=>yk});var Lh={};Ye(Lh,{AutoFocusPlugin:()=>Nk});var Uh={};Ye(Uh,{$createCodeHighlightNode:()=>Kh,$createCodeNode:()=>bo,$getCodeLineDirection:()=>sb,$getEndOfCodeInLine:()=>ab,$getFirstCodeNodeOfLine:()=>os,$getLastCodeNodeOfLine:()=>Vs,$getStartOfCodeInLine:()=>ib,$isCodeHighlightNode:()=>Bt,$isCodeNode:()=>En,$outdentLeadingSpaces:()=>lb,$plainifyCodeContent:()=>Tk,CodeExtension:()=>zh,CodeHighlightNode:()=>Hl,CodeImportExtension:()=>kk,CodeImportRules:()=>Cb,CodeIndentExtension:()=>Ik,CodeNode:()=>Ul,DEFAULT_CODE_LANGUAGE:()=>cb,getDefaultCodeLanguage:()=>bk,registerCodeIndentation:()=>Sb});var Zh={};Ye(Zh,{$convertFromMarkdownString:()=>qk,$convertSelectionToMarkdownString:()=>Qk,$convertToMarkdownString:()=>Zk,$generateNodesFromMarkdownString:()=>Jk,BOLD_ITALIC_STAR:()=>sv,BOLD_ITALIC_UNDERSCORE:()=>iv,BOLD_STAR:()=>av,BOLD_UNDERSCORE:()=>lv,CHECK_LIST:()=>Kk,CODE:()=>Yl,ELEMENT_TRANSFORMERS:()=>gv,HEADING:()=>Qb,HIGHLIGHT:()=>rv,INLINE_CODE:()=>ov,ITALIC_STAR:()=>uv,ITALIC_UNDERSCORE:()=>dv,LINK:()=>fv,MULTILINE_ELEMENT_TRANSFORMERS:()=>pv,ORDERED_LIST:()=>nv,QUOTE:()=>ev,STRIKETHROUGH:()=>cv,TEXT_FORMAT_TRANSFORMERS:()=>hv,TEXT_MATCH_TRANSFORMERS:()=>mv,TRANSFORMERS:()=>ta,UNORDERED_LIST:()=>tv,isTableRowDivider:()=>Xb,registerMarkdownShortcuts:()=>Xk});var em={};Ye(em,{DEFAULT_TRANSFORMERS:()=>Rv,MarkdownShortcutPlugin:()=>eI});var tm={};Ye(tm,{OnChangePlugin:()=>nI});var nm={};Ye(nm,{LexicalErrorBoundary:()=>rI});var lm={};Ye(lm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>im,CODE_LANGUAGE_MAP:()=>Fv,CodePrismExtension:()=>hI,PrismTokenizer:()=>am,getCodeLanguageOptions:()=>uI,getCodeLanguages:()=>cI,getCodeThemeOptions:()=>dI,getLanguageFriendlyName:()=>lI,isCodeLanguageLoaded:()=>Bv,loadCodeLanguage:()=>Kv,normalizeCodeLanguage:()=>Pv,registerCodeHighlighting:()=>pI});var _m={};Ye(_m,{$createCodeHighlightNode:()=>Md,$createCodeNode:()=>Xs,$getCodeLineDirection:()=>Nb,$getEndOfCodeInLine:()=>Eb,$getFirstCodeNodeOfLine:()=>Tb,$getLastCodeNodeOfLine:()=>bb,$getStartOfCodeInLine:()=>vb,$isCodeHighlightNode:()=>ea,$isCodeNode:()=>Xo,$outdentLeadingSpaces:()=>Ob,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>_I,CODE_LANGUAGE_MAP:()=>xI,CodeExtension:()=>Dd,CodeHighlightNode:()=>Gl,CodeIndentExtension:()=>$d,CodeNode:()=>rs,DEFAULT_CODE_LANGUAGE:()=>wd,PrismTokenizer:()=>bI,getCodeLanguageOptions:()=>CI,getCodeLanguages:()=>yI,getCodeThemeOptions:()=>SI,getDefaultCodeLanguage:()=>Rb,getLanguageFriendlyName:()=>NI,normalizeCodeLang:()=>EI,normalizeCodeLanguage:()=>TI,registerCodeHighlighting:()=>vI});var Lm={};Ye(Lm,{$computeTableCellRectBoundary:()=>Jl,$computeTableMap:()=>on,$computeTableMapSkipCellCheck:()=>uo,$createTableCellNode:()=>gn,$createTableNode:()=>tc,$createTableNodeWithDimensions:()=>Qv,$createTableRowNode:()=>mr,$createTableSelection:()=>GI,$createTableSelectionFrom:()=>Gd,$deleteTableColumn:()=>LI,$deleteTableColumnAtSelection:()=>rO,$deleteTableColumn__EXPERIMENTAL:()=>PI,$deleteTableRowAtSelection:()=>oO,$deleteTableRow__EXPERIMENTAL:()=>FI,$findCellNode:()=>sa,$findTableNode:()=>Qs,$getElementForTableNode:()=>hO,$getNodeTriplet:()=>Kt,$getTableAndElementByKey:()=>km,$getTableCellNodeFromLexicalNode:()=>AI,$getTableCellNodeRect:()=>Em,$getTableColumnIndexFromTableCellNode:()=>MI,$getTableNodeFromLexicalNodeOrThrow:()=>Yd,$getTableRowIndexFromTableCellNode:()=>RI,$getTableRowNodeFromTableCellNodeOrThrow:()=>Mm,$insertTableColumn:()=>kI,$insertTableColumnAtNode:()=>Wd,$insertTableColumnAtSelection:()=>nO,$insertTableColumn__EXPERIMENTAL:()=>II,$insertTableRow:()=>$I,$insertTableRowAtNode:()=>Hd,$insertTableRowAtSelection:()=>tO,$insertTableRow__EXPERIMENTAL:()=>wI,$isScrollableTablesActive:()=>Ql,$isSimpleTable:()=>wm,$isStickyScrollbarActive:()=>Rm,$isTableCellNode:()=>_e,$isTableNode:()=>rt,$isTableRowNode:()=>Le,$isTableSelection:()=>ze,$mergeCells:()=>sO,$moveTableColumn:()=>zI,$moveTableRow:()=>UI,$removeTableRowAtIndex:()=>DI,$setTableColumnIsHeader:()=>WI,$setTableRowIsHeader:()=>HI,$unmergeCell:()=>KI,$unmergeCellNode:()=>$m,INSERT_TABLE_COMMAND:()=>Zv,TableCellHeaderStates:()=>be,TableCellNode:()=>hr,TableExtension:()=>yO,TableImportExtension:()=>f1,TableImportRules:()=>CO,TableNode:()=>xr,TableObserver:()=>Im,TableRowNode:()=>ca,TableRowSchema:()=>d1,TableSchema:()=>u1,applyTableHandlers:()=>cO,getDOMCellFromTarget:()=>Zl,getTableElement:()=>qo,getTableObserverFromTableElement:()=>Tm,registerTableCellUnmergeTransform:()=>mO,registerTablePlugin:()=>xO,registerTableSelectionObserver:()=>_O,setScrollableTablesActive:()=>pO});var AO=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Fm=z("bold",AO);var RO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Pm=z("heading-1",RO);var MO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],Bm=z("heading-2",MO);var DO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],Km=z("heading-3",DO);var $O=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],zm=z("italic",$O);var wO=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Um=z("list-ordered",wO);var kO=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Hm=z("quote",kO);var IO=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],Wm=z("redo-2",IO);var LO=[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]],Gm=z("remove-formatting",LO);var FO=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],jm=z("strikethrough",FO);var PO=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Ym=z("underline",PO);var BO=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Vm=z("undo-2",BO);Z();Z();Z();Z();var Xm=Rt(null);function KO(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t!=null?t:n!=null?n.getTheme():null}}}function zO(){let e=Zt(Xm);return e==null&&function(t,...n){let o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(let s of n)r.append("v",s);throw o.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}var Jd=qd,{LexicalComposerContext:qm,createLexicalComposerContext:Jm,useLexicalComposerContext:st}=Jd;function U(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ix(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);n.search=o.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UO=jn&&"documentMode"in document?document.documentMode:null,Ln=jn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Do=jn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),xa=!(!jn||!("InputEvent"in window)||UO)&&"getTargetRanges"in new window.InputEvent("input"),fs=jn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pf=jn&&/Android/.test(navigator.userAgent),Ka=jn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Pf,Bf=jn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ca=jn&&Pf&&Bf,za=jn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ln&&!Bf,HO=0,WO=1,GO=2,jO=1,YO=2,VO=4,XO=8,qO=16,JO=32,ZO=64,Kf=128,QO=2047,eA=1,tA=2,nA=3,oA=4,rA=5,sA=6,ya=Ka||fs||za?" ":"",us=`
|
|
1
|
+
import{xi,oa,Rt,Y,G,Zt,S,nt,Q,M,w,L,W,a,g,ie,X,ee,We,Js,Mn,R,z,er,qe,ps,Dn,Ge,F,vb,bb,QA,wb,Fl,Y0,Xh,Ie,Xt,$r,Bn,Bo,lr,Ir,Lr}from"./chunk-5ngftxjb.js";import{ba}from"./chunk-ffjdkdcv.js";import{Yr}from"./chunk-d55138xx.js";import{ll}from"./chunk-j2txsbxz.js";import{du}from"./chunk-c8frmqsk.js";import{Jl}from"./chunk-a859y4e1.js";import{nc}from"./chunk-0a298n62.js";import{se,Z,Ye}from"./chunk-4p31kxjh.js";var om=Z(function(pH,Pd){var iI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},he=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function _(x){if(x instanceof s)return new s(x.type,_(x.content),x.alias);else if(Array.isArray(x))return x.map(_);else return x.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){if(!_.__id)Object.defineProperty(_,"__id",{value:++n});return _.__id},clone:function _(x,C){C=C||{};var y,N;switch(r.util.type(x)){case"Object":if(N=r.util.objId(x),C[N])return C[N];y={},C[N]=y;for(var E in x)if(x.hasOwnProperty(E))y[E]=_(x[E],C);return y;case"Array":if(N=r.util.objId(x),C[N])return C[N];return y=[],C[N]=y,x.forEach(function(v,b){y[b]=_(v,C)}),y;default:return x}},getLanguage:function(_){while(_){var x=t.exec(_.className);if(x)return x[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,x){_.className=_.className.replace(RegExp(t,"gi"),""),_.classList.add("language-"+x)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(y){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(_){var x=document.getElementsByTagName("script");for(var C in x)if(x[C].src==_)return x[C]}return null}},isActive:function(_,x,C){var y="no-"+x;while(_){var N=_.classList;if(N.contains(x))return!0;if(N.contains(y))return!1;_=_.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(_,x){var C=r.util.clone(r.languages[_]);for(var y in x)C[y]=x[y];return C},insertBefore:function(_,x,C,y){y=y||r.languages;var N=y[_],E={};for(var v in N)if(N.hasOwnProperty(v)){if(v==x){for(var b in C)if(C.hasOwnProperty(b))E[b]=C[b]}if(!C.hasOwnProperty(v))E[v]=N[v]}var A=y[_];return y[_]=E,r.languages.DFS(r.languages,function(O,D){if(D===A&&O!=_)this[O]=E}),E},DFS:function _(x,C,y,N){N=N||{};var E=r.util.objId;for(var v in x)if(x.hasOwnProperty(v)){C.call(x,v,x[v],y||v);var b=x[v],A=r.util.type(b);if(A==="Object"&&!N[E(b)])N[E(b)]=!0,_(b,C,null,N);else if(A==="Array"&&!N[E(b)])N[E(b)]=!0,_(b,C,v,N)}}},plugins:{},highlightAll:function(_,x){r.highlightAllUnder(document,_,x)},highlightAllUnder:function(_,x,C){var y={callback:C,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),r.hooks.run("before-all-elements-highlight",y);for(var N=0,E;E=y.elements[N++];)r.highlightElement(E,x===!0,y.callback)},highlightElement:function(_,x,C){var y=r.util.getLanguage(_),N=r.languages[y];r.util.setLanguage(_,y);var E=_.parentElement;if(E&&E.nodeName.toLowerCase()==="pre")r.util.setLanguage(E,y);var v=_.textContent,b={element:_,language:y,grammar:N,code:v};function A(D){b.highlightedCode=D,r.hooks.run("before-insert",b),b.element.innerHTML=b.highlightedCode,r.hooks.run("after-highlight",b),r.hooks.run("complete",b),C&&C.call(b.element)}if(r.hooks.run("before-sanity-check",b),E=b.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex"))E.setAttribute("tabindex","0");if(!b.code){r.hooks.run("complete",b),C&&C.call(b.element);return}if(r.hooks.run("before-highlight",b),!b.grammar){A(r.util.encode(b.code));return}if(x&&e.Worker){var O=new Worker(r.filename);O.onmessage=function(D){A(D.data)},O.postMessage(JSON.stringify({language:b.language,code:b.code,immediateClose:!0}))}else A(r.highlight(b.code,b.grammar,b.language))},highlight:function(_,x,C){var y={code:_,grammar:x,language:C};if(r.hooks.run("before-tokenize",y),!y.grammar)throw Error('The language "'+y.language+'" has no grammar.');return y.tokens=r.tokenize(y.code,y.grammar),r.hooks.run("after-tokenize",y),s.stringify(r.util.encode(y.tokens),y.language)},tokenize:function(_,x){var C=x.rest;if(C){for(var y in C)x[y]=C[y];delete x.rest}var N=new c;return u(N,N.head,_),l(_,N,x,N.head,0),f(N)},hooks:{all:{},add:function(_,x){var C=r.hooks.all;C[_]=C[_]||[],C[_].push(x)},run:function(_,x){var C=r.hooks.all[_];if(!C||!C.length)return;for(var y=0,N;N=C[y++];)N(x)}},Token:s};e.Prism=r;function s(_,x,C,y){this.type=_,this.content=x,this.alias=C,this.length=(y||"").length|0}s.stringify=function _(x,C){if(typeof x=="string")return x;if(Array.isArray(x)){var y="";return x.forEach(function(A){y+=_(A,C)}),y}var N={type:x.type,content:_(x.content,C),tag:"span",classes:["token",x.type],attributes:{},language:C},E=x.alias;if(E)if(Array.isArray(E))Array.prototype.push.apply(N.classes,E);else N.classes.push(E);r.hooks.run("wrap",N);var v="";for(var b in N.attributes)v+=" "+b+'="'+(N.attributes[b]||"").replace(/"/g,""")+'"';return"<"+N.tag+' class="'+N.classes.join(" ")+'"'+v+">"+N.content+"</"+N.tag+">"};function i(_,x,C,y){_.lastIndex=x;var N=_.exec(C);if(N&&y&&N[1]){var E=N[1].length;N.index+=E,N[0]=N[0].slice(E)}return N}function l(_,x,C,y,N,E){for(var v in C){if(!C.hasOwnProperty(v)||!C[v])continue;var b=C[v];b=Array.isArray(b)?b:[b];for(var A=0;A<b.length;++A){if(E&&E.cause==v+","+A)return;var O=b[A],D=O.inside,H=!!O.lookbehind,k=!!O.greedy,J=O.alias;if(k&&!O.pattern.global){var V=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,V+"g")}var oe=O.pattern||O;for(var B=y.next,de=N;B!==x.tail;de+=B.value.length,B=B.next){if(E&&de>=E.reach)break;var xe=B.value;if(x.length>_.length)return;if(xe instanceof s)continue;var ve=1,te;if(k){if(te=i(oe,de,_,H),!te||te.index>=_.length)break;var Me=te.index,ae=te.index+te[0].length,ce=de;ce+=B.value.length;while(Me>=ce)B=B.next,ce+=B.value.length;if(ce-=B.value.length,de=ce,B.value instanceof s)continue;for(var Re=B;Re!==x.tail&&(ce<ae||typeof Re.value==="string");Re=Re.next)ve++,ce+=Re.value.length;ve--,xe=_.slice(de,ce),te.index-=de}else if(te=i(oe,0,xe,H),!te)continue;var Me=te.index,gt=te[0],Jt=xe.slice(0,Me),ke=xe.slice(Me+gt.length),ht=de+xe.length;if(E&&ht>E.reach)E.reach=ht;var Gt=B.prev;if(Jt)Gt=u(x,Gt,Jt),de+=Jt.length;d(x,Gt,ve);var Cr=new s(v,D?r.tokenize(gt,D):gt,J,gt);if(B=u(x,Gt,Cr),ke)u(x,B,ke);if(ve>1){var Jo={cause:v+","+A,reach:ht};if(l(_,x,C,B.prev,de,Jo),E&&Jo.reach>E.reach)E.reach=Jo.reach}}}}}function c(){var _={value:null,prev:null,next:null},x={value:null,prev:_,next:null};_.next=x,this.head=_,this.tail=x,this.length=0}function u(_,x,C){var y=x.next,N={value:C,prev:x,next:y};return x.next=N,y.prev=N,_.length++,N}function d(_,x,C){var y=x.next;for(var N=0;N<C&&y!==_.tail;N++)y=y.next;x.next=y,y.prev=x,_.length-=N}function f(_){var x=[],C=_.head.next;while(C!==_.tail)x.push(C.value),C=C.next;return x}if(!e.document){if(!e.addEventListener)return r;if(!r.disableWorkerMessageHandler)e.addEventListener("message",function(_){var x=JSON.parse(_.data),{language:C,code:y,immediateClose:N}=x;if(e.postMessage(r.highlight(y,r.languages[C],C)),N)e.close()},!1);return r}var p=r.util.currentScript();if(p){if(r.filename=p.src,p.hasAttribute("data-manual"))r.manual=!0}function h(){if(!r.manual)r.highlightAll()}if(!r.manual){var m=document.readyState;if(m==="loading"||m==="interactive"&&p&&p.defer)document.addEventListener("DOMContentLoaded",h);else if(window.requestAnimationFrame)window.requestAnimationFrame(h);else window.setTimeout(h,16)}return r}(iI);if(typeof Pd<"u"&&Pd.exports)Pd.exports=he;if(typeof global<"u")global.Prism=he;he.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]};he.languages.markup.tag.inside["attr-value"].inside.entity=he.languages.markup.entity;he.languages.markup.doctype.inside["internal-subset"].inside=he.languages.markup;he.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&/,"&")});Object.defineProperty(he.languages.markup.tag,"addInlined",{value:function(t,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:he.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:he.languages[n]};var s={};s[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},he.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(he.languages.markup.tag,"addAttribute",{value:function(e,t){he.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:he.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});he.languages.html=he.languages.markup;he.languages.mathml=he.languages.markup;he.languages.svg=he.languages.markup;he.languages.xml=he.languages.extend("markup",{});he.languages.ssml=he.languages.xml;he.languages.atom=he.languages.xml;he.languages.rss=he.languages.xml;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(he);he.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:/[{}[\];(),.:]/};he.languages.javascript=he.languages.extend("clike",{"class-name":[he.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});he.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;he.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:he.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:he.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:he.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:he.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:he.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});he.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:he.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});he.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(he.languages.markup)he.languages.markup.tag.addInlined("script","javascript"),he.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");he.languages.js=he.languages.javascript;(function(){if(typeof he>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var e="Loading…",t=function(p,h){return"✖ Error "+p+" while fetching file: "+h},n="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",s="loading",i="loaded",l="failed",c="pre[data-src]:not(["+r+'="'+i+'"]):not(['+r+'="'+s+'"])';function u(p,h,m){var _=new XMLHttpRequest;_.open("GET",p,!0),_.onreadystatechange=function(){if(_.readyState==4)if(_.status<400&&_.responseText)h(_.responseText);else if(_.status>=400)m(t(_.status,_.statusText));else m(n)},_.send(null)}function d(p){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(h){var m=Number(h[1]),_=h[2],x=h[3];if(!_)return[m,m];if(!x)return[m,void 0];return[m,Number(x)]}return}he.hooks.add("before-highlightall",function(p){p.selector+=", "+c}),he.hooks.add("before-sanity-check",function(p){var h=p.element;if(h.matches(c)){p.code="",h.setAttribute(r,s);var m=h.appendChild(document.createElement("CODE"));m.textContent=e;var _=h.getAttribute("data-src"),x=p.language;if(x==="none"){var C=(/\.(\w+)$/.exec(_)||[,"none"])[1];x=o[C]||C}he.util.setLanguage(m,x),he.util.setLanguage(h,x);var y=he.plugins.autoloader;if(y)y.loadLanguages(x);u(_,function(N){h.setAttribute(r,i);var E=d(h.getAttribute("data-range"));if(E){var v=N.split(/\r\n?|\n/g),b=E[0],A=E[1]==null?v.length:E[1];if(b<0)b+=v.length;if(b=Math.max(0,Math.min(b-1,v.length)),A<0)A+=v.length;if(A=Math.max(0,Math.min(A,v.length)),N=v.slice(b,A).join(`
|
|
2
|
+
`),!h.hasAttribute("data-start"))h.setAttribute("data-start",String(b+1))}m.textContent=N,he.highlightElement(m)},function(N){h.setAttribute(r,l),m.textContent=N})}}),he.plugins.fileHighlight={highlight:function(h){var m=(h||document).querySelectorAll(c);for(var _=0,x;x=m[_++];)he.highlightElement(x)}};var f=!1;he.fileHighlight=function(){if(!f)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),f=!0;he.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var qd={};Ye(qd,{LexicalComposerContext:()=>Xm,createLexicalComposerContext:()=>KO,useLexicalComposerContext:()=>zO});var Fg={};Ye(Fg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>Xa,$assumeActiveEditor:()=>cR,$caretFromPoint:()=>wr,$caretRangeFromSelection:()=>Ff,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>YR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>XR,$createChildrenArray:()=>Fa,$createLineBreakNode:()=>Pc,$createNodeSelection:()=>bc,$createParagraphNode:()=>bn,$createPoint:()=>ho,$createRangeSelection:()=>CC,$createRangeSelectionFromDom:()=>sR,$createTabNode:()=>iC,$createTextNode:()=>hn,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>yr,$formatText:()=>uC,$fullReconcile:()=>EC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>di,$getAdjacentNode:()=>HC,$getAdjacentSiblingOrParentSiblingCaret:()=>iM,$getCaretInDirection:()=>ko,$getCaretRange:()=>Dr,$getCaretRangeInDirection:()=>Ig,$getCharacterOffsets:()=>Rf,$getChildCaret:()=>ir,$getChildCaretAtIndex:()=>Ey,$getChildCaretOrSelf:()=>xy,$getCollapsedCaretRange:()=>Cy,$getCommonAncestor:()=>kc,$getCommonAncestorResultBranchOrder:()=>kg,$getDOMSlot:()=>On,$getDOMTextNode:()=>rr,$getDocument:()=>_n,$getEditor:()=>_o,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>YC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>vn,$getSelection:()=>Fe,$getSiblingCaret:()=>Ct,$getSlot:()=>Ar,$getSlotFrame:()=>gy,$getSlotHost:()=>zn,$getSlotNameWithinHost:()=>fy,$getSlotNames:()=>Wn,$getState:()=>mc,$getStateChange:()=>CA,$getTextContent:()=>aR,$getTextNodeOffset:()=>po,$getTextPointCaret:()=>Mr,$getTextPointCaretSlice:()=>Lf,$getWritableNodeState:()=>Wf,$hasAncestor:()=>Ia,$hasUpdateTag:()=>IR,$insertNodeToNearestRootAtCaret:()=>by,$insertNodes:()=>iR,$isBlockElementNode:()=>_C,$isChildCaret:()=>Gn,$isDecoratorNode:()=>Ve,$isEditorState:()=>fR,$isElementDOMSlot:()=>ry,$isElementNode:()=>P,$isExtendableTextPointCaret:()=>Ny,$isInlineElementOrDecoratorNode:()=>jC,$isInlineFormattable:()=>Tc,$isLeafNode:()=>DR,$isLexicalNode:()=>og,$isLineBreakNode:()=>wo,$isNodeCaret:()=>tM,$isNodeSelection:()=>fi,$isParagraphNode:()=>DC,$isRangeSelection:()=>fe,$isRootNode:()=>Ft,$isRootOrShadowRoot:()=>vt,$isSelectionCapturedInDecoratorInput:()=>Kc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>Rr,$isSlotChild:()=>Or,$isSlotHost:()=>Ro,$isTabNode:()=>sg,$isTextNode:()=>q,$isTextPointCaret:()=>go,$isTextPointCaretSlice:()=>sM,$isTokenOrSegmented:()=>Hn,$isTokenOrTab:()=>ka,$markSlotEditable:()=>cy,$needsBlockCursorBeside:()=>gc,$nodesOfType:()=>kR,$normalizeCaret:()=>Mo,$normalizeSelection__EXPERIMENTAL:()=>ni,$onUpdate:()=>GC,$parseSerializedNode:()=>uR,$removeFromParent:()=>Kn,$removeSlot:()=>my,$removeTextFromCaretRange:()=>Sy,$rewindSiblingCaret:()=>Ts,$selectAll:()=>wR,$setCompositionKey:()=>Lt,$setDirectionFromDOM:()=>iy,$setFormatFromDOM:()=>ay,$setPointFromCaret:()=>Ba,$setSelection:()=>en,$setSelectionFromCaretRange:()=>yy,$setSlot:()=>Og,$setState:()=>yA,$setTextFormat:()=>oR,$splitAtPointCaretNext:()=>Ty,$splitNode:()=>PR,$updateDOMSelection:()=>yC,$updateRangeSelectionFromCaretRange:()=>_a,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>jf,BLUR_COMMAND:()=>Wx,CAN_REDO_COMMAND:()=>kA,CAN_UNDO_COMMAND:()=>IA,CAN_USE_BEFORE_INPUT:()=>xa,CAN_USE_DOM:()=>Yn,CLEAR_EDITOR_COMMAND:()=>$A,CLEAR_HISTORY_COMMAND:()=>wA,CLICK_COMMAND:()=>vx,COLLABORATION_TAG:()=>Qx,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>TR,COMMAND_PRIORITY_BEFORE_EDITOR:()=>yR,COMMAND_PRIORITY_BEFORE_HIGH:()=>ER,COMMAND_PRIORITY_BEFORE_LOW:()=>SR,COMMAND_PRIORITY_BEFORE_NORMAL:()=>NR,COMMAND_PRIORITY_CRITICAL:()=>CR,COMMAND_PRIORITY_EDITOR:()=>ti,COMMAND_PRIORITY_HIGH:()=>xR,COMMAND_PRIORITY_LOW:()=>mR,COMMAND_PRIORITY_NORMAL:()=>_R,COMPOSITION_END_COMMAND:()=>Xf,COMPOSITION_END_TAG:()=>Ec,COMPOSITION_START_COMMAND:()=>Vf,COMPOSITION_START_TAG:()=>nC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ii,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>YA,DEFAULT_EDITOR_DOM_CONFIG:()=>wa,DELETE_CHARACTER_COMMAND:()=>Oa,DELETE_LINE_COMMAND:()=>Ra,DELETE_WORD_COMMAND:()=>Aa,DRAGEND_COMMAND:()=>zx,DRAGOVER_COMMAND:()=>Kx,DRAGSTART_COMMAND:()=>Bx,DROP_COMMAND:()=>Px,DecoratorNode:()=>Fc,ElementNode:()=>$o,FOCUS_COMMAND:()=>Hx,FORMAT_ELEMENT_COMMAND:()=>DA,FORMAT_TEXT_COMMAND:()=>Sr,HISTORIC_TAG:()=>WA,HISTORY_MERGE_TAG:()=>uc,HISTORY_PUSH_TAG:()=>GA,INDENT_CONTENT_COMMAND:()=>RA,INPUT_COMMAND:()=>Yf,INSERT_LINE_BREAK_COMMAND:()=>ha,INSERT_PARAGRAPH_COMMAND:()=>Nf,INSERT_TAB_COMMAND:()=>AA,INTERNAL_$isBlock:()=>pn,IS_ALL_FORMATTING:()=>QO,IS_ANDROID:()=>Pf,IS_ANDROID_CHROME:()=>Ca,IS_APPLE:()=>Fn,IS_APPLE_WEBKIT:()=>za,IS_BOLD:()=>jO,IS_CHROME:()=>Bf,IS_CODE:()=>qO,IS_FIREFOX:()=>Do,IS_HIGHLIGHT:()=>Kf,IS_IOS:()=>fs,IS_ITALIC:()=>YO,IS_SAFARI:()=>Ka,IS_STRIKETHROUGH:()=>VO,IS_SUBSCRIPT:()=>JO,IS_SUPERSCRIPT:()=>ZO,IS_UNDERLINE:()=>XO,KEY_ARROW_DOWN_COMMAND:()=>$x,KEY_ARROW_LEFT_COMMAND:()=>Rx,KEY_ARROW_RIGHT_COMMAND:()=>Ox,KEY_ARROW_UP_COMMAND:()=>Dx,KEY_BACKSPACE_COMMAND:()=>kx,KEY_DELETE_COMMAND:()=>Lx,KEY_DOWN_COMMAND:()=>Qf,KEY_ENTER_COMMAND:()=>xc,KEY_ESCAPE_COMMAND:()=>Ix,KEY_MODIFIER_COMMAND:()=>Gx,KEY_SPACE_COMMAND:()=>wx,KEY_TAB_COMMAND:()=>Fx,LineBreakNode:()=>Ga,MOVE_TO_END:()=>Ax,MOVE_TO_START:()=>Mx,NODE_STATE_DIRECT:()=>ff,NODE_STATE_KEY:()=>fA,NODE_STATE_LATEST:()=>gf,OUTDENT_CONTENT_COMMAND:()=>MA,PASTE_COMMAND:()=>qf,PASTE_TAG:()=>jA,ParagraphNode:()=>ja,REDO_COMMAND:()=>Zf,REMOVE_TEXT_COMMAND:()=>ac,RootNode:()=>Ha,SELECTION_CHANGE_COMMAND:()=>Gf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>vA,SELECT_ALL_COMMAND:()=>Ux,SET_TEXT_FORMAT_COMMAND:()=>OA,SKIP_COLLAB_TAG:()=>VA,SKIP_DOM_SELECTION_TAG:()=>tC,SKIP_SCROLL_INTO_VIEW_TAG:()=>eC,SKIP_SELECTION_FOCUS_TAG:()=>Nc,TEXT_TYPE_TO_FORMAT:()=>jt,TabNode:()=>Ua,TextNode:()=>ms,UNDO_COMMAND:()=>Jf,addClassNamesToElement:()=>pM,buildImportMap:()=>HA,configExtension:()=>uM,createCommand:()=>Ne,createEditor:()=>bR,createRefCountedRegistry:()=>jx,createSharedNodeState:()=>mx,createState:()=>xA,declarePeerDependency:()=>dM,defineExtension:()=>cM,findAllLexicalElementsDeep:()=>qC,flipDirection:()=>kr,getActiveElement:()=>wc,getActiveElementDeep:()=>ui,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>hi,getDOMOwnerDocument:()=>Uc,getDOMSelection:()=>Vn,getDOMSelectionFromTarget:()=>VC,getDOMSelectionPoints:()=>jn,getDOMSelectionRange:()=>ZC,getDOMSelectionRangeAndPoints:()=>FR,getDOMShadowRoots:()=>XC,getDOMTextNode:()=>IC,getDeclaredSlots:()=>py,getEditorPropertyFromDOMNode:()=>Va,getNearestEditorFromDOMNode:()=>ds,getParentElement:()=>Es,getRegisteredNode:()=>Bc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>VR,getRootOwnerDocument:()=>JC,getStaticNodeConfig:()=>qa,getStyleObjectFromCSS:()=>Of,getTextDirection:()=>MR,getTransformSetFromKlass:()=>wC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>br,isDOMCapturingSelection:()=>La,isDOMDocumentNode:()=>gi,isDOMNode:()=>mi,isDOMShadowRoot:()=>sr,isDOMTextNode:()=>mo,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>ny,isExactShortcutMatch:()=>Ze,isHTMLAnchorElement:()=>BR,isHTMLElement:()=>_t,isHTMLTableCellElement:()=>zR,isHTMLTableRowElement:()=>KR,isInlineDomNode:()=>oy,isLastChildInBlockNode:()=>MC,isLexicalEditor:()=>zc,isModifierMatch:()=>UC,isOnlyChildInBlockNode:()=>RC,isSelectionCapturedInDecoratorInput:()=>RR,isSelectionWithinEditor:()=>Ya,iterStaticNodeConfigChain:()=>Ja,makeStepwiseIterator:()=>$g,mergeRegister:()=>Lg,mountSlotContainer:()=>WR,normalizeClassNames:()=>Qa,registerEventListener:()=>ng,registerEventListeners:()=>mM,removeClassNamesFromElement:()=>hM,removeFromParent:()=>$R,resetRandomKey:()=>OR,safeCast:()=>fM,setDOMStyleFromCSS:()=>Af,setDOMStyleObject:()=>qA,setDOMUnmanaged:()=>ly,setNodeIndentFromDOM:()=>sy,shallowMergeConfig:()=>gM,stopLexicalPropagation:()=>bf,toggleTextFormatType:()=>vr,tokenizeRawText:()=>SC,unmountSlotContainer:()=>GR});var Jg={};Ye(Jg,{LexicalComposer:()=>xM});var Zg={};Ye(Zg,{useLexicalEditable:()=>NM});var rp={};Ye(rp,{$addNodeStyle:()=>RM,$cloneWithProperties:()=>Wc,$copyBlockFormatIndent:()=>IS,$ensureForwardRangeSelection:()=>kS,$forEachSelectedTextNode:()=>wS,$getComputedStyleForElement:()=>tp,$getComputedStyleForParent:()=>np,$getSelectionStyleValueForProperty:()=>FM,$isAtEdgeOfElement:()=>LS,$isAtNodeEnd:()=>AM,$isParentElementRTL:()=>op,$isParentRTL:()=>vM,$moveCaretSelection:()=>BS,$moveCharacter:()=>IM,$patchStyleText:()=>MM,$selectAll:()=>Ur,$setBlocksType:()=>DM,$shouldOverrideDefaultCharacterSelection:()=>kM,$sliceSelectedTextNodeContent:()=>OM,$trimTextContentFromAnchor:()=>$S,$wrapNodes:()=>wM,createDOMRange:()=>TM,createRectsFromDOMRange:()=>bM,getCSSFromStyleObject:()=>DS,getStyleObjectFromCSS:()=>PM,trimTextContentFromAnchor:()=>BM});var hp={};Ye(hp,{$descendantsMatching:()=>gD,$dfs:()=>GM,$dfsIterator:()=>YS,$dfsWithSlots:()=>VM,$dfsWithSlotsIterator:()=>VS,$filter:()=>aD,$findMatchingParent:()=>pe,$firstToLastIterator:()=>pD,$getAdjacentCaret:()=>jM,$getAdjacentSiblingOrParentSiblingCaret:()=>vs,$getDepth:()=>XS,$getNearestBlockElementAncestorOrThrow:()=>QM,$getNearestNodeOfType:()=>ZM,$getNextRightPreorderNode:()=>qM,$getNextSiblingOrParentSibling:()=>XM,$handleIndentAndOutdent:()=>lD,$insertFirst:()=>cD,$insertNodeIntoLeaf:()=>rD,$insertNodeToNearestRoot:()=>oD,$insertNodeToNearestRootAtCaret:()=>Br,$isAtEndOfNode:()=>nN,$isAtStartOfNode:()=>tN,$isBlockFullySelected:()=>eD,$isEditorIsNestedEditor:()=>dD,$lastToFirstIterator:()=>pp,$onEscapeDown:()=>xD,$onEscapeUp:()=>_D,$restoreEditorState:()=>nD,$reverseDfs:()=>YM,$reverseDfsIterator:()=>qS,$reverseDfsWithSlots:()=>JM,$reverseDfsWithSlotsIterator:()=>JS,$splitNode:()=>Hy,$unwrapAndFilterDescendants:()=>fD,$unwrapNode:()=>hD,$wrapNodeInElement:()=>sD,CAN_USE_BEFORE_INPUT:()=>cl,CAN_USE_DOM:()=>un,IS_ANDROID:()=>Qy,IS_ANDROID_CHROME:()=>eS,IS_APPLE:()=>dl,IS_APPLE_WEBKIT:()=>uu,IS_CHROME:()=>tS,IS_FIREFOX:()=>$s,IS_IOS:()=>gl,IS_SAFARI:()=>fu,addClassNamesToElement:()=>Qe,calculateZoomLevel:()=>uD,dedupeSelectionRects:()=>HS,eventFiles:()=>iD,getScrollParent:()=>HM,isBlockDomNode:()=>Is,isHTMLAnchorElement:()=>wi,isHTMLElement:()=>Ce,isInlineDomNode:()=>ki,isMimeType:()=>jS,makeStateWrapper:()=>mD,markSelection:()=>GS,mediaFileReader:()=>WM,mergeRegister:()=>Oe,objectKlassEquals:()=>gp,positionNodeOnRange:()=>WS,registerNestedElementResolver:()=>tD,removeClassNamesFromElement:()=>nn,selectionAlwaysOnDisplay:()=>UM});var wp={};Ye(wp,{$applyFormatToDom:()=>OD,$createHorizontalRuleNode:()=>$p,$defaultShouldInsertAfter:()=>SN,$getExtensionDependency:()=>$N,$getExtensionOutput:()=>BD,$getPeerDependency:()=>KD,$isDecoratorTextNode:()=>bD,$isHorizontalRuleNode:()=>kN,AutoFocusExtension:()=>ND,ClearEditorExtension:()=>ED,ClickAfterLastBlockExtension:()=>TD,DecoratorTextExtension:()=>MD,DecoratorTextNode:()=>Wu,EditorStateExtension:()=>Uu,HorizontalRuleExtension:()=>HD,HorizontalRuleNode:()=>Ki,IMEExtension:()=>WD,INSERT_HORIZONTAL_RULE_COMMAND:()=>wN,InitialStateExtension:()=>MN,LexicalBuilder:()=>fr,NestedEditorExtension:()=>GD,NodeSelectionDataSelectedExtension:()=>jD,NodeSelectionExtension:()=>Op,NormalizeInlineElementsExtension:()=>YD,NormalizeTripleClickSelectionExtension:()=>XD,PreventSelectAllExtension:()=>Ap,RootElementExtension:()=>JD,SelectBlockExtension:()=>ZD,SelectionAlwaysOnDisplayExtension:()=>QD,TabIndentationExtension:()=>e$,WatchEditableExtension:()=>t$,applyFormatFromStyle:()=>vD,applyFormatToDom:()=>TN,batch:()=>pN,buildEditorFromExtensions:()=>LD,computed:()=>_N,configExtension:()=>tn,declarePeerDependency:()=>uS,defineExtension:()=>me,effect:()=>qt,getExtensionDependencyFromEditor:()=>DN,getKnownTypesAndNodes:()=>NN,getPeerDependencyFromEditor:()=>Dp,getPeerDependencyFromEditorOrThrow:()=>PD,namedSignals:()=>So,registerClearEditor:()=>yN,registerTabIndentation:()=>LN,safeCast:()=>Be,shallowMergeConfig:()=>Pt,signal:()=>Zr,untracked:()=>Tp,watchedSignal:()=>vl});var Ip={};Ye(Ip,{ReactProviderExtension:()=>n$});var Fp={};Ye(Fp,{$canShowPlaceholder:()=>XN,$canShowPlaceholderCurry:()=>s$,$findTextIntersectionFromCharacters:()=>i$,$isRootTextContentEmpty:()=>Lp,$isRootTextContentEmptyCurry:()=>r$,$rootTextContent:()=>VN,registerLexicalTextEntity:()=>l$});var Pp={};Ye(Pp,{DragonExtension:()=>g$,installDragonSupport:()=>u$,registerDragonSupport:()=>ZN});var th={};Ye(th,{$appendNodeToHTML:()=>pw,$distributeInlineWrapper:()=>kE,$generateDOMFromNodes:()=>jE,$generateDOMFromRoot:()=>fw,$generateHtmlFromNodes:()=>gw,$generateNodesFromDOM:()=>dw,$generateNodesFromDOMViaExtension:()=>aw,$getImportContextValue:()=>wE,$getRenderContextValue:()=>x$,$getSessionDOMRenderConfig:()=>ed,$inlineStylesFromStyleSheets:()=>pE,$isBlockLevel:()=>Hi,$propagateTextAlignToBlockChildren:()=>IE,$setRenderContextValue:()=>C$,$updateRenderContextValue:()=>y$,$withImportContext:()=>Jp,$withRenderContext:()=>qp,BlockSchema:()=>FE,CoreImportExtension:()=>WE,CoreImportRules:()=>KE,DOMImportExtension:()=>eh,DOMRenderExtension:()=>k$,HorizontalRuleImportExtension:()=>cw,HorizontalRuleImportRules:()=>lw,ImportOverlays:()=>ME,ImportSource:()=>z$,ImportSourceDataTransfer:()=>U$,ImportTextFormat:()=>Ju,ImportTextStyle:()=>vE,ImportWhitespaceConfig:()=>RE,InlineSchema:()=>H$,NestedBlockSchema:()=>W$,RenderContextExport:()=>Vp,RenderContextRoot:()=>_E,RootSchema:()=>PE,contextUpdater:()=>m$,contextValue:()=>Ol,createImportState:()=>Hs,createRenderState:()=>Yp,defaultIsInline:()=>AE,defaultPreservesWhitespace:()=>OE,defineImportRule:()=>pr,defineOverlayRules:()=>ow,domOverride:()=>S$,isElementOfTag:()=>B$,parseSelector:()=>bE,sel:()=>uw});var uh={};Ye(uh,{$exportMimeTypeFromSelection:()=>Tw,$generateJSONFromSelectedNodes:()=>fT,$generateNodesFromSerializedNodes:()=>gT,$getClipboardDataFromSelection:()=>pT,$getHtmlContent:()=>lh,$getLexicalContent:()=>ch,$handlePlainTextDrop:()=>Sw,$handleRichTextDrop:()=>yw,$insertDataTransferForPlainText:()=>lT,$insertDataTransferForRichText:()=>cT,$insertGeneratedNodes:()=>id,$writeDragSourceToDataTransfer:()=>Cw,ClipboardDOMImportExtension:()=>xw,ClipboardImportExtension:()=>ah,DEFAULT_IMPORT_MIME_TYPE:()=>sd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>rd,GetClipboardDataExtension:()=>CT,caretFromPoint:()=>sT,copyToClipboard:()=>Nw,setLexicalClipboardDataTransfer:()=>hT});var gh={};Ye(gh,{$createHeadingNode:()=>Xi,$createQuoteNode:()=>$l,$isHeadingNode:()=>$w,$isQuoteNode:()=>Mw,DRAG_DROP_PASTE:()=>fh,HeadingNode:()=>wl,QuoteNode:()=>Dl,RichTextExtension:()=>DT,RichTextImportExtension:()=>Rw,RichTextImportRules:()=>MT,ShadowRootQuoteRule:()=>Ow,eventFiles:()=>Ps,quoteShadowRootState:()=>fd,registerRichText:()=>$T});var hh={};Ye(hh,{RichTextPlugin:()=>Fw});var mh={};Ye(mh,{ContentEditable:()=>zw,ContentEditableElement:()=>PT});var _h={};Ye(_h,{HistoryExtension:()=>xd,SharedHistoryExtension:()=>jw,createEmptyHistoryState:()=>HT,registerHistory:()=>UT});var xh={};Ye(xh,{HistoryPlugin:()=>Yw,createEmptyHistoryState:()=>yd});var Eh={};Ye(Eh,{$createListItemNode:()=>Eo,$createListNode:()=>No,$getListDepth:()=>Sd,$handleListInsertParagraph:()=>s0,$insertList:()=>Nd,$isListItemNode:()=>De,$isListNode:()=>Ae,$removeList:()=>o0,CheckListExtension:()=>tk,INSERT_CHECK_LIST_COMMAND:()=>a0,INSERT_ORDERED_LIST_COMMAND:()=>h0,INSERT_UNORDERED_LIST_COMMAND:()=>p0,ListExtension:()=>Nh,ListImportExtension:()=>nk,ListImportRules:()=>f0,ListItemNode:()=>js,ListNode:()=>qi,ListSchema:()=>ek,REMOVE_LIST_COMMAND:()=>m0,UPDATE_LIST_START_COMMAND:()=>g0,registerCheckList:()=>l0,registerList:()=>_0,registerListStrictIndentTransform:()=>x0});var vh={};Ye(vh,{ListPlugin:()=>ok});var Oh={};Ye(Oh,{CheckListPlugin:()=>sk});var Ah={};Ye(Ah,{TabIndentationPlugin:()=>ak,registerTabIndentation:()=>Yu});var wh={};Ye(wh,{$createAutoLinkNode:()=>$h,$createLinkNode:()=>Ll,$isAutoLinkNode:()=>fn,$isLinkNode:()=>Ln,$toggleLink:()=>Td,AutoLinkExtension:()=>Ck,AutoLinkNode:()=>Pl,ClickableLinkExtension:()=>fk,LinkExtension:()=>Od,LinkImportExtension:()=>dk,LinkImportRules:()=>I0,LinkNode:()=>ns,TOGGLE_LINK_COMMAND:()=>bd,autoLinkEmailMatcher:()=>hk,autoLinkUrlMatcher:()=>pk,createLinkMatcherWithRegExp:()=>P0,formatUrl:()=>Rh,registerAutoLink:()=>W0,registerClickableLink:()=>F0,registerLink:()=>L0});var Ih={};Ye(Ih,{LinkPlugin:()=>yk});var Lh={};Ye(Lh,{AutoFocusPlugin:()=>Nk});var Uh={};Ye(Uh,{$createCodeHighlightNode:()=>Kh,$createCodeNode:()=>bo,$getCodeLineDirection:()=>sb,$getEndOfCodeInLine:()=>ab,$getFirstCodeNodeOfLine:()=>os,$getLastCodeNodeOfLine:()=>Vs,$getStartOfCodeInLine:()=>ib,$isCodeHighlightNode:()=>Bt,$isCodeNode:()=>En,$outdentLeadingSpaces:()=>lb,$plainifyCodeContent:()=>Tk,CodeExtension:()=>zh,CodeHighlightNode:()=>Ul,CodeImportExtension:()=>kk,CodeImportRules:()=>mb,CodeIndentExtension:()=>Ik,CodeNode:()=>zl,DEFAULT_CODE_LANGUAGE:()=>cb,getDefaultCodeLanguage:()=>bk,registerCodeIndentation:()=>xb});var Zh={};Ye(Zh,{$convertFromMarkdownString:()=>qk,$convertSelectionToMarkdownString:()=>Qk,$convertToMarkdownString:()=>Zk,$generateNodesFromMarkdownString:()=>Jk,BOLD_ITALIC_STAR:()=>sv,BOLD_ITALIC_UNDERSCORE:()=>iv,BOLD_STAR:()=>av,BOLD_UNDERSCORE:()=>lv,CHECK_LIST:()=>Kk,CODE:()=>jl,ELEMENT_TRANSFORMERS:()=>gv,HEADING:()=>Qb,HIGHLIGHT:()=>rv,INLINE_CODE:()=>ov,ITALIC_STAR:()=>uv,ITALIC_UNDERSCORE:()=>dv,LINK:()=>fv,MULTILINE_ELEMENT_TRANSFORMERS:()=>pv,ORDERED_LIST:()=>nv,QUOTE:()=>ev,STRIKETHROUGH:()=>cv,TEXT_FORMAT_TRANSFORMERS:()=>hv,TEXT_MATCH_TRANSFORMERS:()=>mv,TRANSFORMERS:()=>ta,UNORDERED_LIST:()=>tv,isTableRowDivider:()=>Xb,registerMarkdownShortcuts:()=>Xk});var em={};Ye(em,{DEFAULT_TRANSFORMERS:()=>Rv,MarkdownShortcutPlugin:()=>eI});var tm={};Ye(tm,{OnChangePlugin:()=>nI});var nm={};Ye(nm,{LexicalErrorBoundary:()=>rI});var lm={};Ye(lm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>im,CODE_LANGUAGE_MAP:()=>Fv,CodePrismExtension:()=>hI,PrismTokenizer:()=>am,getCodeLanguageOptions:()=>uI,getCodeLanguages:()=>cI,getCodeThemeOptions:()=>dI,getLanguageFriendlyName:()=>lI,isCodeLanguageLoaded:()=>Bv,loadCodeLanguage:()=>Kv,normalizeCodeLanguage:()=>Pv,registerCodeHighlighting:()=>pI});var _m={};Ye(_m,{$createCodeHighlightNode:()=>Md,$createCodeNode:()=>Xs,$getCodeLineDirection:()=>Cb,$getEndOfCodeInLine:()=>yb,$getFirstCodeNodeOfLine:()=>Sb,$getLastCodeNodeOfLine:()=>Nb,$getStartOfCodeInLine:()=>Eb,$isCodeHighlightNode:()=>ea,$isCodeNode:()=>Xo,$outdentLeadingSpaces:()=>Tb,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>_I,CODE_LANGUAGE_MAP:()=>xI,CodeExtension:()=>Dd,CodeHighlightNode:()=>Hl,CodeIndentExtension:()=>$d,CodeNode:()=>rs,DEFAULT_CODE_LANGUAGE:()=>wd,PrismTokenizer:()=>bI,getCodeLanguageOptions:()=>CI,getCodeLanguages:()=>yI,getCodeThemeOptions:()=>SI,getDefaultCodeLanguage:()=>Ab,getLanguageFriendlyName:()=>NI,normalizeCodeLang:()=>EI,normalizeCodeLanguage:()=>TI,registerCodeHighlighting:()=>vI});var Lm={};Ye(Lm,{$computeTableCellRectBoundary:()=>ql,$computeTableMap:()=>on,$computeTableMapSkipCellCheck:()=>uo,$createTableCellNode:()=>gn,$createTableNode:()=>tc,$createTableNodeWithDimensions:()=>Qv,$createTableRowNode:()=>_r,$createTableSelection:()=>GI,$createTableSelectionFrom:()=>Gd,$deleteTableColumn:()=>LI,$deleteTableColumnAtSelection:()=>rO,$deleteTableColumn__EXPERIMENTAL:()=>PI,$deleteTableRowAtSelection:()=>oO,$deleteTableRow__EXPERIMENTAL:()=>FI,$findCellNode:()=>sa,$findTableNode:()=>Qs,$getElementForTableNode:()=>hO,$getNodeTriplet:()=>Kt,$getTableAndElementByKey:()=>km,$getTableCellNodeFromLexicalNode:()=>AI,$getTableCellNodeRect:()=>Em,$getTableColumnIndexFromTableCellNode:()=>MI,$getTableNodeFromLexicalNodeOrThrow:()=>Yd,$getTableRowIndexFromTableCellNode:()=>RI,$getTableRowNodeFromTableCellNodeOrThrow:()=>Mm,$insertTableColumn:()=>kI,$insertTableColumnAtNode:()=>Wd,$insertTableColumnAtSelection:()=>nO,$insertTableColumn__EXPERIMENTAL:()=>II,$insertTableRow:()=>$I,$insertTableRowAtNode:()=>Hd,$insertTableRowAtSelection:()=>tO,$insertTableRow__EXPERIMENTAL:()=>wI,$isScrollableTablesActive:()=>Ql,$isSimpleTable:()=>wm,$isStickyScrollbarActive:()=>Rm,$isTableCellNode:()=>_e,$isTableNode:()=>rt,$isTableRowNode:()=>Le,$isTableSelection:()=>ze,$mergeCells:()=>sO,$moveTableColumn:()=>zI,$moveTableRow:()=>UI,$removeTableRowAtIndex:()=>DI,$setTableColumnIsHeader:()=>WI,$setTableRowIsHeader:()=>HI,$unmergeCell:()=>KI,$unmergeCellNode:()=>$m,INSERT_TABLE_COMMAND:()=>Zv,TableCellHeaderStates:()=>be,TableCellNode:()=>mr,TableExtension:()=>yO,TableImportExtension:()=>f1,TableImportRules:()=>CO,TableNode:()=>xr,TableObserver:()=>Im,TableRowNode:()=>ca,TableRowSchema:()=>d1,TableSchema:()=>u1,applyTableHandlers:()=>cO,getDOMCellFromTarget:()=>Zl,getTableElement:()=>qo,getTableObserverFromTableElement:()=>Tm,registerTableCellUnmergeTransform:()=>mO,registerTablePlugin:()=>xO,registerTableSelectionObserver:()=>_O,setScrollableTablesActive:()=>pO});var AO=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Fm=z("bold",AO);var RO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Pm=z("heading-1",RO);var MO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],Bm=z("heading-2",MO);var DO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],Km=z("heading-3",DO);var $O=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],zm=z("italic",$O);var wO=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Um=z("list-ordered",wO);var kO=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Hm=z("quote",kO);var IO=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],Wm=z("redo-2",IO);var LO=[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]],Gm=z("remove-formatting",LO);var FO=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],jm=z("strikethrough",FO);var PO=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Ym=z("underline",PO);var BO=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Vm=z("undo-2",BO);L();L();L();L();var Xm=Rt(null);function KO(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t!=null?t:n!=null?n.getTheme():null}}}function zO(){let e=Zt(Xm);return e==null&&function(t,...n){let o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(let s of n)r.append("v",s);throw o.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}var Jd=qd,{LexicalComposerContext:qm,createLexicalComposerContext:Jm,useLexicalComposerContext:st}=Jd;function U(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ix(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);n.search=o.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Yn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UO=Yn&&"documentMode"in document?document.documentMode:null,Fn=Yn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Do=Yn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),xa=!(!Yn||!("InputEvent"in window)||UO)&&"getTargetRanges"in new window.InputEvent("input"),fs=Yn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pf=Yn&&/Android/.test(navigator.userAgent),Ka=Yn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Pf,Bf=Yn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ca=Yn&&Pf&&Bf,za=Yn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Fn&&!Bf,HO=0,WO=1,GO=2,jO=1,YO=2,VO=4,XO=8,qO=16,JO=32,ZO=64,Kf=128,QO=2047,eA=1,tA=2,nA=3,oA=4,rA=5,sA=6,ya=Ka||fs||za?" ":"",us=`
|
|
3
3
|
|
|
4
|
-
`,zf=Do?" ":ya,ax="֑-߿יִ-﷽ﹰ-ﻼ",lx="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",iA=new RegExp("^[^"+lx+"]*["+ax+"]"),aA=new RegExp("^[^"+ax+"]*["+lx+"]"),jt={bold:1,capitalize:1024,code:16,highlight:Kf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},lA={directionless:1,unmergeable:2},pc={center:2,end:6,justify:4,left:1,right:3,start:5},cA={[tA]:"center",[sA]:"end",[oA]:"justify",[eA]:"left",[nA]:"right",[rA]:"start"},uA={normal:0,segmented:2,token:1},dA={[HO]:"normal",[GO]:"segmented",[WO]:"token"},fA="$",Zm="$config";function Qm(){return _o()._blockCursorElement}function gA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class ri{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new ri(this.element,e,this.after)}withAfter(e){return new ri(this.element,this.before,e)}withElement(e){return this.element===e?this:new ri(e,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&U(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&U(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&U(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?"before":"after";let o=e_(e,this.element);if(o===null)return"after";let r=Array.prototype.indexOf.call(e.childNodes,o);if(r<0)return"after";if(t===e)return n<=r?"before":"after";let s=e_(e,t);if(s===null)return"after";let i=Array.prototype.indexOf.call(e.childNodes,s);return i>=0&&i<=r?"before":"after"}getInsertionAnchor(){return this.before}}function e_(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}class si extends ri{withBefore(e){return new si(this.element,e,this.after)}withAfter(e){return new si(this.element,this.before,e)}withElement(e){return this.element===e?this:new si(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;gA(t);)e=t,t=t.nextSibling;let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===Qm()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let t=e==="decorator"&&(za||fs||Ka);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}let n=this.element,o=this.before,r=_n().createElement("br");if(r.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(r,o),e){let s=_n().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",n.insertBefore(s,r),n.__lexicalLineBreak=s}else n.__lexicalLineBreak=r}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let o=this.element.firstChild;o!==null&&o!==e&&o!==t;o=o.nextSibling)n++;return n}resolveChildIndex(e,t,n,o){if(n===this.element){let l=this.getFirstChildOffset(),c=Qm(),u=this.element.childNodes,d=Math.min(o,u.length),f=0;for(let p=l;p<d;p++)u[p]!==c&&f++;return[e,Math.min(f,e.getChildrenSize())]}let r=t_(t,n);r.push(o);let s=t_(t,this.element),i=e.getIndexWithinParent();for(let l=0;l<s.length;l++){let c=r[l],u=s[l];if(c===void 0||c<u)break;if(c>u){i+=1;break}}return[e.getParentOrThrow(),i]}}function t_(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;n.push(r)}return o!==e&&U(225),n.reverse()}var cx;try{cx="0.49.0+prod.esm"}catch(e){}var ux=cx??'"<unknown>+source"';class ei{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}var as=null;function dx(e,t=1000){return e instanceof Sa?e.clone():e.size<t?new Map(e):new Sa().init(new Map(e),void 0,e.size)}class Sa{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Sa().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t!==void 0?t:this._old&&this._old.get(e)}get(e){let t=this.getWithTombstone(e);return t===as?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let t=new Map(this._old);for(let[n,o]of this._nursery)o!==as?t.set(n,o):t.delete(n);this._old=t,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let o=this.getNursery();return n!==as&&n!==void 0||(this._size++,n===as&&o.delete(e)),o.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,as),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n!==void 0?n:(this.set(e,t),t)}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let o=t(e);return this.set(e,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let o=n[0],r=e?e.get(o):void 0;r!==as&&(r!==void 0&&(n[1]=r),yield n)}if(e)for(let n of e)n[1]===as||t&&t.has(n[0])||(yield n)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[n,o]of this.entries())e(o,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function hc(e,t,n,o,r,s){if(P(e)){let i=e.getFirstChild();for(;i!==null;){let l=i.__key;i.__parent===t&&((P(i)||Ro(i)&&i.__slots!==null)&&hc(i,l,n,o,r,s),n.has(l)||s.delete(l),r.push(l)),i=i.getNextSibling()}}for(let i of Ro(e)&&e.__slots!==null?e.__slots.values():[]){let l=o.get(i);l!==void 0&&Or(l)&&l.__slotHost===t&&((P(l)||Ro(l)&&l.__slots!==null)&&hc(l,i,n,o,r,s),n.has(i)||s.delete(i),r.push(i))}}var df=!1,Uf=0;function pA(e){Uf=e.timeStamp}function Zd(e,t,n){let o=e.nodeName==="BR",r=t.__lexicalLineBreak;return r&&(e===r||o&&e.previousSibling===r)||o&&pi(e,n)!==void 0}function hA(e,t,n){let o=Yn(xn(n)),r=o&&Gn(o,n._rootElement),s=null,i=null;r!==null&&r.anchorNode===e&&(s=r.anchorOffset,i=r.focusOffset);let l=e.nodeValue;l!==null&&mg(t,l,s,i,!1)}function mA(e,t,n){if(fe(e)){let o=e.anchor.getNode();if(o.is(n)&&e.format!==o.getFormat())return!1}return mo(t)&&n.isAttached()}function _A(e,t,n){for(let o=e;o&&!vg(o);o=Es(o)){let r=pi(o,t);if(r!==void 0){let s=ot(r,n);if(s)return Ve(s)||!_t(o)?void 0:[o,s]}}}function fx(e,t,n){df=!0;let o=performance.now()-Uf>100;try{zn(e,()=>{let r=Fe()||function(f){return f.read("latest",()=>{let p=Fe();return p!==null?p.clone():null})}(e),s=new Map,{_editorState:i,_blockCursorElement:l}=e,c=!1,u="";for(let f=0;f<t.length;f++){let p=t[f],{type:h,target:m}=p,_=_A(m,e,i);if(!_)continue;let[x,C]=_;if(h==="characterData")o&&V(C)&&mo(m)&&mA(r,m,C)&&hA(m,C,e);else if(h==="childList"){c=!0;let y=p.addedNodes;for(let v=0;v<y.length;v++){let b=y[v],A=fg(b),O=b.parentNode;if(!(O==null||b===l||A!==null||Zd(b,O,e)||e._slotsUsed&&_t(b)&&b.hasAttribute("data-lexical-slot")||vg(b))){if(Do){let D=(_t(b)?b.innerText:null)||b.nodeValue;D&&(u+=D)}O.removeChild(b)}}let N=p.removedNodes,E=N.length;if(E>0){let v=0;for(let b=0;b<E;b++){let A=N[b];(Zd(A,m,e)||l===A)&&(m.appendChild(A),v++)}E!==v&&s.set(x,C)}}}if(s.size>0)for(let[f,p]of s)p.reconcileObservedMutation(f,e);let d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let p=d[f],{addedNodes:h,target:m}=p;for(let _=0;_<h.length;_++){let x=h[_],C=x.parentNode;C==null||x.nodeName!=="BR"||Zd(x,m,e)||C.removeChild(x)}}n.takeRecords()}r!==null&&(c&&en(r),Do&&WC(e)&&r.insertRawText(u))})}finally{df=!1}}function gx(e){let t=e._observer;if(t!==null)fx(e,t.takeRecords(),t)}function px(e){(function(t){Uf===0&&xn(t).addEventListener("textInput",pA,!0)})(e),e._observer=new MutationObserver((t,n)=>{fx(e,t,n)})}var ff="direct",gf="latest";class hx{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||SA).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}}function xA(e,t){return new hx(e,t)}function mc(e,t,n=gf){let o=(n===gf?e.getLatest():e).__state;return o?o.getValue(t):t.defaultValue}function CA(e,t,n){let o=mc(e,n,ff),r=mc(t,n,ff);return n.isEqual(o,r)?null:[o,r]}function yA(e,t,n){let o;if(zt(),typeof n=="function"){let s=e.getLatest(),i=mc(s,t);if(o=n(i),t.isEqual(i,o))return s}else o=n;let r=e.getWritable();return Wf(r).updateFromKnown(t,o),r}function mx(e){let t=new Map,n=new Set;for(let{ownNodeConfig:o}of Ja(typeof e=="function"?e:e.replace))if(o&&o.stateConfigs)for(let r of o.stateConfigs){let s;"stateConfig"in r?(s=r.stateConfig,r.flat&&n.add(s.key)):s=r,t.set(s.key,s)}return{flatKeys:n,sharedConfigMap:t}}var n_=new Set(["__proto__","constructor","prototype"]);class Hf{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,o=new Map,r=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=o;let{sharedConfigMap:s}=this.sharedNodeState,i=r!==void 0?r:function(l,c,u){let d=u.size;if(c)for(let f in c){let p=l.get(f);p&&u.has(p)||d++}return d}(s,n,o);this.size=i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let o=this.unknownState[e.key];o!==void 0&&(n=e.parse(o)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[n,o]of this.knownState)n.isEqual(o,n.defaultValue)?delete e[n.key]:e[n.key]=n.unparse(o);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return o_(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:n}=this,o=new Map(this.knownState);return new Hf(e,t,function(r,s,i){let l;if(i)for(let[c,u]of Object.entries(i)){if(n_.has(c))continue;let d=r.get(c);d?s.has(d)||s.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l}(t.sharedConfigMap,o,n),o,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:o,unknownState:r}=this;o.has(e)||r&&n in r||(r&&(delete r[n],this.unknownState=o_(r)),this.size++),o.set(e,t)}updateFromUnknown(e,t){if(n_.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},(e in this.unknownState)||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let n of t.keys())t.set(n,n.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[n,o]of Object.entries(e))this.updateFromUnknown(n,o)}}function Wf(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Hf(t,_x(t));return t.__state=n,n}function _x(e){return e.__state?e.__state.sharedNodeState:dg(_o(),e.getType()).sharedNodeState}function o_(e){if(e)for(let t in e)return e}function SA(e){return e}function r_(e,t,n){for(let[o,r]of t.knownState){if(e.has(o.key))continue;e.add(o.key);let s=n?n.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function s_(e,t,n){let{unknownState:o}=t,r=n?n.unknownState:void 0;if(o)for(let[s,i]of Object.entries(o)){if(e.has(s))continue;if(e.add(s),i!==(r?r[s]:void 0))return!0}return!1}function i_(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function a_(e,t){let{__mode:n,__format:o,__style:r}=e,{__mode:s,__format:i,__style:l}=t,c=e.__state,u=t.__state;return(n===null||n===s)&&(o===null||o===i)&&(r===null||r===l)&&(e.__state===null||c===u||function(d,f){if(d===f)return!0;let p=new Set;return!(d&&r_(p,d,f)||f&&r_(p,f,d)||d&&s_(p,d,f)||f&&s_(p,f,d))}(c,u))}function l_(e,t){let n=e.mergeWithSibling(t),o=He()._normalizedNodes;return o.add(e.__key),o.add(t.__key),n}function c_(e){let t,n,o=e;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(t=o.getPreviousSibling())!==null&&V(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(a_(t,o)){o=l_(t,o);break}break}t.remove()}for(;(n=o.getNextSibling())!==null&&V(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(a_(o,n)){o=l_(o,n);break}break}n.remove()}}else o.remove()}function ni(e){return u_(e.anchor),u_(e.focus),e}function u_(e){for(;e.type==="element";){let t=e.getNode(),n=e.offset,o,r;if(n===t.getChildrenSize()?(o=t.getChildAtIndex(n-1),r=!0):(o=t.getChildAtIndex(n),r=!1),V(o)){e.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!P(o))break;e.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var Na=Symbol.for("@lexical/CachedTextSize");function d_(e,t){return hf.read(()=>{let n=0,o=e;for(let r=0;r<t&&o!==null;r++){let s=fo.get(o);if(s===void 0&&U(345,o),P(s)){let i=mt.get(o);if(i!==void 0&&P(i)&&i.__parent!==s.__parent)n+=s.getTextContentSize();else{let l=gs.get(o),c=l&&l.__lexicalTextContent;typeof c!="string"&&U(346,s.getType()),n+=c.length}r<t-1&&!s.isInline()&&(n+=2)}else{let i=s[Na];i===void 0&&U(347,s.getType(),o),n+=i}o=s.__next}return n},{editor:Ue})}function xx(e){P(e)||e[Na]===void 0&&(e[Na]=V(e)?e.__text.length:e.getTextContentSize())}var NA=4,Ea,Ue,Ta,$e="",Nt=null,Qt=null,Yt=null;function Oo(){return{firstTextKey:Yt,format:Nt,style:Qt}}function Fn(e){e.firstTextKey!==null&&(Nt=e.format,Qt=e.style,Yt=e.firstTextKey)}function pf(e){if(Yt!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&U(348),t===null)return;let n=mt.get(t);V(n)&&(Nt=n.getFormat(),Qt=n.getStyle(),Yt=t)}var Ic,ga,pa,fo,hf,mt,gs,mf,ba,hs,nr=!1,_c=!1;function Er(e,t){let n=fo.get(e),o=mt.has(e);if(t!==null){let r=Sf(e);r.parentNode===t&&t.removeChild(r)}if(!o){if(Ue._keyToDOMMap.delete(e),P(n)){let r=Fa(n,fo);_f(r,0,r.length-1,null)}if(n!==void 0){for(let r of Tn(n).values()){let s=Cf(r);Er(r,null),s!==null&&s.remove()}_g(ba,Ta,Ic,n,"destroyed")}}}function _f(e,t,n,o){for(let r=t;r<=n;++r){let s=e[r];s!==void 0&&Er(s,o)}}function ls(e,t){e.setProperty("text-align",t)}var EA="40px";function Cx(e,t){let n=Ea.theme.indent;if(typeof n=="string"){let o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${EA}))`)}function yx(e,t){let n=e.style;t===0?ls(n,""):t===1?ls(n,"left"):t===2?ls(n,"center"):t===3?ls(n,"right"):t===4?ls(n,"justify"):t===5?ls(n,"start"):t===6&&ls(n,"end")}function xf(e,t){let n=function(o){let r=o.__dir;if(r!==null)return r;if(Ft(o))return null;let s=o.getParent();return s===null||vt(s)&&s.__dir===null?"auto":null}(t);n!==null?e.dir=n:e.removeAttribute("dir")}function Sx(e){let t=_n().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function Nx(e,t,n){t||e.contentEditable==="false"?cy(n,Ue):n.removeAttribute("contenteditable")}function f_(e,t,n){let o=$e,r=Oo();$e="";let s="",i=Ve(e);for(let[l,c]of n){let u=Sx(l);Nx(t,i,u),t.appendChild(u),$e="";let d=Oo();Tr(c,On(e,u,Ue)),Fn(d),Ex(e,l,t,u),s+=$e}return Fn(r),$e=o,s}function Tn(e){return Ro(e)&&e.__slots!==null?e.__slots:dy}function Ex(e,t,n,o){let r=hs.$getSlotTargetElement(e,t,n,Ue);r!==null&&(o.parentElement!==r&&r.appendChild(o),o.style.display="")}function Cf(e){let t=gs.get(e);return t!==void 0?t.parentElement:null}function g_(e,t,n){let o=Tn(e),r=Tn(t);for(let[d,f]of o)if(!r.has(d)){let p=Cf(f);Er(f,null),p!==null&&p.remove()}let s=$e,i=Oo(),l="",c=null,u=Ve(t);for(let[d,f]of r){let p=o.get(d),h=p!==void 0?Cf(p):null;$e="";let m=Oo();if(h===null){h=Sx(d);let _=null;for(let x of n.children)if(!x.hasAttribute("data-lexical-slot")){_=x;break}n.insertBefore(h,_),Tr(f,On(t,h,Ue))}else p===f?tr(f,h):(p!==void 0&&Er(p,h),Tr(f,On(t,h,Ue)));if(Fn(m),Nx(n,u,h),Ex(t,d,n,h),l+=$e,h.parentElement===n){let _=c===null?n.firstChild:c.nextSibling;_!==h&&n.insertBefore(h,_),c=h}}return Fn(i),$e=s,l}function Tr(e,t){let n=mt.get(e);if(n===void 0&&U(60),t!==null){let r=fo.get(e);if(r!==void 0){let s=gs.get(e);if(s!==void 0){let i=Or(r)?r.__slotHost:null,l=Or(n)?n.__slotHost:null,c=r.__parent!==n.__parent||i!==l,u=l!==null&&s.parentElement!==t.element;if(c||u)return t.insertChild(s),tr(e,t.element)}}}let o=hs.$createDOM(n,Ue);if(function(r,s,i){let l=i._keyToDOMMap;FC(s,i,r),l.set(r,s)}(e,o,Ue),V(n)?o.setAttribute("data-lexical-text","true"):Ve(n)&&(o.setAttribute("data-lexical-decorator","true"),ly(o,{captureSelection:!0})),P(n)){let{__indent:r,__size:s}=n;xf(o,n),r!==0&&Cx(o,r);let i=Tn(n),l=i.size>0?f_(n,o,i):"";if(s===0)o.__lexicalTextContent=l,o.__lexicalFirstTextKey=null,$e+=l,i.size>0&&(o.__lexicalSlotTextLength=l.length);else{let u=$e,d=s-1;if(yf(Fa(n,mt),n,0,d,On(n,o,Ue)),l!==""){let f=o.__lexicalTextContent||"";o.__lexicalTextContent=l+f,$e=u+l+f}i.size>0&&(o.__lexicalSlotTextLength=l.length)}let c=n.__format;c!==0&&yx(o,c),n.isInline()||Tx(null,n,o)}else{let r=n.getTextContent();if(Ve(n)){let s=n.decorate(Ue,Ea);s!==null&&bx(e,s),o.contentEditable="false";let i=Tn(n);i.size>0&&f_(n,o,i)}$e+=r}return t!==null&&t.insertChild(o),hs.$decorateDOM(n,null,o,Ue),xx(n),_g(ba,Ta,Ic,n,"created"),o}function yf(e,t,n,o,r){let s=$e,i=Oo();$e="",Nt=null,Qt=null,Yt=null;let l=n;for(;l<=o;++l){let u=Oo();Tr(e[l],r);let d=mt.get(e[l]);d!==null&&V(d)?Nt===null&&(Nt=d.getFormat(),Qt=d.getStyle(),Yt=d.__key):P(d)&&l<o&&!d.isInline()&&($e+=us),Fn(u)}let c=Ue._keyToDOMMap.get(t.__key);c===void 0&&U(349,t.__key),c.__lexicalTextContent=$e,c.__lexicalFirstTextKey=Yt,$e=s+$e,Fn(i)}function Tx(e,t,n){let o=On(t,n,Ue),r=o.element.__lexicalLastChildKind??null,s=function(i,l){if(i){let c=i.__last;if(c){let u=l.get(c);if(u)return wo(u)?"line-break":Ve(u)&&u.isInline()?"decorator":null}return Tn(i).size>0?null:"empty"}return null}(t,mt);r!==s&&o.setManagedLineBreak(s)}function TA(e,t,n){var o;Nt=null,Qt=null,Yt=null,function(r,s,i){let l=$e,c=r.__size,u=s.__size;$e="";let d=i.element,f=Ue._keyToDOMMap.get(s.__key);f===void 0&&U(351,s.__key);let p=u-c;if(!nr&&Math.abs(p)<=1&&c>=NA&&r.__first===s.__first&&(p!==0||!Ue._cloneNotNeeded.has(r.__key))){let h=f.__lexicalTextContent,m=mf.get(r.__key);if(!nr&&typeof h=="string"&&m!==void 0){let _=function(x,C){let y=C.size;if(y===0||y>=x.__size)return null;let N=x.__last,E=null,v=0;for(;N!==null&&v<y;){if(!C.has(N))return null;E=N;let b=mt.get(N);if(b===void 0)return null;N=b.__prev,v++}if(v!==y)return null;if(N!==null&&C.has(N))return null;return E}(s,m);if(_!==null){let x=m.size;if(p===0){let C=d_(_,x),y=_,N=0;for(;y!==null&&N<x;){let O=mt.get(y);if(O===void 0)break;let D=Oo();tr(y,d),V(O)&&Nt===null&&(Nt=O.getFormat(),Qt=O.getStyle(),Yt=O.__key),Fn(D),y=O.__next,N++}let E="";for(y=_,N=0;y!==null&&N<x;){let O=mt.get(y);if(O===void 0)break;let D;if(P(O)){let H=Ue._keyToDOMMap.get(y),k=H&&H.__lexicalTextContent;typeof k!="string"&&U(352,O.getType()),D=k}else D=O.getTextContent();E+=D,N<x-1&&P(O)&&!O.isInline()&&(E+=us),y=O.__next,N++}let v=f.__lexicalSlotTextLength||0,b=v>0?h.slice(v):h,A=b.slice(0,b.length-C)+E;return f.__lexicalTextContent=A,$e=l+A,void p_(s,f,m)}if(function(C,y,N,E,v,b,A,O){if(O!==1&&O!==-1)return!1;if(A!==(O===1?2:1))return!1;let H=A-O,k=C.__last;for(let ke=0;ke<H-1;ke++){if(k===null)return!1;let ht=fo.get(k);if(ht===void 0)return!1;k=ht.__prev}if(k===null)return!1;let q=mt.get(b),j=fo.get(k);if(q===void 0||j===void 0)return!1;if(q.__prev!==j.__prev)return!1;let oe=[],B=b;for(let ke=0;ke<A;ke++){if(B===null)return!1;oe.push(B);let ht=mt.get(B);B=ht?ht.__next:null}let de=[];B=k;for(let ke=0;ke<H;ke++){if(B===null)return!1;de.push(B);let ht=fo.get(B);B=ht?ht.__next:null}let xe=new Set(de),ve=new Set(oe),te=[],ae=0,ce=0;for(;ae<H&&ce<A;)if(oe[ce]===de[ae])te.push({key:oe[ce],kind:"reconcile"}),ae++,ce++;else if(ve.has(de[ae])){if(xe.has(oe[ce]))return!1;te.push({key:oe[ce],kind:"create",nextIndex:ce}),ce++}else te.push({key:de[ae],kind:"destroy"}),ae++;for(;ae<H;)te.push({key:de[ae++],kind:"destroy"});for(;ce<A;)te.push({key:oe[ce],kind:"create",nextIndex:ce}),ce++;let Re=d_(k,H);for(let ke of te){let ht=Oo();if(ke.kind==="reconcile")tr(ke.key,N.element);else if(ke.kind==="destroy")Er(ke.key,N.element);else{let Gt=null;for(let Cr=ke.nextIndex+1;Cr<A;Cr++){let Jo=Ue._keyToDOMMap.get(oe[Cr]);if(Jo!==void 0){Gt=Jo;break}}Tr(ke.key,N.withBefore(Gt??N.before))}if(ke.kind!=="destroy"){let Gt=mt.get(ke.key);Gt&&V(Gt)&&Nt===null&&(Nt=Gt.getFormat(),Qt=Gt.getStyle(),Yt=Gt.__key)}Fn(ht)}let Me="";for(let ke=0;ke<A;ke++){let ht=mt.get(oe[ke]);if(ht===void 0)return!1;let Gt;if(P(ht)){let Cr=Ue._keyToDOMMap.get(oe[ke]),Jo=Cr&&Cr.__lexicalTextContent;typeof Jo!="string"&&U(350,ht.getType()),Gt=Jo}else Gt=ht.getTextContent();Me+=Gt,ke<A-1&&P(ht)&&!ht.isInline()&&(Me+=us)}let gt=E.__lexicalSlotTextLength||0,Jt=gt>0?v.slice(gt):v;return E.__lexicalTextContent=Jt.slice(0,Jt.length-Re)+Me,!0}(r,0,i,f,h,_,x,p)){let C=f.__lexicalTextContent;return typeof C!="string"&&U(353),$e=l+C,void p_(s,f,m)}}}if(p===0){let _=r.__first,x=0;for(;_!==null;){let C=mt.get(_);if(C===void 0)break;let y=nr||pa.has(_)||ga.has(_),N=Oo();if(y)tr(_,d);else{let E,v;if(P(C)){v=gs.get(_);let b=v&&v.__lexicalTextContent;typeof b!="string"&&U(354,C.getType()),E=b}else E=C.getTextContent();$e+=E,v!==void 0&&pf(v)}V(C)?Nt===null&&(Nt=C.getFormat(),Qt=C.getStyle(),Yt=C.__key):P(C)&&x<u-1&&!C.isInline()&&($e+=us),Fn(N),_=C.__next,x++}return f.__lexicalTextContent=$e,f.__lexicalFirstTextKey=Yt,void($e=l+$e)}}if(c===1&&u===1){let h=r.__first,m=s.__first;if(h===m)tr(h,d);else{let x=Sf(h),C=Tr(m,null);try{x.parentNode===d?d.replaceChild(C,x):i.insertChild(C)}catch(y){if(typeof y=="object"&&y!=null){let N=`${y.toString()} Parent: ${d.tagName}, new child: {tag: ${C.tagName} key: ${m}}, old child: {tag: ${x.tagName}, key: ${h}}.`;throw Error(N)}throw y}Er(h,null)}let _=mt.get(m);V(_)&&Nt===null&&(Nt=_.getFormat(),Qt=_.getStyle(),Yt=_.__key)}else{let h=Fa(r,fo),m=Fa(s,mt);if(h.length!==c&&U(227),m.length!==u&&U(228),c===0)u!==0&&yf(m,s,0,u-1,i);else if(u===0){if(c!==0){let _=i.after==null&&i.before==null&&Tn(s).size===0&&i.element.__lexicalLineBreak==null;_f(h,0,c-1,_?null:d),_&&(d.textContent="")}}else(function(_,x,C,y,N,E){let v=y-1,b=N-1,A,O,D=E.getFirstChild(),H=0,k=0;for(;H<=v&&k<=b;){let oe=x[H],B=C[k],de=Oo();if(oe===B)D=Qd(tr(B,E.element)),H++,k++;else{if(O===void 0&&(O=h_(C,k)),A===void 0)A=h_(x,H);else if(!A.has(oe)){H++,Fn(de);continue}if(!O.has(oe)){D=Qd(Sf(oe)),Er(oe,E.element),H++,A.delete(oe),Fn(de);continue}if(A.has(B)){let ve=ci(Ue,B);ve!==D&&E.withBefore(D??E.before).insertChild(ve),D=Qd(tr(B,E.element)),H++,k++}else Tr(B,E.withBefore(D??E.before)),k++}let xe=mt.get(B);xe!==null&&V(xe)?Nt===null&&(Nt=xe.getFormat(),Qt=xe.getStyle(),Yt=xe.__key):P(xe)&&k<=b&&!xe.isInline()&&($e+=us),Fn(de)}let q=H>v,j=k>b;if(q&&!j){let oe=C[b+1],B=oe===void 0?null:Ue.getElementByKey(oe);yf(C,_,k,b,E.withBefore(B??E.before))}else j&&!q&&_f(x,H,v,E.element)})(s,h,m,c,u,i)}f.__lexicalTextContent=$e,f.__lexicalFirstTextKey=Yt,$e=l+$e}(e,t,On(t,n,Ue)),vt(t)||(o=t,Nt==null||Nt===o.__textFormat||_c||o.setTextFormat(Nt),function(r){Qt==null||Qt===r.__textStyle||_c||r.setTextStyle(Qt)}(t))}function p_(e,t,n){let o=t.__lexicalFirstTextKey;if(o!=null){let r=e.__key,s=o;for(;s!==null;){let i=mt.get(s);if(i===void 0){s=null;break}if(i.__parent===r)break;s=i.__parent}if(s!==null&&!n.has(s)){let i=mt.get(o);if(V(i))return Nt=i.getFormat(),void(Qt=i.getStyle())}}t.__lexicalFirstTextKey=Yt}function tr(e,t){let n=fo.get(e),o=mt.get(e);n!==void 0&&o!==void 0||U(61);let r=nr||pa.has(e)||ga.has(e),s=ci(Ue,e);if(n===o&&!r){let i;if(P(n)){let l=s.__lexicalTextContent;typeof l!="string"&&U(355,n.getType()),i=l,pf(s)}else i=n.getTextContent();return $e+=i,s}if(n!==o&&r&&_g(ba,Ta,Ic,o,"updated"),hs.$updateDOM(o,n,s,Ue)){let i=Tr(e,null);return t===null&&U(62),t.replaceChild(i,s),Er(e,null),i}if(P(n)){P(o)||U(334,e);let i=o.__indent;(nr||i!==n.__indent)&&Cx(s,i);let l=o.__format;(nr||l!==n.__format)&&yx(s,l);let c=r&&(Tn(o).size>0||Tn(n).size>0)?g_(n,o,s):"";if(r){let u=$e;if(TA(n,o,s),Ft(o)||o.isInline()||Tx(0,o,s),c!==""){let d=s.__lexicalTextContent||"";s.__lexicalTextContent=c+d,$e=u+c+d,s.__lexicalSlotTextLength=c.length}else(Tn(o).size>0||Tn(n).size>0)&&(s.__lexicalSlotTextLength=0)}else{let u=s.__lexicalTextContent;typeof u!="string"&&U(356,n.getType()),$e+=u,pf(s)}if((nr||o.__dir!==n.__dir||o.__parent!==n.__parent)&&(xf(s,o),Ft(o)&&!nr)){for(let u of o.getChildren())if(P(u))xf(ci(Ue,u.getKey()),u)}}else{let i=o.getTextContent();if(Ve(o)){let l=o.decorate(Ue,Ea);l!==null&&bx(e,l),r&&(Tn(o).size>0||Tn(n).size>0)&&g_(n,o,s)}$e+=i}if(!_c&&Ft(o)){let i=o.getLatest();if(i.__cachedText!==$e){let l=i.getWritable();l.__cachedText=$e,o=l}}return hs.$decorateDOM(o,n,s,Ue),xx(o),s}function bx(e,t){let n=Ue._pendingDecorators,o=Ue._decorators;if(n===null){if(o[e]===t)return;n=PC(Ue)}n[e]=t}function Qd(e){let t=e.nextSibling;return t!==null&&t===Ue._blockCursorElement&&(t=t.nextSibling),t}function h_(e,t){let n=new Set;for(let o=t;o<e.length;o++)n.add(e[o]);return n}function bA(e,t,n,o,r,s){$e="",Nt=null,Qt=null,Yt=null,nr=o===2,Ue=n,Ea=n._config,hs=n._config.dom||wa,Ta=n._nodes,Ic=Ue._listeners.mutation,ga=r,pa=s,fo=e._nodeMap,hf=e,mt=t._nodeMap,_c=t._readOnly,gs=dx(n._keyToDOMMap),mf=function(){let l=new Map,c=(u)=>{for(let d of u){let f=mt.get(d);if(f===void 0)continue;let p=f.__parent;if(p===null)continue;let h=l.get(p);h===void 0&&(h=new Set,l.set(p,h)),h.add(d)}};return c(ga.keys()),c(pa),l}();let i=new Map;return ba=i,tr("root",null),Ue=void 0,Ta=void 0,ga=void 0,pa=void 0,fo=void 0,hf=void 0,mt=void 0,Ea=void 0,gs=void 0,mf=void 0,ba=void 0,hs=wa,i}function Sf(e){let t=gs.get(e);return t===void 0&&U(75,e),t}function Ne(e){return{type:e}}var Gf=Ne("SELECTION_CHANGE_COMMAND"),vA=Ne("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),vx=Ne("CLICK_COMMAND"),jf=Ne("BEFORE_INPUT_COMMAND"),Yf=Ne("INPUT_COMMAND"),Vf=Ne("COMPOSITION_START_COMMAND"),Xf=Ne("COMPOSITION_END_COMMAND"),Oa=Ne("DELETE_CHARACTER_COMMAND"),ha=Ne("INSERT_LINE_BREAK_COMMAND"),Nf=Ne("INSERT_PARAGRAPH_COMMAND"),ii=Ne("CONTROLLED_TEXT_INSERTION_COMMAND"),qf=Ne("PASTE_COMMAND"),ac=Ne("REMOVE_TEXT_COMMAND"),Aa=Ne("DELETE_WORD_COMMAND"),Ra=Ne("DELETE_LINE_COMMAND"),Sr=Ne("FORMAT_TEXT_COMMAND"),OA=Ne("SET_TEXT_FORMAT_COMMAND"),Jf=Ne("UNDO_COMMAND"),Zf=Ne("REDO_COMMAND"),Qf=Ne("KEYDOWN_COMMAND"),Ox=Ne("KEY_ARROW_RIGHT_COMMAND"),Ax=Ne("MOVE_TO_END"),Rx=Ne("KEY_ARROW_LEFT_COMMAND"),Mx=Ne("MOVE_TO_START"),Dx=Ne("KEY_ARROW_UP_COMMAND"),$x=Ne("KEY_ARROW_DOWN_COMMAND"),xc=Ne("KEY_ENTER_COMMAND"),wx=Ne("KEY_SPACE_COMMAND"),kx=Ne("KEY_BACKSPACE_COMMAND"),Ix=Ne("KEY_ESCAPE_COMMAND"),Lx=Ne("KEY_DELETE_COMMAND"),Fx=Ne("KEY_TAB_COMMAND"),AA=Ne("INSERT_TAB_COMMAND"),RA=Ne("INDENT_CONTENT_COMMAND"),MA=Ne("OUTDENT_CONTENT_COMMAND"),Px=Ne("DROP_COMMAND"),DA=Ne("FORMAT_ELEMENT_COMMAND"),Bx=Ne("DRAGSTART_COMMAND"),Kx=Ne("DRAGOVER_COMMAND"),zx=Ne("DRAGEND_COMMAND"),eg=Ne("COPY_COMMAND"),tg=Ne("CUT_COMMAND"),Ux=Ne("SELECT_ALL_COMMAND"),wA=Ne("CLEAR_EDITOR_COMMAND"),kA=Ne("CLEAR_HISTORY_COMMAND"),IA=Ne("CAN_REDO_COMMAND"),LA=Ne("CAN_UNDO_COMMAND"),Hx=Ne("FOCUS_COMMAND"),Wx=Ne("BLUR_COMMAND"),Gx=Ne("KEY_MODIFIER_COMMAND");function jx(e){let t=new Map;return{dispose(){for(let n of t.values())n.dispose();t.clear()},register(n,o){let r=t.get(n);r===void 0&&(r={dispose:e(n,o),holders:new Set},t.set(n,r));let s=()=>{let i=t.get(n);i&&i.holders.delete(s)&&i.holders.size===0&&(t.delete(n),i.dispose())};return r.holders.add(s),s}}}function ng(e,t,n,o){return e.addEventListener(t,n,o),e.removeEventListener.bind(e,t,n,o)}var Zo=Object.freeze({}),Ef=[["keydown",function(e,t){let n=t._inputState;if(n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!=="Backspace"&&Ma(n),t.isComposing())return;re(t,Qf,e)}],["pointerdown",function(e,t){let n=Ng(e),o=e.pointerType;mi(n)&&o!=="touch"&&o!=="pen"&&e.button===0&&zn(t,()=>{La(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){re(t,Vf,e)}],["compositionend",function(e,t){let n=t._inputState;Do?n.compositionPhase="ending-firefox":fs||!Ka&&!za?re(t,Xf,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();let n=t._inputState;Ma(n),zn(t,()=>{qx(e,t)||t.dispatchCommand(Yf,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){zn(t,()=>{let n=Fe(),o=Yn(xn(t)),r=Ns();if(o){if(fe(n)){let s=n.anchor,i=s.getNode();s.type==="element"&&s.offset===0&&n.isCollapsed()&&!Ft(i)&&vn().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r)&&(o.removeAllRanges(),n.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let s=Gn(o,t._rootElement).anchorNode;if(_t(s)||mo(s))en(Da(r,o,t,e))}}if(Do&&o!==null&&o.rangeCount===0){let s=t._rootElement;if(s!==null&&e.target===s){let i=e.clientY,l=s.childNodes.length;for(let u=0;u<s.childNodes.length;u++){let d=s.childNodes[u];if(_t(d)){let f=d.getBoundingClientRect();if(i<=(f.top+f.bottom)/2){l=u;break}}}o.setBaseAndExtent(s,l,s,l);let c=Da(r,o,t,e);c!==null?en(c):o.removeAllRanges()}}re(t,vx,e)})}],["cut",Zo],["copy",Zo],["dragstart",Zo],["dragover",Zo],["dragend",Zo],["paste",Zo],["focus",Zo],["blur",Zo],["drop",Zo]];xa&&Ef.push(["beforeinput",(e,t)=>function(n,o){let r=n.inputType;if(r==="deleteCompositionText"||Do&&WC(o))return;if(r==="insertCompositionText")return;zn(o,()=>{qx(n,o)||re(o,jf,n)},{event:n})}(e,t)]);var Tf=new WeakMap,Cc=new WeakMap,FA=jx((e)=>(e.addEventListener("selectionchange",y_),()=>e.removeEventListener("selectionchange",y_)));function Yx(e,t,n,o,r,s){let{anchor:i,focus:l}=e,c=i.getNode(),u=He(),d;if(s!==void 0)d=s;else{let _=Yn(xn(u));d=_!==null?Gn(_,u._rootElement):null}let f=d!==null?d.anchorNode:null,p=i.key,h=u.getElementByKey(p),m=n.length;return p!==l.key||!V(c)||(!r&&(!xa||u._inputState.lastBeforeInputInsertTextTimeStamp<o+50)||c.isDirty()&&m<2||BC(n))&&i.offset!==l.offset&&!c.isComposing()||Un(c)||c.isDirty()&&m>1||(r||!xa)&&h!==null&&!c.isComposing()&&f!==or(c,h,u)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(_,x){if(x.isSegmented())return!0;if(!_.isCollapsed())return!1;let C=_.anchor.offset,y=x.getParentOrThrow(),N=ka(x);return C===0?!x.canInsertTextBefore()||!y.canInsertTextBefore()&&!x.isComposing()||N||function(E){let v=E.getPreviousSibling();return(V(v)||P(v)&&v.isInline())&&!v.canInsertTextAfter()}(x):C===x.getTextContentSize()&&(!x.canInsertTextAfter()||!y.canInsertTextAfter()&&!x.isComposing()||N)}(e,c)}function m_(e,t){return mo(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function __(e,t,n){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=Gn(e,t._rootElement),l=t._inputState;l.isSelectionChangeFromDOMUpdate&&(l.isSelectionChangeFromDOMUpdate=!1,m_(o,r)&&m_(s,i)&&!l.postDeleteSelectionToRestore)||zn(t,()=>{if(!n)return void en(null);if(!Ya(t,o,s))return;let c=Fe();if(l.postDeleteSelectionToRestore&&fe(c)&&c.isCollapsed()){let u=c.anchor,d=l.postDeleteSelectionToRestore.anchor;(u.key===d.key&&u.offset===d.offset+1||u.offset===1&&d.getNode().is(u.getNode().getPreviousSibling()))&&(c=l.postDeleteSelectionToRestore.clone(),en(c))}if(l.postDeleteSelectionToRestore=null,fe(c)){let u=c.anchor,d=u.getNode();if(c.isCollapsed()){e.type==="Range"&&o===s&&(c.dirty=!0);let f=xn(t).event,p=f?f.timeStamp:performance.now(),{format:h,style:m,offset:_,key:x,timeStamp:C}=l.collapsedSelectionFormat,y=vn(),N=t.isComposing()===!1&&y.getTextContent()==="";if(p<C+200&&u.offset===_&&u.key===x)lc(c,h,m);else if(u.type==="text")V(d)||U(141),Vx(c,d);else if(u.type==="element"&&!N){P(d)||U(259);let E=u.getNode();E.isEmpty()?function(v,b){let A=b.getTextFormat(),O=b.getTextStyle();lc(v,A,O)}(c,E):lc(c,c.format,"")}}else{let f=u.key,p=c.focus.key,h=c.getNodes(),m=h.length,_=c.isBackward(),x=_?i:r,C=_?r:i,y=_?p:f,N=_?f:p,E=2047,v=!1;for(let b=0;b<m;b++){let A=h[b],O=A.getTextContentSize();if(V(A)&&O!==0&&!(b===0&&A.__key===y&&x===O||b===m-1&&A.__key===N&&C===0)&&(v=!0,E&=A.getFormat(),E===0))break}c.format=v?E:0}}re(t,Gf)})}function lc(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Vx(e,t){lc(e,t.getFormat(),t.getStyle())}function Xx(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function x_(e){let{lastKeyCode:t}=He()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t==="Enter"?`
|
|
5
|
-
`:t==="Tab"?"\t":null;if(!n)return;let o=Fe();if(!fe(o)||!o.isCollapsed())return;let r=o.anchor.getNode();if(!
|
|
6
|
-
`){if(wo(i))i.selectEnd();else if(!i){let l=yr(r,_C),c=l&&l.getNextSibling();P(c)&&c.selectStart()}}else n==="\t"?sg(i)&&i.selectEnd():
|
|
7
|
-
`)e.preventDefault(),re(o,ha,!1);else if(i===us)e.preventDefault(),re(o,Nf);else if(i==null&&e.dataTransfer){let f=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(f)}else i!=null&&Yx(s,n,i,e.timeStamp,!0)?(e.preventDefault(),re(o,ii,i),x_(i)):r.unprocessedBeforeInputData=i;return r.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":re(o,ii,e),x_((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let f=r.hadOrphanedCompositionEvents;r.hadOrphanedCompositionEvents=!1;let p=o._compositionKey;Lt(null),f||re(o,ii,e),cc(p);break}case"insertLineBreak":Lt(null),re(o,ha,!1);break;case"insertParagraph":Lt(null),r.isInsertLineBreak&&!fs?(r.isInsertLineBreak=!1,re(o,ha,!1)):re(o,Nf);break;case"insertFromPaste":case"insertFromPasteAsQuotation":re(o,qf,e);break;case"deleteByComposition":(function(f,p){return f!==p||P(f)||P(p)||!ka(f)||!ka(p)})(u,d)&&re(o,ac,e);break;case"deleteByDrag":xs(Nc),re(o,ac,e);break;case"deleteByCut":re(o,ac,e);break;case"deleteContent":re(o,Oa,!1);break;case"deleteWordBackward":re(o,Aa,!0);break;case"deleteWordForward":re(o,Aa,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":re(o,Ra,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":re(o,Ra,!1);break;case"formatStrikeThrough":re(o,Sr,"strikethrough");break;case"formatBold":re(o,Sr,"bold");break;case"formatItalic":re(o,Sr,"italic");break;case"formatUnderline":re(o,Sr,"underline");break;case"historyUndo":re(o,Jf);break;case"historyRedo":re(o,Zf)}return!0}function
|
|
8
|
-
`){let r=Fe();if(fe(r)||fi(r)){if(fe(r)){let s=r.focus;r.anchor.set(s.key,s.offset,s.type)}return re(e,xc,null),cc(n),!1}}let o=ot(n);if(o!==null&&V(o)&&Un(o)){o.markDirty();let r=Fe(),s=o.getTextContentSize(),i=fe(r)&&r.anchor.key===n?r.anchor.offset:s;return o.select(i,i).insertText(t),!0}}return hg(!0,e,t),cc(n),!1}function UA(e){let t=He(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase==="ending-safari"){let o=X_(e);if(o&&zn(t,()=>{yc(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",o)return!0}if(function(o){return Ze(o,"ArrowRight",{shiftKey:"any"})}(e))re(t,Ox,e);else if(function(o){return Ze(o,"ArrowRight",{...er,shiftKey:"any"})}(e))re(t,Ax,e);else if(function(o){return Ze(o,"ArrowLeft",{shiftKey:"any"})}(e))re(t,Rx,e);else if(function(o){return Ze(o,"ArrowLeft",{...er,shiftKey:"any"})}(e))re(t,Mx,e);else if(function(o){return Ze(o,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))re(t,Dx,e);else if(function(o){return Ze(o,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))re(t,$x,e);else if(function(o){return Ze(o,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))n.isInsertLineBreak=!0,re(t,xc,e);else if(function(o){return o.key===" "}(e))re(t,wx,e);else if(function(o){return Ln&&Ze(o,"o",{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,re(t,ha,!0);else if(function(o){return Ze(o,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))n.isInsertLineBreak=!1,re(t,xc,e);else if(function(o){return Ze(o,"Backspace",{shiftKey:"any"})||Ln&&Ze(o,"h",{ctrlKey:!0})}(e))X_(e)?re(t,kx,e)&&C_(n):(e.preventDefault(),re(t,Oa,!0));else if(function(o){return o.key==="Escape"}(e))re(t,Ix,e);else if(function(o){return Ze(o,"Delete",{})||Ln&&Ze(o,"d",{ctrlKey:!0})}(e))!function(o){return o.key==="Delete"}(e)?(e.preventDefault(),re(t,Oa,!1)):re(t,Lx,e);else if(function(o){return Ze(o,"Backspace",V_)}(e))e.preventDefault(),re(t,Aa,!0);else if(function(o){return Ze(o,"Delete",V_)}(e))e.preventDefault(),re(t,Aa,!1);else if(function(o){return Ln&&Ze(o,"Backspace",{metaKey:!0})}(e))e.preventDefault(),re(t,Ra,!0);else if(function(o){return Ln&&(Ze(o,"Delete",{metaKey:!0})||Ze(o,"k",{ctrlKey:!0}))}(e))e.preventDefault(),re(t,Ra,!1);else if(function(o){return Ze(o,"b",er)}(e))e.preventDefault(),re(t,Sr,"bold");else if(function(o){return Ze(o,"u",er)}(e))e.preventDefault(),re(t,Sr,"underline");else if(function(o){return Ze(o,"i",er)}(e))e.preventDefault(),re(t,Sr,"italic");else if(function(o){return Ze(o,"Tab",{shiftKey:"any"})}(e))re(t,Fx,e);else if(function(o){return Ze(o,"z",er)}(e))e.preventDefault(),re(t,Jf);else if(function(o){if(Ln)return Ze(o,"z",{metaKey:!0,shiftKey:!0});return Ze(o,"y",{ctrlKey:!0})||Ze(o,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),re(t,Zf);else{let o=t._editorState._selection;!function(r){return Ze(r,"a",er)}(e)?o===null||fe(o)||(!function(r){return Ze(r,"c",er)}(e)?function(r){return Ze(r,"x",er)}(e)&&(e.preventDefault(),re(t,tg,e)):(e.preventDefault(),re(t,eg,e))):(e.preventDefault(),re(t,Ux,e)&&C_(n))}return function(o){return o.ctrlKey||o.shiftKey||o.altKey||o.metaKey}(e)&&t.dispatchCommand(Gx,e),!0}function Jx(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var ai=new Map;function y_(e){let t=VC(e.target);if(t===null)return;let n=Uc(e.target),o=null,r=null,s=n!==null?Cc.get(n):void 0;if(n!==null){if(s!==void 0){let{editors:f,hasShadowEditor:p}=s;if(p===void 0){p=!1;for(let h of f)if(h._rootElement!==null&&rr(h._rootElement.getRootNode())){p=!0;break}s.hasShadowEditor=p}if(p){let h=null,m=null;for(let _ of f){let x=_._rootElement;if(x===null)continue;let C=Gn(t,x).anchorNode;if(C!==null&&ds(C)===_){if(rr(x.getRootNode())){o=_,r=C;break}h===null&&(h=_,m=C)}}o===null&&h!==null&&(o=h,r=m)}else{let h=t.anchorNode;h===null||_t(h)&&h.shadowRoot!==null||(o=ds(h),o!==null&&(r=h))}}if(o===null){let f=ui(n);o=f!==null?ds(f):null}}if(o===null)return;if(o._inputState.isSelectionChangeFromMouseDown){if(s!==void 0)for(let f of s.editors)f._inputState.isSelectionChangeFromMouseDown=!1;zn(o,()=>{let f=Ns(),p=r??Gn(t,o._rootElement).anchorNode;if(_t(p)||mo(p))en(Da(f,t,o,e))})}let i=pg(o),l=i[i.length-1],c=l._key,u=ai.get(c),d=u||l;d!==o&&__(t,d,!1),__(t,o,!0),o!==l?ai.set(c,o):u&&ai.delete(c)}function bf(e){e._lexicalHandled=!0}function S_(e){return e._lexicalHandled===!0}var N_=()=>{};function HA(e){let t=Tf.get(e);if(t===void 0)return void N_();let n=Cc.get(t);if(n===void 0)return void N_();Tf.delete(e);let o=Va(e);zc(o)?(function(s){if(s._parentEditor!==null){let i=pg(s),l=i[i.length-1]._key;ai.get(l)===s&&ai.delete(l)}else ai.delete(s._key)}(o),n.editors.delete(o),n.hasShadowEditor=void 0,e.__lexicalEditor=null):o&&U(198);let r=Jx(e);for(let s=0;s<r.length;s++)r[s]();e.__lexicalEventHandles=[]}function vf(e,t,n){zt();let o=e.__key,r=e.getParent();if(r===null)return void(Vt(e)!==null&&U(367,o,String(Vt(e))));let s=function(l){let c=Fe();if(!fe(c)||!P(l))return c;let{anchor:u,focus:d}=c,f=u.getNode(),p=d.getNode();return Ia(f,l)&&u.set(l.__key,0,"element"),Ia(p,l)&&d.set(l.__key,0,"element"),c}(e),i=!1;if(fe(s)&&t){let{anchor:l,focus:c}=s;l.key===o&&(vc(l,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0),c.key===o&&(vc(c,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else fi(s)&&t&&e.isSelected()&&e.selectPrevious();if(fe(s)&&t&&!i){let l=e.getIndexWithinParent();Bn(e),cs(s,r,l,-1)}else Bn(e);n||vt(r)||r.canBeEmpty()||!r.isEmpty()||vf(r,t),t&&s&&Ft(r)&&r.isEmpty()&&r.selectEnd()}function WA(e){return e}var Zx=Symbol.for("ephemeral");function Sc(e){return e[Zx]||!1}var E_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class rn{__type;__key;__parent;__prev;__next;__state;[Na];static getType(){let{ownNodeType:e}=qa(this);return e===void 0&&U(64,this.name),e}static clone(e){U(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||uy(this.constructor);return Object.assign(t,{extends:n}),typeof e=="string"&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",E_),Object.defineProperty(this,Na,E_),LC(this,e)}getType(){return this.__type}isInline(){U(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let t=ot(e);if(t===null)break;e=t.__parent!==null?t.__parent:Vt(t)}return!1}isSelected(e){let t=e||Fe();if(t==null)return!1;let n=t.getNodes().some((o)=>o.__key===this.__key);if(V(this))return n;if(fe(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;let o=this.getParent();if(Ve(this)&&this.isInline()&&o){let r=t.isBackward()?t.focus:t.anchor;if(o.is(r.getNode())&&r.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:ot(e)}getParentOrThrow(){let e=this.getParent();return e===null&&U(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(vt(t)||Vt(e)!==null)return P(e)||e===this&&Ve(e)||U(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&U(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:ot(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ot(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=P(this)?this:this.getParent(),n=P(e)?e:e.getParent(),o=t&&n?kc(t,n):null;return o?o.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=kc(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?kg(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&U(279),!1)))}isParentOf(e){return Ia(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],o=new Set,r=this;for(;r!==null;){let s=r.__key;if(o.has(s)||(o.add(s),n.push(r)),r===e)break;let i=P(r)?t?r.getFirstChild():r.getLastChild():null;if(i!==null){r=i;continue}let l=t?r.getNextSibling():r.getPreviousSibling();if(l!==null){r=l;continue}let c=r.getParentOrThrow();if(o.has(c.__key)||n.push(c),c===e)break;let u=null,d=c;do{if(d===null&&U(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||o.has(d.__key)||n.push(d)}while(u===null);r=u}return t||n.reverse(),n}isDirty(){let e=He()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Sc(this))return this;let e=ot(this.__key);return e===null&&U(113),e}getWritable(){if(Sc(this))return this;zt();let e=Io(),t=He(),n=e._nodeMap,o=this.__key,r=this.getLatest(),s=t._cloneNotNeeded,i=Fe();if(i!==null&&i.setCachedNodes(null),s.has(o))return Dc(r),r;let l=bg(r);return s.add(o),Dc(l),n.set(o,l),l}getTextContent(){return hy(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){U(70)}updateDOM(e,t,n){U(71)}getDOMSlot(e){return new ri(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){U(18,this.name)}updateFromJSON(e){return function(t,n){let o=t.getWritable(),r=n.$,s=r;for(let i of _x(o).flatKeys)i in n&&(s!==void 0&&s!==r||(s={...r}),s[i]=n[i]);return(o.__state||s)&&Wf(t).updateFromJSON(s),o}(this,e)}static transform(){return null}remove(e){vf(this,!0,e)}replace(e,t){zt();let n=Fe();n!==null&&(n=n.clone()),cf(this,e);let o=this.getLatest(),r=this.__key,s=e.__key,i=e.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size,u=i.getParent(),d=u!==null?i.getIndexWithinParent():-1;Bn(i),u!==null&&fe(n)&&cs(n,u,d,-1);let f=o.getPreviousSibling(),p=o.getNextSibling(),{__prev:h,__next:m,__parent:_}=o;if(vf(o,!1,!0),f===null)l.__first=s;else f.getWritable().__next=s;if(i.__prev=h,p===null)l.__last=s;else p.getWritable().__prev=s;i.__next=m,i.__parent=_,l.__size=c;let x=0;t&&(P(this)&&P(i)||U(139),x=i.getChildrenSize(),i.splice(x,0,this.getChildren()));let C=Hn(this);if(C.length>0){Ro(this)&&Ro(i)||U(368,this.__key,i.__key);for(let y of C){let N=Ar(this,y);N!==null&&(my(this,y),Og(i,y,N))}}if(fe(n)){en(n);let y=n.anchor,N=n.focus;y.key===r&&(t&&y.type==="element"?y.set(i.__key,x+y.offset,"element"):O_(y,i)),N.key===r&&(t&&N.type==="element"?N.set(i.__key,x+N.offset,"element"):O_(N,i))}return Ao()===r&&Lt(s),i}insertAfter(e,t=!0){zt(),cf(this,e);let n=this.getWritable(),o=e.getWritable();ox(this.getParentOrThrow());let r=o.getParent(),s=Fe(),i=!1,l=!1;if(r!==null){let p=e.getIndexWithinParent();if(fe(s)){let h=r.__key,{anchor:m,focus:_}=s;i=m.type==="element"&&m.key===h&&m.offset===p+1,l=_.type==="element"&&_.key===h&&_.offset===p+1}Bn(o),t&&fe(s)&&cs(s,r,p,-1)}else Bn(o);let c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=o.__key,f=n.__next;if(c===null)u.__last=d;else c.getWritable().__prev=d;if(u.__size++,n.__next=d,o.__next=f,o.__prev=n.__key,o.__parent=n.__parent,t&&fe(s)){let p=this.getIndexWithinParent();cs(s,u,p+1);let h=u.__key;i&&s.anchor.set(h,p+2,"element"),l&&s.focus.set(h,p+2,"element")}return e}insertBefore(e,t=!0){zt(),cf(this,e);let n=this.getWritable(),o=e.getWritable();ox(this.getParentOrThrow());let r=o.__key,s=Fe(),i=o.getParent(),l=i!==null?o.getIndexWithinParent():-1;Bn(o),i!==null&&t&&fe(s)&&cs(s,i,l,-1);let c=this.getPreviousSibling(),u=this.getParentOrThrow().getWritable(),d=n.__prev,f=this.getIndexWithinParent();if(c===null)u.__first=r;else c.getWritable().__next=r;if(u.__size++,n.__prev=r,o.__prev=d,o.__next=n.__key,o.__parent=n.__parent,t&&fe(s))cs(s,this.getParentOrThrow(),f);return e}isParentRequired(){return!1}createParentElementNode(){return bn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){zt();let n=Kn(this);if(n!==null)return n.selectPrevious(e,t);let o=this.getPreviousSibling(),r=this.getParentOrThrow();if(o===null)return r.select(0,0);if(P(o))return o.select();if(!V(o)){let s=o.getIndexWithinParent()+1;return r.select(s,s)}return o.select(e,t)}selectNext(e,t){zt();let n=Kn(this);if(n!==null)return n.selectNext(e,t);let o=this.getNextSibling(),r=this.getParentOrThrow();if(o===null)return r.select();if(P(o))return o.select(0,0);if(!V(o)){let s=o.getIndexWithinParent();return r.select(s,s)}return o.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function og(e){return e instanceof rn}var GA="historic",jA="history-push",uc="history-merge",YA="paste",VA="cut",Qx="collaboration",XA="skip-collab",eC="skip-scroll-into-view",tC="skip-dom-selection",Nc="skip-selection-focus",nC="composition-start",Ec="composition-end",qA="!important";function Of(e){let t={};if(!e)return t;let n="",o="",r=null,s=!1,i=!1,l=!1,c=0,u=e.length,d=-1;for(let h=0;h<u;h++){let m=e[h];if(s)m==="*"&&e[h+1]==="/"&&(s=!1,h++);else if(i)d===-1&&(d=h),i=!1;else if(r===null)if(m!=="/"||e[h+1]!=="*")if(m!=='"'&&m!=="'")if(m!=="(")if(m!==")")if(l||m!==":"||c!==0){if(m===";"&&c===0){d!==-1&&(l?o+=e.slice(d,h):n+=e.slice(d,h),d=-1);let _=n.trim(),x=o.trim();_!==""&&x!==""&&(t[_]=x),n="",o="",l=!1;continue}d===-1&&(d=h)}else d!==-1&&(n+=e.slice(d,h),d=-1),l=!0;else d===-1&&(d=h),c=Math.max(0,c-1);else d===-1&&(d=h),c++;else d===-1&&(d=h),r=m;else d!==-1&&(l?o+=e.slice(d,h):n+=e.slice(d,h),d=-1),s=!0,h++;else d===-1&&(d=h),m==="\\"?i=!0:m===r&&(r=null)}d!==-1&&(l?o+=e.slice(d,u):n+=e.slice(d,u));let f=n.trim(),p=o.trim();return f!==""&&p!==""&&(t[f]=p),t}function oC(e,t,n){let o=n.trimEnd(),r=o.length-10;r>=0&&o.slice(r).toLowerCase()===qA?e.setProperty(t,o.slice(0,r).trim(),"important"):e.setProperty(t,n,"")}function JA(e,t){for(let n in t){let o=t[n];o==null?e.removeProperty(n):oC(e,n,o)}}function Af(e,t,n=""){if(t===n)return;let o=Of(n),r=Of(t);for(let s in r)delete o[s],oC(e,s,r[s]);for(let s in o)e.removeProperty(s)}function ef(e,t){return 16&t?"code":t&Kf?"mark":32&t?"sub":64&t?"sup":null}function tf(e,t){return 1&t?"strong":2&t?"em":"span"}function rC(e,t,n,o,r){let s=o.classList,i=li(r,"base");i!==void 0&&s.add(...i),i=li(r,"underlineStrikethrough");let l=!1,c=8&t&&4&t;i!==void 0&&(8&n&&4&n?(l=!0,c||s.add(...i)):c&&s.remove(...i));for(let u in jt){let d=jt[u];if(i=li(r,u),i!==void 0)if(n&d){if(l&&(u==="underline"||u==="strikethrough")){t&d&&s.remove(...i);continue}((t&d)===0||c&&u==="underline"||u==="strikethrough")&&s.add(...i)}else t&d&&s.remove(...i)}}function sC(e,t,n){let o=n.isComposing(),r=e+(o?ya:""),s=_o(),i=Tg(s).$getDOMSlot(n,t,s),l=i.getFirstChild();if(l===null||l.nodeType!==Node.TEXT_NODE)return void i.insertChild(_n().createTextNode(r));let c=l,u=c.nodeValue;if(u!==r)if(o||Do){let[d,f,p]=function(h,m){let _=h.length,x=m.length,C=0,y=0;for(;C<_&&C<x&&h[C]===m[C];)C++;for(;y+C<_&&y+C<x&&h[_-y-1]===m[x-y-1];)y++;return[C,_-C-y,m.slice(C,x-y)]}(u,r);f!==0&&c.deleteData(d,f),c.insertData(d,p)}else c.nodeValue=r}function T_(e,t,n,o,r,s){sC(r,e,t);let i=s.theme.text;i!==void 0&&rC(0,0,o,e,i)}function oc(e,t){let n=_n().createElement(t);return n.appendChild(e),n}function Tc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends rn{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:tR,priority:0}),b:()=>({conversion:QA,priority:0}),code:()=>({conversion:Qo,priority:0}),em:()=>({conversion:Qo,priority:0}),i:()=>({conversion:Qo,priority:0}),mark:()=>({conversion:Qo,priority:0}),s:()=>({conversion:Qo,priority:0}),span:()=>({conversion:ZA,priority:0}),strong:()=>({conversion:Qo,priority:0}),sub:()=>({conversion:Qo,priority:0}),sup:()=>({conversion:Qo,priority:0}),u:()=>({conversion:Qo,priority:0})}})}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 dA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ao()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=jt[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return vr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,o=ef(0,n),r=tf(0,n),s=o===null?r:o,i=_n().createElement(s),l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),o!==null&&(l=_n().createElement(r),i.appendChild(l)),T_(l,this,0,n,this.__text,e);let c=this.__style;return c!==""&&Af(i.style,c),i}updateDOM(e,t,n){let o=this.__text,r=e.__format,s=this.__format,i=ef(0,r),l=ef(0,s),c=tf(0,r),u=tf(0,s);if((i===null?c:i)!==(l===null?u:l))return!0;if(i===l&&c!==u){let m=t.firstChild;m==null&&U(48);let _=_n().createElement(u);return T_(_,this,0,s,o,n),t.replaceChild(_,m),!1}let d=t;l!==null&&i!==null&&(d=t.firstChild,d==null&&U(49)),sC(o,d,this);let f=n.theme.text;f!==void 0&&r!==s&&rC(0,r,s,d,f);let p=e.__style,h=this.__style;return p!==h&&Af(t.style,h,p),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return _t(t)||U(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=oc(t,"b")),this.hasFormat("italic")&&(t=oc(t,"i")),this.hasFormat("strikethrough")&&(t=oc(t,"s")),this.hasFormat("underline")&&(t=oc(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e=="string"?jt[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e=="string"?lA[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=vr(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=uA[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){zt();let n=e,o=t,r=Fe(),s=this.getTextContent(),i=this.__key;if(typeof s=="string"){let l=s.length;n===void 0&&(n=l),o===void 0&&(o=l)}else n=0,o=0;if(!fe(r))return xC(i,n,i,o,"text","text");{let l=Ao();l!==r.anchor.key&&l!==r.focus.key||Lt(i),r.setTextNodeRange(this,n,this,o)}return r}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,o){let r=this.getWritable(),s=r.__text,i=n.length,l=e;l<0&&(l=i+l,l<0&&(l=0));let c=Fe();if(o&&fe(c)){let d=e+i;c.setTextNodeRange(r,d,r,d)}let u=s.slice(0,l)+n+s.slice(l+t);return r.__text=u,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){zt();let t=this.getLatest(),n=t.getTextContent();if(n==="")return[];let o=t.__key,r=Ao(),s=n.length;e.sort((A,O)=>A-O),e.push(s);let i=[],l=e.length;for(let A=0,O=0;A<s&&O<=l;O++){let D=e[O];D>A&&(i.push(n.slice(A,D)),A=D)}let c=i.length;if(c===1)return[t];let u=i[0],d=t.getParent(),f,p=t.getFormat(),h=t.getStyle(),m=t.__detail,_=!1,x=null,C=null,y=Fe();if(fe(y)){let[A,O]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];A.type==="text"&&A.key===o&&(x=A),O.type==="text"&&O.key===o&&(C=O)}t.isSegmented()?(f=hn(u),f.__format=p,f.__style=h,f.__detail=m,f.__state=i_(t,f),_=!0):f=t.setTextContent(u);let N=[f];for(let A=1;A<c;A++){let O=hn(i[A]);O.__format=p,O.__style=h,O.__detail=m,O.__state=i_(t,O);let D=O.__key;r===o&&Lt(D),N.push(O)}let E=x?x.offset:null,v=C?C.offset:null,b=0;for(let A of N){if(!x&&!C)break;let O=b+A.getTextContentSize();if(x!==null&&E!==null&&E<=O&&E>=b&&(x.set(A.getKey(),E-b,"text"),E<O&&(x=null)),C!==null&&v!==null&&v<=O&&v>=b){C.set(A.getKey(),v-b,"text");break}b=O}if(d!==null){(function(D){let H=D.getPreviousSibling(),k=D.getNextSibling();H!==null&&Dc(H),k!==null&&Dc(k)})(this);let A=d.getWritable(),O=this.getIndexWithinParent();_?(A.splice(O,0,N),this.remove()):A.splice(O,1,N),fe(y)&&cs(y,d,O,c-1)}return N}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||U(50);let n=this.__key,o=e.__key,r=this.__text,s=r.length;Ao()===o&&Lt(n);let i=Fe();if(fe(i)){let{anchor:d,focus:f}=i;d!==null&&d.key===o&&L_(d,t,n,e,s),f!==null&&f.key===o&&L_(f,t,n,e,s)}let l=e.__text,c=t?l+r:r+l;this.setTextContent(c);let u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function ZA(e){return{forChild:rg(e.style),node:null}}function QA(e){let t=e,n=t.style.fontWeight==="normal";return{forChild:rg(t.style,n?void 0:"bold"),node:null}}var b_=new WeakMap;function eR(e){if(!_t(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function tR(e){let t=e;e.parentElement===null&&U(129);let n=t.textContent||"";if(function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=b_.get(s))===void 0&&!eR(s);)i.push(s),s=s.parentNode;let l=r===void 0?s:r;for(let c=0;c<i.length;c++)b_.set(i[c],l);return l}(t)!==null)return{node:ig(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=t,r=!0;for(;o!==null&&(o=v_(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=t,r=!0;for(;o!==null&&(o=v_(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:hn(n)}}function v_(e,t){let n=e;for(;;){let o;for(;(o=t?n.nextSibling:n.previousSibling)===null;){let s=n.parentElement;if(s===null)return null;n=s}if(n=o,_t(n)){let s=n.style.display;if(s===""&&!oy(n)||s!==""&&!s.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(mo(n))return n;if(n.nodeName==="BR")return null}}var nR={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Qo(e){let t=nR[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:rg(e.style,t),node:null}}function hn(e=""){return Xa(new ms(e))}function V(e){return e instanceof ms}function rg(e,t){let n=e.fontWeight,o=e.textDecoration.split(" "),r=n==="700"||n==="bold",s=o.includes("line-through"),i=e.fontStyle==="italic",l=o.includes("underline"),c=e.verticalAlign;return(u)=>V(u)||Tc(u)?(r&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),l&&!u.hasFormat("underline")&&u.toggleFormat("underline"),c!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),c!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),t&&!u.hasFormat(t)&&u.toggleFormat(t),u):u}class Ua extends ms{$config(){return this.config("tab",{extends:ms})}constructor(e=void 0){super("\t",e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=li(e.theme,"tab");if(n!==void 0)t.classList.add(...n);return t}setTextContent(e){return super.setTextContent("\t")}spliceText(e,t,n,o){return n===""&&t===0||n==="\t"&&t===1||U(286),this}setDetail(e){return e!==2&&U(127),this}setMode(e){return e!=="normal"&&U(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function iC(){return Xa(new Ua)}function sg(e){return e instanceof Ua}class aC{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){if(this.key===e.key)return this.offset<e.offset;return wg(Mo($r(this,"next")),Mo($r(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&U(20),e}set(e,t,n,o){let r=this._selection,s=this.key;o&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,br()||(Ao()===s&&Lt(e),r!==null&&(r.setCachedNodes(null),fe(r)&&(r._cachedIsBackward=null),r.dirty=!0)))}}function ho(e,t,n){return new aC(e,t,n)}function nf(e,t){let n=t.__key,o=e.offset,r="element";if(V(t)){r="text";let s=t.getTextContentSize();o>s&&(o=s)}else if(!P(t)){let s=t.getNextSibling();if(V(s))n=s.__key,o=0,r="text";else{let i=t.getParent();i&&(n=i.__key,o=t.getIndexWithinParent()+1)}}e.set(n,o,r)}function O_(e,t){if(P(t)){let n=t.getLastDescendant();P(n)||V(n)?nf(e,n):nf(e,t)}else nf(e,t)}function A_(e,t,n,o){let r=e.getNode(),s=r.getChildAtIndex(e.offset),i=hn();if(i.setFormat(n),i.setStyle(o),DC(s))s.splice(0,0,[i]);else if(s!==null){let l=vt(r)?bn().append(i):i;s.insertBefore(l)}else if(vt(r)){let l=r.getLastChild();P(l)&&!l.isInline()&&l.isEmpty()?l.append(i):r.append(bn().append(i))}else r.append(i);e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}function R_(e,t,n,o){let r=e.anchor.getNode();V(r)||U(398);let s=e.anchor.offset,i=hn(t);i.setFormat(n),i.setStyle(o);let l=r.getParentOrThrow();if(s===0)l.isInline()&&!r.__prev?l.insertBefore(i):r.insertBefore(i,!1);else if(s===r.getTextContentSize())l.isInline()&&!r.__next?l.insertAfter(i):r.insertAfter(i,!1);else{let[c]=r.splitText(s);c.insertAfter(i,!1)}r.getTextContent()===""&&r.isAttached()&&r.remove(),i.selectEnd(),i.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}class Lc{_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(!fi(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((o)=>n.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 Lc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter((s)=>Vt(s)===null),n=t.length;if(n===0)return;let o=t[n-1],r;if(V(o))r=o.select();else{let s=o.getIndexWithinParent()+1;r=o.getParentOrThrow().select(s,s)}r.insertNodes(e);for(let s=0;s<n;s++)t[s].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let o of t){let r=ot(o);r!==null&&n.push(r)}return br()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter((t)=>Vt(t)===null);if((Fe()||Ns())===this&&e[0]){let t=Ct(e[0],"next");yy(Dr(t,t))}for(let t of e)t.remove();lC()}}function lC(){let e=vn();if(e.isEmpty()){let t=bn();e.append(t),t.select()}}function fe(e){return e instanceof Ss}class Ss{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!fe(e)&&(this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(n){let o=[],[r,s]=n.getTextSlices();r&&o.push(r.caret.origin);let i=new Set,l=new Set;for(let c of n)if(Wn(c)){let{origin:u}=c;o.length===0?i.add(u):(l.add(u),o.push(u))}else{let{origin:u}=c;P(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Rr(n.focus)&&P(n.focus.origin)&&n.focus.getNodeAtCaret()===null)for(let c=sr(n.focus.origin,"previous");Wn(c)&&i.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=di(c))i.delete(c.origin),o.pop();for(;o.length>1;){let c=o[o.length-1];if(!P(c)||l.has(c)||c.isEmpty()||i.has(c))break;o.pop()}if(o.length===0&&n.isCollapsed()){let c=Mo(n.anchor),u=Mo(n.anchor.getFlipped()),d=(p)=>go(p)?p.origin:p.getNodeAtCaret(),f=d(c)||d(u)||(n.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(f)}return o}(Ig(Ff(this),"next"));return br()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,o){return this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,o,"text"),this}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let t=e[0],n=e[e.length-1],o=this.anchor,r=this.focus,s=o.isBefore(r),[i,l]=Rf(this),c="",u=!0;for(let d=0;d<e.length;d++){let f=e[d];if(P(f)&&!f.isInline()){u||(c+=`
|
|
9
|
-
`);let p="";for(let h of Hn(f)){let m=Ar(f,h);m!==null&&(p+=m.getTextContent())}p!==""?(c+=p,u=!1):u=!f.isEmpty()}else if(u=!1,V(f)){let p=f.getTextContent();f===t?f===n?o.type==="element"&&r.type==="element"&&r.offset!==o.offset||(p=i<l?p.slice(i,l):p.slice(l,i)):p=s?p.slice(i):p.slice(l):f===n&&(p=s?p.slice(0,l):p.slice(0,i)),c+=p}else!Ve(f)&&!wo(f)||f===n&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){let t=He(),n=t.getEditorState()._selection,o=mC(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(o===null)return;let[r,s,i]=o;this.anchor.set(r.key,r.offset,r.type,!0),this.focus.set(s.key,s.offset,s.type,!0),i&&(this.dirty=!0),ni(this)}clone(){let e=this.anchor,t=this.focus;return new Ss(ho(e.key,e.offset,e.type),ho(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=vr(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=jt[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(ig(e))}insertText(e){let t=this.format,n=this.style;if(!this.isCollapsed()){let d=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(V(d)&&(t=d.getFormat(),n=d.getStyle()),this.removeText(),this.format=t,this.style=n,e==="")return;if(Ao()===null)return this.anchor.type==="element"&&A_(this.anchor,this.focus,t,n),void R_(this,e,t,n)}this.anchor.type==="element"&&A_(this.anchor,this.focus,t,n);let o=this.anchor.getNode();V(o)||U(398);let r=this.anchor.offset,s=o.getParentOrThrow(),i=o.getTextContentSize();if(Un(o)||r===0&&(!o.canInsertTextBefore()||!s.canInsertTextBefore()&&!o.__prev)||r===i&&(!o.canInsertTextAfter()||!s.canInsertTextAfter()&&!o.__next)){if(o.isSegmented()&&r!==0&&r!==i){if(Ao()!==null)o.setMode("normal").setFormat(t).setStyle(n);else{let f=hn(o.getTextContent());f.setFormat(t),f.setStyle(n),o.replace(f),f.select(r,r)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(r===0){let f=o.getPreviousSibling();if(V(f)&&f.canInsertTextAfter()&&!Un(f))f.select();else{let p=hn();p.setFormat(t),p.setStyle(n),s.canInsertTextBefore()?o.insertBefore(p):s.insertBefore(p),p.select()}return void this.insertText(e)}if(r===i){let f=o.getNextSibling();if(V(f)&&f.canInsertTextBefore()&&!Un(f))f.select(0,0);else{let p=hn();p.setFormat(t),p.setStyle(n),s.canInsertTextAfter()?o.insertAfter(p):s.insertAfter(p),p.select(0,0)}return void this.insertText(e)}let d=hn(e);return d.setFormat(t),d.setStyle(n),o.replace(d),void d.select()}if(e==="")return;let l=s.isInline()&&r===0&&!o.__prev,c=s.isInline()&&r===i&&!o.__next,u=o.getFormat()!==t||o.getStyle()!==n;if(l||c||u){if(o.getTextContent()!==""||l||c)return void R_(this,e,t,n);o.setFormat(t),o.setStyle(n)}o.spliceText(r,0,e,!0),o.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=Fe()===this;_a(this,Sy(Ff(this))),e&&Fe()!==this&&en(this)}formatText(e,t=null){uC(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type==="element"&&P(t)&&Vt(t)!==null){let m=t.isShadowRoot()?t.getFirstChild()??t.append(bn()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&m!==null&&!P(m)){let _=bn();m.insertBefore(_),m=_}if(m!==null){m.selectStart();let _=Fe();return fe(_)||U(369),_.insertNodes(e)}}if(this.anchor.type==="element"&&vt(t)){let m=rf(e),_=m.getLastDescendant();return t.splice(this.anchor.offset,0,m.getChildren()),void(_!==null&&_.selectEnd())}let n=(this.isBackward()?this.focus:this.anchor).getNode(),o=yr(n,pn),r=e[e.length-1];if(P(o)&&"__language"in o){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let m=ua(this);o.splice(m,0,e),r.selectEnd()}return}if(!e.some((m)=>(P(m)||Ve(m))&&!m.isInline())){P(o)||U(211,n.constructor.name,n.getType());let m=ua(this);return o.splice(m,0,e),void r.selectEnd()}if(P(o)&&Vt(o)!==null){let m=ua(this),_=Df(e);o.splice(m,0,_);let x=_[_.length-1];return void(x!==void 0?x.selectEnd():o.select(m,m))}if(o===null){let m=rf(e),_=m.getLastDescendant(),x=$r(this.anchor,"next");for(let C of m.getChildren())x=by(C,x);return void(_!==null&&_.selectEnd())}if(P(o)&&!o.isParentRequired()&&!vt(o.getParentOrThrow())){let m=ua(this),_=Df(e);o.splice(m,0,_);let x=_[_.length-1];return void(x!==void 0?x.selectEnd():o.select(m,m))}let s=rf(e),i=s.getLastDescendant(),l=s.getChildren(),c=!P(o)||!o.isEmpty()?this.insertParagraph():null;c&&!o.isAttached()&&(n=this.anchor.getNode(),o=yr(n,pn));let u=l[l.length-1],d=l[0];var f;P(f=d)&&pn(f)&&!f.isEmpty()&&P(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(P(o)||U(211,n.constructor.name,n.getType()),o.append(...d.getChildren()),d=l[1]),d&&(o===null&&U(212,n.constructor.name,n.getType()),function(m,_){let x=_.getParentOrThrow().getLastChild(),C=_,y=[_];for(;C!==x;)C.getNextSibling()||U(140),C=C.getNextSibling(),y.push(C);let N=m;for(let E of y)N=N.insertAfter(E)}(o,d));let p=yr(i,pn);c&&P(p)&&(c.canMergeWhenEmpty()||pn(u))&&(p.append(...c.getChildren()),c.remove()),P(o)&&o.isEmpty()&&o.remove(),i.selectEnd();let h=P(o)?o.getLastChild():null;wo(h)&&p!==o&&h.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&vt(e)){let i=bn();return e.splice(this.anchor.offset,0,[i]),i.select(),i}let t=ua(this),n=yr(this.anchor.getNode(),pn);if(n!==null&&Vt(n)!==null)return null;P(n)||U(213);let o=n.getChildAtIndex(t),r=o?[o,...o.getNextSiblings()]:[],s=n.insertNewAfter(this,!1);return s?(s.append(...r),s.selectStart(),s):null}insertLineBreak(e){let t=Pc();if(this.insertNodes([t]),e){let n=t.getParentOrThrow(),o=t.getIndexWithinParent();n.select(o,o)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],o=e[t-1],[r,s]=Rf(this),i=this.isBackward(),[l,c]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=i?[s,r]:[r,s];if(t===0)return[];if(t===1){if(V(n)&&!this.isCollapsed()){let f=n.splitText(u,d),p=u===0?f[0]:f[1];return p?(l.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[n]}if(V(n)&&(u===n.getTextContentSize()?e.shift():u!==0&&([,n]=n.splitText(u),e[0]=n,l.set(n.getKey(),0,"text"))),V(o)){let f=o.getTextContent().length;d===0?e.pop():d!==f&&([o]=o.splitText(d),e[e.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return e}modify(e,t,n){if(Ac(this,e,t,n))return;let o=e==="move",r=He(),s=Yn(xn(r));if(!s)return;let{_blockCursorElement:i,_rootElement:l}=r,c=this.focus.getNode();l===null||i===null||!P(c)||c.isInline()||c.canBeEmpty()||$c(i,r,l);let u=ci(r,this.focus.key),d=u;if(this.focus.type==="text"&&(d=V(c)?or(c,u,r):null),this.dirty){let f=ci(r,this.anchor.key),p=f;if(this.anchor.type==="text"){let h=this.anchor.getNode();p=V(h)?or(h,f,r):null}p&&d&&Oc(s,p,this.anchor.offset,d,this.focus.offset)}if(n==="character"&&V(c)&&c.isUnmergeable()){if(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize()){let f=Ct(c,t?"previous":"next").getNodeAtCaret();if(V(f)){if(!o){let p=f.getTextContentSize();return t?this.focus.set(f.__key,p-1,"text"):this.focus.set(f.__key,1,"text"),void(this.dirty=!0)}{let p=r.getElementByKey(f.getKey()),h=p?or(f,p,r):null;if(h){let m=t?h.length:0;Oc(s,h,m,h,m)}}}}}if(fC(s,e,t?"backward":"forward",n),s.rangeCount>0){let f=hi(s,r._rootElement),p=f||s.getRangeAt(0),h=this.anchor.getNode(),m=Ft(h)?h:Cg(h);if(this.applyDOMRange(p),this.dirty=!0,!o)gC(this,t,m),(f?s.direction!=="backward":s.anchorNode===p.startContainer&&s.anchorOffset===p.startOffset)||dC(this)}n==="lineboundary"&&Ac(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&P(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){let o=t.getParent(),r=t.getNextSibling()||(o===null?null:o.getNextSibling());if(P(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,e))return;let r=Dg($r(n,e?"previous":"next"));if(r.getTextSlices().every((i)=>i===null||i.distance===0)){let i={type:"initial"};for(let l of r.iterNodeCarets("shadowRoot"))if(Wn(l))if(l.origin.isInline());else{if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(P(r.anchor.origin)&&r.anchor.origin.isEmpty()){let c=Mo(l);_a(this,Dr(c,c)),r.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}else{if(i.type==="merge-block")break;if(Rr(l)){if(P(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(r.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Ve(l.origin)){if(l.origin.isIsolated());else if(Hn(l.origin).length>0){if(P(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let c=bc();c.add(l.origin.getKey()),en(c)}}else if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&P(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let c=bc();c.add(l.origin.getKey()),en(c)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:c}=i;if(Hn(c).length>0)return;return l.origin.isEmpty()&&!c.isEmpty()&&l.origin.getParent()===c.getParent()?void l.origin.remove(!0):(_a(this,Dr(!l.origin.isEmpty()&&c.isEmpty()?Ts(Ct(c,l.direction)):r.anchor,l)),this.removeText())}for(let l=n.getNode();l!==null;){if(Vt(l)!==null)return;if(P(l)&&l.isShadowRoot())break;l=l.getParent()}}let s=this.focus;if(of(this,e,"character"),this.isCollapsed()){if(e&&n.offset===0&&D_(this,n.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(o=n.type==="text"?n.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,c=i.getTextContentSize();if(i.is(o)||e&&l!==c||!e&&l!==0)return void $_(i,e,l)}else if(o!==null&&o.isSegmented()){let l=n.offset,c=o.getTextContentSize();if(o.is(i)||e&&l!==0||!e&&l!==c)return void $_(o,e,l)}(function(l,c){let{anchor:u,focus:d}=l,f=u.getNode(),p=d.getNode();if(f===p&&u.type==="text"&&d.type==="text"){let h=u.offset,m=d.offset,_=h<m,x=_?h:m,C=_?m:h,y=C-1;if(x!==y)(function(N){return!(BC(N)||rR(N))})(f.getTextContent().slice(x,C))&&(c?d.set(d.key,y,d.type):u.set(u.key,y,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let n=this.anchor.getNode();n.isEmpty()&&Ft(n.getParent())&&n.getPreviousSibling()===null&&D_(this,n),lC()}}deleteLine(e){let t=Mf(this.anchor);if(t!==null&&Ve(Kn(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);if(this.isCollapsed()&&of(this,e,"lineboundary"),this.isCollapsed())this.deleteCharacter(e);else yr(this.anchor.getNode(),pn)!==yr(this.focus.getNode(),pn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;of(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return br()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function fi(e){return e instanceof Lc}function cC(e,t){if(fi(e)){for(let C of e.getNodes())Tc(C)&&C.setFormat(t(C.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Lt(null);let n=[];for(let C of e.getNodes())V(C)?n.push(C):P(C)?C.setTextFormat(t(C.getTextFormat())):Tc(C)&&C.setFormat(t(C.getFormat()));let o=n.length;if(o===0)return e.setFormat(t(e.format)),void Lt(null);let{anchor:r,focus:s}=e,i=e.isBackward(),l=i?s:r,c=i?r:s,u=0,d=n[0],f=l.type==="element"?0:l.offset;if(l.type==="text"&&f===d.getTextContentSize()&&(u=1,d=n[1],f=0),d==null)return;let p=o-1,h=n[p],m=c.type==="text"?c.offset:h.getTextContentSize();if(d.is(h)){if(f===m)return;let C=t(d.getFormat());if(Un(d)||f===0&&m===d.getTextContentSize())d.setFormat(C);else{let y=d.splitText(f,m),N=f===0?y[0]:y[1];N.setFormat(C),l.type==="text"&&l.set(N.__key,0,"text"),c.type==="text"&&c.set(N.__key,m-f,"text")}return void(e.format=C)}f===0||Un(d)||([,d]=d.splitText(f),f=0);let _=t(d.getFormat());d.setFormat(_);let x=t(h.getFormat());m>0&&(m===h.getTextContentSize()||Un(h)||([h]=h.splitText(m)),h.setFormat(x));for(let C=u+1;C<p;C++){let y=n[C];y.setFormat(t(y.getFormat()))}l.type==="text"&&l.set(d.__key,f,"text"),c.type==="text"&&c.set(h.__key,m,"text"),e.format=_|x}function oR(e,t){let n=[];for(let[o,r]of Object.entries(t))typeof r=="boolean"&&n.push([o,r]);n.length!==0&&cC(e,(o)=>{for(let[r,s]of n)o=vr(o,r,s?jt[r]:0);return o})}function uC(e,t,n=null){let o=n===null&&fe(e)?vr(e.format,t,null):n;cC(e,(r)=>vr(r,t,o))}function M_(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Rf(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[M_(n),M_(o)]}function D_(e,t){for(let n=t;n;n=n.getParent()){if(P(n)){if(n.collapseAtStart(e))return!0;if(vt(n))break}if(n.getPreviousSibling())break}return!1}function dC(e){let{focus:t,anchor:n}=e,{key:o,offset:r,type:s}=n;n.set(t.key,t.offset,t.type,!0),t.set(o,r,s,!0)}function fC(e,t,n,o){e.modify(t,n,o)}function gC(e,t,n){let o=e.getNodes(),r=o.filter((l)=>Ia(l,n));if(r.length===0||r.length===o.length)return!1;let s=t?r[0]:r[r.length-1],i=P(s)?s:s.getParentOrThrow();return t?i.selectStart():i.selectEnd(),!0}function of(e,t,n){if(Ac(e,"extend",t,n))return;let o=He(),r=Yn(xn(o));if(!r||typeof r.modify!="function")return;let{_blockCursorElement:s,_rootElement:i}=o,l=e.anchor,c=e.focus.getNode();i===null||s===null||!P(c)||c.isInline()||c.canBeEmpty()||$c(s,o,i);let u=(D)=>{let H=D.getNode(),k=o.getElementByKey(D.key);return k!==null&&D.type==="text"&&V(H)?or(H,k,o):k},d=l.getNode(),f=u(l);if(f===null)return;let p=l.offset,h=e.isCollapsed(),m=e.focus,_=h?f:u(m);if(_===null)return;let x=m.offset;if(Oc(r,_,x,_,x),fC(r,"move",t?"backward":"forward",n),r.rangeCount===0)return;let C=hi(r,i)||r.getRangeAt(0),{startContainer:y,startOffset:N}=C;if(h&&n==="character"&&l.type==="text"&&V(d)&&d.isUnmergeable()){if(p===(t?0:d.getTextContentSize())){let D=Ct(d,t?"previous":"next").getNodeAtCaret();if(V(D)){let H=t?D.getTextContentSize()-1:1;return e.focus.set(D.__key,H,"text"),void(e.dirty=!0)}}}if(h&&n==="character"&&l.type==="text"){let D=t?0:d.getTextContentSize(),H=y===f?N:p!==D?D:-1;if(H>=0)return void(H!==p&&(e.focus.set(l.key,H,"text"),e.dirty=!0))}let[E,v,b,A]=t?[y,N,f,p]:[f,p,y,N],O=Ft(d)?d:Cg(d);e.applyDOMRange({collapsed:!1,endContainer:b,endOffset:A,startContainer:E,startOffset:v}),e.dirty=!0,!gC(e,t,O)&&t&&dC(e),n==="lineboundary"&&Ac(e,"extend",t,n,"decorators")}var rR=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("\uD83D\uDC4D"))return t}catch(e){}return()=>!1})();function $_(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,l=0;for(let u=0;u<s;u++){let d=u===s-1;if(l=i,i+=r[u].length,t&&i===n||i>n||d){r.splice(u,1),d&&(l=void 0);break}}let c=r.join("").trim();c===""?o.remove():(o.setTextContent(c),o.select(l,l))}function w_(e,t,n,o){let r,s=t,i=!1;if(_t(e)){let l=!1,c=e.childNodes,u=c.length,d=o._blockCursorElement;s===u&&u>0&&(l=!0,s=u-1),pi(e,o)!==void 0||La(e,o)||(i=!0);let f=c[s],p=!1;if(f===d)f=c[s+1],p=!0;else if(d!==null){let h=d.parentNode;if(e===h)t>Array.prototype.indexOf.call(h.children,d)&&s--}if(r=oi(f),V(r))s=po(r,l?"next":"previous");else{let h=oi(e);if(h===null)return null;if(P(h)){let m=o.getElementByKey(h.getKey());m===null&&U(214),[h,s]=On(h,m,o).resolveChildIndex(h,m,e,t),P(h)||U(215),l&&s>=h.getChildrenSize()&&(s=Math.max(0,h.getChildrenSize()-1));let x=h.getChildAtIndex(s);if(P(x)&&function(C,y,N){let E=C.getParent();return N===null||E===null||!E.canBeEmpty()||E!==N.getNode()}(x,0,n)){let C=l?x.getLastDescendant():x.getFirstDescendant();C===null?h=x:(x=C,h=P(x)?x:x.getParentOrThrow()),s=0}V(x)?(r=x,h=null,s=po(x,l?"next":"previous")):x!==h&&l&&!p&&(P(h)||U(216),s=Math.min(h.getChildrenSize(),s+1))}else{let m=Kn(h),_=m!==null?m:h,x=_.getIndexWithinParent(),C=o.getElementByKey(h.getKey()),y="after";if(C!==null&&oi(e)===h){let N=On(h,C,o);N.element!==C?y=N.resolveLeafPosition(C,e,t):t===0&&Ve(h)&&(y="before")}s=y==="before"?x:x+1,h=_.getParentOrThrow()}if(P(h))return[ho(h.__key,s,"element"),i]}}else r=oi(e);return V(r)?[ho(r.__key,po(r,s,"clamp"),"text"),i]:null}function k_(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(t){if((n||!t)&&s===null&&P(i)&&i.isInline()){let l=i.getPreviousSibling();V(l)&&e.set(l.__key,l.getTextContent().length,"text")}}else P(s)&&!n&&s.isInline()?e.set(s.__key,s.getChildrenSize(),"element"):V(s)&&!r.isUnmergeable()&&e.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(t&&P(s)&&s.isInline())e.set(s.__key,0,"element");else if((n||t)&&s===null&&P(i)&&i.isInline()&&!i.canInsertTextAfter()&&i.getTextContentSize()>1){let l=i.getNextSibling();V(l)&&e.set(l.__key,0,"text")}}}function Mf(e){let t=ot(e.key);return t===null?null:gy(t)}function pC(e,t,n){let o=Mf(e),r=Mf(t);if(o===r||o!==null&&r!==null&&o.is(r))return!1;let s=n(o,r);if(o!==null)return P(o)?t.set(o.getKey(),s?o.getChildrenSize():0,"element"):t.set(o.getKey(),s?o.getTextContentSize():0,"text"),!0;let i=Kn(r);if(i===null)return!1;let l=i.getParent();if(l===null)return!1;let c=i.getIndexWithinParent();return t.set(l.getKey(),s?c+1:c,"element"),!0}function hC(e){let t=pC(e.anchor,e.focus,(n,o)=>function(r,s,i,l){if(i!==null&&l!==null){let d=Kn(i),f=Kn(l);if(d!==null&&d.is(f)){for(let p of Hc(d).values()){if(p===i.getKey())return!0;if(p===l.getKey())return!1}return!0}return d===null||f===null||d.isBefore(f)}if(i!==null){let d=Kn(i),f=ot(s.key);return d===null||f===null||!(!d.is(f)&&!d.isParentOf(f))||d.isBefore(f)}let c=Kn(l),u=ot(r.key);return c!==null&&u!==null&&!c.is(u)&&!c.isParentOf(u)&&u.isBefore(c)}(e.anchor,e.focus,n,o));return t&&(e.dirty=!0),t}function mC(e,t,n,o,r,s){if(e===null||n===null||!Ya(r,e,n))return null;let i=w_(e,t,fe(s)?s.anchor:null,r);if(i===null)return null;let l=w_(n,o,fe(s)?s.focus:null,r);if(l===null)return null;let[c,u]=i,[d,f]=l;if(c.type==="element"&&d.type==="element"){let h=oi(e),m=oi(n);if(Ve(h)&&Ve(m))return null}let p=r._slotsUsed&&pC(c,d,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(h,m){if(h.type==="text"&&m.type==="text"){let _=h.isBefore(m),x=h.is(m);k_(h,_,x),k_(m,!_,x),x&&m.set(h.key,h.offset,h.type)}}(c,d),[c,d,u||f||p]}function _C(e){return P(e)&&!e.isInline()}function xC(e,t,n,o,r,s){let i=Io(),l=new Ss(ho(e,t,r),ho(n,o,s),0,"");return l.dirty=!0,i._selection=l,l}function CC(){let e=ho("root",0,"element"),t=ho("root",0,"element");return new Ss(e,t,0,"")}function bc(){return new Lc(new Set)}function sR(e,t){return Da(null,e,t,null)}function Da(e,t,n,o){let r=n._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,l=i==="selectionchange",c=!df&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),u,d,f,p;if(fe(e)&&!c)return e.clone();{if(t===null)return null;let E=Gn(t,n._rootElement);if(u=E.anchorNode,d=E.focusNode,f=E.anchorOffset,p=E.focusOffset,(l||i===void 0)&&fe(e)&&!Ya(n,u,d))return e.clone()}let h=mC(u,f,d,p,n,e);if(h===null)return null;let[m,_,x]=h,C=0,y="";if(fe(e)){let E=e.anchor;if(m.key===E.key)C=e.format,y=e.style;else{let v=m.getNode();V(v)?(C=v.getFormat(),y=v.getStyle()):P(v)&&(C=v.getTextFormat(),y=v.getTextStyle())}}let N=new Ss(m,_,C,y);return x&&(N.dirty=!0),N}function Fe(){return Io()._selection}function Ns(){return He()._editorState._selection}function cs(e,t,n,o=1){let{anchor:r,focus:s}=e,i=r.getNode(),l=s.getNode();if(!t.is(i)&&!t.is(l))return;let c=t.__key;if(e.isCollapsed()){let u=r.offset;if(n<=u&&o>0||n<u&&o<0){let d=Math.max(0,u+o);r.set(c,d,"element"),s.set(c,d,"element"),I_(e)}}else{let u=e.isBackward(),d=u?s:r,f=d.getNode(),p=u?r:s,h=p.getNode();if(t.is(f)){let m=d.offset;(n<=m&&o>0||n<m&&o<0)&&d.set(c,Math.max(0,m+o),"element")}if(t.is(h)){let m=p.offset;(n<=m&&o>0||n<m&&o<0)&&p.set(c,Math.max(0,m+o),"element")}}I_(e)}function I_(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,s=t.getNode(),i=o.getNode();if(e.isCollapsed()){if(!P(s))return;let l=s.getChildrenSize(),c=n>=l,u=c?s.getChildAtIndex(l-1):s.getChildAtIndex(n);if(V(u)){let d=0;c&&(d=u.getTextContentSize()),t.set(u.__key,d,"text"),o.set(u.__key,d,"text")}return}if(P(s)){let l=s.getChildrenSize(),c=n>=l,u=c?s.getChildAtIndex(l-1):s.getChildAtIndex(n);if(V(u)){let d=0;c&&(d=u.getTextContentSize()),t.set(u.__key,d,"text")}}if(P(i)){let l=i.getChildrenSize(),c=r>=l,u=c?i.getChildAtIndex(l-1):i.getChildAtIndex(r);if(V(u)){let d=0;c&&(d=u.getTextContentSize()),o.set(u.__key,d,"text")}}}function vc(e,t,n,o,r){let s=null,i=0,l=null;o!==null?(s=o.__key,V(o)?(i=o.getTextContentSize(),l="text"):P(o)&&(i=o.getChildrenSize(),l="element")):r!==null&&(s=r.__key,V(r)?l="text":P(r)&&(l="element")),s!==null&&l!==null?e.set(s,i,l):(i=t.getIndexWithinParent(),i===-1&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function L_(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Oc(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch(s){}}function F_(e,t,n){let o=ci(e,t.getKey());if(P(t)){let r=On(t,o,e);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function yC(e,t,n,o,r,s){let i=s.getRootNode(),l=gi(i)||rr(i)?ui(i):null;if(r.has(Qx)&&l!==s||l!==null&&Kc(l,l))return;let c=Gn(o,s),u;if(!fe(t))return void(e!==null&&Ya(n,c.anchorNode,c.focusNode)&&o.removeAllRanges());let{anchor:d,focus:f}=t,p=d.getNode(),h=f.getNode(),[m,_]=F_(n,p,d.offset),[x,C]=F_(n,h,f.offset),{format:y,style:N}=t,E=t.isCollapsed(),v=m,b=x,A=!1;if(d.type==="text"?(v=V(p)?or(p,m,n):null,A=p.getFormat()!==y||p.getStyle()!==N):fe(e)&&e.anchor.type==="text"&&(A=!0),f.type==="text"&&(b=V(h)?or(h,x,n):null),v!==null&&b!==null){if(E&&(e===null||A||fe(e)&&(e.format!==y||e.style!==N))&&function(O,D,H,k,q,j){O._inputState.collapsedSelectionFormat={format:D,key:q,offset:k,style:H,timeStamp:j}}(n,y,N,_,d.key,performance.now()),(o.type!=="Range"||!E)&&c.anchorOffset===_&&c.focusOffset===C&&c.anchorNode===v&&c.focusNode===b){if(l===null||!s.contains(l)){let O=l!==null?ds(l):null;O!==null&&O!==n||r.has(Nc)||s.focus({preventScroll:!0})}if(d.type!=="element")return}if(Oc(o,v,_,b,C),Do&&t.isCollapsed()&&s!==null&&!r.has(Nc)){let O=wc(s);if(O===null||!s.contains(O)){let D=ui(s.ownerDocument),H=D!==null?ds(D):null;H!==null&&H!==n||s.focus({preventScroll:!0})}}if(!r.has(eC)&&t.isCollapsed()&&s!==null&&s===wc(s)){let O=fe(t)&&t.anchor.type==="element"?v.childNodes[_]||null:(u===void 0&&(u=ZC(o,s)),u);if(O!==null){let D;if(mo(O)){let H=O.ownerDocument.createRange();H.selectNode(O),D=H.getBoundingClientRect()}else D=O.getBoundingClientRect();(function(H,k,q){let j=Uc(q),oe=xg(j);if(j===null||oe===null)return;let B=q.getBoundingClientRect();if(k.bottom<B.top)return;let{top:de,bottom:xe}=k,ve=0,te=0,ae=q;for(;ae!==null;){let ce=ae===j.body;if(ce){let Me=oe.visualViewport;if(Me){let ht=Me.offsetTop;ve=ht,te=ht+Me.height}else ve=0,te=xn(H).innerHeight;let gt=oe.getComputedStyle(j.documentElement),Jt=parseFloat(gt.scrollPaddingTop),ke=parseFloat(gt.scrollPaddingBottom);isFinite(Jt)&&(ve+=Jt),isFinite(ke)&&(te-=ke)}else{let Me=ae===q?B:ae.getBoundingClientRect();ve=Me.top,te=Me.bottom}let Re=0;if(de<ve?Re=-(ve-de):xe>te&&(Re=xe-te),Re!==0)if(ce)oe.scrollBy(0,Re);else{let Me=ae.scrollTop;ae.scrollTop+=Re;let gt=ae.scrollTop-Me;de-=gt,xe-=gt}if(ce)break;ae=Es(ae)}})(n,D,s)}}(function(O){O._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}function iR(e){let t=Fe()||Ns();t===null&&(t=vn().selectEnd()),t.insertNodes(e)}function SC(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
4
|
+
`,zf=Do?" ":ya,ax="֑-߿יִ-﷽ﹰ-ﻼ",lx="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",iA=new RegExp("^[^"+lx+"]*["+ax+"]"),aA=new RegExp("^[^"+ax+"]*["+lx+"]"),jt={bold:1,capitalize:1024,code:16,highlight:Kf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},lA={directionless:1,unmergeable:2},pc={center:2,end:6,justify:4,left:1,right:3,start:5},cA={[tA]:"center",[sA]:"end",[oA]:"justify",[eA]:"left",[nA]:"right",[rA]:"start"},uA={normal:0,segmented:2,token:1},dA={[HO]:"normal",[GO]:"segmented",[WO]:"token"},fA="$",Zm="$config";function Qm(){return _o()._blockCursorElement}function gA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class ri{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new ri(this.element,e,this.after)}withAfter(e){return new ri(this.element,this.before,e)}withElement(e){return this.element===e?this:new ri(e,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&U(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&U(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&U(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?"before":"after";let o=e_(e,this.element);if(o===null)return"after";let r=Array.prototype.indexOf.call(e.childNodes,o);if(r<0)return"after";if(t===e)return n<=r?"before":"after";let s=e_(e,t);if(s===null)return"after";let i=Array.prototype.indexOf.call(e.childNodes,s);return i>=0&&i<=r?"before":"after"}getInsertionAnchor(){return this.before}}function e_(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}class si extends ri{withBefore(e){return new si(this.element,e,this.after)}withAfter(e){return new si(this.element,this.before,e)}withElement(e){return this.element===e?this:new si(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;gA(t);)e=t,t=t.nextSibling;let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===Qm()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let t=e==="decorator"&&(za||fs||Ka);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}let n=this.element,o=this.before,r=_n().createElement("br");if(r.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(r,o),e){let s=_n().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",n.insertBefore(s,r),n.__lexicalLineBreak=s}else n.__lexicalLineBreak=r}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let o=this.element.firstChild;o!==null&&o!==e&&o!==t;o=o.nextSibling)n++;return n}resolveChildIndex(e,t,n,o){if(n===this.element){let l=this.getFirstChildOffset(),c=Qm(),u=this.element.childNodes,d=Math.min(o,u.length),f=0;for(let p=l;p<d;p++)u[p]!==c&&f++;return[e,Math.min(f,e.getChildrenSize())]}let r=t_(t,n);r.push(o);let s=t_(t,this.element),i=e.getIndexWithinParent();for(let l=0;l<s.length;l++){let c=r[l],u=s[l];if(c===void 0||c<u)break;if(c>u){i+=1;break}}return[e.getParentOrThrow(),i]}}function t_(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;n.push(r)}return o!==e&&U(225),n.reverse()}var cx;try{cx="0.49.0+prod.esm"}catch(e){}var ux=cx??'"<unknown>+source"';class ei{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}var as=null;function dx(e,t=1000){return e instanceof Sa?e.clone():e.size<t?new Map(e):new Sa().init(new Map(e),void 0,e.size)}class Sa{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Sa().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t!==void 0?t:this._old&&this._old.get(e)}get(e){let t=this.getWithTombstone(e);return t===as?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let t=new Map(this._old);for(let[n,o]of this._nursery)o!==as?t.set(n,o):t.delete(n);this._old=t,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let o=this.getNursery();return n!==as&&n!==void 0||(this._size++,n===as&&o.delete(e)),o.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,as),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n!==void 0?n:(this.set(e,t),t)}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let o=t(e);return this.set(e,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let o=n[0],r=e?e.get(o):void 0;r!==as&&(r!==void 0&&(n[1]=r),yield n)}if(e)for(let n of e)n[1]===as||t&&t.has(n[0])||(yield n)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[n,o]of this.entries())e(o,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function hc(e,t,n,o,r,s){if(P(e)){let i=e.getFirstChild();for(;i!==null;){let l=i.__key;i.__parent===t&&((P(i)||Ro(i)&&i.__slots!==null)&&hc(i,l,n,o,r,s),n.has(l)||s.delete(l),r.push(l)),i=i.getNextSibling()}}for(let i of Ro(e)&&e.__slots!==null?e.__slots.values():[]){let l=o.get(i);l!==void 0&&Or(l)&&l.__slotHost===t&&((P(l)||Ro(l)&&l.__slots!==null)&&hc(l,i,n,o,r,s),n.has(i)||s.delete(i),r.push(i))}}var df=!1,Uf=0;function pA(e){Uf=e.timeStamp}function Zd(e,t,n){let o=e.nodeName==="BR",r=t.__lexicalLineBreak;return r&&(e===r||o&&e.previousSibling===r)||o&&pi(e,n)!==void 0}function hA(e,t,n){let o=Vn(xn(n)),r=o&&jn(o,n._rootElement),s=null,i=null;r!==null&&r.anchorNode===e&&(s=r.anchorOffset,i=r.focusOffset);let l=e.nodeValue;l!==null&&mg(t,l,s,i,!1)}function mA(e,t,n){if(fe(e)){let o=e.anchor.getNode();if(o.is(n)&&e.format!==o.getFormat())return!1}return mo(t)&&n.isAttached()}function _A(e,t,n){for(let o=e;o&&!vg(o);o=Es(o)){let r=pi(o,t);if(r!==void 0){let s=ot(r,n);if(s)return Ve(s)||!_t(o)?void 0:[o,s]}}}function fx(e,t,n){df=!0;let o=performance.now()-Uf>100;try{Un(e,()=>{let r=Fe()||function(f){return f.read("latest",()=>{let p=Fe();return p!==null?p.clone():null})}(e),s=new Map,{_editorState:i,_blockCursorElement:l}=e,c=!1,u="";for(let f=0;f<t.length;f++){let p=t[f],{type:h,target:m}=p,_=_A(m,e,i);if(!_)continue;let[x,C]=_;if(h==="characterData")o&&q(C)&&mo(m)&&mA(r,m,C)&&hA(m,C,e);else if(h==="childList"){c=!0;let y=p.addedNodes;for(let v=0;v<y.length;v++){let b=y[v],A=fg(b),O=b.parentNode;if(!(O==null||b===l||A!==null||Zd(b,O,e)||e._slotsUsed&&_t(b)&&b.hasAttribute("data-lexical-slot")||vg(b))){if(Do){let D=(_t(b)?b.innerText:null)||b.nodeValue;D&&(u+=D)}O.removeChild(b)}}let N=p.removedNodes,E=N.length;if(E>0){let v=0;for(let b=0;b<E;b++){let A=N[b];(Zd(A,m,e)||l===A)&&(m.appendChild(A),v++)}E!==v&&s.set(x,C)}}}if(s.size>0)for(let[f,p]of s)p.reconcileObservedMutation(f,e);let d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let p=d[f],{addedNodes:h,target:m}=p;for(let _=0;_<h.length;_++){let x=h[_],C=x.parentNode;C==null||x.nodeName!=="BR"||Zd(x,m,e)||C.removeChild(x)}}n.takeRecords()}r!==null&&(c&&en(r),Do&&WC(e)&&r.insertRawText(u))})}finally{df=!1}}function gx(e){let t=e._observer;if(t!==null)fx(e,t.takeRecords(),t)}function px(e){(function(t){Uf===0&&xn(t).addEventListener("textInput",pA,!0)})(e),e._observer=new MutationObserver((t,n)=>{fx(e,t,n)})}var ff="direct",gf="latest";class hx{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||SA).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}}function xA(e,t){return new hx(e,t)}function mc(e,t,n=gf){let o=(n===gf?e.getLatest():e).__state;return o?o.getValue(t):t.defaultValue}function CA(e,t,n){let o=mc(e,n,ff),r=mc(t,n,ff);return n.isEqual(o,r)?null:[o,r]}function yA(e,t,n){let o;if(zt(),typeof n=="function"){let s=e.getLatest(),i=mc(s,t);if(o=n(i),t.isEqual(i,o))return s}else o=n;let r=e.getWritable();return Wf(r).updateFromKnown(t,o),r}function mx(e){let t=new Map,n=new Set;for(let{ownNodeConfig:o}of Ja(typeof e=="function"?e:e.replace))if(o&&o.stateConfigs)for(let r of o.stateConfigs){let s;"stateConfig"in r?(s=r.stateConfig,r.flat&&n.add(s.key)):s=r,t.set(s.key,s)}return{flatKeys:n,sharedConfigMap:t}}var n_=new Set(["__proto__","constructor","prototype"]);class Hf{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,o=new Map,r=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=o;let{sharedConfigMap:s}=this.sharedNodeState,i=r!==void 0?r:function(l,c,u){let d=u.size;if(c)for(let f in c){let p=l.get(f);p&&u.has(p)||d++}return d}(s,n,o);this.size=i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let o=this.unknownState[e.key];o!==void 0&&(n=e.parse(o)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[n,o]of this.knownState)n.isEqual(o,n.defaultValue)?delete e[n.key]:e[n.key]=n.unparse(o);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return o_(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:n}=this,o=new Map(this.knownState);return new Hf(e,t,function(r,s,i){let l;if(i)for(let[c,u]of Object.entries(i)){if(n_.has(c))continue;let d=r.get(c);d?s.has(d)||s.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l}(t.sharedConfigMap,o,n),o,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:o,unknownState:r}=this;o.has(e)||r&&n in r||(r&&(delete r[n],this.unknownState=o_(r)),this.size++),o.set(e,t)}updateFromUnknown(e,t){if(n_.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},(e in this.unknownState)||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let n of t.keys())t.set(n,n.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[n,o]of Object.entries(e))this.updateFromUnknown(n,o)}}function Wf(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Hf(t,_x(t));return t.__state=n,n}function _x(e){return e.__state?e.__state.sharedNodeState:dg(_o(),e.getType()).sharedNodeState}function o_(e){if(e)for(let t in e)return e}function SA(e){return e}function r_(e,t,n){for(let[o,r]of t.knownState){if(e.has(o.key))continue;e.add(o.key);let s=n?n.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function s_(e,t,n){let{unknownState:o}=t,r=n?n.unknownState:void 0;if(o)for(let[s,i]of Object.entries(o)){if(e.has(s))continue;if(e.add(s),i!==(r?r[s]:void 0))return!0}return!1}function i_(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function a_(e,t){let{__mode:n,__format:o,__style:r}=e,{__mode:s,__format:i,__style:l}=t,c=e.__state,u=t.__state;return(n===null||n===s)&&(o===null||o===i)&&(r===null||r===l)&&(e.__state===null||c===u||function(d,f){if(d===f)return!0;let p=new Set;return!(d&&r_(p,d,f)||f&&r_(p,f,d)||d&&s_(p,d,f)||f&&s_(p,f,d))}(c,u))}function l_(e,t){let n=e.mergeWithSibling(t),o=He()._normalizedNodes;return o.add(e.__key),o.add(t.__key),n}function c_(e){let t,n,o=e;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(t=o.getPreviousSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(a_(t,o)){o=l_(t,o);break}break}t.remove()}for(;(n=o.getNextSibling())!==null&&q(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(a_(o,n)){o=l_(o,n);break}break}n.remove()}}else o.remove()}function ni(e){return u_(e.anchor),u_(e.focus),e}function u_(e){for(;e.type==="element";){let t=e.getNode(),n=e.offset,o,r;if(n===t.getChildrenSize()?(o=t.getChildAtIndex(n-1),r=!0):(o=t.getChildAtIndex(n),r=!1),q(o)){e.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!P(o))break;e.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var Na=Symbol.for("@lexical/CachedTextSize");function d_(e,t){return hf.read(()=>{let n=0,o=e;for(let r=0;r<t&&o!==null;r++){let s=fo.get(o);if(s===void 0&&U(345,o),P(s)){let i=mt.get(o);if(i!==void 0&&P(i)&&i.__parent!==s.__parent)n+=s.getTextContentSize();else{let l=gs.get(o),c=l&&l.__lexicalTextContent;typeof c!="string"&&U(346,s.getType()),n+=c.length}r<t-1&&!s.isInline()&&(n+=2)}else{let i=s[Na];i===void 0&&U(347,s.getType(),o),n+=i}o=s.__next}return n},{editor:Ue})}function xx(e){P(e)||e[Na]===void 0&&(e[Na]=q(e)?e.__text.length:e.getTextContentSize())}var NA=4,Ea,Ue,Ta,$e="",Nt=null,Qt=null,Yt=null;function Oo(){return{firstTextKey:Yt,format:Nt,style:Qt}}function Pn(e){e.firstTextKey!==null&&(Nt=e.format,Qt=e.style,Yt=e.firstTextKey)}function pf(e){if(Yt!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&U(348),t===null)return;let n=mt.get(t);q(n)&&(Nt=n.getFormat(),Qt=n.getStyle(),Yt=t)}var Ic,ga,pa,fo,hf,mt,gs,mf,va,hs,or=!1,_c=!1;function Er(e,t){let n=fo.get(e),o=mt.has(e);if(t!==null){let r=Sf(e);r.parentNode===t&&t.removeChild(r)}if(!o){if(Ue._keyToDOMMap.delete(e),P(n)){let r=Fa(n,fo);_f(r,0,r.length-1,null)}if(n!==void 0){for(let r of Tn(n).values()){let s=Cf(r);Er(r,null),s!==null&&s.remove()}_g(va,Ta,Ic,n,"destroyed")}}}function _f(e,t,n,o){for(let r=t;r<=n;++r){let s=e[r];s!==void 0&&Er(s,o)}}function ls(e,t){e.setProperty("text-align",t)}var EA="40px";function Cx(e,t){let n=Ea.theme.indent;if(typeof n=="string"){let o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${EA}))`)}function yx(e,t){let n=e.style;t===0?ls(n,""):t===1?ls(n,"left"):t===2?ls(n,"center"):t===3?ls(n,"right"):t===4?ls(n,"justify"):t===5?ls(n,"start"):t===6&&ls(n,"end")}function xf(e,t){let n=function(o){let r=o.__dir;if(r!==null)return r;if(Ft(o))return null;let s=o.getParent();return s===null||vt(s)&&s.__dir===null?"auto":null}(t);n!==null?e.dir=n:e.removeAttribute("dir")}function Sx(e){let t=_n().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function Nx(e,t,n){t||e.contentEditable==="false"?cy(n,Ue):n.removeAttribute("contenteditable")}function f_(e,t,n){let o=$e,r=Oo();$e="";let s="",i=Ve(e);for(let[l,c]of n){let u=Sx(l);Nx(t,i,u),t.appendChild(u),$e="";let d=Oo();Tr(c,On(e,u,Ue)),Pn(d),Ex(e,l,t,u),s+=$e}return Pn(r),$e=o,s}function Tn(e){return Ro(e)&&e.__slots!==null?e.__slots:dy}function Ex(e,t,n,o){let r=hs.$getSlotTargetElement(e,t,n,Ue);r!==null&&(o.parentElement!==r&&r.appendChild(o),o.style.display="")}function Cf(e){let t=gs.get(e);return t!==void 0?t.parentElement:null}function g_(e,t,n){let o=Tn(e),r=Tn(t);for(let[d,f]of o)if(!r.has(d)){let p=Cf(f);Er(f,null),p!==null&&p.remove()}let s=$e,i=Oo(),l="",c=null,u=Ve(t);for(let[d,f]of r){let p=o.get(d),h=p!==void 0?Cf(p):null;$e="";let m=Oo();if(h===null){h=Sx(d);let _=null;for(let x of n.children)if(!x.hasAttribute("data-lexical-slot")){_=x;break}n.insertBefore(h,_),Tr(f,On(t,h,Ue))}else p===f?nr(f,h):(p!==void 0&&Er(p,h),Tr(f,On(t,h,Ue)));if(Pn(m),Nx(n,u,h),Ex(t,d,n,h),l+=$e,h.parentElement===n){let _=c===null?n.firstChild:c.nextSibling;_!==h&&n.insertBefore(h,_),c=h}}return Pn(i),$e=s,l}function Tr(e,t){let n=mt.get(e);if(n===void 0&&U(60),t!==null){let r=fo.get(e);if(r!==void 0){let s=gs.get(e);if(s!==void 0){let i=Or(r)?r.__slotHost:null,l=Or(n)?n.__slotHost:null,c=r.__parent!==n.__parent||i!==l,u=l!==null&&s.parentElement!==t.element;if(c||u)return t.insertChild(s),nr(e,t.element)}}}let o=hs.$createDOM(n,Ue);if(function(r,s,i){let l=i._keyToDOMMap;FC(s,i,r),l.set(r,s)}(e,o,Ue),q(n)?o.setAttribute("data-lexical-text","true"):Ve(n)&&(o.setAttribute("data-lexical-decorator","true"),ly(o,{captureSelection:!0})),P(n)){let{__indent:r,__size:s}=n;xf(o,n),r!==0&&Cx(o,r);let i=Tn(n),l=i.size>0?f_(n,o,i):"";if(s===0)o.__lexicalTextContent=l,o.__lexicalFirstTextKey=null,$e+=l,i.size>0&&(o.__lexicalSlotTextLength=l.length);else{let u=$e,d=s-1;if(yf(Fa(n,mt),n,0,d,On(n,o,Ue)),l!==""){let f=o.__lexicalTextContent||"";o.__lexicalTextContent=l+f,$e=u+l+f}i.size>0&&(o.__lexicalSlotTextLength=l.length)}let c=n.__format;c!==0&&yx(o,c),n.isInline()||Tx(null,n,o)}else{let r=n.getTextContent();if(Ve(n)){let s=n.decorate(Ue,Ea);s!==null&&bx(e,s),o.contentEditable="false";let i=Tn(n);i.size>0&&f_(n,o,i)}$e+=r}return t!==null&&t.insertChild(o),hs.$decorateDOM(n,null,o,Ue),xx(n),_g(va,Ta,Ic,n,"created"),o}function yf(e,t,n,o,r){let s=$e,i=Oo();$e="",Nt=null,Qt=null,Yt=null;let l=n;for(;l<=o;++l){let u=Oo();Tr(e[l],r);let d=mt.get(e[l]);d!==null&&q(d)?Nt===null&&(Nt=d.getFormat(),Qt=d.getStyle(),Yt=d.__key):P(d)&&l<o&&!d.isInline()&&($e+=us),Pn(u)}let c=Ue._keyToDOMMap.get(t.__key);c===void 0&&U(349,t.__key),c.__lexicalTextContent=$e,c.__lexicalFirstTextKey=Yt,$e=s+$e,Pn(i)}function Tx(e,t,n){let o=On(t,n,Ue),r=o.element.__lexicalLastChildKind??null,s=function(i,l){if(i){let c=i.__last;if(c){let u=l.get(c);if(u)return wo(u)?"line-break":Ve(u)&&u.isInline()?"decorator":null}return Tn(i).size>0?null:"empty"}return null}(t,mt);r!==s&&o.setManagedLineBreak(s)}function TA(e,t,n){var o;Nt=null,Qt=null,Yt=null,function(r,s,i){let l=$e,c=r.__size,u=s.__size;$e="";let d=i.element,f=Ue._keyToDOMMap.get(s.__key);f===void 0&&U(351,s.__key);let p=u-c;if(!or&&Math.abs(p)<=1&&c>=NA&&r.__first===s.__first&&(p!==0||!Ue._cloneNotNeeded.has(r.__key))){let h=f.__lexicalTextContent,m=mf.get(r.__key);if(!or&&typeof h=="string"&&m!==void 0){let _=function(x,C){let y=C.size;if(y===0||y>=x.__size)return null;let N=x.__last,E=null,v=0;for(;N!==null&&v<y;){if(!C.has(N))return null;E=N;let b=mt.get(N);if(b===void 0)return null;N=b.__prev,v++}if(v!==y)return null;if(N!==null&&C.has(N))return null;return E}(s,m);if(_!==null){let x=m.size;if(p===0){let C=d_(_,x),y=_,N=0;for(;y!==null&&N<x;){let O=mt.get(y);if(O===void 0)break;let D=Oo();nr(y,d),q(O)&&Nt===null&&(Nt=O.getFormat(),Qt=O.getStyle(),Yt=O.__key),Pn(D),y=O.__next,N++}let E="";for(y=_,N=0;y!==null&&N<x;){let O=mt.get(y);if(O===void 0)break;let D;if(P(O)){let H=Ue._keyToDOMMap.get(y),k=H&&H.__lexicalTextContent;typeof k!="string"&&U(352,O.getType()),D=k}else D=O.getTextContent();E+=D,N<x-1&&P(O)&&!O.isInline()&&(E+=us),y=O.__next,N++}let v=f.__lexicalSlotTextLength||0,b=v>0?h.slice(v):h,A=b.slice(0,b.length-C)+E;return f.__lexicalTextContent=A,$e=l+A,void p_(s,f,m)}if(function(C,y,N,E,v,b,A,O){if(O!==1&&O!==-1)return!1;if(A!==(O===1?2:1))return!1;let H=A-O,k=C.__last;for(let ke=0;ke<H-1;ke++){if(k===null)return!1;let ht=fo.get(k);if(ht===void 0)return!1;k=ht.__prev}if(k===null)return!1;let J=mt.get(b),V=fo.get(k);if(J===void 0||V===void 0)return!1;if(J.__prev!==V.__prev)return!1;let oe=[],B=b;for(let ke=0;ke<A;ke++){if(B===null)return!1;oe.push(B);let ht=mt.get(B);B=ht?ht.__next:null}let de=[];B=k;for(let ke=0;ke<H;ke++){if(B===null)return!1;de.push(B);let ht=fo.get(B);B=ht?ht.__next:null}let xe=new Set(de),ve=new Set(oe),te=[],ae=0,ce=0;for(;ae<H&&ce<A;)if(oe[ce]===de[ae])te.push({key:oe[ce],kind:"reconcile"}),ae++,ce++;else if(ve.has(de[ae])){if(xe.has(oe[ce]))return!1;te.push({key:oe[ce],kind:"create",nextIndex:ce}),ce++}else te.push({key:de[ae],kind:"destroy"}),ae++;for(;ae<H;)te.push({key:de[ae++],kind:"destroy"});for(;ce<A;)te.push({key:oe[ce],kind:"create",nextIndex:ce}),ce++;let Re=d_(k,H);for(let ke of te){let ht=Oo();if(ke.kind==="reconcile")nr(ke.key,N.element);else if(ke.kind==="destroy")Er(ke.key,N.element);else{let Gt=null;for(let Cr=ke.nextIndex+1;Cr<A;Cr++){let Jo=Ue._keyToDOMMap.get(oe[Cr]);if(Jo!==void 0){Gt=Jo;break}}Tr(ke.key,N.withBefore(Gt??N.before))}if(ke.kind!=="destroy"){let Gt=mt.get(ke.key);Gt&&q(Gt)&&Nt===null&&(Nt=Gt.getFormat(),Qt=Gt.getStyle(),Yt=Gt.__key)}Pn(ht)}let Me="";for(let ke=0;ke<A;ke++){let ht=mt.get(oe[ke]);if(ht===void 0)return!1;let Gt;if(P(ht)){let Cr=Ue._keyToDOMMap.get(oe[ke]),Jo=Cr&&Cr.__lexicalTextContent;typeof Jo!="string"&&U(350,ht.getType()),Gt=Jo}else Gt=ht.getTextContent();Me+=Gt,ke<A-1&&P(ht)&&!ht.isInline()&&(Me+=us)}let gt=E.__lexicalSlotTextLength||0,Jt=gt>0?v.slice(gt):v;return E.__lexicalTextContent=Jt.slice(0,Jt.length-Re)+Me,!0}(r,0,i,f,h,_,x,p)){let C=f.__lexicalTextContent;return typeof C!="string"&&U(353),$e=l+C,void p_(s,f,m)}}}if(p===0){let _=r.__first,x=0;for(;_!==null;){let C=mt.get(_);if(C===void 0)break;let y=or||pa.has(_)||ga.has(_),N=Oo();if(y)nr(_,d);else{let E,v;if(P(C)){v=gs.get(_);let b=v&&v.__lexicalTextContent;typeof b!="string"&&U(354,C.getType()),E=b}else E=C.getTextContent();$e+=E,v!==void 0&&pf(v)}q(C)?Nt===null&&(Nt=C.getFormat(),Qt=C.getStyle(),Yt=C.__key):P(C)&&x<u-1&&!C.isInline()&&($e+=us),Pn(N),_=C.__next,x++}return f.__lexicalTextContent=$e,f.__lexicalFirstTextKey=Yt,void($e=l+$e)}}if(c===1&&u===1){let h=r.__first,m=s.__first;if(h===m)nr(h,d);else{let x=Sf(h),C=Tr(m,null);try{x.parentNode===d?d.replaceChild(C,x):i.insertChild(C)}catch(y){if(typeof y=="object"&&y!=null){let N=`${y.toString()} Parent: ${d.tagName}, new child: {tag: ${C.tagName} key: ${m}}, old child: {tag: ${x.tagName}, key: ${h}}.`;throw Error(N)}throw y}Er(h,null)}let _=mt.get(m);q(_)&&Nt===null&&(Nt=_.getFormat(),Qt=_.getStyle(),Yt=_.__key)}else{let h=Fa(r,fo),m=Fa(s,mt);if(h.length!==c&&U(227),m.length!==u&&U(228),c===0)u!==0&&yf(m,s,0,u-1,i);else if(u===0){if(c!==0){let _=i.after==null&&i.before==null&&Tn(s).size===0&&i.element.__lexicalLineBreak==null;_f(h,0,c-1,_?null:d),_&&(d.textContent="")}}else(function(_,x,C,y,N,E){let v=y-1,b=N-1,A,O,D=E.getFirstChild(),H=0,k=0;for(;H<=v&&k<=b;){let oe=x[H],B=C[k],de=Oo();if(oe===B)D=Qd(nr(B,E.element)),H++,k++;else{if(O===void 0&&(O=h_(C,k)),A===void 0)A=h_(x,H);else if(!A.has(oe)){H++,Pn(de);continue}if(!O.has(oe)){D=Qd(Sf(oe)),Er(oe,E.element),H++,A.delete(oe),Pn(de);continue}if(A.has(B)){let ve=ci(Ue,B);ve!==D&&E.withBefore(D??E.before).insertChild(ve),D=Qd(nr(B,E.element)),H++,k++}else Tr(B,E.withBefore(D??E.before)),k++}let xe=mt.get(B);xe!==null&&q(xe)?Nt===null&&(Nt=xe.getFormat(),Qt=xe.getStyle(),Yt=xe.__key):P(xe)&&k<=b&&!xe.isInline()&&($e+=us),Pn(de)}let J=H>v,V=k>b;if(J&&!V){let oe=C[b+1],B=oe===void 0?null:Ue.getElementByKey(oe);yf(C,_,k,b,E.withBefore(B??E.before))}else V&&!J&&_f(x,H,v,E.element)})(s,h,m,c,u,i)}f.__lexicalTextContent=$e,f.__lexicalFirstTextKey=Yt,$e=l+$e}(e,t,On(t,n,Ue)),vt(t)||(o=t,Nt==null||Nt===o.__textFormat||_c||o.setTextFormat(Nt),function(r){Qt==null||Qt===r.__textStyle||_c||r.setTextStyle(Qt)}(t))}function p_(e,t,n){let o=t.__lexicalFirstTextKey;if(o!=null){let r=e.__key,s=o;for(;s!==null;){let i=mt.get(s);if(i===void 0){s=null;break}if(i.__parent===r)break;s=i.__parent}if(s!==null&&!n.has(s)){let i=mt.get(o);if(q(i))return Nt=i.getFormat(),void(Qt=i.getStyle())}}t.__lexicalFirstTextKey=Yt}function nr(e,t){let n=fo.get(e),o=mt.get(e);n!==void 0&&o!==void 0||U(61);let r=or||pa.has(e)||ga.has(e),s=ci(Ue,e);if(n===o&&!r){let i;if(P(n)){let l=s.__lexicalTextContent;typeof l!="string"&&U(355,n.getType()),i=l,pf(s)}else i=n.getTextContent();return $e+=i,s}if(n!==o&&r&&_g(va,Ta,Ic,o,"updated"),hs.$updateDOM(o,n,s,Ue)){let i=Tr(e,null);return t===null&&U(62),t.replaceChild(i,s),Er(e,null),i}if(P(n)){P(o)||U(334,e);let i=o.__indent;(or||i!==n.__indent)&&Cx(s,i);let l=o.__format;(or||l!==n.__format)&&yx(s,l);let c=r&&(Tn(o).size>0||Tn(n).size>0)?g_(n,o,s):"";if(r){let u=$e;if(TA(n,o,s),Ft(o)||o.isInline()||Tx(0,o,s),c!==""){let d=s.__lexicalTextContent||"";s.__lexicalTextContent=c+d,$e=u+c+d,s.__lexicalSlotTextLength=c.length}else(Tn(o).size>0||Tn(n).size>0)&&(s.__lexicalSlotTextLength=0)}else{let u=s.__lexicalTextContent;typeof u!="string"&&U(356,n.getType()),$e+=u,pf(s)}if((or||o.__dir!==n.__dir||o.__parent!==n.__parent)&&(xf(s,o),Ft(o)&&!or)){for(let u of o.getChildren())if(P(u))xf(ci(Ue,u.getKey()),u)}}else{let i=o.getTextContent();if(Ve(o)){let l=o.decorate(Ue,Ea);l!==null&&bx(e,l),r&&(Tn(o).size>0||Tn(n).size>0)&&g_(n,o,s)}$e+=i}if(!_c&&Ft(o)){let i=o.getLatest();if(i.__cachedText!==$e){let l=i.getWritable();l.__cachedText=$e,o=l}}return hs.$decorateDOM(o,n,s,Ue),xx(o),s}function bx(e,t){let n=Ue._pendingDecorators,o=Ue._decorators;if(n===null){if(o[e]===t)return;n=PC(Ue)}n[e]=t}function Qd(e){let t=e.nextSibling;return t!==null&&t===Ue._blockCursorElement&&(t=t.nextSibling),t}function h_(e,t){let n=new Set;for(let o=t;o<e.length;o++)n.add(e[o]);return n}function bA(e,t,n,o,r,s){$e="",Nt=null,Qt=null,Yt=null,or=o===2,Ue=n,Ea=n._config,hs=n._config.dom||wa,Ta=n._nodes,Ic=Ue._listeners.mutation,ga=r,pa=s,fo=e._nodeMap,hf=e,mt=t._nodeMap,_c=t._readOnly,gs=dx(n._keyToDOMMap),mf=function(){let l=new Map,c=(u)=>{for(let d of u){let f=mt.get(d);if(f===void 0)continue;let p=f.__parent;if(p===null)continue;let h=l.get(p);h===void 0&&(h=new Set,l.set(p,h)),h.add(d)}};return c(ga.keys()),c(pa),l}();let i=new Map;return va=i,nr("root",null),Ue=void 0,Ta=void 0,ga=void 0,pa=void 0,fo=void 0,hf=void 0,mt=void 0,Ea=void 0,gs=void 0,mf=void 0,va=void 0,hs=wa,i}function Sf(e){let t=gs.get(e);return t===void 0&&U(75,e),t}function Ne(e){return{type:e}}var Gf=Ne("SELECTION_CHANGE_COMMAND"),vA=Ne("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),vx=Ne("CLICK_COMMAND"),jf=Ne("BEFORE_INPUT_COMMAND"),Yf=Ne("INPUT_COMMAND"),Vf=Ne("COMPOSITION_START_COMMAND"),Xf=Ne("COMPOSITION_END_COMMAND"),Oa=Ne("DELETE_CHARACTER_COMMAND"),ha=Ne("INSERT_LINE_BREAK_COMMAND"),Nf=Ne("INSERT_PARAGRAPH_COMMAND"),ii=Ne("CONTROLLED_TEXT_INSERTION_COMMAND"),qf=Ne("PASTE_COMMAND"),ac=Ne("REMOVE_TEXT_COMMAND"),Aa=Ne("DELETE_WORD_COMMAND"),Ra=Ne("DELETE_LINE_COMMAND"),Sr=Ne("FORMAT_TEXT_COMMAND"),OA=Ne("SET_TEXT_FORMAT_COMMAND"),Jf=Ne("UNDO_COMMAND"),Zf=Ne("REDO_COMMAND"),Qf=Ne("KEYDOWN_COMMAND"),Ox=Ne("KEY_ARROW_RIGHT_COMMAND"),Ax=Ne("MOVE_TO_END"),Rx=Ne("KEY_ARROW_LEFT_COMMAND"),Mx=Ne("MOVE_TO_START"),Dx=Ne("KEY_ARROW_UP_COMMAND"),$x=Ne("KEY_ARROW_DOWN_COMMAND"),xc=Ne("KEY_ENTER_COMMAND"),wx=Ne("KEY_SPACE_COMMAND"),kx=Ne("KEY_BACKSPACE_COMMAND"),Ix=Ne("KEY_ESCAPE_COMMAND"),Lx=Ne("KEY_DELETE_COMMAND"),Fx=Ne("KEY_TAB_COMMAND"),AA=Ne("INSERT_TAB_COMMAND"),RA=Ne("INDENT_CONTENT_COMMAND"),MA=Ne("OUTDENT_CONTENT_COMMAND"),Px=Ne("DROP_COMMAND"),DA=Ne("FORMAT_ELEMENT_COMMAND"),Bx=Ne("DRAGSTART_COMMAND"),Kx=Ne("DRAGOVER_COMMAND"),zx=Ne("DRAGEND_COMMAND"),eg=Ne("COPY_COMMAND"),tg=Ne("CUT_COMMAND"),Ux=Ne("SELECT_ALL_COMMAND"),$A=Ne("CLEAR_EDITOR_COMMAND"),wA=Ne("CLEAR_HISTORY_COMMAND"),kA=Ne("CAN_REDO_COMMAND"),IA=Ne("CAN_UNDO_COMMAND"),Hx=Ne("FOCUS_COMMAND"),Wx=Ne("BLUR_COMMAND"),Gx=Ne("KEY_MODIFIER_COMMAND");function jx(e){let t=new Map;return{dispose(){for(let n of t.values())n.dispose();t.clear()},register(n,o){let r=t.get(n);r===void 0&&(r={dispose:e(n,o),holders:new Set},t.set(n,r));let s=()=>{let i=t.get(n);i&&i.holders.delete(s)&&i.holders.size===0&&(t.delete(n),i.dispose())};return r.holders.add(s),s}}}function ng(e,t,n,o){return e.addEventListener(t,n,o),e.removeEventListener.bind(e,t,n,o)}var Zo=Object.freeze({}),Ef=[["keydown",function(e,t){let n=t._inputState;if(n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!=="Backspace"&&Ma(n),t.isComposing())return;re(t,Qf,e)}],["pointerdown",function(e,t){let n=Ng(e),o=e.pointerType;mi(n)&&o!=="touch"&&o!=="pen"&&e.button===0&&Un(t,()=>{La(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){re(t,Vf,e)}],["compositionend",function(e,t){let n=t._inputState;Do?n.compositionPhase="ending-firefox":fs||!Ka&&!za?re(t,Xf,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();let n=t._inputState;Ma(n),Un(t,()=>{qx(e,t)||t.dispatchCommand(Yf,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){Un(t,()=>{let n=Fe(),o=Vn(xn(t)),r=Ns();if(o){if(fe(n)){let s=n.anchor,i=s.getNode();s.type==="element"&&s.offset===0&&n.isCollapsed()&&!Ft(i)&&vn().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r)&&(o.removeAllRanges(),n.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let s=jn(o,t._rootElement).anchorNode;if(_t(s)||mo(s))en(Da(r,o,t,e))}}if(Do&&o!==null&&o.rangeCount===0){let s=t._rootElement;if(s!==null&&e.target===s){let i=e.clientY,l=s.childNodes.length;for(let u=0;u<s.childNodes.length;u++){let d=s.childNodes[u];if(_t(d)){let f=d.getBoundingClientRect();if(i<=(f.top+f.bottom)/2){l=u;break}}}o.setBaseAndExtent(s,l,s,l);let c=Da(r,o,t,e);c!==null?en(c):o.removeAllRanges()}}re(t,vx,e)})}],["cut",Zo],["copy",Zo],["dragstart",Zo],["dragover",Zo],["dragend",Zo],["paste",Zo],["focus",Zo],["blur",Zo],["drop",Zo]];xa&&Ef.push(["beforeinput",(e,t)=>function(n,o){let r=n.inputType;if(r==="deleteCompositionText"||Do&&WC(o))return;if(r==="insertCompositionText")return;Un(o,()=>{qx(n,o)||re(o,jf,n)},{event:n})}(e,t)]);var Tf=new WeakMap,Cc=new WeakMap,LA=jx((e)=>(e.addEventListener("selectionchange",y_),()=>e.removeEventListener("selectionchange",y_)));function Yx(e,t,n,o,r,s){let{anchor:i,focus:l}=e,c=i.getNode(),u=He(),d;if(s!==void 0)d=s;else{let _=Vn(xn(u));d=_!==null?jn(_,u._rootElement):null}let f=d!==null?d.anchorNode:null,p=i.key,h=u.getElementByKey(p),m=n.length;return p!==l.key||!q(c)||(!r&&(!xa||u._inputState.lastBeforeInputInsertTextTimeStamp<o+50)||c.isDirty()&&m<2||BC(n))&&i.offset!==l.offset&&!c.isComposing()||Hn(c)||c.isDirty()&&m>1||(r||!xa)&&h!==null&&!c.isComposing()&&f!==rr(c,h,u)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(_,x){if(x.isSegmented())return!0;if(!_.isCollapsed())return!1;let C=_.anchor.offset,y=x.getParentOrThrow(),N=ka(x);return C===0?!x.canInsertTextBefore()||!y.canInsertTextBefore()&&!x.isComposing()||N||function(E){let v=E.getPreviousSibling();return(q(v)||P(v)&&v.isInline())&&!v.canInsertTextAfter()}(x):C===x.getTextContentSize()&&(!x.canInsertTextAfter()||!y.canInsertTextAfter()&&!x.isComposing()||N)}(e,c)}function m_(e,t){return mo(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function __(e,t,n){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=jn(e,t._rootElement),l=t._inputState;l.isSelectionChangeFromDOMUpdate&&(l.isSelectionChangeFromDOMUpdate=!1,m_(o,r)&&m_(s,i)&&!l.postDeleteSelectionToRestore)||Un(t,()=>{if(!n)return void en(null);if(!Ya(t,o,s))return;let c=Fe();if(l.postDeleteSelectionToRestore&&fe(c)&&c.isCollapsed()){let u=c.anchor,d=l.postDeleteSelectionToRestore.anchor;(u.key===d.key&&u.offset===d.offset+1||u.offset===1&&d.getNode().is(u.getNode().getPreviousSibling()))&&(c=l.postDeleteSelectionToRestore.clone(),en(c))}if(l.postDeleteSelectionToRestore=null,fe(c)){let u=c.anchor,d=u.getNode();if(c.isCollapsed()){e.type==="Range"&&o===s&&(c.dirty=!0);let f=xn(t).event,p=f?f.timeStamp:performance.now(),{format:h,style:m,offset:_,key:x,timeStamp:C}=l.collapsedSelectionFormat,y=vn(),N=t.isComposing()===!1&&y.getTextContent()==="";if(p<C+200&&u.offset===_&&u.key===x)lc(c,h,m);else if(u.type==="text")q(d)||U(141),Vx(c,d);else if(u.type==="element"&&!N){P(d)||U(259);let E=u.getNode();E.isEmpty()?function(v,b){let A=b.getTextFormat(),O=b.getTextStyle();lc(v,A,O)}(c,E):lc(c,c.format,"")}}else{let f=u.key,p=c.focus.key,h=c.getNodes(),m=h.length,_=c.isBackward(),x=_?i:r,C=_?r:i,y=_?p:f,N=_?f:p,E=2047,v=!1;for(let b=0;b<m;b++){let A=h[b],O=A.getTextContentSize();if(q(A)&&O!==0&&!(b===0&&A.__key===y&&x===O||b===m-1&&A.__key===N&&C===0)&&(v=!0,E&=A.getFormat(),E===0))break}c.format=v?E:0}}re(t,Gf)})}function lc(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Vx(e,t){lc(e,t.getFormat(),t.getStyle())}function Xx(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function x_(e){let{lastKeyCode:t}=He()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t==="Enter"?`
|
|
5
|
+
`:t==="Tab"?"\t":null;if(!n)return;let o=Fe();if(!fe(o)||!o.isCollapsed())return;let r=o.anchor.getNode();if(!q(r))return;let{offset:s}=o.anchor;if(r.getTextContentSize()===s){let i=r.getNextSibling();if(n===`
|
|
6
|
+
`){if(wo(i))i.selectEnd();else if(!i){let l=yr(r,_C),c=l&&l.getNextSibling();P(c)&&c.selectStart()}}else n==="\t"?sg(i)&&i.selectEnd():q(i)&&i.getTextContent()[0]===n&&i.select(1,1)}else r.getTextContent()[s]===n&&r.select(s+1,s+1)}function Ma(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function C_(e){Ma(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Ma(e),0)}function qx(e,t){let n=Ng(e);if(_t(n)&&La(n,t))return!0;let o=t.getRootElement();if(o===null)return!1;let r=ui(o.ownerDocument);return r!==null&&o.contains(r)&&La(r,t)}function FA(e){let t=e.inputType,n=Xx(e),o=He(),r=o._inputState,s=Fe();if(t==="insertText"&&e.data&&r.isInsertTextAfterHandledSelectionCommand){if(Ma(r),e.preventDefault(),fe(s)&&!s.isCollapsed()){let f=s.isBackward()?s.anchor:s.focus;s.anchor.set(f.key,f.offset,f.type),s.focus.set(f.key,f.offset,f.type)}return!0}if(t==="deleteContentBackward"){if(s===null){let f=Ns();if(!fe(f))return!0;en(f.clone())}if(fe(s)){let f=s.anchor.key===s.focus.key;if(function(p,h){return p.lastKeyCode==="MediaLast"&&h<p.lastKeyDownTimeStamp+30}(r,e.timeStamp)&&o.isComposing()&&f){if(Lt(null),r.lastKeyDownTimeStamp=0,setTimeout(()=>{Un(o,()=>{Lt(null)})},30),fe(s)){let p=s.anchor.getNode();p.markDirty(),q(p)||U(142),Vx(s,p)}}else{if(Lt(null),fs&&n!==null&&!n.collapsed&&(s.applyDOMRange(n),!s.isCollapsed()))return e.preventDefault(),s.removeText(),!0;e.preventDefault();let p=s.anchor.getNode(),h=p.getTextContent(),m=p.canInsertTextAfter(),_=s.anchor.offset===0&&s.focus.offset===h.length,x=Ca&&f&&!_&&m;if(x&&s.isCollapsed()&&(x=!Ve(HC(s.anchor,!0))),!x){re(o,Oa,!0);let C=Fe();Ca&&fe(C)&&C.isCollapsed()&&(r.postDeleteSelectionToRestore=C,setTimeout(()=>r.postDeleteSelectionToRestore=null))}}return!0}}if(!fe(s))return!0;let i=e.data;r.unprocessedBeforeInputData!==null&&hg(!1,o,r.unprocessedBeforeInputData),s.dirty&&r.unprocessedBeforeInputData===null||!s.isCollapsed()||Ft(s.anchor.getNode())||n===null||s.applyDOMRange(n),r.unprocessedBeforeInputData=null;let{anchor:l,focus:c}=s,u=l.getNode(),d=c.getNode();if(t==="insertText"||t==="insertTranspose"){if(i===`
|
|
7
|
+
`)e.preventDefault(),re(o,ha,!1);else if(i===us)e.preventDefault(),re(o,Nf);else if(i==null&&e.dataTransfer){let f=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(f)}else i!=null&&Yx(s,n,i,e.timeStamp,!0)?(e.preventDefault(),re(o,ii,i),x_(i)):r.unprocessedBeforeInputData=i;return r.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":re(o,ii,e),x_((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let f=r.hadOrphanedCompositionEvents;r.hadOrphanedCompositionEvents=!1;let p=o._compositionKey;Lt(null),f||re(o,ii,e),cc(p);break}case"insertLineBreak":Lt(null),re(o,ha,!1);break;case"insertParagraph":Lt(null),r.isInsertLineBreak&&!fs?(r.isInsertLineBreak=!1,re(o,ha,!1)):re(o,Nf);break;case"insertFromPaste":case"insertFromPasteAsQuotation":re(o,qf,e);break;case"deleteByComposition":(function(f,p){return f!==p||P(f)||P(p)||!ka(f)||!ka(p)})(u,d)&&re(o,ac,e);break;case"deleteByDrag":xs(Nc),re(o,ac,e);break;case"deleteByCut":re(o,ac,e);break;case"deleteContent":re(o,Oa,!1);break;case"deleteWordBackward":re(o,Aa,!0);break;case"deleteWordForward":re(o,Aa,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":re(o,Ra,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":re(o,Ra,!1);break;case"formatStrikeThrough":re(o,Sr,"strikethrough");break;case"formatBold":re(o,Sr,"bold");break;case"formatItalic":re(o,Sr,"italic");break;case"formatUnderline":re(o,Sr,"underline");break;case"historyUndo":re(o,Jf);break;case"historyRedo":re(o,Zf)}return!0}function PA(e){let t=He(),n=t._inputState,o=Fe(),r=e.data,s=Xx(e),i=!1;if(r!=null&&fe(o)){let l=Vn(xn(t)),c=l!==null?jn(l,t._rootElement):null,u=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=o.anchor.getNode(),f=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&t.isComposing()&&q(d)&&Hn(d);if(!u&&!f&&Yx(o,s,r,e.timeStamp,!1,c)){if(i=!0,n.compositionPhase==="ending-firefox"){let C=yc(t,r);if(n.compositionPhase="idle",C)return xs(Ec),Y_(),!0}let p=o.anchor.getNode();if(l===null||c===null)return!0;let h=o.isBackward(),m=h?o.anchor.offset:o.focus.offset,_=h?o.focus.offset:o.anchor.offset;xa&&!o.isCollapsed()&&q(p)&&c.anchorNode!==null&&p.getTextContent().slice(0,m)+r+p.getTextContent().slice(m+_)===zC(c.anchorNode)||re(t,ii,r);let x=r.length;Do&&x>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(o.anchor.offset-=x,o._cachedNodes=null,o._cachedIsBackward=null),Ca&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Lt(null))}}if(!i)hg(!1,t,r!==null?r:void 0),n.compositionPhase==="ending-firefox"&&(yc(t,r||void 0),xs(Ec),n.compositionPhase="idle");return Y_(),!0}function BA(e){let t=He(),n=t._inputState,o=Fe();if(fe(o)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;let r=o.anchor,s=o.anchor.getNode();if(Lt(r.key),xs(nC),e.timeStamp<n.lastKeyDownTimeStamp+30||r.type==="element"||!o.isCollapsed()||!Ca&&(s.getFormat()!==o.format||q(s)&&s.getStyle()!==o.style)||q(s)&&(Hn(s)||r.offset===0&&!s.canInsertTextBefore()||r.offset===s.getTextContentSize()&&!s.canInsertTextAfter())){re(t,ii,zf);let i=Fe();fe(i)&&Lt(i.anchor.key)}}return!0}function KA(e){let t=He();return t._inputState.compositionPhase="idle",yc(t,e.data),xs(Ec),!0}function cc(e){if(e===null)return;let t=ot(e);if(!q(t)||t.getType()==="text"||Hn(t)||!t.isAttached())return;let n=Fe(),o=fe(n)&&n.anchor.key===e?n.anchor.offset:null,r=hn(t.getTextContent());if(r.setFormat(t.getFormat()),r.setStyle(t.getStyle()),t.replace(r),o!==null){let s=Math.min(o,r.getTextContentSize());r.select(s,s)}}function yc(e,t){let n=e._compositionKey;if(Lt(null),n!==null&&t!=null){if(t===""){let r=ot(n),s=e.getElementByKey(n),i=s!==null&&q(r)?rr(r,s,e):null;if(i!==null&&i.nodeValue!==null&&q(r)){let l=Vn(xn(e)),c=l&&jn(l,e._rootElement),u=null,d=null;c!==null&&c.anchorNode===i&&(u=c.anchorOffset,d=c.focusOffset),mg(r,i.nodeValue,u,d,!0)}return cc(n),!1}if(t[t.length-1]===`
|
|
8
|
+
`){let r=Fe();if(fe(r)||fi(r)){if(fe(r)){let s=r.focus;r.anchor.set(s.key,s.offset,s.type)}return re(e,xc,null),cc(n),!1}}let o=ot(n);if(o!==null&&q(o)&&Hn(o)){o.markDirty();let r=Fe(),s=o.getTextContentSize(),i=fe(r)&&r.anchor.key===n?r.anchor.offset:s;return o.select(i,i).insertText(t),!0}}return hg(!0,e,t),cc(n),!1}function zA(e){let t=He(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase==="ending-safari"){let o=X_(e);if(o&&Un(t,()=>{yc(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",o)return!0}if(function(o){return Ze(o,"ArrowRight",{shiftKey:"any"})}(e))re(t,Ox,e);else if(function(o){return Ze(o,"ArrowRight",{...tr,shiftKey:"any"})}(e))re(t,Ax,e);else if(function(o){return Ze(o,"ArrowLeft",{shiftKey:"any"})}(e))re(t,Rx,e);else if(function(o){return Ze(o,"ArrowLeft",{...tr,shiftKey:"any"})}(e))re(t,Mx,e);else if(function(o){return Ze(o,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))re(t,Dx,e);else if(function(o){return Ze(o,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))re(t,$x,e);else if(function(o){return Ze(o,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))n.isInsertLineBreak=!0,re(t,xc,e);else if(function(o){return o.key===" "}(e))re(t,wx,e);else if(function(o){return Fn&&Ze(o,"o",{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,re(t,ha,!0);else if(function(o){return Ze(o,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))n.isInsertLineBreak=!1,re(t,xc,e);else if(function(o){return Ze(o,"Backspace",{shiftKey:"any"})||Fn&&Ze(o,"h",{ctrlKey:!0})}(e))X_(e)?re(t,kx,e)&&C_(n):(e.preventDefault(),re(t,Oa,!0));else if(function(o){return o.key==="Escape"}(e))re(t,Ix,e);else if(function(o){return Ze(o,"Delete",{})||Fn&&Ze(o,"d",{ctrlKey:!0})}(e))!function(o){return o.key==="Delete"}(e)?(e.preventDefault(),re(t,Oa,!1)):re(t,Lx,e);else if(function(o){return Ze(o,"Backspace",V_)}(e))e.preventDefault(),re(t,Aa,!0);else if(function(o){return Ze(o,"Delete",V_)}(e))e.preventDefault(),re(t,Aa,!1);else if(function(o){return Fn&&Ze(o,"Backspace",{metaKey:!0})}(e))e.preventDefault(),re(t,Ra,!0);else if(function(o){return Fn&&(Ze(o,"Delete",{metaKey:!0})||Ze(o,"k",{ctrlKey:!0}))}(e))e.preventDefault(),re(t,Ra,!1);else if(function(o){return Ze(o,"b",tr)}(e))e.preventDefault(),re(t,Sr,"bold");else if(function(o){return Ze(o,"u",tr)}(e))e.preventDefault(),re(t,Sr,"underline");else if(function(o){return Ze(o,"i",tr)}(e))e.preventDefault(),re(t,Sr,"italic");else if(function(o){return Ze(o,"Tab",{shiftKey:"any"})}(e))re(t,Fx,e);else if(function(o){return Ze(o,"z",tr)}(e))e.preventDefault(),re(t,Jf);else if(function(o){if(Fn)return Ze(o,"z",{metaKey:!0,shiftKey:!0});return Ze(o,"y",{ctrlKey:!0})||Ze(o,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),re(t,Zf);else{let o=t._editorState._selection;!function(r){return Ze(r,"a",tr)}(e)?o===null||fe(o)||(!function(r){return Ze(r,"c",tr)}(e)?function(r){return Ze(r,"x",tr)}(e)&&(e.preventDefault(),re(t,tg,e)):(e.preventDefault(),re(t,eg,e))):(e.preventDefault(),re(t,Ux,e)&&C_(n))}return function(o){return o.ctrlKey||o.shiftKey||o.altKey||o.metaKey}(e)&&t.dispatchCommand(Gx,e),!0}function Jx(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var ai=new Map;function y_(e){let t=VC(e.target);if(t===null)return;let n=Uc(e.target),o=null,r=null,s=n!==null?Cc.get(n):void 0;if(n!==null){if(s!==void 0){let{editors:f,hasShadowEditor:p}=s;if(p===void 0){p=!1;for(let h of f)if(h._rootElement!==null&&sr(h._rootElement.getRootNode())){p=!0;break}s.hasShadowEditor=p}if(p){let h=null,m=null;for(let _ of f){let x=_._rootElement;if(x===null)continue;let C=jn(t,x).anchorNode;if(C!==null&&ds(C)===_){if(sr(x.getRootNode())){o=_,r=C;break}h===null&&(h=_,m=C)}}o===null&&h!==null&&(o=h,r=m)}else{let h=t.anchorNode;h===null||_t(h)&&h.shadowRoot!==null||(o=ds(h),o!==null&&(r=h))}}if(o===null){let f=ui(n);o=f!==null?ds(f):null}}if(o===null)return;if(o._inputState.isSelectionChangeFromMouseDown){if(s!==void 0)for(let f of s.editors)f._inputState.isSelectionChangeFromMouseDown=!1;Un(o,()=>{let f=Ns(),p=r??jn(t,o._rootElement).anchorNode;if(_t(p)||mo(p))en(Da(f,t,o,e))})}let i=pg(o),l=i[i.length-1],c=l._key,u=ai.get(c),d=u||l;d!==o&&__(t,d,!1),__(t,o,!0),o!==l?ai.set(c,o):u&&ai.delete(c)}function bf(e){e._lexicalHandled=!0}function S_(e){return e._lexicalHandled===!0}var N_=()=>{};function UA(e){let t=Tf.get(e);if(t===void 0)return void N_();let n=Cc.get(t);if(n===void 0)return void N_();Tf.delete(e);let o=Va(e);zc(o)?(function(s){if(s._parentEditor!==null){let i=pg(s),l=i[i.length-1]._key;ai.get(l)===s&&ai.delete(l)}else ai.delete(s._key)}(o),n.editors.delete(o),n.hasShadowEditor=void 0,e.__lexicalEditor=null):o&&U(198);let r=Jx(e);for(let s=0;s<r.length;s++)r[s]();e.__lexicalEventHandles=[]}function vf(e,t,n){zt();let o=e.__key,r=e.getParent();if(r===null)return void(Vt(e)!==null&&U(367,o,String(Vt(e))));let s=function(l){let c=Fe();if(!fe(c)||!P(l))return c;let{anchor:u,focus:d}=c,f=u.getNode(),p=d.getNode();return Ia(f,l)&&u.set(l.__key,0,"element"),Ia(p,l)&&d.set(l.__key,0,"element"),c}(e),i=!1;if(fe(s)&&t){let{anchor:l,focus:c}=s;l.key===o&&(vc(l,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0),c.key===o&&(vc(c,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else fi(s)&&t&&e.isSelected()&&e.selectPrevious();if(fe(s)&&t&&!i){let l=e.getIndexWithinParent();Kn(e),cs(s,r,l,-1)}else Kn(e);n||vt(r)||r.canBeEmpty()||!r.isEmpty()||vf(r,t),t&&s&&Ft(r)&&r.isEmpty()&&r.selectEnd()}function HA(e){return e}var Zx=Symbol.for("ephemeral");function Sc(e){return e[Zx]||!1}var E_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class rn{__type;__key;__parent;__prev;__next;__state;[Na];static getType(){let{ownNodeType:e}=qa(this);return e===void 0&&U(64,this.name),e}static clone(e){U(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||uy(this.constructor);return Object.assign(t,{extends:n}),typeof e=="string"&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",E_),Object.defineProperty(this,Na,E_),LC(this,e)}getType(){return this.__type}isInline(){U(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let t=ot(e);if(t===null)break;e=t.__parent!==null?t.__parent:Vt(t)}return!1}isSelected(e){let t=e||Fe();if(t==null)return!1;let n=t.getNodes().some((o)=>o.__key===this.__key);if(q(this))return n;if(fe(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;let o=this.getParent();if(Ve(this)&&this.isInline()&&o){let r=t.isBackward()?t.focus:t.anchor;if(o.is(r.getNode())&&r.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:ot(e)}getParentOrThrow(){let e=this.getParent();return e===null&&U(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(vt(t)||Vt(e)!==null)return P(e)||e===this&&Ve(e)||U(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&U(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:ot(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ot(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=P(this)?this:this.getParent(),n=P(e)?e:e.getParent(),o=t&&n?kc(t,n):null;return o?o.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=kc(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?kg(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&U(279),!1)))}isParentOf(e){return Ia(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],o=new Set,r=this;for(;r!==null;){let s=r.__key;if(o.has(s)||(o.add(s),n.push(r)),r===e)break;let i=P(r)?t?r.getFirstChild():r.getLastChild():null;if(i!==null){r=i;continue}let l=t?r.getNextSibling():r.getPreviousSibling();if(l!==null){r=l;continue}let c=r.getParentOrThrow();if(o.has(c.__key)||n.push(c),c===e)break;let u=null,d=c;do{if(d===null&&U(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||o.has(d.__key)||n.push(d)}while(u===null);r=u}return t||n.reverse(),n}isDirty(){let e=He()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Sc(this))return this;let e=ot(this.__key);return e===null&&U(113),e}getWritable(){if(Sc(this))return this;zt();let e=Io(),t=He(),n=e._nodeMap,o=this.__key,r=this.getLatest(),s=t._cloneNotNeeded,i=Fe();if(i!==null&&i.setCachedNodes(null),s.has(o))return Dc(r),r;let l=bg(r);return s.add(o),Dc(l),n.set(o,l),l}getTextContent(){return hy(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){U(70)}updateDOM(e,t,n){U(71)}getDOMSlot(e){return new ri(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){U(18,this.name)}updateFromJSON(e){return function(t,n){let o=t.getWritable(),r=n.$,s=r;for(let i of _x(o).flatKeys)i in n&&(s!==void 0&&s!==r||(s={...r}),s[i]=n[i]);return(o.__state||s)&&Wf(t).updateFromJSON(s),o}(this,e)}static transform(){return null}remove(e){vf(this,!0,e)}replace(e,t){zt();let n=Fe();n!==null&&(n=n.clone()),cf(this,e);let o=this.getLatest(),r=this.__key,s=e.__key,i=e.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size,u=i.getParent(),d=u!==null?i.getIndexWithinParent():-1;Kn(i),u!==null&&fe(n)&&cs(n,u,d,-1);let f=o.getPreviousSibling(),p=o.getNextSibling(),{__prev:h,__next:m,__parent:_}=o;if(vf(o,!1,!0),f===null)l.__first=s;else f.getWritable().__next=s;if(i.__prev=h,p===null)l.__last=s;else p.getWritable().__prev=s;i.__next=m,i.__parent=_,l.__size=c;let x=0;t&&(P(this)&&P(i)||U(139),x=i.getChildrenSize(),i.splice(x,0,this.getChildren()));let C=Wn(this);if(C.length>0){Ro(this)&&Ro(i)||U(368,this.__key,i.__key);for(let y of C){let N=Ar(this,y);N!==null&&(my(this,y),Og(i,y,N))}}if(fe(n)){en(n);let y=n.anchor,N=n.focus;y.key===r&&(t&&y.type==="element"?y.set(i.__key,x+y.offset,"element"):O_(y,i)),N.key===r&&(t&&N.type==="element"?N.set(i.__key,x+N.offset,"element"):O_(N,i))}return Ao()===r&&Lt(s),i}insertAfter(e,t=!0){zt(),cf(this,e);let n=this.getWritable(),o=e.getWritable();ox(this.getParentOrThrow());let r=o.getParent(),s=Fe(),i=!1,l=!1;if(r!==null){let p=e.getIndexWithinParent();if(fe(s)){let h=r.__key,{anchor:m,focus:_}=s;i=m.type==="element"&&m.key===h&&m.offset===p+1,l=_.type==="element"&&_.key===h&&_.offset===p+1}Kn(o),t&&fe(s)&&cs(s,r,p,-1)}else Kn(o);let c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=o.__key,f=n.__next;if(c===null)u.__last=d;else c.getWritable().__prev=d;if(u.__size++,n.__next=d,o.__next=f,o.__prev=n.__key,o.__parent=n.__parent,t&&fe(s)){let p=this.getIndexWithinParent();cs(s,u,p+1);let h=u.__key;i&&s.anchor.set(h,p+2,"element"),l&&s.focus.set(h,p+2,"element")}return e}insertBefore(e,t=!0){zt(),cf(this,e);let n=this.getWritable(),o=e.getWritable();ox(this.getParentOrThrow());let r=o.__key,s=Fe(),i=o.getParent(),l=i!==null?o.getIndexWithinParent():-1;Kn(o),i!==null&&t&&fe(s)&&cs(s,i,l,-1);let c=this.getPreviousSibling(),u=this.getParentOrThrow().getWritable(),d=n.__prev,f=this.getIndexWithinParent();if(c===null)u.__first=r;else c.getWritable().__next=r;if(u.__size++,n.__prev=r,o.__prev=d,o.__next=n.__key,o.__parent=n.__parent,t&&fe(s))cs(s,this.getParentOrThrow(),f);return e}isParentRequired(){return!1}createParentElementNode(){return bn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){zt();let n=zn(this);if(n!==null)return n.selectPrevious(e,t);let o=this.getPreviousSibling(),r=this.getParentOrThrow();if(o===null)return r.select(0,0);if(P(o))return o.select();if(!q(o)){let s=o.getIndexWithinParent()+1;return r.select(s,s)}return o.select(e,t)}selectNext(e,t){zt();let n=zn(this);if(n!==null)return n.selectNext(e,t);let o=this.getNextSibling(),r=this.getParentOrThrow();if(o===null)return r.select();if(P(o))return o.select(0,0);if(!q(o)){let s=o.getIndexWithinParent();return r.select(s,s)}return o.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function og(e){return e instanceof rn}var WA="historic",GA="history-push",uc="history-merge",jA="paste",YA="cut",Qx="collaboration",VA="skip-collab",eC="skip-scroll-into-view",tC="skip-dom-selection",Nc="skip-selection-focus",nC="composition-start",Ec="composition-end",XA="!important";function Of(e){let t={};if(!e)return t;let n="",o="",r=null,s=!1,i=!1,l=!1,c=0,u=e.length,d=-1;for(let h=0;h<u;h++){let m=e[h];if(s)m==="*"&&e[h+1]==="/"&&(s=!1,h++);else if(i)d===-1&&(d=h),i=!1;else if(r===null)if(m!=="/"||e[h+1]!=="*")if(m!=='"'&&m!=="'")if(m!=="(")if(m!==")")if(l||m!==":"||c!==0){if(m===";"&&c===0){d!==-1&&(l?o+=e.slice(d,h):n+=e.slice(d,h),d=-1);let _=n.trim(),x=o.trim();_!==""&&x!==""&&(t[_]=x),n="",o="",l=!1;continue}d===-1&&(d=h)}else d!==-1&&(n+=e.slice(d,h),d=-1),l=!0;else d===-1&&(d=h),c=Math.max(0,c-1);else d===-1&&(d=h),c++;else d===-1&&(d=h),r=m;else d!==-1&&(l?o+=e.slice(d,h):n+=e.slice(d,h),d=-1),s=!0,h++;else d===-1&&(d=h),m==="\\"?i=!0:m===r&&(r=null)}d!==-1&&(l?o+=e.slice(d,u):n+=e.slice(d,u));let f=n.trim(),p=o.trim();return f!==""&&p!==""&&(t[f]=p),t}function oC(e,t,n){let o=n.trimEnd(),r=o.length-10;r>=0&&o.slice(r).toLowerCase()===XA?e.setProperty(t,o.slice(0,r).trim(),"important"):e.setProperty(t,n,"")}function qA(e,t){for(let n in t){let o=t[n];o==null?e.removeProperty(n):oC(e,n,o)}}function Af(e,t,n=""){if(t===n)return;let o=Of(n),r=Of(t);for(let s in r)delete o[s],oC(e,s,r[s]);for(let s in o)e.removeProperty(s)}function ef(e,t){return 16&t?"code":t&Kf?"mark":32&t?"sub":64&t?"sup":null}function tf(e,t){return 1&t?"strong":2&t?"em":"span"}function rC(e,t,n,o,r){let s=o.classList,i=li(r,"base");i!==void 0&&s.add(...i),i=li(r,"underlineStrikethrough");let l=!1,c=8&t&&4&t;i!==void 0&&(8&n&&4&n?(l=!0,c||s.add(...i)):c&&s.remove(...i));for(let u in jt){let d=jt[u];if(i=li(r,u),i!==void 0)if(n&d){if(l&&(u==="underline"||u==="strikethrough")){t&d&&s.remove(...i);continue}((t&d)===0||c&&u==="underline"||u==="strikethrough")&&s.add(...i)}else t&d&&s.remove(...i)}}function sC(e,t,n){let o=n.isComposing(),r=e+(o?ya:""),s=_o(),i=Tg(s).$getDOMSlot(n,t,s),l=i.getFirstChild();if(l===null||l.nodeType!==Node.TEXT_NODE)return void i.insertChild(_n().createTextNode(r));let c=l,u=c.nodeValue;if(u!==r)if(o||Do){let[d,f,p]=function(h,m){let _=h.length,x=m.length,C=0,y=0;for(;C<_&&C<x&&h[C]===m[C];)C++;for(;y+C<_&&y+C<x&&h[_-y-1]===m[x-y-1];)y++;return[C,_-C-y,m.slice(C,x-y)]}(u,r);f!==0&&c.deleteData(d,f),c.insertData(d,p)}else c.nodeValue=r}function T_(e,t,n,o,r,s){sC(r,e,t);let i=s.theme.text;i!==void 0&&rC(0,0,o,e,i)}function rc(e,t){let n=_n().createElement(t);return n.appendChild(e),n}function Tc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends rn{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:tR,priority:0}),b:()=>({conversion:ZA,priority:0}),code:()=>({conversion:Qo,priority:0}),em:()=>({conversion:Qo,priority:0}),i:()=>({conversion:Qo,priority:0}),mark:()=>({conversion:Qo,priority:0}),s:()=>({conversion:Qo,priority:0}),span:()=>({conversion:JA,priority:0}),strong:()=>({conversion:Qo,priority:0}),sub:()=>({conversion:Qo,priority:0}),sup:()=>({conversion:Qo,priority:0}),u:()=>({conversion:Qo,priority:0})}})}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 dA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ao()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=jt[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return vr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,o=ef(0,n),r=tf(0,n),s=o===null?r:o,i=_n().createElement(s),l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),o!==null&&(l=_n().createElement(r),i.appendChild(l)),T_(l,this,0,n,this.__text,e);let c=this.__style;return c!==""&&Af(i.style,c),i}updateDOM(e,t,n){let o=this.__text,r=e.__format,s=this.__format,i=ef(0,r),l=ef(0,s),c=tf(0,r),u=tf(0,s);if((i===null?c:i)!==(l===null?u:l))return!0;if(i===l&&c!==u){let m=t.firstChild;m==null&&U(48);let _=_n().createElement(u);return T_(_,this,0,s,o,n),t.replaceChild(_,m),!1}let d=t;l!==null&&i!==null&&(d=t.firstChild,d==null&&U(49)),sC(o,d,this);let f=n.theme.text;f!==void 0&&r!==s&&rC(0,r,s,d,f);let p=e.__style,h=this.__style;return p!==h&&Af(t.style,h,p),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return _t(t)||U(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=rc(t,"b")),this.hasFormat("italic")&&(t=rc(t,"i")),this.hasFormat("strikethrough")&&(t=rc(t,"s")),this.hasFormat("underline")&&(t=rc(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e=="string"?jt[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e=="string"?lA[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=vr(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=uA[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){zt();let n=e,o=t,r=Fe(),s=this.getTextContent(),i=this.__key;if(typeof s=="string"){let l=s.length;n===void 0&&(n=l),o===void 0&&(o=l)}else n=0,o=0;if(!fe(r))return xC(i,n,i,o,"text","text");{let l=Ao();l!==r.anchor.key&&l!==r.focus.key||Lt(i),r.setTextNodeRange(this,n,this,o)}return r}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,o){let r=this.getWritable(),s=r.__text,i=n.length,l=e;l<0&&(l=i+l,l<0&&(l=0));let c=Fe();if(o&&fe(c)){let d=e+i;c.setTextNodeRange(r,d,r,d)}let u=s.slice(0,l)+n+s.slice(l+t);return r.__text=u,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){zt();let t=this.getLatest(),n=t.getTextContent();if(n==="")return[];let o=t.__key,r=Ao(),s=n.length;e.sort((A,O)=>A-O),e.push(s);let i=[],l=e.length;for(let A=0,O=0;A<s&&O<=l;O++){let D=e[O];D>A&&(i.push(n.slice(A,D)),A=D)}let c=i.length;if(c===1)return[t];let u=i[0],d=t.getParent(),f,p=t.getFormat(),h=t.getStyle(),m=t.__detail,_=!1,x=null,C=null,y=Fe();if(fe(y)){let[A,O]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];A.type==="text"&&A.key===o&&(x=A),O.type==="text"&&O.key===o&&(C=O)}t.isSegmented()?(f=hn(u),f.__format=p,f.__style=h,f.__detail=m,f.__state=i_(t,f),_=!0):f=t.setTextContent(u);let N=[f];for(let A=1;A<c;A++){let O=hn(i[A]);O.__format=p,O.__style=h,O.__detail=m,O.__state=i_(t,O);let D=O.__key;r===o&&Lt(D),N.push(O)}let E=x?x.offset:null,v=C?C.offset:null,b=0;for(let A of N){if(!x&&!C)break;let O=b+A.getTextContentSize();if(x!==null&&E!==null&&E<=O&&E>=b&&(x.set(A.getKey(),E-b,"text"),E<O&&(x=null)),C!==null&&v!==null&&v<=O&&v>=b){C.set(A.getKey(),v-b,"text");break}b=O}if(d!==null){(function(D){let H=D.getPreviousSibling(),k=D.getNextSibling();H!==null&&Dc(H),k!==null&&Dc(k)})(this);let A=d.getWritable(),O=this.getIndexWithinParent();_?(A.splice(O,0,N),this.remove()):A.splice(O,1,N),fe(y)&&cs(y,d,O,c-1)}return N}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||U(50);let n=this.__key,o=e.__key,r=this.__text,s=r.length;Ao()===o&&Lt(n);let i=Fe();if(fe(i)){let{anchor:d,focus:f}=i;d!==null&&d.key===o&&L_(d,t,n,e,s),f!==null&&f.key===o&&L_(f,t,n,e,s)}let l=e.__text,c=t?l+r:r+l;this.setTextContent(c);let u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function JA(e){return{forChild:rg(e.style),node:null}}function ZA(e){let t=e,n=t.style.fontWeight==="normal";return{forChild:rg(t.style,n?void 0:"bold"),node:null}}var b_=new WeakMap;function eR(e){if(!_t(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function tR(e){let t=e;e.parentElement===null&&U(129);let n=t.textContent||"";if(function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=b_.get(s))===void 0&&!eR(s);)i.push(s),s=s.parentNode;let l=r===void 0?s:r;for(let c=0;c<i.length;c++)b_.set(i[c],l);return l}(t)!==null)return{node:ig(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=t,r=!0;for(;o!==null&&(o=v_(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=t,r=!0;for(;o!==null&&(o=v_(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:hn(n)}}function v_(e,t){let n=e;for(;;){let o;for(;(o=t?n.nextSibling:n.previousSibling)===null;){let s=n.parentElement;if(s===null)return null;n=s}if(n=o,_t(n)){let s=n.style.display;if(s===""&&!oy(n)||s!==""&&!s.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(mo(n))return n;if(n.nodeName==="BR")return null}}var nR={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Qo(e){let t=nR[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:rg(e.style,t),node:null}}function hn(e=""){return Xa(new ms(e))}function q(e){return e instanceof ms}function rg(e,t){let n=e.fontWeight,o=e.textDecoration.split(" "),r=n==="700"||n==="bold",s=o.includes("line-through"),i=e.fontStyle==="italic",l=o.includes("underline"),c=e.verticalAlign;return(u)=>q(u)||Tc(u)?(r&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),l&&!u.hasFormat("underline")&&u.toggleFormat("underline"),c!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),c!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),t&&!u.hasFormat(t)&&u.toggleFormat(t),u):u}class Ua extends ms{$config(){return this.config("tab",{extends:ms})}constructor(e=void 0){super("\t",e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=li(e.theme,"tab");if(n!==void 0)t.classList.add(...n);return t}setTextContent(e){return super.setTextContent("\t")}spliceText(e,t,n,o){return n===""&&t===0||n==="\t"&&t===1||U(286),this}setDetail(e){return e!==2&&U(127),this}setMode(e){return e!=="normal"&&U(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function iC(){return Xa(new Ua)}function sg(e){return e instanceof Ua}class aC{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){if(this.key===e.key)return this.offset<e.offset;return wg(Mo(wr(this,"next")),Mo(wr(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&U(20),e}set(e,t,n,o){let r=this._selection,s=this.key;o&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,br()||(Ao()===s&&Lt(e),r!==null&&(r.setCachedNodes(null),fe(r)&&(r._cachedIsBackward=null),r.dirty=!0)))}}function ho(e,t,n){return new aC(e,t,n)}function nf(e,t){let n=t.__key,o=e.offset,r="element";if(q(t)){r="text";let s=t.getTextContentSize();o>s&&(o=s)}else if(!P(t)){let s=t.getNextSibling();if(q(s))n=s.__key,o=0,r="text";else{let i=t.getParent();i&&(n=i.__key,o=t.getIndexWithinParent()+1)}}e.set(n,o,r)}function O_(e,t){if(P(t)){let n=t.getLastDescendant();P(n)||q(n)?nf(e,n):nf(e,t)}else nf(e,t)}function A_(e,t,n,o){let r=e.getNode(),s=r.getChildAtIndex(e.offset),i=hn();if(i.setFormat(n),i.setStyle(o),DC(s))s.splice(0,0,[i]);else if(s!==null){let l=vt(r)?bn().append(i):i;s.insertBefore(l)}else if(vt(r)){let l=r.getLastChild();P(l)&&!l.isInline()&&l.isEmpty()?l.append(i):r.append(bn().append(i))}else r.append(i);e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}function R_(e,t,n,o){let r=e.anchor.getNode();q(r)||U(398);let s=e.anchor.offset,i=hn(t);i.setFormat(n),i.setStyle(o);let l=r.getParentOrThrow();if(s===0)l.isInline()&&!r.__prev?l.insertBefore(i):r.insertBefore(i,!1);else if(s===r.getTextContentSize())l.isInline()&&!r.__next?l.insertAfter(i):r.insertAfter(i,!1);else{let[c]=r.splitText(s);c.insertAfter(i,!1)}r.getTextContent()===""&&r.isAttached()&&r.remove(),i.selectEnd(),i.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}class Lc{_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(!fi(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((o)=>n.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 Lc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter((s)=>Vt(s)===null),n=t.length;if(n===0)return;let o=t[n-1],r;if(q(o))r=o.select();else{let s=o.getIndexWithinParent()+1;r=o.getParentOrThrow().select(s,s)}r.insertNodes(e);for(let s=0;s<n;s++)t[s].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let o of t){let r=ot(o);r!==null&&n.push(r)}return br()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter((t)=>Vt(t)===null);if((Fe()||Ns())===this&&e[0]){let t=Ct(e[0],"next");yy(Dr(t,t))}for(let t of e)t.remove();lC()}}function lC(){let e=vn();if(e.isEmpty()){let t=bn();e.append(t),t.select()}}function fe(e){return e instanceof Ss}class Ss{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!fe(e)&&(this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(n){let o=[],[r,s]=n.getTextSlices();r&&o.push(r.caret.origin);let i=new Set,l=new Set;for(let c of n)if(Gn(c)){let{origin:u}=c;o.length===0?i.add(u):(l.add(u),o.push(u))}else{let{origin:u}=c;P(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Rr(n.focus)&&P(n.focus.origin)&&n.focus.getNodeAtCaret()===null)for(let c=ir(n.focus.origin,"previous");Gn(c)&&i.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=di(c))i.delete(c.origin),o.pop();for(;o.length>1;){let c=o[o.length-1];if(!P(c)||l.has(c)||c.isEmpty()||i.has(c))break;o.pop()}if(o.length===0&&n.isCollapsed()){let c=Mo(n.anchor),u=Mo(n.anchor.getFlipped()),d=(p)=>go(p)?p.origin:p.getNodeAtCaret(),f=d(c)||d(u)||(n.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(f)}return o}(Ig(Ff(this),"next"));return br()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,o){return this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,o,"text"),this}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let t=e[0],n=e[e.length-1],o=this.anchor,r=this.focus,s=o.isBefore(r),[i,l]=Rf(this),c="",u=!0;for(let d=0;d<e.length;d++){let f=e[d];if(P(f)&&!f.isInline()){u||(c+=`
|
|
9
|
+
`);let p="";for(let h of Wn(f)){let m=Ar(f,h);m!==null&&(p+=m.getTextContent())}p!==""?(c+=p,u=!1):u=!f.isEmpty()}else if(u=!1,q(f)){let p=f.getTextContent();f===t?f===n?o.type==="element"&&r.type==="element"&&r.offset!==o.offset||(p=i<l?p.slice(i,l):p.slice(l,i)):p=s?p.slice(i):p.slice(l):f===n&&(p=s?p.slice(0,l):p.slice(0,i)),c+=p}else!Ve(f)&&!wo(f)||f===n&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){let t=He(),n=t.getEditorState()._selection,o=mC(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(o===null)return;let[r,s,i]=o;this.anchor.set(r.key,r.offset,r.type,!0),this.focus.set(s.key,s.offset,s.type,!0),i&&(this.dirty=!0),ni(this)}clone(){let e=this.anchor,t=this.focus;return new Ss(ho(e.key,e.offset,e.type),ho(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=vr(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=jt[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(ig(e))}insertText(e){let t=this.format,n=this.style;if(!this.isCollapsed()){let d=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(q(d)&&(t=d.getFormat(),n=d.getStyle()),this.removeText(),this.format=t,this.style=n,e==="")return;if(Ao()===null)return this.anchor.type==="element"&&A_(this.anchor,this.focus,t,n),void R_(this,e,t,n)}this.anchor.type==="element"&&A_(this.anchor,this.focus,t,n);let o=this.anchor.getNode();q(o)||U(398);let r=this.anchor.offset,s=o.getParentOrThrow(),i=o.getTextContentSize();if(Hn(o)||r===0&&(!o.canInsertTextBefore()||!s.canInsertTextBefore()&&!o.__prev)||r===i&&(!o.canInsertTextAfter()||!s.canInsertTextAfter()&&!o.__next)){if(o.isSegmented()&&r!==0&&r!==i){if(Ao()!==null)o.setMode("normal").setFormat(t).setStyle(n);else{let f=hn(o.getTextContent());f.setFormat(t),f.setStyle(n),o.replace(f),f.select(r,r)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(r===0){let f=o.getPreviousSibling();if(q(f)&&f.canInsertTextAfter()&&!Hn(f))f.select();else{let p=hn();p.setFormat(t),p.setStyle(n),s.canInsertTextBefore()?o.insertBefore(p):s.insertBefore(p),p.select()}return void this.insertText(e)}if(r===i){let f=o.getNextSibling();if(q(f)&&f.canInsertTextBefore()&&!Hn(f))f.select(0,0);else{let p=hn();p.setFormat(t),p.setStyle(n),s.canInsertTextAfter()?o.insertAfter(p):s.insertAfter(p),p.select(0,0)}return void this.insertText(e)}let d=hn(e);return d.setFormat(t),d.setStyle(n),o.replace(d),void d.select()}if(e==="")return;let l=s.isInline()&&r===0&&!o.__prev,c=s.isInline()&&r===i&&!o.__next,u=o.getFormat()!==t||o.getStyle()!==n;if(l||c||u){if(o.getTextContent()!==""||l||c)return void R_(this,e,t,n);o.setFormat(t),o.setStyle(n)}o.spliceText(r,0,e,!0),o.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=Fe()===this;_a(this,Sy(Ff(this))),e&&Fe()!==this&&en(this)}formatText(e,t=null){uC(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type==="element"&&P(t)&&Vt(t)!==null){let m=t.isShadowRoot()?t.getFirstChild()??t.append(bn()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&m!==null&&!P(m)){let _=bn();m.insertBefore(_),m=_}if(m!==null){m.selectStart();let _=Fe();return fe(_)||U(369),_.insertNodes(e)}}if(this.anchor.type==="element"&&vt(t)){let m=rf(e),_=m.getLastDescendant();return t.splice(this.anchor.offset,0,m.getChildren()),void(_!==null&&_.selectEnd())}let n=(this.isBackward()?this.focus:this.anchor).getNode(),o=yr(n,pn),r=e[e.length-1];if(P(o)&&"__language"in o){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let m=ua(this);o.splice(m,0,e),r.selectEnd()}return}if(!e.some((m)=>(P(m)||Ve(m))&&!m.isInline())){P(o)||U(211,n.constructor.name,n.getType());let m=ua(this);return o.splice(m,0,e),void r.selectEnd()}if(P(o)&&Vt(o)!==null){let m=ua(this),_=Df(e);o.splice(m,0,_);let x=_[_.length-1];return void(x!==void 0?x.selectEnd():o.select(m,m))}if(o===null){let m=rf(e),_=m.getLastDescendant(),x=wr(this.anchor,"next");for(let C of m.getChildren())x=by(C,x);return void(_!==null&&_.selectEnd())}if(P(o)&&!o.isParentRequired()&&!vt(o.getParentOrThrow())){let m=ua(this),_=Df(e);o.splice(m,0,_);let x=_[_.length-1];return void(x!==void 0?x.selectEnd():o.select(m,m))}let s=rf(e),i=s.getLastDescendant(),l=s.getChildren(),c=!P(o)||!o.isEmpty()?this.insertParagraph():null;c&&!o.isAttached()&&(n=this.anchor.getNode(),o=yr(n,pn));let u=l[l.length-1],d=l[0];var f;P(f=d)&&pn(f)&&!f.isEmpty()&&P(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(P(o)||U(211,n.constructor.name,n.getType()),o.append(...d.getChildren()),d=l[1]),d&&(o===null&&U(212,n.constructor.name,n.getType()),function(m,_){let x=_.getParentOrThrow().getLastChild(),C=_,y=[_];for(;C!==x;)C.getNextSibling()||U(140),C=C.getNextSibling(),y.push(C);let N=m;for(let E of y)N=N.insertAfter(E)}(o,d));let p=yr(i,pn);c&&P(p)&&(c.canMergeWhenEmpty()||pn(u))&&(p.append(...c.getChildren()),c.remove()),P(o)&&o.isEmpty()&&o.remove(),i.selectEnd();let h=P(o)?o.getLastChild():null;wo(h)&&p!==o&&h.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&vt(e)){let i=bn();return e.splice(this.anchor.offset,0,[i]),i.select(),i}let t=ua(this),n=yr(this.anchor.getNode(),pn);if(n!==null&&Vt(n)!==null)return null;P(n)||U(213);let o=n.getChildAtIndex(t),r=o?[o,...o.getNextSiblings()]:[],s=n.insertNewAfter(this,!1);return s?(s.append(...r),s.selectStart(),s):null}insertLineBreak(e){let t=Pc();if(this.insertNodes([t]),e){let n=t.getParentOrThrow(),o=t.getIndexWithinParent();n.select(o,o)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],o=e[t-1],[r,s]=Rf(this),i=this.isBackward(),[l,c]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=i?[s,r]:[r,s];if(t===0)return[];if(t===1){if(q(n)&&!this.isCollapsed()){let f=n.splitText(u,d),p=u===0?f[0]:f[1];return p?(l.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[n]}if(q(n)&&(u===n.getTextContentSize()?e.shift():u!==0&&([,n]=n.splitText(u),e[0]=n,l.set(n.getKey(),0,"text"))),q(o)){let f=o.getTextContent().length;d===0?e.pop():d!==f&&([o]=o.splitText(d),e[e.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return e}modify(e,t,n){if(Ac(this,e,t,n))return;let o=e==="move",r=He(),s=Vn(xn(r));if(!s)return;let{_blockCursorElement:i,_rootElement:l}=r,c=this.focus.getNode();l===null||i===null||!P(c)||c.isInline()||c.canBeEmpty()||$c(i,r,l);let u=ci(r,this.focus.key),d=u;if(this.focus.type==="text"&&(d=q(c)?rr(c,u,r):null),this.dirty){let f=ci(r,this.anchor.key),p=f;if(this.anchor.type==="text"){let h=this.anchor.getNode();p=q(h)?rr(h,f,r):null}p&&d&&Oc(s,p,this.anchor.offset,d,this.focus.offset)}if(n==="character"&&q(c)&&c.isUnmergeable()){if(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize()){let f=Ct(c,t?"previous":"next").getNodeAtCaret();if(q(f)){if(!o){let p=f.getTextContentSize();return t?this.focus.set(f.__key,p-1,"text"):this.focus.set(f.__key,1,"text"),void(this.dirty=!0)}{let p=r.getElementByKey(f.getKey()),h=p?rr(f,p,r):null;if(h){let m=t?h.length:0;Oc(s,h,m,h,m)}}}}}if(fC(s,e,t?"backward":"forward",n),s.rangeCount>0){let f=hi(s,r._rootElement),p=f||s.getRangeAt(0),h=this.anchor.getNode(),m=Ft(h)?h:Cg(h);if(this.applyDOMRange(p),this.dirty=!0,!o)gC(this,t,m),(f?s.direction!=="backward":s.anchorNode===p.startContainer&&s.anchorOffset===p.startOffset)||dC(this)}n==="lineboundary"&&Ac(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&P(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){let o=t.getParent(),r=t.getNextSibling()||(o===null?null:o.getNextSibling());if(P(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,e))return;let r=Dg(wr(n,e?"previous":"next"));if(r.getTextSlices().every((i)=>i===null||i.distance===0)){let i={type:"initial"};for(let l of r.iterNodeCarets("shadowRoot"))if(Gn(l))if(l.origin.isInline());else{if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(P(r.anchor.origin)&&r.anchor.origin.isEmpty()){let c=Mo(l);_a(this,Dr(c,c)),r.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}else{if(i.type==="merge-block")break;if(Rr(l)){if(P(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(r.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Ve(l.origin)){if(l.origin.isIsolated());else if(Wn(l.origin).length>0){if(P(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let c=bc();c.add(l.origin.getKey()),en(c)}}else if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&P(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let c=bc();c.add(l.origin.getKey()),en(c)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:c}=i;if(Wn(c).length>0)return;return l.origin.isEmpty()&&!c.isEmpty()&&l.origin.getParent()===c.getParent()?void l.origin.remove(!0):(_a(this,Dr(!l.origin.isEmpty()&&c.isEmpty()?Ts(Ct(c,l.direction)):r.anchor,l)),this.removeText())}for(let l=n.getNode();l!==null;){if(Vt(l)!==null)return;if(P(l)&&l.isShadowRoot())break;l=l.getParent()}}let s=this.focus;if(of(this,e,"character"),this.isCollapsed()){if(e&&n.offset===0&&D_(this,n.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(o=n.type==="text"?n.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,c=i.getTextContentSize();if(i.is(o)||e&&l!==c||!e&&l!==0)return void $_(i,e,l)}else if(o!==null&&o.isSegmented()){let l=n.offset,c=o.getTextContentSize();if(o.is(i)||e&&l!==0||!e&&l!==c)return void $_(o,e,l)}(function(l,c){let{anchor:u,focus:d}=l,f=u.getNode(),p=d.getNode();if(f===p&&u.type==="text"&&d.type==="text"){let h=u.offset,m=d.offset,_=h<m,x=_?h:m,C=_?m:h,y=C-1;if(x!==y)(function(N){return!(BC(N)||rR(N))})(f.getTextContent().slice(x,C))&&(c?d.set(d.key,y,d.type):u.set(u.key,y,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let n=this.anchor.getNode();n.isEmpty()&&Ft(n.getParent())&&n.getPreviousSibling()===null&&D_(this,n),lC()}}deleteLine(e){let t=Mf(this.anchor);if(t!==null&&Ve(zn(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);if(this.isCollapsed()&&of(this,e,"lineboundary"),this.isCollapsed())this.deleteCharacter(e);else yr(this.anchor.getNode(),pn)!==yr(this.focus.getNode(),pn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;of(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return br()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function fi(e){return e instanceof Lc}function cC(e,t){if(fi(e)){for(let C of e.getNodes())Tc(C)&&C.setFormat(t(C.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Lt(null);let n=[];for(let C of e.getNodes())q(C)?n.push(C):P(C)?C.setTextFormat(t(C.getTextFormat())):Tc(C)&&C.setFormat(t(C.getFormat()));let o=n.length;if(o===0)return e.setFormat(t(e.format)),void Lt(null);let{anchor:r,focus:s}=e,i=e.isBackward(),l=i?s:r,c=i?r:s,u=0,d=n[0],f=l.type==="element"?0:l.offset;if(l.type==="text"&&f===d.getTextContentSize()&&(u=1,d=n[1],f=0),d==null)return;let p=o-1,h=n[p],m=c.type==="text"?c.offset:h.getTextContentSize();if(d.is(h)){if(f===m)return;let C=t(d.getFormat());if(Hn(d)||f===0&&m===d.getTextContentSize())d.setFormat(C);else{let y=d.splitText(f,m),N=f===0?y[0]:y[1];N.setFormat(C),l.type==="text"&&l.set(N.__key,0,"text"),c.type==="text"&&c.set(N.__key,m-f,"text")}return void(e.format=C)}f===0||Hn(d)||([,d]=d.splitText(f),f=0);let _=t(d.getFormat());d.setFormat(_);let x=t(h.getFormat());m>0&&(m===h.getTextContentSize()||Hn(h)||([h]=h.splitText(m)),h.setFormat(x));for(let C=u+1;C<p;C++){let y=n[C];y.setFormat(t(y.getFormat()))}l.type==="text"&&l.set(d.__key,f,"text"),c.type==="text"&&c.set(h.__key,m,"text"),e.format=_|x}function oR(e,t){let n=[];for(let[o,r]of Object.entries(t))typeof r=="boolean"&&n.push([o,r]);n.length!==0&&cC(e,(o)=>{for(let[r,s]of n)o=vr(o,r,s?jt[r]:0);return o})}function uC(e,t,n=null){let o=n===null&&fe(e)?vr(e.format,t,null):n;cC(e,(r)=>vr(r,t,o))}function M_(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Rf(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[M_(n),M_(o)]}function D_(e,t){for(let n=t;n;n=n.getParent()){if(P(n)){if(n.collapseAtStart(e))return!0;if(vt(n))break}if(n.getPreviousSibling())break}return!1}function dC(e){let{focus:t,anchor:n}=e,{key:o,offset:r,type:s}=n;n.set(t.key,t.offset,t.type,!0),t.set(o,r,s,!0)}function fC(e,t,n,o){e.modify(t,n,o)}function gC(e,t,n){let o=e.getNodes(),r=o.filter((l)=>Ia(l,n));if(r.length===0||r.length===o.length)return!1;let s=t?r[0]:r[r.length-1],i=P(s)?s:s.getParentOrThrow();return t?i.selectStart():i.selectEnd(),!0}function of(e,t,n){if(Ac(e,"extend",t,n))return;let o=He(),r=Vn(xn(o));if(!r||typeof r.modify!="function")return;let{_blockCursorElement:s,_rootElement:i}=o,l=e.anchor,c=e.focus.getNode();i===null||s===null||!P(c)||c.isInline()||c.canBeEmpty()||$c(s,o,i);let u=(D)=>{let H=D.getNode(),k=o.getElementByKey(D.key);return k!==null&&D.type==="text"&&q(H)?rr(H,k,o):k},d=l.getNode(),f=u(l);if(f===null)return;let p=l.offset,h=e.isCollapsed(),m=e.focus,_=h?f:u(m);if(_===null)return;let x=m.offset;if(Oc(r,_,x,_,x),fC(r,"move",t?"backward":"forward",n),r.rangeCount===0)return;let C=hi(r,i)||r.getRangeAt(0),{startContainer:y,startOffset:N}=C;if(h&&n==="character"&&l.type==="text"&&q(d)&&d.isUnmergeable()){if(p===(t?0:d.getTextContentSize())){let D=Ct(d,t?"previous":"next").getNodeAtCaret();if(q(D)){let H=t?D.getTextContentSize()-1:1;return e.focus.set(D.__key,H,"text"),void(e.dirty=!0)}}}if(h&&n==="character"&&l.type==="text"){let D=t?0:d.getTextContentSize(),H=y===f?N:p!==D?D:-1;if(H>=0)return void(H!==p&&(e.focus.set(l.key,H,"text"),e.dirty=!0))}let[E,v,b,A]=t?[y,N,f,p]:[f,p,y,N],O=Ft(d)?d:Cg(d);e.applyDOMRange({collapsed:!1,endContainer:b,endOffset:A,startContainer:E,startOffset:v}),e.dirty=!0,!gC(e,t,O)&&t&&dC(e),n==="lineboundary"&&Ac(e,"extend",t,n,"decorators")}var rR=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("\uD83D\uDC4D"))return t}catch(e){}return()=>!1})();function $_(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,l=0;for(let u=0;u<s;u++){let d=u===s-1;if(l=i,i+=r[u].length,t&&i===n||i>n||d){r.splice(u,1),d&&(l=void 0);break}}let c=r.join("").trim();c===""?o.remove():(o.setTextContent(c),o.select(l,l))}function w_(e,t,n,o){let r,s=t,i=!1;if(_t(e)){let l=!1,c=e.childNodes,u=c.length,d=o._blockCursorElement;s===u&&u>0&&(l=!0,s=u-1),pi(e,o)!==void 0||La(e,o)||(i=!0);let f=c[s],p=!1;if(f===d)f=c[s+1],p=!0;else if(d!==null){let h=d.parentNode;if(e===h)t>Array.prototype.indexOf.call(h.children,d)&&s--}if(r=oi(f),q(r))s=po(r,l?"next":"previous");else{let h=oi(e);if(h===null)return null;if(P(h)){let m=o.getElementByKey(h.getKey());m===null&&U(214),[h,s]=On(h,m,o).resolveChildIndex(h,m,e,t),P(h)||U(215),l&&s>=h.getChildrenSize()&&(s=Math.max(0,h.getChildrenSize()-1));let x=h.getChildAtIndex(s);if(P(x)&&function(C,y,N){let E=C.getParent();return N===null||E===null||!E.canBeEmpty()||E!==N.getNode()}(x,0,n)){let C=l?x.getLastDescendant():x.getFirstDescendant();C===null?h=x:(x=C,h=P(x)?x:x.getParentOrThrow()),s=0}q(x)?(r=x,h=null,s=po(x,l?"next":"previous")):x!==h&&l&&!p&&(P(h)||U(216),s=Math.min(h.getChildrenSize(),s+1))}else{let m=zn(h),_=m!==null?m:h,x=_.getIndexWithinParent(),C=o.getElementByKey(h.getKey()),y="after";if(C!==null&&oi(e)===h){let N=On(h,C,o);N.element!==C?y=N.resolveLeafPosition(C,e,t):t===0&&Ve(h)&&(y="before")}s=y==="before"?x:x+1,h=_.getParentOrThrow()}if(P(h))return[ho(h.__key,s,"element"),i]}}else r=oi(e);return q(r)?[ho(r.__key,po(r,s,"clamp"),"text"),i]:null}function k_(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(t){if((n||!t)&&s===null&&P(i)&&i.isInline()){let l=i.getPreviousSibling();q(l)&&e.set(l.__key,l.getTextContent().length,"text")}}else P(s)&&!n&&s.isInline()?e.set(s.__key,s.getChildrenSize(),"element"):q(s)&&!r.isUnmergeable()&&e.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(t&&P(s)&&s.isInline())e.set(s.__key,0,"element");else if((n||t)&&s===null&&P(i)&&i.isInline()&&!i.canInsertTextAfter()&&i.getTextContentSize()>1){let l=i.getNextSibling();q(l)&&e.set(l.__key,0,"text")}}}function Mf(e){let t=ot(e.key);return t===null?null:gy(t)}function pC(e,t,n){let o=Mf(e),r=Mf(t);if(o===r||o!==null&&r!==null&&o.is(r))return!1;let s=n(o,r);if(o!==null)return P(o)?t.set(o.getKey(),s?o.getChildrenSize():0,"element"):t.set(o.getKey(),s?o.getTextContentSize():0,"text"),!0;let i=zn(r);if(i===null)return!1;let l=i.getParent();if(l===null)return!1;let c=i.getIndexWithinParent();return t.set(l.getKey(),s?c+1:c,"element"),!0}function hC(e){let t=pC(e.anchor,e.focus,(n,o)=>function(r,s,i,l){if(i!==null&&l!==null){let d=zn(i),f=zn(l);if(d!==null&&d.is(f)){for(let p of Hc(d).values()){if(p===i.getKey())return!0;if(p===l.getKey())return!1}return!0}return d===null||f===null||d.isBefore(f)}if(i!==null){let d=zn(i),f=ot(s.key);return d===null||f===null||!(!d.is(f)&&!d.isParentOf(f))||d.isBefore(f)}let c=zn(l),u=ot(r.key);return c!==null&&u!==null&&!c.is(u)&&!c.isParentOf(u)&&u.isBefore(c)}(e.anchor,e.focus,n,o));return t&&(e.dirty=!0),t}function mC(e,t,n,o,r,s){if(e===null||n===null||!Ya(r,e,n))return null;let i=w_(e,t,fe(s)?s.anchor:null,r);if(i===null)return null;let l=w_(n,o,fe(s)?s.focus:null,r);if(l===null)return null;let[c,u]=i,[d,f]=l;if(c.type==="element"&&d.type==="element"){let h=oi(e),m=oi(n);if(Ve(h)&&Ve(m))return null}let p=r._slotsUsed&&pC(c,d,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(h,m){if(h.type==="text"&&m.type==="text"){let _=h.isBefore(m),x=h.is(m);k_(h,_,x),k_(m,!_,x),x&&m.set(h.key,h.offset,h.type)}}(c,d),[c,d,u||f||p]}function _C(e){return P(e)&&!e.isInline()}function xC(e,t,n,o,r,s){let i=Io(),l=new Ss(ho(e,t,r),ho(n,o,s),0,"");return l.dirty=!0,i._selection=l,l}function CC(){let e=ho("root",0,"element"),t=ho("root",0,"element");return new Ss(e,t,0,"")}function bc(){return new Lc(new Set)}function sR(e,t){return Da(null,e,t,null)}function Da(e,t,n,o){let r=n._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,l=i==="selectionchange",c=!df&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),u,d,f,p;if(fe(e)&&!c)return e.clone();{if(t===null)return null;let E=jn(t,n._rootElement);if(u=E.anchorNode,d=E.focusNode,f=E.anchorOffset,p=E.focusOffset,(l||i===void 0)&&fe(e)&&!Ya(n,u,d))return e.clone()}let h=mC(u,f,d,p,n,e);if(h===null)return null;let[m,_,x]=h,C=0,y="";if(fe(e)){let E=e.anchor;if(m.key===E.key)C=e.format,y=e.style;else{let v=m.getNode();q(v)?(C=v.getFormat(),y=v.getStyle()):P(v)&&(C=v.getTextFormat(),y=v.getTextStyle())}}let N=new Ss(m,_,C,y);return x&&(N.dirty=!0),N}function Fe(){return Io()._selection}function Ns(){return He()._editorState._selection}function cs(e,t,n,o=1){let{anchor:r,focus:s}=e,i=r.getNode(),l=s.getNode();if(!t.is(i)&&!t.is(l))return;let c=t.__key;if(e.isCollapsed()){let u=r.offset;if(n<=u&&o>0||n<u&&o<0){let d=Math.max(0,u+o);r.set(c,d,"element"),s.set(c,d,"element"),I_(e)}}else{let u=e.isBackward(),d=u?s:r,f=d.getNode(),p=u?r:s,h=p.getNode();if(t.is(f)){let m=d.offset;(n<=m&&o>0||n<m&&o<0)&&d.set(c,Math.max(0,m+o),"element")}if(t.is(h)){let m=p.offset;(n<=m&&o>0||n<m&&o<0)&&p.set(c,Math.max(0,m+o),"element")}}I_(e)}function I_(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,s=t.getNode(),i=o.getNode();if(e.isCollapsed()){if(!P(s))return;let l=s.getChildrenSize(),c=n>=l,u=c?s.getChildAtIndex(l-1):s.getChildAtIndex(n);if(q(u)){let d=0;c&&(d=u.getTextContentSize()),t.set(u.__key,d,"text"),o.set(u.__key,d,"text")}return}if(P(s)){let l=s.getChildrenSize(),c=n>=l,u=c?s.getChildAtIndex(l-1):s.getChildAtIndex(n);if(q(u)){let d=0;c&&(d=u.getTextContentSize()),t.set(u.__key,d,"text")}}if(P(i)){let l=i.getChildrenSize(),c=r>=l,u=c?i.getChildAtIndex(l-1):i.getChildAtIndex(r);if(q(u)){let d=0;c&&(d=u.getTextContentSize()),o.set(u.__key,d,"text")}}}function vc(e,t,n,o,r){let s=null,i=0,l=null;o!==null?(s=o.__key,q(o)?(i=o.getTextContentSize(),l="text"):P(o)&&(i=o.getChildrenSize(),l="element")):r!==null&&(s=r.__key,q(r)?l="text":P(r)&&(l="element")),s!==null&&l!==null?e.set(s,i,l):(i=t.getIndexWithinParent(),i===-1&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function L_(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Oc(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch(s){}}function F_(e,t,n){let o=ci(e,t.getKey());if(P(t)){let r=On(t,o,e);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function yC(e,t,n,o,r,s){let i=s.getRootNode(),l=gi(i)||sr(i)?ui(i):null;if(r.has(Qx)&&l!==s||l!==null&&Kc(l,l))return;let c=jn(o,s),u;if(!fe(t))return void(e!==null&&Ya(n,c.anchorNode,c.focusNode)&&o.removeAllRanges());let{anchor:d,focus:f}=t,p=d.getNode(),h=f.getNode(),[m,_]=F_(n,p,d.offset),[x,C]=F_(n,h,f.offset),{format:y,style:N}=t,E=t.isCollapsed(),v=m,b=x,A=!1;if(d.type==="text"?(v=q(p)?rr(p,m,n):null,A=p.getFormat()!==y||p.getStyle()!==N):fe(e)&&e.anchor.type==="text"&&(A=!0),f.type==="text"&&(b=q(h)?rr(h,x,n):null),v!==null&&b!==null){if(E&&(e===null||A||fe(e)&&(e.format!==y||e.style!==N))&&function(O,D,H,k,J,V){O._inputState.collapsedSelectionFormat={format:D,key:J,offset:k,style:H,timeStamp:V}}(n,y,N,_,d.key,performance.now()),(o.type!=="Range"||!E)&&c.anchorOffset===_&&c.focusOffset===C&&c.anchorNode===v&&c.focusNode===b){if(l===null||!s.contains(l)){let O=l!==null?ds(l):null;O!==null&&O!==n||r.has(Nc)||s.focus({preventScroll:!0})}if(d.type!=="element")return}if(Oc(o,v,_,b,C),Do&&t.isCollapsed()&&s!==null&&!r.has(Nc)){let O=wc(s);if(O===null||!s.contains(O)){let D=ui(s.ownerDocument),H=D!==null?ds(D):null;H!==null&&H!==n||s.focus({preventScroll:!0})}}if(!r.has(eC)&&t.isCollapsed()&&s!==null&&s===wc(s)){let O=fe(t)&&t.anchor.type==="element"?v.childNodes[_]||null:(u===void 0&&(u=ZC(o,s)),u);if(O!==null){let D;if(mo(O)){let H=O.ownerDocument.createRange();H.selectNode(O),D=H.getBoundingClientRect()}else D=O.getBoundingClientRect();(function(H,k,J){let V=Uc(J),oe=xg(V);if(V===null||oe===null)return;let B=J.getBoundingClientRect();if(k.bottom<B.top)return;let{top:de,bottom:xe}=k,ve=0,te=0,ae=J;for(;ae!==null;){let ce=ae===V.body;if(ce){let Me=oe.visualViewport;if(Me){let ht=Me.offsetTop;ve=ht,te=ht+Me.height}else ve=0,te=xn(H).innerHeight;let gt=oe.getComputedStyle(V.documentElement),Jt=parseFloat(gt.scrollPaddingTop),ke=parseFloat(gt.scrollPaddingBottom);isFinite(Jt)&&(ve+=Jt),isFinite(ke)&&(te-=ke)}else{let Me=ae===J?B:ae.getBoundingClientRect();ve=Me.top,te=Me.bottom}let Re=0;if(de<ve?Re=-(ve-de):xe>te&&(Re=xe-te),Re!==0)if(ce)oe.scrollBy(0,Re);else{let Me=ae.scrollTop;ae.scrollTop+=Re;let gt=ae.scrollTop-Me;de-=gt,xe-=gt}if(ce)break;ae=Es(ae)}})(n,D,s)}}(function(O){O._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}function iR(e){let t=Fe()||Ns();t===null&&(t=vn().selectEnd()),t.insertNodes(e)}function SC(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
10
10
|
`||n===`\r
|
|
11
|
-
`?t.linebreak():n==="\t"?t.tab():n!==""&&t.text(n)}function ig(e){let t=[];return SC(e,{linebreak:()=>t.push(Pc()),tab:()=>t.push(iC()),text:(n)=>t.push(hn(n))}),t}function aR(){let e=Fe();return e===null?"":e.getTextContent()}function Df(e){let t=[];for(let n of e)wo(n)||(!P(n)&&!Ve(n)||n.isInline()?t.push(n):P(n)&&t.push(...Df(n.getChildren())));return t}function ua(e){let t=e;e.isCollapsed()||t.removeText();let n=Fe();fe(n)&&(t=n),fe(t)||U(161);let o=t.anchor,r=o.getNode(),s=o.offset;for(;!pn(r)&&Vt(r)===null;){let i=r;if([r,s]=lR(r,s),i.is(r))break}return s}function lR(e,t){let n=e.getParent();if(!n){let r=bn();return vn().append(r),r.select(),[vn(),0]}if(V(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let s=t===0?0:1;return[n,r[0].getIndexWithinParent()+s]}if(!P(e)||t===0)return[n,e.getIndexWithinParent()];let o=e.getChildAtIndex(t);if(o){let r=new Ss(ho(e.__key,t,"element"),ho(e.__key,t,"element"),0,""),s=e.insertNewAfter(r);s&&s.append(o,...o.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function P_(e){return wo(e)||jC(e)||V(e)||e.isParentRequired()}function rf(e){let t=bn(),n=null;for(let o=0;o<e.length;o++){let r=e[o];if(P_(r)){if(n===null){n=r.createParentElementNode(),t.append(n);let s=e[o+1];if(wo(r)&&(s===void 0||!P_(s)))continue}n.append(r)}else t.append(r),n=null}return t}function Ac(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[d,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(d.key,d.offset,d.type),!0}let s=$r(e.focus,n?"previous":"next"),i=o==="lineboundary",l=t==="move",c=s,u=r==="decorators-and-blocks";if(!Ny(c)){for(let d of c){u=!1;let{origin:f}=d;if(!Ve(f)||f.isIsolated()||(c=d,!i||!f.isInline()))break}if(u)for(let d of Dg(s).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Wn(d))d.origin.isInline()||(c=d);else{if(P(d.origin))continue;Ve(d.origin)&&!d.origin.isInline()&&(c=d)}break}}if(c===s)return!1;if(l&&!i&&Ve(c.origin)&&c.origin.isKeyboardSelectable()){let d=bc();return d.add(c.origin.getKey()),en(d),!0}return c=Mo(c),l&&Ba(e.anchor,c),Ba(e.focus,c),u||!i}var Ut=null,bt=null,mn=!1,sf=!1,dc=!1,af=new Set,fc=0,B_={characterData:!0,childList:!0,subtree:!0};function br(){return mn||Ut!==null&&Ut._readOnly}function zt(){mn&&U(13)}function NC(){fc>99&&U(14)}function Io(){return Ut===null&&U(195,TC()),Ut}function cR(e){Io()!==null&&bt===null&&(bt=e),bt!==e&&ix(378)}function He(){return bt===null&&U(337,TC()),bt}function EC(){He()._dirtyType=2}function TC(){let e=0,t=new Set,n=_s.version;if(typeof window<"u")for(let r of qC(document)){let s=Va(r);if(zc(s))e++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===n&&(i+=" (separately built, likely a bundler configuration issue)"),t.add(i)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function bC(){return bt}function K_(e,t,n){let o=t.__type,r=dg(e,o),s=n.get(o);s===void 0&&(s=Array.from(r.transforms),n.set(o,s));let i=s.length;for(let l=0;l<i&&(s[l](t),t.isAttached());l++);}function z_(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function vC(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function uR(e){return Rc(e,He()._nodes)}function Rc(e,t){let n=e.type,o=t.get(n);o===void 0&&U(17,n);let r=o.klass;e.type!==r.getType()&&U(18,r.name);let s=r.importJSON(e),i=e.children;if(P(s)&&Array.isArray(i))for(let c=0;c<i.length;c++){let u=Rc(i[c],t);s.append(u)}let l=e.$slots;if(l){Ro(s)||U(379,r.name);for(let c in l)Og(s,c,Rc(l[c],t))}return s}function U_(e,t,n){let o=Ut,r=mn,s=bt;Ut=t,mn=!0,bt=e;try{return n()}finally{Ut=o,mn=r,bt=s}}function Nr(e,t){let n=dc;dc=!0;try{(function(o,r){let{_pendingEditorState:s,_rootElement:i}=o,l=o._headless||i===null;if(s===null)return void(!o._updating&&o._deferred.length>0&&H_(o,o._deferred));let c=o._editorState,u=c._selection,d=s._selection,f=o._dirtyType!==0,p=Ut,h=mn,m=bt,{_updating:_,_observer:x}=o,C=null;if(o._pendingEditorState=null,o._editorState=s,!l&&f&&x!==null){bt=o,Ut=s,mn=!1,o._updating=!0;try{let{_dirtyType:O,_dirtyElements:D,_dirtyLeaves:H}=o;x.disconnect(),C=bA(c,s,o,O,D,H)}catch(O){if(O instanceof Error&&o._onError(O),sf)throw O;return $C(o,null,i,s),px(o),o._dirtyType=2,sf=!0,Nr(o,c),void(sf=!1)}finally{x.observe(i,B_),o._updating=_,Ut=p,mn=h,bt=m}}s._readOnly||(s._readOnly=!0);let{_dirtyLeaves:y,_dirtyElements:N,_normalizedNodes:E,_updateTags:v}=o;f&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set),o._updateTags=new Set,function(O,D){let H=O._decorators,k=O._pendingDecorators||H,q=D._nodeMap,j;for(j in k)q.has(j)||(k===H&&(k=PC(O)),delete k[j])}(o,s);let b=l?null:Yn(xn(o));if(o._editable&&b!==null&&(f||d===null||d.dirty||!d.is(u))&&i!==null&&!v.has(tC)){bt=o,Ut=s;try{if(x!==null&&x.disconnect(),f||d===null||d.dirty){let O=o._blockCursorElement;O!==null&&$c(O,o,i),yC(u,d,o,b,v,i)}(function(O,D,H){let k=O._blockCursorElement;if(fe(H)&&H.isCollapsed()&&H.anchor.type==="element"&&D.contains(wc(D))){let q=H.anchor,j=q.getNode(),oe=q.offset,B=!1,de=null;if(oe===j.getChildrenSize())gc(j.getChildAtIndex(oe-1))&&(B=!0);else{let xe=j.getChildAtIndex(oe);if(xe!==null&&gc(xe)){let ve=xe.getPreviousSibling();(ve===null||gc(ve))&&(B=!0,de=O.getElementByKey(xe.__key))}}if(B){let xe=On(j,O.getElementByKey(j.__key),O).element;return k===null&&(O._blockCursorElement=k=function(ve){let te=ve.theme,ae=_n().createElement("div");ae.contentEditable="false",ae.setAttribute("data-lexical-cursor","true");let ce=te.blockCursor;if(ce!==void 0){if(typeof ce=="string"){let Re=Qa(ce);ce=te.blockCursor=Re}ce!==void 0&&ae.classList.add(...ce)}return ae}(O._config)),D.style.caretColor="transparent",void(de===null?xe.appendChild(k):xe.insertBefore(k,de))}}k!==null&&$c(k,O,D)})(o,i,d)}finally{x!==null&&x.observe(i,B_),bt=m,Ut=p}}C!==null&&function(O,D,H,k,q){let j=Array.from(O._listeners.mutation),oe=j.length;for(let B=0;B<oe;B++){let[de,xe]=j[B];for(let ve of xe){let te=D.get(ve);te!==void 0&&de(te,{dirtyLeaves:k,prevEditorState:q,updateTags:H})}}}(o,C,v,y,c),fe(d)||d===null||u!==null&&u.is(d)||o.dispatchCommand(Gf);let A=o._pendingDecorators;if(A!==null&&(o._decorators=A,o._pendingDecorators=null,ma("decorator",o,!0,A)),function(O,D,H){let k=j_(D),q=j_(H);k!==q&&ma("textcontent",O,!0,q)}(o,r||c,s),ma("update",o,!0,{dirtyElements:N,dirtyLeaves:y,editorState:s,mutatedNodes:C,normalizedNodes:E,prevEditorState:r||c,tags:v}),!_)H_(o,o._deferred);(function(O){let D=O._updates;if(D.length===0)return void(O._cascadeCount=0);if(function(k){if(af.has(k))return;af.add(k),setTimeout(()=>{af.delete(k),k._cascadeCount=0},0)}(O),O._cascadeCount++>99)return O._updates=[],O._cascadeCount=0,void O._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${O._config.namespace}`));let H=D.shift();if(H){let[k,q]=H;$a(O,k,q)}})(o)})(e,t)}finally{dc=n}}function ma(e,t,n,...o){let r=t._updating;t._updating=n;try{let s=t._listeners[e],i=Array.from(s);for(let[l,c]of i){c&&c();let u=l(...o);s.has(l)?s.set(l,u):u&&u()}}finally{t._updating=r}}function OC(e,t,n,o){let r=pg(e),s;if(!dc)for(let i=0;i<r.length;i++)r[i]._updating||(r[i]._cascadeCount=0);for(let i=4;i>=0;i--)for(let l=0;l<r.length;l++){let c=r[l];if(l>0&&c._updating){s=c;break}let u=c._commands.get(t);if(u!==void 0){let d=u[i];if(d.size>0){let f=!1;if(zn(c,()=>{for(let p of d)if(p(n,o))return void(f=!0)}),f)return f}}}return s&&s.update(()=>{OC(s,t,n,o)}),!1}function H_(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let o=0;o<t.length;o++)t[o]()}finally{e._updating=n}}}function W_(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[s,i]=r,l=e._pendingEditorState,c;i!==void 0&&(c=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(l===null&&U(191),l._flushSync=!0),c&&e._deferred.push(c),vC(e,i.tag)),l==null?$a(e,s,i):s()}}return o}function $a(e,t,n){let o=e._updateTags,r,s=!1,i=!1;n!==void 0&&(r=n.onUpdate,vC(e,n.tag),s=n.skipTransforms||!1,i=n.discrete||!1),r&&e._deferred.push(r);let{_editorState:l,_pendingEditorState:c}=e,u=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=AC(c||l),u=!0),c._flushSync=i;let d=Ut,f=mn,p=bt,h=e._updating;Ut=c,mn=!1,e._updating=!0,bt=e;let m=e._headless||e.getRootElement()===null;cg(null);try{u&&(m?l._selection!==null&&(c._selection=l._selection.clone()):c._selection=function(y,N){let E=y.getEditorState()._selection,v=Yn(xn(y));return fe(E)||E==null?Da(E,v,y,N):E.clone()}(e,n&&n.event||null));let x=e._compositionKey;t(),s=W_(e,s),function(y,N){let E=N.getEditorState()._selection,v=y._selection;if(fe(v)){let{anchor:b,focus:A}=v,O;if(b.type==="text"&&(O=b.getNode(),O.selectionTransform(E,v)),A.type==="text"){let D=A.getNode();O!==D&&D.selectionTransform(E,v)}}}(c,e),e._dirtyType!==0&&(s?function(y,N){let E=N._dirtyLeaves,v=y._nodeMap;for(let b of E){let A=v.get(b);V(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&c_(A)}}(c,e):function(y,N){let{_dirtyLeaves:E,_dirtyElements:v}=N,b=y._nodeMap,A=Ao(),O=new Map,D=E,H=D.size,k=v,q=k.size;for(;H>0||q>0;){if(H>0){N._dirtyLeaves=new Set;for(let j of D){let oe=b.get(j);V(oe)&&oe.isAttached()&&oe.isSimpleText()&&!oe.isUnmergeable()&&c_(oe),oe!==void 0&&z_(oe,A)&&K_(N,oe,O),E.add(j)}if(D=N._dirtyLeaves,H=D.size,H>0){fc++;continue}}N._dirtyLeaves=new Set,N._dirtyElements=new Map,k.delete("root")&&k.set("root",!0);for(let j of k){let oe=j[0],B=j[1];if(v.set(oe,B),!B)continue;let de=b.get(oe);de!==void 0&&z_(de,A)&&K_(N,de,O)}D=N._dirtyLeaves,H=D.size,k=N._dirtyElements,q=k.size,fc++}N._dirtyLeaves=E,N._dirtyElements=v}(c,e),W_(e),function(y,N,E,v){let b=y._nodeMap,A=N._nodeMap,O=[];for(let[k]of v){let q=A.get(k);q!==void 0&&(q.isAttached()||(P(q)&&hc(q,k,b,A,O,v),b.has(k)||v.delete(k),O.push(k)))}for(let k of E){let q=A.get(k);q===void 0||q.isAttached()||(Ro(q)&&q.__slots!==null&&hc(q,k,b,A,O,E),b.has(k)||E.delete(k),O.push(k))}for(let k of O)A.delete(k);let D=He(),H=D._compositionKey;H===null||A.has(H)||(D._compositionKey=null)}(l,c,e._dirtyLeaves,e._dirtyElements)),x!==e._compositionKey&&(c._flushSync=!0);let C=c._selection;if(fe(C)){e._slotsUsed&&hC(C);let y=c._nodeMap,N=C.anchor.key,E=C.focus.key;y.get(N)!==void 0&&y.get(E)!==void 0||U(19)}else fi(C)&&C._nodes.size===0&&(c._selection=null)}catch(x){return x instanceof Error&&e._onError(x),e._pendingEditorState=l,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Nr(e)}finally{Ut=d,mn=f,bt=p,e._updating=h,fc=0}e._dirtyType!==0||e._deferred.length>0||function(x,C){let y=C.getEditorState()._selection,N=x._selection;if(N!==null){if(N.dirty||!N.is(y))return!0}else if(y!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Nr(e)):u&&AR(()=>{Nr(e)}):(c._flushSync=!1,u&&(o.clear(),e._deferred=[],e._pendingEditorState=null))}function zn(e,t,n){bt===e&&n===void 0?br()?$a(e,t,n):t():$a(e,t,n)}function dR(e){if(vt(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class $o extends rn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:dR,extends:rn})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&U(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return cA[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Hn(this).length===0}isDirty(){let e=He()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let n of Hn(this)){let o=Ar(this,n);P(o)&&e.push(...o.getAllTextNodes())}let t=this.getFirstChild();for(;t!==null;){if(V(t)&&e.push(t),P(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;P(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;P(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let r=t[n-1];return P(r)&&r.getLastDescendant()||r||null}let o=t[e];return P(o)&&o.getFirstDescendant()||o||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:ot(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&U(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:ot(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&U(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,o;if(e<t/2){for(n=this.getFirstChild(),o=0;n!==null&&o<=e;){if(o===e)return n;n=n.getNextSibling(),o++}return null}for(n=this.getLastChild(),o=t-1;n!==null&&o>=e;){if(o===e)return n;n=n.getPreviousSibling(),o--}return null}getTextContent(){let e=hy(this),t=this.getChildren(),n=t.length;for(let o=0;o<n;o++){let r=t[o];e+=r.getTextContent(),P(r)&&o!==n-1&&!r.isInline()&&(e+=us)}return e}getTextContentSize(){let e=function(o){let r=0;for(let s of Hn(o)){let i=Ar(o,s);i!==null&&(r+=i.getTextContentSize())}return r}(this),t=this.getChildren(),n=t.length;for(let o=0;o<n;o++){let r=t[o];e+=r.getTextContentSize(),P(r)&&o!==n-1&&!r.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let t=pc[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=jt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return vr(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){zt();let n=Fe(),o=e,r=t,s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let l=this.getFirstChild();if(V(l)||P(l))return l.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){let l=this.getLastChild();if(V(l)||P(l))return l.select()}}o===void 0&&(o=s),r===void 0&&(r=s);let i=this.__key;return fe(n)?(n.anchor.set(i,o,"element"),n.focus.set(i,r,"element"),n.dirty=!0,n):xC(i,o,i,r,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((t)=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""&&pc[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Sc(this)&&U(324,this.__key,this.__type);let o=this.getChildrenSize(),r=this.getWritable();e+t<=o||U(226,String(e),String(t),String(o));for(let p of n);let s=r.__key,i=[],l=[],c=this.getChildAtIndex(e+t),u=null,d=o-t+n.length;if(e!==0)if(e===o)u=this.getLastChild();else{let p=this.getChildAtIndex(e);p!==null&&(u=p.getPreviousSibling())}if(t>0){let p=u===null?this.getFirstChild():u.getNextSibling();for(let h=0;h<t;h++){p===null&&U(100);let m=p.getNextSibling(),_=p.__key;Bn(p.getWritable()),l.push(_),p=m}}let f=u;for(let p of n){f!==null&&p.is(f)&&(u=f=f.getPreviousSibling());let h=p.getWritable();h.__parent===s&&d--,Bn(h);let m=p.__key;if(f===null)r.__first=m,h.__prev=null;else{let _=f.getWritable();_.__next=m,h.__prev=_.__key}p.__key===s&&U(76),h.__parent=s,i.push(m),f=p}if(e+t===o){if(f!==null)f.getWritable().__next=null,r.__last=f.__key}else if(c!==null){let p=c.getWritable();if(f!==null){let h=f.getWritable();p.__prev=f.__key,h.__next=c.__key}else p.__prev=null}if(r.__size=d,l.length){let p=Fe();if(fe(p)){let h=new Set(l),m=new Set(i),{anchor:_,focus:x}=p;G_(_,h,m)&&vc(_,_.getNode(),this,u,c),G_(x,h,m)&&vc(x,x.getNode(),this,u,c),d!==0||this.canBeEmpty()||vt(this)||this.remove()}}return r}getDOMSlot(e){return new si(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(_t(t)){let n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px",t.setAttribute("data-lexical-indent",String(n)));let o=this.getDirection();o&&(t.dir=o)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===""||vt(this)||this.getChildren().some(V)||(t!==0&&(e.textFormat=t),n!==""&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=On(this,e,t),o=n.getFirstChild();for(let r=this.getFirstChild();r;r=r.getNextSibling()){let s=t.getElementByKey(r.getKey());s!==null&&(o==null?(n.insertChild(s),o=s):o!==s&&n.replaceChild(s,o),o=o.nextSibling)}}}function P(e){return e instanceof $o}function G_(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}class Fc extends rn{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&U(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ve(e){return e instanceof Fc}class Ha extends $o{__cachedText;$config(){return this.config("root",{extends:$o})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){U(51)}getTextContent(){let e=this.__cachedText;return e===null||!br()&&He()._dirtyType!==0?super.getTextContent():e}remove(){U(52)}replace(e){U(53)}insertBefore(e){U(54)}insertAfter(e){U(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let o of n)P(o)||Ve(o)||U(282);return super.splice(e,t,n)}static importJSON(e){return vn().updateFromJSON(e)}collapseAtStart(){return!0}}function Ft(e){return e instanceof Ha}function AC(e){return new Wa(dx(e._nodeMap),null,e._slotsUsed)}function ag(){return new Wa(new Map([["root",new Ha]]),null,!1)}function $f(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&U(130,n.name),P(e)){let r=t.children;Array.isArray(r)||U(59,n.name);let s=e.getChildren();for(let i=0;i<s.length;i++){let l=$f(s[i]);r.push(l)}}let o=Hn(e);if(o.length>0){let r={};for(let s of o){let i=Ar(e,s);i===null&&U(366,n.name,s),r[s]=$f(i)}t.$slots=r}return t}function fR(e){return e instanceof Wa}class Wa{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return U_(t&&t.editor||null,this,e)}clone(e){let t=new Wa(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return t._readOnly=!0,t}toJSON(){return U_(null,this,()=>({root:$f(vn())}))}}class lg extends $o{$config(){return this.config("artificial",{extends:$o})}createDOM(e){return _n().createElement("div")}}class Ga extends rn{$config(){return this.config("linebreak",{importDOM:{br:(e)=>RC(e)||MC(e)?null:{conversion:gR,priority:0}}})}getTextContent(){return`
|
|
12
|
-
`}createDOM(){return _n().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function gR(e){return{node:Pc()}}function Pc(){return Xa(new Ga)}function wo(e){return e instanceof Ga}function RC(e){let t=e.parentElement;if(t!==null&&Eg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Mc(n)){let o=t.lastChild;if(o===e||o.previousSibling===e&&Mc(o))return!0}}return!1}function MC(e){let t=e.parentElement;if(t!==null&&Eg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Mc(n))return!1;let o=t.lastChild;if(o===e||o.previousSibling===e&&Mc(o))return!0}return!1}function Mc(e){return mo(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class ja extends $o{$config(){return this.config("paragraph",{extends:$o,importDOM:{p:()=>({conversion:pR,priority:0})}})}createDOM(e){let t=_n().createElement("p"),n=li(e.theme,"paragraph");if(n!==void 0)t.classList.add(...n);return t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(_t(t)){this.isEmpty()&&t.append(_n().createElement("br"));let n=this.getFormatType();n&&(t.style.textAlign=n)}return{element:t}}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(V);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=bn();n.setTextFormat(e.format),n.setTextStyle(e.style);let o=this.getDirection();return n.setDirection(o),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||V(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function pR(e){let t=bn();if(ay(t,e),sy(e,t),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in pc&&t.setFormat(n)}return iy(t,e),{node:t}}function bn(){return Xa(new ja)}function DC(e){return e instanceof ja}function hR(e){console.warn(e)}var ti=0,mR=1,_R=2,xR=3,CR=4,yR=-8,SR=-7,NR=-6,ER=-5,TR=-4;function $C(e,t,n,o,r){let s=e._keyToDOMMap;s.clear(),e._editorState=ag(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,r&&r.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent="",function(l,c){let u=`__lexicalKey_${c._key}`;delete l[u]}(t,e)),n!==null&&(n.textContent="",s.set("root",n),FC(n,e,"root"))}function wC(e){let t=new Set,n=new Set;for(let{klass:o,ownNodeConfig:r}of Ja(e)){let s=o.transform;if(!n.has(s)){n.add(s);let i=o.transform();i&&t.add(i)}if(r){let i=r.$transform;i&&t.add(i)}}return t}var wa={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,o)=>{},$exportDOM:(e,t)=>{let n=Bc(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,o,r)=>P(e)&&e.extractWithChild(t,n,o),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,o)=>null,$shouldExclude:(e,t,n)=>P(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,o)=>e.updateDOM(t,n,o._config)};function bR(e){let t=e||{},n=bC(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,s=t.disableEvents||!1,i=ag(),l=t.namespace||(r!==null?r._config.namespace:KC()),c=t.editorState,u=[Ha,ms,Ga,Ua,ja,lg,...t.nodes||[]],{onError:d,onWarn:f,html:p}=t,h=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let x=0;x<u.length;x++){let C=u[x],y=null,N=null;if(C&&typeof C=="object"){let b=C;C=b.replace,y=b.with,N=b.withKlass||null}if(typeof C!="function"||!C.prototype||!(C===rn||C.prototype instanceof rn)){let b="<unknown>";try{b=JSON.parse(ux)}catch(A){}U(365,String(x-u.length+(t.nodes?t.nodes.length:0)),typeof C=="function"?`${C.name}${typeof C.getType=="function"?` (type ${String(C.getType())})`:""}`:String(C),String(b))}qa(C);let E=C.getType(),v=wC(C);m.set(E,{exportDOM:p&&p.export?p.export.get(C):void 0,klass:C,replace:y,replaceWithKlass:N,sharedNodeState:mx(u[x]),transforms:v})}}let _=new _s(i,r,m,{disableEvents:s,dom:{...wa,...e&&e.dom},namespace:l,theme:o},d||console.error,f||hR,function(x,C){let y=new Map,N=new Set,E=(v)=>{Object.keys(v).forEach((b)=>{let A=y.get(b);A===void 0&&(A=[],y.set(b,A)),A.push(v[b])})};return x.forEach((v)=>{let b=v.klass.importDOM;if(b==null||N.has(b))return;N.add(b);let A=b.call(v.klass);A!==null&&E(A)}),C&&E(C),y}(m,p?p.import:void 0),h,e);return c!==void 0&&(_._pendingEditorState=c,_._dirtyType=2),function(x){x.registerCommand(jf,PA,ti),x.registerCommand(Yf,BA,ti),x.registerCommand(Vf,KA,ti),x.registerCommand(Xf,zA,ti),x.registerCommand(Qf,UA,ti)}(_),_}function vR(e,t){let n=e.get(t);e.delete(t),n&&n()}function da(e,t,n){return e.set(t,n),vR.bind(null,e,t)}class _s{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,o,r,s,i,l,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Sa,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=o,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=KC(),this._onError=r,this._onWarn=s,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return da(this._listeners.update,e)}registerEditableListener(e){return da(this._listeners.editable,e)}registerDecoratorListener(e){return da(this._listeners.decorator,e)}registerTextContentListener(e){return da(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Lg(da(t,e,e(this._rootElement,null)||void 0),()=>function(n,o,r){let s=n.get(o);s&&s(),n.set(o,o(...r)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&U(35);let o=this._commands;o.has(e)||o.set(e,[new ei,new ei,new ei,new ei,new ei]);let r=o.get(e);r===void 0&&U(36,String(e));let s=function(l){return 7&l}(n),i=r[s];return s!==n?i.addFront(t):i.addBack(t),()=>{i.delete(t),r.every((l)=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,n){let o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,r=this._listeners.mutation,s=r.get(t);s===void 0&&(s=new Set,r.set(t,s)),s.add(o);let i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,o),()=>{s.delete(o),s.size===0&&r.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&U(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,o=kf(n).get(t.getType());if(!o)return;let r=new Map;for(let s of o.keys())r.set(s,"created");r.size>0&&e(r,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),o=[n],r=n.replaceWithKlass;if(r!=null){let s=this.registerNodeTransformToKlass(r,t);o.push(s)}return function(s,i){let l=kf(s.getEditorState()),c=[];for(let u of i){let d=l.get(u);d&&c.push(d)}if(c.length===0)return;s.update(()=>{for(let u of c)for(let d of u.keys()){let f=ot(d);f&&f.markDirty()}},s._pendingEditorState===null?{tag:uc}:void 0)}(this,o.map((s)=>s.klass.getType())),()=>{o.forEach((s)=>s.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return re(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=li(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,$C(this,t,e,o,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||HA(t),n!=null&&t.classList.remove(...n)),e!==null){let r=xg(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=2,px(this),this._updateTags.add(uc),Nr(this),this._config.disableEvents||function(i,l){let c=i.ownerDocument;Tf.set(i,c);let u=Cc.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},Cc.set(c,u)),u.editors.add(l),u.hasShadowEditor=void 0,i.__lexicalEditor=l;let d=Jx(i);d.push(FA.register(c));for(let f=0;f<Ef.length;f++){let[p,h]=Ef[f],m=typeof h=="function"?(_)=>{S_(_)||(bf(_),(l.isEditable()||p==="click")&&h(_,l))}:(_)=>{if(S_(_))return;bf(_);let x=l.isEditable();switch(p){case"cut":return x&&re(l,tg,_);case"copy":return re(l,eg,_);case"paste":return x&&re(l,qf,_);case"dragstart":return x&&re(l,Bx,_);case"dragover":return x&&re(l,Kx,_);case"dragend":return x&&re(l,zx,_);case"focus":return x&&re(l,Hx,_);case"blur":return x&&re(l,Wx,_);case"drop":return x&&re(l,Px,_)}};d.push(ng(i,p,m))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(uc),Nr(this);ma("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&U(38);let n=e;n._readOnly&&(n=AC(e),n._selection=e._selection?e._selection.clone():null),gx(this);let o=this._pendingEditorState,r=t!==void 0?t.tag:null;o===null||o.isEmpty()||(r!=null&&this._updateTags.add(r),Nr(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,zn(this,()=>{if(r&&this._updateTags.add(r),e._parsed)for(let[s,i]of n._nodeMap.entries())P(i)?this._dirtyElements.set(s,!0):this._dirtyLeaves.add(s)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(n,o,r){let s=ag(),i=Ut,l=mn,c=bt,{_dirtyElements:u,_dirtyLeaves:d,_cloneNotNeeded:f,_dirtyType:p}=o;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Ut=s,mn=!1,bt=o,cg(null);try{let h=o._nodes;Rc(n.root,h),r&&r(),s._readOnly=!0,s._parsed=!0}catch(h){h instanceof Error&&o._onError(h)}finally{o._dirtyElements=u,o._dirtyLeaves=d,o._cloneNotNeeded=f,o._dirtyType=p,Ut=i,mn=l,bt=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?["force-commit",e[0]]:e;return t==="force-commit"&&Nr(this),(t==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(n,o,r){n._updating?n._updates.push([o,r]):$a(n,o,r)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),zn(this,()=>{let o=Fe(),r=vn();o!==null?o.dirty||en(o.clone()):r.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?r.selectStart():r.selectEnd()),xs("focus"),GC(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Yn(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ma("editable",this,!0,e),this._slotsUsed&&this.update(()=>EC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=ux;var wf=null;function cg(e){wf=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),kC=1;function OR(){kC=1}function dg(e,t){let n=Bc(e,t);return n===void 0&&U(30,t),n}function Bc(e,t){return e._nodes.get(t)}var AR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function Kc(e,t){let n=t!==void 0?t:(()=>{let s=e.getRootNode();return gi(s)||rr(s)?ui(s):null})();if(!_t(n))return!1;if(n.hasAttribute("data-lexical-slot"))return!1;let o=gg(n),r=n.nodeName;return og(o)&&(r==="INPUT"||r==="TEXTAREA"||n.contentEditable==="true"&&Va(n)==null)}var RR=Kc;function Ya(e,t,n){let o=e.getRootElement();if(!o)return!1;try{if(!t||!o.contains(t)||!o.contains(n))return!1}catch(r){return!1}return ds(t)===e&&e.read("latest",()=>!Kc(t))}function zc(e){return e instanceof _s}function ds(e){let t=e;for(;t!=null;){let n=Va(t);if(zc(n))return n;t=Es(t)}return null}function Va(e){return e?e.__lexicalEditor:null}function MR(e){return iA.test(e)?"rtl":aA.test(e)?"ltr":null}function ka(e){return sg(e)||e.isToken()}function Un(e){return ka(e)||e.isSegmented()}function mo(e){return mi(e)&&e.nodeType===3}function gi(e){return mi(e)&&e.nodeType===9}function IC(e){let t=e;for(;t!=null;){if(mo(t))return t;t=t.firstChild}return null}function vr(e,t,n){let o=jt[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~jt.superscript:t==="superscript"?r&=~jt.subscript:t==="lowercase"?(r&=~jt.uppercase,r&=~jt.capitalize):t==="uppercase"?(r&=~jt.lowercase,r&=~jt.capitalize):t==="capitalize"&&(r&=~jt.lowercase,r&=~jt.uppercase),r}function DR(e){return V(e)||wo(e)||Ve(e)}function LC(e,t){let n=function(){let i=wf;return wf=null,i}();if((t=t||n&&n.__key)!=null)return void(e.__key=t);zt(),NC();let o=He(),r=Io(),s=""+kC++;r._nodeMap.set(s,e),P(e)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.add(s),o._dirtyType===0&&(o._dirtyType=1),e.__key=s}function Bn(e){Vt(e)!==null&&U(380,e.__key,String(Vt(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),s=e.getNextSibling(),i=s!==null?s.__key:null,l=r!==null?r.__key:null,c=r!==null?r.getWritable():null,u=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=l),c!==null&&(c.__next=i),u!==null&&(u.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}var $R=Bn;function Dc(e){NC(),Sc(e)&&U(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent!==null?t.__parent:Or(t)?t.__slotHost:null,o=Io(),r=He(),s=o._nodeMap,i=r._dirtyElements;n!==null&&function(c,u,d){let f=c;for(;f!==null;){if(d.has(f))return;let p=u.get(f);if(p===void 0)break;d.set(f,!1),f=p.__parent!==null?p.__parent:Or(p)?p.__slotHost:null}}(n,s,i);let l=t.__key;r._dirtyType===0&&(r._dirtyType=1),P(e)?i.set(l,!0):r._dirtyLeaves.add(l)}function Lt(e){zt();let t=He(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=ot(n);o!==null&&o.getWritable()}if(e!==null){let o=ot(e);o!==null&&o.getWritable()}}}function Ao(){if(br())return null;return He()._compositionKey}function ot(e,t){let n=(t||Io())._nodeMap.get(e);return n===void 0?null:n}function fg(e,t){let n=pi(e,He());return n!==void 0?ot(n,t):null}function FC(e,t,n){e[`__lexicalKey_${t._key}`]=n}function pi(e,t){return e[`__lexicalKey_${t._key}`]}function gg(e,t){let n=e;for(;n!=null;){let o=fg(n,t);if(o!==null)return o;n=Es(n)}return null}function PC(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function j_(e){return e.read(()=>vn().getTextContent())}function vn(){return Io()._nodeMap.get("root")}function en(e){zt();let t=Io();e!==null&&(e.dirty=!0,e.setCachedNodes(null),fe(e)&&He()._slotsUsed&&hC(e)),t._selection=e}function Y_(){zt(),gx(He())}function oi(e){let t=function(n,o){let r=n;for(;r!=null;){let s=pi(r,o);if(s!==void 0)return s;r=Es(r)}return null}(e,He());return t===null?null:ot(t)}function BC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pg(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function KC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function zC(e){return mo(e)?e.nodeValue:null}function hg(e,t,n){let o=Yn(xn(t));if(o===null)return;let r=Gn(o,t._rootElement),s=r.anchorNode,{anchorOffset:i,focusOffset:l}=r;if(s!==null){let c=zC(s),u=gg(s);if(c!==null&&V(u)){if((c===ya||c===zf)&&n){let d=n.length;c=n,i=d,l=d}c!==null&&mg(u,c,i,l,e)}}}function mg(e,t,n,o,r){let s=e;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing();if(s.isToken()&&i)return;let l=t;if((i||r)&&(t.endsWith(ya)&&(l=t.slice(0,-ya.length)),r)){let u=zf,d;for(;(d=l.indexOf(u))!==-1;)l=l.slice(0,d)+l.slice(d+u.length),n!==null&&n>d&&(n=Math.max(d,n-u.length)),o!==null&&o>d&&(o=Math.max(d,o-u.length))}let c=s.getTextContent();if(r||l!==c){let u=Fe();if(l===""){if(Lt(null),Ka||fs||za)s.remove();else{let _=He();lf(s,"",u),setTimeout(()=>{_.update(()=>{s.isAttached()&&s.getTextContent()===""&&s.remove()})},20)}return}let d=s.getParent(),f=Ns(),p=s.getTextContentSize(),h=Ao(),m=s.getKey();if(s.isToken()&&!i||h!==null&&m===h&&!i||fe(f)&&(d!==null&&!d.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===e.__key&&f.anchor.offset===0&&!s.canInsertTextBefore()&&!i||f.focus.key===e.__key&&f.focus.offset===p&&!s.canInsertTextAfter()&&!i))return void s.markDirty();if(!fe(u)||n===null||o===null)return void lf(s,l,u);if(u.setTextNodeRange(s,n,s,o),s.isSegmented()){let _=hn(s.getTextContent());s.replace(_),s=_}lf(s,l,u)}}}function lf(e,t,n){if(e.setTextContent(t),fe(n)){let o=e.getKey(),r=!1;for(let s of["anchor","focus"]){let i=n[s];i.type==="text"&&i.key===o&&(i.offset=po(e,i.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function sc(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function UC(e,t){return sc(e,t,"altKey")&&sc(e,t,"ctrlKey")&&sc(e,t,"shiftKey")&&sc(e,t,"metaKey")}function Ze(e,t,n){if(!UC(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1)return!1;if(e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;let o="Key"+t.toUpperCase();return e.code===o}var er={ctrlKey:!Ln,metaKey:Ln},V_={altKey:Ln,ctrlKey:!Ln};function X_(e){return e.key==="Backspace"}function wR(e){let t=vn();if(fe(e)){let{anchor:n,focus:o}=e,r=n.getNode();if(Ft(r))return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),ni(e),e;let s=r.getTopLevelElementOrThrow(),i=s.getParent();if(i===null)return P(s)&&(n.set(s.getKey(),0,"element"),o.set(s.getKey(),s.getChildrenSize(),"element"),ni(e)),e;let l=i;return n.set(l.getKey(),0,"element"),o.set(l.getKey(),l.getChildrenSize(),"element"),ni(e),e}{let n=t.select(0,t.getChildrenSize());return en(ni(n)),n}}function li(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let s=Qa(r);return n[t]=s,s}return r}function _g(e,t,n,o,r){if(n.size===0)return;let{__type:s,__key:i}=o,l=t.get(s);l===void 0&&U(33,s);let c=l.klass,u=e.get(c);u===void 0&&(u=new Map,e.set(c,u));let d=u.get(i),f=d==="destroyed"&&r==="created";(d===void 0||f)&&u.set(i,f?"updated":r)}function kR(e){let t=e.getType(),n=Io();if(n._readOnly){let s=kf(n).get(t);return s?Array.from(s.values()):[]}let o=n._nodeMap,r=[];for(let[,s]of o)s instanceof e&&s.__type===t&&s.isAttached()&&r.push(s);return r}function q_(e,t,n){let o=e.getParent(),r=n,s=e;return o!==null&&(t&&n===0?(r=s.getIndexWithinParent(),s=o):t||n!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(t?r-1:r)}function HC(e,t){let n=e.offset;if(e.type==="element")return q_(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?q_(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function WC(e){let t=xn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function re(e,t,...n){return OC(e,t,n[0],e)}function ci(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&U(75,t),n}function Es(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return rr(n)?n.host:null}function Uc(e){return gi(e)?e:_t(e)?e.ownerDocument:null}function IR(e){return He()._updateTags.has(e)}function xs(e){zt(),He()._updateTags.add(e)}function GC(e){zt(),He()._deferred.push(e)}function Ia(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function xg(e){let t=Uc(e);return t?t.defaultView:null}function xn(e){let t=e._window;return t===null&&U(78),t}function jC(e){return P(e)&&e.isInline()||Ve(e)&&e.isInline()}function Cg(e){let t=e.getLatest();for(;t!==null;){if(Vt(t)!==null&&P(t))return t;let n=t.getParentOrThrow();if(vt(n))return n;t=n}return t}function yg(e){return P(e)&&e.isShadowRoot()}function vt(e){return Ft(e)||yg(e)}function Sg(e,t=!1){let n=e.constructor.clone(e,ug);return LC(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Xa(e){let t=He(),n=e.getType(),o=Bc(t,n);o===void 0&&U(200,e.constructor.name,n);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(e),l=i.constructor;return s!==null?i instanceof s||U(201,s.name,s.getType(),l.name,l.getType(),e.constructor.name,n):i instanceof e.constructor&&l!==e.constructor||U(202,l.name,l.getType(),e.constructor.name,n),i.__key===e.__key&&U(203,e.constructor.name,n,l.name,l.getType()),i}return e}function cf(e,t){!Ft(e.getParent())||P(t)||Ve(t)||U(99)}function YC(e){let t=ot(e);return t===null&&U(63,e),t}function gc(e){if(!e||e.isInline())return!1;if(Ve(e))return!0;if(P(e)){if(e.isShadowRoot()){let t=e.getParent();return!(P(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function $c(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Yn(e){return jn?(e||window).getSelection():null}function VC(e){let t=xg(e);return t?t.getSelection():null}function rr(e){return ny(e)&&"host"in e}var LR=[];function XC(e){let t=e.getRootNode();if(t===e||!rr(t))return LR;let n=[t],o=t.host;for(;;){let r=o.getRootNode();if(r===o||!rr(r))break;n.push(r),o=r.host}return n}function*qC(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');let o=(gi(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=o.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function JC(e){return e!==null?e.ownerDocument:document}function _n(){let e=bC();return JC(e!==null?e._rootElement:null)}function hi(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;let n=XC(t);if(n.length===0)return null;let o=e.getComposedRanges;try{let r=o.call(e,{shadowRoots:n})[0];if(r!==void 0)return r}catch(r){}try{let r=o.apply(e,n)[0];if(r!==void 0)return r}catch(r){}return null}function ZC(e,t){let n=hi(e,t);if(n!==null){let o=QC(n);if(o!==null)return o}return e.rangeCount>0?e.getRangeAt(0):null}function Gn(e,t){let n=hi(e,t);return n===null?e:ey(n,ty(e))}function FR(e,t){let n=hi(e,t);if(n===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let o=QC(n)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ey(n,ty(e)),range:o}}function QC(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch(o){return null}}function ey(e,t){let{startContainer:n,startOffset:o,endContainer:r,endOffset:s}=e;return t==="backward"?{anchorNode:r,anchorOffset:s,direction:t,focusNode:n,focusOffset:o}:{anchorNode:n,anchorOffset:o,direction:t,focusNode:r,focusOffset:s}}function ty(e){return e.direction}function wc(e){let t=e.getRootNode();return gi(t)||rr(t)?t.activeElement:null}function ui(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let n=t.shadowRoot.activeElement;if(n===null)break;t=n}return t}function Ng(e){let t=e.target;if(t!==null&&_t(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){let n=e.composedPath();if(n.length>0)return n[0]}return t}function PR(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),vt(e)&&U(102);let o=(i)=>{let l=i.getParentOrThrow(),c=vt(l),u=i!==n||c?Sg(i):i;if(c)return P(i)&&P(u)||U(133),i.insertAfter(u),[i,u,u];{let[d,f,p]=o(l),h=i.getNextSiblings();return p.append(u,...h),[d,f,u]}},[r,s]=o(n);return[r,s]}function BR(e){return _t(e)&&e.tagName==="A"}function KR(e){return _t(e)&&e.tagName==="TR"}function zR(e){return _t(e)&&(e.tagName==="TD"||e.tagName==="TH")}function _t(e){return mi(e)&&e.nodeType===1}function mi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function ny(e){return mi(e)&&e.nodeType===11}var UR=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function oy(e){return!(!_t(e)||!e.style.display.startsWith("inline"))||UR.test(e.nodeName)}var HR=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Eg(e){return(!_t(e)||!e.style.display.startsWith("inline"))&&HR.test(e.nodeName)}function pn(e){if(Ve(e)&&!e.isInline())return!0;if(!P(e)||vt(e))return!1;let t=e.getFirstChild(),n=t===null||wo(t)||V(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function _o(){return He()}function Tg(e=_o()){return e._config.dom||wa}function On(e,t,n=_o()){let o=Tg(n).$getDOMSlot(e,t,n);return P(e)&&(ry(o)||U(344,e.getKey(),e.getType())),o}function WR(e,t,n,o){let r=e.read("latest",()=>{let s=ot(t);return s!==null?function(i,l,c=_o()){let u=Ar(i,l);if(u===null)return null;let d=c.getElementByKey(u.getKey());return d!==null?d.parentElement:null}(s,n,e):null});return r!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display=""),r}function GR(e,t,n){n.style.display="none";let o=e.getElementByKey(t);o!==null&&n.parentElement!==o&&o.insertBefore(n,o.firstChild)}function ry(e){return e instanceof si}function or(e,t,n=_o()){return IC(On(e,t,n).element)}var J_=new WeakMap,jR=new Map;function kf(e){if(!e._readOnly&&e.isEmpty())return jR;e._readOnly||U(192);let t=J_.get(e);return t||(t=function(n){let o=new Map;for(let[r,s]of n._nodeMap){let i=s.__type,l=o.get(i);l||(l=new Map,o.set(i,l)),l.set(r,s)}return o}(e),J_.set(e,t)),t}function bg(e){let t=e.constructor.clone(e,ug);return t.afterCloneFrom(e),t}function YR(e){return(t=bg(e))[Zx]=!0,t;var t}function sy(e,t){let n=e.getAttribute("data-lexical-indent");if(n!==null){let s=parseInt(n,10);if(Number.isFinite(s)&&s>=0)return void t.setIndent(s)}let o=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(o/40);t.setIndent(r)}function iy(e,t){let n=t.getAttribute("dir");return n==="ltr"||n==="rtl"?e.setDirection(n):e}function ay(e,t){let n=t.style.textAlign;return n&&n in pc?e.setFormat(n):e}function ly(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function cy(e,t=_o()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}function La(e,t){let n=e;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(_t(n)&&n.hasAttribute("data-lexical-slot"))return!1;if(pi(n,t)!==void 0)return!1;n=Es(n)}return!1}function fa(e,t){return function(n,o){return Object.prototype.hasOwnProperty.call(n,o)}(e,t)&&e[t]!==rn[t]}var Z_=new WeakMap,Q_=Symbol("lexical.synthesizedGetType");function qa(e){let t=Z_.get(e);if(t)return t;let n=e.prototype!=null&&Zm in e.prototype?e.prototype[Zm]():void 0,o=function(u){if(!(u===rn||u.prototype instanceof rn)){let d="<unknown>",f="<unknown>";try{d=u.getType()}catch(p){}try{_s.version&&(f=JSON.parse(_s.version))}catch(p){}U(290,u.name,d,f)}return u===Fc||u===$o||u===rn}(e),r=!o&&fa(e,"getType")?e.getType:void 0,s=r&&!(Q_ in r)?r.call(e):void 0,i,l=s;if(n)if(s)i=n[s];else{for(let[u,d]of Object.entries(n))l=u,i=d;if(!i)for(let u of Object.getOwnPropertySymbols(n)){let d=n[u];if(d){i=d;break}}}if(!o&&l){if(!fa(e,"getType")){let u=e,d=function(){return this!==u?rn.getType.call(this):l};d[Q_]=!0,e.getType=d}if(fa(e,"clone")||(e.clone=(u,d)=>{cg(u);let f=new e;return d!==ug&&f.afterCloneFrom(u),f}),fa(e,"importJSON")||(e.importJSON=i&&i.$importJSON||((u)=>new e().updateFromJSON(u))),!fa(e,"importDOM")&&i){let{importDOM:u}=i;u&&(e.importDOM=()=>u)}}let c={klass:e,ownNodeConfig:i,ownNodeType:l};return Z_.set(e,c),c}function*Ja(e){for(let t=e;t&&(t===rn||og(t.prototype));){let n=qa(t);yield n,t=n.ownNodeConfig&&n.ownNodeConfig.extends||uy(t)}}function VR(e){let t=new Map,n=new Map;for(let o of e){let{ownNodeType:r}=qa(o);r&&(n.set(r,o),t.set(r,new Set))}for(let[o,r]of n)for(let{ownNodeType:s}of Ja(r)){let i=s&&t.get(s);i&&i.add(o)}return t}function XR(e){let t=_o();return zt(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var yr=(e,t)=>{let n=e;for(;n!=null&&!Ft(n);){if(t(n))return n;n=n.getParent()}return null};function Fa(e,t){let n=[],o=e.__first;for(;o!==null;){let r=t===null?ot(o):t.get(o);r==null&&U(174),n.push(o),o=r.__next}return n}function uy(e){let t=Object.getPrototypeOf(e);if(typeof t=="function"&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var dy=new Map;function Ro(e){return P(e)||Ve(e)}function Or(e){return P(e)||Ve(e)}function Vt(e){let t=e.getLatest();return Or(t)?t.__slotHost:null}function Kn(e){let t=Vt(e);if(t===null)return null;let n=ot(t);return P(n)||Ve(n)||U(370),n}function fy(e){let t=Kn(e);if(t===null)return null;let n=e.getLatest().__key;for(let[o,r]of Hc(t))if(r===n)return o;return null}function gy(e){let t=e.getLatest();for(;t!==null;){if(Vt(t)!==null)return t;t=t.getParent()}return null}function Hc(e){let t=e.getLatest();return Ro(t)&&t.__slots!==null?t.__slots:dy}function Hn(e){return Array.from(Hc(e).keys())}function Ar(e,t){let n=Hc(e).get(t);return n===void 0?null:ot(n)}var qR=["__proto__","constructor","prototype"],ex=Symbol("slotMapOwner");function If(e){let t=e.__slots;return t!==null&&t[ex]===e||(t=new Map(t),t[ex]=e,e.__slots=t),t}var tx=new WeakMap,JR=[];function py(e){for(let{ownNodeConfig:t}of Ja(e)){let n=t&&t.slots;if(n)return n}return JR}function hy(e){let t="";for(let n of Hn(e)){let o=Ar(e,n);o!==null&&(t+=o.getTextContent())}return t}function nx(e,t,n){let o=n.get(e),r=n.get(t);return o!==void 0?r!==void 0?o-r:-1:r!==void 0?1:e<t?-1:e>t?1:0}function ZR(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(i){let l=tx.get(i);if(l===void 0){let c=py(i),u=new Map;for(let d of c)qR.includes(d)&&U(371,i.name,d),u.has(d)&&U(372,i.name,d),u.set(d,u.size);l=u,tx.set(i,l)}return l}(e.constructor),o=null,r=!0;for(let i of t.keys()){if(o!==null&&nx(o,i,n)>0){r=!1;break}o=i}if(r)return;let s=Array.from(t).sort(([i],[l])=>nx(i,l,n));t.clear();for(let[i,l]of s)t.set(i,l)}function Og(e,t,n){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||U(373,t);let o=e.getLatest();if(o.__slots!==null&&o.__slots.get(t)===n.getLatest().__key)return o;(!P(n)&&!Ve(n)||n.isInline())&&U(374,n.__key);let r=e.getWritable(),s=If(r),i=s.get(t);i!==void 0&&_y(i);let l=n.getWritable(),c=Kn(l);if(c!==null){let u=fy(l);u!==null&&If(c.getWritable()).delete(u),l.__slotHost=null}return Bn(l),l.__slotHost=r.__key,s.set(t,l.__key),ZR(r),function(){let u=_o();u._slotsUsed=!0,u._pendingEditorState&&(u._pendingEditorState._slotsUsed=!0)}(),r}function my(e,t){let n=e.getWritable();if(n.__slots===null)return n;let o=n.__slots.get(t);return o!==void 0&&(_y(o),If(n).delete(t)),n}function ox(e,t){}function _y(e){let t=ot(e);if(t===null)return;let n=t.getWritable();Or(n)||U(377,e),n.__slotHost=null,n.remove()}var QR={next:"previous",previous:"next"};class Za{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:Rr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return Ct(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ct(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){let o=n===this.direction?t:Array.from(t).reverse(),r=this,s=this.getParentAtCaret(),i=new Map;for(let l=r.getAdjacentCaret();l!==null&&i.size<e;l=l.getAdjacentCaret()){let c=l.origin.getWritable();i.set(c.getKey(),c)}for(let l of o){if(i.size>0){let c=r.getNodeAtCaret();if(c)if(i.delete(c.getKey()),i.delete(l.getKey()),c.is(l)||r.origin.is(l));else{let u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}else c===null&&U(263,Array.from(i).join(" "))}else r.insert(l);r=Ct(l,this.direction)}for(let l of i.values())l.remove();return this}}class Pa extends Za{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:sr(e,this.direction)}getParentCaret(e="root"){return Ct(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wr(this.direction);return Ct(this.getNodeAtCaret(),e)||sr(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Pa&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var eM={root:Ft,shadowRoot:vt};function wr(e){return QR[e]}function Ag(e,t="root"){return e===null||eM[t](e)?null:Vt(e)===null?e:null}class Cs extends Za{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ct(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return P(this.origin)?sr(this.origin,this.direction):null}getParentCaret(e="root"){return Ct(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wr(this.direction);return Ct(this.getNodeAtCaret(),e)||sr(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Cs&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ys extends Za{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Mr(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Ct(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Mr(this.origin,wr(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ys&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Ct(this.origin,this.direction)}}function go(e){return e instanceof ys}function tM(e){return e instanceof Za}function Rr(e){return e instanceof Cs}function Wn(e){return e instanceof Pa}var nM={next:class extends ys{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ys{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},oM={next:class extends Cs{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Cs{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rM={next:class extends Pa{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Pa{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Ct(e,t){return e?new oM[t](e):null}function Mr(e,t,n){return e?new nM[t](e,po(e,n)):null}function po(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&ix(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function Lf(e,t){return new Mg(e,t)}function sr(e,t){return P(e)?new rM[t](e):null}function xy(e){return e&&e.getChildCaret()||e}function di(e){return e&&xy(e.getAdjacentCaret())}class Rg{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Rg(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=(o)=>{let r=this[o].getLatest();return go(r)?function(s,i){let{direction:l,origin:c}=s,u=po(c,i==="focus"?wr(l):l);return Lf(s,u-s.offset)}(r,o):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:o}=t,{caret:r}=n;if(o.isSameNodeCaret(r))return[Lf(o,r.offset-o.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=go(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),o=go(n),r=(s)=>s.isSameNodeCaret(n)?null:di(s)||s.getParentCaret(e);return $g({hasNext:(s)=>s!==null&&!(o&&n.isSameNodeCaret(s)),initial:t.isSameNodeCaret(n)?null:r(t),map:(s)=>s,step:r})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Mg{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,o]=this.getSliceIndices(),r=e.getTextContent();return Mr(e.setTextContent(r.slice(0,n)+r.slice(o)),t,n)}}function sM(e){return e instanceof Mg}function Dg(e){return Dr(e,Ct(vn(),e.direction))}function Cy(e){return Dr(e,e)}function Dr(e,t){return e.direction!==t.direction&&U(265),new Rg(e,t,e.direction)}function $g(e){let{initial:t,hasNext:n,step:o,map:r}=e,s=t;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function wg(e,t){let n=kc(e.origin,t.origin);switch(n===null&&U(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?function(s,i){return Math.sign(s-i)}(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return kg(n)}}function kg(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,s=t,i=n;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function ic(e,t){return t.is(e)}function rx(e){return P(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function kc(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=rx(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=rx(t);o;r=o,o=o.getParent()){let s=n.get(o);if(s!==void 0)return s===null?(ic(e,o)||U(276),{commonAncestor:o,type:"ancestor"}):r===null?(ic(t,o)||U(277),{commonAncestor:o,type:"descendant"}):((P(s)||ic(e,s))&&(P(r)||ic(t,r))&&o.is(s.getParent())&&o.is(r.getParent())||U(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function $r(e,t){let{type:n,key:o,offset:r}=e,s=YC(e.key);return n==="text"?(V(s)||U(266,s.getType(),o),Mr(s,t,r)):(P(s)||U(267,s.getType(),o),Ey(s,e.offset,t))}function Ba(e,t){let{origin:n,direction:o}=t,r=o==="next";go(t)?e.set(n.getKey(),t.offset,"text"):Rr(t)?V(n)?e.set(n.getKey(),po(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Wn(t)&&P(n)||U(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function yy(e){let t=Fe(),n=fe(t)?t:CC();return _a(n,e),en(n),n}function _a(e,t){Ba(e.anchor,t.anchor),Ba(e.focus,t.focus)}function Ff(e){let{anchor:t,focus:n}=e,o=$r(t,"next"),r=$r(n,"next"),s=wg(o,r)<=0?"next":"previous";return Dr(ko(o,s),ko(r,s))}function Ts(e){let{direction:t,origin:n}=e,o=Ct(n,wr(t)).getNodeAtCaret();return o?Ct(o,t):sr(n.getParentOrThrow(),t)}function sx(e,t="root"){let n=[e];for(let o=Wn(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Ts(o));return n}function uf(e){return!!e&&e.origin.isAttached()}function Sy(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,s=Ig(e,o),i=sx(s.anchor,n),l=sx(s.focus.getFlipped(),n),c=new Set,u=[];for(let _ of s.iterNodeCarets(n))if(Wn(_))c.add(_.origin.getKey());else if(Rr(_)){let{origin:x}=_;P(x)&&!c.has(x.getKey())||u.push(x)}let d=new Set;for(let _ of u){let x=_.getParent();x===null||c.has(x.getKey())||d.add(x),Bn(_)}for(let _ of d)!_.canBeEmpty()&&!vt(_)&&_.isEmpty()&&_.isAttached()&&_.remove();for(let _ of s.getTextSlices()){if(!_)continue;let{origin:x}=_.caret,C=x.getTextContentSize(),y=Ts(Ct(x,o)),N=x.getMode();if(Math.abs(_.distance)===C&&r==="removeEmptySlices"||N==="token"&&_.distance!==0)y.remove();else if(_.distance!==0){r="removeEmptySlices";let E=_.removeTextSlice(),v=_.caret.origin;if(N==="segmented"){let b=E.origin,A=hn(b.getTextContent()).setStyle(b.getStyle()).setFormat(b.getFormat());y.replaceOrInsert(A),E=Mr(A,o,E.offset)}v.is(i[0].origin)&&(i[0]=E),v.is(l[0].origin)&&(l[0]=E.getFlipped())}}let f,p;for(let _ of i)if(uf(_)){f=Mo(_);break}for(let _ of l)if(uf(_)){p=Mo(_);break}let h=function(_,x,C){if(!_||!x)return null;let y=_.getParentAtCaret(),N=x.getParentAtCaret();if(!y||!N)return null;let E=y.getParents().reverse();E.push(y);let v=N.getParents().reverse();v.push(N);let b=Math.min(E.length,v.length),A;for(A=0;A<b&&E[A]===v[A];A++);let O=(k,q)=>{let j;for(let oe=A;oe<k.length;oe++){let B=k[oe];if(vt(B))return;!j&&q(B)&&(j=B)}return j},D=O(E,pn),H=D&&O(v,(k)=>C.has(k.getKey())&&pn(k));if(H&&Hn(H).length>0)return null;return D&&H?[D,H]:null}(f,p,c);if(h){let[_,x]=h;sr(_,"previous").splice(0,x.getChildren());let C=x.getParent();for(x.remove(!0);C&&C.isEmpty();){let y=C;C=C.getParent(),y.remove(!0)}}else if(p){let _=function(y){if(Wn(y)){let N=y.origin;if(pn(N))return N}else{let N=y.getParentAtCaret();if(N&&pn(N))return N}return null}(p),x=_&&_.getParent(),C=_&&_.getParents().findLast(yg);if(_&&x&&!Ft(x)&&_.isEmpty()&&c.has(_.getKey())&&Hn(_).length===0&&(!C||c.has(C.getKey()))){_.remove(!0);let y=x;for(;y&&!Ft(y)&&y.isEmpty();){let N=y.getParent();if(N&&Ft(N)&&N.getChildrenSize()<=1)break;let E=y;y=N,E.remove(!0)}}}let m=[f,p,...i,...l].find(uf);if(m)return Cy(ko(Mo(m),e.direction));U(269,JSON.stringify(i.map((_)=>_.origin.__key)))}function Mo(e){let t=function(r){let s=r;for(;Wn(s);){let i=di(s);if(!Wn(i))break;s=i}return s}(e.getLatest()),{direction:n}=t;if(V(t.origin))return go(t)?t:Mr(t.origin,n,n);let o=t.getAdjacentCaret();return Rr(o)&&V(o.origin)?Mr(o.origin,n,wr(n)):t}function Ny(e){return go(e)&&e.offset!==po(e.origin,e.direction)}function ko(e,t){return e.direction===t?e:e.getFlipped()}function Ig(e,t){return e.direction===t?e:Dr(ko(e.focus,t),ko(e.anchor,t))}function Ey(e,t,n){let o=sr(e,"next");for(let r=0;r<t;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return ko(o,n)}function iM(e,t="root"){let n=0,o=e,r=di(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=di(o)}return r&&[r,n]}function aM(e){let{origin:t,offset:n,direction:o}=e;if(n===po(t,o))return e.getSiblingCaret();if(n===po(t,wr(o)))return Ts(e.getSiblingCaret());let[r]=t.splitText(n);return V(r)||U(281),ko(Ct(r,"next"),o)}function lM(e,t){return!0}function Ty(e,{$copyElementNode:t=Sg,$splitTextPointCaretNext:n=aM,rootMode:o="shadowRoot",$shouldSplit:r=lM,removeEmptyDestination:s=!1}={}){if(go(e))return n(e);let i=e.getParentCaret(o);if(i){let{origin:l}=i;if(Wn(e)){let u=Ts(i);if(s&&l.isEmpty())return l.remove(),u;if(!l.canBeEmpty()||!r(l,"first"))return u}let c=function(u){let d=[];for(let f=u.getAdjacentCaret();f;f=f.getAdjacentCaret())d.push(f.origin);return d}(e);(c.length>0||!s&&l.canBeEmpty()&&r(l,"last"))&&i.insert(t(l).splice(0,0,c))}return i}function by(e,t,n){let o=ko(t,"next");go(o)&&(o.offset===0?o=Ct(o.origin,"previous").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=Ct(o.origin,"next"))),o.origin.is(e)&&(Rr(o)||U(342,e.getKey(),e.getType()),o=Ts(o)),(e.is(o.getNodeAtCaret())||e.is(o.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let r=o;r;r=Ty(r,n))o=r;return go(o)&&U(283),o.insert(e.isInline()?bn().append(e):e),ko(Ct(e.getLatest(),"next"),t.direction)}function cM(e){return e}function uM(...e){return e}function dM(e,t){return[e,t]}function fM(e){return e}function gM(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Qa(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function pM(e,...t){let n=Qa(...t);n.length>0&&e.classList.add(...n)}function hM(e,...t){let n=Qa(...t);n.length>0&&e.classList.remove(...n)}function Lg(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function mM(e,t,n){return Lg(...Object.entries(t).map(([o,r])=>ng(e,o,r,n)))}var T=Fg,{$addUpdateTag:el,$applyNodeReplacement:sn,$assumeActiveEditor:vy,$caretFromPoint:an,$caretRangeFromSelection:ir,$cloneWithProperties:Wc,$cloneWithPropertiesEphemeral:Oy,$comparePointCaretNext:kr,$copyNode:Ht,$create:Gc,$createChildrenArray:V1,$createLineBreakNode:ln,$createNodeSelection:jc,$createParagraphNode:ye,$createPoint:Vn,$createRangeSelection:Lr,$createRangeSelectionFromDom:Ay,$createTabNode:cn,$createTextNode:xt,$extendCaretToRange:bs,$findMatchingParent:pe,$formatText:Ry,$fullReconcile:_i,$generateNodesFromRawText:tl,$getAdjacentChildCaret:nl,$getAdjacentNode:X1,$getAdjacentSiblingOrParentSiblingCaret:vs,$getCaretInDirection:My,$getCaretRange:Xn,$getCaretRangeInDirection:lr,$getCharacterOffsets:Dy,$getChildCaret:Et,$getChildCaretAtIndex:Pg,$getChildCaretOrSelf:Bg,$getCollapsedCaretRange:Os,$getCommonAncestor:q1,$getCommonAncestorResultBranchOrder:J1,$getDOMSlot:$y,$getDOMTextNode:wy,$getDocument:je,$getEditor:Ke,$getEditorDOMRenderConfig:Kg,$getNearestNodeFromDOMNode:Tt,$getNearestRootOrShadowRoot:Z1,$getNodeByKey:Ot,$getNodeByKeyOrThrow:ky,$getNodeFromDOMNode:Iy,$getPreviousSelection:Cn,$getRoot:Xe,$getSelection:K,$getSiblingCaret:it,$getSlot:Ci,$getSlotFrame:qn,$getSlotHost:Yc,$getSlotNameWithinHost:Q1,$getSlotNames:As,$getState:Lo,$getStateChange:eL,$getTextContent:tL,$getTextNodeOffset:nL,$getTextPointCaret:Vc,$getTextPointCaretSlice:oL,$getWritableNodeState:rL,$hasAncestor:ol,$hasUpdateTag:sL,$insertNodeToNearestRootAtCaret:Pr,$insertNodes:Xc,$isBlockElementNode:Br,$isChildCaret:Fo,$isDecoratorNode:Dt,$isEditorState:Ly,$isElementDOMSlot:iL,$isElementNode:W,$isExtendableTextPointCaret:rl,$isInlineElementOrDecoratorNode:zg,$isInlineFormattable:aL,$isLeafNode:sl,$isLexicalNode:Ug,$isLineBreakNode:Pe,$isNodeCaret:lL,$isNodeSelection:Je,$isParagraphNode:An,$isRangeSelection:I,$isRootNode:xo,$isRootOrShadowRoot:At,$isSelectionCapturedInDecoratorInput:Fy,$isShadowRootNode:qc,$isSiblingCaret:Co,$isSlotChild:cL,$isSlotHost:il,$isTabNode:Wt,$isTextNode:ne,$isTextPointCaret:Kr,$isTextPointCaretSlice:uL,$isTokenOrSegmented:Hg,$isTokenOrTab:dL,$markSlotEditable:fL,$needsBlockCursorBeside:Py,$nodesOfType:gL,$normalizeCaret:$t,$normalizeSelection__EXPERIMENTAL:Po,$onUpdate:By,$parseSerializedNode:Ky,$removeFromParent:pL,$removeSlot:hL,$removeTextFromCaretRange:zy,$rewindSiblingCaret:Ko,$selectAll:zr,$setCompositionKey:mL,$setDirectionFromDOM:yn,$setFormatFromDOM:Jn,$setPointFromCaret:zo,$setSelection:pt,$setSelectionFromCaretRange:Mn,$setSlot:_L,$setState:Qn,$setTextFormat:Uy,$splitAtPointCaretNext:Jc,$splitNode:Hy,$updateDOMSelection:Wy,$updateRangeSelectionFromCaretRange:xL,ArtificialNode__DO_NOT_USE:ll,BEFORE_INPUT_COMMAND:CL,BLUR_COMMAND:yL,CAN_REDO_COMMAND:Rs,CAN_UNDO_COMMAND:Ms,CAN_USE_BEFORE_INPUT:cl,CAN_USE_DOM:un,CLEAR_EDITOR_COMMAND:Zc,CLEAR_HISTORY_COMMAND:Gy,CLICK_COMMAND:yi,COLLABORATION_TAG:jy,COMMAND_PRIORITY_BEFORE_CRITICAL:Yy,COMMAND_PRIORITY_BEFORE_EDITOR:Qc,COMMAND_PRIORITY_BEFORE_HIGH:SL,COMMAND_PRIORITY_BEFORE_LOW:NL,COMMAND_PRIORITY_BEFORE_NORMAL:EL,COMMAND_PRIORITY_CRITICAL:Si,COMMAND_PRIORITY_EDITOR:Ee,COMMAND_PRIORITY_HIGH:Dn,COMMAND_PRIORITY_LOW:we,COMMAND_PRIORITY_NORMAL:TL,COMPOSITION_END_COMMAND:bL,COMPOSITION_END_TAG:eu,COMPOSITION_START_COMMAND:Vy,COMPOSITION_START_TAG:tu,CONTROLLED_TEXT_INSERTION_COMMAND:nu,COPY_COMMAND:Ni,CUT_COMMAND:ou,CUT_TAG:ru,DEFAULT_EDITOR_DOM_CONFIG:Wg,DELETE_CHARACTER_COMMAND:Ei,DELETE_LINE_COMMAND:su,DELETE_WORD_COMMAND:iu,DRAGEND_COMMAND:vL,DRAGOVER_COMMAND:Xy,DRAGSTART_COMMAND:qy,DROP_COMMAND:Jy,DecoratorNode:au,ElementNode:lt,FOCUS_COMMAND:Zy,FORMAT_ELEMENT_COMMAND:lu,FORMAT_TEXT_COMMAND:Uo,HISTORIC_TAG:Ti,HISTORY_MERGE_TAG:Ur,HISTORY_PUSH_TAG:uu,INDENT_CONTENT_COMMAND:eo,INPUT_COMMAND:OL,INSERT_LINE_BREAK_COMMAND:Gg,INSERT_PARAGRAPH_COMMAND:Hr,INSERT_TAB_COMMAND:Ds,INTERNAL_$isBlock:ul,IS_ALL_FORMATTING:AL,IS_ANDROID:Qy,IS_ANDROID_CHROME:eS,IS_APPLE:dl,IS_APPLE_WEBKIT:du,IS_BOLD:fl,IS_CHROME:tS,IS_CODE:nS,IS_FIREFOX:$s,IS_HIGHLIGHT:oS,IS_IOS:gl,IS_ITALIC:pl,IS_SAFARI:fu,IS_STRIKETHROUGH:hl,IS_SUBSCRIPT:gu,IS_SUPERSCRIPT:pu,IS_UNDERLINE:ml,KEY_ARROW_DOWN_COMMAND:Ho,KEY_ARROW_LEFT_COMMAND:Wr,KEY_ARROW_RIGHT_COMMAND:bi,KEY_ARROW_UP_COMMAND:to,KEY_BACKSPACE_COMMAND:vi,KEY_DELETE_COMMAND:hu,KEY_DOWN_COMMAND:RL,KEY_ENTER_COMMAND:Oi,KEY_ESCAPE_COMMAND:Ai,KEY_MODIFIER_COMMAND:ML,KEY_SPACE_COMMAND:mu,KEY_TAB_COMMAND:Gr,LineBreakNode:rS,MOVE_TO_END:_l,MOVE_TO_START:Ri,NODE_STATE_DIRECT:DL,NODE_STATE_KEY:$L,NODE_STATE_LATEST:wL,OUTDENT_CONTENT_COMMAND:Wo,PASTE_COMMAND:Mi,PASTE_TAG:_u,ParagraphNode:sS,REDO_COMMAND:xu,REMOVE_TEXT_COMMAND:iS,RootNode:Cu,SELECTION_CHANGE_COMMAND:no,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:yu,SELECT_ALL_COMMAND:Di,SET_TEXT_FORMAT_COMMAND:aS,SKIP_COLLAB_TAG:kL,SKIP_DOM_SELECTION_TAG:lS,SKIP_SCROLL_INTO_VIEW_TAG:cS,SKIP_SELECTION_FOCUS_TAG:Su,TEXT_TYPE_TO_FORMAT:$i,TabNode:Nu,TextNode:$n,UNDO_COMMAND:Eu,addClassNamesToElement:Qe,buildImportMap:jg,configExtension:tn,createCommand:Sn,createEditor:Tu,createRefCountedRegistry:IL,createSharedNodeState:LL,createState:Go,declarePeerDependency:uS,defineExtension:me,findAllLexicalElementsDeep:dS,flipDirection:fS,getActiveElement:yo,getActiveElementDeep:gS,getComposedEventTarget:xl,getComposedStaticRange:FL,getDOMOwnerDocument:PL,getDOMSelection:wn,getDOMSelectionFromTarget:BL,getDOMSelectionPoints:ws,getDOMSelectionRange:pS,getDOMSelectionRangeAndPoints:KL,getDOMShadowRoots:hS,getDOMTextNode:mS,getDeclaredSlots:zL,getEditorPropertyFromDOMNode:bu,getNearestEditorFromDOMNode:vu,getParentElement:Cl,getRegisteredNode:UL,getRegisteredNodeOrThrow:HL,getRegisteredSubtypeMap:Ou,getRootOwnerDocument:ks,getStaticNodeConfig:_S,getStyleObjectFromCSS:jr,getTextDirection:xS,getTransformSetFromKlass:WL,isBlockDomNode:Is,isCurrentlyReadOnlyMode:CS,isDOMCapturingSelection:GL,isDOMDocumentNode:Yr,isDOMNode:oo,isDOMShadowRoot:Au,isDOMTextNode:Ls,isDOMUnmanaged:jL,isDocumentFragment:Yg,isExactShortcutMatch:yS,isHTMLAnchorElement:wi,isHTMLElement:Ce,isHTMLTableCellElement:YL,isHTMLTableRowElement:SS,isInlineDomNode:ki,isLastChildInBlockNode:NS,isLexicalEditor:Ru,isModifierMatch:VL,isOnlyChildInBlockNode:ES,isSelectionCapturedInDecoratorInput:XL,isSelectionWithinEditor:TS,iterStaticNodeConfigChain:bS,makeStepwiseIterator:Vg,mergeRegister:Oe,mountSlotContainer:qL,normalizeClassNames:Ii,registerEventListener:ro,registerEventListeners:Vr,removeClassNamesFromElement:nn,removeFromParent:JL,resetRandomKey:ZL,safeCast:Be,setDOMStyleFromCSS:cr,setDOMStyleObject:QL,setDOMUnmanaged:Mu,setNodeIndentFromDOM:Xr,shallowMergeConfig:Pt,stopLexicalPropagation:Xg,toggleTextFormatType:qg,tokenizeRawText:Li,unmountSlotContainer:eF}=T;Z();var _M=un?nt:S,Du={tag:Ur};function xM({initialConfig:e,children:t}){let n=G(()=>{let{theme:o,namespace:r,nodes:s,onError:i,onWarn:l,editorState:c,html:u}=e,d=Jm(null,o),f=Tu({editable:e.editable,html:u,namespace:r,nodes:s,onError:(p)=>i(p,f),...l?{onWarn:(p)=>l(p,f)}:{},theme:o});return function(p,h){if(h===null)return;if(h===void 0)p.update(()=>{let m=Xe();if(m.isEmpty()){let _=ye();m.append(_);let x=p.getRootElement(),C=un&&x!==null?yo(x):null;(K()!==null||C!==null&&C===x)&&_.select()}},Du);else if(h!==null)switch(typeof h){case"string":{let m=p.parseEditorState(h);p.setEditorState(m,Du);break}case"object":p.setEditorState(h,Du);break;case"function":p.update(()=>{Xe().isEmpty()&&h(p)},Du)}}(f,c),[f,d]},[]);return _M(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),a(qm.Provider,{value:n,children:t})}var CM=Jg,vS=CM.LexicalComposer;Z();var yM=un?nt:S;function SM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(t)=>e.registerEditableListener(t)}}function NM(){return function(e){let[t]=st(),n=G(()=>e(t),[t,e]),[o,r]=w(()=>n.initialValueFn()),s=M(o);return yM(()=>{let{initialValueFn:i,subscribe:l}=n,c=i();return s.current!==c&&(s.current=c,r(c)),l((u)=>{s.current=u,r(u)})},[n,e]),o}(SM)}var EM=Zg,OS=EM.useLexicalEditable;function ep(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function AS(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function RS(e){let t=e.parentNode;if(t==null)throw Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function TM(e,t,n,o,r){let s=t.getKey(),i=o.getKey(),l=ks(e.getRootElement()).createRange(),c=e.getElementByKey(s),u=e.getElementByKey(i),d=n,f=r;if(ne(t)&&(c=AS(c)),ne(o)&&(u=AS(u)),t===void 0||o===void 0||c===null||u===null)return null;c.nodeName==="BR"&&([c,d]=RS(c)),u.nodeName==="BR"&&([u,f]=RS(u));let p=c.firstChild;c===u&&p!=null&&p.nodeName==="BR"&&d===0&&f===0&&(f=1);try{l.setStart(c,d),l.setEnd(u,f)}catch(h){return null}return!l.collapsed||d===f&&s===i||(l.setStart(u,f),l.setEnd(c,d)),l}function bM(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(t.getClientRects()),l,c=i.length;i.sort((u,d)=>{let f=u.top-d.top;return Math.abs(f)<=3?u.left-d.left:f});for(let u=0;u<c;u++){let d=i[u],f=l&&l.top<=d.top&&l.top+l.height>d.top&&l.left+l.width>d.left,p=d.width+s===o.width;f||p?(i.splice(u--,1),c--):l=d}return i}function DS(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function tp(e){let t=Ke().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function np(e){return tp(xo(e)?e:e.getParentOrThrow())}function vM(e){let t=np(e);return t!==null&&t.direction==="rtl"}function OM(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!Hg(t)&&o!==null){let[r,s]=o,i=e.isBackward(),l=r.getNode(),c=s.getNode(),u=t.is(l),d=t.is(c);if(u||d){let[f,p]=Dy(e),h=l.is(c),m=t.is(i?c:l),_=t.is(i?l:c),x,C=0;if(h)C=f>p?p:f,x=f>p?f:p;else if(m)C=i?p:f,x=void 0;else if(_)C=0,x=i?f:p;let y=t.__text.slice(C,x);y!==t.__text&&(n==="clone"&&(t=Oy(t)),t.__text=y)}}return t}function AM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return W(t)||ep(177),e.offset===t.getChildrenSize()}function $S(e,t,n){let o=t.getNode(),r=n;if(W(o)){let s=o.getDescendantByIndex(t.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if(W(o)){let u=o.getLastDescendant();u!==null&&(o=u)}let s=o.getPreviousSibling(),i=0;if(s===null){let u=o.getParentOrThrow(),d=u.getPreviousSibling();for(;d===null;){if(u=u.getParent(),u===null){s=null;break}d=u.getPreviousSibling()}u!==null&&(i=u.isInline()?0:2,s=d)}let l=o.getTextContent();l===""&&W(o)&&!o.isInline()&&(l=`
|
|
11
|
+
`?t.linebreak():n==="\t"?t.tab():n!==""&&t.text(n)}function ig(e){let t=[];return SC(e,{linebreak:()=>t.push(Pc()),tab:()=>t.push(iC()),text:(n)=>t.push(hn(n))}),t}function aR(){let e=Fe();return e===null?"":e.getTextContent()}function Df(e){let t=[];for(let n of e)wo(n)||(!P(n)&&!Ve(n)||n.isInline()?t.push(n):P(n)&&t.push(...Df(n.getChildren())));return t}function ua(e){let t=e;e.isCollapsed()||t.removeText();let n=Fe();fe(n)&&(t=n),fe(t)||U(161);let o=t.anchor,r=o.getNode(),s=o.offset;for(;!pn(r)&&Vt(r)===null;){let i=r;if([r,s]=lR(r,s),i.is(r))break}return s}function lR(e,t){let n=e.getParent();if(!n){let r=bn();return vn().append(r),r.select(),[vn(),0]}if(q(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let s=t===0?0:1;return[n,r[0].getIndexWithinParent()+s]}if(!P(e)||t===0)return[n,e.getIndexWithinParent()];let o=e.getChildAtIndex(t);if(o){let r=new Ss(ho(e.__key,t,"element"),ho(e.__key,t,"element"),0,""),s=e.insertNewAfter(r);s&&s.append(o,...o.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function P_(e){return wo(e)||jC(e)||q(e)||e.isParentRequired()}function rf(e){let t=bn(),n=null;for(let o=0;o<e.length;o++){let r=e[o];if(P_(r)){if(n===null){n=r.createParentElementNode(),t.append(n);let s=e[o+1];if(wo(r)&&(s===void 0||!P_(s)))continue}n.append(r)}else t.append(r),n=null}return t}function Ac(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[d,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(d.key,d.offset,d.type),!0}let s=wr(e.focus,n?"previous":"next"),i=o==="lineboundary",l=t==="move",c=s,u=r==="decorators-and-blocks";if(!Ny(c)){for(let d of c){u=!1;let{origin:f}=d;if(!Ve(f)||f.isIsolated()||(c=d,!i||!f.isInline()))break}if(u)for(let d of Dg(s).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Gn(d))d.origin.isInline()||(c=d);else{if(P(d.origin))continue;Ve(d.origin)&&!d.origin.isInline()&&(c=d)}break}}if(c===s)return!1;if(l&&!i&&Ve(c.origin)&&c.origin.isKeyboardSelectable()){let d=bc();return d.add(c.origin.getKey()),en(d),!0}return c=Mo(c),l&&Ba(e.anchor,c),Ba(e.focus,c),u||!i}var Ut=null,bt=null,mn=!1,sf=!1,dc=!1,af=new Set,fc=0,B_={characterData:!0,childList:!0,subtree:!0};function br(){return mn||Ut!==null&&Ut._readOnly}function zt(){mn&&U(13)}function NC(){fc>99&&U(14)}function Io(){return Ut===null&&U(195,TC()),Ut}function cR(e){Io()!==null&&bt===null&&(bt=e),bt!==e&&ix(378)}function He(){return bt===null&&U(337,TC()),bt}function EC(){He()._dirtyType=2}function TC(){let e=0,t=new Set,n=_s.version;if(typeof window<"u")for(let r of qC(document)){let s=Va(r);if(zc(s))e++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===n&&(i+=" (separately built, likely a bundler configuration issue)"),t.add(i)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function bC(){return bt}function K_(e,t,n){let o=t.__type,r=dg(e,o),s=n.get(o);s===void 0&&(s=Array.from(r.transforms),n.set(o,s));let i=s.length;for(let l=0;l<i&&(s[l](t),t.isAttached());l++);}function z_(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function vC(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function uR(e){return Rc(e,He()._nodes)}function Rc(e,t){let n=e.type,o=t.get(n);o===void 0&&U(17,n);let r=o.klass;e.type!==r.getType()&&U(18,r.name);let s=r.importJSON(e),i=e.children;if(P(s)&&Array.isArray(i))for(let c=0;c<i.length;c++){let u=Rc(i[c],t);s.append(u)}let l=e.$slots;if(l){Ro(s)||U(379,r.name);for(let c in l)Og(s,c,Rc(l[c],t))}return s}function U_(e,t,n){let o=Ut,r=mn,s=bt;Ut=t,mn=!0,bt=e;try{return n()}finally{Ut=o,mn=r,bt=s}}function Nr(e,t){let n=dc;dc=!0;try{(function(o,r){let{_pendingEditorState:s,_rootElement:i}=o,l=o._headless||i===null;if(s===null)return void(!o._updating&&o._deferred.length>0&&H_(o,o._deferred));let c=o._editorState,u=c._selection,d=s._selection,f=o._dirtyType!==0,p=Ut,h=mn,m=bt,{_updating:_,_observer:x}=o,C=null;if(o._pendingEditorState=null,o._editorState=s,!l&&f&&x!==null){bt=o,Ut=s,mn=!1,o._updating=!0;try{let{_dirtyType:O,_dirtyElements:D,_dirtyLeaves:H}=o;x.disconnect(),C=bA(c,s,o,O,D,H)}catch(O){if(O instanceof Error&&o._onError(O),sf)throw O;return $C(o,null,i,s),px(o),o._dirtyType=2,sf=!0,Nr(o,c),void(sf=!1)}finally{x.observe(i,B_),o._updating=_,Ut=p,mn=h,bt=m}}s._readOnly||(s._readOnly=!0);let{_dirtyLeaves:y,_dirtyElements:N,_normalizedNodes:E,_updateTags:v}=o;f&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set),o._updateTags=new Set,function(O,D){let H=O._decorators,k=O._pendingDecorators||H,J=D._nodeMap,V;for(V in k)J.has(V)||(k===H&&(k=PC(O)),delete k[V])}(o,s);let b=l?null:Vn(xn(o));if(o._editable&&b!==null&&(f||d===null||d.dirty||!d.is(u))&&i!==null&&!v.has(tC)){bt=o,Ut=s;try{if(x!==null&&x.disconnect(),f||d===null||d.dirty){let O=o._blockCursorElement;O!==null&&$c(O,o,i),yC(u,d,o,b,v,i)}(function(O,D,H){let k=O._blockCursorElement;if(fe(H)&&H.isCollapsed()&&H.anchor.type==="element"&&D.contains(wc(D))){let J=H.anchor,V=J.getNode(),oe=J.offset,B=!1,de=null;if(oe===V.getChildrenSize())gc(V.getChildAtIndex(oe-1))&&(B=!0);else{let xe=V.getChildAtIndex(oe);if(xe!==null&&gc(xe)){let ve=xe.getPreviousSibling();(ve===null||gc(ve))&&(B=!0,de=O.getElementByKey(xe.__key))}}if(B){let xe=On(V,O.getElementByKey(V.__key),O).element;return k===null&&(O._blockCursorElement=k=function(ve){let te=ve.theme,ae=_n().createElement("div");ae.contentEditable="false",ae.setAttribute("data-lexical-cursor","true");let ce=te.blockCursor;if(ce!==void 0){if(typeof ce=="string"){let Re=Qa(ce);ce=te.blockCursor=Re}ce!==void 0&&ae.classList.add(...ce)}return ae}(O._config)),D.style.caretColor="transparent",void(de===null?xe.appendChild(k):xe.insertBefore(k,de))}}k!==null&&$c(k,O,D)})(o,i,d)}finally{x!==null&&x.observe(i,B_),bt=m,Ut=p}}C!==null&&function(O,D,H,k,J){let V=Array.from(O._listeners.mutation),oe=V.length;for(let B=0;B<oe;B++){let[de,xe]=V[B];for(let ve of xe){let te=D.get(ve);te!==void 0&&de(te,{dirtyLeaves:k,prevEditorState:J,updateTags:H})}}}(o,C,v,y,c),fe(d)||d===null||u!==null&&u.is(d)||o.dispatchCommand(Gf);let A=o._pendingDecorators;if(A!==null&&(o._decorators=A,o._pendingDecorators=null,ma("decorator",o,!0,A)),function(O,D,H){let k=j_(D),J=j_(H);k!==J&&ma("textcontent",O,!0,J)}(o,r||c,s),ma("update",o,!0,{dirtyElements:N,dirtyLeaves:y,editorState:s,mutatedNodes:C,normalizedNodes:E,prevEditorState:r||c,tags:v}),!_)H_(o,o._deferred);(function(O){let D=O._updates;if(D.length===0)return void(O._cascadeCount=0);if(function(k){if(af.has(k))return;af.add(k),setTimeout(()=>{af.delete(k),k._cascadeCount=0},0)}(O),O._cascadeCount++>99)return O._updates=[],O._cascadeCount=0,void O._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${O._config.namespace}`));let H=D.shift();if(H){let[k,J]=H;$a(O,k,J)}})(o)})(e,t)}finally{dc=n}}function ma(e,t,n,...o){let r=t._updating;t._updating=n;try{let s=t._listeners[e],i=Array.from(s);for(let[l,c]of i){c&&c();let u=l(...o);s.has(l)?s.set(l,u):u&&u()}}finally{t._updating=r}}function OC(e,t,n,o){let r=pg(e),s;if(!dc)for(let i=0;i<r.length;i++)r[i]._updating||(r[i]._cascadeCount=0);for(let i=4;i>=0;i--)for(let l=0;l<r.length;l++){let c=r[l];if(l>0&&c._updating){s=c;break}let u=c._commands.get(t);if(u!==void 0){let d=u[i];if(d.size>0){let f=!1;if(Un(c,()=>{for(let p of d)if(p(n,o))return void(f=!0)}),f)return f}}}return s&&s.update(()=>{OC(s,t,n,o)}),!1}function H_(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let o=0;o<t.length;o++)t[o]()}finally{e._updating=n}}}function W_(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[s,i]=r,l=e._pendingEditorState,c;i!==void 0&&(c=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(l===null&&U(191),l._flushSync=!0),c&&e._deferred.push(c),vC(e,i.tag)),l==null?$a(e,s,i):s()}}return o}function $a(e,t,n){let o=e._updateTags,r,s=!1,i=!1;n!==void 0&&(r=n.onUpdate,vC(e,n.tag),s=n.skipTransforms||!1,i=n.discrete||!1),r&&e._deferred.push(r);let{_editorState:l,_pendingEditorState:c}=e,u=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=AC(c||l),u=!0),c._flushSync=i;let d=Ut,f=mn,p=bt,h=e._updating;Ut=c,mn=!1,e._updating=!0,bt=e;let m=e._headless||e.getRootElement()===null;cg(null);try{u&&(m?l._selection!==null&&(c._selection=l._selection.clone()):c._selection=function(y,N){let E=y.getEditorState()._selection,v=Vn(xn(y));return fe(E)||E==null?Da(E,v,y,N):E.clone()}(e,n&&n.event||null));let x=e._compositionKey;t(),s=W_(e,s),function(y,N){let E=N.getEditorState()._selection,v=y._selection;if(fe(v)){let{anchor:b,focus:A}=v,O;if(b.type==="text"&&(O=b.getNode(),O.selectionTransform(E,v)),A.type==="text"){let D=A.getNode();O!==D&&D.selectionTransform(E,v)}}}(c,e),e._dirtyType!==0&&(s?function(y,N){let E=N._dirtyLeaves,v=y._nodeMap;for(let b of E){let A=v.get(b);q(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&c_(A)}}(c,e):function(y,N){let{_dirtyLeaves:E,_dirtyElements:v}=N,b=y._nodeMap,A=Ao(),O=new Map,D=E,H=D.size,k=v,J=k.size;for(;H>0||J>0;){if(H>0){N._dirtyLeaves=new Set;for(let V of D){let oe=b.get(V);q(oe)&&oe.isAttached()&&oe.isSimpleText()&&!oe.isUnmergeable()&&c_(oe),oe!==void 0&&z_(oe,A)&&K_(N,oe,O),E.add(V)}if(D=N._dirtyLeaves,H=D.size,H>0){fc++;continue}}N._dirtyLeaves=new Set,N._dirtyElements=new Map,k.delete("root")&&k.set("root",!0);for(let V of k){let oe=V[0],B=V[1];if(v.set(oe,B),!B)continue;let de=b.get(oe);de!==void 0&&z_(de,A)&&K_(N,de,O)}D=N._dirtyLeaves,H=D.size,k=N._dirtyElements,J=k.size,fc++}N._dirtyLeaves=E,N._dirtyElements=v}(c,e),W_(e),function(y,N,E,v){let b=y._nodeMap,A=N._nodeMap,O=[];for(let[k]of v){let J=A.get(k);J!==void 0&&(J.isAttached()||(P(J)&&hc(J,k,b,A,O,v),b.has(k)||v.delete(k),O.push(k)))}for(let k of E){let J=A.get(k);J===void 0||J.isAttached()||(Ro(J)&&J.__slots!==null&&hc(J,k,b,A,O,E),b.has(k)||E.delete(k),O.push(k))}for(let k of O)A.delete(k);let D=He(),H=D._compositionKey;H===null||A.has(H)||(D._compositionKey=null)}(l,c,e._dirtyLeaves,e._dirtyElements)),x!==e._compositionKey&&(c._flushSync=!0);let C=c._selection;if(fe(C)){e._slotsUsed&&hC(C);let y=c._nodeMap,N=C.anchor.key,E=C.focus.key;y.get(N)!==void 0&&y.get(E)!==void 0||U(19)}else fi(C)&&C._nodes.size===0&&(c._selection=null)}catch(x){return x instanceof Error&&e._onError(x),e._pendingEditorState=l,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Nr(e)}finally{Ut=d,mn=f,bt=p,e._updating=h,fc=0}e._dirtyType!==0||e._deferred.length>0||function(x,C){let y=C.getEditorState()._selection,N=x._selection;if(N!==null){if(N.dirty||!N.is(y))return!0}else if(y!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Nr(e)):u&&AR(()=>{Nr(e)}):(c._flushSync=!1,u&&(o.clear(),e._deferred=[],e._pendingEditorState=null))}function Un(e,t,n){bt===e&&n===void 0?br()?$a(e,t,n):t():$a(e,t,n)}function dR(e){if(vt(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class $o extends rn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:dR,extends:rn})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&U(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return cA[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Wn(this).length===0}isDirty(){let e=He()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let n of Wn(this)){let o=Ar(this,n);P(o)&&e.push(...o.getAllTextNodes())}let t=this.getFirstChild();for(;t!==null;){if(q(t)&&e.push(t),P(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;P(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;P(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let r=t[n-1];return P(r)&&r.getLastDescendant()||r||null}let o=t[e];return P(o)&&o.getFirstDescendant()||o||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:ot(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&U(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:ot(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&U(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,o;if(e<t/2){for(n=this.getFirstChild(),o=0;n!==null&&o<=e;){if(o===e)return n;n=n.getNextSibling(),o++}return null}for(n=this.getLastChild(),o=t-1;n!==null&&o>=e;){if(o===e)return n;n=n.getPreviousSibling(),o--}return null}getTextContent(){let e=hy(this),t=this.getChildren(),n=t.length;for(let o=0;o<n;o++){let r=t[o];e+=r.getTextContent(),P(r)&&o!==n-1&&!r.isInline()&&(e+=us)}return e}getTextContentSize(){let e=function(o){let r=0;for(let s of Wn(o)){let i=Ar(o,s);i!==null&&(r+=i.getTextContentSize())}return r}(this),t=this.getChildren(),n=t.length;for(let o=0;o<n;o++){let r=t[o];e+=r.getTextContentSize(),P(r)&&o!==n-1&&!r.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let t=pc[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=jt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return vr(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){zt();let n=Fe(),o=e,r=t,s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let l=this.getFirstChild();if(q(l)||P(l))return l.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){let l=this.getLastChild();if(q(l)||P(l))return l.select()}}o===void 0&&(o=s),r===void 0&&(r=s);let i=this.__key;return fe(n)?(n.anchor.set(i,o,"element"),n.focus.set(i,r,"element"),n.dirty=!0,n):xC(i,o,i,r,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((t)=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""&&pc[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Sc(this)&&U(324,this.__key,this.__type);let o=this.getChildrenSize(),r=this.getWritable();e+t<=o||U(226,String(e),String(t),String(o));for(let p of n);let s=r.__key,i=[],l=[],c=this.getChildAtIndex(e+t),u=null,d=o-t+n.length;if(e!==0)if(e===o)u=this.getLastChild();else{let p=this.getChildAtIndex(e);p!==null&&(u=p.getPreviousSibling())}if(t>0){let p=u===null?this.getFirstChild():u.getNextSibling();for(let h=0;h<t;h++){p===null&&U(100);let m=p.getNextSibling(),_=p.__key;Kn(p.getWritable()),l.push(_),p=m}}let f=u;for(let p of n){f!==null&&p.is(f)&&(u=f=f.getPreviousSibling());let h=p.getWritable();h.__parent===s&&d--,Kn(h);let m=p.__key;if(f===null)r.__first=m,h.__prev=null;else{let _=f.getWritable();_.__next=m,h.__prev=_.__key}p.__key===s&&U(76),h.__parent=s,i.push(m),f=p}if(e+t===o){if(f!==null)f.getWritable().__next=null,r.__last=f.__key}else if(c!==null){let p=c.getWritable();if(f!==null){let h=f.getWritable();p.__prev=f.__key,h.__next=c.__key}else p.__prev=null}if(r.__size=d,l.length){let p=Fe();if(fe(p)){let h=new Set(l),m=new Set(i),{anchor:_,focus:x}=p;G_(_,h,m)&&vc(_,_.getNode(),this,u,c),G_(x,h,m)&&vc(x,x.getNode(),this,u,c),d!==0||this.canBeEmpty()||vt(this)||this.remove()}}return r}getDOMSlot(e){return new si(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(_t(t)){let n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px",t.setAttribute("data-lexical-indent",String(n)));let o=this.getDirection();o&&(t.dir=o)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===""||vt(this)||this.getChildren().some(q)||(t!==0&&(e.textFormat=t),n!==""&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=On(this,e,t),o=n.getFirstChild();for(let r=this.getFirstChild();r;r=r.getNextSibling()){let s=t.getElementByKey(r.getKey());s!==null&&(o==null?(n.insertChild(s),o=s):o!==s&&n.replaceChild(s,o),o=o.nextSibling)}}}function P(e){return e instanceof $o}function G_(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}class Fc extends rn{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&U(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ve(e){return e instanceof Fc}class Ha extends $o{__cachedText;$config(){return this.config("root",{extends:$o})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){U(51)}getTextContent(){let e=this.__cachedText;return e===null||!br()&&He()._dirtyType!==0?super.getTextContent():e}remove(){U(52)}replace(e){U(53)}insertBefore(e){U(54)}insertAfter(e){U(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let o of n)P(o)||Ve(o)||U(282);return super.splice(e,t,n)}static importJSON(e){return vn().updateFromJSON(e)}collapseAtStart(){return!0}}function Ft(e){return e instanceof Ha}function AC(e){return new Wa(dx(e._nodeMap),null,e._slotsUsed)}function ag(){return new Wa(new Map([["root",new Ha]]),null,!1)}function $f(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&U(130,n.name),P(e)){let r=t.children;Array.isArray(r)||U(59,n.name);let s=e.getChildren();for(let i=0;i<s.length;i++){let l=$f(s[i]);r.push(l)}}let o=Wn(e);if(o.length>0){let r={};for(let s of o){let i=Ar(e,s);i===null&&U(366,n.name,s),r[s]=$f(i)}t.$slots=r}return t}function fR(e){return e instanceof Wa}class Wa{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return U_(t&&t.editor||null,this,e)}clone(e){let t=new Wa(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return t._readOnly=!0,t}toJSON(){return U_(null,this,()=>({root:$f(vn())}))}}class lg extends $o{$config(){return this.config("artificial",{extends:$o})}createDOM(e){return _n().createElement("div")}}class Ga extends rn{$config(){return this.config("linebreak",{importDOM:{br:(e)=>RC(e)||MC(e)?null:{conversion:gR,priority:0}}})}getTextContent(){return`
|
|
12
|
+
`}createDOM(){return _n().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function gR(e){return{node:Pc()}}function Pc(){return Xa(new Ga)}function wo(e){return e instanceof Ga}function RC(e){let t=e.parentElement;if(t!==null&&Eg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Mc(n)){let o=t.lastChild;if(o===e||o.previousSibling===e&&Mc(o))return!0}}return!1}function MC(e){let t=e.parentElement;if(t!==null&&Eg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Mc(n))return!1;let o=t.lastChild;if(o===e||o.previousSibling===e&&Mc(o))return!0}return!1}function Mc(e){return mo(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class ja extends $o{$config(){return this.config("paragraph",{extends:$o,importDOM:{p:()=>({conversion:pR,priority:0})}})}createDOM(e){let t=_n().createElement("p"),n=li(e.theme,"paragraph");if(n!==void 0)t.classList.add(...n);return t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(_t(t)){this.isEmpty()&&t.append(_n().createElement("br"));let n=this.getFormatType();n&&(t.style.textAlign=n)}return{element:t}}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(q);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=bn();n.setTextFormat(e.format),n.setTextStyle(e.style);let o=this.getDirection();return n.setDirection(o),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||q(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function pR(e){let t=bn();if(ay(t,e),sy(e,t),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in pc&&t.setFormat(n)}return iy(t,e),{node:t}}function bn(){return Xa(new ja)}function DC(e){return e instanceof ja}function hR(e){console.warn(e)}var ti=0,mR=1,_R=2,xR=3,CR=4,yR=-8,SR=-7,NR=-6,ER=-5,TR=-4;function $C(e,t,n,o,r){let s=e._keyToDOMMap;s.clear(),e._editorState=ag(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,r&&r.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent="",function(l,c){let u=`__lexicalKey_${c._key}`;delete l[u]}(t,e)),n!==null&&(n.textContent="",s.set("root",n),FC(n,e,"root"))}function wC(e){let t=new Set,n=new Set;for(let{klass:o,ownNodeConfig:r}of Ja(e)){let s=o.transform;if(!n.has(s)){n.add(s);let i=o.transform();i&&t.add(i)}if(r){let i=r.$transform;i&&t.add(i)}}return t}var wa={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,o)=>{},$exportDOM:(e,t)=>{let n=Bc(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,o,r)=>P(e)&&e.extractWithChild(t,n,o),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,o)=>null,$shouldExclude:(e,t,n)=>P(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,o)=>e.updateDOM(t,n,o._config)};function bR(e){let t=e||{},n=bC(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,s=t.disableEvents||!1,i=ag(),l=t.namespace||(r!==null?r._config.namespace:KC()),c=t.editorState,u=[Ha,ms,Ga,Ua,ja,lg,...t.nodes||[]],{onError:d,onWarn:f,html:p}=t,h=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let x=0;x<u.length;x++){let C=u[x],y=null,N=null;if(C&&typeof C=="object"){let b=C;C=b.replace,y=b.with,N=b.withKlass||null}if(typeof C!="function"||!C.prototype||!(C===rn||C.prototype instanceof rn)){let b="<unknown>";try{b=JSON.parse(ux)}catch(A){}U(365,String(x-u.length+(t.nodes?t.nodes.length:0)),typeof C=="function"?`${C.name}${typeof C.getType=="function"?` (type ${String(C.getType())})`:""}`:String(C),String(b))}qa(C);let E=C.getType(),v=wC(C);m.set(E,{exportDOM:p&&p.export?p.export.get(C):void 0,klass:C,replace:y,replaceWithKlass:N,sharedNodeState:mx(u[x]),transforms:v})}}let _=new _s(i,r,m,{disableEvents:s,dom:{...wa,...e&&e.dom},namespace:l,theme:o},d||console.error,f||hR,function(x,C){let y=new Map,N=new Set,E=(v)=>{Object.keys(v).forEach((b)=>{let A=y.get(b);A===void 0&&(A=[],y.set(b,A)),A.push(v[b])})};return x.forEach((v)=>{let b=v.klass.importDOM;if(b==null||N.has(b))return;N.add(b);let A=b.call(v.klass);A!==null&&E(A)}),C&&E(C),y}(m,p?p.import:void 0),h,e);return c!==void 0&&(_._pendingEditorState=c,_._dirtyType=2),function(x){x.registerCommand(jf,FA,ti),x.registerCommand(Yf,PA,ti),x.registerCommand(Vf,BA,ti),x.registerCommand(Xf,KA,ti),x.registerCommand(Qf,zA,ti)}(_),_}function vR(e,t){let n=e.get(t);e.delete(t),n&&n()}function da(e,t,n){return e.set(t,n),vR.bind(null,e,t)}class _s{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,o,r,s,i,l,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Sa,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=o,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=KC(),this._onError=r,this._onWarn=s,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return da(this._listeners.update,e)}registerEditableListener(e){return da(this._listeners.editable,e)}registerDecoratorListener(e){return da(this._listeners.decorator,e)}registerTextContentListener(e){return da(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Lg(da(t,e,e(this._rootElement,null)||void 0),()=>function(n,o,r){let s=n.get(o);s&&s(),n.set(o,o(...r)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&U(35);let o=this._commands;o.has(e)||o.set(e,[new ei,new ei,new ei,new ei,new ei]);let r=o.get(e);r===void 0&&U(36,String(e));let s=function(l){return 7&l}(n),i=r[s];return s!==n?i.addFront(t):i.addBack(t),()=>{i.delete(t),r.every((l)=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,n){let o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,r=this._listeners.mutation,s=r.get(t);s===void 0&&(s=new Set,r.set(t,s)),s.add(o);let i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,o),()=>{s.delete(o),s.size===0&&r.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&U(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,o=kf(n).get(t.getType());if(!o)return;let r=new Map;for(let s of o.keys())r.set(s,"created");r.size>0&&e(r,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),o=[n],r=n.replaceWithKlass;if(r!=null){let s=this.registerNodeTransformToKlass(r,t);o.push(s)}return function(s,i){let l=kf(s.getEditorState()),c=[];for(let u of i){let d=l.get(u);d&&c.push(d)}if(c.length===0)return;s.update(()=>{for(let u of c)for(let d of u.keys()){let f=ot(d);f&&f.markDirty()}},s._pendingEditorState===null?{tag:uc}:void 0)}(this,o.map((s)=>s.klass.getType())),()=>{o.forEach((s)=>s.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return re(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=li(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,$C(this,t,e,o,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||UA(t),n!=null&&t.classList.remove(...n)),e!==null){let r=xg(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=2,px(this),this._updateTags.add(uc),Nr(this),this._config.disableEvents||function(i,l){let c=i.ownerDocument;Tf.set(i,c);let u=Cc.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},Cc.set(c,u)),u.editors.add(l),u.hasShadowEditor=void 0,i.__lexicalEditor=l;let d=Jx(i);d.push(LA.register(c));for(let f=0;f<Ef.length;f++){let[p,h]=Ef[f],m=typeof h=="function"?(_)=>{S_(_)||(bf(_),(l.isEditable()||p==="click")&&h(_,l))}:(_)=>{if(S_(_))return;bf(_);let x=l.isEditable();switch(p){case"cut":return x&&re(l,tg,_);case"copy":return re(l,eg,_);case"paste":return x&&re(l,qf,_);case"dragstart":return x&&re(l,Bx,_);case"dragover":return x&&re(l,Kx,_);case"dragend":return x&&re(l,zx,_);case"focus":return x&&re(l,Hx,_);case"blur":return x&&re(l,Wx,_);case"drop":return x&&re(l,Px,_)}};d.push(ng(i,p,m))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(uc),Nr(this);ma("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&U(38);let n=e;n._readOnly&&(n=AC(e),n._selection=e._selection?e._selection.clone():null),gx(this);let o=this._pendingEditorState,r=t!==void 0?t.tag:null;o===null||o.isEmpty()||(r!=null&&this._updateTags.add(r),Nr(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Un(this,()=>{if(r&&this._updateTags.add(r),e._parsed)for(let[s,i]of n._nodeMap.entries())P(i)?this._dirtyElements.set(s,!0):this._dirtyLeaves.add(s)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(n,o,r){let s=ag(),i=Ut,l=mn,c=bt,{_dirtyElements:u,_dirtyLeaves:d,_cloneNotNeeded:f,_dirtyType:p}=o;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Ut=s,mn=!1,bt=o,cg(null);try{let h=o._nodes;Rc(n.root,h),r&&r(),s._readOnly=!0,s._parsed=!0}catch(h){h instanceof Error&&o._onError(h)}finally{o._dirtyElements=u,o._dirtyLeaves=d,o._cloneNotNeeded=f,o._dirtyType=p,Ut=i,mn=l,bt=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?["force-commit",e[0]]:e;return t==="force-commit"&&Nr(this),(t==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(n,o,r){n._updating?n._updates.push([o,r]):$a(n,o,r)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),Un(this,()=>{let o=Fe(),r=vn();o!==null?o.dirty||en(o.clone()):r.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?r.selectStart():r.selectEnd()),xs("focus"),GC(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Vn(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ma("editable",this,!0,e),this._slotsUsed&&this.update(()=>EC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=ux;var wf=null;function cg(e){wf=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),kC=1;function OR(){kC=1}function dg(e,t){let n=Bc(e,t);return n===void 0&&U(30,t),n}function Bc(e,t){return e._nodes.get(t)}var AR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function Kc(e,t){let n=t!==void 0?t:(()=>{let s=e.getRootNode();return gi(s)||sr(s)?ui(s):null})();if(!_t(n))return!1;if(n.hasAttribute("data-lexical-slot"))return!1;let o=gg(n),r=n.nodeName;return og(o)&&(r==="INPUT"||r==="TEXTAREA"||n.contentEditable==="true"&&Va(n)==null)}var RR=Kc;function Ya(e,t,n){let o=e.getRootElement();if(!o)return!1;try{if(!t||!o.contains(t)||!o.contains(n))return!1}catch(r){return!1}return ds(t)===e&&e.read("latest",()=>!Kc(t))}function zc(e){return e instanceof _s}function ds(e){let t=e;for(;t!=null;){let n=Va(t);if(zc(n))return n;t=Es(t)}return null}function Va(e){return e?e.__lexicalEditor:null}function MR(e){return iA.test(e)?"rtl":aA.test(e)?"ltr":null}function ka(e){return sg(e)||e.isToken()}function Hn(e){return ka(e)||e.isSegmented()}function mo(e){return mi(e)&&e.nodeType===3}function gi(e){return mi(e)&&e.nodeType===9}function IC(e){let t=e;for(;t!=null;){if(mo(t))return t;t=t.firstChild}return null}function vr(e,t,n){let o=jt[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~jt.superscript:t==="superscript"?r&=~jt.subscript:t==="lowercase"?(r&=~jt.uppercase,r&=~jt.capitalize):t==="uppercase"?(r&=~jt.lowercase,r&=~jt.capitalize):t==="capitalize"&&(r&=~jt.lowercase,r&=~jt.uppercase),r}function DR(e){return q(e)||wo(e)||Ve(e)}function LC(e,t){let n=function(){let i=wf;return wf=null,i}();if((t=t||n&&n.__key)!=null)return void(e.__key=t);zt(),NC();let o=He(),r=Io(),s=""+kC++;r._nodeMap.set(s,e),P(e)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.add(s),o._dirtyType===0&&(o._dirtyType=1),e.__key=s}function Kn(e){Vt(e)!==null&&U(380,e.__key,String(Vt(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),s=e.getNextSibling(),i=s!==null?s.__key:null,l=r!==null?r.__key:null,c=r!==null?r.getWritable():null,u=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=l),c!==null&&(c.__next=i),u!==null&&(u.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}var $R=Kn;function Dc(e){NC(),Sc(e)&&U(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent!==null?t.__parent:Or(t)?t.__slotHost:null,o=Io(),r=He(),s=o._nodeMap,i=r._dirtyElements;n!==null&&function(c,u,d){let f=c;for(;f!==null;){if(d.has(f))return;let p=u.get(f);if(p===void 0)break;d.set(f,!1),f=p.__parent!==null?p.__parent:Or(p)?p.__slotHost:null}}(n,s,i);let l=t.__key;r._dirtyType===0&&(r._dirtyType=1),P(e)?i.set(l,!0):r._dirtyLeaves.add(l)}function Lt(e){zt();let t=He(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=ot(n);o!==null&&o.getWritable()}if(e!==null){let o=ot(e);o!==null&&o.getWritable()}}}function Ao(){if(br())return null;return He()._compositionKey}function ot(e,t){let n=(t||Io())._nodeMap.get(e);return n===void 0?null:n}function fg(e,t){let n=pi(e,He());return n!==void 0?ot(n,t):null}function FC(e,t,n){e[`__lexicalKey_${t._key}`]=n}function pi(e,t){return e[`__lexicalKey_${t._key}`]}function gg(e,t){let n=e;for(;n!=null;){let o=fg(n,t);if(o!==null)return o;n=Es(n)}return null}function PC(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function j_(e){return e.read(()=>vn().getTextContent())}function vn(){return Io()._nodeMap.get("root")}function en(e){zt();let t=Io();e!==null&&(e.dirty=!0,e.setCachedNodes(null),fe(e)&&He()._slotsUsed&&hC(e)),t._selection=e}function Y_(){zt(),gx(He())}function oi(e){let t=function(n,o){let r=n;for(;r!=null;){let s=pi(r,o);if(s!==void 0)return s;r=Es(r)}return null}(e,He());return t===null?null:ot(t)}function BC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pg(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function KC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function zC(e){return mo(e)?e.nodeValue:null}function hg(e,t,n){let o=Vn(xn(t));if(o===null)return;let r=jn(o,t._rootElement),s=r.anchorNode,{anchorOffset:i,focusOffset:l}=r;if(s!==null){let c=zC(s),u=gg(s);if(c!==null&&q(u)){if((c===ya||c===zf)&&n){let d=n.length;c=n,i=d,l=d}c!==null&&mg(u,c,i,l,e)}}}function mg(e,t,n,o,r){let s=e;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing();if(s.isToken()&&i)return;let l=t;if((i||r)&&(t.endsWith(ya)&&(l=t.slice(0,-ya.length)),r)){let u=zf,d;for(;(d=l.indexOf(u))!==-1;)l=l.slice(0,d)+l.slice(d+u.length),n!==null&&n>d&&(n=Math.max(d,n-u.length)),o!==null&&o>d&&(o=Math.max(d,o-u.length))}let c=s.getTextContent();if(r||l!==c){let u=Fe();if(l===""){if(Lt(null),Ka||fs||za)s.remove();else{let _=He();lf(s,"",u),setTimeout(()=>{_.update(()=>{s.isAttached()&&s.getTextContent()===""&&s.remove()})},20)}return}let d=s.getParent(),f=Ns(),p=s.getTextContentSize(),h=Ao(),m=s.getKey();if(s.isToken()&&!i||h!==null&&m===h&&!i||fe(f)&&(d!==null&&!d.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===e.__key&&f.anchor.offset===0&&!s.canInsertTextBefore()&&!i||f.focus.key===e.__key&&f.focus.offset===p&&!s.canInsertTextAfter()&&!i))return void s.markDirty();if(!fe(u)||n===null||o===null)return void lf(s,l,u);if(u.setTextNodeRange(s,n,s,o),s.isSegmented()){let _=hn(s.getTextContent());s.replace(_),s=_}lf(s,l,u)}}}function lf(e,t,n){if(e.setTextContent(t),fe(n)){let o=e.getKey(),r=!1;for(let s of["anchor","focus"]){let i=n[s];i.type==="text"&&i.key===o&&(i.offset=po(e,i.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function sc(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function UC(e,t){return sc(e,t,"altKey")&&sc(e,t,"ctrlKey")&&sc(e,t,"shiftKey")&&sc(e,t,"metaKey")}function Ze(e,t,n){if(!UC(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1)return!1;if(e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;let o="Key"+t.toUpperCase();return e.code===o}var tr={ctrlKey:!Fn,metaKey:Fn},V_={altKey:Fn,ctrlKey:!Fn};function X_(e){return e.key==="Backspace"}function wR(e){let t=vn();if(fe(e)){let{anchor:n,focus:o}=e,r=n.getNode();if(Ft(r))return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),ni(e),e;let s=r.getTopLevelElementOrThrow(),i=s.getParent();if(i===null)return P(s)&&(n.set(s.getKey(),0,"element"),o.set(s.getKey(),s.getChildrenSize(),"element"),ni(e)),e;let l=i;return n.set(l.getKey(),0,"element"),o.set(l.getKey(),l.getChildrenSize(),"element"),ni(e),e}{let n=t.select(0,t.getChildrenSize());return en(ni(n)),n}}function li(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let s=Qa(r);return n[t]=s,s}return r}function _g(e,t,n,o,r){if(n.size===0)return;let{__type:s,__key:i}=o,l=t.get(s);l===void 0&&U(33,s);let c=l.klass,u=e.get(c);u===void 0&&(u=new Map,e.set(c,u));let d=u.get(i),f=d==="destroyed"&&r==="created";(d===void 0||f)&&u.set(i,f?"updated":r)}function kR(e){let t=e.getType(),n=Io();if(n._readOnly){let s=kf(n).get(t);return s?Array.from(s.values()):[]}let o=n._nodeMap,r=[];for(let[,s]of o)s instanceof e&&s.__type===t&&s.isAttached()&&r.push(s);return r}function q_(e,t,n){let o=e.getParent(),r=n,s=e;return o!==null&&(t&&n===0?(r=s.getIndexWithinParent(),s=o):t||n!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(t?r-1:r)}function HC(e,t){let n=e.offset;if(e.type==="element")return q_(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?q_(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function WC(e){let t=xn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function re(e,t,...n){return OC(e,t,n[0],e)}function ci(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&U(75,t),n}function Es(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return sr(n)?n.host:null}function Uc(e){return gi(e)?e:_t(e)?e.ownerDocument:null}function IR(e){return He()._updateTags.has(e)}function xs(e){zt(),He()._updateTags.add(e)}function GC(e){zt(),He()._deferred.push(e)}function Ia(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function xg(e){let t=Uc(e);return t?t.defaultView:null}function xn(e){let t=e._window;return t===null&&U(78),t}function jC(e){return P(e)&&e.isInline()||Ve(e)&&e.isInline()}function Cg(e){let t=e.getLatest();for(;t!==null;){if(Vt(t)!==null&&P(t))return t;let n=t.getParentOrThrow();if(vt(n))return n;t=n}return t}function yg(e){return P(e)&&e.isShadowRoot()}function vt(e){return Ft(e)||yg(e)}function Sg(e,t=!1){let n=e.constructor.clone(e,ug);return LC(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Xa(e){let t=He(),n=e.getType(),o=Bc(t,n);o===void 0&&U(200,e.constructor.name,n);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(e),l=i.constructor;return s!==null?i instanceof s||U(201,s.name,s.getType(),l.name,l.getType(),e.constructor.name,n):i instanceof e.constructor&&l!==e.constructor||U(202,l.name,l.getType(),e.constructor.name,n),i.__key===e.__key&&U(203,e.constructor.name,n,l.name,l.getType()),i}return e}function cf(e,t){!Ft(e.getParent())||P(t)||Ve(t)||U(99)}function YC(e){let t=ot(e);return t===null&&U(63,e),t}function gc(e){if(!e||e.isInline())return!1;if(Ve(e))return!0;if(P(e)){if(e.isShadowRoot()){let t=e.getParent();return!(P(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function $c(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Vn(e){return Yn?(e||window).getSelection():null}function VC(e){let t=xg(e);return t?t.getSelection():null}function sr(e){return ny(e)&&"host"in e}var LR=[];function XC(e){let t=e.getRootNode();if(t===e||!sr(t))return LR;let n=[t],o=t.host;for(;;){let r=o.getRootNode();if(r===o||!sr(r))break;n.push(r),o=r.host}return n}function*qC(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');let o=(gi(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=o.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function JC(e){return e!==null?e.ownerDocument:document}function _n(){let e=bC();return JC(e!==null?e._rootElement:null)}function hi(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;let n=XC(t);if(n.length===0)return null;let o=e.getComposedRanges;try{let r=o.call(e,{shadowRoots:n})[0];if(r!==void 0)return r}catch(r){}try{let r=o.apply(e,n)[0];if(r!==void 0)return r}catch(r){}return null}function ZC(e,t){let n=hi(e,t);if(n!==null){let o=QC(n);if(o!==null)return o}return e.rangeCount>0?e.getRangeAt(0):null}function jn(e,t){let n=hi(e,t);return n===null?e:ey(n,ty(e))}function FR(e,t){let n=hi(e,t);if(n===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let o=QC(n)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ey(n,ty(e)),range:o}}function QC(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch(o){return null}}function ey(e,t){let{startContainer:n,startOffset:o,endContainer:r,endOffset:s}=e;return t==="backward"?{anchorNode:r,anchorOffset:s,direction:t,focusNode:n,focusOffset:o}:{anchorNode:n,anchorOffset:o,direction:t,focusNode:r,focusOffset:s}}function ty(e){return e.direction}function wc(e){let t=e.getRootNode();return gi(t)||sr(t)?t.activeElement:null}function ui(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let n=t.shadowRoot.activeElement;if(n===null)break;t=n}return t}function Ng(e){let t=e.target;if(t!==null&&_t(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){let n=e.composedPath();if(n.length>0)return n[0]}return t}function PR(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),vt(e)&&U(102);let o=(i)=>{let l=i.getParentOrThrow(),c=vt(l),u=i!==n||c?Sg(i):i;if(c)return P(i)&&P(u)||U(133),i.insertAfter(u),[i,u,u];{let[d,f,p]=o(l),h=i.getNextSiblings();return p.append(u,...h),[d,f,u]}},[r,s]=o(n);return[r,s]}function BR(e){return _t(e)&&e.tagName==="A"}function KR(e){return _t(e)&&e.tagName==="TR"}function zR(e){return _t(e)&&(e.tagName==="TD"||e.tagName==="TH")}function _t(e){return mi(e)&&e.nodeType===1}function mi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function ny(e){return mi(e)&&e.nodeType===11}var UR=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function oy(e){return!(!_t(e)||!e.style.display.startsWith("inline"))||UR.test(e.nodeName)}var HR=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Eg(e){return(!_t(e)||!e.style.display.startsWith("inline"))&&HR.test(e.nodeName)}function pn(e){if(Ve(e)&&!e.isInline())return!0;if(!P(e)||vt(e))return!1;let t=e.getFirstChild(),n=t===null||wo(t)||q(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function _o(){return He()}function Tg(e=_o()){return e._config.dom||wa}function On(e,t,n=_o()){let o=Tg(n).$getDOMSlot(e,t,n);return P(e)&&(ry(o)||U(344,e.getKey(),e.getType())),o}function WR(e,t,n,o){let r=e.read("latest",()=>{let s=ot(t);return s!==null?function(i,l,c=_o()){let u=Ar(i,l);if(u===null)return null;let d=c.getElementByKey(u.getKey());return d!==null?d.parentElement:null}(s,n,e):null});return r!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display=""),r}function GR(e,t,n){n.style.display="none";let o=e.getElementByKey(t);o!==null&&n.parentElement!==o&&o.insertBefore(n,o.firstChild)}function ry(e){return e instanceof si}function rr(e,t,n=_o()){return IC(On(e,t,n).element)}var J_=new WeakMap,jR=new Map;function kf(e){if(!e._readOnly&&e.isEmpty())return jR;e._readOnly||U(192);let t=J_.get(e);return t||(t=function(n){let o=new Map;for(let[r,s]of n._nodeMap){let i=s.__type,l=o.get(i);l||(l=new Map,o.set(i,l)),l.set(r,s)}return o}(e),J_.set(e,t)),t}function bg(e){let t=e.constructor.clone(e,ug);return t.afterCloneFrom(e),t}function YR(e){return(t=bg(e))[Zx]=!0,t;var t}function sy(e,t){let n=e.getAttribute("data-lexical-indent");if(n!==null){let s=parseInt(n,10);if(Number.isFinite(s)&&s>=0)return void t.setIndent(s)}let o=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(o/40);t.setIndent(r)}function iy(e,t){let n=t.getAttribute("dir");return n==="ltr"||n==="rtl"?e.setDirection(n):e}function ay(e,t){let n=t.style.textAlign;return n&&n in pc?e.setFormat(n):e}function ly(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function cy(e,t=_o()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}function La(e,t){let n=e;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(_t(n)&&n.hasAttribute("data-lexical-slot"))return!1;if(pi(n,t)!==void 0)return!1;n=Es(n)}return!1}function fa(e,t){return function(n,o){return Object.prototype.hasOwnProperty.call(n,o)}(e,t)&&e[t]!==rn[t]}var Z_=new WeakMap,Q_=Symbol("lexical.synthesizedGetType");function qa(e){let t=Z_.get(e);if(t)return t;let n=e.prototype!=null&&Zm in e.prototype?e.prototype[Zm]():void 0,o=function(u){if(!(u===rn||u.prototype instanceof rn)){let d="<unknown>",f="<unknown>";try{d=u.getType()}catch(p){}try{_s.version&&(f=JSON.parse(_s.version))}catch(p){}U(290,u.name,d,f)}return u===Fc||u===$o||u===rn}(e),r=!o&&fa(e,"getType")?e.getType:void 0,s=r&&!(Q_ in r)?r.call(e):void 0,i,l=s;if(n)if(s)i=n[s];else{for(let[u,d]of Object.entries(n))l=u,i=d;if(!i)for(let u of Object.getOwnPropertySymbols(n)){let d=n[u];if(d){i=d;break}}}if(!o&&l){if(!fa(e,"getType")){let u=e,d=function(){return this!==u?rn.getType.call(this):l};d[Q_]=!0,e.getType=d}if(fa(e,"clone")||(e.clone=(u,d)=>{cg(u);let f=new e;return d!==ug&&f.afterCloneFrom(u),f}),fa(e,"importJSON")||(e.importJSON=i&&i.$importJSON||((u)=>new e().updateFromJSON(u))),!fa(e,"importDOM")&&i){let{importDOM:u}=i;u&&(e.importDOM=()=>u)}}let c={klass:e,ownNodeConfig:i,ownNodeType:l};return Z_.set(e,c),c}function*Ja(e){for(let t=e;t&&(t===rn||og(t.prototype));){let n=qa(t);yield n,t=n.ownNodeConfig&&n.ownNodeConfig.extends||uy(t)}}function VR(e){let t=new Map,n=new Map;for(let o of e){let{ownNodeType:r}=qa(o);r&&(n.set(r,o),t.set(r,new Set))}for(let[o,r]of n)for(let{ownNodeType:s}of Ja(r)){let i=s&&t.get(s);i&&i.add(o)}return t}function XR(e){let t=_o();return zt(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var yr=(e,t)=>{let n=e;for(;n!=null&&!Ft(n);){if(t(n))return n;n=n.getParent()}return null};function Fa(e,t){let n=[],o=e.__first;for(;o!==null;){let r=t===null?ot(o):t.get(o);r==null&&U(174),n.push(o),o=r.__next}return n}function uy(e){let t=Object.getPrototypeOf(e);if(typeof t=="function"&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var dy=new Map;function Ro(e){return P(e)||Ve(e)}function Or(e){return P(e)||Ve(e)}function Vt(e){let t=e.getLatest();return Or(t)?t.__slotHost:null}function zn(e){let t=Vt(e);if(t===null)return null;let n=ot(t);return P(n)||Ve(n)||U(370),n}function fy(e){let t=zn(e);if(t===null)return null;let n=e.getLatest().__key;for(let[o,r]of Hc(t))if(r===n)return o;return null}function gy(e){let t=e.getLatest();for(;t!==null;){if(Vt(t)!==null)return t;t=t.getParent()}return null}function Hc(e){let t=e.getLatest();return Ro(t)&&t.__slots!==null?t.__slots:dy}function Wn(e){return Array.from(Hc(e).keys())}function Ar(e,t){let n=Hc(e).get(t);return n===void 0?null:ot(n)}var qR=["__proto__","constructor","prototype"],ex=Symbol("slotMapOwner");function If(e){let t=e.__slots;return t!==null&&t[ex]===e||(t=new Map(t),t[ex]=e,e.__slots=t),t}var tx=new WeakMap,JR=[];function py(e){for(let{ownNodeConfig:t}of Ja(e)){let n=t&&t.slots;if(n)return n}return JR}function hy(e){let t="";for(let n of Wn(e)){let o=Ar(e,n);o!==null&&(t+=o.getTextContent())}return t}function nx(e,t,n){let o=n.get(e),r=n.get(t);return o!==void 0?r!==void 0?o-r:-1:r!==void 0?1:e<t?-1:e>t?1:0}function ZR(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(i){let l=tx.get(i);if(l===void 0){let c=py(i),u=new Map;for(let d of c)qR.includes(d)&&U(371,i.name,d),u.has(d)&&U(372,i.name,d),u.set(d,u.size);l=u,tx.set(i,l)}return l}(e.constructor),o=null,r=!0;for(let i of t.keys()){if(o!==null&&nx(o,i,n)>0){r=!1;break}o=i}if(r)return;let s=Array.from(t).sort(([i],[l])=>nx(i,l,n));t.clear();for(let[i,l]of s)t.set(i,l)}function Og(e,t,n){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||U(373,t);let o=e.getLatest();if(o.__slots!==null&&o.__slots.get(t)===n.getLatest().__key)return o;(!P(n)&&!Ve(n)||n.isInline())&&U(374,n.__key);let r=e.getWritable(),s=If(r),i=s.get(t);i!==void 0&&_y(i);let l=n.getWritable(),c=zn(l);if(c!==null){let u=fy(l);u!==null&&If(c.getWritable()).delete(u),l.__slotHost=null}return Kn(l),l.__slotHost=r.__key,s.set(t,l.__key),ZR(r),function(){let u=_o();u._slotsUsed=!0,u._pendingEditorState&&(u._pendingEditorState._slotsUsed=!0)}(),r}function my(e,t){let n=e.getWritable();if(n.__slots===null)return n;let o=n.__slots.get(t);return o!==void 0&&(_y(o),If(n).delete(t)),n}function ox(e,t){}function _y(e){let t=ot(e);if(t===null)return;let n=t.getWritable();Or(n)||U(377,e),n.__slotHost=null,n.remove()}var QR={next:"previous",previous:"next"};class Za{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:Rr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return Ct(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ct(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){let o=n===this.direction?t:Array.from(t).reverse(),r=this,s=this.getParentAtCaret(),i=new Map;for(let l=r.getAdjacentCaret();l!==null&&i.size<e;l=l.getAdjacentCaret()){let c=l.origin.getWritable();i.set(c.getKey(),c)}for(let l of o){if(i.size>0){let c=r.getNodeAtCaret();if(c)if(i.delete(c.getKey()),i.delete(l.getKey()),c.is(l)||r.origin.is(l));else{let u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}else c===null&&U(263,Array.from(i).join(" "))}else r.insert(l);r=Ct(l,this.direction)}for(let l of i.values())l.remove();return this}}class Pa extends Za{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ir(e,this.direction)}getParentCaret(e="root"){return Ct(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=kr(this.direction);return Ct(this.getNodeAtCaret(),e)||ir(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Pa&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var eM={root:Ft,shadowRoot:vt};function kr(e){return QR[e]}function Ag(e,t="root"){return e===null||eM[t](e)?null:Vt(e)===null?e:null}class Cs extends Za{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ct(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return P(this.origin)?ir(this.origin,this.direction):null}getParentCaret(e="root"){return Ct(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=kr(this.direction);return Ct(this.getNodeAtCaret(),e)||ir(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Cs&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ys extends Za{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Mr(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Ct(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Mr(this.origin,kr(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ys&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Ct(this.origin,this.direction)}}function go(e){return e instanceof ys}function tM(e){return e instanceof Za}function Rr(e){return e instanceof Cs}function Gn(e){return e instanceof Pa}var nM={next:class extends ys{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ys{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},oM={next:class extends Cs{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Cs{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rM={next:class extends Pa{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Pa{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Ct(e,t){return e?new oM[t](e):null}function Mr(e,t,n){return e?new nM[t](e,po(e,n)):null}function po(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&ix(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function Lf(e,t){return new Mg(e,t)}function ir(e,t){return P(e)?new rM[t](e):null}function xy(e){return e&&e.getChildCaret()||e}function di(e){return e&&xy(e.getAdjacentCaret())}class Rg{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Rg(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=(o)=>{let r=this[o].getLatest();return go(r)?function(s,i){let{direction:l,origin:c}=s,u=po(c,i==="focus"?kr(l):l);return Lf(s,u-s.offset)}(r,o):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:o}=t,{caret:r}=n;if(o.isSameNodeCaret(r))return[Lf(o,r.offset-o.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=go(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),o=go(n),r=(s)=>s.isSameNodeCaret(n)?null:di(s)||s.getParentCaret(e);return $g({hasNext:(s)=>s!==null&&!(o&&n.isSameNodeCaret(s)),initial:t.isSameNodeCaret(n)?null:r(t),map:(s)=>s,step:r})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Mg{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,o]=this.getSliceIndices(),r=e.getTextContent();return Mr(e.setTextContent(r.slice(0,n)+r.slice(o)),t,n)}}function sM(e){return e instanceof Mg}function Dg(e){return Dr(e,Ct(vn(),e.direction))}function Cy(e){return Dr(e,e)}function Dr(e,t){return e.direction!==t.direction&&U(265),new Rg(e,t,e.direction)}function $g(e){let{initial:t,hasNext:n,step:o,map:r}=e,s=t;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function wg(e,t){let n=kc(e.origin,t.origin);switch(n===null&&U(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?function(s,i){return Math.sign(s-i)}(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return kg(n)}}function kg(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,s=t,i=n;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function ic(e,t){return t.is(e)}function rx(e){return P(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function kc(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=rx(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=rx(t);o;r=o,o=o.getParent()){let s=n.get(o);if(s!==void 0)return s===null?(ic(e,o)||U(276),{commonAncestor:o,type:"ancestor"}):r===null?(ic(t,o)||U(277),{commonAncestor:o,type:"descendant"}):((P(s)||ic(e,s))&&(P(r)||ic(t,r))&&o.is(s.getParent())&&o.is(r.getParent())||U(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function wr(e,t){let{type:n,key:o,offset:r}=e,s=YC(e.key);return n==="text"?(q(s)||U(266,s.getType(),o),Mr(s,t,r)):(P(s)||U(267,s.getType(),o),Ey(s,e.offset,t))}function Ba(e,t){let{origin:n,direction:o}=t,r=o==="next";go(t)?e.set(n.getKey(),t.offset,"text"):Rr(t)?q(n)?e.set(n.getKey(),po(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Gn(t)&&P(n)||U(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function yy(e){let t=Fe(),n=fe(t)?t:CC();return _a(n,e),en(n),n}function _a(e,t){Ba(e.anchor,t.anchor),Ba(e.focus,t.focus)}function Ff(e){let{anchor:t,focus:n}=e,o=wr(t,"next"),r=wr(n,"next"),s=wg(o,r)<=0?"next":"previous";return Dr(ko(o,s),ko(r,s))}function Ts(e){let{direction:t,origin:n}=e,o=Ct(n,kr(t)).getNodeAtCaret();return o?Ct(o,t):ir(n.getParentOrThrow(),t)}function sx(e,t="root"){let n=[e];for(let o=Gn(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Ts(o));return n}function uf(e){return!!e&&e.origin.isAttached()}function Sy(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,s=Ig(e,o),i=sx(s.anchor,n),l=sx(s.focus.getFlipped(),n),c=new Set,u=[];for(let _ of s.iterNodeCarets(n))if(Gn(_))c.add(_.origin.getKey());else if(Rr(_)){let{origin:x}=_;P(x)&&!c.has(x.getKey())||u.push(x)}let d=new Set;for(let _ of u){let x=_.getParent();x===null||c.has(x.getKey())||d.add(x),Kn(_)}for(let _ of d)!_.canBeEmpty()&&!vt(_)&&_.isEmpty()&&_.isAttached()&&_.remove();for(let _ of s.getTextSlices()){if(!_)continue;let{origin:x}=_.caret,C=x.getTextContentSize(),y=Ts(Ct(x,o)),N=x.getMode();if(Math.abs(_.distance)===C&&r==="removeEmptySlices"||N==="token"&&_.distance!==0)y.remove();else if(_.distance!==0){r="removeEmptySlices";let E=_.removeTextSlice(),v=_.caret.origin;if(N==="segmented"){let b=E.origin,A=hn(b.getTextContent()).setStyle(b.getStyle()).setFormat(b.getFormat());y.replaceOrInsert(A),E=Mr(A,o,E.offset)}v.is(i[0].origin)&&(i[0]=E),v.is(l[0].origin)&&(l[0]=E.getFlipped())}}let f,p;for(let _ of i)if(uf(_)){f=Mo(_);break}for(let _ of l)if(uf(_)){p=Mo(_);break}let h=function(_,x,C){if(!_||!x)return null;let y=_.getParentAtCaret(),N=x.getParentAtCaret();if(!y||!N)return null;let E=y.getParents().reverse();E.push(y);let v=N.getParents().reverse();v.push(N);let b=Math.min(E.length,v.length),A;for(A=0;A<b&&E[A]===v[A];A++);let O=(k,J)=>{let V;for(let oe=A;oe<k.length;oe++){let B=k[oe];if(vt(B))return;!V&&J(B)&&(V=B)}return V},D=O(E,pn),H=D&&O(v,(k)=>C.has(k.getKey())&&pn(k));if(H&&Wn(H).length>0)return null;return D&&H?[D,H]:null}(f,p,c);if(h){let[_,x]=h;ir(_,"previous").splice(0,x.getChildren());let C=x.getParent();for(x.remove(!0);C&&C.isEmpty();){let y=C;C=C.getParent(),y.remove(!0)}}else if(p){let _=function(y){if(Gn(y)){let N=y.origin;if(pn(N))return N}else{let N=y.getParentAtCaret();if(N&&pn(N))return N}return null}(p),x=_&&_.getParent(),C=_&&_.getParents().findLast(yg);if(_&&x&&!Ft(x)&&_.isEmpty()&&c.has(_.getKey())&&Wn(_).length===0&&(!C||c.has(C.getKey()))){_.remove(!0);let y=x;for(;y&&!Ft(y)&&y.isEmpty();){let N=y.getParent();if(N&&Ft(N)&&N.getChildrenSize()<=1)break;let E=y;y=N,E.remove(!0)}}}let m=[f,p,...i,...l].find(uf);if(m)return Cy(ko(Mo(m),e.direction));U(269,JSON.stringify(i.map((_)=>_.origin.__key)))}function Mo(e){let t=function(r){let s=r;for(;Gn(s);){let i=di(s);if(!Gn(i))break;s=i}return s}(e.getLatest()),{direction:n}=t;if(q(t.origin))return go(t)?t:Mr(t.origin,n,n);let o=t.getAdjacentCaret();return Rr(o)&&q(o.origin)?Mr(o.origin,n,kr(n)):t}function Ny(e){return go(e)&&e.offset!==po(e.origin,e.direction)}function ko(e,t){return e.direction===t?e:e.getFlipped()}function Ig(e,t){return e.direction===t?e:Dr(ko(e.focus,t),ko(e.anchor,t))}function Ey(e,t,n){let o=ir(e,"next");for(let r=0;r<t;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return ko(o,n)}function iM(e,t="root"){let n=0,o=e,r=di(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=di(o)}return r&&[r,n]}function aM(e){let{origin:t,offset:n,direction:o}=e;if(n===po(t,o))return e.getSiblingCaret();if(n===po(t,kr(o)))return Ts(e.getSiblingCaret());let[r]=t.splitText(n);return q(r)||U(281),ko(Ct(r,"next"),o)}function lM(e,t){return!0}function Ty(e,{$copyElementNode:t=Sg,$splitTextPointCaretNext:n=aM,rootMode:o="shadowRoot",$shouldSplit:r=lM,removeEmptyDestination:s=!1}={}){if(go(e))return n(e);let i=e.getParentCaret(o);if(i){let{origin:l}=i;if(Gn(e)){let u=Ts(i);if(s&&l.isEmpty())return l.remove(),u;if(!l.canBeEmpty()||!r(l,"first"))return u}let c=function(u){let d=[];for(let f=u.getAdjacentCaret();f;f=f.getAdjacentCaret())d.push(f.origin);return d}(e);(c.length>0||!s&&l.canBeEmpty()&&r(l,"last"))&&i.insert(t(l).splice(0,0,c))}return i}function by(e,t,n){let o=ko(t,"next");go(o)&&(o.offset===0?o=Ct(o.origin,"previous").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=Ct(o.origin,"next"))),o.origin.is(e)&&(Rr(o)||U(342,e.getKey(),e.getType()),o=Ts(o)),(e.is(o.getNodeAtCaret())||e.is(o.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let r=o;r;r=Ty(r,n))o=r;return go(o)&&U(283),o.insert(e.isInline()?bn().append(e):e),ko(Ct(e.getLatest(),"next"),t.direction)}function cM(e){return e}function uM(...e){return e}function dM(e,t){return[e,t]}function fM(e){return e}function gM(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Qa(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function pM(e,...t){let n=Qa(...t);n.length>0&&e.classList.add(...n)}function hM(e,...t){let n=Qa(...t);n.length>0&&e.classList.remove(...n)}function Lg(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function mM(e,t,n){return Lg(...Object.entries(t).map(([o,r])=>ng(e,o,r,n)))}var T=Fg,{$addUpdateTag:el,$applyNodeReplacement:sn,$assumeActiveEditor:vy,$caretFromPoint:an,$caretRangeFromSelection:ar,$cloneWithProperties:Wc,$cloneWithPropertiesEphemeral:Oy,$comparePointCaretNext:Fr,$copyNode:Ht,$create:Gc,$createChildrenArray:V1,$createLineBreakNode:ln,$createNodeSelection:jc,$createParagraphNode:ye,$createPoint:Xn,$createRangeSelection:Pr,$createRangeSelectionFromDom:Ay,$createTabNode:cn,$createTextNode:xt,$extendCaretToRange:bs,$findMatchingParent:pe,$formatText:Ry,$fullReconcile:_i,$generateNodesFromRawText:tl,$getAdjacentChildCaret:nl,$getAdjacentNode:X1,$getAdjacentSiblingOrParentSiblingCaret:vs,$getCaretInDirection:My,$getCaretRange:qn,$getCaretRangeInDirection:cr,$getCharacterOffsets:Dy,$getChildCaret:Et,$getChildCaretAtIndex:Pg,$getChildCaretOrSelf:Bg,$getCollapsedCaretRange:Os,$getCommonAncestor:q1,$getCommonAncestorResultBranchOrder:J1,$getDOMSlot:$y,$getDOMTextNode:wy,$getDocument:je,$getEditor:Ke,$getEditorDOMRenderConfig:Kg,$getNearestNodeFromDOMNode:Tt,$getNearestRootOrShadowRoot:Z1,$getNodeByKey:Ot,$getNodeByKeyOrThrow:ky,$getNodeFromDOMNode:Iy,$getPreviousSelection:Cn,$getRoot:Xe,$getSelection:K,$getSiblingCaret:it,$getSlot:Ci,$getSlotFrame:Jn,$getSlotHost:Yc,$getSlotNameWithinHost:Q1,$getSlotNames:As,$getState:Lo,$getStateChange:eL,$getTextContent:tL,$getTextNodeOffset:nL,$getTextPointCaret:Vc,$getTextPointCaretSlice:oL,$getWritableNodeState:rL,$hasAncestor:ol,$hasUpdateTag:sL,$insertNodeToNearestRootAtCaret:Br,$insertNodes:Xc,$isBlockElementNode:Kr,$isChildCaret:Fo,$isDecoratorNode:Dt,$isEditorState:Ly,$isElementDOMSlot:iL,$isElementNode:j,$isExtendableTextPointCaret:rl,$isInlineElementOrDecoratorNode:zg,$isInlineFormattable:aL,$isLeafNode:sl,$isLexicalNode:Ug,$isLineBreakNode:Pe,$isNodeCaret:lL,$isNodeSelection:Je,$isParagraphNode:An,$isRangeSelection:I,$isRootNode:xo,$isRootOrShadowRoot:At,$isSelectionCapturedInDecoratorInput:Fy,$isShadowRootNode:qc,$isSiblingCaret:Co,$isSlotChild:cL,$isSlotHost:il,$isTabNode:Wt,$isTextNode:ne,$isTextPointCaret:zr,$isTextPointCaretSlice:uL,$isTokenOrSegmented:Hg,$isTokenOrTab:dL,$markSlotEditable:fL,$needsBlockCursorBeside:Py,$nodesOfType:gL,$normalizeCaret:$t,$normalizeSelection__EXPERIMENTAL:Po,$onUpdate:By,$parseSerializedNode:Ky,$removeFromParent:pL,$removeSlot:hL,$removeTextFromCaretRange:zy,$rewindSiblingCaret:Ko,$selectAll:Ur,$setCompositionKey:mL,$setDirectionFromDOM:yn,$setFormatFromDOM:Zn,$setPointFromCaret:zo,$setSelection:pt,$setSelectionFromCaretRange:Rn,$setSlot:_L,$setState:Qn,$setTextFormat:Uy,$splitAtPointCaretNext:Jc,$splitNode:Hy,$updateDOMSelection:Wy,$updateRangeSelectionFromCaretRange:xL,ArtificialNode__DO_NOT_USE:al,BEFORE_INPUT_COMMAND:CL,BLUR_COMMAND:yL,CAN_REDO_COMMAND:Rs,CAN_UNDO_COMMAND:Ms,CAN_USE_BEFORE_INPUT:cl,CAN_USE_DOM:un,CLEAR_EDITOR_COMMAND:Zc,CLEAR_HISTORY_COMMAND:Gy,CLICK_COMMAND:yi,COLLABORATION_TAG:jy,COMMAND_PRIORITY_BEFORE_CRITICAL:Yy,COMMAND_PRIORITY_BEFORE_EDITOR:Qc,COMMAND_PRIORITY_BEFORE_HIGH:SL,COMMAND_PRIORITY_BEFORE_LOW:NL,COMMAND_PRIORITY_BEFORE_NORMAL:EL,COMMAND_PRIORITY_CRITICAL:Si,COMMAND_PRIORITY_EDITOR:Ee,COMMAND_PRIORITY_HIGH:$n,COMMAND_PRIORITY_LOW:we,COMMAND_PRIORITY_NORMAL:TL,COMPOSITION_END_COMMAND:bL,COMPOSITION_END_TAG:eu,COMPOSITION_START_COMMAND:Vy,COMPOSITION_START_TAG:tu,CONTROLLED_TEXT_INSERTION_COMMAND:nu,COPY_COMMAND:Ni,CUT_COMMAND:ou,CUT_TAG:ru,DEFAULT_EDITOR_DOM_CONFIG:Wg,DELETE_CHARACTER_COMMAND:Ei,DELETE_LINE_COMMAND:su,DELETE_WORD_COMMAND:iu,DRAGEND_COMMAND:vL,DRAGOVER_COMMAND:Xy,DRAGSTART_COMMAND:qy,DROP_COMMAND:Jy,DecoratorNode:au,ElementNode:lt,FOCUS_COMMAND:Zy,FORMAT_ELEMENT_COMMAND:lu,FORMAT_TEXT_COMMAND:Uo,HISTORIC_TAG:Ti,HISTORY_MERGE_TAG:Hr,HISTORY_PUSH_TAG:cu,INDENT_CONTENT_COMMAND:eo,INPUT_COMMAND:OL,INSERT_LINE_BREAK_COMMAND:Gg,INSERT_PARAGRAPH_COMMAND:Wr,INSERT_TAB_COMMAND:Ds,INTERNAL_$isBlock:ul,IS_ALL_FORMATTING:AL,IS_ANDROID:Qy,IS_ANDROID_CHROME:eS,IS_APPLE:dl,IS_APPLE_WEBKIT:uu,IS_BOLD:fl,IS_CHROME:tS,IS_CODE:nS,IS_FIREFOX:$s,IS_HIGHLIGHT:oS,IS_IOS:gl,IS_ITALIC:pl,IS_SAFARI:fu,IS_STRIKETHROUGH:hl,IS_SUBSCRIPT:gu,IS_SUPERSCRIPT:pu,IS_UNDERLINE:ml,KEY_ARROW_DOWN_COMMAND:Ho,KEY_ARROW_LEFT_COMMAND:Gr,KEY_ARROW_RIGHT_COMMAND:bi,KEY_ARROW_UP_COMMAND:to,KEY_BACKSPACE_COMMAND:vi,KEY_DELETE_COMMAND:hu,KEY_DOWN_COMMAND:RL,KEY_ENTER_COMMAND:Oi,KEY_ESCAPE_COMMAND:Ai,KEY_MODIFIER_COMMAND:ML,KEY_SPACE_COMMAND:mu,KEY_TAB_COMMAND:jr,LineBreakNode:rS,MOVE_TO_END:_l,MOVE_TO_START:Ri,NODE_STATE_DIRECT:DL,NODE_STATE_KEY:$L,NODE_STATE_LATEST:wL,OUTDENT_CONTENT_COMMAND:Wo,PASTE_COMMAND:Mi,PASTE_TAG:_u,ParagraphNode:sS,REDO_COMMAND:xu,REMOVE_TEXT_COMMAND:iS,RootNode:Cu,SELECTION_CHANGE_COMMAND:no,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:yu,SELECT_ALL_COMMAND:Di,SET_TEXT_FORMAT_COMMAND:aS,SKIP_COLLAB_TAG:kL,SKIP_DOM_SELECTION_TAG:lS,SKIP_SCROLL_INTO_VIEW_TAG:cS,SKIP_SELECTION_FOCUS_TAG:Su,TEXT_TYPE_TO_FORMAT:$i,TabNode:Nu,TextNode:wn,UNDO_COMMAND:Eu,addClassNamesToElement:Qe,buildImportMap:jg,configExtension:tn,createCommand:Sn,createEditor:Tu,createRefCountedRegistry:IL,createSharedNodeState:LL,createState:Go,declarePeerDependency:uS,defineExtension:me,findAllLexicalElementsDeep:dS,flipDirection:fS,getActiveElement:yo,getActiveElementDeep:gS,getComposedEventTarget:xl,getComposedStaticRange:FL,getDOMOwnerDocument:PL,getDOMSelection:kn,getDOMSelectionFromTarget:BL,getDOMSelectionPoints:ws,getDOMSelectionRange:pS,getDOMSelectionRangeAndPoints:KL,getDOMShadowRoots:hS,getDOMTextNode:mS,getDeclaredSlots:zL,getEditorPropertyFromDOMNode:bu,getNearestEditorFromDOMNode:vu,getParentElement:Cl,getRegisteredNode:UL,getRegisteredNodeOrThrow:HL,getRegisteredSubtypeMap:Ou,getRootOwnerDocument:ks,getStaticNodeConfig:_S,getStyleObjectFromCSS:Vr,getTextDirection:xS,getTransformSetFromKlass:WL,isBlockDomNode:Is,isCurrentlyReadOnlyMode:CS,isDOMCapturingSelection:GL,isDOMDocumentNode:Xr,isDOMNode:oo,isDOMShadowRoot:Au,isDOMTextNode:Ls,isDOMUnmanaged:jL,isDocumentFragment:Yg,isExactShortcutMatch:yS,isHTMLAnchorElement:wi,isHTMLElement:Ce,isHTMLTableCellElement:YL,isHTMLTableRowElement:SS,isInlineDomNode:ki,isLastChildInBlockNode:NS,isLexicalEditor:Ru,isModifierMatch:VL,isOnlyChildInBlockNode:ES,isSelectionCapturedInDecoratorInput:XL,isSelectionWithinEditor:TS,iterStaticNodeConfigChain:bS,makeStepwiseIterator:Vg,mergeRegister:Oe,mountSlotContainer:qL,normalizeClassNames:Ii,registerEventListener:ro,registerEventListeners:qr,removeClassNamesFromElement:nn,removeFromParent:JL,resetRandomKey:ZL,safeCast:Be,setDOMStyleFromCSS:ur,setDOMStyleObject:QL,setDOMUnmanaged:Mu,setNodeIndentFromDOM:Jr,shallowMergeConfig:Pt,stopLexicalPropagation:Xg,toggleTextFormatType:qg,tokenizeRawText:Li,unmountSlotContainer:eF}=T;L();var _M=un?nt:S,Du={tag:Hr};function xM({initialConfig:e,children:t}){let n=Q(()=>{let{theme:o,namespace:r,nodes:s,onError:i,onWarn:l,editorState:c,html:u}=e,d=Jm(null,o),f=Tu({editable:e.editable,html:u,namespace:r,nodes:s,onError:(p)=>i(p,f),...l?{onWarn:(p)=>l(p,f)}:{},theme:o});return function(p,h){if(h===null)return;if(h===void 0)p.update(()=>{let m=Xe();if(m.isEmpty()){let _=ye();m.append(_);let x=p.getRootElement(),C=un&&x!==null?yo(x):null;(K()!==null||C!==null&&C===x)&&_.select()}},Du);else if(h!==null)switch(typeof h){case"string":{let m=p.parseEditorState(h);p.setEditorState(m,Du);break}case"object":p.setEditorState(h,Du);break;case"function":p.update(()=>{Xe().isEmpty()&&h(p)},Du)}}(f,c),[f,d]},[]);return _M(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),a(qm.Provider,{value:n,children:t})}var CM=Jg,vS=CM.LexicalComposer;L();var yM=un?nt:S;function SM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(t)=>e.registerEditableListener(t)}}function NM(){return function(e){let[t]=st(),n=Q(()=>e(t),[t,e]),[o,r]=w(()=>n.initialValueFn()),s=M(o);return yM(()=>{let{initialValueFn:i,subscribe:l}=n,c=i();return s.current!==c&&(s.current=c,r(c)),l((u)=>{s.current=u,r(u)})},[n,e]),o}(SM)}var EM=Zg,OS=EM.useLexicalEditable;function ep(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function AS(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function RS(e){let t=e.parentNode;if(t==null)throw Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function TM(e,t,n,o,r){let s=t.getKey(),i=o.getKey(),l=ks(e.getRootElement()).createRange(),c=e.getElementByKey(s),u=e.getElementByKey(i),d=n,f=r;if(ne(t)&&(c=AS(c)),ne(o)&&(u=AS(u)),t===void 0||o===void 0||c===null||u===null)return null;c.nodeName==="BR"&&([c,d]=RS(c)),u.nodeName==="BR"&&([u,f]=RS(u));let p=c.firstChild;c===u&&p!=null&&p.nodeName==="BR"&&d===0&&f===0&&(f=1);try{l.setStart(c,d),l.setEnd(u,f)}catch(h){return null}return!l.collapsed||d===f&&s===i||(l.setStart(u,f),l.setEnd(c,d)),l}function bM(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(t.getClientRects()),l,c=i.length;i.sort((u,d)=>{let f=u.top-d.top;return Math.abs(f)<=3?u.left-d.left:f});for(let u=0;u<c;u++){let d=i[u],f=l&&l.top<=d.top&&l.top+l.height>d.top&&l.left+l.width>d.left,p=d.width+s===o.width;f||p?(i.splice(u--,1),c--):l=d}return i}function DS(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function tp(e){let t=Ke().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function np(e){return tp(xo(e)?e:e.getParentOrThrow())}function vM(e){let t=np(e);return t!==null&&t.direction==="rtl"}function OM(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!Hg(t)&&o!==null){let[r,s]=o,i=e.isBackward(),l=r.getNode(),c=s.getNode(),u=t.is(l),d=t.is(c);if(u||d){let[f,p]=Dy(e),h=l.is(c),m=t.is(i?c:l),_=t.is(i?l:c),x,C=0;if(h)C=f>p?p:f,x=f>p?f:p;else if(m)C=i?p:f,x=void 0;else if(_)C=0,x=i?f:p;let y=t.__text.slice(C,x);y!==t.__text&&(n==="clone"&&(t=Oy(t)),t.__text=y)}}return t}function AM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return j(t)||ep(177),e.offset===t.getChildrenSize()}function $S(e,t,n){let o=t.getNode(),r=n;if(j(o)){let s=o.getDescendantByIndex(t.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if(j(o)){let u=o.getLastDescendant();u!==null&&(o=u)}let s=o.getPreviousSibling(),i=0;if(s===null){let u=o.getParentOrThrow(),d=u.getPreviousSibling();for(;d===null;){if(u=u.getParent(),u===null){s=null;break}d=u.getPreviousSibling()}u!==null&&(i=u.isInline()?0:2,s=d)}let l=o.getTextContent();l===""&&j(o)&&!o.isInline()&&(l=`
|
|
13
13
|
|
|
14
|
-
`);let c=l.length;if(!ne(o)||r>=c){let u=o.getParent();o.remove(),u==null||u.getChildrenSize()!==0||xo(u)||u.remove(),r-=c+i,o=s}else{let u=o.getKey(),d=e.read("latest",()=>{let h=Ot(u);return ne(h)&&h.isSimpleText()?h.getTextContent():null}),f=c-r,p=l.slice(0,f);if(d!==null&&d!==l){let h=Cn(),m=o;if(o.isSimpleText())o.setTextContent(d);else{let _=xt(d);o.replace(_),m=_}if(I(h)&&h.isCollapsed()){let _=h.anchor.offset;m.select(_,_)}}else if(o.isSimpleText()){let h=t.key===u,m=t.offset;m<r&&(m=c);let _=h?m-r:0,x=h?m:f;if(h&&_===0){let[C]=o.splitText(_,x);C.remove()}else{let[,C]=o.splitText(_,x);C.remove()}}else{let h=xt(p);o.replace(h)}r=0}}}var RM=()=>{};function $u(e,t){(I(e)?e.isCollapsed():ne(e)||W(e))||ep(280);let n=jr(I(e)?e.style:ne(e)?e.getStyle():e.getTextStyle()),o=DS(Object.entries(t).reduce((r,[s,i])=>(typeof i=="function"?r[s]=i(n[s],e):i===null?delete r[s]:r[s]=i,r),{...n}));I(e)||ne(e)?e.setStyle(o):e.setTextStyle(o)}function MM(e,t){if(I(e)&&e.isCollapsed()){$u(e,t);let o=e.anchor.getNode();W(o)&&o.isEmpty()&&$u(o,t)}wS((o)=>{$u(o,t)});let n=e.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!W(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();o.has(s)||(o.add(s),$u(r,t))}}}function wS(e){let t=K();if(!t)return;let n=new Map,o=(s)=>n.get(s.getKey())||[0,s.getTextContentSize()];if(I(t))for(let s of ir(t).getTextSlices())s&&n.set(s.caret.origin.getKey(),s.getSliceIndices());let r=t.getNodes();for(let s of r){if(!ne(s)||!s.canHaveFormat())continue;let[i,l]=o(s);if(l!==i)if(Hg(s)||i===0&&l===s.getTextContentSize())e(s);else e(s.splitText(i,l)[i===0?0:1])}I(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&kS(t)}function kS(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:s}=t;t.set(n.key,n.offset,n.type),n.set(o,r,s)}}function IS(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function LS(e,t,n){let o=an(e,n);if(rl(o))return!1;for(;o;o=o.getParentCaret()){let r=o.getParentAtCaret();if(!r||o.getNodeAtCaret())return!1;if(t.is(r))return!0}return!1}function DM(e,t,n=IS){if(!e)return;let o=e.getStartEndPoints(),r=!1,s=null,i=new Map;if(o){let[l,c]=o,u=pe(l.getNode(),ul);s=pe(c.getNode(),ul);let d=e.isBackward()?"previous":"next";r=W(s)&&!s.is(u)&&function(f,p,h){let m=f.getNode();return(!W(m)||!m.isEmpty())&&LS(f,p,h)}(c,s,fS(d)),W(u)&&i.set(u.getKey(),u),W(s)&&!r&&i.set(s.getKey(),s)}for(let l of e.getNodes())if(W(l)&&ul(l)){if(r&&l.is(s))continue;i.set(l.getKey(),l)}else if(!o){let c=pe(l,ul);W(c)&&i.set(c.getKey(),c)}for(let l of i.values()){let c=t();n(l,c),l.replace(c,!0)}}function MS(e){return e.getNode().isAttached()}function $M(e){let t=e;for(;t!==null&&!At(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function wM(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,s=e.getNodes(),i=s.length;if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let u=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),d=u.getChildren(),f=t();return f.setFormat(u.getFormatType()),f.setIndent(u.getIndent()),d.forEach((p)=>f.append(p)),n&&(f=n.append(f)),void u.replace(f)}let l=null,c=[];for(let u=0;u<i;u++){let d=s[u];At(d)?(Qg(e,c,c.length,t,n),c=[],l=d):l===null||l!==null&&ol(d,l)?c.push(d):(Qg(e,c,c.length,t,n),c=[d])}Qg(e,c,c.length,t,n)}function Qg(e,t,n,o,r=null){if(t.length===0)return;let s=t[0],i=new Map,l=[],c=W(s)?s:s.getParentOrThrow(),u=c.isInline()?c.getParentOrThrow():c,d=!1;for(;u!==null;){let _=u.getPreviousSibling();if(_!==null){u=_,d=!0;break}if(u=u.getParentOrThrow(),At(u))break}let f=new Set;for(let _=0;_<n;_++){let x=t[_];W(x)&&x.getChildrenSize()===0&&f.add(x.getKey())}let p=new Set;for(let _=0;_<n;_++){let x=t[_],C=x.getParent();if(C!==null&&C.isInline()&&(C=C.getParent()),C!==null&&sl(x)&&!p.has(x.getKey())){let y=C.getKey();if(i.get(y)===void 0){let N=o();N.setFormat(C.getFormatType()),N.setIndent(C.getIndent()),l.push(N),i.set(y,N);let E=C.getChildren();N.splice(N.getChildrenSize(),0,E);for(let v of E)if(p.add(v.getKey()),W(v))for(let b of v.getChildrenKeys())p.add(b);$M(C)}}else if(f.has(x.getKey())){W(x)||ep(179);let y=o();y.setFormat(x.getFormatType()),y.setIndent(x.getIndent()),l.push(y),x.remove(!0)}}if(r!==null)for(let _=0;_<l.length;_++){let x=l[_];r.append(x)}let h=null;if(At(u))if(d)if(r!==null)u.insertAfter(r);else for(let _=l.length-1;_>=0;_--){let x=l[_];u.insertAfter(x)}else{let _=u,x=_.getFirstChild();if(W(x)&&(u=x),x===null)if(r)_.append(r);else for(let C=0;C<l.length;C++){let y=l[C];_.append(y),h=y}else if(r!==null)x.insertBefore(r);else for(let C=0;C<l.length;C++){let y=l[C];x.insertBefore(y),h=y}}else if(r)u.insertAfter(r);else for(let _=l.length-1;_>=0;_--){let x=l[_];u.insertAfter(x),h=x}let m=Cn();I(m)&&MS(m.anchor)&&MS(m.focus)?pt(m.clone()):h!==null?h.selectEnd():e.dirty=!0}function FS(e){let t=PS(e);return t!==null&&t.writingMode==="vertical-rl"}function PS(e){let t=e.anchor.getNode();return W(t)?tp(t):np(t)}function kM(e,t){let n=FS(e)?!t:t;op(e)&&(n=!n);let o=an(e.focus,n?"previous":"next");if(rl(o))return!1;if(Kr(o)&&!Wt(o.origin)&&o.origin.isUnmergeable()){let r=o.getNodeAtCaret();if(ne(r)&&!Wt(r))return!0}for(let r of bs(o)){if(Fo(r))return!r.origin.isInline();if(!W(r.origin)){if(Dt(r.origin))return!0;break}}return!1}function BS(e,t,n,o){e.modify(t?"extend":"move",n,o)}function op(e){let t=PS(e);return t!==null&&t.direction==="rtl"}function IM(e,t,n){let o=op(e),r;r=FS(e)||o?!n:n,BS(e,t,r,"character")}function LM(e,t,n){let o=e.getStyle(),r=jr(o);return r!==null&&r[t]||n}function FM(e,t,n=""){let o=null,r=e.getNodes(),s,i;if(I(e)){if(e.isCollapsed()&&e.style!==""){let m=jr(e.style);if(m!==null&&t in m)return m[t]}let{anchor:l,focus:c}=e,u=e.isBackward(),d=u?c.getNode():l.getNode(),f=u?l.getNode():c.getNode(),p=u?c.offset:l.offset,h=u?l.offset:c.offset;ne(d)&&p===d.getTextContentSize()&&(s=d),h===0&&(i=f)}for(let l=0;l<r.length;l++){let c=r[l];if(ne(c)&&!c.is(l===0?s:i)){let u=LM(c,t,n);if(o===null)o=u;else if(o!==u){o="";break}}}return o===null?n:o}var PM=jr,BM=$S;var ct=rp,{$addNodeStyle:gF,$cloneWithProperties:pF,$copyBlockFormatIndent:hF,$ensureForwardRangeSelection:mF,$forEachSelectedTextNode:_F,$getComputedStyleForElement:xF,$getComputedStyleForParent:CF,$getSelectionStyleValueForProperty:yF,$isAtEdgeOfElement:sp,$isAtNodeEnd:ip,$isParentElementRTL:SF,$isParentRTL:yl,$moveCaretSelection:NF,$moveCharacter:ap,$patchStyleText:EF,$selectAll:TF,$setBlocksType:Fi,$shouldOverrideDefaultCharacterSelection:lp,$sliceSelectedTextNodeContent:Fs,$trimTextContentFromAnchor:bF,$wrapNodes:vF,createDOMRange:OF,createRectsFromDOMRange:KS,getCSSFromStyleObject:AF,getStyleObjectFromCSS:RF,trimTextContentFromAnchor:MF}=ct;function up(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function HS(e){let t=(o,r)=>r.left>=o.left-1&&r.top>=o.top-1&&r.right<=o.right+1&&r.bottom<=o.bottom+1,n=[];for(let o of Array.from(e))if(!(o.width<0.5||o.height<0.5||n.some((r)=>t(o,r)))){for(let r=n.length-1;r>=0;r--)t(n[r],o)&&n.splice(r,1);n.push(o)}return n}function jo(e){return`${e}px`}var KM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function WS(e,t,n){let o=null,r=null,s=null,i=[],l=ks(e.getRootElement()).createElement("div");function c(){o===null&&up(182),r===null&&up(183);let{left:f,top:p}=r.getBoundingClientRect(),h=HS(KS(e,t));var m,_;l.isConnected||(_=l,(m=r).insertBefore(_,m.firstChild));let x=!1;for(let C=0;C<h.length;C++){let y=h[C],N=i[C]||ks(o).createElement("div"),E=N.style;E.position!=="absolute"&&(E.position="absolute",x=!0);let v=jo(y.left-f);E.left!==v&&(E.left=v,x=!0);let b=jo(y.top-p);E.top!==b&&(N.style.top=b,x=!0);let A=jo(y.width);E.width!==A&&(N.style.width=A,x=!0);let O=jo(y.height);E.height!==O&&(N.style.height=O,x=!0),N.parentNode!==l&&(l.append(N),x=!0),i[C]=N}for(;i.length>h.length;){let C=i.pop();C!=null&&C.remove()}x&&n(i)}function u(){r=null,o=null,s!==null&&s.disconnect(),s=null,l.remove();for(let f of i)f.remove();i=[]}l.style.position="relative";let d=e.registerRootListener(function f(){let p=e.getRootElement();if(p===null)return u();let h=p.parentElement;if(!Ce(h))return u();u(),o=p,r=h,s=new MutationObserver((m)=>{let _=e.getRootElement(),x=_&&_.parentElement;if(_!==o||x!==r)return f();for(let C of m)if(!l.contains(C.target))return c()}),s.observe(h,KM),c()});return()=>{d(),u()}}function zS(e,t,n,o){if(t.type!=="text"&&W(n)){let r=$y(n,o,e);return[r.element,r.getFirstChildOffset()+t.offset]}return[(ne(n)?wy(n,o,e):mS(o))||o,t.offset]}function zM(e){for(let t of e){let n=t.style;n.background!=="Highlight"&&(n.background="Highlight"),n.color!=="HighlightText"&&(n.color="HighlightText"),n.marginTop!==jo(-1.5)&&(n.marginTop=jo(-1.5)),n.paddingTop!==jo(4)&&(n.paddingTop=jo(4)),n.paddingBottom!==jo(0)&&(n.paddingBottom=jo(0))}}function GS(e,t=zM){let n=null,o=null,r=null,s=null,i=null,l=null,c=()=>{};function u(d){d.read(()=>{let f=K();if(!I(f))return n=null,r=null,s=null,l=null,c(),void(c=()=>{});let[p,h]=function(O){let D=O.getStartEndPoints();return O.isBackward()?[D[1],D[0]]:D}(f),m=p.getNode(),_=m.getKey(),x=p.offset,C=h.getNode(),y=C.getKey(),N=h.offset,E=e.getElementByKey(_),v=e.getElementByKey(y),b=n===null||E!==o||x!==r||_!==n.getKey(),A=s===null||v!==i||N!==l||y!==s.getKey();if((b||A)&&E!==null&&v!==null){let O=function(D,H,k,q,j,oe,B){let de=(D._window?D._window.document:document).createRange();return de.setStart(...zS(D,H,k,q)),de.setEnd(...zS(D,j,oe,B)),de}(e,p,m,E,h,C,v);c(),c=WS(e,O,t)}n=m,o=E,r=x,s=C,i=v,l=N},{editor:e})}return u(e.getEditorState()),Oe(e.registerUpdateListener(({editorState:d})=>u(d)),()=>{c()})}function UM(e,t){let n=null,o=()=>{let r=e.getRootElement(),s=r!==null?r.ownerDocument.defaultView:null,i=s!==null?s.getSelection():null,l=i!==null?ws(i,r).anchorNode:null;l!==null&&r!==null&&r.contains(l)?n!==null&&(n(),n=null):n===null&&(n=GS(e,t))};return e.registerRootListener((r)=>{if(r){let s=r.ownerDocument,i=Oe(ro(s,"selectionchange",o),()=>{n!==null&&n()});return o(),i}})}function HM(e,t){let n=e.ownerDocument,o=n.defaultView||window,r=o.getComputedStyle(e),s=r.position==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(r.position==="fixed")return n.body;for(let l=e;l=Cl(l);)if(r=o.getComputedStyle(l),(!s||r.position!=="static")&&i.test(r.overflow+r.overflowY+r.overflowX))return l;return n.body}function jS(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function WM(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:l,value:c}=n.next();if(l)return o(s);let u=new FileReader;u.addEventListener("error",r),u.addEventListener("load",()=>{let d=u.result;typeof d=="string"&&s.push({file:c,result:d}),i()}),jS(c,t)?u.readAsDataURL(c):i()};i()})}function GM(e,t){return Array.from(YS(e,t))}function jM(e){return e?e.getAdjacentCaret():null}function YM(e,t){return Array.from(qS(e,t))}function YS(e,t){return wu("next",e,t)}function VM(e,t){return Array.from(VS(e,t))}function*VS(e,t){for(let n of wu("next",e,t)){yield n;let{node:o,depth:r}=n;if(il(o)&&!o.is(t))for(let s of As(o)){let i=Ci(o,s);i!==null&&(yield*dp(i,r+1))}}}function*dp(e,t){yield{depth:t,node:e};let n=t+1;if(il(e))for(let o of As(e)){let r=Ci(e,o);r!==null&&(yield*dp(r,n))}if(W(e))for(let o of e.getChildren())yield*dp(o,n)}function US(e,t){let n=vs(it(e,t));return n&&n[0]}function wu(e,t,n){let o=Xe(),r=t||o,s=W(r)?Et(r,e):it(r,e),i=XS(r),l=n?nl(Bg(it(n,e)))||US(n,e):US(r,e),c=i;return Vg({hasNext:(u)=>u!==null,initial:s,map:(u)=>({depth:c,node:u.origin}),step:(u)=>{if(u.isSameNodeCaret(l))return null;Fo(u)&&c++;let d=vs(u);return!d||d[0].isSameNodeCaret(l)?null:(c+=d[1],d[0])}})}function XM(e){let t=vs(it(e,"next"));return t&&[t[0].origin,t[1]]}function XS(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??Yc(n))t++;return t}function qM(e){let t=Bg(it(e,"previous")),n=vs(t,"root");return n&&n[0].origin}function qS(e,t){return wu("previous",e,t)}function JM(e,t){return Array.from(JS(e,t))}function*JS(e,t){let n=[];for(let o of wu("previous",e,t)){for(;n.length>0&&o.depth<=n[n.length-1].depth;){let i=n.pop();yield*fp(i.node,i.depth+1)}yield o;let{node:r,depth:s}=o;il(r)&&As(r).length>0&&!r.is(t)&&n.push({depth:s,node:r})}for(;n.length>0;){let o=n.pop();yield*fp(o.node,o.depth+1)}}function*fp(e,t){let n=As(e);for(let o=n.length-1;o>=0;o--){let r=Ci(e,n[o]);r!==null&&(yield*ZS(r,t))}}function*ZS(e,t){yield{depth:t,node:e};let n=t+1;if(W(e)){let o=e.getChildren();for(let r=o.length-1;r>=0;r--)yield*ZS(o[r],n)}il(e)&&(yield*fp(e,n))}function ZM(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function QM(e){let t=pe(e,(n)=>W(n)&&!n.isInline());return W(t)||up(4,e.__key),t}function eD(e,t){let n=lr(I(t)?ir(t):t,"next"),o=qn(n.anchor.origin),r=qn(e.getLatest());if(o===null?r!==null:!o.is(r))return!1;let s=$t(Et(e,"next")),i=My($t(Et(e,"previous")),"next");return kr(n.anchor,s)<=0&&kr(n.focus,i)>=0}function tD(e,t,n,o){let r=(s)=>s instanceof t;return e.registerNodeTransform(t,(s)=>{let i=((l)=>{let c=l.getChildren();for(let f=0;f<c.length;f++){let p=c[f];if(r(p))return null}let u=l,d=l;for(;u!==null;)if(d=u,u=u.getParent(),r(u))return{child:d,parent:u};return null})(s);if(i!==null){let{child:l,parent:c}=i;if(l.is(s)){o(c,s);let u=l.getNextSiblings(),d=u.length;if(c.insertAfter(l),d!==0){let f=n(c);l.insertAfter(f);for(let p=0;p<d;p++)f.append(u[p])}c.canBeEmpty()||c.getChildrenSize()!==0||c.remove()}}})}function nD(e,t){let n=new Map,o=e._pendingEditorState;for(let[s,i]of t._nodeMap)n.set(s,Wc(i));o&&(o._nodeMap=n),_i();let r=t._selection;pt(r===null?null:r.clone())}function oD(e){let t=K()||Cn(),n;if(I(t))n=an(t.focus,"next");else{if(t!=null){let i=t.getNodes(),l=i[i.length-1];l&&(n=it(l,"next"))}n=n||Et(Xe(),"previous").getFlipped().insert(ye())}let o=Pr(e,n),r=nl(o),s=Fo(r)?$t(r):o;return Mn(Os(s)),e.getLatest()}function rD(e){let t=K();if(!I(t))return void(t&&t.insertNodes([e]));let n=ir(t),o=lr(zy(n),"next").anchor;if(Kr(o)){let s=Jc(o);if(!s)return;o=s}let r=o.getFlipped();r.insert(e),Mn(Xn(r,r))}function sD(e,t){let n=t();return e.replace(n),n.append(e),n}function gp(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function iD(e){let t=null;if(gp(e,DragEvent)?t=e.dataTransfer:gp(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,o=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[o,Array.from(t.files),r]}function aD(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function lD(e){let t=K();if(!I(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(n.has(i))continue;let l=pe(s,(u)=>W(u)&&!u.isInline());if(l===null)continue;let c=l.getKey();l.canIndent()&&!n.has(c)&&(n.add(c),e(l))}return n.size>0}function cD(e,t){Et(e,"next").insert(t)}var cp=!($s||!un)&&void 0;function uD(e,t=!1){let n=1;if(function(){if(cp===void 0){let o=document.createElement("div");o.style.position="absolute",o.style.opacity="0",o.style.width="100px",o.style.left="-1000px",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),cp=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return cp}()||t){let o=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(o.getComputedStyle(e).getPropertyValue("zoom")),e=Cl(e)}return n}function dD(e){return e._parentEditor!==null}function fD(e,t){return QS(e,t,null)}function QS(e,t,n){let o=!1;for(let r of pp(e))t(r)?n!==null&&n(r):(o=!0,W(r)&&QS(r,t,n||((s)=>r.insertAfter(s))),r.remove());return o}function gD(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(W(r))for(let s of pp(r))o.push(s);return n}function pD(e){return eN(Et(e,"next"))}function pp(e){return eN(Et(e,"previous"))}function eN(e){return Vg({hasNext:Co,initial:e.getAdjacentCaret(),map:(t)=>t.origin.getLatest(),step:(t)=>t.getAdjacentCaret()})}function hD(e){Ko(it(e,"next")).splice(1,e.getChildren())}function mD(e){let t=(o)=>Lo(o,e),n=(o,r)=>Qn(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}function _D(e,t){let n=K();if(I(n)&&n.isCollapsed()){let o=pe(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getFirstChild()===o&&tN(n.anchor,o))return o.insertBefore(ye()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function xD(e,t){let n=K();if(I(n)&&n.isCollapsed()){let o=pe(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getLastChild()===o&&nN(n.anchor,o))return o.insertAfter(ye()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function tN(e,t){return sp(e,t,"previous")}function nN(e,t){return sp(e,t,"next")}var ue=hp,{$descendantsMatching:Sl,$dfs:oN,$dfsIterator:IF,$dfsWithSlots:LF,$dfsWithSlotsIterator:FF,$filter:PF,$findMatchingParent:BF,$firstToLastIterator:KF,$getAdjacentCaret:zF,$getAdjacentSiblingOrParentSiblingCaret:UF,$getDepth:HF,$getNearestBlockElementAncestorOrThrow:ku,$getNearestNodeOfType:Iu,$getNextRightPreorderNode:WF,$getNextSiblingOrParentSibling:GF,$handleIndentAndOutdent:El,$insertFirst:rN,$insertNodeIntoLeaf:jF,$insertNodeToNearestRoot:Lu,$insertNodeToNearestRootAtCaret:YF,$isAtEndOfNode:VF,$isAtStartOfNode:XF,$isBlockFullySelected:Tl,$isEditorIsNestedEditor:qF,$lastToFirstIterator:JF,$onEscapeDown:mp,$onEscapeUp:_p,$restoreEditorState:ZF,$reverseDfs:QF,$reverseDfsIterator:eP,$reverseDfsWithSlots:tP,$reverseDfsWithSlotsIterator:nP,$splitNode:oP,$unwrapAndFilterDescendants:xp,$unwrapNode:rP,$wrapNodeInElement:sP,CAN_USE_BEFORE_INPUT:iP,CAN_USE_DOM:aP,IS_ANDROID:lP,IS_ANDROID_CHROME:cP,IS_APPLE:uP,IS_APPLE_WEBKIT:dP,IS_CHROME:fP,IS_FIREFOX:gP,IS_IOS:pP,IS_SAFARI:hP,addClassNamesToElement:mP,calculateZoomLevel:sN,dedupeSelectionRects:_P,eventFiles:Ps,getScrollParent:xP,isBlockDomNode:CP,isHTMLAnchorElement:yP,isHTMLElement:SP,isInlineDomNode:NP,isMimeType:EP,makeStateWrapper:TP,markSelection:bP,mediaFileReader:vP,mergeRegister:OP,objectKlassEquals:kn,positionNodeOnRange:AP,registerNestedElementResolver:RP,removeClassNamesFromElement:MP,selectionAlwaysOnDisplay:iN}=ue;var CD=Symbol.for("preact-signals");function Hu(){if(ur>1)return void ur--;let e,t=!1;for(!function(){let n=Ku;for(Ku=void 0;n!==void 0;)n.S.v===n.v&&(n.S.i=n.i),n=n.o}();vl!==void 0;){let n=vl;for(vl=void 0,zu++;n!==void 0;){let o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&hN(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(zu=0,ur--,t)throw e}function pN(e){if(ur>0)return e();bp=++yD,ur++;try{return e()}finally{Hu()}}var tt,vl;function Tp(e){let t=tt;tt=void 0;try{return e()}finally{tt=t}}var Ku,ur=0,zu=0,yD=0,bp=0,Bu=0;function aN(e){if(tt===void 0)return;let t=e.n;return t===void 0||t.t!==tt?(t={i:0,S:e,p:tt.s,n:void 0,t:tt,e:void 0,x:void 0,r:t},tt.s!==void 0&&(tt.s.n=t),tt.s=t,e.n=t,32&tt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=tt.s,t.n=void 0,tt.s.n=t,tt.s=t),t):void 0}function dn(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}function Zr(e,t){return new dn(e,t)}function hN(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function lN(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function mN(e){let t,n=e.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}e.s=t}function Bs(e,t){dn.call(this,void 0),this.x=e,this.s=void 0,this.g=Bu-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}function _N(e,t){return new Bs(e,t)}function xN(e){let t=e.m;if(e.m=void 0,typeof t=="function"){ur++;let n=tt;tt=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Rp(e),o}finally{tt=n,Hu()}}}function Rp(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,xN(e)}function SD(e){if(tt!==this)throw Error("Out-of-order effect");mN(this),tt=e,this.f&=-2,8&this.f&&Rp(this),Hu()}function Bi(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}function qt(e,t){let n=new Bi(e,t);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function So(e,t={}){let n={};for(let o in e){let r=t[o],s=Zr(r===void 0?e[o]:r);n[o]=s}return n}dn.prototype.brand=CD,dn.prototype.h=function(){return!0},dn.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:Tp(()=>{var n;(n=this.W)==null||n.call(this)}))},dn.prototype.U=function(e){if(this.t!==void 0){let{e:t,x:n}=e;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Tp(()=>{var o;(o=this.Z)==null||o.call(this)}))}},dn.prototype.subscribe=function(e){return qt(()=>{let t=this.value,n=tt;tt=void 0;try{e(t)}finally{tt=n}},{name:"sub"})},dn.prototype.valueOf=function(){return this.value},dn.prototype.toString=function(){return this.value+""},dn.prototype.toJSON=function(){return this.value},dn.prototype.peek=function(){let e=tt;tt=void 0;try{return this.value}finally{tt=e}},Object.defineProperty(dn.prototype,"value",{get(){let e=aN(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(zu>100)throw Error("Cycle detected");(function(t){ur!==0&&zu===0&&t.l!==bp&&(t.l=bp,Ku={S:t,v:t.v,i:t.i,o:Ku})})(this),this.v=e,this.i++,Bu++,ur++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Hu()}}}}),Bs.prototype=new dn,Bs.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32)return!0;if(this.f&=-5,this.g===Bu)return!0;if(this.g=Bu,this.f|=1,this.i>0&&!hN(this))return this.f&=-2,!0;let e=tt;try{lN(this),tt=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return tt=e,mN(this),this.f&=-2,!0},Bs.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}dn.prototype.S.call(this,e)},Bs.prototype.U=function(e){if(this.t!==void 0&&(dn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Bs.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Bs.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=aN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Bi.prototype.c=function(){let e=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}},Bi.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,xN(this),lN(this),ur++;let e=tt;return tt=this,SD.bind(this,e)},Bi.prototype.N=function(){2&this.f||(this.f|=2,this.u=vl,vl=this)},Bi.prototype.d=function(){this.f|=8,1&this.f||Rp(this)},Bi.prototype.dispose=function(){this.d()};var ND=me({build:(e,t,n)=>So(t),config:Be({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let o=n.getOutput();return qt(()=>o.disabled.value?void 0:e.registerRootListener((r)=>{e.focus(()=>{let s=r!==null?yo(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function CN(){let e=Xe(),t=K(),n=ye();e.clear(),e.append(n),t!==null&&n.select(),I(t)&&(t.format=0)}function yN(e,t=CN){return e.registerCommand(Zc,()=>(t(),!0),Ee)}var ED=me({build:(e,t,n)=>So(t),config:Be({$onClear:CN}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:o}=n.getOutput();return qt(()=>yN(e,o.value))}});function SN(e){return!!Dt(e)||!(!W(e)||!e.isShadowRoot())}function cN(e,t,n,o){return!!e.isEditable()&&(n.target===t&&e.read("latest",()=>{let r=Xe().getLastChild();if(r===null)return!1;let s=e.getElementByKey(r.getKey());return s!==null&&(!(n.clientY<=s.getBoundingClientRect().bottom)&&o(r))}))}var TD=me({build:(e,t)=>So(t),config:Be({$shouldInsertAfter:SN,disabled:!1}),name:"@lexical/ClickAfterLastBlock",register:(e,t,n)=>qt(()=>{let o=n.getOutput();if(!o.disabled.value)return e.registerRootListener((r)=>{if(r===null)return;return Vr(r,{click:(s)=>{cN(e,r,s,o.$shouldInsertAfter.peek())&&(s.preventDefault(),Xg(s),e.update(()=>{let i=Xe().getLastChild();if(i===null)return;if(!o.$shouldInsertAfter.peek()(i))return;let l=ye();i.insertAfter(l),l.select()}))},mousedown:(s)=>{cN(e,r,s,o.$shouldInsertAfter.peek())&&s.preventDefault()}},!0)})})});function NN(e){let t=new Set,n=new Set;for(let o of EN(e)){let r=typeof o=="function"?o:o.replace;_S(r),t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function EN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var Cp=Go("format",{parse:(e)=>typeof e=="number"?e:0});class Wu extends au{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:au,stateConfigs:[{flat:!0,stateConfig:Cp}]})}getFormat(e){return Lo(this,Cp,e)}getFormatFlags(e,t){return qg(this.getFormat(),e,t)}hasFormat(e){let t=$i[e];return(this.getFormat()&t)!==0}setFormat(e){return Qn(this,Cp,e)}toggleFormat(e){let t=this.getFormat(),n=qg(t,e,null);return this.setFormat(n)}isInline(){return!0}createDOM(e,t){return je().createElement("span")}}function bD(e){return e instanceof Wu}function vD(e,t,n){let o=t.fontWeight,r=t.textDecoration.split(" "),s=o==="700"||o==="bold",i=r.includes("line-through"),l=t.fontStyle==="italic",c=r.includes("underline"),u=t.verticalAlign;return s&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),l&&!e.hasFormat("italic")&&e.toggleFormat("italic"),c&&!e.hasFormat("underline")&&e.toggleFormat("underline"),u!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),u!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function TN(e,t,n=RD){let o=t;for(let[r,s]of Object.entries(n))e.hasFormat(s)&&(o=AD(o,r));return o}var OD=TN;function AD(e,t){let n=e.ownerDocument.createElement(t);return n.appendChild(e),n}var RD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},MD=me({name:"@lexical/extension/DecoratorText",nodes:()=>[Wu]});function Ol(e,t){let n;return Zr(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var Uu=me({build:(e)=>Ol(()=>e.getEditorState(),(t)=>e.registerUpdateListener((n)=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function et(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var bN;try{bN="0.49.0+prod.esm"}catch(e){}var DD=bN??'"<unknown>+source"',$D=new Set(["__proto__","constructor","prototype"]);function vN(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)!$D.has(r)&&Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=vN(n[r],o[r]));return e}return t}var Mp=0,vp=1,ON=2,yp=3,Fu=4,Pi=5,Sp=6,bl=7;function Np(e){return e.id===Mp}function AN(e){return e.id===ON}function wD(e){return function(t){return t.id===vp}(e)||et(305,String(e.id),String(vp)),Object.assign(e,{id:ON})}var kD=new Set;class RN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Mp}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Pt;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;AN(t)||et(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},r=function(i,l,c){return Object.assign(i,{config:l,id:yp,registerState:c})}(t,this.mergeConfigs(),n),s;this.state=r,this.extension.init&&(s=this.extension.init(e,r.config,n)),this.state=function(i,l,c){return Object.assign(i,{id:Fu,initResult:l,registerState:c})}(r,s,o)}build(e){let t=this.state,n;t.id!==Fu&&et(307,String(t.id),String(Pi)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let o={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(r,s,i){return Object.assign(r,{id:Pi,output:s,registerState:i})}(t,n,o)}register(e,t){this._signal=t;let n=this.state;n.id!==Pi&&et(308,String(n.id),String(Pi));let o=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(r){return Object.assign(r,{id:Sp})}(n),()=>{let r=this.state;r.id!==bl&&et(309,String(n.id),String(bl)),this.state=function(s){return Object.assign(s,{id:Pi})}(r),o&&o()}}afterRegistration(e){let t=this.state,n;return t.id!==Sp&&et(310,String(t.id),String(Sp)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(o){return Object.assign(o,{id:bl})}(t),n}getSignal(){return this._signal===void 0&&et(311),this._signal}getInitResult(){this.extension.init===void 0&&et(312,this.extension.name);let e=this.state;return function(t){return t.id>=Fu}(e)||et(313,String(e.id),String(Fu)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(t){return t.id>=yp}(e)||et(314,String(e.id),String(yp)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&et(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&et(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(t){return t.id>=bl}(e)||et(316,String(e.id),String(bl)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||kD}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(t){return t.id>=Pi})(e)||et(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var uN={tag:Ur};function ID(){let e=Xe();e.isEmpty()&&e.append(ye())}var MN=me({config:Be({setOptions:uN,updateOptions:uN}),init:({$initialEditorState:e=ID})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(Ly(s))e.setEditorState(s,n);else if(typeof s=="function")e.update(()=>{s(e)},t);else if(s&&(typeof s=="string"||typeof s=="object")){let i=e.parseEditorState(s);e.setEditorState(i,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cu,$n,rS,Nu,sS]}),dN=Symbol.for("@lexical/extension/LexicalBuilder");function LD(...e){return dr.fromExtensions(e).buildEditor()}function fN(){}function FD(e){throw e}function Pu(e){return Array.isArray(e)?e:[e]}var Ep=DD;class dr{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Ep,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(e){let t=[Pu(MN)];for(let n of e)t.push(Pu(n));return new dr(t)}static maybeFromEditor(e){let t=e[dN];return t&&(t.PACKAGE_VERSION!==Ep&&et(292,t.PACKAGE_VERSION,Ep),t instanceof dr||et(293)),t}static fromEditor(e){let t=dr.maybeFromEditor(e);return t===void 0&&et(294),t}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...o}=this.buildCreateEditorArgs(),r=Object.assign(Tu({...o,...t?{onError:(s)=>{t(s,r)}}:{},...n?{onWarn:(s)=>{n(s,r)}}:{}}),{[dN]:this});for(let s of this.sortedExtensionReps())s.build(r);return r}buildEditor(){let e=fN;function t(){try{e()}finally{e=fN}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Oe(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&et(295,e.name),t}addEdge(e,t,n){let o=this.outgoingConfigEdges.get(e);o?o.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let r=this.incomingEdges.get(t);r?r.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&et(296);let t=Pu(e),[n]=t;typeof n.name!="string"&&et(297,typeof n.name);let o=this.extensionNameMap.get(n.name);if(o!==void 0&&o.extension!==n&&et(298,n.name),!o){o=new RN(this,n),this.extensionNameMap.set(n.name,o);let r=this.conflicts.get(n.name);typeof r=="string"&&et(299,n.name,r);for(let s of n.conflictsWith||[])this.extensionNameMap.has(s)&&et(299,n.name,s),this.conflicts.set(s,n.name);for(let s of n.dependencies||[]){let i=Pu(s);this.addEdge(n.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of n.peerDependencies||[])this.addEdge(n.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,o)=>{let r=n.state;if(AN(r))return;let s=n.extension.name;var i;Np(r)||et(300,s,o||"[unknown]"),Np(i=r)||et(304,String(i.id),String(Mp)),r=Object.assign(i,{id:vp}),n.state=r;let l=this.outgoingConfigEdges.get(s);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&t(u,s)}r=wD(r),n.state=r,e.push(n)};for(let n of this.extensionNameMap.values())Np(n.state)&&t(n);for(let n of e)for(let[o,r]of this.outgoingConfigEdges.get(n.extension.name)||[])if(r.length>0){let s=this.extensionNameMap.get(o);if(s)for(let i of r)s.configs.add(i)}for(let[n,...o]of this.roots)if(o.length>0){let r=this.extensionNameMap.get(n.name);r===void 0&&et(301,n.name);for(let s of o)r.configs.add(s)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,o=[()=>n.abort()],r=n.signal;for(let s of t){let i=s.register(e,r);i&&o.push(i)}for(let s of t){let i=s.afterRegistration(e);i&&o.push(i)}return Oe(...o)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,o=new Map,r={},s={},i=this.sortedExtensionReps();for(let u of i){let{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.onWarn!==void 0&&(e.onWarn=d.onWarn),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(let f of EN(d)){if(typeof f!="function"){let p=n.get(f.replace);p&&et(302,d.name,f.replace.name,p.extension.name),n.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(let[f,p]of d.html.export.entries())o.set(f,p);d.html.import&&Object.assign(r,d.html.import)}d.theme&&vN(s,d.theme)}Object.keys(s).length>0&&(e.theme=s),t.size&&(e.nodes=[...t]);let l=Object.keys(r).length>0,c=o.size>0;(l||c)&&(e.html={},l&&(e.html.import=r),c&&(e.html.export=o));for(let u of i)u.init(e);return e.onError||(e.onError=FD),e}}function DN(e,t){let n=dr.fromEditor(e).getExtensionRep(t);return n===void 0&&et(303,t.name),n.getExtensionDependency()}function Dp(e,t){let n=dr.maybeFromEditor(e);if(!n)return;let o=n.extensionNameMap.get(t);return o?o.getExtensionDependency():void 0}function PD(e,t){let n=Dp(e,t);return n===void 0&&et(291,t),n}function $N(e){return DN(Ke(),e)}function BD(e){return $N(e).output}function KD(e){return Dp(Ke(),e)}var zD=new Set,Op=me({build(e,t,n){let o=n.getDependency(Uu).output,r=Zr({watchedNodeKeys:new Map}),s=Ol(()=>{},()=>qt(()=>{let i=s.peek(),{watchedNodeKeys:l}=r.value,c,u=!1;o.value.read(()=>{if(K())for(let[d,f]of l.entries()){if(f.size===0){l.delete(d);continue}let p=Ot(d),h=p&&p.isSelected()||!1;u=u||h!==(!!i&&i.has(d)),h&&(c=c||new Set,c.add(d))}}),!u&&c&&i&&c.size===i.size||(s.value=c)}));return{watchNodeKey:function(i){let l=_N(()=>(s.value||zD).has(i)),{watchedNodeKeys:c}=r.peek(),u=c.get(i),d=u!==void 0;return u=u||new Set,u.add(l),d||(c.set(i,u),r.value={watchedNodeKeys:c}),l}}},dependencies:[Uu],name:"@lexical/extension/NodeSelection"}),wN=Sn("INSERT_HORIZONTAL_RULE_COMMAND");class Ki extends au{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:UD,priority:0})}})}exportDOM(){return{element:je().createElement("hr")}}createDOM(e){let t=je().createElement("hr");return Qe(t,e.theme.hr),t}getTextContent(){return`
|
|
15
|
-
`}isInline(){return!1}updateDOM(){return!1}}function UD(){return{node:$p()}}function $p(){return Gc(Ki)}function kN(e){return e instanceof Ki}var HD=me({dependencies:[Uu,Op],name:"@lexical/extension/HorizontalRule",nodes:()=>[Ki],register(e,t,n){let{watchNodeKey:o}=n.getDependency(Op).output,r=Zr({nodeSelections:new Map}),s=e._config.theme.hrSelected??"selected";return Oe(e.registerCommand(wN,(i)=>{let l=K();if(!I(l))return!1;if(l.focus.getNode()!==null){let c=$p();Lu(c)}return!0},Ee),e.registerCommand(yi,(i)=>{if(oo(i.target)){let l=Iy(i.target);if(kN(l))return function(c,u=!1){let d=K(),f=c.isSelected(),p=c.getKey(),h;u&&Je(d)?h=d:(h=jc(),pt(h)),f?h.delete(p):h.add(p)}(l,i.shiftKey),!0}return!1},we),e.registerMutationListener(Ki,(i,l)=>{pN(()=>{let c=!1,{nodeSelections:u}=r.peek();for(let[d,f]of i.entries())if(f==="destroyed")u.delete(d),c=!0;else{let p=u.get(d),h=e.getElementByKey(d);p?p.domNode.value=h:(c=!0,u.set(d,{domNode:Zr(h),selectedSignal:o(d)}))}c&&(r.value={nodeSelections:u})})}),qt(()=>{let i=[];for(let{domNode:l,selectedSignal:c}of r.value.nodeSelections.values())i.push(qt(()=>{let u=l.value;if(u)c.value?Qe(u,s):nn(u,s)}));return Oe(...i)}))}}),WD=me({build:(e)=>({composingTextNode:Zr(null),compositionKey:Zr(null)}),name:"@lexical/extension/IME",register(e,t,n){let{compositionKey:o,composingTextNode:r}=n.getOutput(),s=e.registerCommand(Vy,()=>{let u=K();return I(u)&&(o.value=u.anchor.key),!1},Qc),i=qt(()=>{let u=o.value;r.value=u!==null?e.read("latest",()=>{let d=Ot(u);return ne(d)?d:null}):null}),l=e.registerUpdateListener(({tags:u,editorState:d})=>{u.has(tu)&&d.read(()=>{let f=K();if(!I(f))return;let p=f.anchor.getNode();ne(p)&&(r.value=p)})}),c=e.registerRootListener((u)=>{if(u===null)return void(o.value=null);return ro(u,"compositionend",()=>{o.value=null})});return Oe(s,i,l,c)}}),GD=me({build:(e,t)=>So({inheritEditableFromParent:t.inheritEditableFromParent}),config:Be({$getParentEditor:function(){let e=Ke();return dr.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,t,n)=>{let o=t.$getParentEditor();e.parentEditor=o,e.theme=e.theme||o._config.theme},name:"@lexical/extension/NestedEditor",register:(e,t,n)=>qt(()=>{let o=e._parentEditor;if(o&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(o.isEditable()),o.registerEditableListener(e.setEditable.bind(e))})}),jD=me({config:Be({attribute:"data-selected",nodes:[]}),init(e,t){let n=new Set,o=Ou(NN(e).nodes);for(let r of t.nodes){let s=r.getType(),i=o.get(s);i===void 0&&et(339,r.name,s),n.add(s);for(let l of i)n.add(l)}return{matchTypes:n}},mergeConfig:(e,t)=>Pt(e,{...t,...t.nodes&&{nodes:[...e.nodes,...t.nodes]}}),name:"@lexical/extension/NodeSelectionDataSelected",register(e,t,n){let{attribute:o}=t,{matchTypes:r}=n.getInitResult(),s=new Map,i=(c)=>{let u=new Set;c.read(()=>{let d=K();if(Je(d))for(let f of d.getNodes())r.has(f.getType())&&u.add(f.getKey())});for(let[d,f]of s)u.has(d)||(f.removeAttribute(o),s.delete(d));for(let d of u){let f=e.getElementByKey(d);f!==null&&(f.setAttribute(o,"true"),s.set(d,f))}};i(e.getEditorState());let l=e.registerUpdateListener(({editorState:c})=>i(c));return()=>{l();for(let c of s.values())c.removeAttribute(o);s.clear()}}});function gN(e){W(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var YD=me({build:(e,t,n)=>So(t),config:Be({disabled:!1}),name:"@lexical/NormalizeInlineElements",register:(e,t,n)=>{let o=n.getOutput();return qt(()=>{if(!o.disabled.value){let r=[];for(let{klass:s,transforms:i}of e._nodes.values())s.prototype instanceof lt&&s.prototype.isInline!==lt.prototype.isInline&&(i.add(gN),r.push(()=>i.delete(gN)));return()=>r.forEach((s)=>s())}})}}),VD=new Set([Su,cS]),XD=me({build:(e,t,n)=>So(t),config:Be({$fixFocusOverselection:function(){let e=K();if(I(e)&&!e.isCollapsed()){let t=lr(ir(e),"next"),n=t.focus;for(Kr(n)&&t.anchor.origin!==n.origin&&n.offset===0&&(n=Ko(n.getSiblingCaret())),Co(n)&&t.anchor.origin!==n.origin&&Pe(n.origin)&&(n=Ko(n));Fo(n)&&t.anchor.origin!==n.origin;)n=Ko(it(n.origin,"next"));if(Co(n)&&W(n.origin)&&(n=$t(Et(n.origin,"previous")).getFlipped()),n=$t(n),!n.isSamePointCaret(t.focus)){let o=Mn(Xn(t.anchor,n)),r=Ke().getRootElement(),s=r&&wn(r.ownerDocument.defaultView);s&&Wy(Cn(),o,Ke(),s,VD,r)}}},dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:(e,t,n)=>qt(()=>{let o=n.getOutput();if(!o.disabled.value)return e.registerRootListener((r)=>{if(!r)return;let s=0,i=(l)=>{if(l?l.detail===3:s>0){let c=o.dateNow.peek()();s=l&&l.type==="mousedown"||c-s<=o.thresholdMsec.peek()?c:0}return s};return Oe(e.registerCommand(no,()=>(i(null)&&(s=0,o.$fixFocusOverselection.peek()()),!1),Yy),Vr(r,{mousedown:i,mouseup:i},!0))})})});function qD(e){let t=e.target;yS(e,"a",{ctrlKey:!dl,metaKey:dl})&&Ce(t)&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA")&&t.addEventListener("keydown",Xg,{once:!0})}var Ap=me({build:(e,t,n)=>So(t),config:Be({disabled:!1}),name:"@lexical/extension/PreventSelectAll",register:(e,t,n)=>{let o=n.getOutput();return qt(()=>{if(!o.disabled.value)return e.registerRootListener((r)=>{if(r)return ro(r,"keydown",qD,!0)})})}}),JD=me({build:(e)=>Ol(()=>e.getRootElement(),(t)=>e.registerRootListener((n)=>{t.value=n})),name:"@lexical/extension/RootElement"}),ZD=me({build:(e,t,n)=>So(t),config:Be({cascadeSelection:!1,disabled:!1}),dependencies:[Ap],name:"@lexical/extension/SelectBlock",register:(e,t,n)=>{let o=n.getOutput(),r=n.getDependency(Ap).output;return Oe(qt(()=>{r.disabled.value=o.disabled.value}),qt(()=>{if(!o.disabled.value)return e.registerCommand(Di,(s,i)=>{if(i!==e){if(!o.cascadeSelection.peek())return!1;return!!i.read("pending",()=>{let p=K();return I(p)&&Tl(Xe(),p)})&&(zr(),!0)}let l=K();if(Je(l)){let p=l.getNodes(),h=p[0];if(!h)return!1;let m=h.getTopLevelElement();return!m||xo(m)||m.is(h)||p.length>1&&(c=m,!p.every((_)=>c.is(_.getTopLevelElement())))?zr():W(m)&&m.select(0,m.getChildrenSize()),!0}var c;if(!I(l))return!1;let u=l.anchor.getNode(),d=u.getTopLevelElement();if(d&&d.is(l.focus.getNode().getTopLevelElement())&&!Tl(d,l))return d.select(0,d.getChildrenSize()),!0;let f=qn(u);for(;f!==null;){if(W(f)&&!Tl(f,l))return f.select(0,f.getChildrenSize()),!0;let p=Yc(f);f=p===null?null:qn(p)}return Tl(Xe(),l)||zr(),!0},we)}))}}),QD=me({build:(e,t,n)=>So(t),config:Be({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,t,n)=>{let o=n.getOutput();return qt(()=>{if(!o.disabled.value)return iN(e,o.onReposition.value)})}});function IN(e){return e.canIndent()}function LN(e,t,n=IN){return Oe(e.registerCommand(Gr,(o)=>{let r=K();if(!I(r))return!1;o.preventDefault();let s=function(i){if(i.getNodes().filter((p)=>Br(p)&&p.canIndent()).length>0)return!0;let{anchor:l,focus:c}=i,u=c.isBefore(l)?c:l,d=u.getNode(),f=ku(d);if(f.canIndent()){let p=f.getKey(),h=Lr();if(h.anchor.set(p,0,"element"),h.focus.set(p,0,"element"),h=Po(h),h.anchor.is(u))return!0}return!1}(r)?o.shiftKey?Wo:eo:Ds;return e.dispatchCommand(s)},Ee),e.registerCommand(eo,()=>{let o=typeof t=="number"?t:t?t.peek():null,r=K();if(!I(r))return!1;let s=typeof n=="function"?n:n.peek();return El((i)=>{if(s(i)){let l=i.getIndent()+1;(!o||l<o)&&i.setIndent(l)}})},Si))}var e$=me({build:(e,t,n)=>So(t),config:Be({$canIndent:IN,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:o,maxIndent:r,$canIndent:s}=n.getOutput();return qt(()=>{if(!o.value)return LN(e,r,s)})}}),t$=me({build:(e)=>Ol(()=>e.isEditable(),(t)=>e.registerEditableListener((n)=>{t.value=n})),name:"@lexical/extension/WatchEditable"});var Se=wp,{$applyFormatToDom:IP,$createHorizontalRuleNode:Gu,$defaultShouldInsertAfter:LP,$getExtensionDependency:FP,$getExtensionOutput:FN,$getPeerDependency:PN,$isDecoratorTextNode:PP,$isHorizontalRuleNode:BN,AutoFocusExtension:BP,ClearEditorExtension:KP,ClickAfterLastBlockExtension:zP,DecoratorTextExtension:UP,DecoratorTextNode:HP,EditorStateExtension:WP,HorizontalRuleExtension:KN,HorizontalRuleNode:ju,IMEExtension:GP,INSERT_HORIZONTAL_RULE_COMMAND:jP,InitialStateExtension:YP,LexicalBuilder:zN,NestedEditorExtension:VP,NodeSelectionDataSelectedExtension:XP,NodeSelectionExtension:qP,NormalizeInlineElementsExtension:UN,NormalizeTripleClickSelectionExtension:HN,PreventSelectAllExtension:JP,RootElementExtension:ZP,SelectBlockExtension:QP,SelectionAlwaysOnDisplayExtension:eB,TabIndentationExtension:tB,WatchEditableExtension:nB,applyFormatFromStyle:oB,applyFormatToDom:rB,batch:kp,buildEditorFromExtensions:sB,computed:iB,configExtension:WN,declarePeerDependency:aB,defineExtension:lB,effect:yt,getExtensionDependencyFromEditor:cB,getKnownTypesAndNodes:GN,getPeerDependencyFromEditor:so,getPeerDependencyFromEditorOrThrow:uB,namedSignals:Mt,registerClearEditor:dB,registerTabIndentation:Yu,safeCast:fB,shallowMergeConfig:gB,signal:Ks,untracked:pB,watchedSignal:jN}=Se;var n$=me({name:"@lexical/react/ReactProvider"});var o$=Ip,YN=o$.ReactProviderExtension;function VN(){return Xe().getTextContent()}function Lp(e,t=!0){if(e)return!1;let n=VN();return t&&(n=n.trim()),n===""}function r$(e,t){return()=>Lp(e,t)}function XN(e){if(!Lp(e,!1))return!1;let t=Xe().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(Dt(r))return!1;if(W(r)){if(!An(r))return!1;if(r.__indent!==0)return!1;let s=r.getChildren(),i=s.length;for(let l=0;l<i;l++){let c=s[o];if(!ne(c))return!1}}}return!0}function s$(e){return()=>XN(e)}function i$(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(W(n)){let i=n.getFirstChild();if(i!==null){n=i;continue}}else if(ne(n)){let i=n.getTextContentSize();if(o+i>t)return{node:n,offset:t-o};o+=i}let r=n.getNextSibling();if(r!==null){n=r;continue}let s=n.getParent();for(;s!==null;){let i=s.getNextSibling();if(i!==null){n=i;continue e}s=s.getParent()}break}return null}function a$(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l$(e,t,n,o){let r=(i)=>i instanceof n,s=(i)=>{let l=xt(i.getTextContent());l.setFormat(i.getFormat()),i.replace(l)};return[e.registerNodeTransform($n,(i)=>{if(!i.isSimpleText())return;let l,c=i.getPreviousSibling(),u=i.getTextContent(),d=i;if(ne(c)){let p=c.getTextContent(),h=t(p+u);if(r(c)){if(h===null||((m)=>m.getLatest().__mode)(c)!==0)return void s(c);{let m=h.end-p.length;if(m>0){let _=p+u.slice(0,m);if(c.select(),c.setTextContent(_),m===u.length)i.remove();else{let x=u.slice(m);i.setTextContent(x)}return}}}else if(h===null||h.start<p.length)return}let f=0;for(;;){l=t(u);let p,h=l===null?"":u.slice(l.end);if(u=h,h===""){let _=d.getNextSibling();if(ne(_)){h=d.getTextContent()+_.getTextContent();let x=t(h);if(x===null)return void(r(_)?s(_):_.markDirty());if(x.start!==0)return}}if(l===null)return;if(l.start===0&&ne(c)&&c.isTextEntity()){f+=l.end;continue}l.start===0?[p,d]=d.splitText(l.end):[,p,d]=d.splitText(l.start+f,l.end+f),p===void 0&&a$(165,"nodeToReplace");let m=o(p);if(m.setFormat(p.getFormat()),p.replace(m),d==null)return;f=0,c=m}}),e.registerNodeTransform(n,(i)=>{let l=i.getTextContent(),c=t(l);if(c===null||c.start!==0)return void s(i);if(l.length>c.end)return void i.splitText(c.end);let u=i.getPreviousSibling();ne(u)&&u.isTextEntity()&&(s(u),s(i));let d=i.getNextSibling();ne(d)&&d.isTextEntity()&&(s(d),r(i)&&s(i))})]}var zs=Fp,{$canShowPlaceholder:CB,$canShowPlaceholderCurry:Vu,$findTextIntersectionFromCharacters:yB,$isRootTextContentEmpty:SB,$isRootTextContentEmptyCurry:NB,$rootTextContent:EB,registerLexicalTextEntity:TB}=zs;var c$={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Xu=Symbol.for("@lexical/dragon/WindowState");function u$(e=function(){return typeof window<"u"?window:void 0}()){return e?JN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function JN(e,t,n){let o=function(r){let s=r[Xu];return s===void 0&&(s={dispose:()=>{},editors:new Map,installs:new Set},r[Xu]=s),s}(e);if(o.installs.size===0){let r=f$.bind(e);e.addEventListener("message",r,!0),o.dispose=()=>{e.removeEventListener("message",r,!0)}}if(o.installs.add(t),n){let r=o.editors.get(n)||new Set;r.add(t),o.editors.set(n,r)}return d$.bind(null,e,o,t,n)}function d$(e,t,n,o){if(o){let r=t.editors.get(o);r&&r.delete(n)&&r.size===0&&t.editors.delete(o)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[Xu])}function qN(e){return e&&e.ownerDocument.defaultView}function ZN(e){let t=jN(()=>qN(e.getRootElement()),(n)=>e.registerRootListener((o)=>{n.value=qN(o)}));return yt(()=>{let n=t.value;if(n)return JN(n,Symbol("@lexical/dragon/editorInstall"),e)})}function f$(e){if(e.origin!==this.location.origin)return;let t=function(o){let r=o[Xu];if(r===void 0)return null;let s=bu(gS(o.document));return Ru(s)&&r.editors.has(s)?s:null}(this);if(t===null)return;let n=e.data;if(typeof n=="string"){let o;try{o=JSON.parse(n)}catch(r){return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){let r=o.payload;if(r&&r.functionId==="makeChanges"){let s=r.args;if(Array.isArray(s)){let[i,l,c,u,d,f]=s;if(![i,l,u,d].every(Number.isFinite)||typeof c!="string"&&c!==-1)return;t.update(()=>{let p=K();if(I(p)){let h=p.anchor,m=h.getNode(),_=0,x=0;if(ne(m)&&i>=0&&l>=0&&(_=i,x=i+l,p.setTextNodeRange(m,_,m,x)),typeof c!="string"||_===x&&c===""||(p.insertRawText(c),m=h.getNode()),ne(m)){let C=m.getTextContentSize();_=Math.min(Math.max(u,0),C),x=u<0||d<0?_:Math.min(u+d,C),p.setTextNodeRange(m,_,m,x)}if(typeof f=="string"&&d>0&&!p.isCollapsed()){let C=c$[f];C!==void 0&&p.formatText(C)}e.stopImmediatePropagation()}})}}}}}var g$=me({build:(e,t,n)=>Mt(t),config:Be({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,t,n)=>yt(()=>n.getOutput().disabled.value?void 0:ZN(e))});var Bp=Pp,{DragonExtension:QN,installDragonSupport:AB,registerDragonSupport:eE}=Bp;function Us(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Ui;function Qr(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Gp(e){return Ui&&Ui.editor===e?Ui:void 0}function Zu(e,t){let n=Gp(t);return n&&n[e]}function p$(e,t){if("cfg"in t){let{cfg:n,updater:o}=t;return[n,o(Qr(e,n))]}return t}function qu(e,t){let n=t;for(let o of e){let[r,s]=p$(n,o),i=r.key;if(n===t&&Qr(n,r)===s)continue;let l=n===t||n===void 0?h$(t):n;l[i]=s,n=l}return n}function h$(e){return Object.create(e||null)}function Al(e,t){return[e,t]}function m$(e,t){return{cfg:e,updater:t}}function dE(e,t,n,o=Ke()){let r=Ui,s=Gp(o);try{return Ui={...s,editor:o,[e]:t},n()}finally{Ui=r}}function fE(e,t=()=>{}){return(n,o=Ke())=>(r)=>{let s=Gp(o),i=s&&s[e],l=qu(n,i||t(o));return l&&l!==i?dE(e,l,r,o):r()}}function gE(e,t,n,o){return Object.assign(Go(Symbol(t),{isEqual:o,parse:n}),{[e]:!0})}var pE=(e,t,n)=>{hE(e),n()};function hE(e){if(!Yr(e))return;let t=e;if(t.querySelector("style")===null)return;let n=new Map;function o(r){let s=n.get(r);if(s===void 0){s=new Set;for(let i=0;i<r.style.length;i++)s.add(r.style[i]);n.set(r,s)}return s}try{for(let r of Array.from(t.styleSheets)){let s;try{s=r.cssRules}catch(i){continue}for(let i of Array.from(s)){if(!kn(i,CSSStyleRule))continue;let l;try{l=t.querySelectorAll(i.selectorText)}catch(c){continue}for(let c of Array.from(l)){if(!Ce(c))continue;let u=o(c);for(let d=0;d<i.style.length;d++){let f=i.style[d];u.has(f)||c.style.setProperty(f,i.style.getPropertyValue(f),i.style.getPropertyPriority(f))}}}}}catch(r){}}var jp="@lexical/html/DOM",Qu=Symbol.for("@lexical/html/DOMExportContext"),mE="@lexical/html/DOMImport",Rl=Symbol.for("@lexical/html/DOMImportContext"),_$=()=>!0;function Yp(e,t,n){return gE(Qu,e,t,n)}var _E=Yp("root",Boolean),Vp=Yp("isExport",Boolean);function xE(e){let t=so(e,jp);return t?t.output.defaults:void 0}function x$(e,t=Ke()){return Qr(function(n){return Zu(Qu,n)||xE(n)}(t),e)}function Xp(e){let t=so(e,jp);return t?t.output.runtime:void 0}function C$(e,t,n=Ke()){let o=Xp(n);o&&o.setContextValue(e,t)}function y$(e,t,n=Ke()){let o=Xp(n);o&&o.setContextValue(e,t(Qr(o.editorContext,e)))}function ed(e=Ke()){let t=Xp(e);return t?t.getSessionConfig():Kg(e)}var qp=fE(Qu,xE);function S$(e,t,n){return{...t,...n,nodes:e}}function N$(e){return(t)=>t instanceof e}function E$(e,{nodes:t}){if(t==="*")return _$;let n={},o=[];for(let r of t)if("getType"in r){let s=r.getType();if(n){let i=e.get(s);i===void 0&&Us(339,r.name,s);for(let l of i)n[l]=!0}o.push(N$(r))}else n=void 0,o.push(r);return n||(o.length===1?o[0]:(r)=>{for(let s of o)if(s(r))return!0;return!1})}function tE(e){return(t,n,o)=>e(t,o)}function Kp(e){return(t,n,o,r)=>e(t,n,r)}function nE(e){return(t,n,o,r,s)=>e(t,n,o,s)}function T$(e){return(t,n,o,r,s,i)=>e(t,n,o,r,i)}function oE(e,t){return(n,o)=>{let r=()=>e(n,o),s=t(n);return s?s(n,r,o):r()}}function zp(e,t){return(n,o,r)=>{let s=()=>e(n,o,r),i=t(n);return i?i(n,o,s,r):s()}}var b$=zp,v$=Kp;function rE(e,t){return(n,o,r,s)=>{let i=()=>e(n,o,r,s),l=t(n);return l?l(n,o,r,i,s):i()}}function O$(e,t){return(n,o,r,s,i)=>{let l=()=>e(n,o,r,s,i),c=t(n);return c?c(n,o,r,s,l,i):l()}}function A$(e,t){return(n,o,r,s)=>{e(n,o,r,s);let i=t(n);i&&i(n,o,r,s)}}function fr(e,t,n,o,r){let s=n[t];for(let i of e[t])if(typeof i[0]=="function"){let[l,c]=i;s=o(s,(u)=>l(u)&&c||void 0)}else{let l=i[1],c={};for(let u in l){let d=l[u];d&&(c[u]=d.reduce((f,p)=>o(f,()=>p),s))}s=o(s,(u)=>{let d=c[u.getType()];return d&&r(d)})}n[t]=s}function R$(e,t,n,o){if(!o)return;let r=e[t];if(typeof n=="function")r.push([n,o]);else{let s=r[r.length-1],i;s&&s[0]==="types"?i=s[1]:(i={},r.push(["types",i]));for(let l in n){let c=i[l]||[];i[l]=c,c.push(o)}}}function M$(e){return e.nodes==="*"}function D$(e,t){let n=Ou(GN(e).nodes),o={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let r of function(s){let i=[],l=[],c=[];for(let f of s)if(M$(f))i.push(f);else if(Array.isArray(f.nodes))for(let p of f.nodes)Ug(p.prototype)?c.push(f.nodes.length===1?f:{...f,nodes:[p]}):l.push(f.nodes.length===1?f:{...f,nodes:[p]});let u=new Map,d=(f)=>{let p=u.get(f);if(p===void 0){p=-1;for(let h of bS(f))p++;u.set(f,p)}return p};return c.sort((f,p)=>d(f.nodes[0])-d(p.nodes[0])),[...c,...l,...i]}(t)){let s=E$(n,r);for(let i in o)R$(o,i,s,r[i])}return o}function $$(e){return e}function Up(e,{overrides:t}){let n=D$(e,t),o={...Wg,...e.dom};return fr(n,"$createDOM",o,oE,tE),fr(n,"$exportDOM",o,oE,tE),fr(n,"$extractWithChild",o,O$,T$),fr(n,"$getDOMSlot",o,b$,v$),fr(n,"$shouldExclude",o,zp,Kp),fr(n,"$shouldInclude",o,zp,Kp),fr(n,"$getSlotTargetElement",o,rE,nE),fr(n,"$updateDOM",o,rE,nE),fr(n,"$decorateDOM",o,A$,$$),o}function CE(e){return{get:(t)=>Qr(e,t)}}function sE(e){let t=Object.create(null);return qu(e,t)||t}function Hp(e,t){let n=CE(t);return e.filter((o)=>!(o.disabledForEditor&&o.disabledForEditor(n)))}function w$(e){if(e.nodes==="*")return()=>!0;let t=e.nodes.map((n)=>{let o=n;return Ug(o.prototype)?(r)=>r instanceof o:n});return(n)=>t.some((o)=>o(n))}class yE{editor;initialEditorConfig;overrides;editorContext;hasSessionGates;installed;sessionCache=new Map;constructor(e,t,n,o){this.editor=e,this.initialEditorConfig=t,this.overrides=n,this.editorContext=o,this.installed=Hp(n,o),this.hasSessionGates=n.some((r)=>r.disabledForSession)}setContextValue(e,t){let n=this.installed;this.editorContext[e.key]=t;let o=Hp(this.overrides,this.editorContext);if(function(c,u){if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==u[d])return!1;return!0}(n,o))return;let r=function(c,u){let d=new Set(c),f=new Set(u),p=[];for(let h of c)f.has(h)||p.push(h);for(let h of u)d.has(h)||p.push(h);return p}(n,o);this.installed=o,this.sessionCache.clear();let s=Up(this.initialEditorConfig,{overrides:o});this.editor._config.dom=s;let i=function(c){let u=[];for(let d of c)(d.$createDOM||d.$getDOMSlot||d.$decorateDOM)&&u.push(w$(d));return u.length===0?null:(d)=>u.some((f)=>f(d))}(r);if(!i)return;let l=s.$updateDOM;s.$updateDOM=(c,u,d,f)=>!!i(c)||l(c,u,d,f),this.editor.update(_i,{discrete:!0}),s.$updateDOM=l}getSessionConfig(){let e=this.editor._config.dom||Wg;if(!this.hasSessionGates)return e;let t=CE(Zu(Qu,this.editor)||this.editorContext),n=[],o=[];if(this.installed.forEach((i,l)=>{i.disabledForSession&&i.disabledForSession(t)?n.push(String(l)):o.push(i)}),n.length===0)return e;let r=n.join(","),s=this.sessionCache.get(r);return s||(s=Up(this.initialEditorConfig,{overrides:o}),this.sessionCache.set(r,s)),s}}var k$=me({build(e,t,n){let{initialEditorConfig:o}=n.getInitResult(),r=sE(t.contextDefaults);return{defaults:r,runtime:new yE(e,o,t.overrides,r)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Cu,()=>{let e=je().createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){let n={dom:e.dom,nodes:e.nodes},o=sE(t.contextDefaults),r=Hp(t.overrides,o);return e.dom=Up(e,{overrides:r}),{initialEditorConfig:n}},mergeConfig(e,t){let n=Pt(e,t);for(let o of["overrides","contextDefaults"])t[o]&&(n[o]=[...e[o],...t[o]]);return n},name:jp}),td=Symbol.for("@lexical/html/SelectorImpl");function Ml(e,t){let n={kind:"element",predicate:(o=t,o.length===0?Ce:o.length===1?o[0]:(s,i)=>{for(let l of o)if(!l(s,i))return!1;return!0}),tags:e};var o;let r=(s)=>Ml(e,[...t,s]);return{[td]:n,attr:(s,i,l)=>r(Wp(s,i,l)),classAll:(...s)=>r(NE(s)),classAny:(...s)=>r(function(i){let l=SE(i);if(l.length===0)return()=>!1;return(c)=>{if(!Ce(c))return!1;let u=c.classList;for(let d of l)if(u.contains(d))return!0;return!1}}(s)),styleAny:(s,i,l)=>r(function(c,u,d){if(typeof u=="string")return(f)=>Ce(f)&&f.style.getPropertyValue(c)===u;if(u instanceof RegExp){let f=d&&d.capture,p=u;return(h,m)=>{if(!Ce(h))return!1;let _=h.style.getPropertyValue(c);if(!_)return!1;let x=_.match(p);return x!==null&&(f!==void 0&&(m[f]=x),!0)}}Us(362,JSON.stringify(c))}(s,i,l))}}function SE(e){let t=[];for(let n of e)n&&t.push(n);return t}function NE(e){let t=SE(e);return t.length===0?()=>!0:(n)=>{if(!Ce(n))return!1;let o=n.classList;for(let r of t)if(!o.contains(r))return!1;return!0}}function Wp(e,t,n){if(t===!0)return(o)=>Ce(o)&&o.hasAttribute(e);if(typeof t=="string")return(o)=>Ce(o)&&o.getAttribute(e)===t;if(t instanceof RegExp){let o=n&&n.capture,r=t;return(s,i)=>{if(!Ce(s))return!1;let l=s.getAttribute(e);if(l==null)return!1;let c=l.match(r);return c!==null&&(o!==void 0&&(i[o]=c),!0)}}Us(361,JSON.stringify(e))}var I$={kind:"text",predicate:Ls,tags:new Set},L$={[td]:I$},F$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},P$={[td]:F$},zi={any:()=>Ml(new Set,[]),comment:()=>P$,tag(...e){e.length>0||Us(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return Ml(t,[])},text:()=>L$};function B$(e,t){return Ce(e)&&e.nodeName===t.toUpperCase()}var EE=/[A-Za-z0-9_-]/;class TE{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&EE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e==='"'||e==="'","expected quote");let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,"$1")}assert(e,t){e||Us(364,String(this.pos+1),t,this.source)}}function K$(e){let t=new Set,n=[],o=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(EE.test(e.peek())){let r=e.readIdent();r&&t.add(r.toUpperCase())}for(;!e.eof();){let r=e.peek();if(r==="."){e.consume();let s=e.readIdent();e.assert(s!=="",'expected class name after "."'),o.push(s)}else if(r==="#"){e.consume();let s=e.readIdent();e.assert(s!=="",'expected id after "#"'),n.push(Wp("id",s))}else{if(r!=="[")break;{e.consume(),e.skipWhitespace();let s=e.readIdent();e.assert(s!=="",'expected attribute name after "["'),e.skipWhitespace();let i=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let l=e.peek();l==='"'||l==="'"?i=e.readQuoted():(i=e.readIdent(),e.assert(i!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),n.push(Wp(s,i))}}}return o.length>0&&n.push(NE(o)),{predicates:n,tags:t}}function bE(e){let t=new TE(e,0),n=[];for(;;){let r=K$(t);if(n.push(r),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===",",'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace()}if(n.length===1)return Ml(n[0].tags,n[0].predicates);let o=new Set;if(n.every((r)=>r.tags.size>0))for(let r of n)for(let s of r.tags)o.add(s);return Ml(o,[(r,s)=>{for(let i of n){let l=r.nodeName;if(i.tags.size>0&&!i.tags.has(l))continue;let c=!0;for(let u of i.predicates)if(!u(r,s)){c=!1;break}if(c)return!0}return!1}])}function gr(e){return e}function Hs(e,t,n){return gE(Rl,e,t,n)}var z$=Hs("importSource",()=>"unknown"),U$=Hs("importSourceDataTransfer",()=>null),Ju=Hs("textFormat",()=>0),vE=Hs("textStyle",()=>({}));function OE(e){if(!Ce(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function AE(e){if(Ls(e))return!0;if(!Ce(e))return!1;let t=e.style.display;return t?t.startsWith("inline"):!Is(e)&&ki(e)}var RE=Hs("whitespaceConfig",()=>({isInline:AE,preservesWhitespace:OE})),ME=Hs("importOverlays",()=>[]);class DE{constructor(e){this.record=e}get(e){return Qr(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(Qr(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function $E(e){let t=so(e,mE);return t?t.output.defaults:void 0}function wE(e,t=Ke()){return Qr(function(n){return Zu(Rl,n)||$E(n)}(t),e)}var Jp=fE(Rl,$E);function Hi(e){return Br(e)||Dt(e)&&!e.isInline()}function kE(e,t){let n=[],o=[],r=()=>{o.length!==0&&(n.push(t().splice(0,0,o)),o=[])};for(let s of e)if(Hi(s)){if(r(),W(s)){let i=kE(s.getChildren(),t);s.splice(0,s.getChildrenSize(),i)}n.push(s)}else o.push(s);return r(),n}function IE(e,t){if(!Ce(t))return e;let n=t.style.textAlign;if(!Zp(n))return e;for(let o of e)Br(o)&&o.getFormatType()===""&&o.setFormat(n);return e}function LE(e,t,n){e.length===1&&Pe(e[0])&&(e=[]);let o=ye();if(Ce(n)){let r=n.style.textAlign;Zp(r)&&o.setFormat(r)}return[o.splice(0,0,e)]}var FE={$accepts:Hi,$packageRun:LE,name:"BlockSchema"},H$={$accepts:(e)=>!Hi(e),name:"InlineSchema"},W$={$accepts:Hi,$packageRun:(e)=>e,name:"NestedBlockSchema"},PE={$accepts:Hi,$packageRun:LE,name:"RootSchema"},Ws=zi,G$=new Set(["center","end","justify","left","right","start"]);function Zp(e){return G$.has(e)}var j$={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},Y$={CODE:nS,MARK:oS},V$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),X$=gr({$import:(e,t)=>{let n=e.get(Ju),o=j$[t.nodeName],r=function(p){return{fontStyle:p.style.fontStyle,fontWeight:p.style.fontWeight,textDecoration:p.style.textDecoration,verticalAlign:p.style.verticalAlign}}(t),s=o?(i=o,{fontStyle:(l=r).fontStyle||i.fontStyle,fontWeight:l.fontWeight||i.fontWeight,textDecoration:l.textDecoration||i.textDecoration,verticalAlign:l.verticalAlign||i.verticalAlign}):r;var i,l;let c=(u=n,d=function(p){let h=0,m=0,{fontWeight:_,fontStyle:x,textDecoration:C,verticalAlign:y}=p;if(_==="700"||_==="bold"?h|=fl:_!=="normal"&&_!=="400"||(m|=fl),x==="italic"?h|=pl:x==="normal"&&(m|=pl),C){let N=C.split(" ");N.includes("underline")&&(h|=ml),N.includes("line-through")&&(h|=hl),N.includes("none")&&(m|=ml|hl)}return y==="sub"?(h|=gu,m|=pu):y==="super"?(h|=pu,m|=gu):y==="baseline"&&(m|=gu|pu),{clear:m,set:h}}(s),u&~d.clear|d.set);var u,d;let f=Y$[t.nodeName];return f&&(c|=f),c===n?e.$importChildren(t):e.$importChildren(t,{context:[Al(Ju,c)]})},match:Ws.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function iE(e,t,n){let o=e;for(;;){let r=null;for(;(r=t?o.nextSibling:o.previousSibling)===null;){let i=o.parentNode;if(i===null)return null;o=i}if(o=r,!n.isInline(o))return null;let s=o;for(;(s=t?o.firstChild:o.lastChild)!==null;)o=s;if(Ls(o))return o;if(o.nodeName==="BR")return null}}function aE(e,t){return t!==0&&ne(e)?e.setFormat(t):e}function lE(e,t){if(ne(e)){let n=function(o){let r="";for(let s in o)V$.has(s)||(r+=`${s}: ${o[s]}; `);return r.trimEnd()}(t);n!==""&&e.setStyle(n)}return e}var q$=gr({$import:(e,t)=>{let n=e.get(Ju),o=e.get(vE),r=e.get(RE);if(function(l,c){let u=l.parentNode;for(;u!==null;){if(c.preservesWhitespace(u))return!0;u=u.parentNode}return!1}(t,r)){let l=tl(t.textContent||"");for(let c of l)aE(c,n),lE(c,o);return l}let s=function(l,c){let u=(l.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(u.length===0)return"";if(u[0]===" "){let d=l,f=!0;for(;d!==null&&(d=iE(d,!1,c))!==null;){let p=d.textContent||"";if(p.length>0){/[ \t\n]$/.test(p)&&(u=u.slice(1)),f=!1;break}}f&&(u=u.slice(1))}if(u.length>0&&u[u.length-1]===" "){let d=l,f=!0;for(;d!==null&&(d=iE(d,!0,c))!==null;)if((d.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){f=!1;break}f&&(u=u.slice(0,-1))}return u}(t,r);if(s==="")return[];let i=xt(s);return aE(i,n),lE(i,o),[i]},match:Ws.text(),name:"@lexical/html/#text"}),J$=gr({$import:()=>[],match:Ws.tag("script","style"),name:"@lexical/html/script-style-ignore"}),Z$=gr({$import:(e,t)=>ES(t)||NS(t)?[]:[ln()],match:Ws.tag("br"),name:"@lexical/html/br"}),Q$=gr({$import:(e,t)=>{let n=ye();if(Jn(n,t),Xr(t,n),n.getFormatType()===""){let o=t.getAttribute("align");o&&Zp(o)&&n.setFormat(o)}return yn(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Ws.tag("p"),name:"@lexical/html/p"}),BE=gr({$import:(e,t,n)=>Ke().hasNode(ju)?[Gu()]:n(),match:Ws.tag("hr"),name:"@lexical/html/hr"}),KE=[J$,Q$,BE,gr({$import:(e,t,n)=>Is(t)?IE(e.$importChildren(t,{schema:FE}),t):n(),match:Ws.any(),name:"@lexical/html/transparent-block"}),q$,Z$,X$];function ew(e,t){let n=[],o=0,r=0;for(;o<e.length&&r<t.length;)e[o]<=t[r]?n.push(e[o++]):n.push(t[r++]);for(;o<e.length;)n.push(e[o++]);for(;r<t.length;)n.push(t[r++]);return n}function zE(e){let t=[],n=new Map,o=[],r=[],s=[],i=new Set;e.forEach((c,u)=>{let d=function(p){let h=p[td];return h===void 0&&Us(360),h}(c.match),f=c.name||function(p,h){if(p.kind==="text")return`#text@${h}`;if(p.kind==="comment")return`#comment@${h}`;if(p.tags.size===0)return`*@${h}`;return`${Array.from(p.tags).join(",").toLowerCase()}@${h}`}(d,u);if(c.name&&i.add(c.name),t.push({$import:c.$import,name:f,predicate:d.predicate}),d.kind==="text")r.push(u);else if(d.kind==="comment")s.push(u);else if(d.tags.size===0)o.push(u);else for(let p of d.tags){let h=n.get(p);h||(h=[],n.set(p,h)),h.push(u)}});let l=new Map;if(o.length===0)for(let[c,u]of n)l.set(c,u);else for(let[c,u]of n)l.set(c,ew(u,o));return{byTag:l,commentIndices:s,rules:t,textIndices:r,wildcardIndices:o}}function cE(e,t){return Ls(t)?e.textIndices:t.nodeType===8?e.commentIndices:Ce(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:tw}var tw=Object.freeze([]);function UE(e){let t=[];for(let n of e)if(nw(n))for(let o of n.rules)t.push(o);else t.push(n);return t}function nw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function ow(e){let t=UE(e);return{__type:"CompiledOverlayRules",dispatch:zE(t),rules:t}}var rw=Object.freeze({});function sw(e,t){return{$importChildren:(o,r)=>function(s,i,l){let c=l&&l.rules?l.rules.dispatch:void 0;c&&s.overlays.push(c);try{let u=()=>HE(s,i,l);return l&&l.context?Jp(l.context,s.editor)(u):u()}finally{c&&s.overlays.pop()}}(e,o,r),$importOne:(o,r)=>Qp(e,o,r),captures:t,get:(o)=>wE(o,e.editor),session:e.session}}function HE(e,t,n){let o=n&&n.$onChild,r=[];for(let l of Array.from(t.childNodes)){let c=Qp(e,l,void 0);for(let u of c){let d=o?o(u):u;d!=null&&r.push(d)}}let s=n&&n.$after?n.$after(r):r,i=n&&n.schema;return i?function(l,c,u,d){let f=[],p=null,h=()=>{if(p===null)return;let m=p;if(p=null,l.$packageRun){let _=l.$packageRun(m,u,d);if(_.length>0){for(let x of _)f.push(x);return}}if(l.onReject==="hoist")for(let _ of m)f.push(_)};for(let m of c)l.$accepts(m,u)?(h(),f.push(m)):(p===null&&(p=[]),p.push(m));return h(),l.$finalize?l.$finalize(f,u):f}(i,s,null,t):s}function Qp(e,t,n){let o=()=>function(r,s){let i=function(d,f){let p=[];for(let m=d.overlays.length-1;m>=0;m--){let _=d.overlays[m],x=cE(_,f);x.length>0&&p.push({dispatch:_,indices:x})}let h=cE(d.dispatch,f);return h.length>0&&p.push({dispatch:d.dispatch,indices:h}),p}(r,s);if(i.length===0)return uE(r,s);let l=0,c=0,u=()=>{for(;l<i.length;){let{dispatch:d,indices:f}=i[l];for(;c<f.length;){let p=f[c++],h=d.rules[p],m={};if(h.predicate(s,m)){let _=sw(r,Object.keys(m).length===0?rw:m);try{return h.$import(_,s,u)}catch(x){throw x}}}l++,c=0}return uE(r,s)};return u()}(e,t);return n&&n.context?Jp(n.context,e.editor)(o):o()}function uE(e,t){if(t.childNodes.length===0)return[];let n=[];for(let o of Array.from(t.childNodes)){let r=Qp(e,o,void 0);for(let s of r)n.push(s)}return n}var iw=gr({$import:(e,t)=>e.$importChildren(t),match:zi.any(),name:"@lexical/html/default-hoist"}),eh=me({build(e,t){let n=zE(UE(t.rules)),o=qu(t.contextDefaults,void 0),r=t.preprocess;return{$generateNodesFromDOM:(s,i)=>{let l=Zu(Rl,e)||o,c=i&&i.context?qu(i.context,l):l,u=c!==void 0&&c!==l?c:Object.create(l||null),d=new DE(u),f={session:d};return function(p,h,m){let _=p.length-1,x=()=>{for(;_>=0;)return void(0,p[_--])(h,m,x)};x()}(i&&i.preprocess?[...r,...i.preprocess]:r,s,f),dE(Rl,u,()=>function(p,h,m,_){return HE({dispatch:p,editor:h,overlays:_.get(ME).map((x)=>x.dispatch),session:_},Yr(m)?m.body:m,{schema:PE})}(n,e,s,d),e)},defaults:o}},config:{contextDefaults:[],preprocess:[pE],rules:[iw]},mergeConfig:(e,t)=>Pt(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:mE});function aw(e,t){return FN(eh).$generateNodesFromDOM(e,t)}var WE=me({dependencies:[tn(eh,{rules:KE})],name:"@lexical/html/CoreImport"}),lw=[BE],cw=me({dependencies:[KN,WE],name:"@lexical/html/HorizontalRuleImport"}),uw={any:zi.any,comment:zi.comment,css:bE,tag:zi.tag,text:zi.text},GE=new Set(["STYLE","SCRIPT"]);function dw(e,t){hE(t);let n=Yr(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let s of n)if(!GE.has(s.nodeName)){let i=YE(s,e,r,!1);if(i!==null)for(let l of i)o.push(l)}return function(s){for(let i of s)i.getParent()&&i.getNextSibling()instanceof ll&&i.insertAfter(ln());for(let i of s){let l=i.getParent();l&&l.splice(i.getIndexWithinParent(),1,i.getChildren())}}(r),o}function jE(e,t=null,n=Ke()){return qp([Al(Vp,!0)],n)(()=>{let o=Xe(),r=ed(n),s=I(t)?qn(t.anchor.getNode()):null,i=e.append.bind(e);for(let l of(W(s)?s:o).getChildren())nd(n,l,i,t,r);return e})}function fw(e,t=Xe()){let n=Ke();return qp([Al(Vp,!0),Al(_E,!0)],n)(()=>{let o=ed(n),r=e.append.bind(e);return nd(n,t,r,null,o),e})}function gw(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Us(338),vy(e),jE(je().createElement("div"),t,e).innerHTML}function nd(e,t,n,o=null,r=Kg(e)){let s=r.$shouldInclude(t,o,e),i=r.$shouldExclude(t,o,e),l=t;o!==null&&ne(t)&&(l=Fs(o,t,"clone"));let c=r.$exportDOM(l,e),{element:u,after:d,append:f,$getChildNodes:p}=c;if(!u)return!1;let h=je().createDocumentFragment(),m=p?p():W(l)?l.getChildren():[],_=s&&Je(o)&&W(t)?null:o,x=h.append.bind(h);for(let C of m){let y=nd(e,C,x,_,r);!s&&y&&r.$extractWithChild(t,C,o,"html",e)&&(s=!0)}if(s&&!i){if((Ce(u)||Yg(u))&&(f?f(h):u.append(h)),n(u),d){let C=d.call(l,u);C&&(Yg(u)?u.replaceChildren(C):u.replaceWith(C))}}else n(h);return s}function pw(e,t,n,o=null){return nd(e,t,n.append.bind(n),o,ed(e))}function YE(e,t,n,o,r=new Map,s){let i=[];if(GE.has(e.nodeName))return i;let l=null,c=function(m,_){let{nodeName:x}=m,C=_._htmlConversions.get(x.toLowerCase()),y=null;if(C!==void 0)for(let N of C){let E=N(m);E!==null&&(y===null||(y.priority||0)<=(E.priority||0))&&(y=E)}return y!==null?y.conversion:null}(e,t),u=c?c(e):null,d=null;if(u!==null){d=u.after;let m=u.node;if(l=Array.isArray(m)?m[m.length-1]:m,l!==null){for(let[,_]of r)if(l=_(l,s),!l)break;l&&i.push(...Array.isArray(m)?m:[l])}u.forChild!=null&&r.set(e.nodeName,u.forChild)}let f=e.childNodes,p=[],h=(l==null||!At(l))&&(l!=null&&Br(l)||o);for(let m=0;m<f.length;m++)p.push(...YE(f[m],t,n,h,new Map(r),l));if(d!=null&&(p=d(p)),Is(e)&&(p=hw(e,p,h?()=>{let m=new ll;return n.push(m),m}:ye)),l==null)if(p.length>0)for(let m of p)i.push(m);else Is(e)&&function(m){if(m.nextSibling==null||m.previousSibling==null)return!1;return ki(m.nextSibling)&&ki(m.previousSibling)}(e)&&i.push(ln());else W(l)&&l.append(...p);return i}function hw(e,t,n){let o=e.style.textAlign,r=[],s=[];for(let i=0;i<t.length;i++){let l=t[i];if(Br(l))o&&!l.getFormat()&&l.setFormat(o),r.push(l);else if(s.push(l),i===t.length-1||i<t.length-1&&Br(t[i+1])){let c=n();c.setFormat(o),c.append(...s),r.push(c),s=[]}}return r}var Te=th,{$appendNodeToHTML:kB,$distributeInlineWrapper:VE,$generateDOMFromNodes:IB,$generateDOMFromRoot:LB,$generateHtmlFromNodes:XE,$generateNodesFromDOM:qE,$generateNodesFromDOMViaExtension:JE,$getImportContextValue:FB,$getRenderContextValue:PB,$getSessionDOMRenderConfig:BB,$inlineStylesFromStyleSheets:KB,$isBlockLevel:ZE,$propagateTextAlignToBlockChildren:od,$setRenderContextValue:zB,$updateRenderContextValue:UB,$withImportContext:HB,$withRenderContext:WB,BlockSchema:QE,CoreImportExtension:io,CoreImportRules:GB,DOMImportExtension:Yo,DOMRenderExtension:jB,HorizontalRuleImportExtension:YB,HorizontalRuleImportRules:VB,ImportOverlays:eT,ImportSource:tT,ImportSourceDataTransfer:nT,ImportTextFormat:nh,ImportTextStyle:oh,ImportWhitespaceConfig:XB,InlineSchema:qB,NestedBlockSchema:JB,RenderContextExport:ZB,RenderContextRoot:QB,RootSchema:eK,contextUpdater:tK,contextValue:Wi,createImportState:nK,createRenderState:oK,defaultIsInline:rK,defaultPreservesWhitespace:sK,defineImportRule:ut,defineOverlayRules:rh,domOverride:iK,isElementOfTag:sh,parseSelector:aK,sel:dt}=Te;function sT(e,t,n=null){let o=ks(n),r=n?hS(n):[],s=n!==null&&r.length>0;if(s&&typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t,{shadowRoots:r});if(i!==null&&function(l,c){for(let u=l;u!==null;){if(u===c)return!0;u=Cl(u)}return!1}(i.offsetNode,n))return{node:i.offsetNode,offset:i.offset}}if(s){let i=n.getRootNode();if(Au(i)){let l=i.elementFromPoint(e,t);if(l!==null&&n.contains(l)){let c=function(u,d,f,p){let h=p.createRange(),m=(A)=>d<A.top?A.top-d:d>A.bottom?d-A.bottom:0,_=(A)=>u<A.left?A.left-u:u>A.right?u-A.right:0,x=p.createTreeWalker(f,NodeFilter.SHOW_TEXT),C=null,y=1/0,N=1/0;for(let A=x.nextNode();A;A=x.nextNode()){h.selectNodeContents(A);for(let O of h.getClientRects()){let D=m(O),H=_(O);(D<y||D===y&&H<N)&&(y=D,N=H,C=A)}}if(C===null)return null;let E=0,v=1/0,b=1/0;for(let A=0;A<=C.length;A++){h.setStart(C,A),h.collapse(!0);let O=h.getBoundingClientRect(),D=m(O),H=Math.abs(u-O.left);(D<v||D===v&&H<b)&&(v=D,b=H,E=A)}return{node:C,offset:E}}(e,t,l,o);if(c!==null)return c}}}if(typeof o.caretRangeFromPoint=="function"){let i=o.caretRangeFromPoint(e,t);return i===null?null:{node:i.startContainer,offset:i.startOffset}}if(typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t);return i===null?null:{node:i.offsetNode,offset:i.offset}}return null}function ji(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var rd={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function iT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(t)=>t}).createHTML(e);return e}var oT=(e,t)=>{if(!I(t))return t.insertRawText(e),!0;let n=(o)=>{let r=K();I(r)&&o(r)};return Li(e,{linebreak:()=>n((o)=>o.insertParagraph()),tab:()=>n((o)=>o.insertNodes([cn()])),text:(o)=>n((r)=>r.insertText(o))}),!0},sd={"application/x-lexical-editor":[(e,t,n)=>{try{let o=Ke(),r=JSON.parse(e);if(r&&r.namespace===o._config.namespace&&Array.isArray(r.nodes))return id(o,gT(r.nodes),t),!0}catch(o){console.error(o)}return n()}],"text/html":[(e,t,n)=>{try{let o=Ke(),r=new DOMParser().parseFromString(iT(e),"text/html");return id(o,qE(o,r),t),!0}catch(o){return console.error(o),n()}}],"text/plain":[oT],"text/uri-list":[oT]};function mw(e,t,n,o){if(!e)return!1;let r=(s)=>!!e[s]&&e[s](t,n,r.bind(null,s-1),o);return r(e.length-1)}function aT(e,t,n){let o=t.getData("text/plain");for(let r of function(s){return Object.keys(s.$importMimeType).filter((i)=>s.$importMimeType[i]!==void 0).sort((i,l)=>{let c=s.priority[i],u=s.priority[l];return c===void 0&&u===void 0?i<l?-1:i>l?1:0:c===void 0?1:u===void 0?-1:c-u})}(e)){let s=t.getData(r);if(s&&((r!=="text/html"||s!==o)&&mw(e.$importMimeType[r],s,n,t)))return!0}return!1}var _w={$importMimeType:sd,$insertDataTransfer:(e,t)=>aT({$importMimeType:sd,priority:rd},e,t),priority:rd},ah=me({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(n,o)=>aT(t,n,o),priority:t.priority}),config:Be({$importMimeType:sd,priority:rd}),mergeConfig(e,t){let n=Pt(e,t);if(t.$importMimeType){let o={...e.$importMimeType};for(let[r,s]of Object.entries(t.$importMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$importMimeType=o}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"}),xw=me({dependencies:[io,WN(ah,{$importMimeType:{"text/html":[(e,t,n,o)=>{let r=new DOMParser().parseFromString(iT(e),"text/html"),s=JE(r,{context:[Wi(tT,"paste"),Wi(nT,o)]});return id(Ke(),s,t),!0}]}})],name:"@lexical/clipboard/DOMImport"});function lh(e,t=K()){return t==null&&ji(166),I(t)&&t.isCollapsed()||t.getNodes().length===0?"":XE(e,t)}function ch(e,t=K()){return t==null&&ji(166),I(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(fT(e,t))}function lT(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function cT(e,t,n){(function(){let o=PN(ah.name);return o?o.output:_w})().$insertDataTransfer(e,t)}var uT="application/x-lexical-drag";function Cw(e,t){let n={editorKey:t.getKey()};e.setData(uT,JSON.stringify(n))}function dT(e,t,n){let o=e.dataTransfer;if(o===null)return!1;let r=function(u){let d=u.getData(uT);if(!d)return null;let f;try{f=JSON.parse(d)}catch(h){return null}return(p=f)!==null&&typeof p=="object"&&"editorKey"in p&&typeof p.editorKey=="string"?f:null;var p}(o);if(r===null)return!1;let s=function(u,d){let f=sT(u.clientX,u.clientY,d.getRootElement());if(f===null)return null;let p=Tt(f.node);if(p===null)return null;if(ne(p))return Vc(p,"next",f.offset);if(W(p))return Pg(p,f.offset,"next");let h=p.getParent();return h===null?null:Pg(h,p.getIndexWithinParent()+1,"next")}(e,t);if(s===null)return!1;let i=Jc(s);if(i===null)return!1;let l=r.editorKey===t.getKey(),c=K();if(l){if(!I(c)||c.isCollapsed())return!1;if(function(u,d){let{anchor:f,focus:p}=lr(ir(d),"next");return kr(f,u)<0&&kr(u,p)<0}(s,c))return e.preventDefault(),!0;c.removeText()}if(!i.origin.isAttached())return e.preventDefault(),!0;if(n(o,Mn(Os(i)),t),!l){let u=t.getRootElement(),d=u?u.ownerDocument:null,f=d?function(p,h){for(let m of dS(h)){let _=bu(m);if(Ru(_)&&_.getKey()===p&&Ce(m))return m}return null}(r.editorKey,d):null;f!==null&&f.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function yw(e,t){return dT(e,t,cT)}function Sw(e,t){return dT(e,t,(n,o)=>lT(n,o))}function id(e,t,n){e.dispatchCommand(yu,{nodes:t,selection:n})||(n.insertNodes(t),function(o){if(I(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=an(r,"previous");if(i)if(Kr(i))s=i.origin;else{let l=Xn(i,Et(Xe(),"next").getFlipped());for(let c of l){if(ne(c.origin)){s=c.origin;break}if(W(c.origin)&&!c.origin.isInline())break}}if(s&&ne(s)){let l=s.getFormat(),c=s.getStyle();o.format===l&&o.style===c||(o.format=l,o.style=c,o.dirty=!0)}}}(n))}function ih(e,t,n,o=[]){let r=t===null||n.isSelected(t),s=W(n)&&n.excludeFromCopy("html"),i=n;t!==null&&ne(i)&&(i=Fs(t,i,"clone"));let l=W(i)?i.getChildren():[],c=function(d){let f=d.exportJSON(),p=d.constructor;if(f.type!==p.getType()&&ji(58,p.name),W(d)){let h=f.children;Array.isArray(h)||ji(59,p.name)}return f}(i);ne(i)&&i.getTextContentSize()===0&&(r=!1);let u=r&&Je(t)&&W(n)?null:t;for(let d=0;d<l.length;d++){let f=l[d],p=ih(e,u,f,c.children);!r&&W(n)&&p&&n.extractWithChild(f,t,"clone")&&(r=!0)}if(r&&!s){let d=As(i);if(d.length>0){let f={};for(let p of d){let h=Ci(i,p);h===null&&ji(366,i.constructor.name,p);let m=[];ih(e,null,h,m),m.length===1&&m[0].type===h.getType()||ji(385,p,i.constructor.name,String(m.length),String(m.length>0?m[0].type:"none")),f[p]=m[0]}c.$slots=f}}if(r&&!s)o.push(c);else if(Array.isArray(c.children))for(let d=0;d<c.children.length;d++){let f=c.children[d];o.push(f)}return r}function fT(e,t){let n=[],o=Xe(),r=I(t)?t.anchor.getNode():Je(t)?t.getNodes()[0]??null:null,s=r!==null?qn(r):null,i=(W(s)?s:o).getChildren();for(let l=0;l<i.length;l++)ih(e,t,i[l],n);return{namespace:e._config.namespace,nodes:n}}function gT(e){let t=[];for(let n of e)t.push(Ky(n));return t}var Gi=null;async function Nw(e,t,n){if(Gi!==null)return!1;if(t!==null)return new Promise((u,d)=>{e.update(()=>{u(rT(e,t,n))})});let o=e.getRootElement(),r=e._window||window,s=r.document,i=wn(r);if(o===null||i===null)return!1;let l=s.createElement("span");l.style.position="fixed",l.style.top="-1000px",l.append(s.createTextNode("#")),o.append(l);let c=s.createRange();return c.setStart(l,0),c.setEnd(l,1),i.removeAllRanges(),i.addRange(c),new Promise((u,d)=>{let f=e.registerCommand(Ni,(p)=>(kn(p,ClipboardEvent)&&(f(),Gi!==null&&(r.clearTimeout(Gi),Gi=null),u(rT(e,p,n))),!0),Si);Gi=r.setTimeout(()=>{f(),Gi=null,u(!1)},50),s.execCommand("copy"),l.remove()})}function rT(e,t,n){if(n===void 0){let r=wn(e._window),s=K();if(!s||s.isCollapsed())return!1;if(!r)return!1;let i=ws(r,e.getRootElement()),{anchorNode:l,focusNode:c}=i;if(l!==null&&c!==null&&!TS(e,l,c))return!1;n=pT(s)}t.preventDefault();let o=t.clipboardData;return o!==null&&(hT(o,n),!0)}var Ew=[["text/html",lh],["application/x-lexical-editor",ch]];function pT(e=K()){return function(t,n){let o={"text/plain":""};for(let[r,s]of Object.entries(t))if(s){let i=xT(s,n);i!==null&&(o[r]=i)}return o}(mT(),e)}function hT(e,t){for(let[n]of Ew)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}function mT(e=Ke()){let t=so(e,CT.name);return t?t.output:_T}var _T={"application/x-lexical-editor":[(e,t)=>e?ch(Ke(),e):t()],"text/html":[(e,t)=>e?lh(Ke(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function xT(e,t){let n=(o)=>e[o]?e[o](t,n.bind(null,o-1)):null;return n(e.length-1)}function Tw(e,t=K()){return xT(mT()[e]||[],t)}var CT=me({build:(e,t,n)=>t.$exportMimeType,config:Be({$exportMimeType:_T}),mergeConfig(e,t){let n=Pt(e,t);if(t.$exportMimeType){let o={...e.$exportMimeType};for(let[r,s]of Object.entries(t.$exportMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$exportMimeType=o}return n},name:"@lexical/clipboard/GetClipboardData"});var wt=uh,{$exportMimeTypeFromSelection:pK,$generateJSONFromSelectedNodes:hK,$generateNodesFromSerializedNodes:mK,$getClipboardDataFromSelection:ad,$getHtmlContent:_K,$getLexicalContent:xK,$handlePlainTextDrop:CK,$handleRichTextDrop:yT,$insertDataTransferForPlainText:yK,$insertDataTransferForRichText:dh,$insertGeneratedNodes:SK,$writeDragSourceToDataTransfer:ST,ClipboardDOMImportExtension:NK,ClipboardImportExtension:EK,DEFAULT_IMPORT_MIME_TYPE:TK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:bK,GetClipboardDataExtension:vK,caretFromPoint:ld,copyToClipboard:Dl,setLexicalClipboardDataTransfer:NT}=wt;var bw=ut({$import:(e,t)=>{let n=Xi(t.nodeName.toLowerCase());return Xr(t,n),Jn(n,t),yn(n,t),[n.splice(0,0,e.$importChildren(t))]},match:dt.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),vw=ut({$import:(e,t)=>{let n=wl();return Jn(n,t),Xr(t,n),yn(n,t),[n.splice(0,0,e.$importChildren(t))]},match:dt.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),Ow=ut({$import:(e,t)=>{let n=wl({shadowRoot:!0});return Jn(n,t),Xr(t,n),yn(n,t),[n.splice(0,0,e.$importChildren(t,{schema:QE}))]},match:dt.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),MT=[bw,vw,ut({$import:(e,t,n)=>{let o=t.firstChild;return o&&(Ce(r=o)&&r.nodeName==="SPAN"&&r.style.fontSize==="26pt")?e.$importChildren(t):n();var r},match:dt.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),ut({$import:(e,t,n)=>t.style.fontSize!=="26pt"?n():[Xi("h1").splice(0,0,e.$importChildren(t))],match:dt.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Aw(e,t){return e&&t!==null?Pt(e,t):t}var DT=me({build:(e,t)=>Mt(t),config:Be({escapeFormatTriggers:{capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}}}),conflictsWith:["@lexical/plain-text"],dependencies:[QN,UN,HN,io,tn(Yo,{rules:MT})],mergeConfig:function(e,t){let n=Pt(e,t);return t.escapeFormatTriggers&&(n.escapeFormatTriggers=function(o,r){let s=Pt(o,r);for(let i of Object.keys(r))s[i]=Aw(o[i],r[i]);return s}(e.escapeFormatTriggers,t.escapeFormatTriggers)),n},name:"@lexical/rich-text",nodes:()=>[kl,$l],register:(e,t,n)=>yt(()=>$T(e,n.getOutput().escapeFormatTriggers))}),Rw=me({dependencies:[DT],name:"@lexical/rich-text/Import"}),fh=Sn("DRAG_DROP_PASTE_FILE"),fd=Go("shadowRoot",{parse:Boolean});class $l extends lt{$config(){return this.config("quote",{extends:lt,importDOM:{blockquote:()=>({conversion:Dw,priority:0})},stateConfigs:[{flat:!0,stateConfig:fd}]})}isShadowRoot(){return Lo(this,fd)}setIsShadowRoot(e){return Qn(this,fd,e)}createDOM(e){let t=je().createElement("blockquote");return Qe(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(je().createElement("br"));let n=this.getFormatType();n&&(t.style.textAlign=n);let o=this.getDirection();o&&(t.dir=o)}return{element:t}}exportJSON(){return super.exportJSON()}static importJSON(e){return wl().updateFromJSON(e)}insertNewAfter(e,t){let n=ye(),o=this.getDirection();return n.setDirection(o),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let t of this.getChildren())this.insertBefore(t);return this.remove(),!0}let e=ye();return this.getChildren().forEach((t)=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function wl(e){let t=sn(new $l);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function Mw(e){return e instanceof $l}class kl extends lt{__tag;$config(){return this.config("heading",{extends:lt,importDOM:{h1:()=>({conversion:Yi,priority:0}),h2:()=>({conversion:Yi,priority:0}),h3:()=>({conversion:Yi,priority:0}),h4:()=>({conversion:Yi,priority:0}),h5:()=>({conversion:Yi,priority:0}),h6:()=>({conversion:Yi,priority:0}),p:(e)=>{let t=e.firstChild;return t!==null&&ET(t)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>ET(e)?{conversion:()=>({node:Xi("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=je().createElement(t),o=e.theme.heading;if(o!==void 0){let r=o[t];Qe(n,r)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(je().createElement("br"));let n=this.getFormatType();n&&(t.style.textAlign=n);let o=this.getDirection();o&&(t.dir=o)}return{element:t}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,o=this.getLastDescendant(),r=!o||e&&e.anchor.key===o.getKey()&&n===o.getTextContentSize()||!e?ye():Xi(this.getTag()),s=this.getDirection();if(r.setDirection(s),this.insertAfter(r,t),n===0&&!this.isEmpty()&&e){let i=ye();i.select(),this.replace(i,!0)}return r}collapseAtStart(){if(this.isEmpty()){let e=ye();this.getChildren().forEach((t)=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}}function ET(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Yi(e){let t=e.nodeName.toLowerCase(),n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Xi(t),Xr(e,n),Jn(n,e),yn(n,e)),{node:n}}function Dw(e){let t=wl();return Jn(t,e),Xr(e,t),yn(t,e),{node:t}}function Xi(e="h1"){return sn(new kl(e))}function $w(e){return e instanceof kl}function TT(e){let t=Tt(e);return Dt(t)}function Vi(e,t,n,o){let r=!1,s=null;if(e.isCollapsed()&&e.anchor.type==="text"){let l=e.anchor.getNode();if(ne(l)){s=l;let c=e.anchor.offset,u=c===l.getTextContentSize()&&l.getNextSibling()===null,d=c===0&&l.getPreviousSibling()===null;r=n==="end"&&u||n==="start"&&d||n==="both"&&(u||d)}}let i=!1;for(let[l,c]of Object.entries(o)){if(c==null||!c[t])continue;let u=l;if(c.onlyAtBoundary){if(!(r&&s&&ne(s)&&s.hasFormat(u)))continue;i=!0}e.hasFormat(u)&&e.toggleFormat(u)}i&&e.setStyle("")}var ww={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function cd(e,t){return function(n,o){if(!n.isCollapsed())return!1;let r=an(n.focus,o),s=pe(r.origin,qc);if(!s)return!1;let i=n.focus.getNode();if(!s.is(i)&&!ol(i,s))return!1;let l=Xn(r,it(s,o));if(l.getTextSlices().some((f)=>f&&f.getTextContentSize()>0))return!1;let c=Xn(l.anchor.getSiblingCaret(),l.focus),u=c.anchor.origin;for(let f of c){if(!Co(f)||!f.origin.is(u.getParent()))return!1;u=f.origin}let d=s;for(let f of bs(it(s,o))){if(!f.origin.is(d.getParent())){if(Py(f.origin)){let p=it(d,o);return Mn(Xn(p,p)),!0}break}if(!qc(f.origin))break;d=f.origin}return!1}(e,t)||function(n,o){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;let r=an(n.anchor,o).getNodeAtCaret();return!(!qc(r)||r.isInline()||(Mn(Os($t(Et(r,o)))),0))}(e,t)}function bT(e){return Dt(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ud(e){let t=jc();t.add(e),pt(t)}function vT(e,t){if(!e.isCollapsed())return!1;let n=e.focus,o=n.getNode(),r=t?"previous":"next",s=an(n,r);if(n.type==="element"&&W(o)&&At(o)){let C=s.getNodeAtCaret();return!(C===null||!bT(C))&&(ud(C.__key),!0)}let i=pe(W(o)?o:o.getParentOrThrow(),(C)=>W(C)&&!C.isInline()&&At(C.getParent()));if(i===null)return!1;let l=it(i,r).getNodeAtCaret();if(l===null||!bT(l))return!1;if(i.getTextContentSize()===0)return ud(l.__key),!0;let c=Ke().getRootElement();if(c===null)return!1;let u=wn(c.ownerDocument.defaultView);if(u===null||u.rangeCount===0)return!1;let{anchorNode:d,anchorOffset:f,focusNode:p,focusOffset:h}=u;u.modify("move",t?"backward":"forward","line");let{anchorNode:m,anchorOffset:_}=u;if(m===null)return OT(u,d,f,p,h),!1;let x=Tt(m);if(OT(u,d,f,p,h),x===null)return!1;if(m===d&&_===f)return ud(l.__key),!0;return!x.is(i)&&!ol(x,i)&&(ud(l.__key),!0)}function OT(e,t,n,o,r){t!==null&&o!==null&&e.setBaseAndExtent(t,n,o,r)}function AT(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),o=pe(W(n)?n:n.getParentOrThrow(),(x)=>W(x)&&!x.isInline());if(o===null)return!1;let r=Ke(),s=r.getRootElement();if(s===null)return!1;let i=s.ownerDocument.defaultView;if(i===null)return!1;let l=!1;for(let x of o.getChildren())if(W(x)&&x.isInline()){let C=r.getElementByKey(x.getKey());if(C!==null){let y=i.getComputedStyle(C).display;if(y==="inline-grid"||y==="inline-flex"){l=!0;break}}}if(!l)return!1;let c=it(o,t?"previous":"next").getNodeAtCaret();if(c===null||!W(c)){if(t){let x=o.getFirstDescendant();ne(x)?x.select(0,0):o.select(0,0)}else{let x=o.getLastDescendant();if(ne(x)){let C=x.getTextContentSize();x.select(C,C)}else{let C=o.getChildrenSize();o.select(C,C)}}return!0}let u=r.getElementByKey(c.getKey());if(u===null)return!1;let d=wn(i);if(d===null||d.rangeCount===0)return!1;let f=d.getRangeAt(0).cloneRange();f.collapse(!0);let p=f.getBoundingClientRect(),h=u.getBoundingClientRect(),m=h.top+h.height/2;if(p.height>0){let x=ld(p.left,m,s);if(x!==null&&u.contains(x.node)){let C=s.ownerDocument.createRange();return C.setStart(x.node,x.offset),C.collapse(!0),e.applyDOMRange(C),e.dirty=!0,!0}}let _=t?c.getLastDescendant():c.getFirstDescendant();if(ne(_)){let x=t?_.getTextContentSize():0;_.select(x,x)}else{let x=c.getChildrenSize();c.select(t?x:0,t?x:0)}return!0}function dd(e,t){let n=it(e,t),o=n.getAdjacentCaret();o!==null&&W(o.origin)&&!o.origin.isInline()&&o.origin.isShadowRoot()?Mn(Os(n)):t==="next"?e.selectNext(0,0):e.selectPrevious()}function RT(e,t,n){n.preventDefault(),n.stopPropagation();let o=e.getNodes();if(o.length===0)return!0;let r=o.map((c)=>it(c,"next")).sort(kr),s=(t?r[0]:r[r.length-1]).origin,i=pe(s,(c)=>c!==s&&W(c)&&!c.isInline())??Xe(),l=t?0:i.getChildrenSize();return i.select(l,l),!0}function $T(e,t=Ks(ww)){return Oe(e.registerCommand(yi,()=>{let n=K();return Je(n)?(n.clear(),!0):(I(n)&&Vi(n,"click","both",t.peek()),!1)},Ee),e.registerCommand(Ei,(n)=>{let o=K();return I(o)?(o.deleteCharacter(n),!0):!!Je(o)&&(o.deleteNodes(),!0)},Ee),e.registerCommand(iu,(n)=>{let o=K();return!!I(o)&&(o.deleteWord(n),!0)},Ee),e.registerCommand(su,(n)=>{let o=K();return!!I(o)&&(o.deleteLine(n),!0)},Ee),e.registerCommand(nu,(n)=>{let o=K();if(typeof n=="string")o!==null&&o.insertText(n);else{if(o===null)return!1;let r=n.dataTransfer;if(r!=null)dh(r,o,e);else if(I(o)){let s=n.data;return s&&o.insertText(s),!0}}return!0},Ee),e.registerCommand(iS,()=>{let n=K();return!!I(n)&&(n.removeText(),!0)},Ee),e.registerCommand(Uo,(n)=>{let o=K();return!(!I(o)&&!Je(o))&&(Ry(o,n),!0)},Ee),e.registerCommand(aS,(n)=>{let o=K();return!(!I(o)&&!Je(o))&&(Uy(o,n),!0)},Ee),e.registerCommand(lu,(n)=>{let o=K();if(!I(o)&&!Je(o))return!1;let r=o.getNodes();for(let s of r){let i=pe(s,(l)=>W(l)&&!l.isInline());i!==null&&i.setFormat(n)}return!0},Ee),e.registerCommand(Gg,(n)=>{let o=K();return!!I(o)&&(o.insertLineBreak(n),!0)},Ee),e.registerCommand(Hr,()=>{let n=K();return!!I(n)&&(n.insertParagraph(),!0)},Ee),e.registerCommand(Ds,()=>{let n=cn(),o=K();return I(o)&&(n.setFormat(o.format),n.setStyle(o.style)),Xc([n]),!0},Ee),e.registerCommand(eo,()=>El((n)=>{let o=n.getIndent();n.setIndent(o+1)}),Ee),e.registerCommand(Wo,()=>El((n)=>{let o=n.getIndent();o>0&&n.setIndent(Math.max(0,o-1))}),Ee),e.registerCommand(to,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],"previous"),!0}else if(I(o)){if(function(r){let s=r.focus;return s.key==="root"&&s.offset===0}(o))return n.preventDefault(),!0;if(!n.shiftKey&&cd(o,"previous"))return n.preventDefault(),!0;if(!n.shiftKey&&vT(o,!0))return n.preventDefault(),!0;if(!n.shiftKey&&AT(o,!0))return n.preventDefault(),!0}return!1},Ee),e.registerCommand(Ho,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],"next"),!0}else if(I(o)){if(function(r){let s=r.focus;return s.key==="root"&&s.offset===Xe().getChildrenSize()}(o))return n.preventDefault(),!0;if(!n.shiftKey&&cd(o,"next"))return n.preventDefault(),!0;if(!n.shiftKey&&vT(o,!1))return n.preventDefault(),!0;if(!n.shiftKey&&AT(o,!1))return n.preventDefault(),!0}return!1},Ee),e.registerCommand(Wr,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],yl(r[0])?"next":"previous"),!0}if(!I(o))return!1;if(!n.shiftKey&&cd(o,yl(o.anchor.getNode())?"next":"previous"))return n.preventDefault(),!0;if(n.shiftKey||Vi(o,"arrow","start",t.peek()),lp(o,!0)){let r=n.shiftKey;return n.preventDefault(),ap(o,r,!0),!0}return!1},Ee),e.registerCommand(bi,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],yl(r[0])?"previous":"next"),!0}if(!I(o))return!1;if(!n.shiftKey&&cd(o,yl(o.anchor.getNode())?"previous":"next"))return n.preventDefault(),!0;if(n.shiftKey||Vi(o,"arrow","end",t.peek()),lp(o,!1)){let r=n.shiftKey;return n.preventDefault(),ap(o,r,!1),!0}return!1},Ee),e.registerCommand(vi,(n)=>{let o=K();if(!Je(o)&&TT(n.target))return!1;if(I(o)){if(function(r){if(!r.isCollapsed())return!1;let{anchor:s}=r;if(s.offset!==0)return!1;let i=s.getNode();if(xo(i))return!1;let l=ku(i);return l.getIndent()>0&&(l.is(i)||i.is(l.getFirstDescendant()))}(o))return n.preventDefault(),e.dispatchCommand(Wo);if(gl&&cl)return!1}else if(!Je(o))return!1;return n.preventDefault(),e.dispatchCommand(Ei,!0)},Ee),e.registerCommand(hu,(n)=>{let o=K();return!(!Je(o)&&TT(n.target))&&(!(!I(o)&&!Je(o))&&(n.preventDefault(),e.dispatchCommand(Ei,!1)))},Ee),e.registerCommand(Oi,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();r.length===1&&Dt(r[0])&&!r[0].isInline()&&(o=r[0].selectNext())}if(!I(o))return!1;if(Vi(o,"enter","both",t.peek()),n!==null){if((gl||fu||du)&&cl)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(Gg,!1)}return e.dispatchCommand(Hr)},Ee),e.registerCommand(Ai,()=>{let n=K();return!!I(n)&&(e.blur(),!0)},Ee),e.registerCommand(Jy,(n)=>{let[,o]=Ps(n);if(o.length>0){let{clientX:r,clientY:s}=n,i=ld(r,s,e.getRootElement());if(i!==null){let{offset:l,node:c}=i,u=Tt(c);if(u!==null){let d=Lr();if(ne(u))d.anchor.set(u.getKey(),l,"text"),d.focus.set(u.getKey(),l,"text");else{let p=u.getParentOrThrow().getKey(),h=u.getIndexWithinParent()+1;d.anchor.set(p,h,"element"),d.focus.set(p,h,"element")}let f=Po(d);pt(f)}e.dispatchCommand(fh,o)}return n.preventDefault(),!0}return yT(n,e)},Ee),e.registerCommand(qy,(n)=>{let[o]=Ps(n),r=K();return!(o&&!I(r))&&(I(r)&&!r.isCollapsed()&&n.dataTransfer!==null&&(NT(n.dataTransfer,ad(r)),ST(n.dataTransfer,e)),!0)},Ee),e.registerCommand(Xy,(n)=>{let[o]=Ps(n),r=K();if(o&&!I(r))return!1;let{clientX:s,clientY:i}=n,l=ld(s,i,e.getRootElement());if(l!==null){let c=Tt(l.node);Dt(c)&&n.preventDefault()}return!0},Ee),e.registerCommand(Di,()=>{let n=K();return zr(I(n)&&qn(n.anchor.getNode())!==null?n:null),!0},Ee),e.registerCommand(Ni,(n)=>(Dl(e,kn(n,ClipboardEvent)?n:null),!0),Ee),e.registerCommand(ou,(n)=>(async function(o,r){await Dl(r,kn(o,ClipboardEvent)?o:null),r.update(()=>{let s=K();I(s)?s.removeText():Je(s)&&s.getNodes().forEach((i)=>i.remove())},{tag:ru})}(n,e),!0),Ee),e.registerCommand(Mi,(n)=>{let[,o,r]=Ps(n);if(o.length>0&&!r)return e.dispatchCommand(fh,o),!0;if(oo(n.target)&&Fy(n.target))return!1;return K()!==null&&(function(s,i){s.preventDefault(),i.update(()=>{let l=K(),c=kn(s,InputEvent)||kn(s,KeyboardEvent)?null:s.clipboardData;c!=null&&l!==null&&dh(c,l,i)},{tag:_u})}(n,e),!0)},Ee),e.registerCommand(mu,()=>{let n=K();return I(n)&&Vi(n,"space","both",t.peek()),!1},Ee),e.registerCommand(Gr,()=>{let n=K();return I(n)&&Vi(n,"tab","both",t.peek()),!1},Ee),e.registerCommand(_l,(n)=>{let o=K();if(Je(o))return RT(o,!1,n);if(!I(o))return!1;let{anchor:r}=o;if(r.type!=="element"||r.offset!==0)return!1;let s=r.getNode();if(!W(s))return!1;let i=s.getFirstChild();if(!Dt(i)||!i.isInline())return!1;let l=s.getKey(),c=s.selectEnd();return n.shiftKey&&c.anchor.set(l,0,"element"),n.preventDefault(),n.stopPropagation(),!0},Ee),e.registerCommand(Ri,(n)=>{let o=K();if(Je(o))return RT(o,!0,n);if(!I(o))return!1;let{anchor:r,focus:s}=o,i=pe(s.getNode(),(u)=>W(u)&&!u.isInline());if(i===null)return!1;let l=i.getFirstChild();if(!Dt(l)||!l.isInline())return!1;if(pe(r.getNode(),(u)=>W(u)&&!u.isInline())!==i)return!1;let c=i.getKey();return(s.type!=="element"||s.key!==c||s.offset!==0)&&(o.focus.set(c,0,"element"),n.shiftKey||o.anchor.set(c,0,"element"),n.preventDefault(),n.stopPropagation(),!0)},Ee))}var Nn=gh,{$createHeadingNode:gd,$createQuoteNode:pd,$isHeadingNode:Il,$isQuoteNode:hd,DRAG_DROP_PASTE:LK,HeadingNode:md,QuoteNode:_d,RichTextExtension:FK,RichTextImportExtension:PK,RichTextImportRules:BK,ShadowRootQuoteRule:KK,eventFiles:zK,quoteShadowRootState:UK,registerRichText:wT}=Nn;Z();function kw(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ph=un?nt:S;function Iw({editor:e,ErrorBoundary:t}){return function(n,o){let[r,s]=w(()=>n.getDecorators());return ph(()=>n.registerDecoratorListener((i)=>{Rn(()=>{s(i)})}),[n]),S(()=>{s(n.getDecorators())},[n]),G(()=>{let i=[],l=Object.keys(r);for(let c=0;c<l.length;c++){let u=l[c],d=a(o,{onError:(p)=>n._onError(p),children:a(oa,{fallback:null,children:r[u]})}),f=n.getElementByKey(u);f!==null&&i.push(Js(d,f,u))}return i},[o,r,n])}(e,t)}function Lw({editor:e,ErrorBoundary:t}){return function(n){let o=zN.maybeFromEditor(n);if(o&&o.hasExtensionByName(YN.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&kw(320,r);return!0}return!1}(e)?null:a(Iw,{editor:e,ErrorBoundary:t})}function kT(e){return e.read("latest",Vu(e.isComposing()))}function Fw({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=st();return function(r){ph(()=>Oe(wT(r),eE(r)),[r])}(o),g(Y,{children:[e,a(Pw,{content:t}),a(Lw,{editor:o,ErrorBoundary:n})]})}function Pw({content:e}){let[t]=st(),n=function(r){let[s,i]=w(()=>kT(r));return ph(()=>{function l(){let c=kT(r);i(c)}return l(),Oe(r.registerUpdateListener(()=>{l()}),r.registerEditableListener(()=>{l()}))},[r]),s}(t),o=OS();return n?typeof e=="function"?e(o):e:null}var Bw=hh,IT=Bw.RichTextPlugin;Z();var FT=un?nt:S;function Kw({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:s,ariaExpanded:i,ariaInvalid:l,ariaLabel:c,ariaLabelledBy:u,ariaMultiline:d,ariaOwns:f,ariaRequired:p,autoCapitalize:h,className:m,id:_,role:x="textbox",spellCheck:C=!0,style:y,tabIndex:N,"data-testid":E,...v},b){let[A,O]=w(e.isEditable()),D=Q((k)=>{k&&k.ownerDocument&&k.ownerDocument.defaultView?e.setRootElement(k):e.setRootElement(null)},[e]),H=G(()=>function(...k){return(q)=>{for(let j of k)typeof j=="function"?j(q):j!=null&&(j.current=q)}}(b,D),[D,b]);return FT(()=>(O(e.isEditable()),e.registerEditableListener((k)=>{O(k)})),[e]),a("div",{"aria-activedescendant":A?t:void 0,"aria-autocomplete":A?n:"none","aria-controls":A?o:void 0,"aria-describedby":r,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":A&&x==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":c,"aria-labelledby":u,"aria-multiline":d,"aria-owns":A?f:void 0,"aria-readonly":!A||void 0,"aria-required":p,autoCapitalize:h,className:m,contentEditable:A,"data-testid":E,id:_,ref:H,role:x,spellCheck:C,style:y,tabIndex:N??(A?void 0:-1),...v})}var PT=J(Kw);function LT(e){return e.read("latest",Vu(e.isComposing()))}var zw=J(Uw);function Uw(e,t){let{placeholder:n,...o}=e,[r]=st();return g(Y,{children:[a(PT,{editor:r,...o,ref:t}),n!=null&&a(Hw,{editor:r,content:n})]})}function Hw({content:e,editor:t}){let n=function(i){let[l,c]=w(()=>LT(i));return FT(()=>{function u(){let d=LT(i);c(d)}return u(),Oe(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),l}(t),[o,r]=w(t.isEditable());if(nt(()=>(r(t.isEditable()),t.registerEditableListener((i)=>{r(i)})),[t]),!n)return null;let s=null;return typeof e=="function"?s=e(o):e!==null&&(s=e),s===null?null:a("div",{"aria-hidden":!0,children:s})}var BT=mh,{ContentEditable:KT,ContentEditableElement:az}=BT;function Ww(e,t,n,o,r){if(e===null||n.size===0&&o.size===0&&!r)return 0;let s=t._selection,i=e._selection;if(r)return 1;if(!(I(s)&&I(i)&&i.isCollapsed()&&s.isCollapsed()))return 0;let l=function(C,y,N){let E=C._nodeMap,v=[];for(let b of y){let A=E.get(b);A!==void 0&&v.push(A)}for(let[b,A]of N){if(!A)continue;let O=E.get(b);O===void 0||xo(O)||v.push(O)}return v}(t,n,o);if(l.length===0)return 0;if(l.length>1){let C=t._nodeMap,y=C.get(s.anchor.key),N=C.get(i.anchor.key);return y&&N&&!e._nodeMap.has(y.__key)&&ne(y)&&y.__text.length===1&&s.anchor.offset===1?2:0}let c=l[0],u=e._nodeMap.get(c.__key);if(!ne(u)||!ne(c)||u.__mode!==c.__mode)return 0;let d=u.__text,f=c.__text;if(d===f)return 0;let p=s.anchor,h=i.anchor;if(p.key!==h.key||p.type!=="text")return 0;let m=p.offset,_=h.offset,x=f.length-d.length;return x===1&&_===m-1?2:x===-1&&_===m+1?3:x===-1&&_===m?4:0}function Gw(e,t,n){let o=n(),r=0,s=o,i=0,l=null;return(c,u,d,f,p,h)=>{let m=n();if(h.has(tu)&&(s=o,i=r,l=c),h.has(Ti))return r=0,o=m,2;h.has(eu)&&l&&(o=s,r=i,c=l);let _=h.has(_u)||h.has(ru)?0:Ww(c,u,f,p,e.isComposing()),x=(()=>{let C=d===null||d.editor===e,y=h.has(uu);if(!y&&C&&h.has(Ur))return 0;if(_===1)return 2;if(c===null)return 1;let N=u._selection;if(!(f.size>0||p.size>0))return N!==null?0:2;let E=typeof t=="number"?t:t.peek();if(y===!1&&_!==0&&_===r&&m<o+E&&C)return 0;if(f.size===1){if(function(v,b,A){let O=b._nodeMap.get(v),D=A._nodeMap.get(v),H=b._selection,k=A._selection;return!(I(H)&&I(k)&&H.anchor.type==="element"&&H.focus.type==="element"&&k.anchor.type==="text"&&k.focus.type==="text"||!ne(O)||!ne(D)||O.__parent!==D.__parent)&&JSON.stringify(b.read(()=>O.exportJSON()))===JSON.stringify(A.read(()=>D.exportJSON()))}(Array.from(f)[0],c,u))return 0}return 1})();return o=m,r=_,x}}function zT(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function UT(e,t,n,o=Date.now,r,s=null){let i=Gw(e,n,o),l=()=>{r&&r(t)};return l(),Oe(e.registerCommand(Eu,()=>(function(c,u,d){let{redoStack:f,undoStack:p}=u;if(p.length!==0){let h=u.current,m=p.pop();h!==null&&(f.push(h),c.dispatchCommand(Rs,!0)),p.length===0&&c.dispatchCommand(Ms,!1),u.current=m||null,d&&d(u),m&&m.editor.setEditorState(m.editorState,{tag:Ti})}}(e,t,r),!0),Ee),e.registerCommand(xu,()=>(function(c,u,d){let{redoStack:f,undoStack:p}=u;if(f.length!==0){let h=u.current;h!==null&&(p.push(h),c.dispatchCommand(Ms,!0));let m=f.pop();f.length===0&&c.dispatchCommand(Rs,!1),u.current=m||null,d&&d(u),m&&m.editor.setEditorState(m.editorState,{tag:Ti})}}(e,t,r),!0),Ee),e.registerCommand(Zc,()=>(zT(t,r),!1),Ee),e.registerCommand(Gy,()=>(zT(t,r),e.dispatchCommand(Rs,!1),e.dispatchCommand(Ms,!1),!0),Ee),e.registerUpdateListener(({editorState:c,prevEditorState:u,dirtyLeaves:d,dirtyElements:f,tags:p})=>{let{current:h,redoStack:m,undoStack:_}=t,x=h===null?null:h.editorState;if(h!==null&&c===x)return;let C=i(u,c,h,d,f,p);if(C===1){if(m.length!==0&&(t.redoStack=[],e.dispatchCommand(Rs,!1)),h!==null){_.push({...h});let y=typeof s=="number"||s===null?s:s.peek();y!==null&&_.length>y&&_.splice(0,_.length-y),e.dispatchCommand(Ms,!0)}}else if(C===2)return;t.current={editor:e,editorState:c},l()}))}function HT(){return{current:null,redoStack:[],undoStack:[]}}var xd=me({build:(e,{delay:t,createInitialHistoryState:n,disabled:o,maxDepth:r,now:s},i)=>({...Mt({delay:t,disabled:o,historyState:n(e),maxDepth:r,now:s}),...i.getInitResult()}),config:Be({createInitialHistoryState:HT,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:()=>({canRedo:Ks(!1),canUndo:Ks(!1)}),name:"@lexical/history/History",register:(e,t,n)=>{let{canUndo:o,canRedo:r}=n.getInitResult(),s=n.getOutput(),i=(l)=>kp(()=>{o.value=l!=null&&l.undoStack.length>0,r.value=l!=null&&l.redoStack.length>0});return yt(()=>{if(!s.disabled.value)return UT(e,s.historyState.value,s.delay,()=>s.now.peek()(),i,s.maxDepth);i(null)})}}),jw=me({build:(e,{disabled:t,parentEditor:n})=>Mt({disabled:t,parentEditor:n||e._parentEditor}),config:Be({disabled:!1,parentEditor:null}),dependencies:[tn(xd,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,t,n)=>yt(()=>{let{disabled:o,parentEditor:r}=n.getOutput();if(!o.value){let{output:s}=n.getDependency(xd),i=function(c){return c?so(c,xd.name):null}(r.value);if(!i)return;let l=i.output;kp(()=>{s.delay.value=l.delay.value,s.historyState.value=l.historyState.value,s.now.value=l.now.value,s.disabled.value=l.disabled.value})}})});var Cd=_h,{HistoryExtension:dz,SharedHistoryExtension:fz,createEmptyHistoryState:yd,registerHistory:WT}=Cd;Z();function Yw({delay:e,externalHistoryState:t}){let[n]=st();return function(o,r,s=1000){let i=G(()=>r||yd(),[r]);S(()=>WT(o,i,s),[s,o,i])}(n,t,e),null}var GT=xh,{HistoryPlugin:jT,createEmptyHistoryState:xz}=GT;function es(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sd(e){let t=1,n=e.getParent();for(;n!=null;){if(De(n)){let o=n.getParent();if(Ae(o)){t++,n=o.getParent();continue}es(40)}return t}return t}function Ch(e){let t=e.getParent();Ae(t)||es(40);let n=t,o=t;for(;o!==null;)o=o.getParent(),Ae(o)&&(n=o);return n}function t0(e){let t=[],n=e.getChildren().filter(De);for(let o=0;o<n.length;o++){let r=n[o],s=r.getFirstChild();Ae(s)?t=t.concat(t0(s)):t.push(r)}return t}function ao(e){return De(e)&&Ae(e.getFirstChild())}function n0(e,t){return De(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Nd(e){let t=K();if(t!==null){let n=t.getNodes();if(I(t)){let[r]=t.getStartEndPoints(),s=r.getNode(),i=s.getParent();if(At(s)){let l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{let c=ye();s.append(c),n=c.select().getNodes()}}else if(n0(s,n)){let l=No(e);if(At(i)){s.replace(l);let c=Eo();W(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(De(s)){let c=s.getParentOrThrow();Gs(l,c.getChildren()),c.replace(l)}return}}let o=new Set;for(let r=0;r<n.length;r++){let s=n[r];if(W(s)&&s.isEmpty()&&!De(s)&&!o.has(s.getKey())){YT(s,e);continue}let i=sl(s)?s.getParent():De(s)&&s.isEmpty()?s:null;for(;i!=null;){let l=i.getKey();if(Ae(i)){if(!o.has(l)){let c=No(e);Gs(c,i.getChildren()),i.replace(c),o.add(l)}break}{let c=i.getParent();if(At(c)&&!o.has(l)){o.add(l),YT(i,e);break}i=c}}}}}function Gs(e,t){e.splice(e.getChildrenSize(),0,t)}function YT(e,t){if(Ae(e))return e;let n=e.getPreviousSibling(),o=e.getNextSibling(),r=Eo(),s;if(Gs(r,e.getChildren()),Ae(n)&&t===n.getListType())n.append(r),Ae(o)&&t===o.getListType()&&(Gs(n,o.getChildren()),o.remove()),s=n;else if(Ae(o)&&t===o.getListType())o.getFirstChildOrThrow().insertBefore(r),s=o;else{let l=No(t);l.append(r),e.replace(l),s=l}r.setFormat(e.getFormatType()),r.setIndent(e.getIndent());let i=K();return I(i)&&(s.getKey()===i.anchor.key&&i.anchor.set(r.getKey(),i.anchor.offset,"element"),s.getKey()===i.focus.key&&i.focus.set(r.getKey(),i.focus.offset,"element")),e.remove(),s}function Sh(e,t){let n=e.getLastChild(),o=t.getFirstChild();n&&o&&ao(n)&&ao(o)&&(Sh(n.getFirstChild(),o.getFirstChild()),o.remove());let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function o0(){let e=K();if(I(e)){let t=new Set,n=e.getNodes(),o=e.anchor.getNode();if(n0(o,n))t.add(Ch(o));else for(let r=0;r<n.length;r++){let s=n[r];if(sl(s)){let i=Iu(s,js);i!=null&&t.add(Ch(i))}}for(let r of t){let s=r,i=t0(r);for(let l of i){let c=ye().setTextStyle(e.style).setTextFormat(e.format);Gs(c,l.getChildren()),s.insertAfter(c),s=c,l.__key===e.anchor.key&&zo(e.anchor,$t(Et(c,"next"))),l.__key===e.focus.key&&zo(e.focus,$t(Et(c,"next"))),l.remove()}r.remove()}}}function r0(e){let t=e.getListType()!=="check",n=e.getStart();for(let o of e.getChildren())De(o)&&(o.getValue()!==n&&o.setValue(n),t&&o.getLatest().__checked!=null&&o.setChecked(void 0),Ae(o.getFirstChild())||n++)}function Vw(e){let t=new Set;if(ao(e)||t.has(e.getKey()))return;let n=e.getParent(),o=e.getNextSibling(),r=e.getPreviousSibling();if(ao(o)&&ao(r)){let s=r.getFirstChild();if(Ae(s)){s.append(e);let i=o.getFirstChild();if(Ae(i))Gs(s,i.getChildren()),o.remove(),t.add(o.getKey())}}else if(ao(o)){let s=o.getFirstChild();if(Ae(s)){let i=s.getFirstChild();i!==null&&i.insertBefore(e)}}else if(ao(r)){let s=r.getFirstChild();Ae(s)&&s.append(e)}else if(Ae(n)){let s=Ht(e),i=Ht(n);s.append(i),i.append(e),r?r.insertAfter(s):o?o.insertBefore(s):n.append(s)}}function VT(e){if(ao(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(Ae(n?n.getParent():void 0)&&De(n)&&Ae(t)){let o=t?t.getFirstChild():void 0,r=t?t.getLastChild():void 0;if(e.is(o))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(r))n.insertAfter(e),t.isEmpty()&&n.remove();else{let s=Ht(e),i=Ht(t);s.append(i),e.getPreviousSiblings().forEach((u)=>i.append(u));let l=Ht(e),c=Ht(t);l.append(c),Gs(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function s0(e=!1){let t=K();if(!I(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),o=null;if(De(n)&&n.getChildrenSize()===0)o=n;else if(ne(n)){let u=n.getParent();De(u)&&u.getChildren().every((d)=>ne(d)&&d.getTextContent().trim()==="")&&(o=u)}if(o===null)return!1;let r=Ch(o),s=o.getParent();Ae(s)||es(40);let i=s.getParent(),l;if(At(i))l=ye(),r.insertAfter(l);else{if(!De(i))return!1;l=Ht(i),i.insertAfter(l)}l.setTextStyle(t.style).setTextFormat(t.format).select();let c=o.getNextSiblings();if(c.length>0){let u=e?function(f,p){return f.getStart()+p.getIndexWithinParent()}(s,o):1,d=Ht(s).setStart(u);if(De(l)){let f=Ht(l);f.append(d),l.insertAfter(f)}else l.insertAfter(d);d.append(...c)}return function(u){let d=u;for(;d.getNextSibling()==null&&d.getPreviousSibling()==null;){let f=d.getParent();if(f==null||!De(f)&&!Ae(f))break;d=f}d.remove()}(o),!0}class js extends lt{__value;__checked;$config(){return this.config("listitem",{$transform:(e)=>{let t=e.getParent();if(Ae(t))t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();Ae(n)||es(340);let o=[e];for(let r of["previous","next"]){o.reverse();for(let{origin:s}of it(e,r)){if(!De(s))break;o.push(s)}}e.insertBefore(n),n.splice(0,0,o),At(t)||(Pr(n,Ko(it(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:lt,importDOM:jg({li:()=>({conversion:Xw,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=je().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(s,i){let l=i.getParent();!Ae(l)||l.getListType()!=="check"||Ae(i.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),s.setAttribute("aria-checked",i.getChecked()?"true":"false"))})(t,this),t.value=this.__value,function(s,i,l){let c=i.list;if(!c)return;let u=c.listitem,d=c.nested&&c.nested.listitem,f=l.getParent(),p=Ae(f)&&f.getListType()==="check",h=l.getChecked(),m=l.getChildren().some((C)=>Ae(C)),_=[];c.listitemChecked!==void 0&&_.push(c.listitemChecked),c.listitemUnchecked!==void 0&&_.push(c.listitemUnchecked),d!==void 0&&_.push(...Ii(d)),_.length>0&&nn(s,..._);let x=[];if(u!==void 0&&x.push(...Ii(u)),p){let C=h?c.listitemChecked:c.listitemUnchecked;C!==void 0&&x.push(C)}d!==void 0&&m&&x.push(...Ii(d)),x.length>0&&Qe(s,...x)}(t,n.theme,this);let o=e?e.__style:"",r=this.__style;o!==r&&cr(t.style,r,o),function(s,i,l){let c=i.__textStyle,u=l?l.__textStyle:"";if(l!==null&&u===c)return;let d=jr(c);for(let f in d)s.style.setProperty(`--listitem-marker-${f}`,d[f]);if(u!=="")for(let f in jr(u))f in d||s.style.removeProperty(`--listitem-marker-${f}`)}(t,this,e)}updateDOM(e,t,n){let o=t;return this.updateListItemDOM(e,o,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let o=this.getDirection();return o&&(t.dir=o),ao(this)?{after(r){if(Ce(r)){let s=r.previousElementSibling;if(Ce(s)&&s.nodeName==="LI"){for(;r.firstChild;)s.append(r.firstChild);r.remove()}}return r},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(W(n)&&this.canMergeWith(n)){let o=n.getChildren();this.append(...o),n.remove()}else super.append(n)}return this}replace(e,t){if(De(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!Ae(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let s=Ht(n),i=this.getNextSibling();for(;i;){let l=i;i=i.getNextSibling(),s.append(l)}n.insertAfter(e),e.insertAfter(s)}let o=this.__key,r=0;if(t&&(W(e)||es(139),r=e.getChildrenSize(),e.splice(r,0,this.getChildren())),t&&W(e)){let s=K();if(I(s))for(let i of s.getStartEndPoints())i.key===o&&i.type==="element"&&i.set(e.getKey(),r+i.offset,"element")}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(Ae(n)||es(39),De(e))return super.insertAfter(e,t);let o=this.getNextSiblings();if(n.insertAfter(e,t),o.length!==0){let r=Ht(n);o.forEach((s)=>r.append(s)),e.insertAfter(r,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&ao(t)&&ao(n)&&(Sh(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=Ht(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(ao(this))return!1;let t=this.getParentOrThrow();if(De(t.getParentOrThrow()))return VT(this),!0;let n=ye().append(...this.getChildren()),o=this.getNextSiblings();if(o.length>0){let r=Ht(t);r.append(...o),t.insertAfter(r)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return Ae(n)&&(t=n.getListType()),t==="check"?Boolean(e.__checked):void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;De(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&es(117),(e=Math.floor(e))>=0||es(199);let t=this.getIndent();for(;t!==e;)t<e?(Vw(this),t++):(VT(this),t--);return this}canInsertAfter(e){return De(e)}canReplaceWith(e){return De(e)}canMergeWith(e){return De(e)||An(e)}extractWithChild(e,t){if(!I(t))return!1;let n=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(o)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return No("bullet")}canMergeWhenEmpty(){return!0}}function Xw(e){if(e.classList.contains("task-list-item")){for(let o of e.children)if(o.tagName==="INPUT")return XT(o)}if(e.classList.contains("joplin-checkbox")){for(let o of e.children)if(o.classList.contains("checkbox-wrapper")&&o.children.length>0&&o.children[0].tagName==="INPUT")return XT(o.children[0])}let t=e.getAttribute("aria-checked"),n=Eo(t==="true"||t!=="false"&&void 0);return Jn(n,e),{after:i0.bind(null,n),node:yn(n,e)}}function XT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let t=Eo(e.hasAttribute("checked"));return{after:i0.bind(null,t),node:t}}function i0(e,t){let n=t[0];return t.length===1&&An(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function Eo(e){return sn(new js(void 0,e))}function De(e){return e instanceof js}class qi extends lt{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(t){let n=t.getNextSibling();Ae(n)&&t.getListType()===n.getListType()&&Sh(t,n)})(e),r0(e)},extends:lt,importDOM:jg({ol:()=>({conversion:JT,priority:0}),ul:()=>({conversion:JT,priority:0})})})}constructor(e="number",t=1,n){super(n);let o=qw[e]||e;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,o=je().createElement(n);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,qT(o,e.theme,this),o}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(qT(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return Ce(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let o=n;for(let r=0;r<n.length;r++){let s=n[r];De(s)||(o===n&&(o=[...n]),o[r]=this.createListItemNode().append(!W(s)||Ae(s)||s.isInline()?s:xt(s.getTextContent())))}return super.splice(e,t,o)}extractWithChild(e){return De(e)}createListItemNode(){return Eo()}}function qT(e,t,n){let o=[],r=[],s=t.list;if(s!==void 0){let i=s[`${n.__tag}Depth`]||[],l=Sd(n)-1,c=l%i.length,u=i[c],d=s[n.__tag],f,{nested:p,checklist:h}=s;if(p!==void 0&&p.list&&(f=p.list),d!==void 0&&o.push(d),h!==void 0&&n.__listType==="check"&&o.push(h),u!==void 0){o.push(...Ii(u));for(let m=0;m<i.length;m++)m!==c&&r.push(n.__tag+m)}if(f!==void 0){let m=Ii(f);l>1?o.push(...m):r.push(...m)}}r.length>0&&nn(e,...r),o.length>0&&Qe(e,...o)}function JT(e){let t;if(function(n){return Ce(n)&&n.nodeName.toLowerCase()==="ol"}(e)){let n=e.start;t=No("number",n)}else t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list")||n.getAttribute("data-is-checklist")==="1")return!0;for(let o of n.childNodes)if(Ce(o)&&o.hasAttribute("aria-checked"))return!0;return!1}(e)?No("check"):No("bullet");return yn(t,e),{after:(n)=>function(o,r){let s=r.createListItemNode.bind(r),i=[];for(let l=0;l<o.length;l++){let c=o[l];if(De(c)){i.push(c);let u=c.getChildren();u.length>1&&u.forEach((d)=>{Ae(d)&&i.push(s().append(d))})}else i.push(s().append(c))}return i}(n,t),node:t}}var qw={ol:"number",ul:"bullet"};function No(e="number",t=1){return sn(new qi(e,t))}function Ae(e){return e instanceof qi}var a0=Sn("INSERT_CHECK_LIST_COMMAND");function l0(e,t){let n=t&&t.disableTakeFocusOnClick||!1,o=typeof n=="boolean"?()=>n:n.peek.bind(n),r=(u)=>{let d=u.target;if(!Ce(d))return!1;let f=d.__lexicalCheckListLastHandled;return f!==void 0&&u.timeStamp-f<500},s=(u)=>{let d=u.target;Ce(d)&&(d.__lexicalCheckListLastHandled=u.timeStamp)},i=(u)=>{r(u)||(s(u),ZT(u,o()))},l=(u)=>{u.pointerType==="touch"&&(r(u)||(s(u),ZT(u,o())))},c=(u)=>{(function(d,f){c0(d,()=>{d.preventDefault(),f&&d.stopPropagation()})})(u,o())};return Oe(e.registerCommand(a0,()=>(Nd("check"),!0),we),e.registerCommand(Ho,(u)=>QT(u,e,!1),we),e.registerCommand(to,(u)=>QT(u,e,!0),we),e.registerCommand(Ai,()=>{if(yh(e)!=null){let u=e.getRootElement();return u!=null&&u.focus(),!0}return!1},we),e.registerCommand(mu,(u)=>{let d=yh(e);return!(d==null||!e.isEditable())&&(e.update(()=>{let f=Tt(d);De(f)&&(u.preventDefault(),f.toggleChecked())}),!0)},we),e.registerCommand(Wr,(u)=>e.read("latest",()=>{let d=K();if(I(d)&&d.isCollapsed()){let{anchor:f}=d,p=f.type==="element";if(p||f.offset===0){let h=f.getNode(),m=pe(h,(_)=>W(_)&&!_.isInline());if(De(m)){let _=m.getParent();if(Ae(_)&&_.getListType()==="check"&&(p||m.getFirstDescendant()===h)){let x=e.getElementByKey(m.__key);if(x!=null&&yo(x)!==x)return x.focus(),u.preventDefault(),!0}}}}return!1}),we),e.registerRootListener((u)=>{if(u!==null)return Oe(Vr(u,{click:i,pointerup:l}),Vr(u,{mousedown:c,pointerdown:c},{capture:!0}),ro(u,"touchstart",c,{capture:!0,passive:!1}))}))}function c0(e,t){let n=e.target;if(!Ce(n))return;let o=n.firstChild;if(Ce(o)&&(o.tagName==="UL"||o.tagName==="OL"))return;let r=n.parentNode;if(!r||r.__lexicalListType!=="check")return;let s=null,i=null;if("clientX"in e)s=e.clientX;else if("touches"in e){let h=e.touches;h.length>0&&(s=h[0].clientX,i="touch")}if(s==null)return;let l=n.getBoundingClientRect(),c=s/sN(n),u=n.ownerDocument.defaultView,d=u?u.getComputedStyle(n,"::before"):{width:"0px"},f=parseFloat(d.width),p=i==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(n.dir==="rtl"?c<l.right+p&&c>l.right-f-p:c>l.left-p&&c<l.left+f+p)&&t()}function ZT(e,t){c0(e,()=>{if(Ce(e.target)){let n=e.target,o=vu(n);o!=null&&o.isEditable()&&o.update(()=>{let r=Tt(n);De(r)&&(t?(el(Su),el(lS)):n.focus(),r.toggleChecked())})}})}function yh(e){let t=e.getRootElement(),n=t?yo(t):null;return Ce(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function QT(e,t,n){let o=yh(t);return o!=null&&t.update(()=>{let r=Tt(o);if(!De(r))return;let s=function(i,l){let c=l?i.getPreviousSibling():i.getNextSibling(),u=i;for(;c==null&&De(u);)u=u.getParentOrThrow().getParent(),u!=null&&(c=l?u.getPreviousSibling():u.getNextSibling());for(;De(c);){let d=l?c.getLastChild():c.getFirstChild();if(!Ae(d))return c;c=l?d.getLastChild():d.getFirstChild()}return null}(r,n);if(s!=null){s.selectStart();let i=t.getElementByKey(s.__key);i!=null&&(e.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}function Jw(e){let t=[];for(let n of e)if(De(n)){t.push(n);let o=n.getChildren();if(o.length>1)for(let r of o)Ae(r)&&t.push(Eo().append(r))}else t.push(Eo().append(n));return t}var Zw=ut({$import:(e,t)=>{let n;var o;return sh(t,"ol")?n=No("number",t.start):n=(o=t).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||o.querySelector(":scope > [aria-checked]")!==null?No("check"):No("bullet"),yn(n,t),[n.splice(0,0,od(Jw(e.$importChildren(t)),t))]},match:dt.tag("ol","ul"),name:"@lexical/list/list"});function u0(e,t){if(t.length!==1)return t;let n=t[0];return An(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function d0(e){let t=(i)=>ZE(i)&&!Ae(i);if(!e.some(t))return e;let n=[],o=[],r=()=>{o.length>0&&(n.push(o),o=[])};for(let i of e)t(i)?(r(),n.push(W(i)?i.getChildren():[i])):o.push(i);r();let s=[];for(let i of n)s.length>0&&s.push(ln()),s.push(...i);return s}var Qw=ut({$import:(e,t)=>{let n=t.getAttribute("aria-checked"),o=Eo(n==="true"||n!=="false"&&void 0);return Jn(o,t),yn(o,t),[o.splice(0,0,d0(u0(o,e.$importChildren(t))))]},match:dt.tag("li"),name:"@lexical/list/li"});function e0(e,t,n){let o=sh(n,"input")?n:n.querySelector('input[type="checkbox"]');if(!o||o.getAttribute("type")!=="checkbox")return[];let r=Eo(o.hasAttribute("checked"));return Jn(r,t),yn(r,t),[r.splice(0,0,d0(u0(r,e.$importChildren(t))))]}var ek={$accepts:(e)=>De(e)||Ae(e),$packageRun:(e)=>[Eo().splice(0,0,e)],name:"ListSchema"},f0=[ut({$import:(e,t,n)=>{let o=t.querySelector(':scope > input[type="checkbox"]');return o?e0(e,t,o):n()},match:dt.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),ut({$import:(e,t,n)=>{let o=t.querySelector(":scope > .checkbox-wrapper");if(!o)return n();let r=o.querySelector(':scope > input[type="checkbox"]');return r?e0(e,t,r):n()},match:dt.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Zw,Qw],g0=Sn("UPDATE_LIST_START_COMMAND"),p0=Sn("INSERT_UNORDERED_LIST_COMMAND"),h0=Sn("INSERT_ORDERED_LIST_COMMAND"),m0=Sn("REMOVE_LIST_COMMAND");function _0(e,t){return Oe(e.registerCommand(h0,()=>(Nd("number"),!0),we),e.registerCommand(g0,(n)=>{let{listNodeKey:o,newStart:r}=n,s=Ot(o);return!!Ae(s)&&(s.getListType()==="number"&&(s.setStart(r),r0(s)),!0)},we),e.registerCommand(p0,()=>(Nd("bullet"),!0),we),e.registerCommand(m0,()=>(o0(),!0),we),e.registerCommand(Hr,()=>s0(!!(t&&t.restoreNumbering)),we),e.registerCommand(vi,(n)=>{let o=K();if(!I(o)||!o.isCollapsed())return!1;let{anchor:r}=o;if(r.offset!==0)return!1;let s=r.getNode();for(;!De(s);){if(s.getPreviousSibling()!==null)return!1;let i=s.getParent();if(i===null)return!1;s=i}return!(!De(s)||!s.collapseAtStart(o))&&(n.preventDefault(),!0)},Qc),e.registerNodeTransform(js,(n)=>{let o=n.getFirstChild();if(o){if(ne(o)){let r=o.getStyle(),s=o.getFormat();n.getTextStyle()!==r&&n.setTextStyle(r),n.getTextFormat()!==s&&n.setTextFormat(s)}}else{let r=K();I(r)&&(r.style!==n.getTextStyle()||r.format!==n.getTextFormat())&&r.isCollapsed()&&n.is(r.anchor.getNode())&&n.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform($n,(n)=>{let o=n.getParent();if(De(o)&&n.is(o.getFirstChild())){let r=n.getStyle(),s=n.getFormat();r===o.getTextStyle()&&s===o.getTextFormat()||o.setTextStyle(r).setTextFormat(s)}}))}function x0(e){let t=(n)=>{let o=n.getParent();if(Ae(n.getFirstChild())||!Ae(o))return;let r=pe(n,(s)=>De(s)&&Ae(s.getParent())&&De(s.getPreviousSibling()));if(r===null&&n.getIndent()>0)n.setIndent(0);else if(De(r)){let s=r.getPreviousSibling();if(De(s)){let i=function(c){let u=c,d=u.getFirstChild();for(;Ae(d);){let f=d.getLastChild();if(!De(f))break;u=f,d=u.getFirstChild()}return u}(s),l=i.getParent();if(Ae(l)){let c=Sd(l);c+1<Sd(o)&&n.setIndent(c)}}}};return e.registerNodeTransform(qi,(n)=>{let o=[n];for(;o.length>0;){let r=o.shift();if(Ae(r)){for(let s of r.getChildren())if(De(s)){t(s);let i=s.getFirstChild();Ae(i)&&o.push(i)}}}})}var Nh=me({build:(e,t,n)=>Mt(t),config:Be({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[io,tn(Yo,{rules:f0})],name:"@lexical/list/List",nodes:()=>[qi,js],register(e,t,n){let o=n.getOutput();return Oe(yt(()=>_0(e,{restoreNumbering:o.shouldPreserveNumbering.value})),yt(()=>o.hasStrictIndent.value?x0(e):void 0))}}),tk=me({build:(e,t)=>Mt(t),config:Be({disableTakeFocusOnClick:!1}),dependencies:[Nh],name:"@lexical/list/CheckList",register:(e,t,n)=>l0(e,n.getOutput())}),nk=me({dependencies:[Nh],name:"@lexical/list/Import"});var St=Eh,{$createListItemNode:C0,$createListNode:y0,$getListDepth:Tz,$handleListInsertParagraph:bz,$insertList:vz,$isListItemNode:Th,$isListNode:To,$removeList:Oz,CheckListExtension:Az,INSERT_CHECK_LIST_COMMAND:S0,INSERT_ORDERED_LIST_COMMAND:N0,INSERT_UNORDERED_LIST_COMMAND:E0,ListExtension:Rz,ListImportExtension:Mz,ListImportRules:Dz,ListItemNode:ts,ListNode:Vo,ListSchema:$z,REMOVE_LIST_COMMAND:Ed,UPDATE_LIST_START_COMMAND:wz,registerCheckList:T0,registerList:bh,registerListStrictIndentTransform:b0}=St;Z();function ok({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){let[n]=st();return S(()=>{if(!n.hasNodes([Vo,ts]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),S(()=>Oe(bh(n,{restoreNumbering:t}),e?b0(n):()=>{}),[n,e,t]),function(o){S(()=>bh(o),[o])}(n),null}var rk=vh,v0=rk.ListPlugin;Z();function sk({disableTakeFocusOnClick:e=!1}){let[t]=st();return S(()=>T0(t,{disableTakeFocusOnClick:e}),[t,e]),null}var ik=Oh,O0=ik.CheckListPlugin;Z();function ak({maxIndent:e,$canIndent:t}){let[n]=st();return S(()=>Yu(n,e,t),[n,e,t]),null}var A0=Ah,{TabIndentationPlugin:R0,registerTabIndentation:Vz}=A0;var M0=new Set(["http:","https:","mailto:","sms:","tel:"]);class ns extends lt{__url;__target;__rel;__title;$config(){return this.config("link",{extends:lt,importDOM:{a:()=>({conversion:ck,priority:1})}})}constructor(e="",t={},n){super(n);let{target:o=null,rel:r=null,title:s=null}=t;this.__url=e,this.__target=o,this.__rel=r,this.__title=s}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let t=je().createElement("a");return this.updateLinkDOM(null,t,e),Qe(t,e.theme.link),t}updateLinkDOM(e,t,n){if(wi(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let o of["target","rel","title"]){let r=`__${o}`,s=this[r];e&&e[r]===s||(s?t[o]=s:t.removeAttribute(o))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let t=e;e=Rh(e);try{let n=new URL(Rh(e));if(!M0.has(n.protocol))return"about:blank"}catch(n){let o=t.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(o!=null&&!M0.has(`${o[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Ht(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!I(t))return!1;let o=t.anchor.getNode(),r=t.focus.getNode();return(this.is(o)||this.isParentOf(o))&&(this.is(r)||this.isParentOf(r))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}}function D0(e){let t=an(e,"next");return[t,t.getFlipped()]}function $0(e,t){for(let n of t)if(n.origin.isAttached()){let o=$t(n);return void zo(e,o)}}function lk(e){let t=K(),n=null,o=null;function r(){I(t)&&($0(t.anchor,n),$0(t.focus,o),Po(t))}I(t)&&(n=D0(t.anchor),o=D0(t.focus));let s=!1;for(let l of Et(e,"next")){let c=l.origin;if(W(c)&&!c.isInline()){let u=c.getChildren();if(u.length>0){let d=Ht(e);d.append(...u),c.append(d),s=!0}Pr(c,Ko(l),{$shouldSplit:()=>!1})}}function i(l,c,u){let[d,f]=l,p=(m)=>Co(m)&&m.origin.is(c);if(!p(d)&&!p(f))return l;let h=$t(Et(u,"next"));return[h,h.getFlipped()]}if(e.isAttached()){let l=e.getPreviousSibling();if(In(l)&&l.shouldMergeAdjacentLink(e))return n&&(n=i(n,l,e)),o&&(o=i(o,l,e)),l.append(...e.getChildren()),e.remove(),void r();let c=e.getNextSibling();In(c)&&e.shouldMergeAdjacentLink(c)&&(n&&(n=i(n,e,c)),o&&(o=i(o,e,c)),e.append(...c.getChildren()),c.remove(),s=!0)}if(s){if(!e.canBeEmpty()&&e.isEmpty()){let l=e.getParent();e.remove(),l&&l.isEmpty()&&l.remove()}r()}}function ck(e){let t=null;if(wi(e)){let n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Fl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Fl(e="",t){return sn(new ns(e,t))}function In(e){return e instanceof ns}class Pl extends ns{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:ns})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?je().createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=$h(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}}function $h(e="",t){return sn(new Pl(e,t))}function fn(e){return e instanceof Pl}var bd=Sn("TOGGLE_LINK_COMMAND");function w0(e,t){if(e.type==="element"){let n=e.getNode();return W(n)||function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let l of r)i.append("v",l);throw s.search=i.toString(),Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Td(e,t={}){let n;if(e&&typeof e=="object"){let{url:d,...f}=e;n=d,t={...f,...t}}else n=e;let{target:o,title:r}=t,s=t.rel===void 0?"noreferrer":t.rel,i=K();if(i===null||!I(i)&&!Je(i))return;if(Je(i)){let d=i.getNodes();if(d.length===0)return;return void d.forEach((f)=>{if(n===null){let p=pe(f,(h)=>!fn(h)&&In(h));p&&(p.insertBefore(f),p.getChildren().length===0&&p.remove())}else{let p=pe(f,(h)=>!fn(h)&&In(h));if(p)p.setURL(n),o!==void 0&&p.setTarget(o),s!==void 0&&p.setRel(s);else{let h=Fl(n,{rel:s,target:o});f.insertBefore(h),h.append(f)}}})}if(i.isCollapsed()&&n===null)for(let d of i.getNodes()){let f=pe(d,(p)=>!fn(p)&&In(p));return void(f!==null&&(f.getParentOrThrow().splice(f.getIndexWithinParent(),0,f.getChildren()),f.remove()))}let l=i.extract();if(n===null){let d=new Set;return void l.forEach((f)=>{let p=pe(f,(h)=>!fn(h)&&In(h));if(p!==null){let h=p.getKey();if(d.has(h))return;(function(m,_){let x=new Set(_.filter((O)=>m.isParentOf(O)).map((O)=>O.getKey())),C=m.getChildren(),y=(O)=>x.has(O.getKey())||W(O)&&_.some((D)=>m.isParentOf(D)&&O.isParentOf(D)),N=C.filter(y);if(N.length===C.length)return C.forEach((O)=>m.insertBefore(O)),void m.remove();let E=C.findIndex(y),v=C.findLastIndex(y),b=E===0,A=v===C.length-1;if(b)N.forEach((O)=>m.insertBefore(O));else if(A)for(let O=N.length-1;O>=0;O--)m.insertAfter(N[O]);else{for(let D=N.length-1;D>=0;D--)m.insertAfter(N[D]);let O=C.slice(v+1);if(O.length>0){let D=Ht(m);N[N.length-1].insertAfter(D),O.forEach((H)=>D.append(H))}}})(p,l),d.add(h)}})}let c=new Set,u=(d)=>{c.has(d.getKey())||(c.add(d.getKey()),d.setURL(n),o!==void 0&&d.setTarget(o),s!==void 0&&d.setRel(s),r!==void 0&&d.setTitle(r))};if(l.length===1){let d=l[0],f=pe(d,In);if(f!==null)return u(f)}(function(d){let f=K();if(!I(f))return d();let p=Po(f),h=p.isBackward(),m=w0(p.anchor,h?-1:0),_=w0(p.focus,h?0:-1),x=d();if(m||_){let C=K();if(I(C)){let y=C.clone();if(m){let N=m.getParent();N&&y.anchor.set(N.getKey(),m.getIndexWithinParent()+(h?1:0),"element")}if(_){let N=_.getParent();N&&y.focus.set(N.getKey(),_.getIndexWithinParent()+(h?0:1),"element")}pt(Po(y))}}})(()=>{let d=null;for(let f of l){if(!f.isAttached())continue;let p=pe(f,In);if(p){u(p);continue}if(W(f)){if(!f.isInline())continue;if(In(f)){if(!(fn(f)||d!==null&&d.getParentOrThrow().isParentOf(f))){u(f),d=f;continue}for(let m of f.getChildren())f.insertBefore(m);f.remove();continue}}let h=f.getPreviousSibling();In(h)&&h.is(d)?h.append(f):(d=Fl(n,{rel:s,target:o,title:r}),f.insertAfter(d),d.append(f))}})}var uk=/^\+?[0-9\s()-]{5,}$/;function Rh(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:uk.test(e)?`tel:${e}`:`https://${e}`}var I0=[ut({$import:(e,t)=>{if(!t.textContent&&t.children.length===0)return[];let n=t.getAttribute("href")||"",o={rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")};return VE(e.$importChildren(t),()=>Fl(n,o))},match:dt.tag("a"),name:"@lexical/link/a"})];function L0(e,t){return Oe(e.registerNodeTransform(ns,lk),e.registerCommand(bd,(n)=>{let o=t.validateUrl.peek(),r=t.attributes.peek();if(n===null)return Td(null),!0;if(typeof n=="string")return!(o!==void 0&&!o(n))&&(Td(n,r),!0);{let{url:s,target:i,rel:l,title:c}=n;return Td(s,{...r,rel:l,target:i,title:c}),!0}},Ee),yt(()=>{let n=t.validateUrl.value;if(!n)return;let o=t.attributes.value;return e.registerCommand(Mi,(r)=>{let s=K();if(!I(s)||s.isCollapsed()||!kn(r,ClipboardEvent))return!1;if(r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");if(!n(i))return!1;return!s.getNodes().some((l)=>W(l)||ne(l)&&!l.isSimpleText())&&(e.dispatchCommand(bd,{...o,url:i}),r.preventDefault(),!0)},we)}))}var Od=me({build:(e,t,n)=>Mt(t),config:{attributes:void 0,validateUrl:void 0},dependencies:[io,tn(Yo,{rules:I0})],mergeConfig(e,t){let n=Pt(e,t);return e.attributes&&(n.attributes=Pt(e.attributes,n.attributes)),n},name:"@lexical/link/Link",nodes:()=>[ns],register:(e,t,n)=>L0(e,n.getOutput())}),dk=me({dependencies:[Od],name:"@lexical/link/Import"});function F0(e,t,n={}){let o=(s)=>{let i=s.target;if(!oo(i))return;let l=vu(i);if(l===null)return;let c=null,u=null,d=!1;if(l.update(()=>{let h=Tt(i);if(h!==null){let m=pe(h,W);if(!t.disabled.peek())if(In(m))d=fn(m)&&m.getIsUnlinked(),c=m.sanitizeUrl(m.getURL()),u=m.getTarget();else{let _=function(x,C){let y=x;for(;y!=null;){if(C(y))return y;y=y.parentNode}return null}(i,wi);_!==null&&(c=_.href,u=_.target)}}}),c===null||c===""||d)return;let f=e.read("latest",K);if(I(f)&&!f.isCollapsed())return void s.preventDefault();let p=s.type==="auxclick"&&s.button===1;window.open(c,t.newTab.peek()||p||s.metaKey||s.ctrlKey||u==="_blank"?"_blank":"_self"),s.preventDefault()},r=(s)=>{s.button===1&&o(s)};return e.registerRootListener((s)=>{if(s)return Vr(s,{click:o,mouseup:r},n)})}var fk=me({build:(e,t,n)=>Mt(t),config:Be({disabled:!1,newTab:!1}),dependencies:[Od],name:"@lexical/link/ClickableLink",register:(e,t,n)=>F0(e,n.getOutput())});function P0(e,t=(n)=>n){return(n)=>{let o=e.exec(n);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:t(o[0])}}}var gk=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,pk=(e)=>{let t=gk.exec(e);if(t===null)return null;let n=t[0],o=0;for(let r of n)r==="("?o++:r===")"&&o--;for(;o<0&&n.endsWith(")");)n=n.slice(0,-1),o++;return{index:t.index,length:n.length,text:n,url:n.startsWith("http")?n:`https://${n}`}},hk=P0(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,(e)=>`mailto:${e}`);function Mh(e,t){for(let n=0;n<t.length;n++){let o=t[n](e);if(o)return o}return null}var B0=/[.,;\s]/;function vd(e,t){return t.test(e)}function z0(e,t){return vd(e[e.length-1],t)}function Dh(e,t){return vd(e[0],t)}function U0(e,t){let n=e.getPreviousSibling();return W(n)&&(n=n.getLastDescendant()),n===null||Pe(n)||ne(n)&&z0(n.getTextContent(),t)}function H0(e,t){let n=e.getNextSibling();return W(n)&&(n=n.getFirstDescendant()),n===null||Pe(n)||ne(n)&&Dh(n.getTextContent(),t)}function mk(e,t,n,o,r){if(!(e>0?vd(o[e-1],n):U0(r[0],n)))return!1;return t<o.length?vd(o[t],n):H0(r[r.length-1],n)}function _k(e,t,n){let o=[],r=[],s=[],i=0,l=0,c=[...e];for(;c.length>0;){let u=c[0],d=u.getTextContent().length,f=l;l+d<=t?(o.push(u),i+=d):f>=n?s.push(u):r.push(u),l+=d,c.shift()}return[i,o,r,s]}function xk(e,t,n,o){let r=$h(o.url,o.attributes);if(e.length===1){let s,i=e[0];t===0?[s,i]=i.splitText(n):[,s,i]=i.splitText(t,n);let l=xt(o.text);return l.setFormat(s.getFormat()),l.setDetail(s.getDetail()),l.setStyle(s.getStyle()),r.append(l),s.replace(r),i}if(e.length>1){let s=e[0],i,l=s.getTextContent().length;t===0?i=s:[,i]=s.splitText(t);let c=[],u;for(let h=1;h<e.length;h++){let m=e[h],_=m.getTextContent().length,x=l;if(x<n)if(l+_<=n)c.push(m);else{let[C,y]=m.splitText(n-x);c.push(C),u=y}l+=_}let d=K(),f=d?d.getNodes().find(ne):void 0,p=xt(i.getTextContent());return p.setFormat(i.getFormat()),p.setDetail(i.getDetail()),p.setStyle(i.getStyle()),r.append(p,...c),f&&f===i&&(I(d)?p.select(d.anchor.offset,d.focus.offset):Je(d)&&p.select(0,p.getTextContent().length)),i.replace(r),u}}function k0(e,t,n,o){let r=e.getChildren(),s=r.length;for(let u=0;u<s;u++){let d=r[u];if(!ne(d)||!d.isSimpleText())return Ll(e),void n(null,e.getURL())}let i=e.getTextContent(),l=Mh(i,t);if(l===null||l.text!==i)return Ll(e),void n(null,e.getURL());if(!U0(e,o)||!H0(e,o))return Ll(e),void n(null,e.getURL());let c=e.getURL();if(c!==l.url&&(e.setURL(l.url),n(l.url,c)),l.attributes){let u=e.getRel();u!==l.attributes.rel&&(e.setRel(l.attributes.rel||null),n(l.attributes.rel||null,u));let d=e.getTarget();d!==l.attributes.target&&(e.setTarget(l.attributes.target||null),n(l.attributes.target||null,d))}}function Ll(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((n)=>n.getLatest())}var W0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:B0};function G0(e,t=W0){let{matchers:n,changeHandlers:o,excludeParents:r,separatorRegex:s=B0}=t,i=(l,c)=>{for(let u of o)u(l,c)};return Oe(e.registerNodeTransform($n,(l)=>{let c=l.getParentOrThrow(),u=l.getPreviousSibling();if(fn(c))k0(c,n,i,s);else if(!In(c)&&!r.some((d)=>d(c))){if(l.isSimpleText()&&(Dh(l.getTextContent(),s)||!fn(u))){let d=function(f){let p=[f],h=f.getNextSibling();for(;h!==null&&ne(h)&&h.isSimpleText()&&(p.push(h),!/[\s]/.test(h.getTextContent()));)h=h.getNextSibling();return p}(l);(function(f,p,h,m){for(let E of f){let v=E.getParent();if(fn(v)&&!v.getIsUnlinked())return}let _=[...f],x=_.map((E)=>E.getTextContent()).join(""),C,y=x,N=0;for(;(C=Mh(y,p))&&C!==null;){let E=C.index,v=E+C.length;if(mk(N+E,N+v,m,x,_)){let[b,,A,O]=_k(_,N+E,N+v),D=!1;for(let k of A){let q=k.getParent();if(fn(q)&&!q.getIsUnlinked()){D=!0;break}}if(D){N+=v,y=y.substring(v);continue}let H=xk(A,N+E-b,N+v-b,C);_=H?[H,...O]:O,h(C.url,null),N=0}else N+=v;y=y.substring(v)}})(d,n,i,s)}(function(d,f,p,h){let m=d.getParent(),_=d.getPreviousSibling(),x=d.getNextSibling(),C=d.getTextContent();if(!fn(m)||m.getIsUnlinked()){if(fn(_)&&!_.getIsUnlinked()&&_.is(d.getPreviousSibling())&&d.getParent()===_.getParent()){if(!Dh(C,h))return Ll(_),void p(null,_.getURL());if(y=C,_.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(y):/^\.[a-zA-Z0-9]{1,}/.test(y)){let N=_.getTextContent()+C,E=Mh(N,f);E!==null&&E.text===N&&(_.append(d),k0(_,f,p,h),p(null,_.getURL()))}}var y;!fn(x)||x.getIsUnlinked()||z0(C,h)||x.is(d.getNextSibling())&&d.getParent()===x.getParent()&&(Ll(x),p(null,x.getURL()))}})(l,n,i,s)}}),e.registerCommand(bd,(l)=>{let c=K();if(l!==null||!I(c))return!1;return c.extract().forEach((u)=>{let d=u.getParent();fn(d)&&(d.setIsUnlinked(!d.getIsUnlinked()),d.markDirty())}),!1},we))}var Ck=me({config:W0,dependencies:[Od],mergeConfig(e,t){let n=Pt(e,t);for(let o of["matchers","changeHandlers","excludeParents"]){let r=t[o];Array.isArray(r)&&(n[o]=[...e[o],...r])}return n},name:"@lexical/link/AutoLink",nodes:[Pl],register:G0});var kt=wh,{$createAutoLinkNode:eU,$createLinkNode:j0,$isAutoLinkNode:Y0,$isLinkNode:Ji,$toggleLink:tU,AutoLinkExtension:nU,AutoLinkNode:V0,ClickableLinkExtension:oU,LinkExtension:rU,LinkImportExtension:sU,LinkImportRules:iU,LinkNode:Zi,TOGGLE_LINK_COMMAND:kh,autoLinkEmailMatcher:aU,autoLinkUrlMatcher:lU,createLinkMatcherWithRegExp:cU,formatUrl:uU,registerAutoLink:dU,registerClickableLink:fU,registerLink:X0}=kt;Z();function yk({validateUrl:e,attributes:t}){let[n]=st();return S(()=>{if(!n.hasNodes([Zi]))throw Error("LinkPlugin: LinkNode not registered on editor")}),S(()=>X0(n,Mt({attributes:t,validateUrl:e})),[n,e,t]),null}var Sk=Ih,q0=Sk.LinkPlugin;Z();function Nk({defaultSelection:e}){let[t]=st();return S(()=>{t.focus(()=>{let n=t.getRootElement(),o=n!==null?yo(n):null;n===null||o!==null&&n.contains(o)||n.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}var Ek=Lh,J0=Ek.AutoFocusPlugin;function Rd(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function rb(e,t){let n=e;for(let o=it(e,t);o&&(Bt(o.origin)||Wt(o.origin));o=o.getAdjacentCaret())n=o.origin;return n}function os(e){return rb(e,"previous")}function Vs(e){return rb(e,"next")}function sb(e){let t=os(e),n=Vs(e),o=t;for(;o!==null;){if(Bt(o)){let s=xS(o.getTextContent());if(s!==null)return s}if(o===n)break;o=o.getNextSibling()}let r=t.getParent();if(W(r)){let s=r.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function ib(e,t){let n=null,o=null,r=e,s=t,i=e.getTextContent();for(;;){if(s===0){let u=r.getPreviousSibling();if(u===null){r=null;break}if(Bt(u)||Wt(u)||Pe(u)||Rd(167),r=u,Pe(r)){n={node:r,offset:1};break}s=Math.max(0,r.getTextContentSize()-1),i=r.getTextContent()}else s--;let c=i[s];Bt(r)&&c!==" "&&(o={node:r,offset:s})}if(o!==null)return o;let l=null;if(t<e.getTextContentSize())Bt(e)&&(l=e.getTextContent()[t]);else{let c=e.getNextSibling();Bt(c)&&(l=c.getTextContent()[0])}if(l!==null&&l!==" ")return n;{let c=function(u,d){let f=u,p=d,h=u.getTextContent(),m=u.getTextContentSize();for(;;){if(!Bt(f)||p===m){if(f=f.getNextSibling(),f===null||Pe(f))return null;Bt(f)&&(p=0,h=f.getTextContent(),m=f.getTextContentSize())}if(Bt(f)){if(h[p]!==" ")return{node:f,offset:p};p++}}}(e,t);return c!==null?c:n}}function ab(e){let t=Vs(e);return Pe(t)&&Rd(168),t}function Tk(e){let t=[];return Li(e,{linebreak:()=>t.push(ln()),tab:()=>t.push(cn()),text:(n)=>t.push(Kh(n))}),t}function lb(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let o=e.getTextContent(),r=/^ +/.exec(o);if(!r)return!1;let s=Math.min(t,r[0].length),i=e.getKey(),l=n.anchor.key===i&&n.anchor.type==="text"?n.anchor.offset:null,c=n.focus.key===i&&n.focus.type==="text"?n.focus.offset:null;return e.spliceText(0,s,""),l!==null&&n.anchor.set(i,Math.max(0,l-s),"text"),c!==null&&n.focus.set(i,Math.max(0,c-s),"text"),!0}var cb="javascript",bk=()=>cb;function ub(e,t){for(let n of e.childNodes){if(Ce(n)&&n.tagName===t)return!0;if(ub(n,t))return!0}return!1}var zl="data-language",Bl="data-highlight-language",Ad="data-theme",vk=()=>{};class Ul extends lt{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:lt,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||ub(e,"BR"))?{conversion:Z0,priority:1}:null,div:()=>({conversion:Ok,priority:1}),pre:()=>({conversion:Z0,priority:0}),table:(e)=>Fh(e)?{conversion:Ak,priority:3}:null,td:(e)=>{let t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&Fh(n)?{conversion:Q0,priority:3}:null},tr:(e)=>{let t=e.closest("table");return t&&Fh(t)?{conversion:Q0,priority:3}:null}}})}constructor(e=void 0,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=je().createElement("code");Qe(t,e.theme.code),t.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(t.setAttribute(zl,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Bl,n));let o=this.getTheme();o&&t.setAttribute(Ad,o);let r=this.getStyle();return r&&cr(t.style,r),t}updateDOM(e,t,n){let o=this.__language,r=e.__language;o?o!==r&&t.setAttribute(zl,o):r&&t.removeAttribute(zl);let s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&r?s&&o?o!==r&&t.setAttribute(Bl,o):t.removeAttribute(Bl):s&&o&&t.setAttribute(Bl,o);let i=this.__theme,l=e.__theme;i?i!==l&&t.setAttribute(Ad,i):l&&t.removeAttribute(Ad);let c=this.__style,u=e.__style;return c!==u&&cr(t.style,c,u),!1}exportDOM(e){let t=je().createElement("pre");Qe(t,e._config.theme.code),t.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(t.setAttribute(zl,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Bl,n));let o=this.getTheme();o&&t.setAttribute(Ad,o);let r=this.getStyle();return r&&cr(t.style,r),{element:t}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!so(Ke(),"@lexical/code")){vk();let s=db(e);if(s)return s}let{anchor:n,focus:o}=e,r=(n.isBefore(o)?n:o).getNode();if(ne(r)){let s=os(r),i=[];for(;;)if(Wt(s))i.push(cn()),s=s.getNextSibling();else{if(!Bt(s))break;{let h=0,m=s.getTextContent(),_=s.getTextContentSize();for(;h<_&&m[h]===" ";)h++;if(h!==0&&i.push(Kh(" ".repeat(h))),h!==_)break;s=s.getNextSibling()}}let l=r.splitText(n.offset)[0],c=n.offset===0?0:1,u=l.getIndexWithinParent()+c,d=r.getParentOrThrow(),f=[ln(),...i];d.splice(u,0,f);let p=i[i.length-1];p?p.select():n.offset===0?l.selectPrevious():l.getNextSibling().selectNext(0,0)}if(En(r)){let{offset:s}=e.anchor;r.splice(s,0,[ln()]),r.select(s+1,s+1)}return null}canIndent(){return!1}collapseAtStart(){let e=ye();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 bo(e,t){return Gc(Ul).setLanguage(e).setTheme(t)}function En(e){return e instanceof Ul}function Z0(e){return{node:bo(e.getAttribute(zl))}}function Ok(e){let t=e,n=eb(t);return n||function(o){let r=o.parentElement;for(;r!==null;){if(eb(r))return!0;r=r.parentElement}return!1}(t)?{node:n?bo():null}:{node:null}}function Ak(){return{node:bo()}}function Q0(){return{node:null}}function eb(e){return e.style.fontFamily.match("monospace")!==null}function Fh(e){return e.classList.contains("js-file-line-container")}function db(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type==="element"){let n=t.getNode();if(En(n)){let o=n.getChildrenSize();if(o>=2&&t.offset===o){let r=n.getLastChild();if(Pe(r)&&Pe(r.getPreviousSibling())){let s=ye();return n.splice(o-2,2,[]).insertAfter(s,!1),s.select(),s}}}}return null}class Hl extends $n{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}$config(){return this.config("code-highlight",{extends:$n})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}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),n=Ph(e.theme,this.__highlightType);return Qe(t,n),t}updateDOM(e,t,n){let o=super.updateDOM(e,t,n),r=Ph(n.theme,e.__highlightType),s=Ph(n.theme,this.__highlightType);return r!==s&&(r&&nn(t,r),s&&Qe(t,s)),o}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 bo()}}function Ph(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Kh(e="",t){return sn(new Hl(e,t))}function Bt(e){return e instanceof Hl}var fb="data-language";function pb(e){return e.style.fontFamily.match("monospace")!==null}function Bh(e){let t=e.parentElement;for(;t!==null;){if(pb(t))return!0;t=t.parentElement}return!1}var Rk=rh([ut({$import:(e,t)=>e.$importChildren(t),match:dt.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Mk=ut({$import:(e,t)=>[bo(t.getAttribute(fb)).splice(0,0,e.$importChildren(t))],match:dt.tag("pre"),name:"@lexical/code/pre"}),Dk=ut({$import:(e,t,n)=>{let o=t.textContent||"";return/\r?\n/.test(o)||t.querySelector("br")!==null?[bo(t.getAttribute(fb)).splice(0,0,e.$importChildren(t))]:n()},match:dt.tag("code"),name:"@lexical/code/code-multiline"});function Qi(e){if(!Ce(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t=="string"&&/monospace/i.test(t)&&typeof n=="string"&&n.startsWith("pre")}function _b(e){let t=!1,n=[],o="",r=!1,s=()=>{r&&(n.push(o),o="",r=!1)};for(let i of Array.from(e.childNodes))if(Ce(i))i.tagName==="DIV"?(s(),n.push(i.textContent||""),t=!0):i.tagName==="BR"?(s(),n.push(""),t=!0):(o+=i.textContent||"",r=!0);else if(Ls(i)){let l=i.textContent||"";l.length>0&&(o+=l,r=!0)}return s(),t?n:null}function xb(e){for(let t of Array.from(e.children)){if(Ce(t)&&Qi(t)){if(_b(t)!==null)return!0;let n=t.nextElementSibling;if(n&&Qi(n))return!0;continue}if(xb(t))return!0}return!1}var $k=rh([ut({$import:(e,t,n)=>{if(!Qi(t)||Bh(t))return n();let o=_b(t);return o===null||o.length===0?n():[bo().splice(0,0,tl(o.join(`
|
|
14
|
+
`);let c=l.length;if(!ne(o)||r>=c){let u=o.getParent();o.remove(),u==null||u.getChildrenSize()!==0||xo(u)||u.remove(),r-=c+i,o=s}else{let u=o.getKey(),d=e.read("latest",()=>{let h=Ot(u);return ne(h)&&h.isSimpleText()?h.getTextContent():null}),f=c-r,p=l.slice(0,f);if(d!==null&&d!==l){let h=Cn(),m=o;if(o.isSimpleText())o.setTextContent(d);else{let _=xt(d);o.replace(_),m=_}if(I(h)&&h.isCollapsed()){let _=h.anchor.offset;m.select(_,_)}}else if(o.isSimpleText()){let h=t.key===u,m=t.offset;m<r&&(m=c);let _=h?m-r:0,x=h?m:f;if(h&&_===0){let[C]=o.splitText(_,x);C.remove()}else{let[,C]=o.splitText(_,x);C.remove()}}else{let h=xt(p);o.replace(h)}r=0}}}var RM=()=>{};function $u(e,t){(I(e)?e.isCollapsed():ne(e)||j(e))||ep(280);let n=Vr(I(e)?e.style:ne(e)?e.getStyle():e.getTextStyle()),o=DS(Object.entries(t).reduce((r,[s,i])=>(typeof i=="function"?r[s]=i(n[s],e):i===null?delete r[s]:r[s]=i,r),{...n}));I(e)||ne(e)?e.setStyle(o):e.setTextStyle(o)}function MM(e,t){if(I(e)&&e.isCollapsed()){$u(e,t);let o=e.anchor.getNode();j(o)&&o.isEmpty()&&$u(o,t)}wS((o)=>{$u(o,t)});let n=e.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!j(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();o.has(s)||(o.add(s),$u(r,t))}}}function wS(e){let t=K();if(!t)return;let n=new Map,o=(s)=>n.get(s.getKey())||[0,s.getTextContentSize()];if(I(t))for(let s of ar(t).getTextSlices())s&&n.set(s.caret.origin.getKey(),s.getSliceIndices());let r=t.getNodes();for(let s of r){if(!ne(s)||!s.canHaveFormat())continue;let[i,l]=o(s);if(l!==i)if(Hg(s)||i===0&&l===s.getTextContentSize())e(s);else e(s.splitText(i,l)[i===0?0:1])}I(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&kS(t)}function kS(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:s}=t;t.set(n.key,n.offset,n.type),n.set(o,r,s)}}function IS(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function LS(e,t,n){let o=an(e,n);if(rl(o))return!1;for(;o;o=o.getParentCaret()){let r=o.getParentAtCaret();if(!r||o.getNodeAtCaret())return!1;if(t.is(r))return!0}return!1}function DM(e,t,n=IS){if(!e)return;let o=e.getStartEndPoints(),r=!1,s=null,i=new Map;if(o){let[l,c]=o,u=pe(l.getNode(),ul);s=pe(c.getNode(),ul);let d=e.isBackward()?"previous":"next";r=j(s)&&!s.is(u)&&function(f,p,h){let m=f.getNode();return(!j(m)||!m.isEmpty())&&LS(f,p,h)}(c,s,fS(d)),j(u)&&i.set(u.getKey(),u),j(s)&&!r&&i.set(s.getKey(),s)}for(let l of e.getNodes())if(j(l)&&ul(l)){if(r&&l.is(s))continue;i.set(l.getKey(),l)}else if(!o){let c=pe(l,ul);j(c)&&i.set(c.getKey(),c)}for(let l of i.values()){let c=t();n(l,c),l.replace(c,!0)}}function MS(e){return e.getNode().isAttached()}function $M(e){let t=e;for(;t!==null&&!At(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function wM(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,s=e.getNodes(),i=s.length;if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let u=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),d=u.getChildren(),f=t();return f.setFormat(u.getFormatType()),f.setIndent(u.getIndent()),d.forEach((p)=>f.append(p)),n&&(f=n.append(f)),void u.replace(f)}let l=null,c=[];for(let u=0;u<i;u++){let d=s[u];At(d)?(Qg(e,c,c.length,t,n),c=[],l=d):l===null||l!==null&&ol(d,l)?c.push(d):(Qg(e,c,c.length,t,n),c=[d])}Qg(e,c,c.length,t,n)}function Qg(e,t,n,o,r=null){if(t.length===0)return;let s=t[0],i=new Map,l=[],c=j(s)?s:s.getParentOrThrow(),u=c.isInline()?c.getParentOrThrow():c,d=!1;for(;u!==null;){let _=u.getPreviousSibling();if(_!==null){u=_,d=!0;break}if(u=u.getParentOrThrow(),At(u))break}let f=new Set;for(let _=0;_<n;_++){let x=t[_];j(x)&&x.getChildrenSize()===0&&f.add(x.getKey())}let p=new Set;for(let _=0;_<n;_++){let x=t[_],C=x.getParent();if(C!==null&&C.isInline()&&(C=C.getParent()),C!==null&&sl(x)&&!p.has(x.getKey())){let y=C.getKey();if(i.get(y)===void 0){let N=o();N.setFormat(C.getFormatType()),N.setIndent(C.getIndent()),l.push(N),i.set(y,N);let E=C.getChildren();N.splice(N.getChildrenSize(),0,E);for(let v of E)if(p.add(v.getKey()),j(v))for(let b of v.getChildrenKeys())p.add(b);$M(C)}}else if(f.has(x.getKey())){j(x)||ep(179);let y=o();y.setFormat(x.getFormatType()),y.setIndent(x.getIndent()),l.push(y),x.remove(!0)}}if(r!==null)for(let _=0;_<l.length;_++){let x=l[_];r.append(x)}let h=null;if(At(u))if(d)if(r!==null)u.insertAfter(r);else for(let _=l.length-1;_>=0;_--){let x=l[_];u.insertAfter(x)}else{let _=u,x=_.getFirstChild();if(j(x)&&(u=x),x===null)if(r)_.append(r);else for(let C=0;C<l.length;C++){let y=l[C];_.append(y),h=y}else if(r!==null)x.insertBefore(r);else for(let C=0;C<l.length;C++){let y=l[C];x.insertBefore(y),h=y}}else if(r)u.insertAfter(r);else for(let _=l.length-1;_>=0;_--){let x=l[_];u.insertAfter(x),h=x}let m=Cn();I(m)&&MS(m.anchor)&&MS(m.focus)?pt(m.clone()):h!==null?h.selectEnd():e.dirty=!0}function FS(e){let t=PS(e);return t!==null&&t.writingMode==="vertical-rl"}function PS(e){let t=e.anchor.getNode();return j(t)?tp(t):np(t)}function kM(e,t){let n=FS(e)?!t:t;op(e)&&(n=!n);let o=an(e.focus,n?"previous":"next");if(rl(o))return!1;if(zr(o)&&!Wt(o.origin)&&o.origin.isUnmergeable()){let r=o.getNodeAtCaret();if(ne(r)&&!Wt(r))return!0}for(let r of bs(o)){if(Fo(r))return!r.origin.isInline();if(!j(r.origin)){if(Dt(r.origin))return!0;break}}return!1}function BS(e,t,n,o){e.modify(t?"extend":"move",n,o)}function op(e){let t=PS(e);return t!==null&&t.direction==="rtl"}function IM(e,t,n){let o=op(e),r;r=FS(e)||o?!n:n,BS(e,t,r,"character")}function LM(e,t,n){let o=e.getStyle(),r=Vr(o);return r!==null&&r[t]||n}function FM(e,t,n=""){let o=null,r=e.getNodes(),s,i;if(I(e)){if(e.isCollapsed()&&e.style!==""){let m=Vr(e.style);if(m!==null&&t in m)return m[t]}let{anchor:l,focus:c}=e,u=e.isBackward(),d=u?c.getNode():l.getNode(),f=u?l.getNode():c.getNode(),p=u?c.offset:l.offset,h=u?l.offset:c.offset;ne(d)&&p===d.getTextContentSize()&&(s=d),h===0&&(i=f)}for(let l=0;l<r.length;l++){let c=r[l];if(ne(c)&&!c.is(l===0?s:i)){let u=LM(c,t,n);if(o===null)o=u;else if(o!==u){o="";break}}}return o===null?n:o}var PM=Vr,BM=$S;var ct=rp,{$addNodeStyle:gF,$cloneWithProperties:pF,$copyBlockFormatIndent:hF,$ensureForwardRangeSelection:mF,$forEachSelectedTextNode:_F,$getComputedStyleForElement:xF,$getComputedStyleForParent:CF,$getSelectionStyleValueForProperty:yF,$isAtEdgeOfElement:sp,$isAtNodeEnd:ip,$isParentElementRTL:SF,$isParentRTL:yl,$moveCaretSelection:NF,$moveCharacter:ap,$patchStyleText:EF,$selectAll:TF,$setBlocksType:Fi,$shouldOverrideDefaultCharacterSelection:lp,$sliceSelectedTextNodeContent:Fs,$trimTextContentFromAnchor:bF,$wrapNodes:vF,createDOMRange:OF,createRectsFromDOMRange:KS,getCSSFromStyleObject:AF,getStyleObjectFromCSS:RF,trimTextContentFromAnchor:MF}=ct;function up(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function HS(e){let t=(o,r)=>r.left>=o.left-1&&r.top>=o.top-1&&r.right<=o.right+1&&r.bottom<=o.bottom+1,n=[];for(let o of Array.from(e))if(!(o.width<0.5||o.height<0.5||n.some((r)=>t(o,r)))){for(let r=n.length-1;r>=0;r--)t(n[r],o)&&n.splice(r,1);n.push(o)}return n}function jo(e){return`${e}px`}var KM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function WS(e,t,n){let o=null,r=null,s=null,i=[],l=ks(e.getRootElement()).createElement("div");function c(){o===null&&up(182),r===null&&up(183);let{left:f,top:p}=r.getBoundingClientRect(),h=HS(KS(e,t));var m,_;l.isConnected||(_=l,(m=r).insertBefore(_,m.firstChild));let x=!1;for(let C=0;C<h.length;C++){let y=h[C],N=i[C]||ks(o).createElement("div"),E=N.style;E.position!=="absolute"&&(E.position="absolute",x=!0);let v=jo(y.left-f);E.left!==v&&(E.left=v,x=!0);let b=jo(y.top-p);E.top!==b&&(N.style.top=b,x=!0);let A=jo(y.width);E.width!==A&&(N.style.width=A,x=!0);let O=jo(y.height);E.height!==O&&(N.style.height=O,x=!0),N.parentNode!==l&&(l.append(N),x=!0),i[C]=N}for(;i.length>h.length;){let C=i.pop();C!=null&&C.remove()}x&&n(i)}function u(){r=null,o=null,s!==null&&s.disconnect(),s=null,l.remove();for(let f of i)f.remove();i=[]}l.style.position="relative";let d=e.registerRootListener(function f(){let p=e.getRootElement();if(p===null)return u();let h=p.parentElement;if(!Ce(h))return u();u(),o=p,r=h,s=new MutationObserver((m)=>{let _=e.getRootElement(),x=_&&_.parentElement;if(_!==o||x!==r)return f();for(let C of m)if(!l.contains(C.target))return c()}),s.observe(h,KM),c()});return()=>{d(),u()}}function zS(e,t,n,o){if(t.type!=="text"&&j(n)){let r=$y(n,o,e);return[r.element,r.getFirstChildOffset()+t.offset]}return[(ne(n)?wy(n,o,e):mS(o))||o,t.offset]}function zM(e){for(let t of e){let n=t.style;n.background!=="Highlight"&&(n.background="Highlight"),n.color!=="HighlightText"&&(n.color="HighlightText"),n.marginTop!==jo(-1.5)&&(n.marginTop=jo(-1.5)),n.paddingTop!==jo(4)&&(n.paddingTop=jo(4)),n.paddingBottom!==jo(0)&&(n.paddingBottom=jo(0))}}function GS(e,t=zM){let n=null,o=null,r=null,s=null,i=null,l=null,c=()=>{};function u(d){d.read(()=>{let f=K();if(!I(f))return n=null,r=null,s=null,l=null,c(),void(c=()=>{});let[p,h]=function(O){let D=O.getStartEndPoints();return O.isBackward()?[D[1],D[0]]:D}(f),m=p.getNode(),_=m.getKey(),x=p.offset,C=h.getNode(),y=C.getKey(),N=h.offset,E=e.getElementByKey(_),v=e.getElementByKey(y),b=n===null||E!==o||x!==r||_!==n.getKey(),A=s===null||v!==i||N!==l||y!==s.getKey();if((b||A)&&E!==null&&v!==null){let O=function(D,H,k,J,V,oe,B){let de=(D._window?D._window.document:document).createRange();return de.setStart(...zS(D,H,k,J)),de.setEnd(...zS(D,V,oe,B)),de}(e,p,m,E,h,C,v);c(),c=WS(e,O,t)}n=m,o=E,r=x,s=C,i=v,l=N},{editor:e})}return u(e.getEditorState()),Oe(e.registerUpdateListener(({editorState:d})=>u(d)),()=>{c()})}function UM(e,t){let n=null,o=()=>{let r=e.getRootElement(),s=r!==null?r.ownerDocument.defaultView:null,i=s!==null?s.getSelection():null,l=i!==null?ws(i,r).anchorNode:null;l!==null&&r!==null&&r.contains(l)?n!==null&&(n(),n=null):n===null&&(n=GS(e,t))};return e.registerRootListener((r)=>{if(r){let s=r.ownerDocument,i=Oe(ro(s,"selectionchange",o),()=>{n!==null&&n()});return o(),i}})}function HM(e,t){let n=e.ownerDocument,o=n.defaultView||window,r=o.getComputedStyle(e),s=r.position==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(r.position==="fixed")return n.body;for(let l=e;l=Cl(l);)if(r=o.getComputedStyle(l),(!s||r.position!=="static")&&i.test(r.overflow+r.overflowY+r.overflowX))return l;return n.body}function jS(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function WM(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:l,value:c}=n.next();if(l)return o(s);let u=new FileReader;u.addEventListener("error",r),u.addEventListener("load",()=>{let d=u.result;typeof d=="string"&&s.push({file:c,result:d}),i()}),jS(c,t)?u.readAsDataURL(c):i()};i()})}function GM(e,t){return Array.from(YS(e,t))}function jM(e){return e?e.getAdjacentCaret():null}function YM(e,t){return Array.from(qS(e,t))}function YS(e,t){return wu("next",e,t)}function VM(e,t){return Array.from(VS(e,t))}function*VS(e,t){for(let n of wu("next",e,t)){yield n;let{node:o,depth:r}=n;if(il(o)&&!o.is(t))for(let s of As(o)){let i=Ci(o,s);i!==null&&(yield*dp(i,r+1))}}}function*dp(e,t){yield{depth:t,node:e};let n=t+1;if(il(e))for(let o of As(e)){let r=Ci(e,o);r!==null&&(yield*dp(r,n))}if(j(e))for(let o of e.getChildren())yield*dp(o,n)}function US(e,t){let n=vs(it(e,t));return n&&n[0]}function wu(e,t,n){let o=Xe(),r=t||o,s=j(r)?Et(r,e):it(r,e),i=XS(r),l=n?nl(Bg(it(n,e)))||US(n,e):US(r,e),c=i;return Vg({hasNext:(u)=>u!==null,initial:s,map:(u)=>({depth:c,node:u.origin}),step:(u)=>{if(u.isSameNodeCaret(l))return null;Fo(u)&&c++;let d=vs(u);return!d||d[0].isSameNodeCaret(l)?null:(c+=d[1],d[0])}})}function XM(e){let t=vs(it(e,"next"));return t&&[t[0].origin,t[1]]}function XS(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??Yc(n))t++;return t}function qM(e){let t=Bg(it(e,"previous")),n=vs(t,"root");return n&&n[0].origin}function qS(e,t){return wu("previous",e,t)}function JM(e,t){return Array.from(JS(e,t))}function*JS(e,t){let n=[];for(let o of wu("previous",e,t)){for(;n.length>0&&o.depth<=n[n.length-1].depth;){let i=n.pop();yield*fp(i.node,i.depth+1)}yield o;let{node:r,depth:s}=o;il(r)&&As(r).length>0&&!r.is(t)&&n.push({depth:s,node:r})}for(;n.length>0;){let o=n.pop();yield*fp(o.node,o.depth+1)}}function*fp(e,t){let n=As(e);for(let o=n.length-1;o>=0;o--){let r=Ci(e,n[o]);r!==null&&(yield*ZS(r,t))}}function*ZS(e,t){yield{depth:t,node:e};let n=t+1;if(j(e)){let o=e.getChildren();for(let r=o.length-1;r>=0;r--)yield*ZS(o[r],n)}il(e)&&(yield*fp(e,n))}function ZM(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function QM(e){let t=pe(e,(n)=>j(n)&&!n.isInline());return j(t)||up(4,e.__key),t}function eD(e,t){let n=cr(I(t)?ar(t):t,"next"),o=Jn(n.anchor.origin),r=Jn(e.getLatest());if(o===null?r!==null:!o.is(r))return!1;let s=$t(Et(e,"next")),i=My($t(Et(e,"previous")),"next");return Fr(n.anchor,s)<=0&&Fr(n.focus,i)>=0}function tD(e,t,n,o){let r=(s)=>s instanceof t;return e.registerNodeTransform(t,(s)=>{let i=((l)=>{let c=l.getChildren();for(let f=0;f<c.length;f++){let p=c[f];if(r(p))return null}let u=l,d=l;for(;u!==null;)if(d=u,u=u.getParent(),r(u))return{child:d,parent:u};return null})(s);if(i!==null){let{child:l,parent:c}=i;if(l.is(s)){o(c,s);let u=l.getNextSiblings(),d=u.length;if(c.insertAfter(l),d!==0){let f=n(c);l.insertAfter(f);for(let p=0;p<d;p++)f.append(u[p])}c.canBeEmpty()||c.getChildrenSize()!==0||c.remove()}}})}function nD(e,t){let n=new Map,o=e._pendingEditorState;for(let[s,i]of t._nodeMap)n.set(s,Wc(i));o&&(o._nodeMap=n),_i();let r=t._selection;pt(r===null?null:r.clone())}function oD(e){let t=K()||Cn(),n;if(I(t))n=an(t.focus,"next");else{if(t!=null){let i=t.getNodes(),l=i[i.length-1];l&&(n=it(l,"next"))}n=n||Et(Xe(),"previous").getFlipped().insert(ye())}let o=Br(e,n),r=nl(o),s=Fo(r)?$t(r):o;return Rn(Os(s)),e.getLatest()}function rD(e){let t=K();if(!I(t))return void(t&&t.insertNodes([e]));let n=ar(t),o=cr(zy(n),"next").anchor;if(zr(o)){let s=Jc(o);if(!s)return;o=s}let r=o.getFlipped();r.insert(e),Rn(qn(r,r))}function sD(e,t){let n=t();return e.replace(n),n.append(e),n}function gp(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function iD(e){let t=null;if(gp(e,DragEvent)?t=e.dataTransfer:gp(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,o=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[o,Array.from(t.files),r]}function aD(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function lD(e){let t=K();if(!I(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(n.has(i))continue;let l=pe(s,(u)=>j(u)&&!u.isInline());if(l===null)continue;let c=l.getKey();l.canIndent()&&!n.has(c)&&(n.add(c),e(l))}return n.size>0}function cD(e,t){Et(e,"next").insert(t)}var cp=!($s||!un)&&void 0;function uD(e,t=!1){let n=1;if(function(){if(cp===void 0){let o=document.createElement("div");o.style.position="absolute",o.style.opacity="0",o.style.width="100px",o.style.left="-1000px",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),cp=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return cp}()||t){let o=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(o.getComputedStyle(e).getPropertyValue("zoom")),e=Cl(e)}return n}function dD(e){return e._parentEditor!==null}function fD(e,t){return QS(e,t,null)}function QS(e,t,n){let o=!1;for(let r of pp(e))t(r)?n!==null&&n(r):(o=!0,j(r)&&QS(r,t,n||((s)=>r.insertAfter(s))),r.remove());return o}function gD(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(j(r))for(let s of pp(r))o.push(s);return n}function pD(e){return eN(Et(e,"next"))}function pp(e){return eN(Et(e,"previous"))}function eN(e){return Vg({hasNext:Co,initial:e.getAdjacentCaret(),map:(t)=>t.origin.getLatest(),step:(t)=>t.getAdjacentCaret()})}function hD(e){Ko(it(e,"next")).splice(1,e.getChildren())}function mD(e){let t=(o)=>Lo(o,e),n=(o,r)=>Qn(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}function _D(e,t){let n=K();if(I(n)&&n.isCollapsed()){let o=pe(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getFirstChild()===o&&tN(n.anchor,o))return o.insertBefore(ye()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function xD(e,t){let n=K();if(I(n)&&n.isCollapsed()){let o=pe(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getLastChild()===o&&nN(n.anchor,o))return o.insertAfter(ye()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function tN(e,t){return sp(e,t,"previous")}function nN(e,t){return sp(e,t,"next")}var ue=hp,{$descendantsMatching:Sl,$dfs:oN,$dfsIterator:IF,$dfsWithSlots:LF,$dfsWithSlotsIterator:FF,$filter:PF,$findMatchingParent:BF,$firstToLastIterator:KF,$getAdjacentCaret:zF,$getAdjacentSiblingOrParentSiblingCaret:UF,$getDepth:HF,$getNearestBlockElementAncestorOrThrow:ku,$getNearestNodeOfType:Iu,$getNextRightPreorderNode:WF,$getNextSiblingOrParentSibling:GF,$handleIndentAndOutdent:Nl,$insertFirst:rN,$insertNodeIntoLeaf:jF,$insertNodeToNearestRoot:Lu,$insertNodeToNearestRootAtCaret:YF,$isAtEndOfNode:VF,$isAtStartOfNode:XF,$isBlockFullySelected:El,$isEditorIsNestedEditor:qF,$lastToFirstIterator:JF,$onEscapeDown:mp,$onEscapeUp:_p,$restoreEditorState:ZF,$reverseDfs:QF,$reverseDfsIterator:eP,$reverseDfsWithSlots:tP,$reverseDfsWithSlotsIterator:nP,$splitNode:oP,$unwrapAndFilterDescendants:xp,$unwrapNode:rP,$wrapNodeInElement:sP,CAN_USE_BEFORE_INPUT:iP,CAN_USE_DOM:aP,IS_ANDROID:lP,IS_ANDROID_CHROME:cP,IS_APPLE:uP,IS_APPLE_WEBKIT:dP,IS_CHROME:fP,IS_FIREFOX:gP,IS_IOS:pP,IS_SAFARI:hP,addClassNamesToElement:mP,calculateZoomLevel:sN,dedupeSelectionRects:_P,eventFiles:Ps,getScrollParent:xP,isBlockDomNode:CP,isHTMLAnchorElement:yP,isHTMLElement:SP,isInlineDomNode:NP,isMimeType:EP,makeStateWrapper:TP,markSelection:bP,mediaFileReader:vP,mergeRegister:OP,objectKlassEquals:In,positionNodeOnRange:AP,registerNestedElementResolver:RP,removeClassNamesFromElement:MP,selectionAlwaysOnDisplay:iN}=ue;var CD=Symbol.for("preact-signals");function Hu(){if(dr>1)return void dr--;let e,t=!1;for(!function(){let n=Ku;for(Ku=void 0;n!==void 0;)n.S.v===n.v&&(n.S.i=n.i),n=n.o}();bl!==void 0;){let n=bl;for(bl=void 0,zu++;n!==void 0;){let o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&hN(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(zu=0,dr--,t)throw e}function pN(e){if(dr>0)return e();bp=++yD,dr++;try{return e()}finally{Hu()}}var tt,bl;function Tp(e){let t=tt;tt=void 0;try{return e()}finally{tt=t}}var Ku,dr=0,zu=0,yD=0,bp=0,Bu=0;function aN(e){if(tt===void 0)return;let t=e.n;return t===void 0||t.t!==tt?(t={i:0,S:e,p:tt.s,n:void 0,t:tt,e:void 0,x:void 0,r:t},tt.s!==void 0&&(tt.s.n=t),tt.s=t,e.n=t,32&tt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=tt.s,t.n=void 0,tt.s.n=t,tt.s=t),t):void 0}function dn(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}function Zr(e,t){return new dn(e,t)}function hN(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function lN(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function mN(e){let t,n=e.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}e.s=t}function Bs(e,t){dn.call(this,void 0),this.x=e,this.s=void 0,this.g=Bu-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}function _N(e,t){return new Bs(e,t)}function xN(e){let t=e.m;if(e.m=void 0,typeof t=="function"){dr++;let n=tt;tt=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Rp(e),o}finally{tt=n,Hu()}}}function Rp(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,xN(e)}function SD(e){if(tt!==this)throw Error("Out-of-order effect");mN(this),tt=e,this.f&=-2,8&this.f&&Rp(this),Hu()}function Bi(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}function qt(e,t){let n=new Bi(e,t);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function So(e,t={}){let n={};for(let o in e){let r=t[o],s=Zr(r===void 0?e[o]:r);n[o]=s}return n}dn.prototype.brand=CD,dn.prototype.h=function(){return!0},dn.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:Tp(()=>{var n;(n=this.W)==null||n.call(this)}))},dn.prototype.U=function(e){if(this.t!==void 0){let{e:t,x:n}=e;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Tp(()=>{var o;(o=this.Z)==null||o.call(this)}))}},dn.prototype.subscribe=function(e){return qt(()=>{let t=this.value,n=tt;tt=void 0;try{e(t)}finally{tt=n}},{name:"sub"})},dn.prototype.valueOf=function(){return this.value},dn.prototype.toString=function(){return this.value+""},dn.prototype.toJSON=function(){return this.value},dn.prototype.peek=function(){let e=tt;tt=void 0;try{return this.value}finally{tt=e}},Object.defineProperty(dn.prototype,"value",{get(){let e=aN(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(zu>100)throw Error("Cycle detected");(function(t){dr!==0&&zu===0&&t.l!==bp&&(t.l=bp,Ku={S:t,v:t.v,i:t.i,o:Ku})})(this),this.v=e,this.i++,Bu++,dr++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Hu()}}}}),Bs.prototype=new dn,Bs.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32)return!0;if(this.f&=-5,this.g===Bu)return!0;if(this.g=Bu,this.f|=1,this.i>0&&!hN(this))return this.f&=-2,!0;let e=tt;try{lN(this),tt=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return tt=e,mN(this),this.f&=-2,!0},Bs.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}dn.prototype.S.call(this,e)},Bs.prototype.U=function(e){if(this.t!==void 0&&(dn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Bs.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Bs.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=aN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Bi.prototype.c=function(){let e=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}},Bi.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,xN(this),lN(this),dr++;let e=tt;return tt=this,SD.bind(this,e)},Bi.prototype.N=function(){2&this.f||(this.f|=2,this.u=bl,bl=this)},Bi.prototype.d=function(){this.f|=8,1&this.f||Rp(this)},Bi.prototype.dispose=function(){this.d()};var ND=me({build:(e,t,n)=>So(t),config:Be({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let o=n.getOutput();return qt(()=>o.disabled.value?void 0:e.registerRootListener((r)=>{e.focus(()=>{let s=r!==null?yo(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function CN(){let e=Xe(),t=K(),n=ye();e.clear(),e.append(n),t!==null&&n.select(),I(t)&&(t.format=0)}function yN(e,t=CN){return e.registerCommand(Zc,()=>(t(),!0),Ee)}var ED=me({build:(e,t,n)=>So(t),config:Be({$onClear:CN}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:o}=n.getOutput();return qt(()=>yN(e,o.value))}});function SN(e){return!!Dt(e)||!(!j(e)||!e.isShadowRoot())}function cN(e,t,n,o){return!!e.isEditable()&&(n.target===t&&e.read("latest",()=>{let r=Xe().getLastChild();if(r===null)return!1;let s=e.getElementByKey(r.getKey());return s!==null&&(!(n.clientY<=s.getBoundingClientRect().bottom)&&o(r))}))}var TD=me({build:(e,t)=>So(t),config:Be({$shouldInsertAfter:SN,disabled:!1}),name:"@lexical/ClickAfterLastBlock",register:(e,t,n)=>qt(()=>{let o=n.getOutput();if(!o.disabled.value)return e.registerRootListener((r)=>{if(r===null)return;return qr(r,{click:(s)=>{cN(e,r,s,o.$shouldInsertAfter.peek())&&(s.preventDefault(),Xg(s),e.update(()=>{let i=Xe().getLastChild();if(i===null)return;if(!o.$shouldInsertAfter.peek()(i))return;let l=ye();i.insertAfter(l),l.select()}))},mousedown:(s)=>{cN(e,r,s,o.$shouldInsertAfter.peek())&&s.preventDefault()}},!0)})})});function NN(e){let t=new Set,n=new Set;for(let o of EN(e)){let r=typeof o=="function"?o:o.replace;_S(r),t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function EN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var Cp=Go("format",{parse:(e)=>typeof e=="number"?e:0});class Wu extends au{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:au,stateConfigs:[{flat:!0,stateConfig:Cp}]})}getFormat(e){return Lo(this,Cp,e)}getFormatFlags(e,t){return qg(this.getFormat(),e,t)}hasFormat(e){let t=$i[e];return(this.getFormat()&t)!==0}setFormat(e){return Qn(this,Cp,e)}toggleFormat(e){let t=this.getFormat(),n=qg(t,e,null);return this.setFormat(n)}isInline(){return!0}createDOM(e,t){return je().createElement("span")}}function bD(e){return e instanceof Wu}function vD(e,t,n){let o=t.fontWeight,r=t.textDecoration.split(" "),s=o==="700"||o==="bold",i=r.includes("line-through"),l=t.fontStyle==="italic",c=r.includes("underline"),u=t.verticalAlign;return s&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),l&&!e.hasFormat("italic")&&e.toggleFormat("italic"),c&&!e.hasFormat("underline")&&e.toggleFormat("underline"),u!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),u!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function TN(e,t,n=RD){let o=t;for(let[r,s]of Object.entries(n))e.hasFormat(s)&&(o=AD(o,r));return o}var OD=TN;function AD(e,t){let n=e.ownerDocument.createElement(t);return n.appendChild(e),n}var RD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},MD=me({name:"@lexical/extension/DecoratorText",nodes:()=>[Wu]});function vl(e,t){let n;return Zr(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var Uu=me({build:(e)=>vl(()=>e.getEditorState(),(t)=>e.registerUpdateListener((n)=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function et(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var bN;try{bN="0.49.0+prod.esm"}catch(e){}var DD=bN??'"<unknown>+source"',$D=new Set(["__proto__","constructor","prototype"]);function vN(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)!$D.has(r)&&Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=vN(n[r],o[r]));return e}return t}var Mp=0,vp=1,ON=2,yp=3,Fu=4,Pi=5,Sp=6,Tl=7;function Np(e){return e.id===Mp}function AN(e){return e.id===ON}function wD(e){return function(t){return t.id===vp}(e)||et(305,String(e.id),String(vp)),Object.assign(e,{id:ON})}var kD=new Set;class RN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Mp}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Pt;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;AN(t)||et(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},r=function(i,l,c){return Object.assign(i,{config:l,id:yp,registerState:c})}(t,this.mergeConfigs(),n),s;this.state=r,this.extension.init&&(s=this.extension.init(e,r.config,n)),this.state=function(i,l,c){return Object.assign(i,{id:Fu,initResult:l,registerState:c})}(r,s,o)}build(e){let t=this.state,n;t.id!==Fu&&et(307,String(t.id),String(Pi)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let o={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(r,s,i){return Object.assign(r,{id:Pi,output:s,registerState:i})}(t,n,o)}register(e,t){this._signal=t;let n=this.state;n.id!==Pi&&et(308,String(n.id),String(Pi));let o=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(r){return Object.assign(r,{id:Sp})}(n),()=>{let r=this.state;r.id!==Tl&&et(309,String(n.id),String(Tl)),this.state=function(s){return Object.assign(s,{id:Pi})}(r),o&&o()}}afterRegistration(e){let t=this.state,n;return t.id!==Sp&&et(310,String(t.id),String(Sp)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(o){return Object.assign(o,{id:Tl})}(t),n}getSignal(){return this._signal===void 0&&et(311),this._signal}getInitResult(){this.extension.init===void 0&&et(312,this.extension.name);let e=this.state;return function(t){return t.id>=Fu}(e)||et(313,String(e.id),String(Fu)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(t){return t.id>=yp}(e)||et(314,String(e.id),String(yp)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&et(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&et(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(t){return t.id>=Tl}(e)||et(316,String(e.id),String(Tl)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||kD}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(t){return t.id>=Pi})(e)||et(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var uN={tag:Hr};function ID(){let e=Xe();e.isEmpty()&&e.append(ye())}var MN=me({config:Be({setOptions:uN,updateOptions:uN}),init:({$initialEditorState:e=ID})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(Ly(s))e.setEditorState(s,n);else if(typeof s=="function")e.update(()=>{s(e)},t);else if(s&&(typeof s=="string"||typeof s=="object")){let i=e.parseEditorState(s);e.setEditorState(i,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cu,wn,rS,Nu,sS]}),dN=Symbol.for("@lexical/extension/LexicalBuilder");function LD(...e){return fr.fromExtensions(e).buildEditor()}function fN(){}function FD(e){throw e}function Pu(e){return Array.isArray(e)?e:[e]}var Ep=DD;class fr{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Ep,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(e){let t=[Pu(MN)];for(let n of e)t.push(Pu(n));return new fr(t)}static maybeFromEditor(e){let t=e[dN];return t&&(t.PACKAGE_VERSION!==Ep&&et(292,t.PACKAGE_VERSION,Ep),t instanceof fr||et(293)),t}static fromEditor(e){let t=fr.maybeFromEditor(e);return t===void 0&&et(294),t}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...o}=this.buildCreateEditorArgs(),r=Object.assign(Tu({...o,...t?{onError:(s)=>{t(s,r)}}:{},...n?{onWarn:(s)=>{n(s,r)}}:{}}),{[dN]:this});for(let s of this.sortedExtensionReps())s.build(r);return r}buildEditor(){let e=fN;function t(){try{e()}finally{e=fN}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Oe(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&et(295,e.name),t}addEdge(e,t,n){let o=this.outgoingConfigEdges.get(e);o?o.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let r=this.incomingEdges.get(t);r?r.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&et(296);let t=Pu(e),[n]=t;typeof n.name!="string"&&et(297,typeof n.name);let o=this.extensionNameMap.get(n.name);if(o!==void 0&&o.extension!==n&&et(298,n.name),!o){o=new RN(this,n),this.extensionNameMap.set(n.name,o);let r=this.conflicts.get(n.name);typeof r=="string"&&et(299,n.name,r);for(let s of n.conflictsWith||[])this.extensionNameMap.has(s)&&et(299,n.name,s),this.conflicts.set(s,n.name);for(let s of n.dependencies||[]){let i=Pu(s);this.addEdge(n.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of n.peerDependencies||[])this.addEdge(n.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,o)=>{let r=n.state;if(AN(r))return;let s=n.extension.name;var i;Np(r)||et(300,s,o||"[unknown]"),Np(i=r)||et(304,String(i.id),String(Mp)),r=Object.assign(i,{id:vp}),n.state=r;let l=this.outgoingConfigEdges.get(s);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&t(u,s)}r=wD(r),n.state=r,e.push(n)};for(let n of this.extensionNameMap.values())Np(n.state)&&t(n);for(let n of e)for(let[o,r]of this.outgoingConfigEdges.get(n.extension.name)||[])if(r.length>0){let s=this.extensionNameMap.get(o);if(s)for(let i of r)s.configs.add(i)}for(let[n,...o]of this.roots)if(o.length>0){let r=this.extensionNameMap.get(n.name);r===void 0&&et(301,n.name);for(let s of o)r.configs.add(s)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,o=[()=>n.abort()],r=n.signal;for(let s of t){let i=s.register(e,r);i&&o.push(i)}for(let s of t){let i=s.afterRegistration(e);i&&o.push(i)}return Oe(...o)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,o=new Map,r={},s={},i=this.sortedExtensionReps();for(let u of i){let{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.onWarn!==void 0&&(e.onWarn=d.onWarn),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(let f of EN(d)){if(typeof f!="function"){let p=n.get(f.replace);p&&et(302,d.name,f.replace.name,p.extension.name),n.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(let[f,p]of d.html.export.entries())o.set(f,p);d.html.import&&Object.assign(r,d.html.import)}d.theme&&vN(s,d.theme)}Object.keys(s).length>0&&(e.theme=s),t.size&&(e.nodes=[...t]);let l=Object.keys(r).length>0,c=o.size>0;(l||c)&&(e.html={},l&&(e.html.import=r),c&&(e.html.export=o));for(let u of i)u.init(e);return e.onError||(e.onError=FD),e}}function DN(e,t){let n=fr.fromEditor(e).getExtensionRep(t);return n===void 0&&et(303,t.name),n.getExtensionDependency()}function Dp(e,t){let n=fr.maybeFromEditor(e);if(!n)return;let o=n.extensionNameMap.get(t);return o?o.getExtensionDependency():void 0}function PD(e,t){let n=Dp(e,t);return n===void 0&&et(291,t),n}function $N(e){return DN(Ke(),e)}function BD(e){return $N(e).output}function KD(e){return Dp(Ke(),e)}var zD=new Set,Op=me({build(e,t,n){let o=n.getDependency(Uu).output,r=Zr({watchedNodeKeys:new Map}),s=vl(()=>{},()=>qt(()=>{let i=s.peek(),{watchedNodeKeys:l}=r.value,c,u=!1;o.value.read(()=>{if(K())for(let[d,f]of l.entries()){if(f.size===0){l.delete(d);continue}let p=Ot(d),h=p&&p.isSelected()||!1;u=u||h!==(!!i&&i.has(d)),h&&(c=c||new Set,c.add(d))}}),!u&&c&&i&&c.size===i.size||(s.value=c)}));return{watchNodeKey:function(i){let l=_N(()=>(s.value||zD).has(i)),{watchedNodeKeys:c}=r.peek(),u=c.get(i),d=u!==void 0;return u=u||new Set,u.add(l),d||(c.set(i,u),r.value={watchedNodeKeys:c}),l}}},dependencies:[Uu],name:"@lexical/extension/NodeSelection"}),wN=Sn("INSERT_HORIZONTAL_RULE_COMMAND");class Ki extends au{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:UD,priority:0})}})}exportDOM(){return{element:je().createElement("hr")}}createDOM(e){let t=je().createElement("hr");return Qe(t,e.theme.hr),t}getTextContent(){return`
|
|
15
|
+
`}isInline(){return!1}updateDOM(){return!1}}function UD(){return{node:$p()}}function $p(){return Gc(Ki)}function kN(e){return e instanceof Ki}var HD=me({dependencies:[Uu,Op],name:"@lexical/extension/HorizontalRule",nodes:()=>[Ki],register(e,t,n){let{watchNodeKey:o}=n.getDependency(Op).output,r=Zr({nodeSelections:new Map}),s=e._config.theme.hrSelected??"selected";return Oe(e.registerCommand(wN,(i)=>{let l=K();if(!I(l))return!1;if(l.focus.getNode()!==null){let c=$p();Lu(c)}return!0},Ee),e.registerCommand(yi,(i)=>{if(oo(i.target)){let l=Iy(i.target);if(kN(l))return function(c,u=!1){let d=K(),f=c.isSelected(),p=c.getKey(),h;u&&Je(d)?h=d:(h=jc(),pt(h)),f?h.delete(p):h.add(p)}(l,i.shiftKey),!0}return!1},we),e.registerMutationListener(Ki,(i,l)=>{pN(()=>{let c=!1,{nodeSelections:u}=r.peek();for(let[d,f]of i.entries())if(f==="destroyed")u.delete(d),c=!0;else{let p=u.get(d),h=e.getElementByKey(d);p?p.domNode.value=h:(c=!0,u.set(d,{domNode:Zr(h),selectedSignal:o(d)}))}c&&(r.value={nodeSelections:u})})}),qt(()=>{let i=[];for(let{domNode:l,selectedSignal:c}of r.value.nodeSelections.values())i.push(qt(()=>{let u=l.value;if(u)c.value?Qe(u,s):nn(u,s)}));return Oe(...i)}))}}),WD=me({build:(e)=>({composingTextNode:Zr(null),compositionKey:Zr(null)}),name:"@lexical/extension/IME",register(e,t,n){let{compositionKey:o,composingTextNode:r}=n.getOutput(),s=e.registerCommand(Vy,()=>{let u=K();return I(u)&&(o.value=u.anchor.key),!1},Qc),i=qt(()=>{let u=o.value;r.value=u!==null?e.read("latest",()=>{let d=Ot(u);return ne(d)?d:null}):null}),l=e.registerUpdateListener(({tags:u,editorState:d})=>{u.has(tu)&&d.read(()=>{let f=K();if(!I(f))return;let p=f.anchor.getNode();ne(p)&&(r.value=p)})}),c=e.registerRootListener((u)=>{if(u===null)return void(o.value=null);return ro(u,"compositionend",()=>{o.value=null})});return Oe(s,i,l,c)}}),GD=me({build:(e,t)=>So({inheritEditableFromParent:t.inheritEditableFromParent}),config:Be({$getParentEditor:function(){let e=Ke();return fr.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,t,n)=>{let o=t.$getParentEditor();e.parentEditor=o,e.theme=e.theme||o._config.theme},name:"@lexical/extension/NestedEditor",register:(e,t,n)=>qt(()=>{let o=e._parentEditor;if(o&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(o.isEditable()),o.registerEditableListener(e.setEditable.bind(e))})}),jD=me({config:Be({attribute:"data-selected",nodes:[]}),init(e,t){let n=new Set,o=Ou(NN(e).nodes);for(let r of t.nodes){let s=r.getType(),i=o.get(s);i===void 0&&et(339,r.name,s),n.add(s);for(let l of i)n.add(l)}return{matchTypes:n}},mergeConfig:(e,t)=>Pt(e,{...t,...t.nodes&&{nodes:[...e.nodes,...t.nodes]}}),name:"@lexical/extension/NodeSelectionDataSelected",register(e,t,n){let{attribute:o}=t,{matchTypes:r}=n.getInitResult(),s=new Map,i=(c)=>{let u=new Set;c.read(()=>{let d=K();if(Je(d))for(let f of d.getNodes())r.has(f.getType())&&u.add(f.getKey())});for(let[d,f]of s)u.has(d)||(f.removeAttribute(o),s.delete(d));for(let d of u){let f=e.getElementByKey(d);f!==null&&(f.setAttribute(o,"true"),s.set(d,f))}};i(e.getEditorState());let l=e.registerUpdateListener(({editorState:c})=>i(c));return()=>{l();for(let c of s.values())c.removeAttribute(o);s.clear()}}});function gN(e){j(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var YD=me({build:(e,t,n)=>So(t),config:Be({disabled:!1}),name:"@lexical/NormalizeInlineElements",register:(e,t,n)=>{let o=n.getOutput();return qt(()=>{if(!o.disabled.value){let r=[];for(let{klass:s,transforms:i}of e._nodes.values())s.prototype instanceof lt&&s.prototype.isInline!==lt.prototype.isInline&&(i.add(gN),r.push(()=>i.delete(gN)));return()=>r.forEach((s)=>s())}})}}),VD=new Set([Su,cS]),XD=me({build:(e,t,n)=>So(t),config:Be({$fixFocusOverselection:function(){let e=K();if(I(e)&&!e.isCollapsed()){let t=cr(ar(e),"next"),n=t.focus;for(zr(n)&&t.anchor.origin!==n.origin&&n.offset===0&&(n=Ko(n.getSiblingCaret())),Co(n)&&t.anchor.origin!==n.origin&&Pe(n.origin)&&(n=Ko(n));Fo(n)&&t.anchor.origin!==n.origin;)n=Ko(it(n.origin,"next"));if(Co(n)&&j(n.origin)&&(n=$t(Et(n.origin,"previous")).getFlipped()),n=$t(n),!n.isSamePointCaret(t.focus)){let o=Rn(qn(t.anchor,n)),r=Ke().getRootElement(),s=r&&kn(r.ownerDocument.defaultView);s&&Wy(Cn(),o,Ke(),s,VD,r)}}},dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:(e,t,n)=>qt(()=>{let o=n.getOutput();if(!o.disabled.value)return e.registerRootListener((r)=>{if(!r)return;let s=0,i=(l)=>{if(l?l.detail===3:s>0){let c=o.dateNow.peek()();s=l&&l.type==="mousedown"||c-s<=o.thresholdMsec.peek()?c:0}return s};return Oe(e.registerCommand(no,()=>(i(null)&&(s=0,o.$fixFocusOverselection.peek()()),!1),Yy),qr(r,{mousedown:i,mouseup:i},!0))})})});function qD(e){let t=e.target;yS(e,"a",{ctrlKey:!dl,metaKey:dl})&&Ce(t)&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA")&&t.addEventListener("keydown",Xg,{once:!0})}var Ap=me({build:(e,t,n)=>So(t),config:Be({disabled:!1}),name:"@lexical/extension/PreventSelectAll",register:(e,t,n)=>{let o=n.getOutput();return qt(()=>{if(!o.disabled.value)return e.registerRootListener((r)=>{if(r)return ro(r,"keydown",qD,!0)})})}}),JD=me({build:(e)=>vl(()=>e.getRootElement(),(t)=>e.registerRootListener((n)=>{t.value=n})),name:"@lexical/extension/RootElement"}),ZD=me({build:(e,t,n)=>So(t),config:Be({cascadeSelection:!1,disabled:!1}),dependencies:[Ap],name:"@lexical/extension/SelectBlock",register:(e,t,n)=>{let o=n.getOutput(),r=n.getDependency(Ap).output;return Oe(qt(()=>{r.disabled.value=o.disabled.value}),qt(()=>{if(!o.disabled.value)return e.registerCommand(Di,(s,i)=>{if(i!==e){if(!o.cascadeSelection.peek())return!1;return!!i.read("pending",()=>{let p=K();return I(p)&&El(Xe(),p)})&&(Ur(),!0)}let l=K();if(Je(l)){let p=l.getNodes(),h=p[0];if(!h)return!1;let m=h.getTopLevelElement();return!m||xo(m)||m.is(h)||p.length>1&&(c=m,!p.every((_)=>c.is(_.getTopLevelElement())))?Ur():j(m)&&m.select(0,m.getChildrenSize()),!0}var c;if(!I(l))return!1;let u=l.anchor.getNode(),d=u.getTopLevelElement();if(d&&d.is(l.focus.getNode().getTopLevelElement())&&!El(d,l))return d.select(0,d.getChildrenSize()),!0;let f=Jn(u);for(;f!==null;){if(j(f)&&!El(f,l))return f.select(0,f.getChildrenSize()),!0;let p=Yc(f);f=p===null?null:Jn(p)}return El(Xe(),l)||Ur(),!0},we)}))}}),QD=me({build:(e,t,n)=>So(t),config:Be({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,t,n)=>{let o=n.getOutput();return qt(()=>{if(!o.disabled.value)return iN(e,o.onReposition.value)})}});function IN(e){return e.canIndent()}function LN(e,t,n=IN){return Oe(e.registerCommand(jr,(o)=>{let r=K();if(!I(r))return!1;o.preventDefault();let s=function(i){if(i.getNodes().filter((p)=>Kr(p)&&p.canIndent()).length>0)return!0;let{anchor:l,focus:c}=i,u=c.isBefore(l)?c:l,d=u.getNode(),f=ku(d);if(f.canIndent()){let p=f.getKey(),h=Pr();if(h.anchor.set(p,0,"element"),h.focus.set(p,0,"element"),h=Po(h),h.anchor.is(u))return!0}return!1}(r)?o.shiftKey?Wo:eo:Ds;return e.dispatchCommand(s)},Ee),e.registerCommand(eo,()=>{let o=typeof t=="number"?t:t?t.peek():null,r=K();if(!I(r))return!1;let s=typeof n=="function"?n:n.peek();return Nl((i)=>{if(s(i)){let l=i.getIndent()+1;(!o||l<o)&&i.setIndent(l)}})},Si))}var e$=me({build:(e,t,n)=>So(t),config:Be({$canIndent:IN,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:o,maxIndent:r,$canIndent:s}=n.getOutput();return qt(()=>{if(!o.value)return LN(e,r,s)})}}),t$=me({build:(e)=>vl(()=>e.isEditable(),(t)=>e.registerEditableListener((n)=>{t.value=n})),name:"@lexical/extension/WatchEditable"});var Se=wp,{$applyFormatToDom:IP,$createHorizontalRuleNode:Gu,$defaultShouldInsertAfter:LP,$getExtensionDependency:FP,$getExtensionOutput:FN,$getPeerDependency:PN,$isDecoratorTextNode:PP,$isHorizontalRuleNode:BN,AutoFocusExtension:BP,ClearEditorExtension:KP,ClickAfterLastBlockExtension:zP,DecoratorTextExtension:UP,DecoratorTextNode:HP,EditorStateExtension:WP,HorizontalRuleExtension:KN,HorizontalRuleNode:ju,IMEExtension:GP,INSERT_HORIZONTAL_RULE_COMMAND:jP,InitialStateExtension:YP,LexicalBuilder:zN,NestedEditorExtension:VP,NodeSelectionDataSelectedExtension:XP,NodeSelectionExtension:qP,NormalizeInlineElementsExtension:UN,NormalizeTripleClickSelectionExtension:HN,PreventSelectAllExtension:JP,RootElementExtension:ZP,SelectBlockExtension:QP,SelectionAlwaysOnDisplayExtension:eB,TabIndentationExtension:tB,WatchEditableExtension:nB,applyFormatFromStyle:oB,applyFormatToDom:rB,batch:kp,buildEditorFromExtensions:sB,computed:iB,configExtension:WN,declarePeerDependency:aB,defineExtension:lB,effect:yt,getExtensionDependencyFromEditor:cB,getKnownTypesAndNodes:GN,getPeerDependencyFromEditor:so,getPeerDependencyFromEditorOrThrow:uB,namedSignals:Mt,registerClearEditor:dB,registerTabIndentation:Yu,safeCast:fB,shallowMergeConfig:gB,signal:Ks,untracked:pB,watchedSignal:jN}=Se;var n$=me({name:"@lexical/react/ReactProvider"});var o$=Ip,YN=o$.ReactProviderExtension;function VN(){return Xe().getTextContent()}function Lp(e,t=!0){if(e)return!1;let n=VN();return t&&(n=n.trim()),n===""}function r$(e,t){return()=>Lp(e,t)}function XN(e){if(!Lp(e,!1))return!1;let t=Xe().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(Dt(r))return!1;if(j(r)){if(!An(r))return!1;if(r.__indent!==0)return!1;let s=r.getChildren(),i=s.length;for(let l=0;l<i;l++){let c=s[o];if(!ne(c))return!1}}}return!0}function s$(e){return()=>XN(e)}function i$(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(j(n)){let i=n.getFirstChild();if(i!==null){n=i;continue}}else if(ne(n)){let i=n.getTextContentSize();if(o+i>t)return{node:n,offset:t-o};o+=i}let r=n.getNextSibling();if(r!==null){n=r;continue}let s=n.getParent();for(;s!==null;){let i=s.getNextSibling();if(i!==null){n=i;continue e}s=s.getParent()}break}return null}function a$(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l$(e,t,n,o){let r=(i)=>i instanceof n,s=(i)=>{let l=xt(i.getTextContent());l.setFormat(i.getFormat()),i.replace(l)};return[e.registerNodeTransform(wn,(i)=>{if(!i.isSimpleText())return;let l,c=i.getPreviousSibling(),u=i.getTextContent(),d=i;if(ne(c)){let p=c.getTextContent(),h=t(p+u);if(r(c)){if(h===null||((m)=>m.getLatest().__mode)(c)!==0)return void s(c);{let m=h.end-p.length;if(m>0){let _=p+u.slice(0,m);if(c.select(),c.setTextContent(_),m===u.length)i.remove();else{let x=u.slice(m);i.setTextContent(x)}return}}}else if(h===null||h.start<p.length)return}let f=0;for(;;){l=t(u);let p,h=l===null?"":u.slice(l.end);if(u=h,h===""){let _=d.getNextSibling();if(ne(_)){h=d.getTextContent()+_.getTextContent();let x=t(h);if(x===null)return void(r(_)?s(_):_.markDirty());if(x.start!==0)return}}if(l===null)return;if(l.start===0&&ne(c)&&c.isTextEntity()){f+=l.end;continue}l.start===0?[p,d]=d.splitText(l.end):[,p,d]=d.splitText(l.start+f,l.end+f),p===void 0&&a$(165,"nodeToReplace");let m=o(p);if(m.setFormat(p.getFormat()),p.replace(m),d==null)return;f=0,c=m}}),e.registerNodeTransform(n,(i)=>{let l=i.getTextContent(),c=t(l);if(c===null||c.start!==0)return void s(i);if(l.length>c.end)return void i.splitText(c.end);let u=i.getPreviousSibling();ne(u)&&u.isTextEntity()&&(s(u),s(i));let d=i.getNextSibling();ne(d)&&d.isTextEntity()&&(s(d),r(i)&&s(i))})]}var zs=Fp,{$canShowPlaceholder:CB,$canShowPlaceholderCurry:Vu,$findTextIntersectionFromCharacters:yB,$isRootTextContentEmpty:SB,$isRootTextContentEmptyCurry:NB,$rootTextContent:EB,registerLexicalTextEntity:TB}=zs;var c$={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Xu=Symbol.for("@lexical/dragon/WindowState");function u$(e=function(){return typeof window<"u"?window:void 0}()){return e?JN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function JN(e,t,n){let o=function(r){let s=r[Xu];return s===void 0&&(s={dispose:()=>{},editors:new Map,installs:new Set},r[Xu]=s),s}(e);if(o.installs.size===0){let r=f$.bind(e);e.addEventListener("message",r,!0),o.dispose=()=>{e.removeEventListener("message",r,!0)}}if(o.installs.add(t),n){let r=o.editors.get(n)||new Set;r.add(t),o.editors.set(n,r)}return d$.bind(null,e,o,t,n)}function d$(e,t,n,o){if(o){let r=t.editors.get(o);r&&r.delete(n)&&r.size===0&&t.editors.delete(o)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[Xu])}function qN(e){return e&&e.ownerDocument.defaultView}function ZN(e){let t=jN(()=>qN(e.getRootElement()),(n)=>e.registerRootListener((o)=>{n.value=qN(o)}));return yt(()=>{let n=t.value;if(n)return JN(n,Symbol("@lexical/dragon/editorInstall"),e)})}function f$(e){if(e.origin!==this.location.origin)return;let t=function(o){let r=o[Xu];if(r===void 0)return null;let s=bu(gS(o.document));return Ru(s)&&r.editors.has(s)?s:null}(this);if(t===null)return;let n=e.data;if(typeof n=="string"){let o;try{o=JSON.parse(n)}catch(r){return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){let r=o.payload;if(r&&r.functionId==="makeChanges"){let s=r.args;if(Array.isArray(s)){let[i,l,c,u,d,f]=s;if(![i,l,u,d].every(Number.isFinite)||typeof c!="string"&&c!==-1)return;t.update(()=>{let p=K();if(I(p)){let h=p.anchor,m=h.getNode(),_=0,x=0;if(ne(m)&&i>=0&&l>=0&&(_=i,x=i+l,p.setTextNodeRange(m,_,m,x)),typeof c!="string"||_===x&&c===""||(p.insertRawText(c),m=h.getNode()),ne(m)){let C=m.getTextContentSize();_=Math.min(Math.max(u,0),C),x=u<0||d<0?_:Math.min(u+d,C),p.setTextNodeRange(m,_,m,x)}if(typeof f=="string"&&d>0&&!p.isCollapsed()){let C=c$[f];C!==void 0&&p.formatText(C)}e.stopImmediatePropagation()}})}}}}}var g$=me({build:(e,t,n)=>Mt(t),config:Be({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,t,n)=>yt(()=>n.getOutput().disabled.value?void 0:ZN(e))});var Bp=Pp,{DragonExtension:QN,installDragonSupport:AB,registerDragonSupport:eE}=Bp;function Us(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Ui;function Qr(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Gp(e){return Ui&&Ui.editor===e?Ui:void 0}function Zu(e,t){let n=Gp(t);return n&&n[e]}function p$(e,t){if("cfg"in t){let{cfg:n,updater:o}=t;return[n,o(Qr(e,n))]}return t}function qu(e,t){let n=t;for(let o of e){let[r,s]=p$(n,o),i=r.key;if(n===t&&Qr(n,r)===s)continue;let l=n===t||n===void 0?h$(t):n;l[i]=s,n=l}return n}function h$(e){return Object.create(e||null)}function Ol(e,t){return[e,t]}function m$(e,t){return{cfg:e,updater:t}}function dE(e,t,n,o=Ke()){let r=Ui,s=Gp(o);try{return Ui={...s,editor:o,[e]:t},n()}finally{Ui=r}}function fE(e,t=()=>{}){return(n,o=Ke())=>(r)=>{let s=Gp(o),i=s&&s[e],l=qu(n,i||t(o));return l&&l!==i?dE(e,l,r,o):r()}}function gE(e,t,n,o){return Object.assign(Go(Symbol(t),{isEqual:o,parse:n}),{[e]:!0})}var pE=(e,t,n)=>{hE(e),n()};function hE(e){if(!Xr(e))return;let t=e;if(t.querySelector("style")===null)return;let n=new Map;function o(r){let s=n.get(r);if(s===void 0){s=new Set;for(let i=0;i<r.style.length;i++)s.add(r.style[i]);n.set(r,s)}return s}try{for(let r of Array.from(t.styleSheets)){let s;try{s=r.cssRules}catch(i){continue}for(let i of Array.from(s)){if(!In(i,CSSStyleRule))continue;let l;try{l=t.querySelectorAll(i.selectorText)}catch(c){continue}for(let c of Array.from(l)){if(!Ce(c))continue;let u=o(c);for(let d=0;d<i.style.length;d++){let f=i.style[d];u.has(f)||c.style.setProperty(f,i.style.getPropertyValue(f),i.style.getPropertyPriority(f))}}}}}catch(r){}}var jp="@lexical/html/DOM",Qu=Symbol.for("@lexical/html/DOMExportContext"),mE="@lexical/html/DOMImport",Al=Symbol.for("@lexical/html/DOMImportContext"),_$=()=>!0;function Yp(e,t,n){return gE(Qu,e,t,n)}var _E=Yp("root",Boolean),Vp=Yp("isExport",Boolean);function xE(e){let t=so(e,jp);return t?t.output.defaults:void 0}function x$(e,t=Ke()){return Qr(function(n){return Zu(Qu,n)||xE(n)}(t),e)}function Xp(e){let t=so(e,jp);return t?t.output.runtime:void 0}function C$(e,t,n=Ke()){let o=Xp(n);o&&o.setContextValue(e,t)}function y$(e,t,n=Ke()){let o=Xp(n);o&&o.setContextValue(e,t(Qr(o.editorContext,e)))}function ed(e=Ke()){let t=Xp(e);return t?t.getSessionConfig():Kg(e)}var qp=fE(Qu,xE);function S$(e,t,n){return{...t,...n,nodes:e}}function N$(e){return(t)=>t instanceof e}function E$(e,{nodes:t}){if(t==="*")return _$;let n={},o=[];for(let r of t)if("getType"in r){let s=r.getType();if(n){let i=e.get(s);i===void 0&&Us(339,r.name,s);for(let l of i)n[l]=!0}o.push(N$(r))}else n=void 0,o.push(r);return n||(o.length===1?o[0]:(r)=>{for(let s of o)if(s(r))return!0;return!1})}function tE(e){return(t,n,o)=>e(t,o)}function Kp(e){return(t,n,o,r)=>e(t,n,r)}function nE(e){return(t,n,o,r,s)=>e(t,n,o,s)}function T$(e){return(t,n,o,r,s,i)=>e(t,n,o,r,i)}function oE(e,t){return(n,o)=>{let r=()=>e(n,o),s=t(n);return s?s(n,r,o):r()}}function zp(e,t){return(n,o,r)=>{let s=()=>e(n,o,r),i=t(n);return i?i(n,o,s,r):s()}}var b$=zp,v$=Kp;function rE(e,t){return(n,o,r,s)=>{let i=()=>e(n,o,r,s),l=t(n);return l?l(n,o,r,i,s):i()}}function O$(e,t){return(n,o,r,s,i)=>{let l=()=>e(n,o,r,s,i),c=t(n);return c?c(n,o,r,s,l,i):l()}}function A$(e,t){return(n,o,r,s)=>{e(n,o,r,s);let i=t(n);i&&i(n,o,r,s)}}function gr(e,t,n,o,r){let s=n[t];for(let i of e[t])if(typeof i[0]=="function"){let[l,c]=i;s=o(s,(u)=>l(u)&&c||void 0)}else{let l=i[1],c={};for(let u in l){let d=l[u];d&&(c[u]=d.reduce((f,p)=>o(f,()=>p),s))}s=o(s,(u)=>{let d=c[u.getType()];return d&&r(d)})}n[t]=s}function R$(e,t,n,o){if(!o)return;let r=e[t];if(typeof n=="function")r.push([n,o]);else{let s=r[r.length-1],i;s&&s[0]==="types"?i=s[1]:(i={},r.push(["types",i]));for(let l in n){let c=i[l]||[];i[l]=c,c.push(o)}}}function M$(e){return e.nodes==="*"}function D$(e,t){let n=Ou(GN(e).nodes),o={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let r of function(s){let i=[],l=[],c=[];for(let f of s)if(M$(f))i.push(f);else if(Array.isArray(f.nodes))for(let p of f.nodes)Ug(p.prototype)?c.push(f.nodes.length===1?f:{...f,nodes:[p]}):l.push(f.nodes.length===1?f:{...f,nodes:[p]});let u=new Map,d=(f)=>{let p=u.get(f);if(p===void 0){p=-1;for(let h of bS(f))p++;u.set(f,p)}return p};return c.sort((f,p)=>d(f.nodes[0])-d(p.nodes[0])),[...c,...l,...i]}(t)){let s=E$(n,r);for(let i in o)R$(o,i,s,r[i])}return o}function $$(e){return e}function Up(e,{overrides:t}){let n=D$(e,t),o={...Wg,...e.dom};return gr(n,"$createDOM",o,oE,tE),gr(n,"$exportDOM",o,oE,tE),gr(n,"$extractWithChild",o,O$,T$),gr(n,"$getDOMSlot",o,b$,v$),gr(n,"$shouldExclude",o,zp,Kp),gr(n,"$shouldInclude",o,zp,Kp),gr(n,"$getSlotTargetElement",o,rE,nE),gr(n,"$updateDOM",o,rE,nE),gr(n,"$decorateDOM",o,A$,$$),o}function CE(e){return{get:(t)=>Qr(e,t)}}function sE(e){let t=Object.create(null);return qu(e,t)||t}function Hp(e,t){let n=CE(t);return e.filter((o)=>!(o.disabledForEditor&&o.disabledForEditor(n)))}function w$(e){if(e.nodes==="*")return()=>!0;let t=e.nodes.map((n)=>{let o=n;return Ug(o.prototype)?(r)=>r instanceof o:n});return(n)=>t.some((o)=>o(n))}class yE{editor;initialEditorConfig;overrides;editorContext;hasSessionGates;installed;sessionCache=new Map;constructor(e,t,n,o){this.editor=e,this.initialEditorConfig=t,this.overrides=n,this.editorContext=o,this.installed=Hp(n,o),this.hasSessionGates=n.some((r)=>r.disabledForSession)}setContextValue(e,t){let n=this.installed;this.editorContext[e.key]=t;let o=Hp(this.overrides,this.editorContext);if(function(c,u){if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==u[d])return!1;return!0}(n,o))return;let r=function(c,u){let d=new Set(c),f=new Set(u),p=[];for(let h of c)f.has(h)||p.push(h);for(let h of u)d.has(h)||p.push(h);return p}(n,o);this.installed=o,this.sessionCache.clear();let s=Up(this.initialEditorConfig,{overrides:o});this.editor._config.dom=s;let i=function(c){let u=[];for(let d of c)(d.$createDOM||d.$getDOMSlot||d.$decorateDOM)&&u.push(w$(d));return u.length===0?null:(d)=>u.some((f)=>f(d))}(r);if(!i)return;let l=s.$updateDOM;s.$updateDOM=(c,u,d,f)=>!!i(c)||l(c,u,d,f),this.editor.update(_i,{discrete:!0}),s.$updateDOM=l}getSessionConfig(){let e=this.editor._config.dom||Wg;if(!this.hasSessionGates)return e;let t=CE(Zu(Qu,this.editor)||this.editorContext),n=[],o=[];if(this.installed.forEach((i,l)=>{i.disabledForSession&&i.disabledForSession(t)?n.push(String(l)):o.push(i)}),n.length===0)return e;let r=n.join(","),s=this.sessionCache.get(r);return s||(s=Up(this.initialEditorConfig,{overrides:o}),this.sessionCache.set(r,s)),s}}var k$=me({build(e,t,n){let{initialEditorConfig:o}=n.getInitResult(),r=sE(t.contextDefaults);return{defaults:r,runtime:new yE(e,o,t.overrides,r)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Cu,()=>{let e=je().createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){let n={dom:e.dom,nodes:e.nodes},o=sE(t.contextDefaults),r=Hp(t.overrides,o);return e.dom=Up(e,{overrides:r}),{initialEditorConfig:n}},mergeConfig(e,t){let n=Pt(e,t);for(let o of["overrides","contextDefaults"])t[o]&&(n[o]=[...e[o],...t[o]]);return n},name:jp}),td=Symbol.for("@lexical/html/SelectorImpl");function Rl(e,t){let n={kind:"element",predicate:(o=t,o.length===0?Ce:o.length===1?o[0]:(s,i)=>{for(let l of o)if(!l(s,i))return!1;return!0}),tags:e};var o;let r=(s)=>Rl(e,[...t,s]);return{[td]:n,attr:(s,i,l)=>r(Wp(s,i,l)),classAll:(...s)=>r(NE(s)),classAny:(...s)=>r(function(i){let l=SE(i);if(l.length===0)return()=>!1;return(c)=>{if(!Ce(c))return!1;let u=c.classList;for(let d of l)if(u.contains(d))return!0;return!1}}(s)),styleAny:(s,i,l)=>r(function(c,u,d){if(typeof u=="string")return(f)=>Ce(f)&&f.style.getPropertyValue(c)===u;if(u instanceof RegExp){let f=d&&d.capture,p=u;return(h,m)=>{if(!Ce(h))return!1;let _=h.style.getPropertyValue(c);if(!_)return!1;let x=_.match(p);return x!==null&&(f!==void 0&&(m[f]=x),!0)}}Us(362,JSON.stringify(c))}(s,i,l))}}function SE(e){let t=[];for(let n of e)n&&t.push(n);return t}function NE(e){let t=SE(e);return t.length===0?()=>!0:(n)=>{if(!Ce(n))return!1;let o=n.classList;for(let r of t)if(!o.contains(r))return!1;return!0}}function Wp(e,t,n){if(t===!0)return(o)=>Ce(o)&&o.hasAttribute(e);if(typeof t=="string")return(o)=>Ce(o)&&o.getAttribute(e)===t;if(t instanceof RegExp){let o=n&&n.capture,r=t;return(s,i)=>{if(!Ce(s))return!1;let l=s.getAttribute(e);if(l==null)return!1;let c=l.match(r);return c!==null&&(o!==void 0&&(i[o]=c),!0)}}Us(361,JSON.stringify(e))}var I$={kind:"text",predicate:Ls,tags:new Set},L$={[td]:I$},F$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},P$={[td]:F$},zi={any:()=>Rl(new Set,[]),comment:()=>P$,tag(...e){e.length>0||Us(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return Rl(t,[])},text:()=>L$};function B$(e,t){return Ce(e)&&e.nodeName===t.toUpperCase()}var EE=/[A-Za-z0-9_-]/;class TE{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&EE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e==='"'||e==="'","expected quote");let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,"$1")}assert(e,t){e||Us(364,String(this.pos+1),t,this.source)}}function K$(e){let t=new Set,n=[],o=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(EE.test(e.peek())){let r=e.readIdent();r&&t.add(r.toUpperCase())}for(;!e.eof();){let r=e.peek();if(r==="."){e.consume();let s=e.readIdent();e.assert(s!=="",'expected class name after "."'),o.push(s)}else if(r==="#"){e.consume();let s=e.readIdent();e.assert(s!=="",'expected id after "#"'),n.push(Wp("id",s))}else{if(r!=="[")break;{e.consume(),e.skipWhitespace();let s=e.readIdent();e.assert(s!=="",'expected attribute name after "["'),e.skipWhitespace();let i=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let l=e.peek();l==='"'||l==="'"?i=e.readQuoted():(i=e.readIdent(),e.assert(i!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),n.push(Wp(s,i))}}}return o.length>0&&n.push(NE(o)),{predicates:n,tags:t}}function bE(e){let t=new TE(e,0),n=[];for(;;){let r=K$(t);if(n.push(r),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===",",'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace()}if(n.length===1)return Rl(n[0].tags,n[0].predicates);let o=new Set;if(n.every((r)=>r.tags.size>0))for(let r of n)for(let s of r.tags)o.add(s);return Rl(o,[(r,s)=>{for(let i of n){let l=r.nodeName;if(i.tags.size>0&&!i.tags.has(l))continue;let c=!0;for(let u of i.predicates)if(!u(r,s)){c=!1;break}if(c)return!0}return!1}])}function pr(e){return e}function Hs(e,t,n){return gE(Al,e,t,n)}var z$=Hs("importSource",()=>"unknown"),U$=Hs("importSourceDataTransfer",()=>null),Ju=Hs("textFormat",()=>0),vE=Hs("textStyle",()=>({}));function OE(e){if(!Ce(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function AE(e){if(Ls(e))return!0;if(!Ce(e))return!1;let t=e.style.display;return t?t.startsWith("inline"):!Is(e)&&ki(e)}var RE=Hs("whitespaceConfig",()=>({isInline:AE,preservesWhitespace:OE})),ME=Hs("importOverlays",()=>[]);class DE{constructor(e){this.record=e}get(e){return Qr(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(Qr(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function $E(e){let t=so(e,mE);return t?t.output.defaults:void 0}function wE(e,t=Ke()){return Qr(function(n){return Zu(Al,n)||$E(n)}(t),e)}var Jp=fE(Al,$E);function Hi(e){return Kr(e)||Dt(e)&&!e.isInline()}function kE(e,t){let n=[],o=[],r=()=>{o.length!==0&&(n.push(t().splice(0,0,o)),o=[])};for(let s of e)if(Hi(s)){if(r(),j(s)){let i=kE(s.getChildren(),t);s.splice(0,s.getChildrenSize(),i)}n.push(s)}else o.push(s);return r(),n}function IE(e,t){if(!Ce(t))return e;let n=t.style.textAlign;if(!Zp(n))return e;for(let o of e)Kr(o)&&o.getFormatType()===""&&o.setFormat(n);return e}function LE(e,t,n){e.length===1&&Pe(e[0])&&(e=[]);let o=ye();if(Ce(n)){let r=n.style.textAlign;Zp(r)&&o.setFormat(r)}return[o.splice(0,0,e)]}var FE={$accepts:Hi,$packageRun:LE,name:"BlockSchema"},H$={$accepts:(e)=>!Hi(e),name:"InlineSchema"},W$={$accepts:Hi,$packageRun:(e)=>e,name:"NestedBlockSchema"},PE={$accepts:Hi,$packageRun:LE,name:"RootSchema"},Ws=zi,G$=new Set(["center","end","justify","left","right","start"]);function Zp(e){return G$.has(e)}var j$={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},Y$={CODE:nS,MARK:oS},V$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),X$=pr({$import:(e,t)=>{let n=e.get(Ju),o=j$[t.nodeName],r=function(p){return{fontStyle:p.style.fontStyle,fontWeight:p.style.fontWeight,textDecoration:p.style.textDecoration,verticalAlign:p.style.verticalAlign}}(t),s=o?(i=o,{fontStyle:(l=r).fontStyle||i.fontStyle,fontWeight:l.fontWeight||i.fontWeight,textDecoration:l.textDecoration||i.textDecoration,verticalAlign:l.verticalAlign||i.verticalAlign}):r;var i,l;let c=(u=n,d=function(p){let h=0,m=0,{fontWeight:_,fontStyle:x,textDecoration:C,verticalAlign:y}=p;if(_==="700"||_==="bold"?h|=fl:_!=="normal"&&_!=="400"||(m|=fl),x==="italic"?h|=pl:x==="normal"&&(m|=pl),C){let N=C.split(" ");N.includes("underline")&&(h|=ml),N.includes("line-through")&&(h|=hl),N.includes("none")&&(m|=ml|hl)}return y==="sub"?(h|=gu,m|=pu):y==="super"?(h|=pu,m|=gu):y==="baseline"&&(m|=gu|pu),{clear:m,set:h}}(s),u&~d.clear|d.set);var u,d;let f=Y$[t.nodeName];return f&&(c|=f),c===n?e.$importChildren(t):e.$importChildren(t,{context:[Ol(Ju,c)]})},match:Ws.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function iE(e,t,n){let o=e;for(;;){let r=null;for(;(r=t?o.nextSibling:o.previousSibling)===null;){let i=o.parentNode;if(i===null)return null;o=i}if(o=r,!n.isInline(o))return null;let s=o;for(;(s=t?o.firstChild:o.lastChild)!==null;)o=s;if(Ls(o))return o;if(o.nodeName==="BR")return null}}function aE(e,t){return t!==0&&ne(e)?e.setFormat(t):e}function lE(e,t){if(ne(e)){let n=function(o){let r="";for(let s in o)V$.has(s)||(r+=`${s}: ${o[s]}; `);return r.trimEnd()}(t);n!==""&&e.setStyle(n)}return e}var q$=pr({$import:(e,t)=>{let n=e.get(Ju),o=e.get(vE),r=e.get(RE);if(function(l,c){let u=l.parentNode;for(;u!==null;){if(c.preservesWhitespace(u))return!0;u=u.parentNode}return!1}(t,r)){let l=tl(t.textContent||"");for(let c of l)aE(c,n),lE(c,o);return l}let s=function(l,c){let u=(l.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(u.length===0)return"";if(u[0]===" "){let d=l,f=!0;for(;d!==null&&(d=iE(d,!1,c))!==null;){let p=d.textContent||"";if(p.length>0){/[ \t\n]$/.test(p)&&(u=u.slice(1)),f=!1;break}}f&&(u=u.slice(1))}if(u.length>0&&u[u.length-1]===" "){let d=l,f=!0;for(;d!==null&&(d=iE(d,!0,c))!==null;)if((d.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){f=!1;break}f&&(u=u.slice(0,-1))}return u}(t,r);if(s==="")return[];let i=xt(s);return aE(i,n),lE(i,o),[i]},match:Ws.text(),name:"@lexical/html/#text"}),J$=pr({$import:()=>[],match:Ws.tag("script","style"),name:"@lexical/html/script-style-ignore"}),Z$=pr({$import:(e,t)=>ES(t)||NS(t)?[]:[ln()],match:Ws.tag("br"),name:"@lexical/html/br"}),Q$=pr({$import:(e,t)=>{let n=ye();if(Zn(n,t),Jr(t,n),n.getFormatType()===""){let o=t.getAttribute("align");o&&Zp(o)&&n.setFormat(o)}return yn(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Ws.tag("p"),name:"@lexical/html/p"}),BE=pr({$import:(e,t,n)=>Ke().hasNode(ju)?[Gu()]:n(),match:Ws.tag("hr"),name:"@lexical/html/hr"}),KE=[J$,Q$,BE,pr({$import:(e,t,n)=>Is(t)?IE(e.$importChildren(t,{schema:FE}),t):n(),match:Ws.any(),name:"@lexical/html/transparent-block"}),q$,Z$,X$];function ew(e,t){let n=[],o=0,r=0;for(;o<e.length&&r<t.length;)e[o]<=t[r]?n.push(e[o++]):n.push(t[r++]);for(;o<e.length;)n.push(e[o++]);for(;r<t.length;)n.push(t[r++]);return n}function zE(e){let t=[],n=new Map,o=[],r=[],s=[],i=new Set;e.forEach((c,u)=>{let d=function(p){let h=p[td];return h===void 0&&Us(360),h}(c.match),f=c.name||function(p,h){if(p.kind==="text")return`#text@${h}`;if(p.kind==="comment")return`#comment@${h}`;if(p.tags.size===0)return`*@${h}`;return`${Array.from(p.tags).join(",").toLowerCase()}@${h}`}(d,u);if(c.name&&i.add(c.name),t.push({$import:c.$import,name:f,predicate:d.predicate}),d.kind==="text")r.push(u);else if(d.kind==="comment")s.push(u);else if(d.tags.size===0)o.push(u);else for(let p of d.tags){let h=n.get(p);h||(h=[],n.set(p,h)),h.push(u)}});let l=new Map;if(o.length===0)for(let[c,u]of n)l.set(c,u);else for(let[c,u]of n)l.set(c,ew(u,o));return{byTag:l,commentIndices:s,rules:t,textIndices:r,wildcardIndices:o}}function cE(e,t){return Ls(t)?e.textIndices:t.nodeType===8?e.commentIndices:Ce(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:tw}var tw=Object.freeze([]);function UE(e){let t=[];for(let n of e)if(nw(n))for(let o of n.rules)t.push(o);else t.push(n);return t}function nw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function ow(e){let t=UE(e);return{__type:"CompiledOverlayRules",dispatch:zE(t),rules:t}}var rw=Object.freeze({});function sw(e,t){return{$importChildren:(o,r)=>function(s,i,l){let c=l&&l.rules?l.rules.dispatch:void 0;c&&s.overlays.push(c);try{let u=()=>HE(s,i,l);return l&&l.context?Jp(l.context,s.editor)(u):u()}finally{c&&s.overlays.pop()}}(e,o,r),$importOne:(o,r)=>Qp(e,o,r),captures:t,get:(o)=>wE(o,e.editor),session:e.session}}function HE(e,t,n){let o=n&&n.$onChild,r=[];for(let l of Array.from(t.childNodes)){let c=Qp(e,l,void 0);for(let u of c){let d=o?o(u):u;d!=null&&r.push(d)}}let s=n&&n.$after?n.$after(r):r,i=n&&n.schema;return i?function(l,c,u,d){let f=[],p=null,h=()=>{if(p===null)return;let m=p;if(p=null,l.$packageRun){let _=l.$packageRun(m,u,d);if(_.length>0){for(let x of _)f.push(x);return}}if(l.onReject==="hoist")for(let _ of m)f.push(_)};for(let m of c)l.$accepts(m,u)?(h(),f.push(m)):(p===null&&(p=[]),p.push(m));return h(),l.$finalize?l.$finalize(f,u):f}(i,s,null,t):s}function Qp(e,t,n){let o=()=>function(r,s){let i=function(d,f){let p=[];for(let m=d.overlays.length-1;m>=0;m--){let _=d.overlays[m],x=cE(_,f);x.length>0&&p.push({dispatch:_,indices:x})}let h=cE(d.dispatch,f);return h.length>0&&p.push({dispatch:d.dispatch,indices:h}),p}(r,s);if(i.length===0)return uE(r,s);let l=0,c=0,u=()=>{for(;l<i.length;){let{dispatch:d,indices:f}=i[l];for(;c<f.length;){let p=f[c++],h=d.rules[p],m={};if(h.predicate(s,m)){let _=sw(r,Object.keys(m).length===0?rw:m);try{return h.$import(_,s,u)}catch(x){throw x}}}l++,c=0}return uE(r,s)};return u()}(e,t);return n&&n.context?Jp(n.context,e.editor)(o):o()}function uE(e,t){if(t.childNodes.length===0)return[];let n=[];for(let o of Array.from(t.childNodes)){let r=Qp(e,o,void 0);for(let s of r)n.push(s)}return n}var iw=pr({$import:(e,t)=>e.$importChildren(t),match:zi.any(),name:"@lexical/html/default-hoist"}),eh=me({build(e,t){let n=zE(UE(t.rules)),o=qu(t.contextDefaults,void 0),r=t.preprocess;return{$generateNodesFromDOM:(s,i)=>{let l=Zu(Al,e)||o,c=i&&i.context?qu(i.context,l):l,u=c!==void 0&&c!==l?c:Object.create(l||null),d=new DE(u),f={session:d};return function(p,h,m){let _=p.length-1,x=()=>{for(;_>=0;)return void(0,p[_--])(h,m,x)};x()}(i&&i.preprocess?[...r,...i.preprocess]:r,s,f),dE(Al,u,()=>function(p,h,m,_){return HE({dispatch:p,editor:h,overlays:_.get(ME).map((x)=>x.dispatch),session:_},Xr(m)?m.body:m,{schema:PE})}(n,e,s,d),e)},defaults:o}},config:{contextDefaults:[],preprocess:[pE],rules:[iw]},mergeConfig:(e,t)=>Pt(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:mE});function aw(e,t){return FN(eh).$generateNodesFromDOM(e,t)}var WE=me({dependencies:[tn(eh,{rules:KE})],name:"@lexical/html/CoreImport"}),lw=[BE],cw=me({dependencies:[KN,WE],name:"@lexical/html/HorizontalRuleImport"}),uw={any:zi.any,comment:zi.comment,css:bE,tag:zi.tag,text:zi.text},GE=new Set(["STYLE","SCRIPT"]);function dw(e,t){hE(t);let n=Xr(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let s of n)if(!GE.has(s.nodeName)){let i=YE(s,e,r,!1);if(i!==null)for(let l of i)o.push(l)}return function(s){for(let i of s)i.getParent()&&i.getNextSibling()instanceof al&&i.insertAfter(ln());for(let i of s){let l=i.getParent();l&&l.splice(i.getIndexWithinParent(),1,i.getChildren())}}(r),o}function jE(e,t=null,n=Ke()){return qp([Ol(Vp,!0)],n)(()=>{let o=Xe(),r=ed(n),s=I(t)?Jn(t.anchor.getNode()):null,i=e.append.bind(e);for(let l of(j(s)?s:o).getChildren())nd(n,l,i,t,r);return e})}function fw(e,t=Xe()){let n=Ke();return qp([Ol(Vp,!0),Ol(_E,!0)],n)(()=>{let o=ed(n),r=e.append.bind(e);return nd(n,t,r,null,o),e})}function gw(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Us(338),vy(e),jE(je().createElement("div"),t,e).innerHTML}function nd(e,t,n,o=null,r=Kg(e)){let s=r.$shouldInclude(t,o,e),i=r.$shouldExclude(t,o,e),l=t;o!==null&&ne(t)&&(l=Fs(o,t,"clone"));let c=r.$exportDOM(l,e),{element:u,after:d,append:f,$getChildNodes:p}=c;if(!u)return!1;let h=je().createDocumentFragment(),m=p?p():j(l)?l.getChildren():[],_=s&&Je(o)&&j(t)?null:o,x=h.append.bind(h);for(let C of m){let y=nd(e,C,x,_,r);!s&&y&&r.$extractWithChild(t,C,o,"html",e)&&(s=!0)}if(s&&!i){if((Ce(u)||Yg(u))&&(f?f(h):u.append(h)),n(u),d){let C=d.call(l,u);C&&(Yg(u)?u.replaceChildren(C):u.replaceWith(C))}}else n(h);return s}function pw(e,t,n,o=null){return nd(e,t,n.append.bind(n),o,ed(e))}function YE(e,t,n,o,r=new Map,s){let i=[];if(GE.has(e.nodeName))return i;let l=null,c=function(m,_){let{nodeName:x}=m,C=_._htmlConversions.get(x.toLowerCase()),y=null;if(C!==void 0)for(let N of C){let E=N(m);E!==null&&(y===null||(y.priority||0)<=(E.priority||0))&&(y=E)}return y!==null?y.conversion:null}(e,t),u=c?c(e):null,d=null;if(u!==null){d=u.after;let m=u.node;if(l=Array.isArray(m)?m[m.length-1]:m,l!==null){for(let[,_]of r)if(l=_(l,s),!l)break;l&&i.push(...Array.isArray(m)?m:[l])}u.forChild!=null&&r.set(e.nodeName,u.forChild)}let f=e.childNodes,p=[],h=(l==null||!At(l))&&(l!=null&&Kr(l)||o);for(let m=0;m<f.length;m++)p.push(...YE(f[m],t,n,h,new Map(r),l));if(d!=null&&(p=d(p)),Is(e)&&(p=hw(e,p,h?()=>{let m=new al;return n.push(m),m}:ye)),l==null)if(p.length>0)for(let m of p)i.push(m);else Is(e)&&function(m){if(m.nextSibling==null||m.previousSibling==null)return!1;return ki(m.nextSibling)&&ki(m.previousSibling)}(e)&&i.push(ln());else j(l)&&l.append(...p);return i}function hw(e,t,n){let o=e.style.textAlign,r=[],s=[];for(let i=0;i<t.length;i++){let l=t[i];if(Kr(l))o&&!l.getFormat()&&l.setFormat(o),r.push(l);else if(s.push(l),i===t.length-1||i<t.length-1&&Kr(t[i+1])){let c=n();c.setFormat(o),c.append(...s),r.push(c),s=[]}}return r}var Te=th,{$appendNodeToHTML:kB,$distributeInlineWrapper:VE,$generateDOMFromNodes:IB,$generateDOMFromRoot:LB,$generateHtmlFromNodes:XE,$generateNodesFromDOM:qE,$generateNodesFromDOMViaExtension:JE,$getImportContextValue:FB,$getRenderContextValue:PB,$getSessionDOMRenderConfig:BB,$inlineStylesFromStyleSheets:KB,$isBlockLevel:ZE,$propagateTextAlignToBlockChildren:od,$setRenderContextValue:zB,$updateRenderContextValue:UB,$withImportContext:HB,$withRenderContext:WB,BlockSchema:QE,CoreImportExtension:io,CoreImportRules:GB,DOMImportExtension:Yo,DOMRenderExtension:jB,HorizontalRuleImportExtension:YB,HorizontalRuleImportRules:VB,ImportOverlays:eT,ImportSource:tT,ImportSourceDataTransfer:nT,ImportTextFormat:nh,ImportTextStyle:oh,ImportWhitespaceConfig:XB,InlineSchema:qB,NestedBlockSchema:JB,RenderContextExport:ZB,RenderContextRoot:QB,RootSchema:eK,contextUpdater:tK,contextValue:Wi,createImportState:nK,createRenderState:oK,defaultIsInline:rK,defaultPreservesWhitespace:sK,defineImportRule:ut,defineOverlayRules:rh,domOverride:iK,isElementOfTag:sh,parseSelector:aK,sel:dt}=Te;function sT(e,t,n=null){let o=ks(n),r=n?hS(n):[],s=n!==null&&r.length>0;if(s&&typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t,{shadowRoots:r});if(i!==null&&function(l,c){for(let u=l;u!==null;){if(u===c)return!0;u=Cl(u)}return!1}(i.offsetNode,n))return{node:i.offsetNode,offset:i.offset}}if(s){let i=n.getRootNode();if(Au(i)){let l=i.elementFromPoint(e,t);if(l!==null&&n.contains(l)){let c=function(u,d,f,p){let h=p.createRange(),m=(A)=>d<A.top?A.top-d:d>A.bottom?d-A.bottom:0,_=(A)=>u<A.left?A.left-u:u>A.right?u-A.right:0,x=p.createTreeWalker(f,NodeFilter.SHOW_TEXT),C=null,y=1/0,N=1/0;for(let A=x.nextNode();A;A=x.nextNode()){h.selectNodeContents(A);for(let O of h.getClientRects()){let D=m(O),H=_(O);(D<y||D===y&&H<N)&&(y=D,N=H,C=A)}}if(C===null)return null;let E=0,v=1/0,b=1/0;for(let A=0;A<=C.length;A++){h.setStart(C,A),h.collapse(!0);let O=h.getBoundingClientRect(),D=m(O),H=Math.abs(u-O.left);(D<v||D===v&&H<b)&&(v=D,b=H,E=A)}return{node:C,offset:E}}(e,t,l,o);if(c!==null)return c}}}if(typeof o.caretRangeFromPoint=="function"){let i=o.caretRangeFromPoint(e,t);return i===null?null:{node:i.startContainer,offset:i.startOffset}}if(typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t);return i===null?null:{node:i.offsetNode,offset:i.offset}}return null}function ji(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var rd={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function iT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(t)=>t}).createHTML(e);return e}var oT=(e,t)=>{if(!I(t))return t.insertRawText(e),!0;let n=(o)=>{let r=K();I(r)&&o(r)};return Li(e,{linebreak:()=>n((o)=>o.insertParagraph()),tab:()=>n((o)=>o.insertNodes([cn()])),text:(o)=>n((r)=>r.insertText(o))}),!0},sd={"application/x-lexical-editor":[(e,t,n)=>{try{let o=Ke(),r=JSON.parse(e);if(r&&r.namespace===o._config.namespace&&Array.isArray(r.nodes))return id(o,gT(r.nodes),t),!0}catch(o){console.error(o)}return n()}],"text/html":[(e,t,n)=>{try{let o=Ke(),r=new DOMParser().parseFromString(iT(e),"text/html");return id(o,qE(o,r),t),!0}catch(o){return console.error(o),n()}}],"text/plain":[oT],"text/uri-list":[oT]};function mw(e,t,n,o){if(!e)return!1;let r=(s)=>!!e[s]&&e[s](t,n,r.bind(null,s-1),o);return r(e.length-1)}function aT(e,t,n){let o=t.getData("text/plain");for(let r of function(s){return Object.keys(s.$importMimeType).filter((i)=>s.$importMimeType[i]!==void 0).sort((i,l)=>{let c=s.priority[i],u=s.priority[l];return c===void 0&&u===void 0?i<l?-1:i>l?1:0:c===void 0?1:u===void 0?-1:c-u})}(e)){let s=t.getData(r);if(s&&((r!=="text/html"||s!==o)&&mw(e.$importMimeType[r],s,n,t)))return!0}return!1}var _w={$importMimeType:sd,$insertDataTransfer:(e,t)=>aT({$importMimeType:sd,priority:rd},e,t),priority:rd},ah=me({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(n,o)=>aT(t,n,o),priority:t.priority}),config:Be({$importMimeType:sd,priority:rd}),mergeConfig(e,t){let n=Pt(e,t);if(t.$importMimeType){let o={...e.$importMimeType};for(let[r,s]of Object.entries(t.$importMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$importMimeType=o}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"}),xw=me({dependencies:[io,WN(ah,{$importMimeType:{"text/html":[(e,t,n,o)=>{let r=new DOMParser().parseFromString(iT(e),"text/html"),s=JE(r,{context:[Wi(tT,"paste"),Wi(nT,o)]});return id(Ke(),s,t),!0}]}})],name:"@lexical/clipboard/DOMImport"});function lh(e,t=K()){return t==null&&ji(166),I(t)&&t.isCollapsed()||t.getNodes().length===0?"":XE(e,t)}function ch(e,t=K()){return t==null&&ji(166),I(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(fT(e,t))}function lT(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function cT(e,t,n){(function(){let o=PN(ah.name);return o?o.output:_w})().$insertDataTransfer(e,t)}var uT="application/x-lexical-drag";function Cw(e,t){let n={editorKey:t.getKey()};e.setData(uT,JSON.stringify(n))}function dT(e,t,n){let o=e.dataTransfer;if(o===null)return!1;let r=function(u){let d=u.getData(uT);if(!d)return null;let f;try{f=JSON.parse(d)}catch(h){return null}return(p=f)!==null&&typeof p=="object"&&"editorKey"in p&&typeof p.editorKey=="string"?f:null;var p}(o);if(r===null)return!1;let s=function(u,d){let f=sT(u.clientX,u.clientY,d.getRootElement());if(f===null)return null;let p=Tt(f.node);if(p===null)return null;if(ne(p))return Vc(p,"next",f.offset);if(j(p))return Pg(p,f.offset,"next");let h=p.getParent();return h===null?null:Pg(h,p.getIndexWithinParent()+1,"next")}(e,t);if(s===null)return!1;let i=Jc(s);if(i===null)return!1;let l=r.editorKey===t.getKey(),c=K();if(l){if(!I(c)||c.isCollapsed())return!1;if(function(u,d){let{anchor:f,focus:p}=cr(ar(d),"next");return Fr(f,u)<0&&Fr(u,p)<0}(s,c))return e.preventDefault(),!0;c.removeText()}if(!i.origin.isAttached())return e.preventDefault(),!0;if(n(o,Rn(Os(i)),t),!l){let u=t.getRootElement(),d=u?u.ownerDocument:null,f=d?function(p,h){for(let m of dS(h)){let _=bu(m);if(Ru(_)&&_.getKey()===p&&Ce(m))return m}return null}(r.editorKey,d):null;f!==null&&f.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function yw(e,t){return dT(e,t,cT)}function Sw(e,t){return dT(e,t,(n,o)=>lT(n,o))}function id(e,t,n){e.dispatchCommand(yu,{nodes:t,selection:n})||(n.insertNodes(t),function(o){if(I(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=an(r,"previous");if(i)if(zr(i))s=i.origin;else{let l=qn(i,Et(Xe(),"next").getFlipped());for(let c of l){if(ne(c.origin)){s=c.origin;break}if(j(c.origin)&&!c.origin.isInline())break}}if(s&&ne(s)){let l=s.getFormat(),c=s.getStyle();o.format===l&&o.style===c||(o.format=l,o.style=c,o.dirty=!0)}}}(n))}function ih(e,t,n,o=[]){let r=t===null||n.isSelected(t),s=j(n)&&n.excludeFromCopy("html"),i=n;t!==null&&ne(i)&&(i=Fs(t,i,"clone"));let l=j(i)?i.getChildren():[],c=function(d){let f=d.exportJSON(),p=d.constructor;if(f.type!==p.getType()&&ji(58,p.name),j(d)){let h=f.children;Array.isArray(h)||ji(59,p.name)}return f}(i);ne(i)&&i.getTextContentSize()===0&&(r=!1);let u=r&&Je(t)&&j(n)?null:t;for(let d=0;d<l.length;d++){let f=l[d],p=ih(e,u,f,c.children);!r&&j(n)&&p&&n.extractWithChild(f,t,"clone")&&(r=!0)}if(r&&!s){let d=As(i);if(d.length>0){let f={};for(let p of d){let h=Ci(i,p);h===null&&ji(366,i.constructor.name,p);let m=[];ih(e,null,h,m),m.length===1&&m[0].type===h.getType()||ji(385,p,i.constructor.name,String(m.length),String(m.length>0?m[0].type:"none")),f[p]=m[0]}c.$slots=f}}if(r&&!s)o.push(c);else if(Array.isArray(c.children))for(let d=0;d<c.children.length;d++){let f=c.children[d];o.push(f)}return r}function fT(e,t){let n=[],o=Xe(),r=I(t)?t.anchor.getNode():Je(t)?t.getNodes()[0]??null:null,s=r!==null?Jn(r):null,i=(j(s)?s:o).getChildren();for(let l=0;l<i.length;l++)ih(e,t,i[l],n);return{namespace:e._config.namespace,nodes:n}}function gT(e){let t=[];for(let n of e)t.push(Ky(n));return t}var Gi=null;async function Nw(e,t,n){if(Gi!==null)return!1;if(t!==null)return new Promise((u,d)=>{e.update(()=>{u(rT(e,t,n))})});let o=e.getRootElement(),r=e._window||window,s=r.document,i=kn(r);if(o===null||i===null)return!1;let l=s.createElement("span");l.style.position="fixed",l.style.top="-1000px",l.append(s.createTextNode("#")),o.append(l);let c=s.createRange();return c.setStart(l,0),c.setEnd(l,1),i.removeAllRanges(),i.addRange(c),new Promise((u,d)=>{let f=e.registerCommand(Ni,(p)=>(In(p,ClipboardEvent)&&(f(),Gi!==null&&(r.clearTimeout(Gi),Gi=null),u(rT(e,p,n))),!0),Si);Gi=r.setTimeout(()=>{f(),Gi=null,u(!1)},50),s.execCommand("copy"),l.remove()})}function rT(e,t,n){if(n===void 0){let r=kn(e._window),s=K();if(!s||s.isCollapsed())return!1;if(!r)return!1;let i=ws(r,e.getRootElement()),{anchorNode:l,focusNode:c}=i;if(l!==null&&c!==null&&!TS(e,l,c))return!1;n=pT(s)}t.preventDefault();let o=t.clipboardData;return o!==null&&(hT(o,n),!0)}var Ew=[["text/html",lh],["application/x-lexical-editor",ch]];function pT(e=K()){return function(t,n){let o={"text/plain":""};for(let[r,s]of Object.entries(t))if(s){let i=xT(s,n);i!==null&&(o[r]=i)}return o}(mT(),e)}function hT(e,t){for(let[n]of Ew)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}function mT(e=Ke()){let t=so(e,CT.name);return t?t.output:_T}var _T={"application/x-lexical-editor":[(e,t)=>e?ch(Ke(),e):t()],"text/html":[(e,t)=>e?lh(Ke(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function xT(e,t){let n=(o)=>e[o]?e[o](t,n.bind(null,o-1)):null;return n(e.length-1)}function Tw(e,t=K()){return xT(mT()[e]||[],t)}var CT=me({build:(e,t,n)=>t.$exportMimeType,config:Be({$exportMimeType:_T}),mergeConfig(e,t){let n=Pt(e,t);if(t.$exportMimeType){let o={...e.$exportMimeType};for(let[r,s]of Object.entries(t.$exportMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$exportMimeType=o}return n},name:"@lexical/clipboard/GetClipboardData"});var wt=uh,{$exportMimeTypeFromSelection:pK,$generateJSONFromSelectedNodes:hK,$generateNodesFromSerializedNodes:mK,$getClipboardDataFromSelection:ad,$getHtmlContent:_K,$getLexicalContent:xK,$handlePlainTextDrop:CK,$handleRichTextDrop:yT,$insertDataTransferForPlainText:yK,$insertDataTransferForRichText:dh,$insertGeneratedNodes:SK,$writeDragSourceToDataTransfer:ST,ClipboardDOMImportExtension:NK,ClipboardImportExtension:EK,DEFAULT_IMPORT_MIME_TYPE:TK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:bK,GetClipboardDataExtension:vK,caretFromPoint:ld,copyToClipboard:Ml,setLexicalClipboardDataTransfer:NT}=wt;var bw=ut({$import:(e,t)=>{let n=Xi(t.nodeName.toLowerCase());return Jr(t,n),Zn(n,t),yn(n,t),[n.splice(0,0,e.$importChildren(t))]},match:dt.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),vw=ut({$import:(e,t)=>{let n=$l();return Zn(n,t),Jr(t,n),yn(n,t),[n.splice(0,0,e.$importChildren(t))]},match:dt.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),Ow=ut({$import:(e,t)=>{let n=$l({shadowRoot:!0});return Zn(n,t),Jr(t,n),yn(n,t),[n.splice(0,0,e.$importChildren(t,{schema:QE}))]},match:dt.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),MT=[bw,vw,ut({$import:(e,t,n)=>{let o=t.firstChild;return o&&(Ce(r=o)&&r.nodeName==="SPAN"&&r.style.fontSize==="26pt")?e.$importChildren(t):n();var r},match:dt.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),ut({$import:(e,t,n)=>t.style.fontSize!=="26pt"?n():[Xi("h1").splice(0,0,e.$importChildren(t))],match:dt.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Aw(e,t){return e&&t!==null?Pt(e,t):t}var DT=me({build:(e,t)=>Mt(t),config:Be({escapeFormatTriggers:{capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}}}),conflictsWith:["@lexical/plain-text"],dependencies:[QN,UN,HN,io,tn(Yo,{rules:MT})],mergeConfig:function(e,t){let n=Pt(e,t);return t.escapeFormatTriggers&&(n.escapeFormatTriggers=function(o,r){let s=Pt(o,r);for(let i of Object.keys(r))s[i]=Aw(o[i],r[i]);return s}(e.escapeFormatTriggers,t.escapeFormatTriggers)),n},name:"@lexical/rich-text",nodes:()=>[wl,Dl],register:(e,t,n)=>yt(()=>$T(e,n.getOutput().escapeFormatTriggers))}),Rw=me({dependencies:[DT],name:"@lexical/rich-text/Import"}),fh=Sn("DRAG_DROP_PASTE_FILE"),fd=Go("shadowRoot",{parse:Boolean});class Dl extends lt{$config(){return this.config("quote",{extends:lt,importDOM:{blockquote:()=>({conversion:Dw,priority:0})},stateConfigs:[{flat:!0,stateConfig:fd}]})}isShadowRoot(){return Lo(this,fd)}setIsShadowRoot(e){return Qn(this,fd,e)}createDOM(e){let t=je().createElement("blockquote");return Qe(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(je().createElement("br"));let n=this.getFormatType();n&&(t.style.textAlign=n);let o=this.getDirection();o&&(t.dir=o)}return{element:t}}exportJSON(){return super.exportJSON()}static importJSON(e){return $l().updateFromJSON(e)}insertNewAfter(e,t){let n=ye(),o=this.getDirection();return n.setDirection(o),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let t of this.getChildren())this.insertBefore(t);return this.remove(),!0}let e=ye();return this.getChildren().forEach((t)=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function $l(e){let t=sn(new Dl);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function Mw(e){return e instanceof Dl}class wl extends lt{__tag;$config(){return this.config("heading",{extends:lt,importDOM:{h1:()=>({conversion:Yi,priority:0}),h2:()=>({conversion:Yi,priority:0}),h3:()=>({conversion:Yi,priority:0}),h4:()=>({conversion:Yi,priority:0}),h5:()=>({conversion:Yi,priority:0}),h6:()=>({conversion:Yi,priority:0}),p:(e)=>{let t=e.firstChild;return t!==null&&ET(t)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>ET(e)?{conversion:()=>({node:Xi("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=je().createElement(t),o=e.theme.heading;if(o!==void 0){let r=o[t];Qe(n,r)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ce(t)){this.isEmpty()&&t.append(je().createElement("br"));let n=this.getFormatType();n&&(t.style.textAlign=n);let o=this.getDirection();o&&(t.dir=o)}return{element:t}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,o=this.getLastDescendant(),r=!o||e&&e.anchor.key===o.getKey()&&n===o.getTextContentSize()||!e?ye():Xi(this.getTag()),s=this.getDirection();if(r.setDirection(s),this.insertAfter(r,t),n===0&&!this.isEmpty()&&e){let i=ye();i.select(),this.replace(i,!0)}return r}collapseAtStart(){if(this.isEmpty()){let e=ye();this.getChildren().forEach((t)=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}}function ET(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Yi(e){let t=e.nodeName.toLowerCase(),n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Xi(t),Jr(e,n),Zn(n,e),yn(n,e)),{node:n}}function Dw(e){let t=$l();return Zn(t,e),Jr(e,t),yn(t,e),{node:t}}function Xi(e="h1"){return sn(new wl(e))}function $w(e){return e instanceof wl}function TT(e){let t=Tt(e);return Dt(t)}function Vi(e,t,n,o){let r=!1,s=null;if(e.isCollapsed()&&e.anchor.type==="text"){let l=e.anchor.getNode();if(ne(l)){s=l;let c=e.anchor.offset,u=c===l.getTextContentSize()&&l.getNextSibling()===null,d=c===0&&l.getPreviousSibling()===null;r=n==="end"&&u||n==="start"&&d||n==="both"&&(u||d)}}let i=!1;for(let[l,c]of Object.entries(o)){if(c==null||!c[t])continue;let u=l;if(c.onlyAtBoundary){if(!(r&&s&&ne(s)&&s.hasFormat(u)))continue;i=!0}e.hasFormat(u)&&e.toggleFormat(u)}i&&e.setStyle("")}var ww={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function cd(e,t){return function(n,o){if(!n.isCollapsed())return!1;let r=an(n.focus,o),s=pe(r.origin,qc);if(!s)return!1;let i=n.focus.getNode();if(!s.is(i)&&!ol(i,s))return!1;let l=qn(r,it(s,o));if(l.getTextSlices().some((f)=>f&&f.getTextContentSize()>0))return!1;let c=qn(l.anchor.getSiblingCaret(),l.focus),u=c.anchor.origin;for(let f of c){if(!Co(f)||!f.origin.is(u.getParent()))return!1;u=f.origin}let d=s;for(let f of bs(it(s,o))){if(!f.origin.is(d.getParent())){if(Py(f.origin)){let p=it(d,o);return Rn(qn(p,p)),!0}break}if(!qc(f.origin))break;d=f.origin}return!1}(e,t)||function(n,o){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;let r=an(n.anchor,o).getNodeAtCaret();return!(!qc(r)||r.isInline()||(Rn(Os($t(Et(r,o)))),0))}(e,t)}function bT(e){return Dt(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ud(e){let t=jc();t.add(e),pt(t)}function vT(e,t){if(!e.isCollapsed())return!1;let n=e.focus,o=n.getNode(),r=t?"previous":"next",s=an(n,r);if(n.type==="element"&&j(o)&&At(o)){let C=s.getNodeAtCaret();return!(C===null||!bT(C))&&(ud(C.__key),!0)}let i=pe(j(o)?o:o.getParentOrThrow(),(C)=>j(C)&&!C.isInline()&&At(C.getParent()));if(i===null)return!1;let l=it(i,r).getNodeAtCaret();if(l===null||!bT(l))return!1;if(i.getTextContentSize()===0)return ud(l.__key),!0;let c=Ke().getRootElement();if(c===null)return!1;let u=kn(c.ownerDocument.defaultView);if(u===null||u.rangeCount===0)return!1;let{anchorNode:d,anchorOffset:f,focusNode:p,focusOffset:h}=u;u.modify("move",t?"backward":"forward","line");let{anchorNode:m,anchorOffset:_}=u;if(m===null)return OT(u,d,f,p,h),!1;let x=Tt(m);if(OT(u,d,f,p,h),x===null)return!1;if(m===d&&_===f)return ud(l.__key),!0;return!x.is(i)&&!ol(x,i)&&(ud(l.__key),!0)}function OT(e,t,n,o,r){t!==null&&o!==null&&e.setBaseAndExtent(t,n,o,r)}function AT(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),o=pe(j(n)?n:n.getParentOrThrow(),(x)=>j(x)&&!x.isInline());if(o===null)return!1;let r=Ke(),s=r.getRootElement();if(s===null)return!1;let i=s.ownerDocument.defaultView;if(i===null)return!1;let l=!1;for(let x of o.getChildren())if(j(x)&&x.isInline()){let C=r.getElementByKey(x.getKey());if(C!==null){let y=i.getComputedStyle(C).display;if(y==="inline-grid"||y==="inline-flex"){l=!0;break}}}if(!l)return!1;let c=it(o,t?"previous":"next").getNodeAtCaret();if(c===null||!j(c)){if(t){let x=o.getFirstDescendant();ne(x)?x.select(0,0):o.select(0,0)}else{let x=o.getLastDescendant();if(ne(x)){let C=x.getTextContentSize();x.select(C,C)}else{let C=o.getChildrenSize();o.select(C,C)}}return!0}let u=r.getElementByKey(c.getKey());if(u===null)return!1;let d=kn(i);if(d===null||d.rangeCount===0)return!1;let f=d.getRangeAt(0).cloneRange();f.collapse(!0);let p=f.getBoundingClientRect(),h=u.getBoundingClientRect(),m=h.top+h.height/2;if(p.height>0){let x=ld(p.left,m,s);if(x!==null&&u.contains(x.node)){let C=s.ownerDocument.createRange();return C.setStart(x.node,x.offset),C.collapse(!0),e.applyDOMRange(C),e.dirty=!0,!0}}let _=t?c.getLastDescendant():c.getFirstDescendant();if(ne(_)){let x=t?_.getTextContentSize():0;_.select(x,x)}else{let x=c.getChildrenSize();c.select(t?x:0,t?x:0)}return!0}function dd(e,t){let n=it(e,t),o=n.getAdjacentCaret();o!==null&&j(o.origin)&&!o.origin.isInline()&&o.origin.isShadowRoot()?Rn(Os(n)):t==="next"?e.selectNext(0,0):e.selectPrevious()}function RT(e,t,n){n.preventDefault(),n.stopPropagation();let o=e.getNodes();if(o.length===0)return!0;let r=o.map((c)=>it(c,"next")).sort(Fr),s=(t?r[0]:r[r.length-1]).origin,i=pe(s,(c)=>c!==s&&j(c)&&!c.isInline())??Xe(),l=t?0:i.getChildrenSize();return i.select(l,l),!0}function $T(e,t=Ks(ww)){return Oe(e.registerCommand(yi,()=>{let n=K();return Je(n)?(n.clear(),!0):(I(n)&&Vi(n,"click","both",t.peek()),!1)},Ee),e.registerCommand(Ei,(n)=>{let o=K();return I(o)?(o.deleteCharacter(n),!0):!!Je(o)&&(o.deleteNodes(),!0)},Ee),e.registerCommand(iu,(n)=>{let o=K();return!!I(o)&&(o.deleteWord(n),!0)},Ee),e.registerCommand(su,(n)=>{let o=K();return!!I(o)&&(o.deleteLine(n),!0)},Ee),e.registerCommand(nu,(n)=>{let o=K();if(typeof n=="string")o!==null&&o.insertText(n);else{if(o===null)return!1;let r=n.dataTransfer;if(r!=null)dh(r,o,e);else if(I(o)){let s=n.data;return s&&o.insertText(s),!0}}return!0},Ee),e.registerCommand(iS,()=>{let n=K();return!!I(n)&&(n.removeText(),!0)},Ee),e.registerCommand(Uo,(n)=>{let o=K();return!(!I(o)&&!Je(o))&&(Ry(o,n),!0)},Ee),e.registerCommand(aS,(n)=>{let o=K();return!(!I(o)&&!Je(o))&&(Uy(o,n),!0)},Ee),e.registerCommand(lu,(n)=>{let o=K();if(!I(o)&&!Je(o))return!1;let r=o.getNodes();for(let s of r){let i=pe(s,(l)=>j(l)&&!l.isInline());i!==null&&i.setFormat(n)}return!0},Ee),e.registerCommand(Gg,(n)=>{let o=K();return!!I(o)&&(o.insertLineBreak(n),!0)},Ee),e.registerCommand(Wr,()=>{let n=K();return!!I(n)&&(n.insertParagraph(),!0)},Ee),e.registerCommand(Ds,()=>{let n=cn(),o=K();return I(o)&&(n.setFormat(o.format),n.setStyle(o.style)),Xc([n]),!0},Ee),e.registerCommand(eo,()=>Nl((n)=>{let o=n.getIndent();n.setIndent(o+1)}),Ee),e.registerCommand(Wo,()=>Nl((n)=>{let o=n.getIndent();o>0&&n.setIndent(Math.max(0,o-1))}),Ee),e.registerCommand(to,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],"previous"),!0}else if(I(o)){if(function(r){let s=r.focus;return s.key==="root"&&s.offset===0}(o))return n.preventDefault(),!0;if(!n.shiftKey&&cd(o,"previous"))return n.preventDefault(),!0;if(!n.shiftKey&&vT(o,!0))return n.preventDefault(),!0;if(!n.shiftKey&&AT(o,!0))return n.preventDefault(),!0}return!1},Ee),e.registerCommand(Ho,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],"next"),!0}else if(I(o)){if(function(r){let s=r.focus;return s.key==="root"&&s.offset===Xe().getChildrenSize()}(o))return n.preventDefault(),!0;if(!n.shiftKey&&cd(o,"next"))return n.preventDefault(),!0;if(!n.shiftKey&&vT(o,!1))return n.preventDefault(),!0;if(!n.shiftKey&&AT(o,!1))return n.preventDefault(),!0}return!1},Ee),e.registerCommand(Gr,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],yl(r[0])?"next":"previous"),!0}if(!I(o))return!1;if(!n.shiftKey&&cd(o,yl(o.anchor.getNode())?"next":"previous"))return n.preventDefault(),!0;if(n.shiftKey||Vi(o,"arrow","start",t.peek()),lp(o,!0)){let r=n.shiftKey;return n.preventDefault(),ap(o,r,!0),!0}return!1},Ee),e.registerCommand(bi,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();if(r.length>0)return n.preventDefault(),dd(r[0],yl(r[0])?"previous":"next"),!0}if(!I(o))return!1;if(!n.shiftKey&&cd(o,yl(o.anchor.getNode())?"previous":"next"))return n.preventDefault(),!0;if(n.shiftKey||Vi(o,"arrow","end",t.peek()),lp(o,!1)){let r=n.shiftKey;return n.preventDefault(),ap(o,r,!1),!0}return!1},Ee),e.registerCommand(vi,(n)=>{let o=K();if(!Je(o)&&TT(n.target))return!1;if(I(o)){if(function(r){if(!r.isCollapsed())return!1;let{anchor:s}=r;if(s.offset!==0)return!1;let i=s.getNode();if(xo(i))return!1;let l=ku(i);return l.getIndent()>0&&(l.is(i)||i.is(l.getFirstDescendant()))}(o))return n.preventDefault(),e.dispatchCommand(Wo);if(gl&&cl)return!1}else if(!Je(o))return!1;return n.preventDefault(),e.dispatchCommand(Ei,!0)},Ee),e.registerCommand(hu,(n)=>{let o=K();return!(!Je(o)&&TT(n.target))&&(!(!I(o)&&!Je(o))&&(n.preventDefault(),e.dispatchCommand(Ei,!1)))},Ee),e.registerCommand(Oi,(n)=>{let o=K();if(Je(o)){let r=o.getNodes();r.length===1&&Dt(r[0])&&!r[0].isInline()&&(o=r[0].selectNext())}if(!I(o))return!1;if(Vi(o,"enter","both",t.peek()),n!==null){if((gl||fu||uu)&&cl)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(Gg,!1)}return e.dispatchCommand(Wr)},Ee),e.registerCommand(Ai,()=>{let n=K();return!!I(n)&&(e.blur(),!0)},Ee),e.registerCommand(Jy,(n)=>{let[,o]=Ps(n);if(o.length>0){let{clientX:r,clientY:s}=n,i=ld(r,s,e.getRootElement());if(i!==null){let{offset:l,node:c}=i,u=Tt(c);if(u!==null){let d=Pr();if(ne(u))d.anchor.set(u.getKey(),l,"text"),d.focus.set(u.getKey(),l,"text");else{let p=u.getParentOrThrow().getKey(),h=u.getIndexWithinParent()+1;d.anchor.set(p,h,"element"),d.focus.set(p,h,"element")}let f=Po(d);pt(f)}e.dispatchCommand(fh,o)}return n.preventDefault(),!0}return yT(n,e)},Ee),e.registerCommand(qy,(n)=>{let[o]=Ps(n),r=K();return!(o&&!I(r))&&(I(r)&&!r.isCollapsed()&&n.dataTransfer!==null&&(NT(n.dataTransfer,ad(r)),ST(n.dataTransfer,e)),!0)},Ee),e.registerCommand(Xy,(n)=>{let[o]=Ps(n),r=K();if(o&&!I(r))return!1;let{clientX:s,clientY:i}=n,l=ld(s,i,e.getRootElement());if(l!==null){let c=Tt(l.node);Dt(c)&&n.preventDefault()}return!0},Ee),e.registerCommand(Di,()=>{let n=K();return Ur(I(n)&&Jn(n.anchor.getNode())!==null?n:null),!0},Ee),e.registerCommand(Ni,(n)=>(Ml(e,In(n,ClipboardEvent)?n:null),!0),Ee),e.registerCommand(ou,(n)=>(async function(o,r){await Ml(r,In(o,ClipboardEvent)?o:null),r.update(()=>{let s=K();I(s)?s.removeText():Je(s)&&s.getNodes().forEach((i)=>i.remove())},{tag:ru})}(n,e),!0),Ee),e.registerCommand(Mi,(n)=>{let[,o,r]=Ps(n);if(o.length>0&&!r)return e.dispatchCommand(fh,o),!0;if(oo(n.target)&&Fy(n.target))return!1;return K()!==null&&(function(s,i){s.preventDefault(),i.update(()=>{let l=K(),c=In(s,InputEvent)||In(s,KeyboardEvent)?null:s.clipboardData;c!=null&&l!==null&&dh(c,l,i)},{tag:_u})}(n,e),!0)},Ee),e.registerCommand(mu,()=>{let n=K();return I(n)&&Vi(n,"space","both",t.peek()),!1},Ee),e.registerCommand(jr,()=>{let n=K();return I(n)&&Vi(n,"tab","both",t.peek()),!1},Ee),e.registerCommand(_l,(n)=>{let o=K();if(Je(o))return RT(o,!1,n);if(!I(o))return!1;let{anchor:r}=o;if(r.type!=="element"||r.offset!==0)return!1;let s=r.getNode();if(!j(s))return!1;let i=s.getFirstChild();if(!Dt(i)||!i.isInline())return!1;let l=s.getKey(),c=s.selectEnd();return n.shiftKey&&c.anchor.set(l,0,"element"),n.preventDefault(),n.stopPropagation(),!0},Ee),e.registerCommand(Ri,(n)=>{let o=K();if(Je(o))return RT(o,!0,n);if(!I(o))return!1;let{anchor:r,focus:s}=o,i=pe(s.getNode(),(u)=>j(u)&&!u.isInline());if(i===null)return!1;let l=i.getFirstChild();if(!Dt(l)||!l.isInline())return!1;if(pe(r.getNode(),(u)=>j(u)&&!u.isInline())!==i)return!1;let c=i.getKey();return(s.type!=="element"||s.key!==c||s.offset!==0)&&(o.focus.set(c,0,"element"),n.shiftKey||o.anchor.set(c,0,"element"),n.preventDefault(),n.stopPropagation(),!0)},Ee))}var Nn=gh,{$createHeadingNode:gd,$createQuoteNode:pd,$isHeadingNode:kl,$isQuoteNode:hd,DRAG_DROP_PASTE:LK,HeadingNode:md,QuoteNode:_d,RichTextExtension:FK,RichTextImportExtension:PK,RichTextImportRules:BK,ShadowRootQuoteRule:KK,eventFiles:zK,quoteShadowRootState:UK,registerRichText:wT}=Nn;L();function kw(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ph=un?nt:S;function Iw({editor:e,ErrorBoundary:t}){return function(n,o){let[r,s]=w(()=>n.getDecorators());return ph(()=>n.registerDecoratorListener((i)=>{Mn(()=>{s(i)})}),[n]),S(()=>{s(n.getDecorators())},[n]),Q(()=>{let i=[],l=Object.keys(r);for(let c=0;c<l.length;c++){let u=l[c],d=a(o,{onError:(p)=>n._onError(p),children:a(oa,{fallback:null,children:r[u]})}),f=n.getElementByKey(u);f!==null&&i.push(Js(d,f,u))}return i},[o,r,n])}(e,t)}function Lw({editor:e,ErrorBoundary:t}){return function(n){let o=zN.maybeFromEditor(n);if(o&&o.hasExtensionByName(YN.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&kw(320,r);return!0}return!1}(e)?null:a(Iw,{editor:e,ErrorBoundary:t})}function kT(e){return e.read("latest",Vu(e.isComposing()))}function Fw({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=st();return function(r){ph(()=>Oe(wT(r),eE(r)),[r])}(o),g(W,{children:[e,a(Pw,{content:t}),a(Lw,{editor:o,ErrorBoundary:n})]})}function Pw({content:e}){let[t]=st(),n=function(r){let[s,i]=w(()=>kT(r));return ph(()=>{function l(){let c=kT(r);i(c)}return l(),Oe(r.registerUpdateListener(()=>{l()}),r.registerEditableListener(()=>{l()}))},[r]),s}(t),o=OS();return n?typeof e=="function"?e(o):e:null}var Bw=hh,IT=Bw.RichTextPlugin;L();var FT=un?nt:S;function Kw({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:s,ariaExpanded:i,ariaInvalid:l,ariaLabel:c,ariaLabelledBy:u,ariaMultiline:d,ariaOwns:f,ariaRequired:p,autoCapitalize:h,className:m,id:_,role:x="textbox",spellCheck:C=!0,style:y,tabIndex:N,"data-testid":E,...v},b){let[A,O]=w(e.isEditable()),D=G((k)=>{k&&k.ownerDocument&&k.ownerDocument.defaultView?e.setRootElement(k):e.setRootElement(null)},[e]),H=Q(()=>function(...k){return(J)=>{for(let V of k)typeof V=="function"?V(J):V!=null&&(V.current=J)}}(b,D),[D,b]);return FT(()=>(O(e.isEditable()),e.registerEditableListener((k)=>{O(k)})),[e]),a("div",{"aria-activedescendant":A?t:void 0,"aria-autocomplete":A?n:"none","aria-controls":A?o:void 0,"aria-describedby":r,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":A&&x==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":c,"aria-labelledby":u,"aria-multiline":d,"aria-owns":A?f:void 0,"aria-readonly":!A||void 0,"aria-required":p,autoCapitalize:h,className:m,contentEditable:A,"data-testid":E,id:_,ref:H,role:x,spellCheck:C,style:y,tabIndex:N??(A?void 0:-1),...v})}var PT=Y(Kw);function LT(e){return e.read("latest",Vu(e.isComposing()))}var zw=Y(Uw);function Uw(e,t){let{placeholder:n,...o}=e,[r]=st();return g(W,{children:[a(PT,{editor:r,...o,ref:t}),n!=null&&a(Hw,{editor:r,content:n})]})}function Hw({content:e,editor:t}){let n=function(i){let[l,c]=w(()=>LT(i));return FT(()=>{function u(){let d=LT(i);c(d)}return u(),Oe(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),l}(t),[o,r]=w(t.isEditable());if(nt(()=>(r(t.isEditable()),t.registerEditableListener((i)=>{r(i)})),[t]),!n)return null;let s=null;return typeof e=="function"?s=e(o):e!==null&&(s=e),s===null?null:a("div",{"aria-hidden":!0,children:s})}var BT=mh,{ContentEditable:KT,ContentEditableElement:az}=BT;function Ww(e,t,n,o,r){if(e===null||n.size===0&&o.size===0&&!r)return 0;let s=t._selection,i=e._selection;if(r)return 1;if(!(I(s)&&I(i)&&i.isCollapsed()&&s.isCollapsed()))return 0;let l=function(C,y,N){let E=C._nodeMap,v=[];for(let b of y){let A=E.get(b);A!==void 0&&v.push(A)}for(let[b,A]of N){if(!A)continue;let O=E.get(b);O===void 0||xo(O)||v.push(O)}return v}(t,n,o);if(l.length===0)return 0;if(l.length>1){let C=t._nodeMap,y=C.get(s.anchor.key),N=C.get(i.anchor.key);return y&&N&&!e._nodeMap.has(y.__key)&&ne(y)&&y.__text.length===1&&s.anchor.offset===1?2:0}let c=l[0],u=e._nodeMap.get(c.__key);if(!ne(u)||!ne(c)||u.__mode!==c.__mode)return 0;let d=u.__text,f=c.__text;if(d===f)return 0;let p=s.anchor,h=i.anchor;if(p.key!==h.key||p.type!=="text")return 0;let m=p.offset,_=h.offset,x=f.length-d.length;return x===1&&_===m-1?2:x===-1&&_===m+1?3:x===-1&&_===m?4:0}function Gw(e,t,n){let o=n(),r=0,s=o,i=0,l=null;return(c,u,d,f,p,h)=>{let m=n();if(h.has(tu)&&(s=o,i=r,l=c),h.has(Ti))return r=0,o=m,2;h.has(eu)&&l&&(o=s,r=i,c=l);let _=h.has(_u)||h.has(ru)?0:Ww(c,u,f,p,e.isComposing()),x=(()=>{let C=d===null||d.editor===e,y=h.has(cu);if(!y&&C&&h.has(Hr))return 0;if(_===1)return 2;if(c===null)return 1;let N=u._selection;if(!(f.size>0||p.size>0))return N!==null?0:2;let E=typeof t=="number"?t:t.peek();if(y===!1&&_!==0&&_===r&&m<o+E&&C)return 0;if(f.size===1){if(function(v,b,A){let O=b._nodeMap.get(v),D=A._nodeMap.get(v),H=b._selection,k=A._selection;return!(I(H)&&I(k)&&H.anchor.type==="element"&&H.focus.type==="element"&&k.anchor.type==="text"&&k.focus.type==="text"||!ne(O)||!ne(D)||O.__parent!==D.__parent)&&JSON.stringify(b.read(()=>O.exportJSON()))===JSON.stringify(A.read(()=>D.exportJSON()))}(Array.from(f)[0],c,u))return 0}return 1})();return o=m,r=_,x}}function zT(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function UT(e,t,n,o=Date.now,r,s=null){let i=Gw(e,n,o),l=()=>{r&&r(t)};return l(),Oe(e.registerCommand(Eu,()=>(function(c,u,d){let{redoStack:f,undoStack:p}=u;if(p.length!==0){let h=u.current,m=p.pop();h!==null&&(f.push(h),c.dispatchCommand(Rs,!0)),p.length===0&&c.dispatchCommand(Ms,!1),u.current=m||null,d&&d(u),m&&m.editor.setEditorState(m.editorState,{tag:Ti})}}(e,t,r),!0),Ee),e.registerCommand(xu,()=>(function(c,u,d){let{redoStack:f,undoStack:p}=u;if(f.length!==0){let h=u.current;h!==null&&(p.push(h),c.dispatchCommand(Ms,!0));let m=f.pop();f.length===0&&c.dispatchCommand(Rs,!1),u.current=m||null,d&&d(u),m&&m.editor.setEditorState(m.editorState,{tag:Ti})}}(e,t,r),!0),Ee),e.registerCommand(Zc,()=>(zT(t,r),!1),Ee),e.registerCommand(Gy,()=>(zT(t,r),e.dispatchCommand(Rs,!1),e.dispatchCommand(Ms,!1),!0),Ee),e.registerUpdateListener(({editorState:c,prevEditorState:u,dirtyLeaves:d,dirtyElements:f,tags:p})=>{let{current:h,redoStack:m,undoStack:_}=t,x=h===null?null:h.editorState;if(h!==null&&c===x)return;let C=i(u,c,h,d,f,p);if(C===1){if(m.length!==0&&(t.redoStack=[],e.dispatchCommand(Rs,!1)),h!==null){_.push({...h});let y=typeof s=="number"||s===null?s:s.peek();y!==null&&_.length>y&&_.splice(0,_.length-y),e.dispatchCommand(Ms,!0)}}else if(C===2)return;t.current={editor:e,editorState:c},l()}))}function HT(){return{current:null,redoStack:[],undoStack:[]}}var xd=me({build:(e,{delay:t,createInitialHistoryState:n,disabled:o,maxDepth:r,now:s},i)=>({...Mt({delay:t,disabled:o,historyState:n(e),maxDepth:r,now:s}),...i.getInitResult()}),config:Be({createInitialHistoryState:HT,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:()=>({canRedo:Ks(!1),canUndo:Ks(!1)}),name:"@lexical/history/History",register:(e,t,n)=>{let{canUndo:o,canRedo:r}=n.getInitResult(),s=n.getOutput(),i=(l)=>kp(()=>{o.value=l!=null&&l.undoStack.length>0,r.value=l!=null&&l.redoStack.length>0});return yt(()=>{if(!s.disabled.value)return UT(e,s.historyState.value,s.delay,()=>s.now.peek()(),i,s.maxDepth);i(null)})}}),jw=me({build:(e,{disabled:t,parentEditor:n})=>Mt({disabled:t,parentEditor:n||e._parentEditor}),config:Be({disabled:!1,parentEditor:null}),dependencies:[tn(xd,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,t,n)=>yt(()=>{let{disabled:o,parentEditor:r}=n.getOutput();if(!o.value){let{output:s}=n.getDependency(xd),i=function(c){return c?so(c,xd.name):null}(r.value);if(!i)return;let l=i.output;kp(()=>{s.delay.value=l.delay.value,s.historyState.value=l.historyState.value,s.now.value=l.now.value,s.disabled.value=l.disabled.value})}})});var Cd=_h,{HistoryExtension:dz,SharedHistoryExtension:fz,createEmptyHistoryState:yd,registerHistory:WT}=Cd;L();function Yw({delay:e,externalHistoryState:t}){let[n]=st();return function(o,r,s=1000){let i=Q(()=>r||yd(),[r]);S(()=>WT(o,i,s),[s,o,i])}(n,t,e),null}var GT=xh,{HistoryPlugin:jT,createEmptyHistoryState:xz}=GT;function es(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sd(e){let t=1,n=e.getParent();for(;n!=null;){if(De(n)){let o=n.getParent();if(Ae(o)){t++,n=o.getParent();continue}es(40)}return t}return t}function Ch(e){let t=e.getParent();Ae(t)||es(40);let n=t,o=t;for(;o!==null;)o=o.getParent(),Ae(o)&&(n=o);return n}function t0(e){let t=[],n=e.getChildren().filter(De);for(let o=0;o<n.length;o++){let r=n[o],s=r.getFirstChild();Ae(s)?t=t.concat(t0(s)):t.push(r)}return t}function ao(e){return De(e)&&Ae(e.getFirstChild())}function n0(e,t){return De(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Nd(e){let t=K();if(t!==null){let n=t.getNodes();if(I(t)){let[r]=t.getStartEndPoints(),s=r.getNode(),i=s.getParent();if(At(s)){let l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{let c=ye();s.append(c),n=c.select().getNodes()}}else if(n0(s,n)){let l=No(e);if(At(i)){s.replace(l);let c=Eo();j(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(De(s)){let c=s.getParentOrThrow();Gs(l,c.getChildren()),c.replace(l)}return}}let o=new Set;for(let r=0;r<n.length;r++){let s=n[r];if(j(s)&&s.isEmpty()&&!De(s)&&!o.has(s.getKey())){YT(s,e);continue}let i=sl(s)?s.getParent():De(s)&&s.isEmpty()?s:null;for(;i!=null;){let l=i.getKey();if(Ae(i)){if(!o.has(l)){let c=No(e);Gs(c,i.getChildren()),i.replace(c),o.add(l)}break}{let c=i.getParent();if(At(c)&&!o.has(l)){o.add(l),YT(i,e);break}i=c}}}}}function Gs(e,t){e.splice(e.getChildrenSize(),0,t)}function YT(e,t){if(Ae(e))return e;let n=e.getPreviousSibling(),o=e.getNextSibling(),r=Eo(),s;if(Gs(r,e.getChildren()),Ae(n)&&t===n.getListType())n.append(r),Ae(o)&&t===o.getListType()&&(Gs(n,o.getChildren()),o.remove()),s=n;else if(Ae(o)&&t===o.getListType())o.getFirstChildOrThrow().insertBefore(r),s=o;else{let l=No(t);l.append(r),e.replace(l),s=l}r.setFormat(e.getFormatType()),r.setIndent(e.getIndent());let i=K();return I(i)&&(s.getKey()===i.anchor.key&&i.anchor.set(r.getKey(),i.anchor.offset,"element"),s.getKey()===i.focus.key&&i.focus.set(r.getKey(),i.focus.offset,"element")),e.remove(),s}function Sh(e,t){let n=e.getLastChild(),o=t.getFirstChild();n&&o&&ao(n)&&ao(o)&&(Sh(n.getFirstChild(),o.getFirstChild()),o.remove());let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function o0(){let e=K();if(I(e)){let t=new Set,n=e.getNodes(),o=e.anchor.getNode();if(n0(o,n))t.add(Ch(o));else for(let r=0;r<n.length;r++){let s=n[r];if(sl(s)){let i=Iu(s,js);i!=null&&t.add(Ch(i))}}for(let r of t){let s=r,i=t0(r);for(let l of i){let c=ye().setTextStyle(e.style).setTextFormat(e.format);Gs(c,l.getChildren()),s.insertAfter(c),s=c,l.__key===e.anchor.key&&zo(e.anchor,$t(Et(c,"next"))),l.__key===e.focus.key&&zo(e.focus,$t(Et(c,"next"))),l.remove()}r.remove()}}}function r0(e){let t=e.getListType()!=="check",n=e.getStart();for(let o of e.getChildren())De(o)&&(o.getValue()!==n&&o.setValue(n),t&&o.getLatest().__checked!=null&&o.setChecked(void 0),Ae(o.getFirstChild())||n++)}function Vw(e){let t=new Set;if(ao(e)||t.has(e.getKey()))return;let n=e.getParent(),o=e.getNextSibling(),r=e.getPreviousSibling();if(ao(o)&&ao(r)){let s=r.getFirstChild();if(Ae(s)){s.append(e);let i=o.getFirstChild();if(Ae(i))Gs(s,i.getChildren()),o.remove(),t.add(o.getKey())}}else if(ao(o)){let s=o.getFirstChild();if(Ae(s)){let i=s.getFirstChild();i!==null&&i.insertBefore(e)}}else if(ao(r)){let s=r.getFirstChild();Ae(s)&&s.append(e)}else if(Ae(n)){let s=Ht(e),i=Ht(n);s.append(i),i.append(e),r?r.insertAfter(s):o?o.insertBefore(s):n.append(s)}}function VT(e){if(ao(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(Ae(n?n.getParent():void 0)&&De(n)&&Ae(t)){let o=t?t.getFirstChild():void 0,r=t?t.getLastChild():void 0;if(e.is(o))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(r))n.insertAfter(e),t.isEmpty()&&n.remove();else{let s=Ht(e),i=Ht(t);s.append(i),e.getPreviousSiblings().forEach((u)=>i.append(u));let l=Ht(e),c=Ht(t);l.append(c),Gs(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function s0(e=!1){let t=K();if(!I(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),o=null;if(De(n)&&n.getChildrenSize()===0)o=n;else if(ne(n)){let u=n.getParent();De(u)&&u.getChildren().every((d)=>ne(d)&&d.getTextContent().trim()==="")&&(o=u)}if(o===null)return!1;let r=Ch(o),s=o.getParent();Ae(s)||es(40);let i=s.getParent(),l;if(At(i))l=ye(),r.insertAfter(l);else{if(!De(i))return!1;l=Ht(i),i.insertAfter(l)}l.setTextStyle(t.style).setTextFormat(t.format).select();let c=o.getNextSiblings();if(c.length>0){let u=e?function(f,p){return f.getStart()+p.getIndexWithinParent()}(s,o):1,d=Ht(s).setStart(u);if(De(l)){let f=Ht(l);f.append(d),l.insertAfter(f)}else l.insertAfter(d);d.append(...c)}return function(u){let d=u;for(;d.getNextSibling()==null&&d.getPreviousSibling()==null;){let f=d.getParent();if(f==null||!De(f)&&!Ae(f))break;d=f}d.remove()}(o),!0}class js extends lt{__value;__checked;$config(){return this.config("listitem",{$transform:(e)=>{let t=e.getParent();if(Ae(t))t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();Ae(n)||es(340);let o=[e];for(let r of["previous","next"]){o.reverse();for(let{origin:s}of it(e,r)){if(!De(s))break;o.push(s)}}e.insertBefore(n),n.splice(0,0,o),At(t)||(Br(n,Ko(it(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:lt,importDOM:jg({li:()=>({conversion:Xw,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=je().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(s,i){let l=i.getParent();!Ae(l)||l.getListType()!=="check"||Ae(i.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),s.setAttribute("aria-checked",i.getChecked()?"true":"false"))})(t,this),t.value=this.__value,function(s,i,l){let c=i.list;if(!c)return;let u=c.listitem,d=c.nested&&c.nested.listitem,f=l.getParent(),p=Ae(f)&&f.getListType()==="check",h=l.getChecked(),m=l.getChildren().some((C)=>Ae(C)),_=[];c.listitemChecked!==void 0&&_.push(c.listitemChecked),c.listitemUnchecked!==void 0&&_.push(c.listitemUnchecked),d!==void 0&&_.push(...Ii(d)),_.length>0&&nn(s,..._);let x=[];if(u!==void 0&&x.push(...Ii(u)),p){let C=h?c.listitemChecked:c.listitemUnchecked;C!==void 0&&x.push(C)}d!==void 0&&m&&x.push(...Ii(d)),x.length>0&&Qe(s,...x)}(t,n.theme,this);let o=e?e.__style:"",r=this.__style;o!==r&&ur(t.style,r,o),function(s,i,l){let c=i.__textStyle,u=l?l.__textStyle:"";if(l!==null&&u===c)return;let d=Vr(c);for(let f in d)s.style.setProperty(`--listitem-marker-${f}`,d[f]);if(u!=="")for(let f in Vr(u))f in d||s.style.removeProperty(`--listitem-marker-${f}`)}(t,this,e)}updateDOM(e,t,n){let o=t;return this.updateListItemDOM(e,o,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let o=this.getDirection();return o&&(t.dir=o),ao(this)?{after(r){if(Ce(r)){let s=r.previousElementSibling;if(Ce(s)&&s.nodeName==="LI"){for(;r.firstChild;)s.append(r.firstChild);r.remove()}}return r},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(j(n)&&this.canMergeWith(n)){let o=n.getChildren();this.append(...o),n.remove()}else super.append(n)}return this}replace(e,t){if(De(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!Ae(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let s=Ht(n),i=this.getNextSibling();for(;i;){let l=i;i=i.getNextSibling(),s.append(l)}n.insertAfter(e),e.insertAfter(s)}let o=this.__key,r=0;if(t&&(j(e)||es(139),r=e.getChildrenSize(),e.splice(r,0,this.getChildren())),t&&j(e)){let s=K();if(I(s))for(let i of s.getStartEndPoints())i.key===o&&i.type==="element"&&i.set(e.getKey(),r+i.offset,"element")}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(Ae(n)||es(39),De(e))return super.insertAfter(e,t);let o=this.getNextSiblings();if(n.insertAfter(e,t),o.length!==0){let r=Ht(n);o.forEach((s)=>r.append(s)),e.insertAfter(r,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&ao(t)&&ao(n)&&(Sh(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=Ht(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(ao(this))return!1;let t=this.getParentOrThrow();if(De(t.getParentOrThrow()))return VT(this),!0;let n=ye().append(...this.getChildren()),o=this.getNextSiblings();if(o.length>0){let r=Ht(t);r.append(...o),t.insertAfter(r)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return Ae(n)&&(t=n.getListType()),t==="check"?Boolean(e.__checked):void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;De(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&es(117),(e=Math.floor(e))>=0||es(199);let t=this.getIndent();for(;t!==e;)t<e?(Vw(this),t++):(VT(this),t--);return this}canInsertAfter(e){return De(e)}canReplaceWith(e){return De(e)}canMergeWith(e){return De(e)||An(e)}extractWithChild(e,t){if(!I(t))return!1;let n=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(o)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return No("bullet")}canMergeWhenEmpty(){return!0}}function Xw(e){if(e.classList.contains("task-list-item")){for(let o of e.children)if(o.tagName==="INPUT")return XT(o)}if(e.classList.contains("joplin-checkbox")){for(let o of e.children)if(o.classList.contains("checkbox-wrapper")&&o.children.length>0&&o.children[0].tagName==="INPUT")return XT(o.children[0])}let t=e.getAttribute("aria-checked"),n=Eo(t==="true"||t!=="false"&&void 0);return Zn(n,e),{after:i0.bind(null,n),node:yn(n,e)}}function XT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let t=Eo(e.hasAttribute("checked"));return{after:i0.bind(null,t),node:t}}function i0(e,t){let n=t[0];return t.length===1&&An(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function Eo(e){return sn(new js(void 0,e))}function De(e){return e instanceof js}class qi extends lt{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(t){let n=t.getNextSibling();Ae(n)&&t.getListType()===n.getListType()&&Sh(t,n)})(e),r0(e)},extends:lt,importDOM:jg({ol:()=>({conversion:JT,priority:0}),ul:()=>({conversion:JT,priority:0})})})}constructor(e="number",t=1,n){super(n);let o=qw[e]||e;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,o=je().createElement(n);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,qT(o,e.theme,this),o}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(qT(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return Ce(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let o=n;for(let r=0;r<n.length;r++){let s=n[r];De(s)||(o===n&&(o=[...n]),o[r]=this.createListItemNode().append(!j(s)||Ae(s)||s.isInline()?s:xt(s.getTextContent())))}return super.splice(e,t,o)}extractWithChild(e){return De(e)}createListItemNode(){return Eo()}}function qT(e,t,n){let o=[],r=[],s=t.list;if(s!==void 0){let i=s[`${n.__tag}Depth`]||[],l=Sd(n)-1,c=l%i.length,u=i[c],d=s[n.__tag],f,{nested:p,checklist:h}=s;if(p!==void 0&&p.list&&(f=p.list),d!==void 0&&o.push(d),h!==void 0&&n.__listType==="check"&&o.push(h),u!==void 0){o.push(...Ii(u));for(let m=0;m<i.length;m++)m!==c&&r.push(n.__tag+m)}if(f!==void 0){let m=Ii(f);l>1?o.push(...m):r.push(...m)}}r.length>0&&nn(e,...r),o.length>0&&Qe(e,...o)}function JT(e){let t;if(function(n){return Ce(n)&&n.nodeName.toLowerCase()==="ol"}(e)){let n=e.start;t=No("number",n)}else t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list")||n.getAttribute("data-is-checklist")==="1")return!0;for(let o of n.childNodes)if(Ce(o)&&o.hasAttribute("aria-checked"))return!0;return!1}(e)?No("check"):No("bullet");return yn(t,e),{after:(n)=>function(o,r){let s=r.createListItemNode.bind(r),i=[];for(let l=0;l<o.length;l++){let c=o[l];if(De(c)){i.push(c);let u=c.getChildren();u.length>1&&u.forEach((d)=>{Ae(d)&&i.push(s().append(d))})}else i.push(s().append(c))}return i}(n,t),node:t}}var qw={ol:"number",ul:"bullet"};function No(e="number",t=1){return sn(new qi(e,t))}function Ae(e){return e instanceof qi}var a0=Sn("INSERT_CHECK_LIST_COMMAND");function l0(e,t){let n=t&&t.disableTakeFocusOnClick||!1,o=typeof n=="boolean"?()=>n:n.peek.bind(n),r=(u)=>{let d=u.target;if(!Ce(d))return!1;let f=d.__lexicalCheckListLastHandled;return f!==void 0&&u.timeStamp-f<500},s=(u)=>{let d=u.target;Ce(d)&&(d.__lexicalCheckListLastHandled=u.timeStamp)},i=(u)=>{r(u)||(s(u),ZT(u,o()))},l=(u)=>{u.pointerType==="touch"&&(r(u)||(s(u),ZT(u,o())))},c=(u)=>{(function(d,f){c0(d,()=>{d.preventDefault(),f&&d.stopPropagation()})})(u,o())};return Oe(e.registerCommand(a0,()=>(Nd("check"),!0),we),e.registerCommand(Ho,(u)=>QT(u,e,!1),we),e.registerCommand(to,(u)=>QT(u,e,!0),we),e.registerCommand(Ai,()=>{if(yh(e)!=null){let u=e.getRootElement();return u!=null&&u.focus(),!0}return!1},we),e.registerCommand(mu,(u)=>{let d=yh(e);return!(d==null||!e.isEditable())&&(e.update(()=>{let f=Tt(d);De(f)&&(u.preventDefault(),f.toggleChecked())}),!0)},we),e.registerCommand(Gr,(u)=>e.read("latest",()=>{let d=K();if(I(d)&&d.isCollapsed()){let{anchor:f}=d,p=f.type==="element";if(p||f.offset===0){let h=f.getNode(),m=pe(h,(_)=>j(_)&&!_.isInline());if(De(m)){let _=m.getParent();if(Ae(_)&&_.getListType()==="check"&&(p||m.getFirstDescendant()===h)){let x=e.getElementByKey(m.__key);if(x!=null&&yo(x)!==x)return x.focus(),u.preventDefault(),!0}}}}return!1}),we),e.registerRootListener((u)=>{if(u!==null)return Oe(qr(u,{click:i,pointerup:l}),qr(u,{mousedown:c,pointerdown:c},{capture:!0}),ro(u,"touchstart",c,{capture:!0,passive:!1}))}))}function c0(e,t){let n=e.target;if(!Ce(n))return;let o=n.firstChild;if(Ce(o)&&(o.tagName==="UL"||o.tagName==="OL"))return;let r=n.parentNode;if(!r||r.__lexicalListType!=="check")return;let s=null,i=null;if("clientX"in e)s=e.clientX;else if("touches"in e){let h=e.touches;h.length>0&&(s=h[0].clientX,i="touch")}if(s==null)return;let l=n.getBoundingClientRect(),c=s/sN(n),u=n.ownerDocument.defaultView,d=u?u.getComputedStyle(n,"::before"):{width:"0px"},f=parseFloat(d.width),p=i==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(n.dir==="rtl"?c<l.right+p&&c>l.right-f-p:c>l.left-p&&c<l.left+f+p)&&t()}function ZT(e,t){c0(e,()=>{if(Ce(e.target)){let n=e.target,o=vu(n);o!=null&&o.isEditable()&&o.update(()=>{let r=Tt(n);De(r)&&(t?(el(Su),el(lS)):n.focus(),r.toggleChecked())})}})}function yh(e){let t=e.getRootElement(),n=t?yo(t):null;return Ce(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function QT(e,t,n){let o=yh(t);return o!=null&&t.update(()=>{let r=Tt(o);if(!De(r))return;let s=function(i,l){let c=l?i.getPreviousSibling():i.getNextSibling(),u=i;for(;c==null&&De(u);)u=u.getParentOrThrow().getParent(),u!=null&&(c=l?u.getPreviousSibling():u.getNextSibling());for(;De(c);){let d=l?c.getLastChild():c.getFirstChild();if(!Ae(d))return c;c=l?d.getLastChild():d.getFirstChild()}return null}(r,n);if(s!=null){s.selectStart();let i=t.getElementByKey(s.__key);i!=null&&(e.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}function Jw(e){let t=[];for(let n of e)if(De(n)){t.push(n);let o=n.getChildren();if(o.length>1)for(let r of o)Ae(r)&&t.push(Eo().append(r))}else t.push(Eo().append(n));return t}var Zw=ut({$import:(e,t)=>{let n;var o;return sh(t,"ol")?n=No("number",t.start):n=(o=t).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||o.querySelector(":scope > [aria-checked]")!==null?No("check"):No("bullet"),yn(n,t),[n.splice(0,0,od(Jw(e.$importChildren(t)),t))]},match:dt.tag("ol","ul"),name:"@lexical/list/list"});function u0(e,t){if(t.length!==1)return t;let n=t[0];return An(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function d0(e){let t=(i)=>ZE(i)&&!Ae(i);if(!e.some(t))return e;let n=[],o=[],r=()=>{o.length>0&&(n.push(o),o=[])};for(let i of e)t(i)?(r(),n.push(j(i)?i.getChildren():[i])):o.push(i);r();let s=[];for(let i of n)s.length>0&&s.push(ln()),s.push(...i);return s}var Qw=ut({$import:(e,t)=>{let n=t.getAttribute("aria-checked"),o=Eo(n==="true"||n!=="false"&&void 0);return Zn(o,t),yn(o,t),[o.splice(0,0,d0(u0(o,e.$importChildren(t))))]},match:dt.tag("li"),name:"@lexical/list/li"});function e0(e,t,n){let o=sh(n,"input")?n:n.querySelector('input[type="checkbox"]');if(!o||o.getAttribute("type")!=="checkbox")return[];let r=Eo(o.hasAttribute("checked"));return Zn(r,t),yn(r,t),[r.splice(0,0,d0(u0(r,e.$importChildren(t))))]}var ek={$accepts:(e)=>De(e)||Ae(e),$packageRun:(e)=>[Eo().splice(0,0,e)],name:"ListSchema"},f0=[ut({$import:(e,t,n)=>{let o=t.querySelector(':scope > input[type="checkbox"]');return o?e0(e,t,o):n()},match:dt.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),ut({$import:(e,t,n)=>{let o=t.querySelector(":scope > .checkbox-wrapper");if(!o)return n();let r=o.querySelector(':scope > input[type="checkbox"]');return r?e0(e,t,r):n()},match:dt.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Zw,Qw],g0=Sn("UPDATE_LIST_START_COMMAND"),p0=Sn("INSERT_UNORDERED_LIST_COMMAND"),h0=Sn("INSERT_ORDERED_LIST_COMMAND"),m0=Sn("REMOVE_LIST_COMMAND");function _0(e,t){return Oe(e.registerCommand(h0,()=>(Nd("number"),!0),we),e.registerCommand(g0,(n)=>{let{listNodeKey:o,newStart:r}=n,s=Ot(o);return!!Ae(s)&&(s.getListType()==="number"&&(s.setStart(r),r0(s)),!0)},we),e.registerCommand(p0,()=>(Nd("bullet"),!0),we),e.registerCommand(m0,()=>(o0(),!0),we),e.registerCommand(Wr,()=>s0(!!(t&&t.restoreNumbering)),we),e.registerCommand(vi,(n)=>{let o=K();if(!I(o)||!o.isCollapsed())return!1;let{anchor:r}=o;if(r.offset!==0)return!1;let s=r.getNode();for(;!De(s);){if(s.getPreviousSibling()!==null)return!1;let i=s.getParent();if(i===null)return!1;s=i}return!(!De(s)||!s.collapseAtStart(o))&&(n.preventDefault(),!0)},Qc),e.registerNodeTransform(js,(n)=>{let o=n.getFirstChild();if(o){if(ne(o)){let r=o.getStyle(),s=o.getFormat();n.getTextStyle()!==r&&n.setTextStyle(r),n.getTextFormat()!==s&&n.setTextFormat(s)}}else{let r=K();I(r)&&(r.style!==n.getTextStyle()||r.format!==n.getTextFormat())&&r.isCollapsed()&&n.is(r.anchor.getNode())&&n.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(wn,(n)=>{let o=n.getParent();if(De(o)&&n.is(o.getFirstChild())){let r=n.getStyle(),s=n.getFormat();r===o.getTextStyle()&&s===o.getTextFormat()||o.setTextStyle(r).setTextFormat(s)}}))}function x0(e){let t=(n)=>{let o=n.getParent();if(Ae(n.getFirstChild())||!Ae(o))return;let r=pe(n,(s)=>De(s)&&Ae(s.getParent())&&De(s.getPreviousSibling()));if(r===null&&n.getIndent()>0)n.setIndent(0);else if(De(r)){let s=r.getPreviousSibling();if(De(s)){let i=function(c){let u=c,d=u.getFirstChild();for(;Ae(d);){let f=d.getLastChild();if(!De(f))break;u=f,d=u.getFirstChild()}return u}(s),l=i.getParent();if(Ae(l)){let c=Sd(l);c+1<Sd(o)&&n.setIndent(c)}}}};return e.registerNodeTransform(qi,(n)=>{let o=[n];for(;o.length>0;){let r=o.shift();if(Ae(r)){for(let s of r.getChildren())if(De(s)){t(s);let i=s.getFirstChild();Ae(i)&&o.push(i)}}}})}var Nh=me({build:(e,t,n)=>Mt(t),config:Be({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[io,tn(Yo,{rules:f0})],name:"@lexical/list/List",nodes:()=>[qi,js],register(e,t,n){let o=n.getOutput();return Oe(yt(()=>_0(e,{restoreNumbering:o.shouldPreserveNumbering.value})),yt(()=>o.hasStrictIndent.value?x0(e):void 0))}}),tk=me({build:(e,t)=>Mt(t),config:Be({disableTakeFocusOnClick:!1}),dependencies:[Nh],name:"@lexical/list/CheckList",register:(e,t,n)=>l0(e,n.getOutput())}),nk=me({dependencies:[Nh],name:"@lexical/list/Import"});var St=Eh,{$createListItemNode:C0,$createListNode:y0,$getListDepth:Tz,$handleListInsertParagraph:bz,$insertList:vz,$isListItemNode:Th,$isListNode:To,$removeList:Oz,CheckListExtension:Az,INSERT_CHECK_LIST_COMMAND:S0,INSERT_ORDERED_LIST_COMMAND:N0,INSERT_UNORDERED_LIST_COMMAND:E0,ListExtension:Rz,ListImportExtension:Mz,ListImportRules:Dz,ListItemNode:ts,ListNode:Vo,ListSchema:$z,REMOVE_LIST_COMMAND:Ed,UPDATE_LIST_START_COMMAND:wz,registerCheckList:T0,registerList:bh,registerListStrictIndentTransform:b0}=St;L();function ok({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){let[n]=st();return S(()=>{if(!n.hasNodes([Vo,ts]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),S(()=>Oe(bh(n,{restoreNumbering:t}),e?b0(n):()=>{}),[n,e,t]),function(o){S(()=>bh(o),[o])}(n),null}var rk=vh,v0=rk.ListPlugin;L();function sk({disableTakeFocusOnClick:e=!1}){let[t]=st();return S(()=>T0(t,{disableTakeFocusOnClick:e}),[t,e]),null}var ik=Oh,O0=ik.CheckListPlugin;L();function ak({maxIndent:e,$canIndent:t}){let[n]=st();return S(()=>Yu(n,e,t),[n,e,t]),null}var A0=Ah,{TabIndentationPlugin:R0,registerTabIndentation:Vz}=A0;var M0=new Set(["http:","https:","mailto:","sms:","tel:"]);class ns extends lt{__url;__target;__rel;__title;$config(){return this.config("link",{extends:lt,importDOM:{a:()=>({conversion:ck,priority:1})}})}constructor(e="",t={},n){super(n);let{target:o=null,rel:r=null,title:s=null}=t;this.__url=e,this.__target=o,this.__rel=r,this.__title=s}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let t=je().createElement("a");return this.updateLinkDOM(null,t,e),Qe(t,e.theme.link),t}updateLinkDOM(e,t,n){if(wi(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let o of["target","rel","title"]){let r=`__${o}`,s=this[r];e&&e[r]===s||(s?t[o]=s:t.removeAttribute(o))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let t=e;e=Rh(e);try{let n=new URL(Rh(e));if(!M0.has(n.protocol))return"about:blank"}catch(n){let o=t.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(o!=null&&!M0.has(`${o[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Ht(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!I(t))return!1;let o=t.anchor.getNode(),r=t.focus.getNode();return(this.is(o)||this.isParentOf(o))&&(this.is(r)||this.isParentOf(r))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}}function D0(e){let t=an(e,"next");return[t,t.getFlipped()]}function $0(e,t){for(let n of t)if(n.origin.isAttached()){let o=$t(n);return void zo(e,o)}}function lk(e){let t=K(),n=null,o=null;function r(){I(t)&&($0(t.anchor,n),$0(t.focus,o),Po(t))}I(t)&&(n=D0(t.anchor),o=D0(t.focus));let s=!1;for(let l of Et(e,"next")){let c=l.origin;if(j(c)&&!c.isInline()){let u=c.getChildren();if(u.length>0){let d=Ht(e);d.append(...u),c.append(d),s=!0}Br(c,Ko(l),{$shouldSplit:()=>!1})}}function i(l,c,u){let[d,f]=l,p=(m)=>Co(m)&&m.origin.is(c);if(!p(d)&&!p(f))return l;let h=$t(Et(u,"next"));return[h,h.getFlipped()]}if(e.isAttached()){let l=e.getPreviousSibling();if(Ln(l)&&l.shouldMergeAdjacentLink(e))return n&&(n=i(n,l,e)),o&&(o=i(o,l,e)),l.append(...e.getChildren()),e.remove(),void r();let c=e.getNextSibling();Ln(c)&&e.shouldMergeAdjacentLink(c)&&(n&&(n=i(n,e,c)),o&&(o=i(o,e,c)),e.append(...c.getChildren()),c.remove(),s=!0)}if(s){if(!e.canBeEmpty()&&e.isEmpty()){let l=e.getParent();e.remove(),l&&l.isEmpty()&&l.remove()}r()}}function ck(e){let t=null;if(wi(e)){let n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Ll(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Ll(e="",t){return sn(new ns(e,t))}function Ln(e){return e instanceof ns}class Pl extends ns{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:ns})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?je().createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=$h(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}}function $h(e="",t){return sn(new Pl(e,t))}function fn(e){return e instanceof Pl}var bd=Sn("TOGGLE_LINK_COMMAND");function w0(e,t){if(e.type==="element"){let n=e.getNode();return j(n)||function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let l of r)i.append("v",l);throw s.search=i.toString(),Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Td(e,t={}){let n;if(e&&typeof e=="object"){let{url:d,...f}=e;n=d,t={...f,...t}}else n=e;let{target:o,title:r}=t,s=t.rel===void 0?"noreferrer":t.rel,i=K();if(i===null||!I(i)&&!Je(i))return;if(Je(i)){let d=i.getNodes();if(d.length===0)return;return void d.forEach((f)=>{if(n===null){let p=pe(f,(h)=>!fn(h)&&Ln(h));p&&(p.insertBefore(f),p.getChildren().length===0&&p.remove())}else{let p=pe(f,(h)=>!fn(h)&&Ln(h));if(p)p.setURL(n),o!==void 0&&p.setTarget(o),s!==void 0&&p.setRel(s);else{let h=Ll(n,{rel:s,target:o});f.insertBefore(h),h.append(f)}}})}if(i.isCollapsed()&&n===null)for(let d of i.getNodes()){let f=pe(d,(p)=>!fn(p)&&Ln(p));return void(f!==null&&(f.getParentOrThrow().splice(f.getIndexWithinParent(),0,f.getChildren()),f.remove()))}let l=i.extract();if(n===null){let d=new Set;return void l.forEach((f)=>{let p=pe(f,(h)=>!fn(h)&&Ln(h));if(p!==null){let h=p.getKey();if(d.has(h))return;(function(m,_){let x=new Set(_.filter((O)=>m.isParentOf(O)).map((O)=>O.getKey())),C=m.getChildren(),y=(O)=>x.has(O.getKey())||j(O)&&_.some((D)=>m.isParentOf(D)&&O.isParentOf(D)),N=C.filter(y);if(N.length===C.length)return C.forEach((O)=>m.insertBefore(O)),void m.remove();let E=C.findIndex(y),v=C.findLastIndex(y),b=E===0,A=v===C.length-1;if(b)N.forEach((O)=>m.insertBefore(O));else if(A)for(let O=N.length-1;O>=0;O--)m.insertAfter(N[O]);else{for(let D=N.length-1;D>=0;D--)m.insertAfter(N[D]);let O=C.slice(v+1);if(O.length>0){let D=Ht(m);N[N.length-1].insertAfter(D),O.forEach((H)=>D.append(H))}}})(p,l),d.add(h)}})}let c=new Set,u=(d)=>{c.has(d.getKey())||(c.add(d.getKey()),d.setURL(n),o!==void 0&&d.setTarget(o),s!==void 0&&d.setRel(s),r!==void 0&&d.setTitle(r))};if(l.length===1){let d=l[0],f=pe(d,Ln);if(f!==null)return u(f)}(function(d){let f=K();if(!I(f))return d();let p=Po(f),h=p.isBackward(),m=w0(p.anchor,h?-1:0),_=w0(p.focus,h?0:-1),x=d();if(m||_){let C=K();if(I(C)){let y=C.clone();if(m){let N=m.getParent();N&&y.anchor.set(N.getKey(),m.getIndexWithinParent()+(h?1:0),"element")}if(_){let N=_.getParent();N&&y.focus.set(N.getKey(),_.getIndexWithinParent()+(h?0:1),"element")}pt(Po(y))}}})(()=>{let d=null;for(let f of l){if(!f.isAttached())continue;let p=pe(f,Ln);if(p){u(p);continue}if(j(f)){if(!f.isInline())continue;if(Ln(f)){if(!(fn(f)||d!==null&&d.getParentOrThrow().isParentOf(f))){u(f),d=f;continue}for(let m of f.getChildren())f.insertBefore(m);f.remove();continue}}let h=f.getPreviousSibling();Ln(h)&&h.is(d)?h.append(f):(d=Ll(n,{rel:s,target:o,title:r}),f.insertAfter(d),d.append(f))}})}var uk=/^\+?[0-9\s()-]{5,}$/;function Rh(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:uk.test(e)?`tel:${e}`:`https://${e}`}var I0=[ut({$import:(e,t)=>{if(!t.textContent&&t.children.length===0)return[];let n=t.getAttribute("href")||"",o={rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")};return VE(e.$importChildren(t),()=>Ll(n,o))},match:dt.tag("a"),name:"@lexical/link/a"})];function L0(e,t){return Oe(e.registerNodeTransform(ns,lk),e.registerCommand(bd,(n)=>{let o=t.validateUrl.peek(),r=t.attributes.peek();if(n===null)return Td(null),!0;if(typeof n=="string")return!(o!==void 0&&!o(n))&&(Td(n,r),!0);{let{url:s,target:i,rel:l,title:c}=n;return Td(s,{...r,rel:l,target:i,title:c}),!0}},Ee),yt(()=>{let n=t.validateUrl.value;if(!n)return;let o=t.attributes.value;return e.registerCommand(Mi,(r)=>{let s=K();if(!I(s)||s.isCollapsed()||!In(r,ClipboardEvent))return!1;if(r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");if(!n(i))return!1;return!s.getNodes().some((l)=>j(l)||ne(l)&&!l.isSimpleText())&&(e.dispatchCommand(bd,{...o,url:i}),r.preventDefault(),!0)},we)}))}var Od=me({build:(e,t,n)=>Mt(t),config:{attributes:void 0,validateUrl:void 0},dependencies:[io,tn(Yo,{rules:I0})],mergeConfig(e,t){let n=Pt(e,t);return e.attributes&&(n.attributes=Pt(e.attributes,n.attributes)),n},name:"@lexical/link/Link",nodes:()=>[ns],register:(e,t,n)=>L0(e,n.getOutput())}),dk=me({dependencies:[Od],name:"@lexical/link/Import"});function F0(e,t,n={}){let o=(s)=>{let i=s.target;if(!oo(i))return;let l=vu(i);if(l===null)return;let c=null,u=null,d=!1;if(l.update(()=>{let h=Tt(i);if(h!==null){let m=pe(h,j);if(!t.disabled.peek())if(Ln(m))d=fn(m)&&m.getIsUnlinked(),c=m.sanitizeUrl(m.getURL()),u=m.getTarget();else{let _=function(x,C){let y=x;for(;y!=null;){if(C(y))return y;y=y.parentNode}return null}(i,wi);_!==null&&(c=_.href,u=_.target)}}}),c===null||c===""||d)return;let f=e.read("latest",K);if(I(f)&&!f.isCollapsed())return void s.preventDefault();let p=s.type==="auxclick"&&s.button===1;window.open(c,t.newTab.peek()||p||s.metaKey||s.ctrlKey||u==="_blank"?"_blank":"_self"),s.preventDefault()},r=(s)=>{s.button===1&&o(s)};return e.registerRootListener((s)=>{if(s)return qr(s,{click:o,mouseup:r},n)})}var fk=me({build:(e,t,n)=>Mt(t),config:Be({disabled:!1,newTab:!1}),dependencies:[Od],name:"@lexical/link/ClickableLink",register:(e,t,n)=>F0(e,n.getOutput())});function P0(e,t=(n)=>n){return(n)=>{let o=e.exec(n);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:t(o[0])}}}var gk=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,pk=(e)=>{let t=gk.exec(e);if(t===null)return null;let n=t[0],o=0;for(let r of n)r==="("?o++:r===")"&&o--;for(;o<0&&n.endsWith(")");)n=n.slice(0,-1),o++;return{index:t.index,length:n.length,text:n,url:n.startsWith("http")?n:`https://${n}`}},hk=P0(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,(e)=>`mailto:${e}`);function Mh(e,t){for(let n=0;n<t.length;n++){let o=t[n](e);if(o)return o}return null}var B0=/[.,;\s]/;function vd(e,t){return t.test(e)}function K0(e,t){return vd(e[e.length-1],t)}function Dh(e,t){return vd(e[0],t)}function z0(e,t){let n=e.getPreviousSibling();return j(n)&&(n=n.getLastDescendant()),n===null||Pe(n)||ne(n)&&K0(n.getTextContent(),t)}function U0(e,t){let n=e.getNextSibling();return j(n)&&(n=n.getFirstDescendant()),n===null||Pe(n)||ne(n)&&Dh(n.getTextContent(),t)}function mk(e,t,n,o,r){if(!(e>0?vd(o[e-1],n):z0(r[0],n)))return!1;return t<o.length?vd(o[t],n):U0(r[r.length-1],n)}function _k(e,t,n){let o=[],r=[],s=[],i=0,l=0,c=[...e];for(;c.length>0;){let u=c[0],d=u.getTextContent().length,f=l;l+d<=t?(o.push(u),i+=d):f>=n?s.push(u):r.push(u),l+=d,c.shift()}return[i,o,r,s]}function xk(e,t,n,o){let r=$h(o.url,o.attributes);if(e.length===1){let s,i=e[0];t===0?[s,i]=i.splitText(n):[,s,i]=i.splitText(t,n);let l=xt(o.text);return l.setFormat(s.getFormat()),l.setDetail(s.getDetail()),l.setStyle(s.getStyle()),r.append(l),s.replace(r),i}if(e.length>1){let s=e[0],i,l=s.getTextContent().length;t===0?i=s:[,i]=s.splitText(t);let c=[],u;for(let h=1;h<e.length;h++){let m=e[h],_=m.getTextContent().length,x=l;if(x<n)if(l+_<=n)c.push(m);else{let[C,y]=m.splitText(n-x);c.push(C),u=y}l+=_}let d=K(),f=d?d.getNodes().find(ne):void 0,p=xt(i.getTextContent());return p.setFormat(i.getFormat()),p.setDetail(i.getDetail()),p.setStyle(i.getStyle()),r.append(p,...c),f&&f===i&&(I(d)?p.select(d.anchor.offset,d.focus.offset):Je(d)&&p.select(0,p.getTextContent().length)),i.replace(r),u}}function k0(e,t,n,o){let r=e.getChildren(),s=r.length;for(let u=0;u<s;u++){let d=r[u];if(!ne(d)||!d.isSimpleText())return Il(e),void n(null,e.getURL())}let i=e.getTextContent(),l=Mh(i,t);if(l===null||l.text!==i)return Il(e),void n(null,e.getURL());if(!z0(e,o)||!U0(e,o))return Il(e),void n(null,e.getURL());let c=e.getURL();if(c!==l.url&&(e.setURL(l.url),n(l.url,c)),l.attributes){let u=e.getRel();u!==l.attributes.rel&&(e.setRel(l.attributes.rel||null),n(l.attributes.rel||null,u));let d=e.getTarget();d!==l.attributes.target&&(e.setTarget(l.attributes.target||null),n(l.attributes.target||null,d))}}function Il(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((n)=>n.getLatest())}var H0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:B0};function W0(e,t=H0){let{matchers:n,changeHandlers:o,excludeParents:r,separatorRegex:s=B0}=t,i=(l,c)=>{for(let u of o)u(l,c)};return Oe(e.registerNodeTransform(wn,(l)=>{let c=l.getParentOrThrow(),u=l.getPreviousSibling();if(fn(c))k0(c,n,i,s);else if(!Ln(c)&&!r.some((d)=>d(c))){if(l.isSimpleText()&&(Dh(l.getTextContent(),s)||!fn(u))){let d=function(f){let p=[f],h=f.getNextSibling();for(;h!==null&&ne(h)&&h.isSimpleText()&&(p.push(h),!/[\s]/.test(h.getTextContent()));)h=h.getNextSibling();return p}(l);(function(f,p,h,m){for(let E of f){let v=E.getParent();if(fn(v)&&!v.getIsUnlinked())return}let _=[...f],x=_.map((E)=>E.getTextContent()).join(""),C,y=x,N=0;for(;(C=Mh(y,p))&&C!==null;){let E=C.index,v=E+C.length;if(mk(N+E,N+v,m,x,_)){let[b,,A,O]=_k(_,N+E,N+v),D=!1;for(let k of A){let J=k.getParent();if(fn(J)&&!J.getIsUnlinked()){D=!0;break}}if(D){N+=v,y=y.substring(v);continue}let H=xk(A,N+E-b,N+v-b,C);_=H?[H,...O]:O,h(C.url,null),N=0}else N+=v;y=y.substring(v)}})(d,n,i,s)}(function(d,f,p,h){let m=d.getParent(),_=d.getPreviousSibling(),x=d.getNextSibling(),C=d.getTextContent();if(!fn(m)||m.getIsUnlinked()){if(fn(_)&&!_.getIsUnlinked()&&_.is(d.getPreviousSibling())&&d.getParent()===_.getParent()){if(!Dh(C,h))return Il(_),void p(null,_.getURL());if(y=C,_.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(y):/^\.[a-zA-Z0-9]{1,}/.test(y)){let N=_.getTextContent()+C,E=Mh(N,f);E!==null&&E.text===N&&(_.append(d),k0(_,f,p,h),p(null,_.getURL()))}}var y;!fn(x)||x.getIsUnlinked()||K0(C,h)||x.is(d.getNextSibling())&&d.getParent()===x.getParent()&&(Il(x),p(null,x.getURL()))}})(l,n,i,s)}}),e.registerCommand(bd,(l)=>{let c=K();if(l!==null||!I(c))return!1;return c.extract().forEach((u)=>{let d=u.getParent();fn(d)&&(d.setIsUnlinked(!d.getIsUnlinked()),d.markDirty())}),!1},we))}var Ck=me({config:H0,dependencies:[Od],mergeConfig(e,t){let n=Pt(e,t);for(let o of["matchers","changeHandlers","excludeParents"]){let r=t[o];Array.isArray(r)&&(n[o]=[...e[o],...r])}return n},name:"@lexical/link/AutoLink",nodes:[Pl],register:W0});var kt=wh,{$createAutoLinkNode:eU,$createLinkNode:G0,$isAutoLinkNode:j0,$isLinkNode:Ji,$toggleLink:tU,AutoLinkExtension:nU,AutoLinkNode:V0,ClickableLinkExtension:oU,LinkExtension:rU,LinkImportExtension:sU,LinkImportRules:iU,LinkNode:Zi,TOGGLE_LINK_COMMAND:kh,autoLinkEmailMatcher:aU,autoLinkUrlMatcher:lU,createLinkMatcherWithRegExp:cU,formatUrl:uU,registerAutoLink:dU,registerClickableLink:fU,registerLink:X0}=kt;L();function yk({validateUrl:e,attributes:t}){let[n]=st();return S(()=>{if(!n.hasNodes([Zi]))throw Error("LinkPlugin: LinkNode not registered on editor")}),S(()=>X0(n,Mt({attributes:t,validateUrl:e})),[n,e,t]),null}var Sk=Ih,q0=Sk.LinkPlugin;L();function Nk({defaultSelection:e}){let[t]=st();return S(()=>{t.focus(()=>{let n=t.getRootElement(),o=n!==null?yo(n):null;n===null||o!==null&&n.contains(o)||n.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}var Ek=Lh,J0=Ek.AutoFocusPlugin;function Rd(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function rb(e,t){let n=e;for(let o=it(e,t);o&&(Bt(o.origin)||Wt(o.origin));o=o.getAdjacentCaret())n=o.origin;return n}function os(e){return rb(e,"previous")}function Vs(e){return rb(e,"next")}function sb(e){let t=os(e),n=Vs(e),o=t;for(;o!==null;){if(Bt(o)){let s=xS(o.getTextContent());if(s!==null)return s}if(o===n)break;o=o.getNextSibling()}let r=t.getParent();if(j(r)){let s=r.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function ib(e,t){let n=null,o=null,r=e,s=t,i=e.getTextContent();for(;;){if(s===0){let u=r.getPreviousSibling();if(u===null){r=null;break}if(Bt(u)||Wt(u)||Pe(u)||Rd(167),r=u,Pe(r)){n={node:r,offset:1};break}s=Math.max(0,r.getTextContentSize()-1),i=r.getTextContent()}else s--;let c=i[s];Bt(r)&&c!==" "&&(o={node:r,offset:s})}if(o!==null)return o;let l=null;if(t<e.getTextContentSize())Bt(e)&&(l=e.getTextContent()[t]);else{let c=e.getNextSibling();Bt(c)&&(l=c.getTextContent()[0])}if(l!==null&&l!==" ")return n;{let c=function(u,d){let f=u,p=d,h=u.getTextContent(),m=u.getTextContentSize();for(;;){if(!Bt(f)||p===m){if(f=f.getNextSibling(),f===null||Pe(f))return null;Bt(f)&&(p=0,h=f.getTextContent(),m=f.getTextContentSize())}if(Bt(f)){if(h[p]!==" ")return{node:f,offset:p};p++}}}(e,t);return c!==null?c:n}}function ab(e){let t=Vs(e);return Pe(t)&&Rd(168),t}function Tk(e){let t=[];return Li(e,{linebreak:()=>t.push(ln()),tab:()=>t.push(cn()),text:(n)=>t.push(Kh(n))}),t}function lb(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let o=e.getTextContent(),r=/^ +/.exec(o);if(!r)return!1;let s=Math.min(t,r[0].length),i=e.getKey(),l=n.anchor.key===i&&n.anchor.type==="text"?n.anchor.offset:null,c=n.focus.key===i&&n.focus.type==="text"?n.focus.offset:null;return e.spliceText(0,s,""),l!==null&&n.anchor.set(i,Math.max(0,l-s),"text"),c!==null&&n.focus.set(i,Math.max(0,c-s),"text"),!0}var cb="javascript",bk=()=>cb;function ub(e,t){for(let n of e.childNodes){if(Ce(n)&&n.tagName===t)return!0;if(ub(n,t))return!0}return!1}var Kl="data-language",Bl="data-highlight-language",Ad="data-theme",vk=()=>{};class zl extends lt{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:lt,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||ub(e,"BR"))?{conversion:Z0,priority:1}:null,div:()=>({conversion:Ok,priority:1}),pre:()=>({conversion:Z0,priority:0}),table:(e)=>Fh(e)?{conversion:Ak,priority:3}:null,td:(e)=>{let t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&Fh(n)?{conversion:Q0,priority:3}:null},tr:(e)=>{let t=e.closest("table");return t&&Fh(t)?{conversion:Q0,priority:3}:null}}})}constructor(e=void 0,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=je().createElement("code");Qe(t,e.theme.code),t.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(t.setAttribute(Kl,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Bl,n));let o=this.getTheme();o&&t.setAttribute(Ad,o);let r=this.getStyle();return r&&ur(t.style,r),t}updateDOM(e,t,n){let o=this.__language,r=e.__language;o?o!==r&&t.setAttribute(Kl,o):r&&t.removeAttribute(Kl);let s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&r?s&&o?o!==r&&t.setAttribute(Bl,o):t.removeAttribute(Bl):s&&o&&t.setAttribute(Bl,o);let i=this.__theme,l=e.__theme;i?i!==l&&t.setAttribute(Ad,i):l&&t.removeAttribute(Ad);let c=this.__style,u=e.__style;return c!==u&&ur(t.style,c,u),!1}exportDOM(e){let t=je().createElement("pre");Qe(t,e._config.theme.code),t.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(t.setAttribute(Kl,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Bl,n));let o=this.getTheme();o&&t.setAttribute(Ad,o);let r=this.getStyle();return r&&ur(t.style,r),{element:t}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!so(Ke(),"@lexical/code")){vk();let s=db(e);if(s)return s}let{anchor:n,focus:o}=e,r=(n.isBefore(o)?n:o).getNode();if(ne(r)){let s=os(r),i=[];for(;;)if(Wt(s))i.push(cn()),s=s.getNextSibling();else{if(!Bt(s))break;{let h=0,m=s.getTextContent(),_=s.getTextContentSize();for(;h<_&&m[h]===" ";)h++;if(h!==0&&i.push(Kh(" ".repeat(h))),h!==_)break;s=s.getNextSibling()}}let l=r.splitText(n.offset)[0],c=n.offset===0?0:1,u=l.getIndexWithinParent()+c,d=r.getParentOrThrow(),f=[ln(),...i];d.splice(u,0,f);let p=i[i.length-1];p?p.select():n.offset===0?l.selectPrevious():l.getNextSibling().selectNext(0,0)}if(En(r)){let{offset:s}=e.anchor;r.splice(s,0,[ln()]),r.select(s+1,s+1)}return null}canIndent(){return!1}collapseAtStart(){let e=ye();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 bo(e,t){return Gc(zl).setLanguage(e).setTheme(t)}function En(e){return e instanceof zl}function Z0(e){return{node:bo(e.getAttribute(Kl))}}function Ok(e){let t=e,n=eb(t);return n||function(o){let r=o.parentElement;for(;r!==null;){if(eb(r))return!0;r=r.parentElement}return!1}(t)?{node:n?bo():null}:{node:null}}function Ak(){return{node:bo()}}function Q0(){return{node:null}}function eb(e){return e.style.fontFamily.match("monospace")!==null}function Fh(e){return e.classList.contains("js-file-line-container")}function db(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type==="element"){let n=t.getNode();if(En(n)){let o=n.getChildrenSize();if(o>=2&&t.offset===o){let r=n.getLastChild();if(Pe(r)&&Pe(r.getPreviousSibling())){let s=ye();return n.splice(o-2,2,[]).insertAfter(s,!1),s.select(),s}}}}return null}class Ul extends wn{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}$config(){return this.config("code-highlight",{extends:wn})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}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),n=Ph(e.theme,this.__highlightType);return Qe(t,n),t}updateDOM(e,t,n){let o=super.updateDOM(e,t,n),r=Ph(n.theme,e.__highlightType),s=Ph(n.theme,this.__highlightType);return r!==s&&(r&&nn(t,r),s&&Qe(t,s)),o}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 bo()}}function Ph(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Kh(e="",t){return sn(new Ul(e,t))}function Bt(e){return e instanceof Ul}var fb="data-language";function gb(e){return e.style.fontFamily.match("monospace")!==null}function Bh(e){let t=e.parentElement;for(;t!==null;){if(gb(t))return!0;t=t.parentElement}return!1}var Rk=rh([ut({$import:(e,t)=>e.$importChildren(t),match:dt.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Mk=ut({$import:(e,t)=>[bo(t.getAttribute(fb)).splice(0,0,e.$importChildren(t))],match:dt.tag("pre"),name:"@lexical/code/pre"}),Dk=ut({$import:(e,t,n)=>{let o=t.textContent||"";return/\r?\n/.test(o)||t.querySelector("br")!==null?[bo(t.getAttribute(fb)).splice(0,0,e.$importChildren(t))]:n()},match:dt.tag("code"),name:"@lexical/code/code-multiline"});function Qi(e){if(!Ce(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t=="string"&&/monospace/i.test(t)&&typeof n=="string"&&n.startsWith("pre")}function pb(e){let t=!1,n=[],o="",r=!1,s=()=>{r&&(n.push(o),o="",r=!1)};for(let i of Array.from(e.childNodes))if(Ce(i))i.tagName==="DIV"?(s(),n.push(i.textContent||""),t=!0):i.tagName==="BR"?(s(),n.push(""),t=!0):(o+=i.textContent||"",r=!0);else if(Ls(i)){let l=i.textContent||"";l.length>0&&(o+=l,r=!0)}return s(),t?n:null}function hb(e){for(let t of Array.from(e.children)){if(Ce(t)&&Qi(t)){if(pb(t)!==null)return!0;let n=t.nextElementSibling;if(n&&Qi(n))return!0;continue}if(hb(t))return!0}return!1}var $k=rh([ut({$import:(e,t,n)=>{if(!Qi(t)||Bh(t))return n();let o=pb(t);return o===null||o.length===0?n():[bo().splice(0,0,tl(o.join(`
|
|
16
16
|
`)))]},match:dt.tag("div"),name:"@lexical/code/vscode-wrapper"}),ut({$import:(e,t,n)=>{if(!Qi(t)||Bh(t))return n();let o=t.previousElementSibling;if(o&&Qi(o))return[];let r=[],s=t;for(;s&&Qi(s);)r.push(s.tagName==="BR"?"":s.textContent||""),s=s.nextElementSibling;return r.length<2?n():[bo().splice(0,0,tl(r.join(`
|
|
17
|
-
`)))]},match:dt.tag("div","br"),name:"@lexical/code/vscode-line-run"})]),wk=ut({$import:(e,t,n)=>
|
|
18
|
-
`){let s=cn(),i=ln(),l=n.isBackward()?"previous":"next";return n.insertNodes([s,i]),
|
|
19
|
-
`)},Qb={dependencies:[md],export:(e,t)=>{if(!
|
|
17
|
+
`)))]},match:dt.tag("div","br"),name:"@lexical/code/vscode-line-run"})]),wk=ut({$import:(e,t,n)=>gb(t)?[bo().splice(0,0,e.$importChildren(t))]:Bh(t)?e.$importChildren(t):n(),match:dt.tag("div"),name:"@lexical/code/div"}),mb=[ut({$import:(e,t)=>[bo().splice(0,0,e.$importChildren(t,{rules:Rk}))],match:dt.tag("table").classAll("js-file-line-container"),name:"@lexical/code/github-code-table"}),ut({$import:(e,t)=>e.$importChildren(t),match:dt.tag("td").classAll("js-file-line"),name:"@lexical/code/github-code-cell-by-class"}),Dk,Mk,wk],zh=me({dependencies:[io,tn(Yo,{preprocess:[(e,t,n)=>{hb(Xr(e)?e.body:e)&&t.session.update(eT,(o)=>[...o,$k]),n()}],rules:mb})],name:"@lexical/code",nodes:()=>[zl,Ul],register:(e)=>Oe(e.registerCommand(Oi,(t)=>{let n=K();return!(!I(n)||!db(n))&&(t!==null&&t.preventDefault(),!0)},we),e.registerNodeTransform(Nu,(t)=>{t.getFormat()!==0&&En(t.getParent())&&t.setFormat(0)}))}),kk=me({dependencies:[zh],name:"@lexical/code/Import"});function Ys(e){if(!I(e))return!1;let t=e.anchor.getNode(),n=En(t)?t:t.getParent(),o=e.focus.getNode(),r=En(o)?o:o.getParent();return En(n)&&n.is(r)}function _b(e){let t=e.getNodes(),n=[];if(t.length===1&&En(t[0]))return n;let o=[];for(let r=0;r<t.length;r++){let s=t[r];Bt(s)||Wt(s)||Pe(s)||Rd(169),Pe(s)?o.length>0&&(n.push(o),o=[]):o.push(s)}if(o.length>0){let r=e.isBackward()?e.anchor:e.focus,s=Xn(o[0].getKey(),0,"text");r.is(s)||n.push(o)}return n}function tb(e,t){let n=K();if(!I(n)||!Ys(n))return!1;let o=_b(n),r=o.length;if(r===0&&n.isCollapsed())return e===eo&&n.insertNodes([cn()]),!0;if(r===0&&e===eo&&n.getTextContent()===`
|
|
18
|
+
`){let s=cn(),i=ln(),l=n.isBackward()?"previous":"next";return n.insertNodes([s,i]),Rn(cr(qn(Vc(s,"next",0),$t(it(i,"next"))),l)),!0}for(let s=0;s<r;s++){let i=o[s];if(i.length>0){let l=i[0];if(s===0&&(l=os(l)),e===eo){let c=cn();if(l.insertBefore(c),s===0){let u=n.isBackward()?"focus":"anchor",d=Xn(l.getKey(),0,"text");n[u].is(d)&&n[u].set(c.getKey(),0,"text")}}else Wt(l)?l.remove():t!==void 0&&Bt(l)&&lb(l,t,n)}}return!0}function nb(e,t){let n=K();if(!I(n))return!1;let{anchor:o,focus:r}=n,s=o.offset,i=r.offset,l=o.getNode(),c=r.getNode(),u=e===to;if(!Ys(n)||!Bt(l)&&!Wt(l)||!Bt(c)&&!Wt(c))return!1;if(!t.altKey){if(n.isCollapsed()){let C=l.getParentOrThrow();if(u&&s===0&&l.getPreviousSibling()===null){if(C.getPreviousSibling()===null)return C.selectPrevious(),t.preventDefault(),!1}else if(!u&&s===l.getTextContentSize()&&l.getNextSibling()===null){if(C.getNextSibling()===null)return C.selectNext(),t.preventDefault(),!1}}return!1}let d,f;if(l.isBefore(c)?(d=os(l),f=Vs(c)):(d=os(c),f=Vs(l)),d==null||f==null)return!1;let p=d.getNodesBetween(f);for(let C=0;C<p.length;C++){let y=p[C];if(!Bt(y)&&!Wt(y)&&!Pe(y))return!1}t.preventDefault(),t.stopPropagation();let h=u?d.getPreviousSibling():f.getNextSibling();if(!Pe(h))return!0;let m=u?h.getPreviousSibling():h.getNextSibling();if(m==null)return!0;let _=Bt(m)||Wt(m)||Pe(m)?u?os(m):Vs(m):null,x=_!=null?_:m;return h.remove(),p.forEach((C)=>C.remove()),e===to?(p.forEach((C)=>x.insertBefore(C)),x.insertBefore(h)):(x.insertAfter(h),x=h,p.forEach((C)=>{x.insertAfter(C),x=C})),n.setTextNodeRange(l,s,c,i),!0}function ob(e,t){let n=K();if(!I(n))return!1;let{anchor:o,focus:r}=n,s=o.getNode(),i=r.getNode(),l=e===Ri;if(!Ys(n)||!Bt(s)&&!Wt(s)||!Bt(i)&&!Wt(i))return!1;let c=i,u=sb(c)==="rtl"?!l:l,{key:d,offset:f,type:p}=o;if(u){let h=ib(c,r.offset);if(h!==null){let{node:m,offset:_}=h;Pe(m)?m.selectNext(0,0):n.setTextNodeRange(m,_,m,_)}else c.getParentOrThrow().selectStart()}else ab(c).select();return t.shiftKey&&n.anchor.set(d,f,p),t.preventDefault(),t.stopPropagation(),!0}function xb(e,t,n){return Oe(...n?[e.registerCommand(Ho,(o)=>!o.altKey&&mp(En,o),we),e.registerCommand(bi,(o)=>mp(En,o),we),e.registerCommand(to,(o)=>!o.altKey&&_p(En,o),we),e.registerCommand(Gr,(o)=>_p(En,o),we)]:[],e.registerCommand(jr,(o)=>{let r=function(s){let i=K();if(!I(i)||!Ys(i))return null;let l=s?Wo:eo,c=s?Wo:Ds,{anchor:u,focus:d}=i;if(u.is(d))return c;let f=_b(i);if(f.length!==1)return l;let p=f[0],h,m;p.length===0&&Rd(285),i.isBackward()?(h=d,m=u):(h=u,m=d);let _=os(p[0]),x=Vs(p[0]),C=Xn(_.getKey(),0,"text"),y=Xn(x.getKey(),x.getTextContentSize(),"text");return h.isBefore(C)||y.isBefore(m)?l:C.isBefore(h)||m.isBefore(y)?c:l}(o.shiftKey);return r!==null&&(o.preventDefault(),e.dispatchCommand(r),!0)},we),e.registerCommand(Ds,()=>!!Ys(K())&&(Xc([cn()]),!0),we),e.registerCommand(eo,()=>tb(eo),we),e.registerCommand(Wo,()=>tb(Wo,t),we),e.registerCommand(to,(o)=>{let r=K();if(!I(r))return!1;let{anchor:s}=r,i=s.getNode();if(!Ys(r))return!1;let l=i.getParent();return r.isCollapsed()&&s.offset===0&&i.getPreviousSibling()===null&&En(l)&&l.getPreviousSibling()===null?(o.preventDefault(),!0):nb(to,o)},we),e.registerCommand(Ho,(o)=>{let r=K();if(!I(r))return!1;let{anchor:s}=r,i=s.getNode();return!!Ys(r)&&(r.isCollapsed()&&s.offset===i.getTextContentSize()&&i.getNextSibling()===null&&En(i.getParentOrThrow())&&i.getParentOrThrow().getNextSibling()===null?(o.preventDefault(),!0):nb(Ho,o))},we),e.registerCommand(Ri,(o)=>ob(Ri,o),we),e.registerCommand(_l,(o)=>ob(_l,o),we))}var Ik=me({build:(e,t)=>Mt(t),config:Be({disabled:!1,escapeWithArrows:!1,tabSize:void 0}),dependencies:[zh],name:"@lexical/code-indent",register:(e,t,n)=>{let o=n.getOutput();return yt(()=>{if(!o.disabled.value)return xb(e,o.tabSize.value,o.escapeWithArrows.value)})}});var It=Uh,{$createCodeHighlightNode:Md,$createCodeNode:Xs,$getCodeLineDirection:Cb,$getEndOfCodeInLine:yb,$getFirstCodeNodeOfLine:Sb,$getLastCodeNodeOfLine:Nb,$getStartOfCodeInLine:Eb,$isCodeHighlightNode:ea,$isCodeNode:Xo,$outdentLeadingSpaces:Tb,$plainifyCodeContent:Ob,CodeExtension:Dd,CodeHighlightNode:Hl,CodeImportExtension:OU,CodeImportRules:AU,CodeIndentExtension:$d,CodeNode:rs,DEFAULT_CODE_LANGUAGE:wd,getDefaultCodeLanguage:Ab,registerCodeIndentation:Rb}=It;function Hh(e,t){let n={};for(let o of e){let r=t(o);r&&(n[r]?n[r].push(o):n[r]=[o])}return n}function Ld(e){let t=Hh(e,(n)=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}var Mb=/[!-/:-@[-`{-~\s]/,Db=/\s/,Wh=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Lk=/^\s{0,3}$/;function Vl(e){if(!An(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&ne(t)&&Lk.test(t.getTextContent())}function Gh(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(t,n)=>String.fromCodePoint(Number(n)))}var Wb=/^(\s*)(\d{1,})\.\s/,Gb=/^(\s*)[-*+]\s/,jb=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,jh=/^(#{1,6})\s/,Yb=/^>\s/,Vb=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Yh=/^[ \t]*`{3,}$/,Fk=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Pk=/^(?:\|)(.+)(?:\|)\s?$/;function Xb(e){if(e[0]!=="|")return!1;let{length:t}=e,n=1,o=0;for(;n<t;){let r=n;for(e[r]===" "&&r++,e[r]===":"&&r++;e[r]==="-";)r++;if(e[r]===":"&&r++,e[r]===" "&&r++,e[r]!=="|")break;o++,n=r+1}return o>0&&(n===t||n===t-1&&/\s/.test(e[n]))}var $b=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,kb=/^<\/[a-z_][\w-]*\s*>/i,Ib=(e)=>new RegExp(`(?:${e.source})$`,e.flags),Gl=Go("mdListMarker",{parse:(e)=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),Lb=Go("mdCodeFence",{parse:(e)=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),qb=Go("mdHardLineBreak",{parse:(e)=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function Vh(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function Bk(e){let t=e.getChildren(),n=t.length-1,o=t[n];if(!ne(o))return null;let r=o.getTextContent(),s=Vh(r);if(s!==null){let[i,l]=s;return o.setTextContent(i),l}return/^ {2,}$/.test(r)&&function(i,l){for(let c=l-1;c>=0;c--){if(Pe(i[c]))return!1;if(/\S/.test(i[c].getTextContent()))return!0}return!1}(t,n)?(o.setTextContent(""),r):null}function Jb(e){let t=ln(),n=Bk(e);return n!==null&&Qn(t,qb,n),t}var Zb=(e)=>(t,n,o,r)=>{let s=e(o);s.append(...n),t.replace(s),r||s.select(0,0)},Jh=(e)=>(t,n,o,r)=>{if(kl(t))return!1;let s=t.getPreviousSibling(),i=t.getNextSibling(),l=C0(e==="check"?o[3]==="x":void 0),c=o[0].trim()[0],u=e!=="bullet"&&e!=="check"||c!==Gl.parse(c)?void 0:c;if(To(i)&&i.getListType()===e){u&&Qn(i,Gl,u);let f=i.getFirstChild();f!==null?f.insertBefore(l):i.append(l),e==="number"&&i.setStart(Number(o[2])),t.remove()}else if(To(s)&&s.getListType()===e)u&&Qn(s,Gl,u),s.append(l),t.remove();else{let f=y0(e,e==="number"?Number(o[2]):void 0);u&&Qn(f,Gl,u),f.append(l),t.replace(f)}l.append(...n),r||l.select(0,0);let d=function(f){let p=f.match(/\t/g),h=f.match(/ /g),m=0;return p&&(m+=p.length),h&&(m+=Math.floor(h.length/4)),m}(o[1]);d&&l.setIndent(d)},Fd=(e,t,n,o)=>{let r=[],s=e.getChildren(),i=0;for(let l of s)if(Th(l)){if(l.getChildrenSize()===1){let h=l.getFirstChild();if(To(h)){let m=Fd(h,t,n+1,o);m&&r.push(m);continue}}if(o&&!l.getChildren().some((h)=>h.isSelected(o)))continue;let c=" ".repeat(4*n),u=e.getListType(),d=Lo(e,Gl),f=u==="number"?`${e.getStart()+i}. `:u==="check"?`${d} [${l.getChecked()?"x":" "}] `:d+" ",p=t(l);u!=="number"&&(p=p.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),r.push(c+f+p),i++}return r.join(`
|
|
19
|
+
`)},Qb={dependencies:[md],export:(e,t)=>{if(!kl(e))return null;let n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:jh,replace:Zb((e)=>{let t="h"+e[1].length;return gd(t)}),triggerOnEnter:!0,type:"element"},ev={dependencies:[_d],export:(e,t)=>{if(!hd(e))return null;let n=t(e).split(`
|
|
20
20
|
`),o=[];for(let r of n)o.push("> "+r);return o.join(`
|
|
21
|
-
`)},regExp:Yb,replace:(e,t,n,o)=>{if(o){let s=e.getPreviousSibling();if(hd(s))return s.splice(s.getChildrenSize(),0,[Jb(s),...t]),void e.remove()}let r=pd();r.append(...t),e.replace(r),o||r.select(0,0)},triggerOnEnter:!0,type:"element"},
|
|
21
|
+
`)},regExp:Yb,replace:(e,t,n,o)=>{if(o){let s=e.getPreviousSibling();if(hd(s))return s.splice(s.getChildrenSize(),0,[Jb(s),...t]),void e.remove()}let r=pd();r.append(...t),e.replace(r),o||r.select(0,0)},triggerOnEnter:!0,type:"element"},jl={dependencies:[rs],export:(e)=>{if(!Xo(e))return null;let t=e.getTextContent(),n=Lo(e,Lb);if(t.indexOf(n)>-1){let o=t.match(/`{3,}/g);if(o){let r=Math.max(...o.map((s)=>s.length));n="`".repeat(r+1)}}return n+(e.getLanguage()||"")+(t?`
|
|
22
22
|
`+t:"")+`
|
|
23
|
-
`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:o})=>{let r=o[1],s=r.trim().length,i=e[n],l=o.index+r.length,c=i.slice(l),u=new RegExp(`\`{${s},}$`);if(u.test(c)){let h=c.match(u),m=c.slice(0,c.lastIndexOf(h[0])),_=[...o];return _[2]="",
|
|
24
|
-
`)}Qn(i,Lb,c);let d=xt(l);i.append(d),e.append(i)}else t&&Zb((d)=>Xs(d?d[2]:void 0))(e,t,n,s)},type:"multiline-element"},tv={dependencies:[Vo,ts],export:(e,t,n)=>To(e)?Fd(e,t,0,n):null,regExp:Gb,replace:
|
|
25
|
-
`),o=0,r=[];for(let s=0;s<n.length;s++){let i=n[s],l=i.trimEnd(),c=r[r.length-1],u=s<n.length-1?Vh(i):null,d=c!==void 0&&Vh(c)!==null;if(Fk.test(l))r.push(l);else if(o===0){{let f=l.match(Vb);if(f){o=f[1].trim().length,r.push(l);continue}}l===""||c===""||!c||jh.test(c)||jh.test(l)||Yb.test(l)||Wb.test(l)||Gb.test(l)||jb.test(l)||Pk.test(l)||Xb(l)||d||!t
|
|
26
|
-
`)}function zk(e,t,n,o,r,s){let i=e.isSelected(t);for(let l of n){if(!l.export)continue;let c=l.export(e,(u)=>
|
|
27
|
-
`}function Id(e,t,n,o,r,s=!1){let i=e.hasFormat("code"),l,c,u,d,f=t;if(i||(f=s?f.replace(/([*_`~])/g,"\\$1"):f.replace(/([*_`~\\])/g,"\\$1")),i){let{fence:y,padded:N}=function(E){let v=E.match(/`+/g),b=v?Math.max(...v.map((A)=>A.length)):0;return{fence:"`".repeat(b+1),padded:E.length===0||E.includes("`")||/^\s/.test(E)&&/\s$/.test(E)?` ${E} `:E}}(t);l="",u="",c=y+N+y,d=!1}else{let y=f.match(/^(\s*)(.*?)(\s*)$/s)||["","",f,""];l=y[1],c=y[2],u=y[3],d=c===""}let p="",h="",m="",_=Fb(e,!0),x=Fb(e,!1),C=new Set;for(let y of n){let N=y.format[0],E=y.tag;N!=="code"&&(Pb(e,N)&&!C.has(N)&&(C.add(N),Pb(_,N)&&o.find((v)=>v.tag===E)||(o.push({format:N,tag:E}),p+=E)))}for(let y=0;y<o.length;y++){let N=
|
|
28
|
-
`),l=i.length;for(let u=0;u<l;u++){let d=i[u],[f,p]=Wk(i,u,r.multilineElement,t);f?u=p:Gk(d,t,r.element,s,r.textMatch,o)}let c=t.getChildren();for(let u of c)if(!o&&
|
|
23
|
+
`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:o})=>{let r=o[1],s=r.trim().length,i=e[n],l=o.index+r.length,c=i.slice(l),u=new RegExp(`\`{${s},}$`);if(u.test(c)){let h=c.match(u),m=c.slice(0,c.lastIndexOf(h[0])),_=[...o];return _[2]="",jl.replace(t,null,_,h,[m],!0),[!0,n]}let d=new RegExp(`^[ \\t]*\`{${s},}$`);for(let h=n+1;h<e.length;h++){let m=e[h];if(d.test(m)){let _=m.match(d),x=e.slice(n+1,h),C=i.slice(o[0].length);return C.length>0&&x.unshift(C),jl.replace(t,null,o,_,x,!0),[!0,h]}}let f=e.slice(n+1),p=i.slice(o[0].length);return p.length>0&&f.unshift(p),jl.replace(t,null,o,null,f,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:Yh},regExpStart:Vb,replace:(e,t,n,o,r,s)=>{let i,l,c=n[1]?n[1].trim():"```",u=n[2]||void 0;if(!t&&r){if(r.length===1)o?(i=Xs(u),l=r[0]):(i=Xs(u),l=r[0].startsWith(" ")?r[0].slice(1):r[0]);else{for(i=Xs(u),r.length>0&&(r[0].trim().length===0?r.shift():r[0].startsWith(" ")&&(r[0]=r[0].slice(1)));r.length>0&&!r[r.length-1].length;)r.pop();l=r.join(`
|
|
24
|
+
`)}Qn(i,Lb,c);let d=xt(l);i.append(d),e.append(i)}else t&&Zb((d)=>Xs(d?d[2]:void 0))(e,t,n,s)},type:"multiline-element"},tv={dependencies:[Vo,ts],export:(e,t,n)=>To(e)?Fd(e,t,0,n):null,regExp:Gb,replace:Jh("bullet"),triggerOnEnter:!0,type:"element"},Kk={dependencies:[Vo,ts],export:(e,t,n)=>To(e)?Fd(e,t,0,n):null,regExp:jb,replace:Jh("check"),triggerOnEnter:!0,type:"element"},nv={dependencies:[Vo,ts],export:(e,t,n)=>To(e)?Fd(e,t,0,n):null,regExp:Wb,replace:Jh("number"),triggerOnEnter:!0,type:"element"},ov={format:["code"],tag:"`",type:"text-format"},rv={format:["highlight"],tag:"==",type:"text-format"},sv={format:["bold","italic"],tag:"***",type:"text-format"},iv={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},av={format:["bold"],tag:"**",type:"text-format"},lv={format:["bold"],intraword:!1,tag:"__",type:"text-format"},cv={format:["strikethrough"],tag:"~~",type:"text-format"},uv={format:["italic"],tag:"*",type:"text-format"},dv={format:["italic"],intraword:!1,tag:"_",type:"text-format"},fv={dependencies:[Zi],export:(e,t,n)=>{if(!Ji(e)||j0(e))return null;let o=t(e),r=e.getTitle();return r!=null&&(r=r.replace(/([\\"])/g,"\\$1")),r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(pe(e,Ji))return;let[,n,o,r]=t,s=o!=null?Gh(o):void 0,i=r!=null?Gh(r):void 0,l=G0(s,{title:i}),c=n.split("[").length-1,u=n.split("]").length-1,d=n,f="";if(c<u)return;if(c>u){let h=n.split("[");f="["+h[0],d=h.slice(1).join("[")}let p=xt(d);return p.setFormat(e.getFormat()),l.append(p),e.replace(l),f&&l.insertBefore(xt(f)),p},trigger:")",type:"text-match"},gv=[Qb,ev,tv,nv],pv=[jl],hv=[ov,sv,iv,av,lv,rv,uv,dv,cv],mv=[fv],ta=[...gv,...pv,...hv,...mv];function _v(e,t=!1){let n=e.split(`
|
|
25
|
+
`),o=0,r=[];for(let s=0;s<n.length;s++){let i=n[s],l=i.trimEnd(),c=r[r.length-1],u=s<n.length-1?Vh(i):null,d=c!==void 0&&Vh(c)!==null;if(Fk.test(l))r.push(l);else if(o===0){{let f=l.match(Vb);if(f){o=f[1].trim().length,r.push(l);continue}}l===""||c===""||!c||jh.test(c)||jh.test(l)||Yb.test(l)||Wb.test(l)||Gb.test(l)||jb.test(l)||Pk.test(l)||Xb(l)||d||!t||$b.test(l)||kb.test(l)||Ib(kb).test(c)||Ib($b).test(c)||Yh.test(c)?r.push(!t&&l!==""||u!==null?i:l):r[r.length-1]=c+" "+(u===null?l:i).trimStart()}else{if(Yh.test(l)&&l.trim().length>=o){o=0,r.push(l);continue}r.push(i)}}return r.join(`
|
|
26
|
+
`)}function zk(e,t,n,o,r,s){let i=e.isSelected(t);for(let l of n){if(!l.export)continue;let c=l.export(e,(u)=>Yl(u,t,o,r,s).markdown,t);if(c!=null){if(!i&&j(e))Yl(e,t,o,r,s).shouldInclude&&(i=!0);return{markdown:c,shouldInclude:i}}}if(j(e)){let l=Yl(e,t,o,r,s);return{markdown:l.markdown,shouldInclude:i||l.shouldInclude}}return Dt(e)?{markdown:e.getTextContent(),shouldInclude:i}:{markdown:null,shouldInclude:i}}function Yl(e,t,n,o,r,s,i){let l=[],c=e.getChildren(),u=!1;s||(s=[]),i||(i=[]);e:for(let d of c){let f=d.isSelected(t);for(let p of o){if(!p.export)continue;let h=p.export(d,(m)=>Yl(m,t,n,o,r,s,[...i,...s]).markdown,(m,_)=>Id(m,Fs(t,m,"clone").getTextContent(),n,s,i,r));if(h!=null){!f&&j(d)&&d.getChildren().some((m)=>m.isSelected(t))&&d.extractWithChild(d,t,"html")&&(f=!0),f&&(l.push(h),u=!0);continue e}}if(Pe(d))f&&(l.push(xv(d)),u=!0);else if(ne(d)){if(f){let p=Fs(t,d,"clone");l.push(Id(d,p.getTextContent(),n,s,i,r)),u=!0}}else if(j(d)){let p=Yl(d,t,n,o,r,s,i);!f&&p.shouldInclude&&d.extractWithChild(d,t,"html")&&(f=!0),(f||p.shouldInclude)&&(l.push(p.markdown),u=!0)}else Dt(d)&&f&&(l.push(d.getTextContent()),u=!0)}return{markdown:l.join(""),shouldInclude:u}}function Uk(e,t,n,o,r){for(let s of t){if(!s.export)continue;let i=s.export(e,(l)=>kd(l,n,o,void 0,void 0,r));if(i!=null)return i}return j(e)?kd(e,n,o,void 0,void 0,r):Dt(e)?e.getTextContent():null}function kd(e,t,n,o,r,s=!1){let i=[],l=e.getChildren();o||(o=[]),r||(r=[]);e:for(let c of l){for(let u of n){if(!u.export)continue;let d=u.export(c,(f)=>kd(f,t,n,o,[...r,...o],s),(f,p)=>Id(f,p,t,o,r,s));if(d!=null){i.push(d);continue e}}Pe(c)?i.push(xv(c)):ne(c)?i.push(Id(c,c.getTextContent(),t,o,r,s)):j(c)?i.push(kd(c,t,n,o,r,s)):Dt(c)&&i.push(c.getTextContent())}return i.join("")}function xv(e){return Lo(e,qb)+`
|
|
27
|
+
`}function Id(e,t,n,o,r,s=!1){let i=e.hasFormat("code"),l,c,u,d,f=t;if(i||(f=s?f.replace(/([*_`~])/g,"\\$1"):f.replace(/([*_`~\\])/g,"\\$1")),i){let{fence:y,padded:N}=function(E){let v=E.match(/`+/g),b=v?Math.max(...v.map((A)=>A.length)):0;return{fence:"`".repeat(b+1),padded:E.length===0||E.includes("`")||/^\s/.test(E)&&/\s$/.test(E)?` ${E} `:E}}(t);l="",u="",c=y+N+y,d=!1}else{let y=f.match(/^(\s*)(.*?)(\s*)$/s)||["","",f,""];l=y[1],c=y[2],u=y[3],d=c===""}let p="",h="",m="",_=Fb(e,!0),x=Fb(e,!1),C=new Set;for(let y of n){let N=y.format[0],E=y.tag;N!=="code"&&(Pb(e,N)&&!C.has(N)&&(C.add(N),Pb(_,N)&&o.find((v)=>v.tag===E)||(o.push({format:N,tag:E}),p+=E)))}for(let y=0;y<o.length;y++){let N=qh(e,o[y].format),E=qh(x,o[y].format);if(N&&E)continue;let v=[...o];for(;v.length>y;){let b=v.pop();r&&b&&r.find((A)=>A.tag===b.tag)||(b&&typeof b.tag=="string"&&(N?E||(m+=b.tag):h+=b.tag),o.pop())}break}return d&&!e.hasFormat("code")?h+f:h+l+p+c+m+u}function Fb(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return ne(n)?n:null}function qh(e,t){return ne(e)&&e.hasFormat(t)}function Pb(e,t){return!!qh(e,t)&&(t==="code"||(!e||!/^\s*$/.test(e.getTextContent())))}function Hk(e,t){let n=e.getTextContent(),o=t.transformersByTag["`"],r=[],s=null;if(o){let f=function(p){let h=(y)=>{let N=0;for(let E=y-1;E>=0&&p[E]==="\\";E--)N++;return N%2==1},m=[],_=0;for(;_<p.length;)if(p[_]==="`"){let y=1;for(;_+y<p.length&&p[_+y]==="`";)y++;m.push({index:_,length:y}),_+=y}else _++;let x=[],C=0;for(;C<m.length;){let y=m[C];if(h(y.index)){C++;continue}let N=-1;for(let b=C+1;b<m.length;b++)if(m[b].length===y.length){N=b;break}if(N===-1){C++;continue}let E=m[N],v=p.slice(y.index+y.length,E.index);v.length>=2&&v.startsWith(" ")&&v.endsWith(" ")&&/[^ ]/.test(v)&&(v=v.slice(1,-1)),x.push({content:v,endIndex:E.index+E.length,startIndex:y.index}),C=N+1}return x}(n);for(let p of f)s||(s={content:p.content,endIndex:p.endIndex,startIndex:p.startIndex,tag:"`"}),r.push({end:p.endIndex,start:p.startIndex})}let i=function(f,p,h=[]){let m=[],_=new Set(Object.keys(p.transformersByTag).filter((N)=>N[0]!=="`").map((N)=>N[0])),x=(N)=>{let E=0;for(let v=N-1;v>=0&&f[v]==="\\";v--)E++;return E%2==1},C=(N)=>h.some((E)=>N>=E.start&&N<E.end),y=0;for(;y<f.length;){let N=f[y];if(!_.has(N)||x(y)||C(y)){y++;continue}let E=1;for(;y+E<f.length&&f[y+E]===N;)E++;let v=Bb(N,f,y,E,!0),b=Bb(N,f,y,E,!1);(v||b)&&m.push({active:!0,canClose:b,canOpen:v,char:N,index:y,length:E}),y+=E}return m}(n,t,r),l=i.length>0?function(f,p,h){let m={},_=0,x=null;for(;_<p.length;){let C=p[_];if(!C.active||!C.canClose||C.length===0){_++;continue}let y=`${C.char}${C.canOpen}${C.length%3}`,N=m[y]??-1,E=!1;for(let v=_-1;v>N;v--){let b=p[v];if(!b.active||!b.canOpen||b.length===0||b.char!==C.char)continue;if(b.canClose||C.canOpen){if((b.length+C.length)%3==0&&b.length%3!=0&&C.length%3!=0)continue}let A=Math.min(b.length,C.length),O=Object.keys(h.transformersByTag).filter((k)=>k[0]===b.char&&k.length<=A).sort((k,J)=>J.length-k.length)[0];if(!O)continue;E=!0;let D=O.length,H={content:f.slice(b.index+b.length,C.index),endIndex:C.index+D,startIndex:b.index+(b.length-D),tag:O};(!x||H.startIndex<x.startIndex||H.startIndex===x.startIndex&&H.endIndex>x.endIndex)&&(x=H);for(let k=v+1;k<_;k++)p[k].active=!1;b.length-=D,C.length-=D,b.active=b.length>0,C.length>0?C.index+=D:(C.active=!1,_++);break}E||(m[y]=_-1,C.canOpen||(C.active=!1),_++)}return x}(n,i,t):null,c=null,u=null;if(s&&l?l.startIndex<=s.startIndex&&l.endIndex>=s.endIndex?(c=l,u=t.transformersByTag[l.tag]):(c=s,u=o):s?(c=s,u=o):l&&(c=l,u=t.transformersByTag[l.tag]),!c||!u)return null;let d=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return d.index=c.startIndex,d.input=n,{endIndex:c.endIndex,isCodeSpan:u===o,match:d,startIndex:c.startIndex,transformer:u}}function Bb(e,t,n,o,r){if(!Kb(t,n,o,r))return!1;if(e==="*")return!0;if(e==="_"){if(!Kb(t,n,o,!r))return!0;let s=r?t[n-1]:t[n+o];return s!==void 0&&Wh.test(s)}return!0}function Kb(e,t,n,o){let r=e[t-1],s=e[t+n],[i,l]=o?[s,r]:[r,s];return i!==void 0&&!Db.test(i)&&(!Wh.test(i)||(l===void 0||Db.test(l)||Wh.test(l)))}function ss(e){return ne(e)&&!e.hasFormat("code")}function qs(e,t,n){let o=Hk(e,t),r=function(i,l){let c=i,u,d,f,p;for(let h of l){if(!h.replace||!h.importRegExp)continue;let m=c.getTextContent().match(h.importRegExp);if(!m)continue;let _=m.index||0,x=h.getEndIndex?h.getEndIndex(c,m):_+m[0].length;x!==!1&&(u===void 0||d===void 0||_<u&&(x>d||x<=u))&&(u=_,d=x,f=h,p=m)}return u===void 0||d===void 0||f===void 0||p===void 0?null:{endIndex:d,match:p,startIndex:u,transformer:f}}(e,n);if(o&&r&&(o.isCodeSpan?r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex?o=null:r=null:o.startIndex<=r.startIndex&&o.endIndex>=r.endIndex||r.startIndex>o.endIndex?r=null:o=null),o){let i=function(l,c,u,d,f){let p=l.getTextContent(),h,m,_;if(f[0]===p?h=l:c===0?[h,m]=l.splitText(u):[_,h,m]=l.splitText(c,u),h.setTextContent(f[2]),d)for(let x of d.format)h.hasFormat(x)||h.toggleFormat(x);return{nodeAfter:m,nodeBefore:_,transformedNode:h}}(e,o.startIndex,o.endIndex,o.transformer,o.match);ss(i.nodeAfter)&&qs(i.nodeAfter,t,n),ss(i.nodeBefore)&&qs(i.nodeBefore,t,n),ss(i.transformedNode)&&qs(i.transformedNode,t,n)}else if(r){let i=function(l,c,u,d,f){let p,h,m;return c===0?[p,h]=l.splitText(u):[m,p,h]=l.splitText(c,u),d.replace?{nodeAfter:h,nodeBefore:m,transformedNode:d.replace(p,f)||void 0}:null}(e,r.startIndex,r.endIndex,r.transformer,r.match);if(!i)return;ss(i.nodeAfter)&&qs(i.nodeAfter,t,n),ss(i.nodeBefore)&&qs(i.nodeBefore,t,n),ss(i.transformedNode)&&qs(i.transformedNode,t,n)}let s=Gh(e.getTextContent());e.setTextContent(s)}function Cv(e,t,n,o=!1){let r=Ld(n),s=function(u){let d={},f={},p=[];for(let h of u){let{tag:m}=h;d[m]=h;let _=m.replace(/(\*|\^|\+)/g,"\\$1");p.push(_),m.length===1?f[m]=m==="`"?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${_}])(${_})((\\\\${_})?.*?[^${_}\\s](\\\\${_})?)(${_})(?![\\\\${_}])`):f[m]=new RegExp(`(^|[^\\\\])(${_})((\\\\${_})?.*?[^\\s](\\\\${_})?)(${_})(?!\\\\)`)}return{fullMatchRegExpByTag:f,openTagsRegExp:new RegExp(`(${p.join("|")})`,"g"),transformersByTag:d}}(r.textFormat),i=e.split(`
|
|
28
|
+
`),l=i.length;for(let u=0;u<l;u++){let d=i[u],[f,p]=Wk(i,u,r.multilineElement,t);f?u=p:Gk(d,t,r.element,s,r.textMatch,o)}let c=t.getChildren();for(let u of c)if(!o&&Vl(u)&&t.getChildrenSize()>1)u.remove();else if(j(u))for(let d of u.getAllTextNodes())jk(d)}function Wk(e,t,n,o){for(let r of n){let{handleImportAfterStartMatch:s,regExpEnd:i,regExpStart:l,replace:c}=r,u=e[t].match(l);if(!u)continue;if(s){let m=s({lines:e,rootNode:o,startLineIndex:t,startMatch:u,transformer:r});if(m===null)continue;if(m)return m}let d=typeof i=="object"&&"regExp"in i?i.regExp:i,f=i&&typeof i=="object"&&"optional"in i?i.optional:!i,p=t,h=e.length;for(;p<h;){let m=d?e[p].match(d):null;if(!m&&(!f||f&&p<h-1)){p++;continue}if(m&&t===p&&m.index===u.index){p++;continue}let _=[];if(m&&t===p)_.push(e[t].slice(u[0].length,-m[0].length));else for(let x=t;x<=p;x++)if(x===t){let C=e[x].slice(u[0].length);_.push(C)}else if(x===p&&m){let C=e[x].slice(0,-m[0].length);_.push(C)}else _.push(e[x]);if(c(o,null,u,m,_,!0)!==!1)return[!0,p];break}}return[!1,t]}function Gk(e,t,n,o,r,s){let i=xt(e),l=ye();l.append(i),t.append(l);for(let{regExp:c,replace:u}of n){let d=e.match(c);if(d&&(i.setTextContent(e.slice(d[0].length)),u(l,[i],d,!0)!==!1))break}if(qs(i,o,r),l.getParent()!==null&&e.length>0){let c=l.getPreviousSibling();if(!s&&(An(c)||hd(c)||To(c))){let u=c;if(To(c)){let d=c.getLastDescendant();u=d==null?null:pe(d,Th)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[Jb(u),...l.getChildren()]),l.remove())}}}function jk(e){let t=new Set,n=e.getTextContent(),o=n.indexOf("\t");for(;o!==-1;)t.add(o),t.add(o+1),o=n.indexOf("\t",o+1);e.splitText(...t).forEach((r)=>{r.getTextContent()==="\t"&&r.replace(cn())})}function Yk(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function zb(e,t,n,o,r){let s=e.getParent();if(!At(s)||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(!r&&i[n-1]!==" ")return!1;for(let{regExp:l,replace:c}of o){let u=i.match(l),d=r||u&&u[0].endsWith(" ")?n:n-1;if(u&&u[0].length===d){let f=t.getNextSiblings(),[p,h]=t.splitText(n);if(c(e,h?[h,...f]:f,u,!1)!==!1)return p.remove(),!0}}return!1}function Ub(e,t,n,o,r){let s=e.getParent();if(!At(s)||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(!r&&i[n-1]!==" ")return!1;for(let{regExpStart:l,replace:c,regExpEnd:u}of o){if(u&&!("optional"in u)||u&&"optional"in u&&!u.optional)continue;let d=i.match(l);if(d){let f=r||d[0].endsWith(" ")?n:n-1;if(d[0].length!==f)continue;let p=t.getNextSiblings(),[h,m]=t.splitText(n);if(c(e,m?[m,...p]:p,d,null,null,!1)!==!1)return h.remove(),!0}}return!1}function Vk(e,t){let n=0,o=e.getTextContent();for(let r=0;r<t;r++)o[r]==="`"&&n++;return n%2!=0}function Hb(e,t,n){let o=n.length;for(let r=t;r>=o;r--){let s=r-o;if(yv(e,s,n,0,o)&&e[s+o]!==" ")return s}return-1}function yv(e,t,n,o,r){for(let s=0;s<r;s++)if(e[t+s]!==n[o+s])return!1;return!0}function Xk(e,t=ta){let n=Ld(t),o=n.element.filter((c)=>c.triggerOnEnter),r=Hh(n.textFormat,({tag:c})=>c[c.length-1]),s=Hh(n.textMatch,({trigger:c})=>c),i=new Set([" "]);for(let c of n.textFormat)i.add(c.tag.slice(-1));for(let c of n.textMatch)c.trigger!==void 0&&i.add(c.trigger);for(let c of t){let u=c.type;if(u==="element"||u==="text-match"||u==="multiline-element"){let d=c.dependencies;for(let f of d)e.hasNode(f)||Yk(173,f.getType())}}let l=(c,u,d)=>!!zb(c,u,d,n.element)||(!!Ub(c,u,d,n.multilineElement)||(!!function(f,p,h){let m=f.getTextContent(),_=h[m[p-1]];if(_==null)return!1;p<m.length&&(m=m.slice(0,p));for(let x of _){if(!x.replace||!x.regExp)continue;let C=m.match(x.regExp);if(C===null)continue;let y=C.index||0,N=y+C[0].length,E;return y===0?[E]=f.splitText(N):[,E]=f.splitText(y,N),E.selectNext(0,0),x.replace(E,C),!0}return!1}(u,d,s)||!!function(f,p,h){let m=f.getTextContent(),_=p-1,x=m[_],C=h[x];if(!C)return!1;for(let y of C){let{tag:N}=y,E=N.length,v=_-E+1;if(E>1&&!yv(m,v,N,0,E))continue;if(m[v-1]===" ")continue;let b=m[_+1];if(y.intraword===!1&&b&&!Mb.test(b))continue;let A=f,O=A,D=Hb(m,v,N),H=O;for(;D<0&&(H=H.getPreviousSibling())&&!Pe(H);)if(ne(H)){if(H.hasFormat("code"))continue;let te=H.getTextContent();O=H,D=Hb(te,te.length,N)}if(D<0)continue;if(O===A&&D+E===v)continue;let k=O.getTextContent();if(D>0&&k[D-1]===x)continue;let J=k[D-1];if(y.intraword===!1&&J&&!Mb.test(J))continue;if(!y.format.includes("code")&&Vk(O,D))continue;let V=A.getTextContent(),oe=V.slice(0,v)+V.slice(_+1);A.setTextContent(oe);let B=O===A?oe:k;O.setTextContent(B.slice(0,D)+B.slice(D+E));let de=K(),xe=Pr();pt(xe);let ve=_-E*(O===A?2:1)+1;xe.anchor.set(O.__key,D,"text"),xe.focus.set(A.__key,ve,"text");for(let te of y.format)xe.formatText(te,$i[te]);xe.anchor.set(xe.focus.key,xe.focus.offset,xe.focus.type);for(let te of y.format)xe.hasFormat(te)&&xe.toggleFormat(te);return I(de)&&(xe.format=de.format),!0}return!1}(u,d,r)));return Oe(e.registerUpdateListener(({tags:c,dirtyLeaves:u,editorState:d,prevEditorState:f})=>{if(c.has(jy)||c.has(Ti))return;if(e.isComposing())return;let p=c.has(eu),h=d.read(K),m=f.read(K);if(!I(m)||!I(h)||!h.isCollapsed()||h.is(m)&&!p)return;let _=h.anchor.key,x=h.anchor.offset,C=d._nodeMap.get(_);if(ne(C)&&u.has(_)&&(p||x===1||!(x>m.anchor.offset+1))){if(p){let y=d.read(()=>C.getTextContent())[x-1];if(!i.has(y))return}e.update(()=>{if(!ss(C))return;let y=C.getParent();y===null||Xo(y)||l(y,C,h.anchor.offset)&&el(cu)})}}),e.registerCommand(Oi,(c)=>{if(c!==null&&c.shiftKey)return!1;let u=K();if(!I(u)||!u.isCollapsed())return!1;let d=u.anchor.offset,f=u.anchor.getNode();if(!ne(f)||!ss(f))return!1;let p=f.getParent();if(p===null||Xo(p))return!1;return d===f.getTextContent().length&&(!(!Ub(p,f,d,n.multilineElement,!0)&&!zb(p,f,d,o,!0))&&(c!==null&&c.preventDefault(),!0))},we))}function qk(e,t=ta,n,o=!1,r=!1){let s=o?e:_v(e,r),i=n||Xe();i.clear(),Cv(s,i,t,o),K()!==null&&i.selectStart()}function Jk(e,t=ta,n=!1,o=!1){let r=n?e:_v(e,o),s=new al;return Cv(r,s,t,n),s.getChildren()}function Zk(e=ta,t,n=!1){return function(r,s=!1){let i=Ld(r),l=[...i.multilineElement,...i.element],c=!s,u=i.textFormat.filter((d)=>d.format.length===1).sort((d,f)=>Number(d.format.includes("code"))-Number(f.format.includes("code")));return(d)=>{let f=[],p=(d||Xe()).getChildren();for(let h=0;h<p.length;h++){let m=p[h],_=Uk(m,l,u,i.textMatch,s);_!=null&&f.push(c&&h>0&&!Vl(m)&&!Vl(p[h-1])?`
|
|
29
29
|
`.concat(_):_)}return f.join(`
|
|
30
|
-
`)}}(e,n)(t)}function Qk(e=ta,t,n=!1){if(!t||I(t)&&t.isCollapsed())return"";return function(r,s=!1){let i=Ld(r),l=[...i.multilineElement,...i.element],c=!s,u=i.textFormat.filter((d)=>d.format.length===1).sort((d,f)=>Number(d.format.includes("code"))-Number(f.format.includes("code")));return(d)=>{let f=[],p=Xe().getChildren();for(let h=0;h<p.length;h++){let m=p[h],{shouldInclude:_,markdown:x}=zk(m,d,l,u,i.textMatch,s);_&&x!=null&&f.push(c&&h>0&&!
|
|
30
|
+
`)}}(e,n)(t)}function Qk(e=ta,t,n=!1){if(!t||I(t)&&t.isCollapsed())return"";return function(r,s=!1){let i=Ld(r),l=[...i.multilineElement,...i.element],c=!s,u=i.textFormat.filter((d)=>d.format.length===1).sort((d,f)=>Number(d.format.includes("code"))-Number(f.format.includes("code")));return(d)=>{let f=[],p=Xe().getChildren();for(let h=0;h<p.length;h++){let m=p[h],{shouldInclude:_,markdown:x}=zk(m,d,l,u,i.textMatch,s);_&&x!=null&&f.push(c&&h>0&&!Vl(m)&&!Vl(p[h-1])?`
|
|
31
31
|
`.concat(x):x)}return f.join(`
|
|
32
|
-
`)}}(e,n)(t)}var at=Zh,{$convertFromMarkdownString:Qh,$convertSelectionToMarkdownString:LU,$convertToMarkdownString:Sv,$generateNodesFromMarkdownString:FU,BOLD_ITALIC_STAR:PU,BOLD_ITALIC_UNDERSCORE:BU,BOLD_STAR:KU,BOLD_UNDERSCORE:zU,CHECK_LIST:Nv,CODE:UU,ELEMENT_TRANSFORMERS:Ev,HEADING:HU,HIGHLIGHT:WU,INLINE_CODE:GU,ITALIC_STAR:jU,ITALIC_UNDERSCORE:YU,LINK:VU,MULTILINE_ELEMENT_TRANSFORMERS:Tv,ORDERED_LIST:XU,QUOTE:qU,STRIKETHROUGH:JU,TEXT_FORMAT_TRANSFORMERS:bv,TEXT_MATCH_TRANSFORMERS:vv,TRANSFORMERS:Ov,UNORDERED_LIST:ZU,isTableRowDivider:QU,registerMarkdownShortcuts:Av}=at;Z();var Rv=[{dependencies:[ju],export:(e)=>BN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,o)=>{let r=Gu();o||e.getNextSibling()!=null?e.replace(r):e.insertBefore(r),r.selectNext()},triggerOnEnter:!0,type:"element"},...Ov];function eI({transformers:e=Rv}){let[t]=st();return S(()=>Av(t,e),[t,e]),null}var Mv=em,{DEFAULT_TRANSFORMERS:sH,MarkdownShortcutPlugin:Dv}=Mv;Z();var tI=un?nt:S;function nI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[o]=st();return tI(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:s,dirtyLeaves:i,prevEditorState:l,tags:c})=>{t&&s.size===0&&i.size===0||e&&c.has(Ur)||l.isEmpty()||n(r,o,c)})},[o,e,t,n]),null}var oI=tm,$v=oI.OnChangePlugin;Z();class wv extends xi{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function rI({children:e,fallback:t,onError:n}){return a(wv,{fallback:t===void 0?a("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):t,onError:n,children:e})}var sI=nm,kv=sI.LexicalErrorBoundary;var hH=se(om(),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.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(Prism.languages.markup)Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&/,"&")});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var s={};s[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,r=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+r+s+"(?:"+r+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+r+s+")(?:"+r+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+r+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+r+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(f){if(d!==f)e.languages.markdown[d].inside.content.inside[f]=e.languages.markdown[f]})}),e.hooks.add("after-tokenize",function(d){if(d.language!=="markdown"&&d.language!=="md")return;function f(p){if(!p||typeof p==="string")return;for(var h=0,m=p.length;h<m;h++){var _=p[h];if(_.type!=="code"){f(_.content);continue}var x=_.content[1],C=_.content[3];if(x&&C&&x.type==="code-language"&&C.type==="code-block"&&typeof x.content==="string"){var y=x.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var N="language-"+y;if(!C.alias)C.alias=[N];else if(typeof C.alias==="string")C.alias=[C.alias,N];else C.alias.push(N)}}}f(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type!=="code-block")return;var f="";for(var p=0,h=d.classes.length;p<h;p++){var m=d.classes[p],_=/language-(.+)/.exec(m);if(_){f=_[1];break}}var x=e.languages[f];if(!x){if(f&&f!=="none"&&e.plugins.autoloader){var C="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);d.attributes.id=C,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(C);if(y)y.innerHTML=e.highlight(y.textContent,e.languages[f],f)})}}else d.content=e.highlight(u(d.content),x,f)});var i=RegExp(e.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;function u(d){var f=d.replace(i,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(p,h){if(h=h.toLowerCase(),h[0]==="#"){var m;if(h[1]==="x")m=parseInt(h.slice(2),16);else m=Number(h.slice(1));return c(m)}else{var _=l[h];if(_)return _;return p}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(e){var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism);Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,o={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[o,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:o.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:o.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":o,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:o.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:o.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var o=t[n],r=[];if(!/^\w+$/.test(n))r.push(/\w+/.exec(n)[0]);if(n==="diff")r.push("bold");e.languages.diff[n]={pattern:RegExp("^(?:["+o+`].*(?:\r
|
|
32
|
+
`)}}(e,n)(t)}var at=Zh,{$convertFromMarkdownString:Qh,$convertSelectionToMarkdownString:LU,$convertToMarkdownString:Sv,$generateNodesFromMarkdownString:FU,BOLD_ITALIC_STAR:PU,BOLD_ITALIC_UNDERSCORE:BU,BOLD_STAR:KU,BOLD_UNDERSCORE:zU,CHECK_LIST:Nv,CODE:UU,ELEMENT_TRANSFORMERS:Ev,HEADING:HU,HIGHLIGHT:WU,INLINE_CODE:GU,ITALIC_STAR:jU,ITALIC_UNDERSCORE:YU,LINK:VU,MULTILINE_ELEMENT_TRANSFORMERS:Tv,ORDERED_LIST:XU,QUOTE:qU,STRIKETHROUGH:JU,TEXT_FORMAT_TRANSFORMERS:bv,TEXT_MATCH_TRANSFORMERS:vv,TRANSFORMERS:Ov,UNORDERED_LIST:ZU,isTableRowDivider:QU,registerMarkdownShortcuts:Av}=at;L();var Rv=[{dependencies:[ju],export:(e)=>BN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,o)=>{let r=Gu();o||e.getNextSibling()!=null?e.replace(r):e.insertBefore(r),r.selectNext()},triggerOnEnter:!0,type:"element"},...Ov];function eI({transformers:e=Rv}){let[t]=st();return S(()=>Av(t,e),[t,e]),null}var Mv=em,{DEFAULT_TRANSFORMERS:sH,MarkdownShortcutPlugin:Dv}=Mv;L();var tI=un?nt:S;function nI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[o]=st();return tI(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:s,dirtyLeaves:i,prevEditorState:l,tags:c})=>{t&&s.size===0&&i.size===0||e&&c.has(Hr)||l.isEmpty()||n(r,o,c)})},[o,e,t,n]),null}var oI=tm,$v=oI.OnChangePlugin;L();class wv extends xi{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function rI({children:e,fallback:t,onError:n}){return a(wv,{fallback:t===void 0?a("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):t,onError:n,children:e})}var sI=nm,kv=sI.LexicalErrorBoundary;var hH=se(om(),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.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(Prism.languages.markup)Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&/,"&")});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var s={};s[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,r=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+r+s+"(?:"+r+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+r+s+")(?:"+r+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+r+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+r+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(f){if(d!==f)e.languages.markdown[d].inside.content.inside[f]=e.languages.markdown[f]})}),e.hooks.add("after-tokenize",function(d){if(d.language!=="markdown"&&d.language!=="md")return;function f(p){if(!p||typeof p==="string")return;for(var h=0,m=p.length;h<m;h++){var _=p[h];if(_.type!=="code"){f(_.content);continue}var x=_.content[1],C=_.content[3];if(x&&C&&x.type==="code-language"&&C.type==="code-block"&&typeof x.content==="string"){var y=x.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var N="language-"+y;if(!C.alias)C.alias=[N];else if(typeof C.alias==="string")C.alias=[C.alias,N];else C.alias.push(N)}}}f(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type!=="code-block")return;var f="";for(var p=0,h=d.classes.length;p<h;p++){var m=d.classes[p],_=/language-(.+)/.exec(m);if(_){f=_[1];break}}var x=e.languages[f];if(!x){if(f&&f!=="none"&&e.plugins.autoloader){var C="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);d.attributes.id=C,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(C);if(y)y.innerHTML=e.highlight(y.textContent,e.languages[f],f)})}}else d.content=e.highlight(u(d.content),x,f)});var i=RegExp(e.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;function u(d){var f=d.replace(i,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(p,h){if(h=h.toLowerCase(),h[0]==="#"){var m;if(h[1]==="x")m=parseInt(h.slice(2),16);else m=Number(h.slice(1));return c(m)}else{var _=l[h];if(_)return _;return p}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(e){var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism);Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,o={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[o,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:o.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:o.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":o,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:o.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:o.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var o=t[n],r=[];if(!/^\w+$/.test(n))r.push(/\w+/.exec(n)[0]);if(n==="diff")r.push("bold");e.languages.diff[n]={pattern:RegExp("^(?:["+o+`].*(?:\r
|
|
33
33
|
?|
|
|
34
34
|
|(?![\\s\\S])))+`,"m"),alias:r,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];var DH=globalThis.Prism||window.Prism;var IH=se(om(),1);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var o=t[n],r=[];/^\w+$/.test(n)||r.push(/\w+/.exec(n)[0]),n==="diff"&&r.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+o+`].*(?:\r
|
|
35
35
|
?|
|
|
36
|
-
|(?![\\s\\S])))+`,"m"),alias:r,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var lo=globalThis.Prism||window.Prism,im={c:"C",clike:"C-like",cpp:"C++",css:"CSS",go:"Go",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"},Fv={cpp:"cpp",golang:"go",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Pv(e){return Fv[e]||e}function lI(e){let t=Pv(e);return im[t]||t}var cI=()=>Object.keys(lo.languages).filter((e)=>typeof lo.languages[e]!="function").sort();function uI(){let e=[];for(let[t,n]of Object.entries(im))e.push([t,n]);return e}function dI(){return[]}function Bv(e){let t=function(o){let r=/^diff-([\w-]+)/i.exec(o);return r?r[1]:null}(e),n=t||e;try{return!!n&&lo.languages.hasOwnProperty(n)}catch(o){return!1}}async function Kv(e,t,n){}function rm(e){return typeof e=="string"?e:Array.isArray(e)?e.map(rm).join(""):rm(e.content)}function fI(e,t){let n=/^diff-([\w-]+)/i.exec(t),o=e.getTextContent(),r=lo.tokenize(o,lo.languages[n?"diff":t]);return n&&(r=function(s,i){let l=i,c=lo.languages[l],u={tokens:s},d=lo.languages.diff.PREFIXES;for(let f of u.tokens){if(typeof f=="string"||!(f.type in d)||!Array.isArray(f.content))continue;let p=f.type,h=0,m=()=>(h++,new lo.Token("prefix",d[p],p.replace(/^(\w+).*/,"$1"))),_=f.content.filter((v)=>typeof v=="string"||v.type!=="prefix"),x=f.content.length-_.length,C=lo.tokenize(rm(_),c);C.unshift(m());let y=/\r\n|\n/g,N=(v)=>{let b=[];y.lastIndex=0;let A,O=0;for(;h<x&&(A=y.exec(v));){let D=A.index+A[0].length;b.push(v.slice(O,D)),O=D,b.push(m())}if(b.length!==0)return O<v.length&&b.push(v.slice(O)),b},E=(v)=>{for(let b=0;b<v.length&&h<x;b++){let A=v[b];if(typeof A=="string"){let O=N(A);O&&(v.splice(b,1,...O),b+=O.length-1)}else if(typeof A.content=="string"){let O=N(A.content);O&&(A.content=O)}else Array.isArray(A.content)?E(A.content):E([A.content])}};E(C),h<x&&C.push(m()),f.content=C}return u.tokens}(r,n[1])),sm(r)}function sm(e,t){let n=[];for(let o of e)if(typeof o=="string")Li(o,{linebreak:()=>n.push(ln()),tab:()=>n.push(cn()),text:(r)=>n.push(Md(r,t))});else{let{content:r,alias:s}=o;typeof r=="string"?n.push(...sm([r],o.type==="prefix"&&typeof s=="string"?s:o.type)):Array.isArray(r)&&n.push(...sm(r,o.type==="unchanged"?void 0:o.type))}return n}var am={$tokenize(e,t){let n=t||this.defaultLanguage;return n===null?
|
|
37
|
-
`+ ++i);n.setAttribute("data-gutter",s)}function zv(e,t,n,o){let{nodesCurrentlyHighlighting:r}=n,s=o.getKey();o.getLanguage()===void 0&&t.defaultLanguage!==null&&o.setLanguage(t.defaultLanguage);let i=o.getLanguage()||t.defaultLanguage;if(i){if(!Bv(i))return o.getIsSyntaxHighlightSupported()&&o.setIsSyntaxHighlightSupported(!1),void Kv();o.getIsSyntaxHighlightSupported()||o.setIsSyntaxHighlightSupported(!0)}else o.getIsSyntaxHighlightSupported()&&o.setIsSyntaxHighlightSupported(!1);r.has(s)||(r.add(s),n.didTransform||(n.didTransform=!0,By(()=>{n.didTransform=!1,r.clear()})),function(l,c){let u=Ot(l);if(!Xo(u)||!u.isAttached())return;let d=K();if(!I(d))return void c();let f=d.anchor,p=f.offset,h=f.type==="element"&&Pe(u.getChildAtIndex(f.offset-1)),m=0;if(!h){let _=f.getNode();m=p+_.getPreviousSiblings().reduce((x,C)=>x+C.getTextContentSize(),0)}if(!c())return;if(h)return void f.getNode().select(p,p);u.getChildren().some((_)=>{let x=ne(_);if(x||Pe(_)){let C=_.getTextContentSize();if(x&&C>=m)return _.select(m,m),!0;m-=C}return!1})}(s,()=>{let l=Ot(s);if(!Xo(l)||!l.isAttached())return!1;let c=l.getLanguage()||t.defaultLanguage,u=t.$tokenize(l,c??void 0),d=function(m,_){let x=0;for(;x<m.length&&Lv(m[x],_[x]);)x++;let C=m.length,y=_.length,N=Math.min(C,y)-x,E=0;for(;E<N;)if(E++,!Lv(m[C-E],_[y-E])){E--;break}let v=x,b=C-E,A=_.slice(x,y-E);return{from:v,nodesForReplacement:A,to:b}}(l.getChildren(),u),{from:f,to:p,nodesForReplacement:h}=d;return!(f===p&&!h.length)&&(o.splice(f,p-f,h),!0)}))}function Lv(e,t){return ea(e)&&ea(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Wt(e)&&Wt(t)||Pe(e)&&Pe(t)}function Uv(e,t){let n=[];e._headless!==!0&&n.push(e.registerMutationListener(rs,(r)=>{e.read("latest",()=>{for(let[s,i]of r)if(i!=="destroyed"){let l=Ot(s);l!==null&&gI(l,e)}})},{skipInitialization:!1}));let o={didTransform:!1,nodesCurrentlyHighlighting:new Set};return n.push(e.registerNodeTransform(rs,zv.bind(null,e,t,o)),e.registerNodeTransform($n,Iv.bind(null,e,t,o)),e.registerNodeTransform(Gl,Iv.bind(null,e,t,o))),Oe(...n)}function pI(e,t=am){if(!e.hasNodes([rs,Gl]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return Oe(Uv(e,t),Mb(e))}var hI=me({build:(e,t)=>Mt(t),config:Be({disabled:!1,tokenizer:am}),dependencies:[Dd,$d],name:"@lexical/code-prism",register:(e,t,n)=>{let o=n.getOutput();return yt(()=>{if(!o.disabled.value)return Uv(e,o.tokenizer.value)})}});var co=lm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:cm,CODE_LANGUAGE_MAP:um,CodePrismExtension:JH,PrismTokenizer:dm,getCodeLanguageOptions:fm,getCodeLanguages:gm,getCodeThemeOptions:pm,getLanguageFriendlyName:hm,isCodeLanguageLoaded:ZH,loadCodeLanguage:QH,normalizeCodeLanguage:Bd,registerCodeHighlighting:mm}=co;var _I=cm,xI=um,CI=fm,yI=gm,SI=pm,NI=hm,EI=Bd,TI=Bd,bI=dm,vI=mm;var ft=_m,{$createCodeHighlightNode:tW,$createCodeNode:Wv,$getCodeLineDirection:nW,$getEndOfCodeInLine:oW,$getFirstCodeNodeOfLine:rW,$getLastCodeNodeOfLine:sW,$getStartOfCodeInLine:iW,$isCodeHighlightNode:aW,$isCodeNode:lW,$outdentLeadingSpaces:cW,CODE_LANGUAGE_FRIENDLY_NAME_MAP:uW,CODE_LANGUAGE_MAP:dW,CodeExtension:fW,CodeHighlightNode:gW,CodeIndentExtension:pW,CodeNode:Gv,DEFAULT_CODE_LANGUAGE:hW,PrismTokenizer:mW,getCodeLanguageOptions:_W,getCodeLanguages:xW,getCodeThemeOptions:CW,getDefaultCodeLanguage:yW,getLanguageFriendlyName:SW,normalizeCodeLang:NW,normalizeCodeLanguage:EW,registerCodeHighlighting:TW}=ft;var ia=/^(\d+(?:\.\d+)?)px$/,be={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class hr extends lt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config("tablecell",{extends:lt,importDOM:{td:()=>({conversion:jv,priority:0}),th:()=>({conversion:jv,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign,this.__colSpan=e.__colSpan,this.__headerState=e.__headerState,this.__width=e.__width}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=be.NO_STATUS,t=1,n,o){super(o),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=je().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),Sm(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),Qe(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(Ce(t.element)){let n=t.element;n.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),n.style.border="1px solid black",this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),n.style.width=`${this.getWidth()||75}px`,n.style.verticalAlign=this.getVerticalAlign()||"top",n.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(n.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...Sm(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=be.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==be.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Sm(e){return e==="middle"||e==="bottom"}function jv(e){let t=e,n=e.nodeName.toLowerCase(),o;ia.test(t.style.width)&&(o=parseFloat(t.style.width));let r=be.NO_STATUS;if(n==="th"){let _=t.getAttribute("scope");if(_==="col")r=be.COLUMN;else if(_==="row")r=be.ROW;else{let x=t.parentElement,C=Ce(x)&&x.nodeName.toLowerCase()==="tr"&&Ce(x.parentElement)&&(x.parentElement.nodeName.toLowerCase()==="thead"||x.rowIndex===0),y=t.cellIndex===0;C&&(r|=be.ROW),y&&(r|=be.COLUMN),r===be.NO_STATUS&&(r=be.ROW)}}let s=gn(r,t.colSpan,o);s.__rowSpan=t.rowSpan;let i=t.style.backgroundColor;i!==""&&(s.__backgroundColor=i);let l=t.style.verticalAlign;Sm(l)&&(s.__verticalAlign=l);let c=t.style,u=(c&&c.textDecoration||"").split(" "),d=c.fontWeight==="700"||c.fontWeight==="bold",f=u.includes("line-through"),p=c.fontStyle==="italic",h=u.includes("underline"),m=c.color;return{after:(_)=>{let x=[],C=null,y=()=>{if(C){let N=C.getFirstChild();Pe(N)&&C.getChildrenSize()===1&&N.remove()}};for(let N of _)if(zg(N)||ne(N)||Pe(N)){if(ne(N)&&(d&&N.toggleFormat("bold"),f&&N.toggleFormat("strikethrough"),p&&N.toggleFormat("italic"),h&&N.toggleFormat("underline"),m)){let E=N.getStyle();E.includes("color:")||N.setStyle(E+`color: ${m};`)}C?C.append(N):(C=ye().append(N),x.push(C))}else x.push(N),y(),C=null;return y(),x.length===0&&x.push(ye()),x},node:s}}function gn(e=be.NO_STATUS,t=1,n){return sn(new hr(e,t,n))}function _e(e){return e instanceof hr}var Zv=Sn("INSERT_TABLE_COMMAND");function ge(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class ca extends lt{__height;$config(){return this.config("tablerow",{extends:lt,importDOM:{tr:()=>({conversion:OI,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__height=e.__height}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e=void 0,t){super(t),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){let t=je().createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),Qe(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n==="html"}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function OI(e){let t=e,n;return ia.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:(o)=>Sl(o,_e),node:mr(n)}}function mr(e){return sn(new ca(e))}function Le(e){return e instanceof ca}function Qv(e,t,n=!0){let o=tc();for(let r=0;r<e;r++){let s=mr();for(let i=0;i<t;i++){let l=be.NO_STATUS;typeof n=="object"?(r===0&&n.rows&&(l|=be.ROW),i===0&&n.columns&&(l|=be.COLUMN)):n&&(r===0&&(l|=be.ROW),i===0&&(l|=be.COLUMN));let c=gn(l),u=ye();u.append(xt()),c.append(u),s.append(c)}o.append(s)}return o}function AI(e){let t=pe(e,(n)=>_e(n));return _e(t)?t:null}function Mm(e){let t=pe(e,(n)=>Le(n));if(Le(t))return t;throw Error("Expected table cell to be inside of table row.")}function Yd(e){let t=pe(e,(n)=>rt(n));if(rt(t))return t;throw Error("Expected table cell to be inside of table.")}function RI(e){let t=Mm(e);return Yd(t).getChildren().findIndex((n)=>n.is(t))}function MI(e){return Mm(e).getChildren().findIndex((t)=>t.is(e))}function eO(e,t){let n=Yd(e),{x:o,y:r}=n.getCordsFromCellNode(e,t);return{above:n.getCellNodeFromCords(o,r-1,t),below:n.getCellNodeFromCords(o,r+1,t),left:n.getCellNodeFromCords(o-1,r,t),right:n.getCellNodeFromCords(o+1,r,t)}}function DI(e,t){let n=e.getChildren();if(t>=n.length||t<0)throw Error("Expected table cell to be inside of table row.");return n[t].remove(),e}function $I(e,t,n=!0,o,r){let s=e.getChildren();if(t>=s.length||t<0)throw Error("Table row target index out of range");let i=s[t];if(!Le(i))throw Error("Row before insertion index does not exist.");for(let l=0;l<o;l++){let c=i.getChildren(),u=c.length,d=mr();for(let f=0;f<u;f++){let p=c[f];_e(p)||ge(12);let{above:h,below:m}=eO(p,r),_=be.NO_STATUS,x=h&&h.getWidth()||m&&m.getWidth()||void 0;(h&&h.hasHeaderState(be.COLUMN)||m&&m.hasHeaderState(be.COLUMN))&&(_|=be.COLUMN);let C=gn(_,1,x);C.append(ye()),d.append(C)}n?i.insertAfter(d):i.insertBefore(d)}return e}var Nm=(e,t)=>e===be.BOTH||e===t?t:be.NO_STATUS;function tO(e=!0){let t=K();I(t)||ze(t)||ge(188);let n=t.anchor.getNode(),o=t.focus.getNode(),[r]=Kt(n),[s,,i]=Kt(o),[,l,c]=on(i,s,r),{startRow:u}=c,{startRow:d}=l;return e?Hd(u+r.__rowSpan>d+s.__rowSpan?r:s,!0):Hd(d<u?s:r,!1)}var wI=tO;function Hd(e,t=!0){let[,,n]=Kt(e),[o,r]=on(n,e,e),s=o[0].length,{startRow:i}=r,l=null;if(t){let c=i+e.__rowSpan-1,u=o[c],d=mr();for(let p=0;p<s;p++){let{cell:h,startRow:m}=u[p];if(m+h.__rowSpan-1<=c){let _=u[p].cell.__headerState,x=Nm(_,be.COLUMN);d.append(gn(x).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}let f=n.getChildAtIndex(c);Le(f)||ge(256),f.insertAfter(d),l=d}else{let c=i,u=o[c],d=mr();for(let p=0;p<s;p++){let{cell:h,startRow:m}=u[p];if(m===c){let _=u[p].cell.__headerState,x=Nm(_,be.COLUMN);d.append(gn(x).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}let f=n.getChildAtIndex(c);Le(f)||ge(257),f.insertBefore(d),l=d}return l}function kI(e,t,n=!0,o,r){let s=e.getChildren(),i=[];for(let l=0;l<s.length;l++){let c=s[l];if(Le(c))for(let u=0;u<o;u++){let d=c.getChildren();if(t>=d.length||t<0)throw Error("Table column target index out of range");let f=d[t];_e(f)||ge(12);let{left:p,right:h}=eO(f,r),m=be.NO_STATUS;(p&&p.hasHeaderState(be.ROW)||h&&h.hasHeaderState(be.ROW))&&(m|=be.ROW);let _=gn(m);_.append(ye()),i.push({newTableCell:_,targetCell:f})}}return i.forEach(({newTableCell:l,targetCell:c})=>{n?c.insertAfter(l):c.insertBefore(l)}),e}function nO(e=!0){let t=K();I(t)||ze(t)||ge(188);let n=t.anchor.getNode(),o=t.focus.getNode(),[r]=Kt(n),[s,,i]=Kt(o),[,l,c]=on(i,s,r),{startColumn:u}=c,{startColumn:d}=l;return e?Wd(u+r.__colSpan>d+s.__colSpan?r:s,!0):Wd(d<u?s:r,!1)}var II=nO;function Wd(e,t=!0,n=!0){let[,,o]=Kt(e),[r,s]=on(o,e,e),i=r.length,{startColumn:l}=s,c=t?l+e.__colSpan-1:l-1,u=o.getFirstChild();Le(u)||ge(120);let d=null;function f(m=be.NO_STATUS){let _=gn(m).append(ye());return d===null&&(d=_),_}let p=u;e:for(let m=0;m<i;m++){if(m!==0){let v=p.getNextSibling();Le(v)||ge(121),p=v}let _=r[m],x=_[c<0?0:c].cell.__headerState,C=Nm(x,be.ROW);if(c<0){Dm(p,f(C));continue}let{cell:y,startColumn:N,startRow:E}=_[c];if(N+y.__colSpan-1<=c){let v=y,b=E,A=c;for(;b!==m&&v.__rowSpan>1;){if(A-=y.__colSpan,!(A>=0)){p.append(f(C));continue e}{let{cell:O,startRow:D}=_[A];v=O,b=D}}v.insertAfter(f(C))}else y.setColSpan(y.__colSpan+1)}d!==null&&n&&ql(d);let h=o.getColWidths();if(h){let m=[...h],_=c<0?0:c,x=m[_];m.splice(_,0,x),o.setColWidths(m)}return d}function LI(e,t){let n=e.getChildren();for(let o=0;o<n.length;o++){let r=n[o];if(Le(r)){let s=r.getChildren();if(t>=s.length||t<0)throw Error("Table column target index out of range");s[t].remove()}}return e}function oO(){let e=K();I(e)||ze(e)||ge(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[o,,r]=Kt(t),[s]=Kt(n),[i,l,c]=on(r,o,s),{startRow:u}=l,{startRow:d}=c,f=d+s.__rowSpan-1;if(i.length===f-u+1)return void r.remove();let p=i[0].length,h=i[f+1],m=r.getChildAtIndex(f+1);for(let _=f;_>=u;_--){for(let C=p-1;C>=0;C--){let{cell:y,startRow:N,startColumn:E}=i[_][C];if(E===C){if(N<u||N+y.__rowSpan-1>f){let v=Math.max(N,u),b=Math.min(y.__rowSpan+N-1,f),A=v<=b?b-v+1:0;y.setRowSpan(y.__rowSpan-A)}if(N>=u&&N+y.__rowSpan-1>f&&_===f){Le(m)||ge(387);let v=null;for(let b=0;b<C;b++){let A=h[b],O=A.cell;A.startRow===_+1&&(v=O),O.__colSpan>1&&(b+=O.__colSpan-1)}v===null?Dm(m,y):v.insertAfter(y)}}}let x=r.getChildAtIndex(_);Le(x)||ge(206,String(_)),x.remove()}if(h!==void 0){let{cell:_}=h[0];ql(_)}else{let _=i[u-1],{cell:x}=_[0];ql(x)}}var FI=oO;function rO(){let e=K();I(e)||ze(e)||ge(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[o,,r]=Kt(t),[s]=Kt(n),[i,l,c]=on(r,o,s),{startColumn:u}=l,{startRow:d,startColumn:f}=c,p=Math.min(u,f),h=Math.max(u+o.__colSpan-1,f+s.__colSpan-1),m=h-p+1;if(i[0].length===h-p+1)return r.selectPrevious(),void r.remove();let _=i.length;for(let N=0;N<_;N++)for(let E=p;E<=h;E++){let{cell:v,startColumn:b}=i[N][E];if(b<p){if(E===p){let A=p-b;v.setColSpan(v.__colSpan-Math.min(m,v.__colSpan-A))}}else if(b+v.__colSpan-1>h){if(E===h){let A=h-b+1;v.setColSpan(v.__colSpan-A)}}else v.remove()}let x=i[d],C=u>f?x[u+o.__colSpan]:x[f+s.__colSpan];if(C!==void 0){let{cell:N}=C;ql(N)}else{let N=f<u?x[f-1]:x[u-1],{cell:E}=N;ql(E)}let y=r.getColWidths();if(y){let N=[...y];N.splice(p,m),r.setColWidths(N)}}var PI=rO;function ql(e){let t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function Dm(e,t){let n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function sO(e){if(e.length===0)return null;let t=Yd(e[0]),[n]=uo(t,null,null),o=1/0,r=-1/0,s=1/0,i=-1/0,l=new Set;for(let h of n)for(let m of h){if(!m||!m.cell)continue;let _=m.cell.getKey();if(!l.has(_)&&e.some((x)=>x.is(m.cell))){l.add(_);let{startRow:x,startColumn:C}=m,y=m.cell.__rowSpan||1,N=m.cell.__colSpan||1;o=Math.min(o,x),r=Math.max(r,x+y-1),s=Math.min(s,C),i=Math.max(i,C+N-1)}}if(o===1/0||s===1/0)return null;let c=r-o+1,u=i-s+1,d=n[o][s];if(!d.cell)return null;let f=d.cell;f.setColSpan(u),f.setRowSpan(c);let p=new Set([f.getKey()]);for(let h=o;h<=r;h++)for(let m=s;m<=i;m++){let _=n[h][m];if(!_.cell)continue;let x=_.cell,C=x.getKey();if(!p.has(C))p.add(C),BI(x)||f.append(...x.getChildren()),x.remove()}return f.getChildrenSize()===0&&f.append(ye()),f}function BI(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!An(t)||!t.isEmpty())}function KI(){let e=K();I(e)||ze(e)||ge(188);let t=e.anchor.getNode(),n=pe(t,_e);return _e(n)||ge(148),$m(n)}function $m(e){let[t,n,o]=Kt(e),{__colSpan:r,__rowSpan:s}=t;if(r===1&&s===1)return;let[i,l]=on(o,t,t),{startColumn:c,startRow:u}=l,d=t.__headerState&be.COLUMN,f=Array.from({length:r},(m,_)=>{let x=d;for(let C=0;x!==0&&C<i.length;C++)x&=i[C][_+c].cell.__headerState;return x}),p=t.__headerState&be.ROW,h=Array.from({length:s},(m,_)=>{let x=p;for(let C=0;x!==0&&C<i[0].length;C++)x&=i[_+u][C].cell.__headerState;return x});if(r>1){for(let m=1;m<r;m++)t.insertAfter(gn(f[m]|h[0]).append(ye()));t.setColSpan(1)}if(s>1){let m;for(let _=1;_<s;_++){let x=u+_,C=i[x];m=(m||n).getNextSibling(),Le(m)||ge(125);let y=null;for(let N=0;N<c;N++){let E=C[N],v=E.cell;E.startRow===x&&(y=v),v.__colSpan>1&&(N+=v.__colSpan-1)}if(y===null)for(let N=r-1;N>=0;N--)Dm(m,gn(f[N]|h[_]).append(ye()));else for(let N=r-1;N>=0;N--)y.insertAfter(gn(f[N]|h[_]).append(ye()))}t.setRowSpan(1)}}function on(e,t,n){let[o,r,s]=uo(e,t,n);return r===null&&ge(207),s===null&&ge(208),[o,r,s]}function uo(e,t,n){let o=[],r=null,s=null;function i(c){let u=o[c];return u===void 0&&(o[c]=u=[]),u}let l=e.getChildren();for(let c=0;c<l.length;c++){let u=l[c];Le(u)||ge(209);let d=i(c);for(let f=u.getFirstChild(),p=0;f!=null;f=f.getNextSibling()){for(_e(f)||ge(147);d[p]!==void 0;)p++;let h={cell:f,startColumn:p,startRow:c},{__rowSpan:m,__colSpan:_}=f;for(let x=0;x<m&&!(c+x>=l.length);x++){let C=i(c+x);for(let y=0;y<_;y++)C[p+y]=h}t!==null&&r===null&&t.is(f)&&(r=h),n!==null&&s===null&&n.is(f)&&(s=h)}}return[o,r,s]}function Kt(e){let t;if(e instanceof hr)t=e;else if("__type"in e){let r=pe(e,_e);_e(r)||ge(148),t=r}else{let r=pe(e.getNode(),_e);_e(r)||ge(148),t=r}let n=t.getParent();Le(n)||ge(149);let o=n.getParent();return rt(o)||ge(210),[t,n,o]}function Jl(e,t,n){let o,r=Math.min(t.startColumn,n.startColumn),s=Math.min(t.startRow,n.startRow),i=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),l=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{o=!1;for(let c=0;c<e.length;c++)for(let u=0;u<e[0].length;u++){let d=e[c][u];if(!d)continue;let f=d.startColumn+d.cell.__colSpan-1,p=d.startRow+d.cell.__rowSpan-1,h=d.startColumn<=i&&f>=r,m=d.startRow<=l&&p>=s;if(h&&m){let _=Math.min(r,d.startColumn),x=Math.max(i,f),C=Math.min(s,d.startRow),y=Math.max(l,p);_===r&&x===i&&C===s&&y===l||(r=_,i=x,s=C,l=y,o=!0)}}}while(o);return{maxColumn:i,maxRow:l,minColumn:r,minRow:s}}function wm(e){let t=e.getChildren(),n=null;for(let o of t){if(!Le(o))return!1;if(n===null&&(n=o.getChildrenSize()),o.getChildrenSize()!==n)return!1;let r=o.getChildren();for(let s of r)if(!_e(s)||s.getRowSpan()!==1||s.getColSpan()!==1)return!1}return(n||0)>0}function zI(e,t,n){if(t===n)return;let o=e.getColumnCount();if(t<0||t>=o||n<0||n>=o)return;if(!wm(e))return;e.getChildren().filter(Le).forEach((s)=>{let i=s.getChildren(),[l]=i.splice(t,1);i.splice(n,0,l),s.splice(0,i.length,i)});let r=e.getColWidths();if(r&&r.length===o){let s=[...r],[i]=s.splice(t,1);s.splice(n,0,i),e.setColWidths(s)}}function UI(e,t,n){if(t===n)return;let o=e.getChildren().filter(Le),r=o.length;if(t<0||t>=r||n<0||n>=r)return;if(!wm(e))return;let s=o[t],i=o[n];n>t?i.insertAfter(s):i.insertBefore(s)}function Em(e){let[t,,n]=Kt(e),o=n.getChildren().filter(Le),r=o.length,s=o[0].getChildren().length,i=Array(r);for(let l=0;l<r;l++)i[l]=Array(s);for(let l=0;l<r;l++){let c=o[l].getChildren().filter(_e),u=0;for(let d=0;d<c.length;d++){for(;i[l][u];)u++;let f=c[d],p=f.__rowSpan||1,h=f.__colSpan||1;for(let m=0;m<p;m++)for(let _=0;_<h;_++)i[l+m][u+_]=f;if(t===f)return{colSpan:h,columnIndex:u,rowIndex:l,rowSpan:p};u+=h}}return null}function iO(e,t){let n=t.getStartEndPoints(),o=ze(t);if(n===null)return!1;let[r,s]=n,[i,l,c]=Kt(r),u=pe(s.getNode(),(k)=>_e(k));if(!(_e(i)&&_e(u)&&Le(l)&&rt(c)))return!1;let[d,f,p]=on(c,i,u),[h]=uo(e,null,null),m=d.length,_=m>0?d[0].length:0,{startRow:x,startColumn:C}=f,y=h.length,N=y>0?h[0].length:0;if(o){let k=Jl(d,f,p),q=k.maxRow-k.minRow+1,j=k.maxColumn-k.minColumn+1;x=k.minRow,C=k.minColumn,y=Math.min(y,q),N=Math.min(N,j)}let E=!1,v=Math.min(m,x+y)-1,b=Math.min(_,C+N)-1,A=new Set;for(let k=x;k<=v;k++)for(let q=C;q<=b;q++){let j=d[k][q];A.has(j.cell.getKey())||(j.cell.__rowSpan===1&&j.cell.__colSpan===1||($m(j.cell),A.add(j.cell.getKey()),E=!0))}let[O]=uo(c.getWritable(),null,null),D=y-m+x;for(let k=0;k<D;k++)Hd(O[m-1][0].cell);let H=N-_+C;for(let k=0;k<H;k++)Wd(O[0][_-1].cell,!0,!1);[O]=uo(c.getWritable(),null,null);for(let k=x;k<x+y;k++)for(let q=C;q<C+N;q++){let j=k-x,oe=q-C,B=h[j][oe];if(B.startRow!==j||B.startColumn!==oe)continue;let de=B.cell;if(de.__rowSpan!==1||de.__colSpan!==1){let ae=[],ce=Math.min(k+de.__rowSpan,x+y)-1,Re=Math.min(q+de.__colSpan,C+N)-1;for(let Me=k;Me<=ce;Me++)for(let gt=q;gt<=Re;gt++){let Jt=O[Me][gt];ae.push(Jt.cell)}sO(ae),E=!0}let{cell:xe}=O[k][q],ve=de.getBackgroundColor();ve!=null&&xe.setBackgroundColor(ve);let te=xe.getChildren();de.getChildren().forEach((ae)=>{if(ne(ae))ye().append(ae),xe.append(ae);else xe.append(ae)}),te.forEach((ae)=>ae.remove())}if(o&&E){let[k]=uo(c.getWritable(),null,null);k[f.startRow][f.startColumn].cell.selectEnd()}return!0}function HI(e,t,n){let[o]=uo(e,null,null);t>=0&&t<o.length||ge(396,String(t));let r=o[t],s=n?be.ROW:be.NO_STATUS,i=new Set;for(let l=0;l<r.length;l++){let c=r[l];c!=null&&(i.has(c.cell)||(i.add(c.cell),c.cell.setHeaderStyles(s,be.ROW)))}}function WI(e,t,n){let[o]=uo(e,null,null);o.length>0&&t>=0&&t<o[0].length||ge(397,String(t));let r=n?be.COLUMN:be.NO_STATUS,s=new Set;for(let i=0;i<o.length;i++){let l=o[i][t];l!=null&&(s.has(l.cell)||(s.add(l.cell),l.cell.setHeaderStyles(r,be.COLUMN)))}}function xm(e){let[[t,n,o,r],[s,i,l,c]]=["anchor","focus"].map((u)=>{let d=e[u].getNode(),f=pe(d,_e);_e(f)||ge(238,u,d.getKey(),d.getType());let p=f.getParent();Le(p)||ge(239,u);let h=p.getParent();return rt(h)||ge(240,u),[d,f,p,h]});return r.is(c)||ge(241),{anchorCell:n,anchorNode:t,anchorRow:o,anchorTable:r,focusCell:i,focusNode:s,focusRow:l,focusTable:c}}class ec{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;let e=Ot(this.tableKey),t=Ot(this.anchor.key),n=Ot(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return ze(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new ec(this.tableKey,Vn(this.anchor.key,this.anchor.offset,this.anchor.type),Vn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e==="")return;let t=(e.endsWith(`
|
|
36
|
+
|(?![\\s\\S])))+`,"m"),alias:r,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var lo=globalThis.Prism||window.Prism,im={c:"C",clike:"C-like",cpp:"C++",css:"CSS",go:"Go",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"},Fv={cpp:"cpp",golang:"go",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Pv(e){return Fv[e]||e}function lI(e){let t=Pv(e);return im[t]||t}var cI=()=>Object.keys(lo.languages).filter((e)=>typeof lo.languages[e]!="function").sort();function uI(){let e=[];for(let[t,n]of Object.entries(im))e.push([t,n]);return e}function dI(){return[]}function Bv(e){let t=function(o){let r=/^diff-([\w-]+)/i.exec(o);return r?r[1]:null}(e),n=t||e;try{return!!n&&lo.languages.hasOwnProperty(n)}catch(o){return!1}}async function Kv(e,t,n){}function rm(e){return typeof e=="string"?e:Array.isArray(e)?e.map(rm).join(""):rm(e.content)}function fI(e,t){let n=/^diff-([\w-]+)/i.exec(t),o=e.getTextContent(),r=lo.tokenize(o,lo.languages[n?"diff":t]);return n&&(r=function(s,i){let l=i,c=lo.languages[l],u={tokens:s},d=lo.languages.diff.PREFIXES;for(let f of u.tokens){if(typeof f=="string"||!(f.type in d)||!Array.isArray(f.content))continue;let p=f.type,h=0,m=()=>(h++,new lo.Token("prefix",d[p],p.replace(/^(\w+).*/,"$1"))),_=f.content.filter((v)=>typeof v=="string"||v.type!=="prefix"),x=f.content.length-_.length,C=lo.tokenize(rm(_),c);C.unshift(m());let y=/\r\n|\n/g,N=(v)=>{let b=[];y.lastIndex=0;let A,O=0;for(;h<x&&(A=y.exec(v));){let D=A.index+A[0].length;b.push(v.slice(O,D)),O=D,b.push(m())}if(b.length!==0)return O<v.length&&b.push(v.slice(O)),b},E=(v)=>{for(let b=0;b<v.length&&h<x;b++){let A=v[b];if(typeof A=="string"){let O=N(A);O&&(v.splice(b,1,...O),b+=O.length-1)}else if(typeof A.content=="string"){let O=N(A.content);O&&(A.content=O)}else Array.isArray(A.content)?E(A.content):E([A.content])}};E(C),h<x&&C.push(m()),f.content=C}return u.tokens}(r,n[1])),sm(r)}function sm(e,t){let n=[];for(let o of e)if(typeof o=="string")Li(o,{linebreak:()=>n.push(ln()),tab:()=>n.push(cn()),text:(r)=>n.push(Md(r,t))});else{let{content:r,alias:s}=o;typeof r=="string"?n.push(...sm([r],o.type==="prefix"&&typeof s=="string"?s:o.type)):Array.isArray(r)&&n.push(...sm(r,o.type==="unchanged"?void 0:o.type))}return n}var am={$tokenize(e,t){let n=t||this.defaultLanguage;return n===null?Ob(e.getTextContent()):fI(e,n)},defaultLanguage:wd,tokenize(e,t){let n=this.defaultLanguage;return lo.tokenize(e,lo.languages[t||""]||(n===null?void 0:lo.languages[n]))}};function Iv(e,t,n,o){let r=o.getParent();Xo(r)?zv(e,t,n,r):ea(o)&&o.replace(xt(o.__text))}function gI(e,t){let n=t.getElementByKey(e.getKey());if(n===null)return;let o=e.getChildren(),r=o.length;if(r===n.__cachedChildrenLength)return;n.__cachedChildrenLength=r;let s="1",i=1;for(let l=0;l<r;l++)Pe(o[l])&&(s+=`
|
|
37
|
+
`+ ++i);n.setAttribute("data-gutter",s)}function zv(e,t,n,o){let{nodesCurrentlyHighlighting:r}=n,s=o.getKey();o.getLanguage()===void 0&&t.defaultLanguage!==null&&o.setLanguage(t.defaultLanguage);let i=o.getLanguage()||t.defaultLanguage;if(i){if(!Bv(i))return o.getIsSyntaxHighlightSupported()&&o.setIsSyntaxHighlightSupported(!1),void Kv();o.getIsSyntaxHighlightSupported()||o.setIsSyntaxHighlightSupported(!0)}else o.getIsSyntaxHighlightSupported()&&o.setIsSyntaxHighlightSupported(!1);r.has(s)||(r.add(s),n.didTransform||(n.didTransform=!0,By(()=>{n.didTransform=!1,r.clear()})),function(l,c){let u=Ot(l);if(!Xo(u)||!u.isAttached())return;let d=K();if(!I(d))return void c();let f=d.anchor,p=f.offset,h=f.type==="element"&&Pe(u.getChildAtIndex(f.offset-1)),m=0;if(!h){let _=f.getNode();m=p+_.getPreviousSiblings().reduce((x,C)=>x+C.getTextContentSize(),0)}if(!c())return;if(h)return void f.getNode().select(p,p);u.getChildren().some((_)=>{let x=ne(_);if(x||Pe(_)){let C=_.getTextContentSize();if(x&&C>=m)return _.select(m,m),!0;m-=C}return!1})}(s,()=>{let l=Ot(s);if(!Xo(l)||!l.isAttached())return!1;let c=l.getLanguage()||t.defaultLanguage,u=t.$tokenize(l,c??void 0),d=function(m,_){let x=0;for(;x<m.length&&Lv(m[x],_[x]);)x++;let C=m.length,y=_.length,N=Math.min(C,y)-x,E=0;for(;E<N;)if(E++,!Lv(m[C-E],_[y-E])){E--;break}let v=x,b=C-E,A=_.slice(x,y-E);return{from:v,nodesForReplacement:A,to:b}}(l.getChildren(),u),{from:f,to:p,nodesForReplacement:h}=d;return!(f===p&&!h.length)&&(o.splice(f,p-f,h),!0)}))}function Lv(e,t){return ea(e)&&ea(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Wt(e)&&Wt(t)||Pe(e)&&Pe(t)}function Uv(e,t){let n=[];e._headless!==!0&&n.push(e.registerMutationListener(rs,(r)=>{e.read("latest",()=>{for(let[s,i]of r)if(i!=="destroyed"){let l=Ot(s);l!==null&&gI(l,e)}})},{skipInitialization:!1}));let o={didTransform:!1,nodesCurrentlyHighlighting:new Set};return n.push(e.registerNodeTransform(rs,zv.bind(null,e,t,o)),e.registerNodeTransform(wn,Iv.bind(null,e,t,o)),e.registerNodeTransform(Hl,Iv.bind(null,e,t,o))),Oe(...n)}function pI(e,t=am){if(!e.hasNodes([rs,Hl]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return Oe(Uv(e,t),Rb(e))}var hI=me({build:(e,t)=>Mt(t),config:Be({disabled:!1,tokenizer:am}),dependencies:[Dd,$d],name:"@lexical/code-prism",register:(e,t,n)=>{let o=n.getOutput();return yt(()=>{if(!o.disabled.value)return Uv(e,o.tokenizer.value)})}});var co=lm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:cm,CODE_LANGUAGE_MAP:um,CodePrismExtension:JH,PrismTokenizer:dm,getCodeLanguageOptions:fm,getCodeLanguages:gm,getCodeThemeOptions:pm,getLanguageFriendlyName:hm,isCodeLanguageLoaded:ZH,loadCodeLanguage:QH,normalizeCodeLanguage:Bd,registerCodeHighlighting:mm}=co;var _I=cm,xI=um,CI=fm,yI=gm,SI=pm,NI=hm,EI=Bd,TI=Bd,bI=dm,vI=mm;var ft=_m,{$createCodeHighlightNode:tW,$createCodeNode:Wv,$getCodeLineDirection:nW,$getEndOfCodeInLine:oW,$getFirstCodeNodeOfLine:rW,$getLastCodeNodeOfLine:sW,$getStartOfCodeInLine:iW,$isCodeHighlightNode:aW,$isCodeNode:lW,$outdentLeadingSpaces:cW,CODE_LANGUAGE_FRIENDLY_NAME_MAP:uW,CODE_LANGUAGE_MAP:dW,CodeExtension:fW,CodeHighlightNode:gW,CodeIndentExtension:pW,CodeNode:Gv,DEFAULT_CODE_LANGUAGE:hW,PrismTokenizer:mW,getCodeLanguageOptions:_W,getCodeLanguages:xW,getCodeThemeOptions:CW,getDefaultCodeLanguage:yW,getLanguageFriendlyName:SW,normalizeCodeLang:NW,normalizeCodeLanguage:EW,registerCodeHighlighting:TW}=ft;var ia=/^(\d+(?:\.\d+)?)px$/,be={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class mr extends lt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config("tablecell",{extends:lt,importDOM:{td:()=>({conversion:jv,priority:0}),th:()=>({conversion:jv,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign,this.__colSpan=e.__colSpan,this.__headerState=e.__headerState,this.__width=e.__width}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=be.NO_STATUS,t=1,n,o){super(o),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=je().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),Sm(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),Qe(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(Ce(t.element)){let n=t.element;n.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),n.style.border="1px solid black",this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),n.style.width=`${this.getWidth()||75}px`,n.style.verticalAlign=this.getVerticalAlign()||"top",n.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(n.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...Sm(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=be.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==be.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Sm(e){return e==="middle"||e==="bottom"}function jv(e){let t=e,n=e.nodeName.toLowerCase(),o;ia.test(t.style.width)&&(o=parseFloat(t.style.width));let r=be.NO_STATUS;if(n==="th"){let _=t.getAttribute("scope");if(_==="col")r=be.COLUMN;else if(_==="row")r=be.ROW;else{let x=t.parentElement,C=Ce(x)&&x.nodeName.toLowerCase()==="tr"&&Ce(x.parentElement)&&(x.parentElement.nodeName.toLowerCase()==="thead"||x.rowIndex===0),y=t.cellIndex===0;C&&(r|=be.ROW),y&&(r|=be.COLUMN),r===be.NO_STATUS&&(r=be.ROW)}}let s=gn(r,t.colSpan,o);s.__rowSpan=t.rowSpan;let i=t.style.backgroundColor;i!==""&&(s.__backgroundColor=i);let l=t.style.verticalAlign;Sm(l)&&(s.__verticalAlign=l);let c=t.style,u=(c&&c.textDecoration||"").split(" "),d=c.fontWeight==="700"||c.fontWeight==="bold",f=u.includes("line-through"),p=c.fontStyle==="italic",h=u.includes("underline"),m=c.color;return{after:(_)=>{let x=[],C=null,y=()=>{if(C){let N=C.getFirstChild();Pe(N)&&C.getChildrenSize()===1&&N.remove()}};for(let N of _)if(zg(N)||ne(N)||Pe(N)){if(ne(N)&&(d&&N.toggleFormat("bold"),f&&N.toggleFormat("strikethrough"),p&&N.toggleFormat("italic"),h&&N.toggleFormat("underline"),m)){let E=N.getStyle();E.includes("color:")||N.setStyle(E+`color: ${m};`)}C?C.append(N):(C=ye().append(N),x.push(C))}else x.push(N),y(),C=null;return y(),x.length===0&&x.push(ye()),x},node:s}}function gn(e=be.NO_STATUS,t=1,n){return sn(new mr(e,t,n))}function _e(e){return e instanceof mr}var Zv=Sn("INSERT_TABLE_COMMAND");function ge(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class ca extends lt{__height;$config(){return this.config("tablerow",{extends:lt,importDOM:{tr:()=>({conversion:OI,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__height=e.__height}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e=void 0,t){super(t),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){let t=je().createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),Qe(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n==="html"}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function OI(e){let t=e,n;return ia.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:(o)=>Sl(o,_e),node:_r(n)}}function _r(e){return sn(new ca(e))}function Le(e){return e instanceof ca}function Qv(e,t,n=!0){let o=tc();for(let r=0;r<e;r++){let s=_r();for(let i=0;i<t;i++){let l=be.NO_STATUS;typeof n=="object"?(r===0&&n.rows&&(l|=be.ROW),i===0&&n.columns&&(l|=be.COLUMN)):n&&(r===0&&(l|=be.ROW),i===0&&(l|=be.COLUMN));let c=gn(l),u=ye();u.append(xt()),c.append(u),s.append(c)}o.append(s)}return o}function AI(e){let t=pe(e,(n)=>_e(n));return _e(t)?t:null}function Mm(e){let t=pe(e,(n)=>Le(n));if(Le(t))return t;throw Error("Expected table cell to be inside of table row.")}function Yd(e){let t=pe(e,(n)=>rt(n));if(rt(t))return t;throw Error("Expected table cell to be inside of table.")}function RI(e){let t=Mm(e);return Yd(t).getChildren().findIndex((n)=>n.is(t))}function MI(e){return Mm(e).getChildren().findIndex((t)=>t.is(e))}function eO(e,t){let n=Yd(e),{x:o,y:r}=n.getCordsFromCellNode(e,t);return{above:n.getCellNodeFromCords(o,r-1,t),below:n.getCellNodeFromCords(o,r+1,t),left:n.getCellNodeFromCords(o-1,r,t),right:n.getCellNodeFromCords(o+1,r,t)}}function DI(e,t){let n=e.getChildren();if(t>=n.length||t<0)throw Error("Expected table cell to be inside of table row.");return n[t].remove(),e}function $I(e,t,n=!0,o,r){let s=e.getChildren();if(t>=s.length||t<0)throw Error("Table row target index out of range");let i=s[t];if(!Le(i))throw Error("Row before insertion index does not exist.");for(let l=0;l<o;l++){let c=i.getChildren(),u=c.length,d=_r();for(let f=0;f<u;f++){let p=c[f];_e(p)||ge(12);let{above:h,below:m}=eO(p,r),_=be.NO_STATUS,x=h&&h.getWidth()||m&&m.getWidth()||void 0;(h&&h.hasHeaderState(be.COLUMN)||m&&m.hasHeaderState(be.COLUMN))&&(_|=be.COLUMN);let C=gn(_,1,x);C.append(ye()),d.append(C)}n?i.insertAfter(d):i.insertBefore(d)}return e}var Nm=(e,t)=>e===be.BOTH||e===t?t:be.NO_STATUS;function tO(e=!0){let t=K();I(t)||ze(t)||ge(188);let n=t.anchor.getNode(),o=t.focus.getNode(),[r]=Kt(n),[s,,i]=Kt(o),[,l,c]=on(i,s,r),{startRow:u}=c,{startRow:d}=l;return e?Hd(u+r.__rowSpan>d+s.__rowSpan?r:s,!0):Hd(d<u?s:r,!1)}var wI=tO;function Hd(e,t=!0){let[,,n]=Kt(e),[o,r]=on(n,e,e),s=o[0].length,{startRow:i}=r,l=null;if(t){let c=i+e.__rowSpan-1,u=o[c],d=_r();for(let p=0;p<s;p++){let{cell:h,startRow:m}=u[p];if(m+h.__rowSpan-1<=c){let _=u[p].cell.__headerState,x=Nm(_,be.COLUMN);d.append(gn(x).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}let f=n.getChildAtIndex(c);Le(f)||ge(256),f.insertAfter(d),l=d}else{let c=i,u=o[c],d=_r();for(let p=0;p<s;p++){let{cell:h,startRow:m}=u[p];if(m===c){let _=u[p].cell.__headerState,x=Nm(_,be.COLUMN);d.append(gn(x).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}let f=n.getChildAtIndex(c);Le(f)||ge(257),f.insertBefore(d),l=d}return l}function kI(e,t,n=!0,o,r){let s=e.getChildren(),i=[];for(let l=0;l<s.length;l++){let c=s[l];if(Le(c))for(let u=0;u<o;u++){let d=c.getChildren();if(t>=d.length||t<0)throw Error("Table column target index out of range");let f=d[t];_e(f)||ge(12);let{left:p,right:h}=eO(f,r),m=be.NO_STATUS;(p&&p.hasHeaderState(be.ROW)||h&&h.hasHeaderState(be.ROW))&&(m|=be.ROW);let _=gn(m);_.append(ye()),i.push({newTableCell:_,targetCell:f})}}return i.forEach(({newTableCell:l,targetCell:c})=>{n?c.insertAfter(l):c.insertBefore(l)}),e}function nO(e=!0){let t=K();I(t)||ze(t)||ge(188);let n=t.anchor.getNode(),o=t.focus.getNode(),[r]=Kt(n),[s,,i]=Kt(o),[,l,c]=on(i,s,r),{startColumn:u}=c,{startColumn:d}=l;return e?Wd(u+r.__colSpan>d+s.__colSpan?r:s,!0):Wd(d<u?s:r,!1)}var II=nO;function Wd(e,t=!0,n=!0){let[,,o]=Kt(e),[r,s]=on(o,e,e),i=r.length,{startColumn:l}=s,c=t?l+e.__colSpan-1:l-1,u=o.getFirstChild();Le(u)||ge(120);let d=null;function f(m=be.NO_STATUS){let _=gn(m).append(ye());return d===null&&(d=_),_}let p=u;e:for(let m=0;m<i;m++){if(m!==0){let v=p.getNextSibling();Le(v)||ge(121),p=v}let _=r[m],x=_[c<0?0:c].cell.__headerState,C=Nm(x,be.ROW);if(c<0){Dm(p,f(C));continue}let{cell:y,startColumn:N,startRow:E}=_[c];if(N+y.__colSpan-1<=c){let v=y,b=E,A=c;for(;b!==m&&v.__rowSpan>1;){if(A-=y.__colSpan,!(A>=0)){p.append(f(C));continue e}{let{cell:O,startRow:D}=_[A];v=O,b=D}}v.insertAfter(f(C))}else y.setColSpan(y.__colSpan+1)}d!==null&&n&&Xl(d);let h=o.getColWidths();if(h){let m=[...h],_=c<0?0:c,x=m[_];m.splice(_,0,x),o.setColWidths(m)}return d}function LI(e,t){let n=e.getChildren();for(let o=0;o<n.length;o++){let r=n[o];if(Le(r)){let s=r.getChildren();if(t>=s.length||t<0)throw Error("Table column target index out of range");s[t].remove()}}return e}function oO(){let e=K();I(e)||ze(e)||ge(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[o,,r]=Kt(t),[s]=Kt(n),[i,l,c]=on(r,o,s),{startRow:u}=l,{startRow:d}=c,f=d+s.__rowSpan-1;if(i.length===f-u+1)return void r.remove();let p=i[0].length,h=i[f+1],m=r.getChildAtIndex(f+1);for(let _=f;_>=u;_--){for(let C=p-1;C>=0;C--){let{cell:y,startRow:N,startColumn:E}=i[_][C];if(E===C){if(N<u||N+y.__rowSpan-1>f){let v=Math.max(N,u),b=Math.min(y.__rowSpan+N-1,f),A=v<=b?b-v+1:0;y.setRowSpan(y.__rowSpan-A)}if(N>=u&&N+y.__rowSpan-1>f&&_===f){Le(m)||ge(387);let v=null;for(let b=0;b<C;b++){let A=h[b],O=A.cell;A.startRow===_+1&&(v=O),O.__colSpan>1&&(b+=O.__colSpan-1)}v===null?Dm(m,y):v.insertAfter(y)}}}let x=r.getChildAtIndex(_);Le(x)||ge(206,String(_)),x.remove()}if(h!==void 0){let{cell:_}=h[0];Xl(_)}else{let _=i[u-1],{cell:x}=_[0];Xl(x)}}var FI=oO;function rO(){let e=K();I(e)||ze(e)||ge(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[o,,r]=Kt(t),[s]=Kt(n),[i,l,c]=on(r,o,s),{startColumn:u}=l,{startRow:d,startColumn:f}=c,p=Math.min(u,f),h=Math.max(u+o.__colSpan-1,f+s.__colSpan-1),m=h-p+1;if(i[0].length===h-p+1)return r.selectPrevious(),void r.remove();let _=i.length;for(let N=0;N<_;N++)for(let E=p;E<=h;E++){let{cell:v,startColumn:b}=i[N][E];if(b<p){if(E===p){let A=p-b;v.setColSpan(v.__colSpan-Math.min(m,v.__colSpan-A))}}else if(b+v.__colSpan-1>h){if(E===h){let A=h-b+1;v.setColSpan(v.__colSpan-A)}}else v.remove()}let x=i[d],C=u>f?x[u+o.__colSpan]:x[f+s.__colSpan];if(C!==void 0){let{cell:N}=C;Xl(N)}else{let N=f<u?x[f-1]:x[u-1],{cell:E}=N;Xl(E)}let y=r.getColWidths();if(y){let N=[...y];N.splice(p,m),r.setColWidths(N)}}var PI=rO;function Xl(e){let t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function Dm(e,t){let n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function sO(e){if(e.length===0)return null;let t=Yd(e[0]),[n]=uo(t,null,null),o=1/0,r=-1/0,s=1/0,i=-1/0,l=new Set;for(let h of n)for(let m of h){if(!m||!m.cell)continue;let _=m.cell.getKey();if(!l.has(_)&&e.some((x)=>x.is(m.cell))){l.add(_);let{startRow:x,startColumn:C}=m,y=m.cell.__rowSpan||1,N=m.cell.__colSpan||1;o=Math.min(o,x),r=Math.max(r,x+y-1),s=Math.min(s,C),i=Math.max(i,C+N-1)}}if(o===1/0||s===1/0)return null;let c=r-o+1,u=i-s+1,d=n[o][s];if(!d.cell)return null;let f=d.cell;f.setColSpan(u),f.setRowSpan(c);let p=new Set([f.getKey()]);for(let h=o;h<=r;h++)for(let m=s;m<=i;m++){let _=n[h][m];if(!_.cell)continue;let x=_.cell,C=x.getKey();if(!p.has(C))p.add(C),BI(x)||f.append(...x.getChildren()),x.remove()}return f.getChildrenSize()===0&&f.append(ye()),f}function BI(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!An(t)||!t.isEmpty())}function KI(){let e=K();I(e)||ze(e)||ge(188);let t=e.anchor.getNode(),n=pe(t,_e);return _e(n)||ge(148),$m(n)}function $m(e){let[t,n,o]=Kt(e),{__colSpan:r,__rowSpan:s}=t;if(r===1&&s===1)return;let[i,l]=on(o,t,t),{startColumn:c,startRow:u}=l,d=t.__headerState&be.COLUMN,f=Array.from({length:r},(m,_)=>{let x=d;for(let C=0;x!==0&&C<i.length;C++)x&=i[C][_+c].cell.__headerState;return x}),p=t.__headerState&be.ROW,h=Array.from({length:s},(m,_)=>{let x=p;for(let C=0;x!==0&&C<i[0].length;C++)x&=i[_+u][C].cell.__headerState;return x});if(r>1){for(let m=1;m<r;m++)t.insertAfter(gn(f[m]|h[0]).append(ye()));t.setColSpan(1)}if(s>1){let m;for(let _=1;_<s;_++){let x=u+_,C=i[x];m=(m||n).getNextSibling(),Le(m)||ge(125);let y=null;for(let N=0;N<c;N++){let E=C[N],v=E.cell;E.startRow===x&&(y=v),v.__colSpan>1&&(N+=v.__colSpan-1)}if(y===null)for(let N=r-1;N>=0;N--)Dm(m,gn(f[N]|h[_]).append(ye()));else for(let N=r-1;N>=0;N--)y.insertAfter(gn(f[N]|h[_]).append(ye()))}t.setRowSpan(1)}}function on(e,t,n){let[o,r,s]=uo(e,t,n);return r===null&&ge(207),s===null&&ge(208),[o,r,s]}function uo(e,t,n){let o=[],r=null,s=null;function i(c){let u=o[c];return u===void 0&&(o[c]=u=[]),u}let l=e.getChildren();for(let c=0;c<l.length;c++){let u=l[c];Le(u)||ge(209);let d=i(c);for(let f=u.getFirstChild(),p=0;f!=null;f=f.getNextSibling()){for(_e(f)||ge(147);d[p]!==void 0;)p++;let h={cell:f,startColumn:p,startRow:c},{__rowSpan:m,__colSpan:_}=f;for(let x=0;x<m&&!(c+x>=l.length);x++){let C=i(c+x);for(let y=0;y<_;y++)C[p+y]=h}t!==null&&r===null&&t.is(f)&&(r=h),n!==null&&s===null&&n.is(f)&&(s=h)}}return[o,r,s]}function Kt(e){let t;if(e instanceof mr)t=e;else if("__type"in e){let r=pe(e,_e);_e(r)||ge(148),t=r}else{let r=pe(e.getNode(),_e);_e(r)||ge(148),t=r}let n=t.getParent();Le(n)||ge(149);let o=n.getParent();return rt(o)||ge(210),[t,n,o]}function ql(e,t,n){let o,r=Math.min(t.startColumn,n.startColumn),s=Math.min(t.startRow,n.startRow),i=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),l=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{o=!1;for(let c=0;c<e.length;c++)for(let u=0;u<e[0].length;u++){let d=e[c][u];if(!d)continue;let f=d.startColumn+d.cell.__colSpan-1,p=d.startRow+d.cell.__rowSpan-1,h=d.startColumn<=i&&f>=r,m=d.startRow<=l&&p>=s;if(h&&m){let _=Math.min(r,d.startColumn),x=Math.max(i,f),C=Math.min(s,d.startRow),y=Math.max(l,p);_===r&&x===i&&C===s&&y===l||(r=_,i=x,s=C,l=y,o=!0)}}}while(o);return{maxColumn:i,maxRow:l,minColumn:r,minRow:s}}function wm(e){let t=e.getChildren(),n=null;for(let o of t){if(!Le(o))return!1;if(n===null&&(n=o.getChildrenSize()),o.getChildrenSize()!==n)return!1;let r=o.getChildren();for(let s of r)if(!_e(s)||s.getRowSpan()!==1||s.getColSpan()!==1)return!1}return(n||0)>0}function zI(e,t,n){if(t===n)return;let o=e.getColumnCount();if(t<0||t>=o||n<0||n>=o)return;if(!wm(e))return;e.getChildren().filter(Le).forEach((s)=>{let i=s.getChildren(),[l]=i.splice(t,1);i.splice(n,0,l),s.splice(0,i.length,i)});let r=e.getColWidths();if(r&&r.length===o){let s=[...r],[i]=s.splice(t,1);s.splice(n,0,i),e.setColWidths(s)}}function UI(e,t,n){if(t===n)return;let o=e.getChildren().filter(Le),r=o.length;if(t<0||t>=r||n<0||n>=r)return;if(!wm(e))return;let s=o[t],i=o[n];n>t?i.insertAfter(s):i.insertBefore(s)}function Em(e){let[t,,n]=Kt(e),o=n.getChildren().filter(Le),r=o.length,s=o[0].getChildren().length,i=Array(r);for(let l=0;l<r;l++)i[l]=Array(s);for(let l=0;l<r;l++){let c=o[l].getChildren().filter(_e),u=0;for(let d=0;d<c.length;d++){for(;i[l][u];)u++;let f=c[d],p=f.__rowSpan||1,h=f.__colSpan||1;for(let m=0;m<p;m++)for(let _=0;_<h;_++)i[l+m][u+_]=f;if(t===f)return{colSpan:h,columnIndex:u,rowIndex:l,rowSpan:p};u+=h}}return null}function iO(e,t){let n=t.getStartEndPoints(),o=ze(t);if(n===null)return!1;let[r,s]=n,[i,l,c]=Kt(r),u=pe(s.getNode(),(k)=>_e(k));if(!(_e(i)&&_e(u)&&Le(l)&&rt(c)))return!1;let[d,f,p]=on(c,i,u),[h]=uo(e,null,null),m=d.length,_=m>0?d[0].length:0,{startRow:x,startColumn:C}=f,y=h.length,N=y>0?h[0].length:0;if(o){let k=ql(d,f,p),J=k.maxRow-k.minRow+1,V=k.maxColumn-k.minColumn+1;x=k.minRow,C=k.minColumn,y=Math.min(y,J),N=Math.min(N,V)}let E=!1,v=Math.min(m,x+y)-1,b=Math.min(_,C+N)-1,A=new Set;for(let k=x;k<=v;k++)for(let J=C;J<=b;J++){let V=d[k][J];A.has(V.cell.getKey())||(V.cell.__rowSpan===1&&V.cell.__colSpan===1||($m(V.cell),A.add(V.cell.getKey()),E=!0))}let[O]=uo(c.getWritable(),null,null),D=y-m+x;for(let k=0;k<D;k++)Hd(O[m-1][0].cell);let H=N-_+C;for(let k=0;k<H;k++)Wd(O[0][_-1].cell,!0,!1);[O]=uo(c.getWritable(),null,null);for(let k=x;k<x+y;k++)for(let J=C;J<C+N;J++){let V=k-x,oe=J-C,B=h[V][oe];if(B.startRow!==V||B.startColumn!==oe)continue;let de=B.cell;if(de.__rowSpan!==1||de.__colSpan!==1){let ae=[],ce=Math.min(k+de.__rowSpan,x+y)-1,Re=Math.min(J+de.__colSpan,C+N)-1;for(let Me=k;Me<=ce;Me++)for(let gt=J;gt<=Re;gt++){let Jt=O[Me][gt];ae.push(Jt.cell)}sO(ae),E=!0}let{cell:xe}=O[k][J],ve=de.getBackgroundColor();ve!=null&&xe.setBackgroundColor(ve);let te=xe.getChildren();de.getChildren().forEach((ae)=>{if(ne(ae))ye().append(ae),xe.append(ae);else xe.append(ae)}),te.forEach((ae)=>ae.remove())}if(o&&E){let[k]=uo(c.getWritable(),null,null);k[f.startRow][f.startColumn].cell.selectEnd()}return!0}function HI(e,t,n){let[o]=uo(e,null,null);t>=0&&t<o.length||ge(396,String(t));let r=o[t],s=n?be.ROW:be.NO_STATUS,i=new Set;for(let l=0;l<r.length;l++){let c=r[l];c!=null&&(i.has(c.cell)||(i.add(c.cell),c.cell.setHeaderStyles(s,be.ROW)))}}function WI(e,t,n){let[o]=uo(e,null,null);o.length>0&&t>=0&&t<o[0].length||ge(397,String(t));let r=n?be.COLUMN:be.NO_STATUS,s=new Set;for(let i=0;i<o.length;i++){let l=o[i][t];l!=null&&(s.has(l.cell)||(s.add(l.cell),l.cell.setHeaderStyles(r,be.COLUMN)))}}function xm(e){let[[t,n,o,r],[s,i,l,c]]=["anchor","focus"].map((u)=>{let d=e[u].getNode(),f=pe(d,_e);_e(f)||ge(238,u,d.getKey(),d.getType());let p=f.getParent();Le(p)||ge(239,u);let h=p.getParent();return rt(h)||ge(240,u),[d,f,p,h]});return r.is(c)||ge(241),{anchorCell:n,anchorNode:t,anchorRow:o,anchorTable:r,focusCell:i,focusNode:s,focusRow:l,focusTable:c}}class ec{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;let e=Ot(this.tableKey),t=Ot(this.anchor.key),n=Ot(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return ze(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new ec(this.tableKey,Xn(this.anchor.key,this.anchor.offset,this.anchor.type),Xn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e==="")return;let t=(e.endsWith(`
|
|
38
38
|
`)?e.slice(0,-1):e).split(`
|
|
39
|
-
`).map((r)=>r.split("\t")),n=tc();for(let r of t){let s=
|
|
40
|
-
`:"\t")}return t}}function ze(e){return e instanceof ec}function GI(){let e=Vn("root",0,"element"),t=Vn("root",0,"element");return new ec("root",e,t)}function Gd(e,t,n){e.getKey(),t.getKey(),n.getKey();let o=K(),r=ze(o)?o.clone():new ec("root",Vn("root",0,"element"),Vn("root",0,"element"));return r.set(e.getKey(),t.getKey(),n.getKey()),r}function jI(e,t){let n=[[e]];for(let o=n.at(-1);o!==void 0&&n.length>0;o=n.at(-1)){let r=o.pop();r===void 0?n.pop():t(r)!==!1&&W(r)&&n.push(r.getChildren())}}function km(e,t=Ke()){let n=Ot(e);rt(n)||ge(231,e);let o=qo(n,t.getElementByKey(e));return o===null&&ge(232,e),{tableElement:o,tableNode:n}}class aO{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let o=Ot(t);rt(o)?e.push([o,n]):this.removeObserver(t)}return e}}class Im{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach((e)=>e()),this.listenersToRemove.clear()}$lookup(){return km(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver((t)=>{this.editor.read("latest",()=>{let n=!1;for(let s=0;s<t.length;s++){let i=t[s].target.nodeName;if(i==="TABLE"||i==="TBODY"||i==="THEAD"||i==="TR"){n=!0;break}}if(!n)return;let{tableNode:o,tableElement:r}=this.$lookup();this.table=la(o,r)})});this.editor.read("latest",()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=la(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:o}=this.$lookup();Kd(t,la(n,o),null),e&&K()!==null&&(pt(null),t.dispatchCommand(no))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();nn(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();Qe(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&ge(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Kd(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=wn(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:o}=this.$lookup(),{x:r,y:s}=e;if(this.focusCell=e,!this.isHighlightingCells)(t||this.anchorX!==r||this.anchorY!==s||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&r===this.focusX&&s===this.focusY)return!1;if(this.focusX=r,this.focusY=s,this.isHighlightingCells){let i=vm(o,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let l=i;if(l===null&&t&&(l=o.getCellNodeFromCords(r,s,this.table)),l!==null){let c=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=l.getKey(),this.tableSelection=Gd(o,c,l),pt(this.tableSelection),n.dispatchCommand(no),Kd(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?Ot(this.anchorCellNodeKey):null;return _e(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&ge(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?Ot(this.focusCellNodeKey):null;return _e(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&ge(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=vm(t,e.elem);if(n!==null){let o=n.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),o,o)):this.tableSelection=Gd(t,n,n),this.anchorCellNodeKey=o}}$formatCells(e){let t=K();ze(t)||ge(236);let n=Lr(),{anchor:o,focus:r}=n,s=t.getNodes().filter(_e);s.length>0||ge(237);let i=s[0].getFirstChild(),l=An(i)?i.getFormatFlags(e,null):null;s.forEach((c)=>{o.set(c.getKey(),0,"element"),r.set(c.getKey(),c.getChildrenSize(),"element"),n.formatText(e,l)}),pt(t),this.editor.dispatchCommand(no)}$clearText(){let{editor:e}=this,t=Ot(this.tableNodeKey);if(!rt(t))throw Error("Expected TableNode.");let n=K();ze(n)||ge(253);let o=n.getNodes().filter(_e),r=t.getFirstChild(),s=t.getLastChild();if(o.length>0&&r!==null&&s!==null&&Le(r)&&Le(s)&&o[0]===r.getFirstChild()&&o[o.length-1]===s.getLastChild()){t.selectPrevious();let i=t.getParent();return t.remove(),void(xo(i)&&i.isEmpty()&&e.dispatchCommand(Hr))}o.forEach((i)=>{if(W(i)){let l=ye(),c=xt();l.append(c),i.append(l),i.getChildren().forEach((u)=>{u!==l&&u.remove()})}}),Kd(e,this.table,null),pt(null),e.dispatchCommand(no)}}var aa="__lexicalTableSelection";function lO(e){let t=ky(e);return rt(t)||ge(386,e),t}var na=40;function Cm(e,t,n){let o=(r)=>Math.max(1,Math.ceil(Math.min(na,r)/na*18));return e<=t+na?-o(t+na-e):e>=n-na?o(e-(n-na)):0}function is(e){return Ce(e)&&e.nodeName==="TABLE"}function qo(e,t){if(!t)return t;let n=is(t)?t:t.querySelector("table");return is(n)||ge(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function Vd(e){return e._window}function Xd(e,t){for(let n=t,o=null;n!==null;n=n.getParent()){if(e.is(n))return o;_e(n)&&(o=n)}return null}var YI=[[Ho,"down"],[to,"up"],[Wr,"backward"],[bi,"forward"]],VI=[iu,su,Ei],XI=[vi,hu];function qI(e,t){return e.registerRootListener((n)=>{if(n===null)return;let o=e._window;if(o===null)return;return ro(o,"pointerdown",(r)=>{let s=xl(r);if(r.button!==0||!oo(s)||!n.contains(s))return;let i=function(l){let c=Zl(l);if(c===null)return null;let u=c.elem;for(;u!=null;){if(u.nodeName==="TABLE"&&aa in u&&u[aa])return{cellElement:c,tableElement:u,tableObserver:u[aa]};u=u.parentNode}return null}(s);e.update(()=>{if(ze(K())){for(let[d]of t.observers.values())d.$clearHighlight(!1);pt(null),e.dispatchCommand(no)}if(!i)return;let{tableObserver:l,tableElement:c,cellElement:u}=i;(function(d,f,p,h,m,_){let x=d._window;if(!x)return;let C=(E)=>{if(m.isSelecting)return;m.isSelecting=!0,E!==null&&m.anchorCell===null&&d.update(()=>{m.$setAnchorCellForSelection(E)});let{clientX:v,clientY:b}=f,A=null,O=()=>{m.isSelecting=!1,A!==null&&(x.cancelAnimationFrame(A),A=null),x.removeEventListener("pointerup",xe),x.removeEventListener("pointermove",ve)},D=(te,ae)=>{let ce=h.getRootNode();if(!Yr(ce)&&!Au(ce))return null;for(let Re of ce.elementsFromPoint(te,ae)){let Me=Yv(h,Re);if(Me)return Me}return null},H=(te,ae)=>{m.anchorCell===null&&d.update(()=>{m.$setAnchorCellForSelection(te)}),m.focusCell!==null&&te.elem===m.focusCell.elem||(_.setNextFocus({focusCell:te,override:ae,tableKey:m.tableNodeKey}),d.dispatchCommand(no))},k=(te)=>{for(let ae=h.parentElement;ae;ae=ae.parentElement)if(te==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ce=x.getComputedStyle(ae),Re=te==="x"?ce.overflowX:ce.overflowY;if(Re==="auto"||Re==="scroll")return ae}return null},q=(te,ae,ce)=>{let Re,Me;if(te===null)Re=0,Me=ce==="x"?x.innerWidth:x.innerHeight;else{let ke=te.getBoundingClientRect();Re=ce==="x"?ke.left:ke.top,Me=ce==="x"?ke.right:ke.bottom}let gt=Cm(ae,Re,Me);if(gt===0)return!1;if(te===null){let ke=ce==="x"?x.scrollX:x.scrollY;return x.scrollBy(ce==="x"?gt:0,ce==="x"?0:gt),(ce==="x"?x.scrollX:x.scrollY)!==ke}if(ce==="x"){let ke=te.scrollLeft;return te.scrollLeft+=gt,te.scrollLeft!==ke}let Jt=te.scrollTop;return te.scrollTop+=gt,te.scrollTop!==Jt},j=(te,ae)=>{let ce=v,Re=b;if(te===null)ce=Math.min(Math.max(ce,1),x.innerWidth-1);else{let Me=te.getBoundingClientRect();ce=Math.min(Math.max(ce,Me.left+1),Me.right-1)}if(ae===null)Re=Math.min(Math.max(Re,1),x.innerHeight-1);else{let Me=ae.getBoundingClientRect();Re=Math.min(Math.max(Re,Me.top+1),Me.bottom-1)}return[ce,Re]},oe=()=>{let te=k("x");if(te!==null){let Me=te.getBoundingClientRect();if(Cm(v,Me.left,Me.right)!==0)return!0}let ae=k("y"),ce=ae===null?0:ae.getBoundingClientRect().top,Re=ae===null?x.innerHeight:ae.getBoundingClientRect().bottom;return Cm(b,ce,Re)!==0},B=()=>{if(A=null,!m.isSelecting)return;let te=k("x"),ae=k("y"),ce=te!==null&&q(te,v,"x"),Re=q(ae,b,"y");if(ce||Re){let[Me,gt]=j(te,ae),Jt=D(Me,gt);Jt&&H(Jt,!1),A=x.requestAnimationFrame(B)}},de=()=>{A===null&&m.pointerType!=="touch"&&oe()&&(A=x.requestAnimationFrame(B))},xe=()=>{O()},ve=(te)=>{if(!((Me)=>!(1&~Me.buttons))(te)&&m.isSelecting)return void O();let ae=xl(te);if(!oo(ae))return;v=te.clientX,b=te.clientY;let ce=null,Re=!($s||h.contains(ae));ce=Re?Yv(h,ae):D(te.clientX,te.clientY),ce&&H(ce,Re),de()};x.addEventListener("pointerup",xe,m.listenerOptions),x.addEventListener("pointermove",ve,m.listenerOptions)};m.pointerType=f.pointerType;let y=lO(m.tableNodeKey),N=Cn();if($s&&f.shiftKey&&vo(N,y)&&(I(N)||ze(N))){let E=N.anchor.getNode(),v=Xd(y,N.anchor.getNode());if(v)m.$setAnchorCellForSelection(Zs(m,v)),m.$setFocusCellForSelection(p),pr(f);else(y.isBefore(E)?y.selectStart():y.selectEnd()).anchor.set(N.anchor.key,N.anchor.offset,N.anchor.type)}else f.pointerType!=="touch"&&m.$setAnchorCellForSelection(p);C(p)})(e,r,u,c,l,t)})})})}function cO(e,t,n,o,r){let s=n.getRootElement(),i=Vd(n);s!==null&&i!==null||ge(246);let l=new Im(n,e.getKey()),c=qo(e,t);(function(p,h){Tm(p)!==null&&ge(205),p[aa]=h})(c,l),l.listenersToRemove.add(()=>function(p,h){Tm(p)===h&&delete p[aa]}(c,l)),l.listenersToRemove.add(ro(c,"mousedown",(p)=>{let h=xl(p);if(p.detail>=3&&oo(h))Zl(h)!==null&&p.preventDefault()},l.listenerOptions));for(let[p,h]of YI)l.listenersToRemove.add(n.registerCommand(p,(m)=>fO(n,m,h,e,l,r),Dn));l.listenersToRemove.add(n.registerCommand(Ai,(p)=>{let h=K();if(ze(h)){let m=Xd(e,h.focus.getNode());if(m!==null)return pr(p),m.selectEnd(),!0}return!1},Dn));let u=()=>{let p=K();return!!vo(p,e)&&(!!ze(p)&&(l.$clearText(),!0))};for(let p of VI)l.listenersToRemove.add(n.registerCommand(p,u,Dn));let d=(p)=>{let h=K();if(!ze(h)&&!I(h))return!1;let m=e.isParentOf(h.anchor.getNode());if(m!==e.isParentOf(h.focus.getNode())){let _=m?"anchor":"focus",x=m?"focus":"anchor",{key:C,offset:y,type:N}=h[x];return e[h[_].isBefore(h[x])?"selectPrevious":"selectNext"]()[x].set(C,y,N),!1}return!!vo(h,e)&&(!!ze(h)&&(p&&(p.preventDefault(),p.stopPropagation()),l.$clearText(),!0))};for(let p of XI)l.listenersToRemove.add(n.registerCommand(p,d,Dn));l.listenersToRemove.add(n.registerCommand(ou,(p)=>{let h=K();if(h){if(!ze(h)&&!I(h))return!1;Dl(n,kn(p,ClipboardEvent)?p:null,ad(h));let m=d(p);return I(h)?(h.removeText(),!0):m}return!1},Dn));let f=s.ownerDocument;return l.listenersToRemove.add(ro(f,"paste",(p)=>{if(p.defaultPrevented)return;n.read("latest",()=>{let h=K();return s.contains(f.activeElement)&&ze(h)&&vo(h,e)})&&(p.preventDefault(),n.dispatchCommand(Mi,p))})),l.listenersToRemove.add(ro(f,"copy",(p)=>{if(p.defaultPrevented)return;let h=xl(p);if(h===s||oo(h)&&s.contains(h))return;n.read("latest",()=>{let m=K();return s.contains(yo(s))&&ze(m)&&vo(m,e)})&&(p.preventDefault(),n.dispatchCommand(Ni,p))})),l.listenersToRemove.add(n.registerCommand(Uo,(p)=>{let h=K();return!!vo(h,e)&&(!!ze(h)&&(l.$formatCells(p),!0))},Dn)),l.listenersToRemove.add(n.registerCommand(lu,(p)=>{let h=K();if(!ze(h)||!vo(h,e))return!1;let m=h.anchor.getNode(),_=h.focus.getNode();if(!_e(m)||!_e(_))return!1;let[x,C,y]=on(e,m,_),N=Math.max(C.startRow+C.cell.__rowSpan-1,y.startRow+y.cell.__rowSpan-1),E=Math.max(C.startColumn+C.cell.__colSpan-1,y.startColumn+y.cell.__colSpan-1),v=Math.min(C.startRow,y.startRow),b=Math.min(C.startColumn,y.startColumn);if(v===0&&b===0&&N===x.length-1&&E===x[0].length-1)return e.setFormat(p),!0;let A=new Set;for(let O=v;O<=N;O++)for(let D=b;D<=E;D++){let H=x[O][D].cell;if(A.has(H))continue;A.add(H),H.setFormat(p);let k=H.getChildren();for(let q=0;q<k.length;q++){let j=k[q];W(j)&&!j.isInline()&&j.setFormat(p)}}return!0},Dn)),l.listenersToRemove.add(n.registerCommand(nu,(p)=>{let h=K();if(!vo(h,e))return!1;if(ze(h))return l.$clearHighlight(),!1;if(I(h)){let m=pe(h.anchor.getNode(),(_)=>_e(_));if(!_e(m))return!1;if(typeof p=="string"){let _=Xv(n,h,e);if(_)return Vv(_,e,[xt(p)]),!0}}return!1},Dn)),o&&l.listenersToRemove.add(n.registerCommand(Gr,(p)=>{let h=K();if(!I(h)||!h.isCollapsed()||!vo(h,e))return!1;let m=sa(h.anchor.getNode());return!(m===null||!e.is(Qs(m)))&&(pr(p),function(_,x){let C=x==="next"?"getNextSibling":"getPreviousSibling",y=x==="next"?"getFirstChild":"getLastChild",N=_[C]();if(W(N))return N.selectEnd();let E=pe(_,Le);E===null&&ge(247);for(let b=E[C]();Le(b);b=b[C]()){let A=b[y]();if(W(A))return A.selectEnd()}let v=pe(E,rt);v===null&&ge(248),x==="next"?v.selectNext():v.selectPrevious()}(m,p.shiftKey?"previous":"next"),!0)},Dn)),l.listenersToRemove.add(n.registerCommand(Zy,(p)=>e.isSelected(),Dn)),l.listenersToRemove.add(n.registerCommand(Hr,()=>{let p=K();if(!I(p)||!p.isCollapsed()||!vo(p,e))return!1;let h=Xv(n,p,e);return!!h&&(Vv(h,e),!0)},Dn)),l}function JI(e,t){let n=K(),o=Cn(),r=e.getAndClearNextFocus();if(r!==null){let{tableKey:i,focusCell:l}=r,c=e.observers.get(i);c||ge(335,i);let[u]=c;if(ze(n)&&n.tableKey===u.tableNodeKey)return(l.x!==u.focusX||l.y!==u.focusY)&&(u.$setFocusCellForSelection(l),!0);if(u.anchorCell!==null&&u.anchorCellNodeKey!==null&&l.elem!==u.anchorCell.elem&&u.tableSelection!==null)return u.$setFocusCellForSelection(l,!0),!0}let s=e.getAndClearShouldCheckSelectionForTable();if(s&&I(o)&&I(n)&&n.isCollapsed()){let i=Ot(s);if(rt(i)){let l=n.anchor.getNode(),c=i.getFirstChild(),u=sa(l);if(u!==null&&Le(c)){let d=c.getFirstChild();if(_e(d)&&i.is(pe(u,(f)=>f.is(i)||f.is(d))))return d.selectStart(),!0}}}ze(n)&&function(i,l){let c=Vd(i),u=Cn();if(!l.is(u))return;let d=lO(l.tableKey),f=wn(c),p=f&&ws(f,i.getRootElement());if(f&&p&&p.anchorNode&&p.focusNode){let h=Tt(p.focusNode),m=h&&!d.isParentOf(h),_=Tt(p.anchorNode),x=_&&d.isParentOf(_);if(m&&x&&f.rangeCount>0){let C=Ay(f,i);C&&(C.anchor.set(d.getKey(),l.isBackward()?d.getChildrenSize():0,"element"),f.removeAllRanges(),pt(C))}}}(t,n),I(n)&&function(i,l){let c=Cn(),{anchor:u,focus:d}=i,f=u.getNode(),p=d.getNode(),h=sa(f),m=sa(p),_=h?Qs(h):null,x=m?Qs(m):null,C=i.isBackward(),y=h&&m&&_&&x&&_.is(x),N=x&&(!_||_.isParentOf(x)),E=_&&(!x||x.isParentOf(_));if(N){let v=i.clone(),[b]=on(x,m,m),A=b[0][0].cell,O=b[b.length-1].at(-1).cell;v.focus.set(C?A.getKey():O.getKey(),C?0:O.getChildrenSize(),"element"),pt(v)}else if(E){let v=i.clone(),[b]=on(_,h,h),A=b[0][0].cell,O=b[b.length-1].at(-1).cell;v.anchor.set(C?O.getKey():A.getKey(),C?O.getChildrenSize():0,"element"),pt(v)}else if(y){let v=l.observers.get(_.getKey());v||ge(335,_.getKey());let[b]=v;if(h.is(m)||(b.$setAnchorCellForSelection(Zs(b,h)),b.$setFocusCellForSelection(Zs(b,m),!0)),b.pointerType==="touch"&&b.isSelecting&&i.isCollapsed()&&I(c)&&c.isCollapsed()){let A=sa(c.anchor.getNode());A&&!A.is(m)&&(b.$setAnchorCellForSelection(Zs(b,A)),b.$setFocusCellForSelection(Zs(b,m),!0),b.pointerType=null)}}}(n,e);for(let[i,l]of e.$getTableNodesAndObservers())ZI(t,i,l);return!1}function ZI(e,t,n){let o=K(),r=Cn();o&&!o.is(r)&&(ze(o)||ze(r))&&n.tableSelection&&!n.tableSelection.is(r)&&(ze(o)&&o.tableKey===n.tableNodeKey?n.$updateTableTableSelection(o):!ze(o)&&ze(r)&&r.tableKey===n.tableNodeKey&&n.$updateTableTableSelection(null)),n.hasHijackedSelectionStyles&&!t.isSelected()?function(s,i){i.$enableHighlightStyle(),bm(i.table,(l)=>{let c=l.elem;l.highlighted=!1,dO(s,l),c.getAttribute("style")||c.removeAttribute("style")})}(e,n):!n.hasHijackedSelectionStyles&&t.isSelected()&&function(s,i){i.$disableHighlightStyle(),bm(i.table,(l)=>{l.highlighted=!0,uO(s,l)})}(e,n)}function Tm(e){return e[aa]||null}function Zl(e){let t=e;for(;t!=null;){let n=t.nodeName;if(n==="TD"||n==="TH"){let o=t._cell;return o===void 0?null:o}t=t.parentNode}return null}function Yv(e,t){if(!e.contains(t))return null;let n=null;for(let o=t;o!=null;o=o.parentNode){if(o===e)return n;let r=o.nodeName;r!=="TD"&&r!=="TH"||(n=o._cell||null)}return null}function la(e,t){let n=[],o={columns:0,domRows:n,rows:0},r=qo(e,t).querySelector("tr"),s=0,i=0;for(n.length=0;r!=null;){let l=r.nodeName;if(l==="TD"||l==="TH"){let d={elem:r,hasBackgroundColor:r.style.backgroundColor!=="",highlighted:!1,x:s,y:i};r._cell=d;let f=n[i];f===void 0&&(f=n[i]=[]),f[s]=d}else{let d=r.firstChild;if(d!=null){r=d;continue}}let c=r.nextSibling;if(c!=null){s++,r=c;continue}let u=r.parentNode;if(u!=null){let d=u.nextSibling;if(d==null)break;i++,s=0,r=d}}return o.columns=s+1,o.rows=i+1,o}function Kd(e,t,n){let o=new Set(n?n.getNodes():[]);bm(t,(r,s)=>{let i=r.elem;o.has(s)?(r.highlighted=!0,uO(e,r)):(r.highlighted=!1,dO(e,r),i.getAttribute("style")||i.removeAttribute("style"))})}function bm(e,t){let{domRows:n}=e;for(let o=0;o<n.length;o++){let r=n[o];if(r)for(let s=0;s<r.length;s++){let i=r[s];if(!i)continue;let l=Tt(i.elem);l!==null&&t(i,l,{x:s,y:o})}}}var QI=(e,t,n,o,r)=>{let s=r==="forward";switch(r){case"backward":case"forward":return n!==(s?e.table.columns-1:0)?Ud(t.getCellNodeFromCordsOrThrow(n+(s?1:-1),o,e.table),s):o!==(s?e.table.rows-1:0)?Ud(t.getCellNodeFromCordsOrThrow(s?0:e.table.columns-1,o+(s?1:-1),e.table),s):s?t.selectNext():t.selectPrevious(),!0;case"up":return o!==0?Ud(t.getCellNodeFromCordsOrThrow(n,o-1,e.table),!1):t.selectPrevious(),!0;case"down":return o!==e.table.rows-1?Ud(t.getCellNodeFromCordsOrThrow(n,o+1,e.table),!0):t.selectNext(),!0;default:return!1}};function ym(e,t){let n,o;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)o="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;o="maxRow"}return[n,o]}function zd([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function ra(e,t,[n,o]){let r=t[o],s=e[r];s===void 0&&ge(250,o,String(r));let i=t[n],l=s[i];return l===void 0&&ge(250,n,String(i)),l}function e1(e,t,n,o,r){let s=Jl(t,n,o),i=function(b,A){let{minColumn:O,maxColumn:D,minRow:H,maxRow:k}=A,q=1,j=1,oe=1,B=1,de=b[H],xe=b[k];for(let ve=O;ve<=D;ve++)q=Math.max(q,de[ve].cell.__rowSpan),B=Math.max(B,xe[ve].cell.__rowSpan);for(let ve=H;ve<=k;ve++)j=Math.max(j,b[ve][O].cell.__colSpan),oe=Math.max(oe,b[ve][D].cell.__colSpan);return{bottomSpan:B,leftSpan:j,rightSpan:oe,topSpan:q}}(t,s),{topSpan:l,leftSpan:c,bottomSpan:u,rightSpan:d}=i,f=function(b,A){let O=ym(b,A);return O===null&&ge(249,A.cell.getKey()),O}(s,n),[p,h]=zd(f),m=s[p],_=s[h];r==="forward"?m+=p==="maxColumn"?1:c:r==="backward"?m-=p==="minColumn"?1:d:r==="down"?_+=h==="maxRow"?1:l:r==="up"&&(_-=h==="minRow"?1:u);let x=t[_];if(x===void 0)return!1;let C=x[m];if(C===void 0)return!1;let[y,N]=function(b,A,O){let D=Jl(b,A,O),H=ym(D,A);if(H)return[ra(b,D,H),ra(b,D,zd(H))];let k=ym(D,O);if(k)return[ra(b,D,zd(k)),ra(b,D,k)];let q=["minColumn","minRow"];return[ra(b,D,q),ra(b,D,zd(q))]}(t,n,C),E=Zs(e,y.cell),v=Zs(e,N.cell);return e.$setAnchorCellForSelection(E),e.$setFocusCellForSelection(v,!0),!0}function vo(e,t){if(I(e)||ze(e)){let n=t.isParentOf(e.anchor.getNode()),o=t.isParentOf(e.focus.getNode());return n&&o}return!1}function Ud(e,t){t?e.selectStart():e.selectEnd()}function uO(e,t){let n=t.elem,o=e._config.theme;_e(Tt(n))||ge(131),Qe(n,o.tableCellSelected)}function dO(e,t){let n=t.elem;_e(Tt(n))||ge(131);let o=e._config.theme;nn(n,o.tableCellSelected)}function sa(e){let t=pe(e,_e);return _e(t)?t:null}function Qs(e){let t=pe(e,rt);return rt(t)?t:null}function t1(e,t,n,o,r,s,i){let l=an(n.focus,r?"previous":"next");if(rl(l))return!1;let c=l;for(let x of bs(l).iterNodeCarets("shadowRoot")){if(!Co(x)||!W(x.origin))return!1;c=x}let u=c.getParentAtCaret();if(!_e(u))return!1;let d=u,f=function(x){for(let C of bs(x).iterNodeCarets("root")){let{origin:y}=C;if(_e(y)){if(Fo(C))return Et(y,x.direction)}else if(!Le(y))break}return null}(it(d,c.direction)),p=pe(d,rt);if(!p||!p.is(s))return!1;let h=e.getElementByKey(d.getKey()),m=Zl(h);if(!h||!m)return!1;let _=hO(e,p);if(i.table=_,f)if(o==="extend"){let x=Zl(e.getElementByKey(f.origin.getKey()));if(!x)return!1;i.$setAnchorCellForSelection(m),i.$setFocusCellForSelection(x,!0)}else{let x=$t(f);zo(n.anchor,x),zo(n.focus,x)}else if(o==="extend")i.$setAnchorCellForSelection(m),i.$setFocusCellForSelection(m,!0);else{let x=function(C){let y=nl(C);return Fo(y)?$t(y):C}(it(p,l.direction));zo(n.anchor,x),zo(n.focus,x)}return pr(t),!0}function fO(e,t,n,o,r,s){if((n==="up"||n==="down")&&function(l){let c=l.getRootElement();if(!c)return!1;return c.hasAttribute("aria-controls")&&c.getAttribute("aria-controls")==="typeahead-menu"}(e))return!1;let i=K();if(!vo(i,o)){if(I(i)){if(n==="backward"){if(i.focus.offset>0)return!1;let l=function(u){for(let d=u,f=u;f!==null;d=f,f=f.getParent())if(W(f)){if(f!==d&&f.getFirstChild()!==d)return null;if(!f.isInline())return f}return null}(i.focus.getNode());if(!l)return!1;let c=l.getPreviousSibling();return!!rt(c)&&(pr(t),t.shiftKey?i.focus.set(c.getParentOrThrow().getKey(),c.getIndexWithinParent(),"element"):c.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){let l=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let c=pe(l,(h)=>rt(h));if(_e(c)&&(c=pe(c,rt)),c!==o)return!1;if(!c)return!1;let u=n==="down"?c.getNextSibling():c.getPreviousSibling();if(!u)return!1;let d=0;n==="up"&&W(u)&&(d=u.getChildrenSize());let f=u;if(n==="up"&&W(u))f=u.getLastChild()||u,d=ne(f)?f.getTextContentSize():0;let p=i.clone();return p.focus.set(f.getKey(),d,ne(f)?"text":"element"),pt(p),pr(t),!0}if(At(l)){let c=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(c){if(Xd(o,c)!==null){let u=o.getFirstDescendant(),d=o.getLastDescendant();if(!u||!d)return!1;let[f]=Kt(u),[p]=Kt(d),h=o.getCordsFromCellNode(f,r.table),m=o.getCordsFromCellNode(p,r.table),_=o.getDOMCellFromCordsOrThrow(h.x,h.y,r.table),x=o.getDOMCellFromCordsOrThrow(m.x,m.y,r.table);return r.$setAnchorCellForSelection(_),r.$setFocusCellForSelection(x,!0),!0}}return!1}{let c=pe(l,(d)=>W(d)&&!d.isInline());if(_e(c)&&(c=pe(c,rt)),!c)return!1;let u=n==="down"?c.getNextSibling():c.getPreviousSibling();if(rt(u)&&r.tableNodeKey===u.getKey()){let d=u.getFirstDescendant(),f=u.getLastDescendant();if(!d||!f)return!1;let[p]=Kt(d),[h]=Kt(f),m=i.clone();return m.focus.set((n==="up"?p:h).getKey(),n==="up"?0:h.getChildrenSize(),"element"),pr(t),pt(m),!0}}}}return n==="down"&&Ql(e)&&s.setShouldCheckSelectionForTable(o.getKey()),!1}if(I(i)){if(n==="backward"||n==="forward")return t1(e,t,i,t.shiftKey?"extend":"move",n==="backward",o,r);if(i.isCollapsed()){let{anchor:l,focus:c}=i,u=pe(l.getNode(),_e),d=pe(c.getNode(),_e);if(!_e(u)||!u.is(d))return!1;let f=Qs(u);if(f!==o&&f!=null){let y=qo(f,e.getElementByKey(f.getKey()));if(y!=null)return r.table=la(f,y),fO(e,t,n,f,r,s)}let p=e.getElementByKey(u.__key),h=e.getElementByKey(l.key);if(h==null||p==null)return!1;let m;if(l.type==="element")m=h.getBoundingClientRect();else{let y=wn(Vd(e));if(y===null||y.rangeCount===0)return!1;let N=pS(y,e.getRootElement());if(N===null)return!1;m=N.getBoundingClientRect()}let _=n==="up"?u.getFirstChild():u.getLastChild();if(_==null)return!1;let x=e.getElementByKey(_.__key);if(x==null)return!1;let C=x.getBoundingClientRect();if(n==="up"?C.top>m.top-m.height:m.bottom+m.height>C.bottom){pr(t);let y=o.getCordsFromCellNode(u,r.table);if(!t.shiftKey)return QI(r,o,y.x,y.y,n);{let N=o.getDOMCellFromCordsOrThrow(y.x,y.y,r.table);r.$setAnchorCellForSelection(N),r.$setFocusCellForSelection(N,!0)}return!0}}}else if(ze(i)){let{anchor:l,focus:c,tableKey:u}=i;if(u!==o.getKey())return!1;let d=pe(l.getNode(),_e),f=pe(c.getNode(),_e),[p]=i.getNodes();rt(p)||ge(251);let h=qo(p,e.getElementByKey(p.getKey()));if(!_e(d)||!_e(f)||!rt(p)||h==null)return!1;r.$updateTableTableSelection(i);let m=la(p,h),_=o.getCordsFromCellNode(d,m),x=o.getDOMCellFromCordsOrThrow(_.x,_.y,m);if(r.$setAnchorCellForSelection(x),pr(t),t.shiftKey){let[C,y,N]=on(o,d,f);return e1(r,C,y,N,n)}return f.selectEnd(),!0}return!1}function pr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Vv(e,t,n){let o=ye();e==="first"?t.insertBefore(o):t.insertAfter(o),o.append(...n||[]),o.selectEnd()}function Xv(e,t,n){let o=n.getParent();if(!o)return;let r=wn(Vd(e));if(!r)return;let s=ws(r,e.getRootElement()).anchorNode,i=e.getElementByKey(o.getKey()),l=qo(n,e.getElementByKey(n.getKey()));if(!s||!i||!l||!i.contains(s)||l.contains(s))return;let c=pe(t.anchor.getNode(),(y)=>_e(y));if(!c)return;let u=pe(c,(y)=>rt(y));if(!rt(u)||!u.is(n))return;let[d,f]=on(n,c,c),p=d[0][0],h=d[d.length-1][d[0].length-1],{startRow:m,startColumn:_}=f,x=m===p.startRow&&_===p.startColumn,C=m===h.startRow&&_===h.startColumn;return x?"first":C?"last":void 0}function Zs(e,t){let{tableNode:n}=e.$lookup(),o=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(o.x,o.y,e.table)}function vm(e,t,n){return Xd(e,Tt(t,n))}function jd(e){return Ce(e)&&e.nodeName==="DIV"}function qv(e,t,n){let o=e.querySelector(":scope > colgroup");if(!n)return void(o&&o.remove());o||(o=je().createElement("colgroup"),Mu(o),e.insertBefore(o,e.firstChild));let r=[];for(let s=0;s<t;s++){let i=je().createElement("col"),l=n[s];l&&(i.style.width=`${l}px`),r.push(i)}o.replaceChildren(...r)}function Jv(e,t,n){if(!t.theme.tableAlignment)return;let o=[],r=[];for(let s of["center","right"]){let i=t.theme.tableAlignment[s];i&&(s===n?r:o).push(i)}nn(e,...o),Qe(e,...r)}var gO=new WeakSet;function n1(e){let{scrollable:t,scrollbar:n,tableElement:o}=e;if(n.classList.length===0&&function(l){let c=l.style.display;l.style.display="";let u=l.offsetHeight-l.clientHeight;return l.style.display=c,u}(n)===0)return gO.add(n),n.style.display="none",t.style.scrollbarWidth="auto",()=>{};let r=()=>{n.scrollLeft!==t.scrollLeft&&(n.scrollLeft=t.scrollLeft)},s=()=>{t.scrollLeft!==n.scrollLeft&&(t.scrollLeft=n.scrollLeft)};t.addEventListener("scroll",r,{passive:!0}),n.addEventListener("scroll",s,{passive:!0});let i=null;return typeof ResizeObserver<"u"&&(i=new ResizeObserver(()=>{Om(t,n)}),i.observe(t),i.observe(o)),Om(t,n),()=>{t.removeEventListener("scroll",r),n.removeEventListener("scroll",s),i&&i.disconnect()}}function Om(e,t){if(gO.has(t))return;let n=t.firstElementChild;if(!n||!Ce(n)||!e.isConnected)return;let o=e.ownerDocument.defaultView;if(!o)return void(t.style.display="none");let r=o.getComputedStyle(e).overflowX,s=r==="auto"||r==="scroll",{scrollWidth:i,clientWidth:l}=e,c=i+"px";n.style.width!==c&&(n.style.width=c);let u=s&&i>l;t.style.display=u?"":"none"}function o1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let t=e.firstElementChild;if(!jd(t))return null;let n=t.querySelector(":scope > table");if(!is(n))return null;let o=t.nextElementSibling;return jd(o)?{scrollable:t,scrollbar:o,tableElement:n}:null}var Am=new WeakSet;function Ql(e=Ke()){return Am.has(e)}function Rm(e=Ke()){let t=so(e,"@lexical/table/Table");return!!t&&(t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek())}function pO(e,t){t?Am.add(e):Am.delete(e)}class xr extends lt{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:lt,importDOM:{table:()=>({conversion:r1,priority:1})}})}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,n){return n==="html"}getDOMSlot(e){let t=is(e)?e:e.querySelector("table");return is(t)||ge(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(":scope > colgroup"))}createDOM(e,t){let n=je().createElement("table");if(this.__style&&cr(n.style,this.__style),this.getColWidths()){let o=je().createElement("colgroup");n.appendChild(o),Mu(o)}if(Qe(n,e.theme.table),this.updateTableElement(null,n,e),Ql(t)){let o=Rm(t),r=function(s,i,l){let c=je().createElement("div"),u=i.theme.tableScrollableWrapper;return u?Qe(c,u):c.style.overflowX="auto",l&&(c.style.scrollbarWidth="none"),c.appendChild(s),c}(n,e,o);if(this.updateTableWrapper(null,r,n,e),o){let s=function(l){let c=je(),u=c.createElement("div"),d=l.theme.tableStickyScrollbar;d?Qe(u,d):(u.style.position="sticky",u.style.bottom="0",u.style.overflowX="scroll",u.style.overflowY="hidden"),u.style.display="none",u.setAttribute("aria-hidden","true"),u.tabIndex=-1;let f=c.createElement("div");return f.style.height="1px",f.style.width="0px",u.appendChild(f),u}(e),i=je().createElement("div");return i.setAttribute("data-lexical-sticky-scrollbar","true"),i.appendChild(r),i.appendChild(s),Mu(s),i}return r}return n}updateTableWrapper(e,t,n,o){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(r,s,i,l){l>0?(Qe(r,i.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(nn(r,i.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))}(t,n,o,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(r,s,i,l){l>0?(Qe(r,i.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(nn(r,i.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))}(t,n,o,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:"")&&cr(t.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(s,i,l){l?(Qe(s,i.theme.tableRowStriping),s.setAttribute("data-lexical-row-striping","true")):(nn(s,i.theme.tableRowStriping),s.removeAttribute("data-lexical-row-striping"))}(t,n,this.__rowStriping);let o=e?e.getColumnCount():0,r=e?e.__colWidths:void 0;this.getColumnCount()===o&&this.getColWidths()===r||qv(t,this.getColumnCount(),this.getColWidths()),Jv(t,n,this.getFormatType())}updateDOM(e,t,n){let o=qo(this,t);if(t===o===Ql())return!0;if(jd(t)){if(t.hasAttribute("data-lexical-sticky-scrollbar")!==Rm())return!0;let r=o.parentElement;jd(r)&&this.updateTableWrapper(e,r,o,n)}return this.updateTableElement(e,o,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();if(!n)return;qv(qo(this,e),this.getColumnCount(),n.map((o)=>o*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t;return{after:(o)=>{if(t.after&&(o=t.after(o)),!is(o)&&Ce(o)&&(o=o.querySelector("table")),!is(o))return null;Jv(o,e._config,this.getFormatType());let[r]=uo(this,null,null),s=new Map;for(let u of r)for(let d of u){let f=d.cell.getKey();s.has(f)||s.set(f,{colSpan:d.cell.getColSpan(),startColumn:d.startColumn})}let i=new Set;for(let u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let d=u.getAttribute("data-temporary-table-cell-lexical-key");if(d){let f=s.get(d);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),f){s.delete(d);for(let p=0;p<f.colSpan;p++)i.add(p+f.startColumn)}}}let l=o.querySelector(":scope > colgroup");if(l){let u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((d,f)=>i.has(f));l.replaceChildren(...u)}let c=o.querySelectorAll(":scope > tr");if(c.length>0){let u=je().createElement("tbody");for(let d of c)u.appendChild(d);o.append(u)}return o},element:!is(n)&&Ce(n)?n.querySelector("table"):n}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:o}=t;for(let r=0;r<n;r++){let s=o[r];if(s!=null)for(let i=0;i<s.length;i++){let l=s[i];if(l==null)continue;let{elem:c}=l,u=vm(this,c);if(u!==null&&e.is(u))return{x:i,y:r}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){let{domRows:o}=n,r=o[t];if(r==null)return null;let s=r[e<r.length?e:r.length-1];return s==null?null:s}getDOMCellFromCordsOrThrow(e,t,n){let o=this.getDOMCellFromCords(e,t,n);if(!o)throw Error("Cell not found at cords.");return o}getCellNodeFromCords(e,t,n){let o=this.getDOMCellFromCords(e,t,n);if(o==null)return null;let r=Tt(o.elem);return _e(r)?r:null}getCellNodeFromCordsOrThrow(e,t,n){let o=this.getCellNodeFromCords(e,t,n);if(!o)throw Error("Node at cords not TableCellNode.");return o}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!Le(e))return 0;let t=0;return e.getChildren().forEach((n)=>{_e(n)&&(t+=n.getColSpan())}),t}}function hO(e,t){let n=e.getElementByKey(t.getKey());return n===null&&ge(230),la(t,n)}function r1(e){let t=tc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);let n=e.querySelector(":scope > colgroup");if(n){let o=[];for(let r of n.querySelectorAll(":scope > col")){let s=r.style.width||"";if(!ia.test(s)&&(s=r.getAttribute("width")||"",!/^\d+$/.test(s))){o=void 0;break}o.push(parseFloat(s))}o&&t.setColWidths(o)}return{after:(o)=>Sl(o,Le),node:t}}function tc(){return sn(new xr)}function rt(e){return e instanceof xr}function s1(e){Le(e.getParent())?e.isEmpty()&&e.append(ye()):e.remove()}function i1(e){rt(e.getParent())?xp(e,_e):e.remove()}function a1(e){xp(e,Le);let[t]=uo(e,null,null),n=t.reduce((i,l)=>Math.max(i,l.length),0),o=e.getChildren();for(let i=0;i<t.length;++i){let l=o[i];if(!l)continue;Le(l)||ge(254,l.constructor.name,l.getType());let c=t[i].reduce((u,d)=>d?1+u:u,0);if(c!==n)for(let u=c;u<n;++u){let d=gn();d.append(ye()),l.append(d)}}let r=e.getColWidths(),s=e.getColumnCount();if(r&&r.length!==s){let i;if(s<r.length)i=r.slice(0,s);else if(r.length>0){let l=r[r.length-1];i=[...r,...Array(s-r.length).fill(l)]}e.setColWidths(i)}}function l1(e){if(e.detail<3||!oo(e.target))return!1;let t=Tt(e.target);if(t===null)return!1;let n=pe(t,(o)=>W(o)&&!o.isInline());if(n===null)return!1;return!!_e(n.getParent())&&(n.select(0),!0)}function c1(){let e=K();if(!I(e))return!1;let t=Qs(e.anchor.getNode());if(t===null)return!1;let n=Xe();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[o]=uo(t,null,null);if(o.length===0||o[0].length===0)return!1;let r=o[0][0];if(!r||!r.cell)return!1;let s=o[o.length-1],i=s[s.length-1];if(!i||!i.cell)return!1;let l=Gd(t,r.cell,i.cell);return pt(l),!0}function mO(e){return e.registerNodeTransform(hr,(t)=>{if(t.getColSpan()>1||t.getRowSpan()>1){let[,,n]=Kt(t),[o]=on(n,t,t),r=o.length,s=o[0].length,i=n.getFirstChild();Le(i)||ge(175);let l=[];for(let c=0;c<r;c++){c!==0&&(i=i.getNextSibling(),Le(i)||ge(175));let u=null;for(let d=0;d<s;d++){let f=o[c][d],p=f.cell;if(f.startRow===c&&f.startColumn===d)u=p,l.push(p);else if(p.getColSpan()>1||p.getRowSpan()>1){_e(p)||ge(176);let h=gn(p.__headerState);u!==null?u.insertAfter(h):rN(i,h)}}}for(let c of l)c.setColSpan(1),c.setRowSpan(1)}})}function _O(e,t=!0){let n=new aO,o=(r,s,i)=>{let l=qo(r,i),c=cO(r,l,e,t,n);n.observers.set(s,[c,l])};return Oe(qI(e,n),e.registerCommand(no,()=>JI(n,e),Dn),e.registerMutationListener(xr,(r)=>{e.read("latest",()=>{for(let[s,i]of r){let l=n.observers.get(s);if(i==="created"||i==="updated"){let{tableNode:c,tableElement:u}=km(s);l===void 0?o(c,s,u):u!==l[1]&&(n.removeObserver(s),o(c,s,u))}else i==="destroyed"&&n.removeObserver(s)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function xO(e,t){e.hasNodes([xr])||ge(255);let{hasNestedTables:n=Ks(!1)}=t??{};return Oe(e.registerCommand(Zv,(o)=>function({rows:r,columns:s,includeHeaders:i},l){let c=K()||Cn();if(!c||!I(c))return!1;if(!l&&Qs(c.anchor.getNode()))return!1;let u=Qv(Number(r),Number(s),i);Lu(u);let d=u.getFirstDescendant();return ne(d)&&d.select(),!0}(o,n.peek()),Ee),e.registerCommand(yu,(o,r)=>e===r&&function(s,i){let{nodes:l,selection:c}=s;if(!l.some((f)=>rt(f)||oN(f).some((p)=>rt(p.node)))){if(ze(c)){let f="",p=!1;for(let h of l){let m=W(h)&&!h.isInline();f.length>0&&(m||p)&&(f+=`
|
|
41
|
-
`),f+=h.getTextContent(),p=m}return c.insertRawText(f),!0}return!1}let u=ze(c),d=I(c);if(!(d&&pe(c.anchor.getNode(),(f)=>_e(f))!==null&&pe(c.focus.getNode(),(f)=>_e(f))!==null||u))return!1;if(l.length===1&&rt(l[0]))return iO(l[0],c);if(d&&i.peek()&&!function(f){if(ze(f)&&!f.focus.getNode().is(f.anchor.getNode()))return!0;if(I(f)&&_e(f.anchor.getNode())&&!f.anchor.getNode().is(f.focus.getNode()))return!0;return!1}(c))return!1;return!0}(o,n),Ee),e.registerCommand(Di,c1,we),e.registerCommand(yi,l1,Ee),e.registerNodeTransform(xr,a1),e.registerNodeTransform(ca,i1),e.registerNodeTransform(hr,s1))}var u1={$accepts:Le,$packageRun:(e)=>e.every(_e)?[mr().splice(0,0,e)]:[],name:"TableSchema"},d1={$accepts:_e,name:"TableRowSchema"},CO=[ut({$import:(e,t)=>{let n=tc();t.hasAttribute("data-lexical-row-striping")&&n.setRowStriping(!0),t.hasAttribute("data-lexical-frozen-column")&&n.setFrozenColumns(1),t.hasAttribute("data-lexical-frozen-row")&&n.setFrozenRows(1);let o=t.querySelector(":scope > colgroup");if(o){let r=[];for(let s of o.querySelectorAll(":scope > col")){let i=s.style.width||"";if(!ia.test(i)&&(i=s.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&n.setColWidths(r)}return[n.splice(0,0,Sl(e.$importChildren(t),Le))]},match:dt.tag("table"),name:"@lexical/table/table"}),ut({$import:(e,t)=>[mr(ia.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,Sl(e.$importChildren(t),_e))],match:dt.tag("tr"),name:"@lexical/table/tr"}),ut({$import:(e,t)=>{let n=t.nodeName==="TH",o=ia.test(t.style.width)?parseFloat(t.style.width):void 0,r=be.NO_STATUS;if(n){let x=t.getAttribute("scope");if(x==="col")r=be.COLUMN;else if(x==="row")r=be.ROW;else{let C=t.parentElement,y=SS(C)&&(C.parentElement&&C.parentElement.nodeName==="THEAD"||C.rowIndex===0),N=t.cellIndex===0;y&&(r|=be.ROW),N&&(r|=be.COLUMN),r===be.NO_STATUS&&(r=be.ROW)}}let s=gn(r,t.colSpan,o);s.__rowSpan=t.rowSpan;let i=t.style.backgroundColor;i!==""&&(s.__backgroundColor=i);let l=t.style.verticalAlign;(function(x){return x==="middle"||x==="bottom"})(l)&&(s.__verticalAlign=l);let c=e.get(nh),u=c|function(x){let C=0,y=x.fontWeight;y!=="700"&&y!=="bold"||(C|=fl),x.fontStyle==="italic"&&(C|=pl);let N=(x.textDecoration||"").split(" ");return N.includes("underline")&&(C|=ml),N.includes("line-through")&&(C|=hl),C}(t.style),d=e.get(oh),f=t.style.color,p=f?{...d,color:f}:d,h=[];u!==c&&h.push(Wi(nh,u)),p!==d&&h.push(Wi(oh,p));let m=function(x){let C=[],y=null,N=()=>{if(y!==null){let E=y.getFirstChild();Pe(E)&&y.getChildrenSize()===1&&E.remove()}};for(let E of x)zg(E)||ne(E)||Pe(E)?y!==null?y.append(E):(y=ye().append(E),C.push(y)):(N(),y=null,C.push(E));return N(),C.length===0&&C.push(ye()),C}(e.$importChildren(t,{context:h})),_=n?m:od(m,t);return[s.splice(0,0,_)]},match:dt.tag("td","th"),name:"@lexical/table/cell"})],yO=me({build:(e,t,n)=>Mt(t),config:Be({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[io,tn(Yo,{rules:CO})],name:"@lexical/table/Table",nodes:()=>[xr,ca,hr],register(e,t,n){let o=n.getOutput(),r=!1;return Oe(yt(()=>{let s=o.hasHorizontalScroll.value,i=o.hasStickyScrollbar.value&&s,l=Ql(e);l!==s&&pO(e,s),l===s&&r===i||e.update(_i),r=i}),xO(e,o),yt(()=>_O(e,o.hasTabHandler.value)),yt(()=>{if(o.hasStickyScrollbar.value&&o.hasHorizontalScroll.value)return e.registerRootListener((s)=>{if(s)return function(i){let l=new Map;return Oe(()=>{for(let{cleanup:c}of l.values())c();l.clear()},i.registerMutationListener(xr,(c)=>{for(let[u,d]of c){let f=l.get(u);if(d==="destroyed"){f&&(f.cleanup(),l.delete(u));continue}let p=i.getElementByKey(u),h=p&&Ce(p)?o1(p):null;f&&h&&f.parts.scrollable===h.scrollable&&f.parts.scrollbar===h.scrollbar&&f.parts.tableElement===h.tableElement?Om(h.scrollable,h.scrollbar):(f&&(f.cleanup(),l.delete(u)),h&&l.set(u,{cleanup:n1(h),parts:h}))}},{skipInitialization:!1}))}(e)})}),yt(()=>o.hasCellMerge.value?void 0:mO(e)),yt(()=>o.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(hr,(s)=>{s.getBackgroundColor()!==null&&s.setBackgroundColor(null)})))}}),f1=me({dependencies:[yO],name:"@lexical/table/Import"});var le=Lm,{$computeTableCellRectBoundary:DW,$computeTableMap:$W,$computeTableMapSkipCellCheck:wW,$createTableCellNode:kW,$createTableNode:IW,$createTableNodeWithDimensions:LW,$createTableRowNode:FW,$createTableSelection:PW,$createTableSelectionFrom:BW,$deleteTableColumn:KW,$deleteTableColumnAtSelection:zW,$deleteTableColumn__EXPERIMENTAL:UW,$deleteTableRowAtSelection:HW,$deleteTableRow__EXPERIMENTAL:WW,$findCellNode:GW,$findTableNode:jW,$getElementForTableNode:YW,$getNodeTriplet:VW,$getTableAndElementByKey:XW,$getTableCellNodeFromLexicalNode:qW,$getTableCellNodeRect:JW,$getTableColumnIndexFromTableCellNode:ZW,$getTableNodeFromLexicalNodeOrThrow:QW,$getTableRowIndexFromTableCellNode:e2,$getTableRowNodeFromTableCellNodeOrThrow:t2,$insertTableColumn:n2,$insertTableColumnAtNode:o2,$insertTableColumnAtSelection:r2,$insertTableColumn__EXPERIMENTAL:s2,$insertTableRow:i2,$insertTableRowAtNode:a2,$insertTableRowAtSelection:l2,$insertTableRow__EXPERIMENTAL:c2,$isScrollableTablesActive:u2,$isSimpleTable:d2,$isStickyScrollbarActive:f2,$isTableCellNode:g2,$isTableNode:p2,$isTableRowNode:h2,$isTableSelection:m2,$mergeCells:_2,$moveTableColumn:x2,$moveTableRow:C2,$removeTableRowAtIndex:y2,$setTableColumnIsHeader:S2,$setTableRowIsHeader:N2,$unmergeCell:E2,$unmergeCellNode:T2,INSERT_TABLE_COMMAND:b2,TableCellHeaderStates:v2,TableCellNode:SO,TableExtension:O2,TableImportExtension:A2,TableImportRules:R2,TableNode:NO,TableObserver:M2,TableRowNode:EO,TableRowSchema:D2,TableSchema:$2,applyTableHandlers:w2,getDOMCellFromTarget:k2,getTableElement:I2,getTableObserverFromTableElement:L2,registerTableCellUnmergeTransform:F2,registerTablePlugin:P2,registerTableSelectionObserver:B2,setScrollableTablesActive:K2}=le;Z();var g1={paragraph:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bullet:"Bullet List",number:"Numbered List",check:"Check List",quote:"Quote",code:"Code Block"};function p1(e){let{anchor:t,focus:n}=e,o=e.anchor.getNode(),r=e.focus.getNode();if(o===r)return o;if(e.isBackward())return ip(n)?o:r;else return ip(t)?r:o}function TO({rightContent:e}={}){let[t]=st(),[n,o]=w(!1),[r,s]=w(!1),[i,l]=w("paragraph"),[c,u]=w(!1),[d,f]=w(!1),[p,h]=w(!1),[m,_]=w(!1),[x,C]=w(!1),[y,N]=w(!1),E=Q(()=>{let B=K();if(I(B)){u(B.hasFormat("bold")),f(B.hasFormat("italic")),h(B.hasFormat("underline")),_(B.hasFormat("strikethrough")),C(B.hasFormat("code"));let de=p1(B),xe=de.getParent();N(Ji(xe)||Ji(de));let ve=B.anchor.getNode(),te=ve.getKey()==="root"?ve:ve.getTopLevelElementOrThrow(),ae=te.getKey();if(t.getElementByKey(ae)!==null)if(To(te)){let Re=Iu(ve,Vo),Me=Re?Re.getListType():te.getListType();l(Me)}else if(Il(te))l(te.getTag());else{let Re=te.getType();if(Re in g1)l(Re);else l("paragraph")}}},[t]);S(()=>t.registerCommand(no,()=>(E(),!1),Si),[t,E]),S(()=>t.registerUpdateListener(({editorState:B})=>{B.read(()=>{E()})}),[t,E]),S(()=>{let B=t.registerCommand(Ms,(xe)=>(o(xe),!1),we),de=t.registerCommand(Rs,(xe)=>(s(xe),!1),we);return()=>{B(),de()}},[t]);let v=()=>{t.update(()=>{let B=K();if(I(B))Fi(B,()=>ye())})},b=(B)=>{t.update(()=>{let de=K();if(I(de))Fi(de,()=>gd(B))})},A=()=>{if(i!=="bullet")t.dispatchCommand(E0,void 0);else t.dispatchCommand(Ed,void 0)},O=()=>{if(i!=="number")t.dispatchCommand(N0,void 0);else t.dispatchCommand(Ed,void 0)},D=()=>{if(i!=="check")t.dispatchCommand(S0,void 0);else t.dispatchCommand(Ed,void 0)},H=()=>{if(i!=="quote")t.update(()=>{let B=K();if(I(B))Fi(B,()=>pd())});else v()},k=()=>{if(i!=="code")t.update(()=>{let B=K();if(I(B))Fi(B,()=>Wv())});else v()},q=Q(()=>{if(!y){let B=prompt("Enter link URL (e.g., https://example.com):");if(B)t.dispatchCommand(kh,B)}else t.dispatchCommand(kh,null)},[t,y]),j=Q(()=>{t.update(()=>{let B=K();if(I(B))B.setFormat(0),Fi(B,()=>ye())})},[t]);return g("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[g("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[a("button",{type:"button",disabled:!n,onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Eu,void 0),title:"Undo","aria-label":"Undo",children:a(Vm,{className:"h-4 w-4"})}),a("button",{type:"button",disabled:!r,onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(xu,void 0),title:"Redo","aria-label":"Redo",children:a(Wm,{className:"h-4 w-4"})}),a("div",{className:"toolbar-divider"}),g("select",{value:i,onChange:(B)=>{let de=B.target.value;switch(de){case"paragraph":v();break;case"h1":case"h2":case"h3":b(de);break;case"bullet":A();break;case"number":O();break;case"check":D();break;case"quote":H();break;case"code":k();break}},"aria-label":"Block formatting",children:[a("option",{value:"paragraph",children:"Normal"}),a("option",{value:"h1",children:"Heading 1"}),a("option",{value:"h2",children:"Heading 2"}),a("option",{value:"h3",children:"Heading 3"}),a("option",{value:"bullet",children:"Bullet List"}),a("option",{value:"number",children:"Numbered List"}),a("option",{value:"check",children:"Check List"}),a("option",{value:"quote",children:"Quote"}),a("option",{value:"code",children:"Code Block"})]}),a("div",{className:"toolbar-divider"}),a("button",{type:"button",className:c?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:a(Fm,{className:"h-4 w-4"})}),a("button",{type:"button",className:d?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:a(zm,{className:"h-4 w-4"})}),a("button",{type:"button",className:p?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:a(Ym,{className:"h-4 w-4"})}),a("button",{type:"button",className:m?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:a(jm,{className:"h-4 w-4"})}),a("button",{type:"button",className:x?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"code"),title:"Inline Code","aria-label":"Inline Code",children:a(cu,{className:"h-4 w-4"})}),a("button",{type:"button",className:y?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:q,title:"Insert Link","aria-label":"Link",children:a(rc,{className:"h-4 w-4"})}),a("div",{className:"toolbar-divider"}),a("button",{type:"button",className:i==="h1"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>b("h1"),title:"H1","aria-label":"Heading 1",children:a(Pm,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="h2"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>b("h2"),title:"H2","aria-label":"Heading 2",children:a(Bm,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="h3"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>b("h3"),title:"H3","aria-label":"Heading 3",children:a(Km,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="bullet"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:A,title:"Bullet List","aria-label":"Bullet List",children:a(ps,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="number"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:O,title:"Numbered List","aria-label":"Numbered List",children:a(Um,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="check"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:D,title:"Check List","aria-label":"Check List",children:a(Wl,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="quote"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:H,title:"Quote","aria-label":"Quote",children:a(Hm,{className:"h-4 w-4"})}),a("div",{className:"toolbar-divider"}),a("button",{type:"button",onMouseDown:(B)=>B.preventDefault(),onClick:j,title:"Clear Formatting","aria-label":"Clear Formatting",children:a(Gm,{className:"h-4 w-4"})})]}),e&&a("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})]})}var bO={paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3"},list:{checklist:"editor-checklist",listitem:"editor-listitem",listitemChecked:"editor-listitem-checked",listitemUnchecked:"editor-listitem-unchecked",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},link:"editor-link",text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",underlineStrikethrough:"editor-text-underlineStrikethrough",code:"editor-text-code"},code:"editor-code-block"};var nc=[Nv,...Ev,...Tv,...bv,...vv];function h1({value:e,initialContent:t="",onChange:n}){let[o]=st(),r=M(!1),s=M("");return S(()=>{if(!r.current){r.current=!0;let i=e!==void 0?e:t;if(i)o.update(()=>{Qh(i,nc)}),s.current=i}},[o,t,e]),S(()=>{if(r.current&&e!==void 0&&e!==s.current)o.update(()=>{Qh(e,nc)}),s.current=e},[o,e]),a($v,{ignoreSelectionChange:!0,onChange:(i)=>{i.read(()=>{let l=Sv(nc);if(l!==s.current)s.current=l,n?.(l)})}})}function vO({initialContent:e="",value:t,onChange:n,placeholder:o="Write your markdown content here...",readOnly:r=!1,autoFocus:s=!1,className:i="",hideToolbar:l=!1,rightToolbarContent:c}){let u={namespace:"ShumaiWysiwygMarkdownEditor",theme:bO,editable:!r,onError:(d)=>{console.error("[MarkdownEditor] Error:",d)},nodes:[md,_d,Vo,ts,Gv,NO,SO,EO,V0,Zi]};return a("div",{className:`shumai-editor-wrapper ${r?"read-only":""} ${i}`,children:g(vS,{initialConfig:u,children:[!r&&!l?a(TO,{rightContent:c}):c?a("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:c}):null,g(Ie,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[a("div",{className:"relative min-h-full",children:a(IT,{contentEditable:a(KT,{className:"editor-input"}),placeholder:a("div",{className:"editor-placeholder",children:o}),ErrorBoundary:kv})}),a(jT,{}),a(v0,{}),a(O0,{}),a(R0,{}),a(q0,{}),a(Dv,{transformers:nc}),a(h1,{value:t,initialContent:e,onChange:n}),s&&a(J0,{})]})]})})}function OO({projectId:e,assetId:t,rootFolderId:n,isRoot:o}){let r=We(),s=ie(),{canAdmin:i}=Xt(e),{data:l,isLoading:c}=X({queryKey:["folders",t,"agentsmd"],queryFn:async()=>{let j=await R.api.folders[":folderId"].agentsmd.$get({param:{folderId:t}});if(!j.ok)throw Error("Failed to fetch agents.md");return await j.json()}}),[u,d]=w(""),[f,p]=w(!1),[h,m]=w("idle"),_=M(null),x=M(null),C=M(""),y=M(null),N=M(Promise.resolve());S(()=>{if(!f&&l!==void 0){let j=l.content??"";d(j),C.current=j,y.current=j,p(!0)}},[l,f]);let[E,v]=w(!1),b=ee({mutationFn:async(j)=>{let oe=await R.api.folders[":folderId"].agentsmd.$patch({param:{folderId:t},json:{content:j}});if(!oe.ok)throw Error("Failed to save agents.md");return await oe.json()},onSuccess:(j,oe)=>{if(m("saved"),y.current=oe,s.setQueryData(["folders",t,"agentsmd"],{content:oe}),s.invalidateQueries({queryKey:["folders",t]}),x.current)clearTimeout(x.current);x.current=setTimeout(()=>{m("idle")},2500)},onError:()=>{m("error")}}),A=M(b.mutateAsync);A.current=b.mutateAsync;let O=Q((j)=>{if(!i)return Promise.resolve();if(y.current===j)return m("saved"),Promise.resolve();m("saving");let oe=N.current.then(async()=>{await A.current(j)}).catch(()=>{});return N.current=oe,oe},[i]),D=Q((j)=>{if(!i)return;if(d(j),C.current=j,_.current)clearTimeout(_.current);m("saving"),_.current=setTimeout(()=>{_.current=null,O(j)},1000)},[i,O]),H=Q(()=>{if(_.current)return clearTimeout(_.current),_.current=null,O(C.current);return N.current},[O]);S(()=>()=>{if(H(),x.current)clearTimeout(x.current)},[H]);let k=async()=>{v(!0);try{H(),await N.current}catch{}finally{if(o||t===n)r({to:"/projects/$projectId",params:{projectId:e}});else r({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:t}})}},q=g("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[i?g("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(h==="saving"||E)&&g("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[a(al,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:Jh()})]}),h==="saved"&&!E&&g("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[a(qe,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:K0()})]}),h==="error"&&!E&&g("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[a(_r,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:gb()})]})]}):g("div",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/60 px-2.5 py-1 rounded-md shrink-0",title:$A(),children:[a(Pn,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:$A()})]}),g("div",{className:"flex items-center gap-2 shrink-0",children:[i&&a(Bo,{orientation:"vertical",className:"h-4 shrink-0"}),g(F,{variant:"ghost",size:"sm",onClick:k,disabled:E,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Nl(),children:[a(Ge,{className:"h-4 w-4 mr-1 shrink-0"}),a("span",{children:Nl()})]})]})]});if(c||!f)return g("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[a(al,{className:"h-4 w-4 animate-pulse mr-2"}),a("span",{children:mb()})]});return a("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:a(vO,{value:u,onChange:D,placeholder:hb(),readOnly:!i,rightToolbarContent:q,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function Kl({teamId:e,projectId:t,projectName:n,assetId:o,rootFolderId:r,isRoot:s}){let i=We(),[l,c]=w(240),[u,d]=w(360),{fileListLeftSidebarCollapsed:f,setFileListLeftSidebarCollapsed:p}=ar(),{isChatbotOpen:h,setIsChatbotOpen:m}=Ir(),_=Fr((N)=>Boolean(N.metadata["appearance.hideAgent"])),{data:x}=X({queryKey:["folders",o],queryFn:async()=>{let N=await R.api.folders[":folderId"].$get({param:{folderId:o}});if(!N.ok)throw Error("failed to fetch folder");return await N.json()},enabled:!!o}),{setProjectState:C,clearProjectState:y}=Zn();return S(()=>{let E=s||o===r?[]:x?.name?[{id:o,name:x.name},...x?.ancestorFolders??[]]:x?.ancestorFolders??[];return C({teamId:e,projectId:t,projectName:n,ancestorFolders:E,currentAsset:{name:x?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(v)=>{i({to:"/projects/$projectId/folders/$folderId",params:{projectId:t,folderId:v}})}}),()=>y()},[e,t,n,x?.ancestorFolders,x?.name,s,o,r,C,y,i]),a("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:g("div",{className:"flex-1 flex overflow-hidden relative",children:[!f&&a("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>p(!0)}),h&&a("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>m(!1)}),!f&&g(Y,{children:[a("div",{className:"bg-background flex-shrink-0",style:{width:l},children:a(qr,{teamId:e,projectId:t,projectName:n,rootFolderId:r,selectedFolderId:o,ancestorFolders:x?.ancestorFolders??[]})}),a(Jr,{onResize:(N)=>{c((E)=>Math.max(180,Math.min(400,E+N)))},className:"hidden md:block"})]}),a("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:a(OO,{projectId:t,assetId:o,rootFolderId:r,isRoot:s})}),h&&!_&&g(Y,{children:[a(Jr,{onResize:(N)=>{d((E)=>Math.max(240,Math.min(600,E-N)))},className:"hidden md:block"}),a("div",{style:{width:u},className:"bg-background flex flex-col flex-shrink-0",children:a(va,{projectId:t,contextAssetId:o})})]})]})})}
|
|
42
|
-
export{
|
|
39
|
+
`).map((r)=>r.split("\t")),n=tc();for(let r of t){let s=_r();for(let i of r){let l=gn(be.NO_STATUS),c=ye();i&&c.append(xt(i)),l.append(c),s.append(l)}n.append(s)}let{anchorCell:o}=xm(this);iO(n,o.select(0,o.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(_e).forEach((o)=>{let r=o.getFirstChild();An(r)&&(t|=r.getTextFormat())});let n=$i[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();j(t)||ge(151),Po(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=xm(this),n=Em(e);n===null&&ge(153);let o=Em(t);o===null&&ge(155);let r=Math.min(n.columnIndex,o.columnIndex),s=Math.max(n.columnIndex+n.colSpan-1,o.columnIndex+o.colSpan-1),i=Math.min(n.rowIndex,o.rowIndex),l=Math.max(n.rowIndex+n.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(r,s),fromY:Math.min(i,l),toX:Math.max(r,s),toY:Math.max(i,l)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:o}=xm(this),r=o.getParents()[1];if(r!==t){if(t.isParentOf(o)){let _=r.getParent();_==null&&ge(159),this.set(this.tableKey,o.getKey(),_.getKey())}else{let _=t.getParent();_==null&&ge(158),this.set(this.tableKey,_.getKey(),o.getKey())}return this.getNodes()}let[s,i,l]=on(t,n,o),{minColumn:c,maxColumn:u,minRow:d,maxRow:f}=ql(s,i,l),p=new Map([[t.getKey(),t]]),h=null;for(let _=d;_<=f;_++)for(let x=c;x<=u;x++){let{cell:C}=s[_][x],y=C.getParent();Le(y)||ge(160),y!==h&&(p.set(y.getKey(),y),h=y),p.has(C.getKey())||jI(C,(N)=>{p.set(N.getKey(),N)})}let m=Array.from(p.values());return CS()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter((n)=>_e(n)),t="";for(let n=0;n<e.length;n++){let o=e[n],r=o.__parent,s=(e[n+1]||{}).__parent;t+=o.getTextContent()+(s!==r?`
|
|
40
|
+
`:"\t")}return t}}function ze(e){return e instanceof ec}function GI(){let e=Xn("root",0,"element"),t=Xn("root",0,"element");return new ec("root",e,t)}function Gd(e,t,n){e.getKey(),t.getKey(),n.getKey();let o=K(),r=ze(o)?o.clone():new ec("root",Xn("root",0,"element"),Xn("root",0,"element"));return r.set(e.getKey(),t.getKey(),n.getKey()),r}function jI(e,t){let n=[[e]];for(let o=n.at(-1);o!==void 0&&n.length>0;o=n.at(-1)){let r=o.pop();r===void 0?n.pop():t(r)!==!1&&j(r)&&n.push(r.getChildren())}}function km(e,t=Ke()){let n=Ot(e);rt(n)||ge(231,e);let o=qo(n,t.getElementByKey(e));return o===null&&ge(232,e),{tableElement:o,tableNode:n}}class aO{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let o=Ot(t);rt(o)?e.push([o,n]):this.removeObserver(t)}return e}}class Im{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach((e)=>e()),this.listenersToRemove.clear()}$lookup(){return km(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver((t)=>{this.editor.read("latest",()=>{let n=!1;for(let s=0;s<t.length;s++){let i=t[s].target.nodeName;if(i==="TABLE"||i==="TBODY"||i==="THEAD"||i==="TR"){n=!0;break}}if(!n)return;let{tableNode:o,tableElement:r}=this.$lookup();this.table=la(o,r)})});this.editor.read("latest",()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=la(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:o}=this.$lookup();Kd(t,la(n,o),null),e&&K()!==null&&(pt(null),t.dispatchCommand(no))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();nn(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();Qe(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&ge(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Kd(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=kn(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:o}=this.$lookup(),{x:r,y:s}=e;if(this.focusCell=e,!this.isHighlightingCells)(t||this.anchorX!==r||this.anchorY!==s||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&r===this.focusX&&s===this.focusY)return!1;if(this.focusX=r,this.focusY=s,this.isHighlightingCells){let i=vm(o,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let l=i;if(l===null&&t&&(l=o.getCellNodeFromCords(r,s,this.table)),l!==null){let c=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=l.getKey(),this.tableSelection=Gd(o,c,l),pt(this.tableSelection),n.dispatchCommand(no),Kd(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?Ot(this.anchorCellNodeKey):null;return _e(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&ge(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?Ot(this.focusCellNodeKey):null;return _e(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&ge(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=vm(t,e.elem);if(n!==null){let o=n.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),o,o)):this.tableSelection=Gd(t,n,n),this.anchorCellNodeKey=o}}$formatCells(e){let t=K();ze(t)||ge(236);let n=Pr(),{anchor:o,focus:r}=n,s=t.getNodes().filter(_e);s.length>0||ge(237);let i=s[0].getFirstChild(),l=An(i)?i.getFormatFlags(e,null):null;s.forEach((c)=>{o.set(c.getKey(),0,"element"),r.set(c.getKey(),c.getChildrenSize(),"element"),n.formatText(e,l)}),pt(t),this.editor.dispatchCommand(no)}$clearText(){let{editor:e}=this,t=Ot(this.tableNodeKey);if(!rt(t))throw Error("Expected TableNode.");let n=K();ze(n)||ge(253);let o=n.getNodes().filter(_e),r=t.getFirstChild(),s=t.getLastChild();if(o.length>0&&r!==null&&s!==null&&Le(r)&&Le(s)&&o[0]===r.getFirstChild()&&o[o.length-1]===s.getLastChild()){t.selectPrevious();let i=t.getParent();return t.remove(),void(xo(i)&&i.isEmpty()&&e.dispatchCommand(Wr))}o.forEach((i)=>{if(j(i)){let l=ye(),c=xt();l.append(c),i.append(l),i.getChildren().forEach((u)=>{u!==l&&u.remove()})}}),Kd(e,this.table,null),pt(null),e.dispatchCommand(no)}}var aa="__lexicalTableSelection";function lO(e){let t=ky(e);return rt(t)||ge(386,e),t}var na=40;function Cm(e,t,n){let o=(r)=>Math.max(1,Math.ceil(Math.min(na,r)/na*18));return e<=t+na?-o(t+na-e):e>=n-na?o(e-(n-na)):0}function is(e){return Ce(e)&&e.nodeName==="TABLE"}function qo(e,t){if(!t)return t;let n=is(t)?t:t.querySelector("table");return is(n)||ge(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function Vd(e){return e._window}function Xd(e,t){for(let n=t,o=null;n!==null;n=n.getParent()){if(e.is(n))return o;_e(n)&&(o=n)}return null}var YI=[[Ho,"down"],[to,"up"],[Gr,"backward"],[bi,"forward"]],VI=[iu,su,Ei],XI=[vi,hu];function qI(e,t){return e.registerRootListener((n)=>{if(n===null)return;let o=e._window;if(o===null)return;return ro(o,"pointerdown",(r)=>{let s=xl(r);if(r.button!==0||!oo(s)||!n.contains(s))return;let i=function(l){let c=Zl(l);if(c===null)return null;let u=c.elem;for(;u!=null;){if(u.nodeName==="TABLE"&&aa in u&&u[aa])return{cellElement:c,tableElement:u,tableObserver:u[aa]};u=u.parentNode}return null}(s);e.update(()=>{if(ze(K())){for(let[d]of t.observers.values())d.$clearHighlight(!1);pt(null),e.dispatchCommand(no)}if(!i)return;let{tableObserver:l,tableElement:c,cellElement:u}=i;(function(d,f,p,h,m,_){let x=d._window;if(!x)return;let C=(E)=>{if(m.isSelecting)return;m.isSelecting=!0,E!==null&&m.anchorCell===null&&d.update(()=>{m.$setAnchorCellForSelection(E)});let{clientX:v,clientY:b}=f,A=null,O=()=>{m.isSelecting=!1,A!==null&&(x.cancelAnimationFrame(A),A=null),x.removeEventListener("pointerup",xe),x.removeEventListener("pointermove",ve)},D=(te,ae)=>{let ce=h.getRootNode();if(!Xr(ce)&&!Au(ce))return null;for(let Re of ce.elementsFromPoint(te,ae)){let Me=Yv(h,Re);if(Me)return Me}return null},H=(te,ae)=>{m.anchorCell===null&&d.update(()=>{m.$setAnchorCellForSelection(te)}),m.focusCell!==null&&te.elem===m.focusCell.elem||(_.setNextFocus({focusCell:te,override:ae,tableKey:m.tableNodeKey}),d.dispatchCommand(no))},k=(te)=>{for(let ae=h.parentElement;ae;ae=ae.parentElement)if(te==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ce=x.getComputedStyle(ae),Re=te==="x"?ce.overflowX:ce.overflowY;if(Re==="auto"||Re==="scroll")return ae}return null},J=(te,ae,ce)=>{let Re,Me;if(te===null)Re=0,Me=ce==="x"?x.innerWidth:x.innerHeight;else{let ke=te.getBoundingClientRect();Re=ce==="x"?ke.left:ke.top,Me=ce==="x"?ke.right:ke.bottom}let gt=Cm(ae,Re,Me);if(gt===0)return!1;if(te===null){let ke=ce==="x"?x.scrollX:x.scrollY;return x.scrollBy(ce==="x"?gt:0,ce==="x"?0:gt),(ce==="x"?x.scrollX:x.scrollY)!==ke}if(ce==="x"){let ke=te.scrollLeft;return te.scrollLeft+=gt,te.scrollLeft!==ke}let Jt=te.scrollTop;return te.scrollTop+=gt,te.scrollTop!==Jt},V=(te,ae)=>{let ce=v,Re=b;if(te===null)ce=Math.min(Math.max(ce,1),x.innerWidth-1);else{let Me=te.getBoundingClientRect();ce=Math.min(Math.max(ce,Me.left+1),Me.right-1)}if(ae===null)Re=Math.min(Math.max(Re,1),x.innerHeight-1);else{let Me=ae.getBoundingClientRect();Re=Math.min(Math.max(Re,Me.top+1),Me.bottom-1)}return[ce,Re]},oe=()=>{let te=k("x");if(te!==null){let Me=te.getBoundingClientRect();if(Cm(v,Me.left,Me.right)!==0)return!0}let ae=k("y"),ce=ae===null?0:ae.getBoundingClientRect().top,Re=ae===null?x.innerHeight:ae.getBoundingClientRect().bottom;return Cm(b,ce,Re)!==0},B=()=>{if(A=null,!m.isSelecting)return;let te=k("x"),ae=k("y"),ce=te!==null&&J(te,v,"x"),Re=J(ae,b,"y");if(ce||Re){let[Me,gt]=V(te,ae),Jt=D(Me,gt);Jt&&H(Jt,!1),A=x.requestAnimationFrame(B)}},de=()=>{A===null&&m.pointerType!=="touch"&&oe()&&(A=x.requestAnimationFrame(B))},xe=()=>{O()},ve=(te)=>{if(!((Me)=>!(1&~Me.buttons))(te)&&m.isSelecting)return void O();let ae=xl(te);if(!oo(ae))return;v=te.clientX,b=te.clientY;let ce=null,Re=!($s||h.contains(ae));ce=Re?Yv(h,ae):D(te.clientX,te.clientY),ce&&H(ce,Re),de()};x.addEventListener("pointerup",xe,m.listenerOptions),x.addEventListener("pointermove",ve,m.listenerOptions)};m.pointerType=f.pointerType;let y=lO(m.tableNodeKey),N=Cn();if($s&&f.shiftKey&&vo(N,y)&&(I(N)||ze(N))){let E=N.anchor.getNode(),v=Xd(y,N.anchor.getNode());if(v)m.$setAnchorCellForSelection(Zs(m,v)),m.$setFocusCellForSelection(p),hr(f);else(y.isBefore(E)?y.selectStart():y.selectEnd()).anchor.set(N.anchor.key,N.anchor.offset,N.anchor.type)}else f.pointerType!=="touch"&&m.$setAnchorCellForSelection(p);C(p)})(e,r,u,c,l,t)})})})}function cO(e,t,n,o,r){let s=n.getRootElement(),i=Vd(n);s!==null&&i!==null||ge(246);let l=new Im(n,e.getKey()),c=qo(e,t);(function(p,h){Tm(p)!==null&&ge(205),p[aa]=h})(c,l),l.listenersToRemove.add(()=>function(p,h){Tm(p)===h&&delete p[aa]}(c,l)),l.listenersToRemove.add(ro(c,"mousedown",(p)=>{let h=xl(p);if(p.detail>=3&&oo(h))Zl(h)!==null&&p.preventDefault()},l.listenerOptions));for(let[p,h]of YI)l.listenersToRemove.add(n.registerCommand(p,(m)=>fO(n,m,h,e,l,r),$n));l.listenersToRemove.add(n.registerCommand(Ai,(p)=>{let h=K();if(ze(h)){let m=Xd(e,h.focus.getNode());if(m!==null)return hr(p),m.selectEnd(),!0}return!1},$n));let u=()=>{let p=K();return!!vo(p,e)&&(!!ze(p)&&(l.$clearText(),!0))};for(let p of VI)l.listenersToRemove.add(n.registerCommand(p,u,$n));let d=(p)=>{let h=K();if(!ze(h)&&!I(h))return!1;let m=e.isParentOf(h.anchor.getNode());if(m!==e.isParentOf(h.focus.getNode())){let _=m?"anchor":"focus",x=m?"focus":"anchor",{key:C,offset:y,type:N}=h[x];return e[h[_].isBefore(h[x])?"selectPrevious":"selectNext"]()[x].set(C,y,N),!1}return!!vo(h,e)&&(!!ze(h)&&(p&&(p.preventDefault(),p.stopPropagation()),l.$clearText(),!0))};for(let p of XI)l.listenersToRemove.add(n.registerCommand(p,d,$n));l.listenersToRemove.add(n.registerCommand(ou,(p)=>{let h=K();if(h){if(!ze(h)&&!I(h))return!1;Ml(n,In(p,ClipboardEvent)?p:null,ad(h));let m=d(p);return I(h)?(h.removeText(),!0):m}return!1},$n));let f=s.ownerDocument;return l.listenersToRemove.add(ro(f,"paste",(p)=>{if(p.defaultPrevented)return;n.read("latest",()=>{let h=K();return s.contains(f.activeElement)&&ze(h)&&vo(h,e)})&&(p.preventDefault(),n.dispatchCommand(Mi,p))})),l.listenersToRemove.add(ro(f,"copy",(p)=>{if(p.defaultPrevented)return;let h=xl(p);if(h===s||oo(h)&&s.contains(h))return;n.read("latest",()=>{let m=K();return s.contains(yo(s))&&ze(m)&&vo(m,e)})&&(p.preventDefault(),n.dispatchCommand(Ni,p))})),l.listenersToRemove.add(n.registerCommand(Uo,(p)=>{let h=K();return!!vo(h,e)&&(!!ze(h)&&(l.$formatCells(p),!0))},$n)),l.listenersToRemove.add(n.registerCommand(lu,(p)=>{let h=K();if(!ze(h)||!vo(h,e))return!1;let m=h.anchor.getNode(),_=h.focus.getNode();if(!_e(m)||!_e(_))return!1;let[x,C,y]=on(e,m,_),N=Math.max(C.startRow+C.cell.__rowSpan-1,y.startRow+y.cell.__rowSpan-1),E=Math.max(C.startColumn+C.cell.__colSpan-1,y.startColumn+y.cell.__colSpan-1),v=Math.min(C.startRow,y.startRow),b=Math.min(C.startColumn,y.startColumn);if(v===0&&b===0&&N===x.length-1&&E===x[0].length-1)return e.setFormat(p),!0;let A=new Set;for(let O=v;O<=N;O++)for(let D=b;D<=E;D++){let H=x[O][D].cell;if(A.has(H))continue;A.add(H),H.setFormat(p);let k=H.getChildren();for(let J=0;J<k.length;J++){let V=k[J];j(V)&&!V.isInline()&&V.setFormat(p)}}return!0},$n)),l.listenersToRemove.add(n.registerCommand(nu,(p)=>{let h=K();if(!vo(h,e))return!1;if(ze(h))return l.$clearHighlight(),!1;if(I(h)){let m=pe(h.anchor.getNode(),(_)=>_e(_));if(!_e(m))return!1;if(typeof p=="string"){let _=Xv(n,h,e);if(_)return Vv(_,e,[xt(p)]),!0}}return!1},$n)),o&&l.listenersToRemove.add(n.registerCommand(jr,(p)=>{let h=K();if(!I(h)||!h.isCollapsed()||!vo(h,e))return!1;let m=sa(h.anchor.getNode());return!(m===null||!e.is(Qs(m)))&&(hr(p),function(_,x){let C=x==="next"?"getNextSibling":"getPreviousSibling",y=x==="next"?"getFirstChild":"getLastChild",N=_[C]();if(j(N))return N.selectEnd();let E=pe(_,Le);E===null&&ge(247);for(let b=E[C]();Le(b);b=b[C]()){let A=b[y]();if(j(A))return A.selectEnd()}let v=pe(E,rt);v===null&&ge(248),x==="next"?v.selectNext():v.selectPrevious()}(m,p.shiftKey?"previous":"next"),!0)},$n)),l.listenersToRemove.add(n.registerCommand(Zy,(p)=>e.isSelected(),$n)),l.listenersToRemove.add(n.registerCommand(Wr,()=>{let p=K();if(!I(p)||!p.isCollapsed()||!vo(p,e))return!1;let h=Xv(n,p,e);return!!h&&(Vv(h,e),!0)},$n)),l}function JI(e,t){let n=K(),o=Cn(),r=e.getAndClearNextFocus();if(r!==null){let{tableKey:i,focusCell:l}=r,c=e.observers.get(i);c||ge(335,i);let[u]=c;if(ze(n)&&n.tableKey===u.tableNodeKey)return(l.x!==u.focusX||l.y!==u.focusY)&&(u.$setFocusCellForSelection(l),!0);if(u.anchorCell!==null&&u.anchorCellNodeKey!==null&&l.elem!==u.anchorCell.elem&&u.tableSelection!==null)return u.$setFocusCellForSelection(l,!0),!0}let s=e.getAndClearShouldCheckSelectionForTable();if(s&&I(o)&&I(n)&&n.isCollapsed()){let i=Ot(s);if(rt(i)){let l=n.anchor.getNode(),c=i.getFirstChild(),u=sa(l);if(u!==null&&Le(c)){let d=c.getFirstChild();if(_e(d)&&i.is(pe(u,(f)=>f.is(i)||f.is(d))))return d.selectStart(),!0}}}ze(n)&&function(i,l){let c=Vd(i),u=Cn();if(!l.is(u))return;let d=lO(l.tableKey),f=kn(c),p=f&&ws(f,i.getRootElement());if(f&&p&&p.anchorNode&&p.focusNode){let h=Tt(p.focusNode),m=h&&!d.isParentOf(h),_=Tt(p.anchorNode),x=_&&d.isParentOf(_);if(m&&x&&f.rangeCount>0){let C=Ay(f,i);C&&(C.anchor.set(d.getKey(),l.isBackward()?d.getChildrenSize():0,"element"),f.removeAllRanges(),pt(C))}}}(t,n),I(n)&&function(i,l){let c=Cn(),{anchor:u,focus:d}=i,f=u.getNode(),p=d.getNode(),h=sa(f),m=sa(p),_=h?Qs(h):null,x=m?Qs(m):null,C=i.isBackward(),y=h&&m&&_&&x&&_.is(x),N=x&&(!_||_.isParentOf(x)),E=_&&(!x||x.isParentOf(_));if(N){let v=i.clone(),[b]=on(x,m,m),A=b[0][0].cell,O=b[b.length-1].at(-1).cell;v.focus.set(C?A.getKey():O.getKey(),C?0:O.getChildrenSize(),"element"),pt(v)}else if(E){let v=i.clone(),[b]=on(_,h,h),A=b[0][0].cell,O=b[b.length-1].at(-1).cell;v.anchor.set(C?O.getKey():A.getKey(),C?O.getChildrenSize():0,"element"),pt(v)}else if(y){let v=l.observers.get(_.getKey());v||ge(335,_.getKey());let[b]=v;if(h.is(m)||(b.$setAnchorCellForSelection(Zs(b,h)),b.$setFocusCellForSelection(Zs(b,m),!0)),b.pointerType==="touch"&&b.isSelecting&&i.isCollapsed()&&I(c)&&c.isCollapsed()){let A=sa(c.anchor.getNode());A&&!A.is(m)&&(b.$setAnchorCellForSelection(Zs(b,A)),b.$setFocusCellForSelection(Zs(b,m),!0),b.pointerType=null)}}}(n,e);for(let[i,l]of e.$getTableNodesAndObservers())ZI(t,i,l);return!1}function ZI(e,t,n){let o=K(),r=Cn();o&&!o.is(r)&&(ze(o)||ze(r))&&n.tableSelection&&!n.tableSelection.is(r)&&(ze(o)&&o.tableKey===n.tableNodeKey?n.$updateTableTableSelection(o):!ze(o)&&ze(r)&&r.tableKey===n.tableNodeKey&&n.$updateTableTableSelection(null)),n.hasHijackedSelectionStyles&&!t.isSelected()?function(s,i){i.$enableHighlightStyle(),bm(i.table,(l)=>{let c=l.elem;l.highlighted=!1,dO(s,l),c.getAttribute("style")||c.removeAttribute("style")})}(e,n):!n.hasHijackedSelectionStyles&&t.isSelected()&&function(s,i){i.$disableHighlightStyle(),bm(i.table,(l)=>{l.highlighted=!0,uO(s,l)})}(e,n)}function Tm(e){return e[aa]||null}function Zl(e){let t=e;for(;t!=null;){let n=t.nodeName;if(n==="TD"||n==="TH"){let o=t._cell;return o===void 0?null:o}t=t.parentNode}return null}function Yv(e,t){if(!e.contains(t))return null;let n=null;for(let o=t;o!=null;o=o.parentNode){if(o===e)return n;let r=o.nodeName;r!=="TD"&&r!=="TH"||(n=o._cell||null)}return null}function la(e,t){let n=[],o={columns:0,domRows:n,rows:0},r=qo(e,t).querySelector("tr"),s=0,i=0;for(n.length=0;r!=null;){let l=r.nodeName;if(l==="TD"||l==="TH"){let d={elem:r,hasBackgroundColor:r.style.backgroundColor!=="",highlighted:!1,x:s,y:i};r._cell=d;let f=n[i];f===void 0&&(f=n[i]=[]),f[s]=d}else{let d=r.firstChild;if(d!=null){r=d;continue}}let c=r.nextSibling;if(c!=null){s++,r=c;continue}let u=r.parentNode;if(u!=null){let d=u.nextSibling;if(d==null)break;i++,s=0,r=d}}return o.columns=s+1,o.rows=i+1,o}function Kd(e,t,n){let o=new Set(n?n.getNodes():[]);bm(t,(r,s)=>{let i=r.elem;o.has(s)?(r.highlighted=!0,uO(e,r)):(r.highlighted=!1,dO(e,r),i.getAttribute("style")||i.removeAttribute("style"))})}function bm(e,t){let{domRows:n}=e;for(let o=0;o<n.length;o++){let r=n[o];if(r)for(let s=0;s<r.length;s++){let i=r[s];if(!i)continue;let l=Tt(i.elem);l!==null&&t(i,l,{x:s,y:o})}}}var QI=(e,t,n,o,r)=>{let s=r==="forward";switch(r){case"backward":case"forward":return n!==(s?e.table.columns-1:0)?Ud(t.getCellNodeFromCordsOrThrow(n+(s?1:-1),o,e.table),s):o!==(s?e.table.rows-1:0)?Ud(t.getCellNodeFromCordsOrThrow(s?0:e.table.columns-1,o+(s?1:-1),e.table),s):s?t.selectNext():t.selectPrevious(),!0;case"up":return o!==0?Ud(t.getCellNodeFromCordsOrThrow(n,o-1,e.table),!1):t.selectPrevious(),!0;case"down":return o!==e.table.rows-1?Ud(t.getCellNodeFromCordsOrThrow(n,o+1,e.table),!0):t.selectNext(),!0;default:return!1}};function ym(e,t){let n,o;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)o="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;o="maxRow"}return[n,o]}function zd([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function ra(e,t,[n,o]){let r=t[o],s=e[r];s===void 0&&ge(250,o,String(r));let i=t[n],l=s[i];return l===void 0&&ge(250,n,String(i)),l}function e1(e,t,n,o,r){let s=ql(t,n,o),i=function(b,A){let{minColumn:O,maxColumn:D,minRow:H,maxRow:k}=A,J=1,V=1,oe=1,B=1,de=b[H],xe=b[k];for(let ve=O;ve<=D;ve++)J=Math.max(J,de[ve].cell.__rowSpan),B=Math.max(B,xe[ve].cell.__rowSpan);for(let ve=H;ve<=k;ve++)V=Math.max(V,b[ve][O].cell.__colSpan),oe=Math.max(oe,b[ve][D].cell.__colSpan);return{bottomSpan:B,leftSpan:V,rightSpan:oe,topSpan:J}}(t,s),{topSpan:l,leftSpan:c,bottomSpan:u,rightSpan:d}=i,f=function(b,A){let O=ym(b,A);return O===null&&ge(249,A.cell.getKey()),O}(s,n),[p,h]=zd(f),m=s[p],_=s[h];r==="forward"?m+=p==="maxColumn"?1:c:r==="backward"?m-=p==="minColumn"?1:d:r==="down"?_+=h==="maxRow"?1:l:r==="up"&&(_-=h==="minRow"?1:u);let x=t[_];if(x===void 0)return!1;let C=x[m];if(C===void 0)return!1;let[y,N]=function(b,A,O){let D=ql(b,A,O),H=ym(D,A);if(H)return[ra(b,D,H),ra(b,D,zd(H))];let k=ym(D,O);if(k)return[ra(b,D,zd(k)),ra(b,D,k)];let J=["minColumn","minRow"];return[ra(b,D,J),ra(b,D,zd(J))]}(t,n,C),E=Zs(e,y.cell),v=Zs(e,N.cell);return e.$setAnchorCellForSelection(E),e.$setFocusCellForSelection(v,!0),!0}function vo(e,t){if(I(e)||ze(e)){let n=t.isParentOf(e.anchor.getNode()),o=t.isParentOf(e.focus.getNode());return n&&o}return!1}function Ud(e,t){t?e.selectStart():e.selectEnd()}function uO(e,t){let n=t.elem,o=e._config.theme;_e(Tt(n))||ge(131),Qe(n,o.tableCellSelected)}function dO(e,t){let n=t.elem;_e(Tt(n))||ge(131);let o=e._config.theme;nn(n,o.tableCellSelected)}function sa(e){let t=pe(e,_e);return _e(t)?t:null}function Qs(e){let t=pe(e,rt);return rt(t)?t:null}function t1(e,t,n,o,r,s,i){let l=an(n.focus,r?"previous":"next");if(rl(l))return!1;let c=l;for(let x of bs(l).iterNodeCarets("shadowRoot")){if(!Co(x)||!j(x.origin))return!1;c=x}let u=c.getParentAtCaret();if(!_e(u))return!1;let d=u,f=function(x){for(let C of bs(x).iterNodeCarets("root")){let{origin:y}=C;if(_e(y)){if(Fo(C))return Et(y,x.direction)}else if(!Le(y))break}return null}(it(d,c.direction)),p=pe(d,rt);if(!p||!p.is(s))return!1;let h=e.getElementByKey(d.getKey()),m=Zl(h);if(!h||!m)return!1;let _=hO(e,p);if(i.table=_,f)if(o==="extend"){let x=Zl(e.getElementByKey(f.origin.getKey()));if(!x)return!1;i.$setAnchorCellForSelection(m),i.$setFocusCellForSelection(x,!0)}else{let x=$t(f);zo(n.anchor,x),zo(n.focus,x)}else if(o==="extend")i.$setAnchorCellForSelection(m),i.$setFocusCellForSelection(m,!0);else{let x=function(C){let y=nl(C);return Fo(y)?$t(y):C}(it(p,l.direction));zo(n.anchor,x),zo(n.focus,x)}return hr(t),!0}function fO(e,t,n,o,r,s){if((n==="up"||n==="down")&&function(l){let c=l.getRootElement();if(!c)return!1;return c.hasAttribute("aria-controls")&&c.getAttribute("aria-controls")==="typeahead-menu"}(e))return!1;let i=K();if(!vo(i,o)){if(I(i)){if(n==="backward"){if(i.focus.offset>0)return!1;let l=function(u){for(let d=u,f=u;f!==null;d=f,f=f.getParent())if(j(f)){if(f!==d&&f.getFirstChild()!==d)return null;if(!f.isInline())return f}return null}(i.focus.getNode());if(!l)return!1;let c=l.getPreviousSibling();return!!rt(c)&&(hr(t),t.shiftKey?i.focus.set(c.getParentOrThrow().getKey(),c.getIndexWithinParent(),"element"):c.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){let l=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let c=pe(l,(h)=>rt(h));if(_e(c)&&(c=pe(c,rt)),c!==o)return!1;if(!c)return!1;let u=n==="down"?c.getNextSibling():c.getPreviousSibling();if(!u)return!1;let d=0;n==="up"&&j(u)&&(d=u.getChildrenSize());let f=u;if(n==="up"&&j(u))f=u.getLastChild()||u,d=ne(f)?f.getTextContentSize():0;let p=i.clone();return p.focus.set(f.getKey(),d,ne(f)?"text":"element"),pt(p),hr(t),!0}if(At(l)){let c=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(c){if(Xd(o,c)!==null){let u=o.getFirstDescendant(),d=o.getLastDescendant();if(!u||!d)return!1;let[f]=Kt(u),[p]=Kt(d),h=o.getCordsFromCellNode(f,r.table),m=o.getCordsFromCellNode(p,r.table),_=o.getDOMCellFromCordsOrThrow(h.x,h.y,r.table),x=o.getDOMCellFromCordsOrThrow(m.x,m.y,r.table);return r.$setAnchorCellForSelection(_),r.$setFocusCellForSelection(x,!0),!0}}return!1}{let c=pe(l,(d)=>j(d)&&!d.isInline());if(_e(c)&&(c=pe(c,rt)),!c)return!1;let u=n==="down"?c.getNextSibling():c.getPreviousSibling();if(rt(u)&&r.tableNodeKey===u.getKey()){let d=u.getFirstDescendant(),f=u.getLastDescendant();if(!d||!f)return!1;let[p]=Kt(d),[h]=Kt(f),m=i.clone();return m.focus.set((n==="up"?p:h).getKey(),n==="up"?0:h.getChildrenSize(),"element"),hr(t),pt(m),!0}}}}return n==="down"&&Ql(e)&&s.setShouldCheckSelectionForTable(o.getKey()),!1}if(I(i)){if(n==="backward"||n==="forward")return t1(e,t,i,t.shiftKey?"extend":"move",n==="backward",o,r);if(i.isCollapsed()){let{anchor:l,focus:c}=i,u=pe(l.getNode(),_e),d=pe(c.getNode(),_e);if(!_e(u)||!u.is(d))return!1;let f=Qs(u);if(f!==o&&f!=null){let y=qo(f,e.getElementByKey(f.getKey()));if(y!=null)return r.table=la(f,y),fO(e,t,n,f,r,s)}let p=e.getElementByKey(u.__key),h=e.getElementByKey(l.key);if(h==null||p==null)return!1;let m;if(l.type==="element")m=h.getBoundingClientRect();else{let y=kn(Vd(e));if(y===null||y.rangeCount===0)return!1;let N=pS(y,e.getRootElement());if(N===null)return!1;m=N.getBoundingClientRect()}let _=n==="up"?u.getFirstChild():u.getLastChild();if(_==null)return!1;let x=e.getElementByKey(_.__key);if(x==null)return!1;let C=x.getBoundingClientRect();if(n==="up"?C.top>m.top-m.height:m.bottom+m.height>C.bottom){hr(t);let y=o.getCordsFromCellNode(u,r.table);if(!t.shiftKey)return QI(r,o,y.x,y.y,n);{let N=o.getDOMCellFromCordsOrThrow(y.x,y.y,r.table);r.$setAnchorCellForSelection(N),r.$setFocusCellForSelection(N,!0)}return!0}}}else if(ze(i)){let{anchor:l,focus:c,tableKey:u}=i;if(u!==o.getKey())return!1;let d=pe(l.getNode(),_e),f=pe(c.getNode(),_e),[p]=i.getNodes();rt(p)||ge(251);let h=qo(p,e.getElementByKey(p.getKey()));if(!_e(d)||!_e(f)||!rt(p)||h==null)return!1;r.$updateTableTableSelection(i);let m=la(p,h),_=o.getCordsFromCellNode(d,m),x=o.getDOMCellFromCordsOrThrow(_.x,_.y,m);if(r.$setAnchorCellForSelection(x),hr(t),t.shiftKey){let[C,y,N]=on(o,d,f);return e1(r,C,y,N,n)}return f.selectEnd(),!0}return!1}function hr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Vv(e,t,n){let o=ye();e==="first"?t.insertBefore(o):t.insertAfter(o),o.append(...n||[]),o.selectEnd()}function Xv(e,t,n){let o=n.getParent();if(!o)return;let r=kn(Vd(e));if(!r)return;let s=ws(r,e.getRootElement()).anchorNode,i=e.getElementByKey(o.getKey()),l=qo(n,e.getElementByKey(n.getKey()));if(!s||!i||!l||!i.contains(s)||l.contains(s))return;let c=pe(t.anchor.getNode(),(y)=>_e(y));if(!c)return;let u=pe(c,(y)=>rt(y));if(!rt(u)||!u.is(n))return;let[d,f]=on(n,c,c),p=d[0][0],h=d[d.length-1][d[0].length-1],{startRow:m,startColumn:_}=f,x=m===p.startRow&&_===p.startColumn,C=m===h.startRow&&_===h.startColumn;return x?"first":C?"last":void 0}function Zs(e,t){let{tableNode:n}=e.$lookup(),o=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(o.x,o.y,e.table)}function vm(e,t,n){return Xd(e,Tt(t,n))}function jd(e){return Ce(e)&&e.nodeName==="DIV"}function qv(e,t,n){let o=e.querySelector(":scope > colgroup");if(!n)return void(o&&o.remove());o||(o=je().createElement("colgroup"),Mu(o),e.insertBefore(o,e.firstChild));let r=[];for(let s=0;s<t;s++){let i=je().createElement("col"),l=n[s];l&&(i.style.width=`${l}px`),r.push(i)}o.replaceChildren(...r)}function Jv(e,t,n){if(!t.theme.tableAlignment)return;let o=[],r=[];for(let s of["center","right"]){let i=t.theme.tableAlignment[s];i&&(s===n?r:o).push(i)}nn(e,...o),Qe(e,...r)}var gO=new WeakSet;function n1(e){let{scrollable:t,scrollbar:n,tableElement:o}=e;if(n.classList.length===0&&function(l){let c=l.style.display;l.style.display="";let u=l.offsetHeight-l.clientHeight;return l.style.display=c,u}(n)===0)return gO.add(n),n.style.display="none",t.style.scrollbarWidth="auto",()=>{};let r=()=>{n.scrollLeft!==t.scrollLeft&&(n.scrollLeft=t.scrollLeft)},s=()=>{t.scrollLeft!==n.scrollLeft&&(t.scrollLeft=n.scrollLeft)};t.addEventListener("scroll",r,{passive:!0}),n.addEventListener("scroll",s,{passive:!0});let i=null;return typeof ResizeObserver<"u"&&(i=new ResizeObserver(()=>{Om(t,n)}),i.observe(t),i.observe(o)),Om(t,n),()=>{t.removeEventListener("scroll",r),n.removeEventListener("scroll",s),i&&i.disconnect()}}function Om(e,t){if(gO.has(t))return;let n=t.firstElementChild;if(!n||!Ce(n)||!e.isConnected)return;let o=e.ownerDocument.defaultView;if(!o)return void(t.style.display="none");let r=o.getComputedStyle(e).overflowX,s=r==="auto"||r==="scroll",{scrollWidth:i,clientWidth:l}=e,c=i+"px";n.style.width!==c&&(n.style.width=c);let u=s&&i>l;t.style.display=u?"":"none"}function o1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let t=e.firstElementChild;if(!jd(t))return null;let n=t.querySelector(":scope > table");if(!is(n))return null;let o=t.nextElementSibling;return jd(o)?{scrollable:t,scrollbar:o,tableElement:n}:null}var Am=new WeakSet;function Ql(e=Ke()){return Am.has(e)}function Rm(e=Ke()){let t=so(e,"@lexical/table/Table");return!!t&&(t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek())}function pO(e,t){t?Am.add(e):Am.delete(e)}class xr extends lt{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:lt,importDOM:{table:()=>({conversion:r1,priority:1})}})}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,n){return n==="html"}getDOMSlot(e){let t=is(e)?e:e.querySelector("table");return is(t)||ge(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(":scope > colgroup"))}createDOM(e,t){let n=je().createElement("table");if(this.__style&&ur(n.style,this.__style),this.getColWidths()){let o=je().createElement("colgroup");n.appendChild(o),Mu(o)}if(Qe(n,e.theme.table),this.updateTableElement(null,n,e),Ql(t)){let o=Rm(t),r=function(s,i,l){let c=je().createElement("div"),u=i.theme.tableScrollableWrapper;return u?Qe(c,u):c.style.overflowX="auto",l&&(c.style.scrollbarWidth="none"),c.appendChild(s),c}(n,e,o);if(this.updateTableWrapper(null,r,n,e),o){let s=function(l){let c=je(),u=c.createElement("div"),d=l.theme.tableStickyScrollbar;d?Qe(u,d):(u.style.position="sticky",u.style.bottom="0",u.style.overflowX="scroll",u.style.overflowY="hidden"),u.style.display="none",u.setAttribute("aria-hidden","true"),u.tabIndex=-1;let f=c.createElement("div");return f.style.height="1px",f.style.width="0px",u.appendChild(f),u}(e),i=je().createElement("div");return i.setAttribute("data-lexical-sticky-scrollbar","true"),i.appendChild(r),i.appendChild(s),Mu(s),i}return r}return n}updateTableWrapper(e,t,n,o){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(r,s,i,l){l>0?(Qe(r,i.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(nn(r,i.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))}(t,n,o,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(r,s,i,l){l>0?(Qe(r,i.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(nn(r,i.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))}(t,n,o,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:"")&&ur(t.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(s,i,l){l?(Qe(s,i.theme.tableRowStriping),s.setAttribute("data-lexical-row-striping","true")):(nn(s,i.theme.tableRowStriping),s.removeAttribute("data-lexical-row-striping"))}(t,n,this.__rowStriping);let o=e?e.getColumnCount():0,r=e?e.__colWidths:void 0;this.getColumnCount()===o&&this.getColWidths()===r||qv(t,this.getColumnCount(),this.getColWidths()),Jv(t,n,this.getFormatType())}updateDOM(e,t,n){let o=qo(this,t);if(t===o===Ql())return!0;if(jd(t)){if(t.hasAttribute("data-lexical-sticky-scrollbar")!==Rm())return!0;let r=o.parentElement;jd(r)&&this.updateTableWrapper(e,r,o,n)}return this.updateTableElement(e,o,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();if(!n)return;qv(qo(this,e),this.getColumnCount(),n.map((o)=>o*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t;return{after:(o)=>{if(t.after&&(o=t.after(o)),!is(o)&&Ce(o)&&(o=o.querySelector("table")),!is(o))return null;Jv(o,e._config,this.getFormatType());let[r]=uo(this,null,null),s=new Map;for(let u of r)for(let d of u){let f=d.cell.getKey();s.has(f)||s.set(f,{colSpan:d.cell.getColSpan(),startColumn:d.startColumn})}let i=new Set;for(let u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let d=u.getAttribute("data-temporary-table-cell-lexical-key");if(d){let f=s.get(d);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),f){s.delete(d);for(let p=0;p<f.colSpan;p++)i.add(p+f.startColumn)}}}let l=o.querySelector(":scope > colgroup");if(l){let u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((d,f)=>i.has(f));l.replaceChildren(...u)}let c=o.querySelectorAll(":scope > tr");if(c.length>0){let u=je().createElement("tbody");for(let d of c)u.appendChild(d);o.append(u)}return o},element:!is(n)&&Ce(n)?n.querySelector("table"):n}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:o}=t;for(let r=0;r<n;r++){let s=o[r];if(s!=null)for(let i=0;i<s.length;i++){let l=s[i];if(l==null)continue;let{elem:c}=l,u=vm(this,c);if(u!==null&&e.is(u))return{x:i,y:r}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){let{domRows:o}=n,r=o[t];if(r==null)return null;let s=r[e<r.length?e:r.length-1];return s==null?null:s}getDOMCellFromCordsOrThrow(e,t,n){let o=this.getDOMCellFromCords(e,t,n);if(!o)throw Error("Cell not found at cords.");return o}getCellNodeFromCords(e,t,n){let o=this.getDOMCellFromCords(e,t,n);if(o==null)return null;let r=Tt(o.elem);return _e(r)?r:null}getCellNodeFromCordsOrThrow(e,t,n){let o=this.getCellNodeFromCords(e,t,n);if(!o)throw Error("Node at cords not TableCellNode.");return o}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!Le(e))return 0;let t=0;return e.getChildren().forEach((n)=>{_e(n)&&(t+=n.getColSpan())}),t}}function hO(e,t){let n=e.getElementByKey(t.getKey());return n===null&&ge(230),la(t,n)}function r1(e){let t=tc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);let n=e.querySelector(":scope > colgroup");if(n){let o=[];for(let r of n.querySelectorAll(":scope > col")){let s=r.style.width||"";if(!ia.test(s)&&(s=r.getAttribute("width")||"",!/^\d+$/.test(s))){o=void 0;break}o.push(parseFloat(s))}o&&t.setColWidths(o)}return{after:(o)=>Sl(o,Le),node:t}}function tc(){return sn(new xr)}function rt(e){return e instanceof xr}function s1(e){Le(e.getParent())?e.isEmpty()&&e.append(ye()):e.remove()}function i1(e){rt(e.getParent())?xp(e,_e):e.remove()}function a1(e){xp(e,Le);let[t]=uo(e,null,null),n=t.reduce((i,l)=>Math.max(i,l.length),0),o=e.getChildren();for(let i=0;i<t.length;++i){let l=o[i];if(!l)continue;Le(l)||ge(254,l.constructor.name,l.getType());let c=t[i].reduce((u,d)=>d?1+u:u,0);if(c!==n)for(let u=c;u<n;++u){let d=gn();d.append(ye()),l.append(d)}}let r=e.getColWidths(),s=e.getColumnCount();if(r&&r.length!==s){let i;if(s<r.length)i=r.slice(0,s);else if(r.length>0){let l=r[r.length-1];i=[...r,...Array(s-r.length).fill(l)]}e.setColWidths(i)}}function l1(e){if(e.detail<3||!oo(e.target))return!1;let t=Tt(e.target);if(t===null)return!1;let n=pe(t,(o)=>j(o)&&!o.isInline());if(n===null)return!1;return!!_e(n.getParent())&&(n.select(0),!0)}function c1(){let e=K();if(!I(e))return!1;let t=Qs(e.anchor.getNode());if(t===null)return!1;let n=Xe();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[o]=uo(t,null,null);if(o.length===0||o[0].length===0)return!1;let r=o[0][0];if(!r||!r.cell)return!1;let s=o[o.length-1],i=s[s.length-1];if(!i||!i.cell)return!1;let l=Gd(t,r.cell,i.cell);return pt(l),!0}function mO(e){return e.registerNodeTransform(mr,(t)=>{if(t.getColSpan()>1||t.getRowSpan()>1){let[,,n]=Kt(t),[o]=on(n,t,t),r=o.length,s=o[0].length,i=n.getFirstChild();Le(i)||ge(175);let l=[];for(let c=0;c<r;c++){c!==0&&(i=i.getNextSibling(),Le(i)||ge(175));let u=null;for(let d=0;d<s;d++){let f=o[c][d],p=f.cell;if(f.startRow===c&&f.startColumn===d)u=p,l.push(p);else if(p.getColSpan()>1||p.getRowSpan()>1){_e(p)||ge(176);let h=gn(p.__headerState);u!==null?u.insertAfter(h):rN(i,h)}}}for(let c of l)c.setColSpan(1),c.setRowSpan(1)}})}function _O(e,t=!0){let n=new aO,o=(r,s,i)=>{let l=qo(r,i),c=cO(r,l,e,t,n);n.observers.set(s,[c,l])};return Oe(qI(e,n),e.registerCommand(no,()=>JI(n,e),$n),e.registerMutationListener(xr,(r)=>{e.read("latest",()=>{for(let[s,i]of r){let l=n.observers.get(s);if(i==="created"||i==="updated"){let{tableNode:c,tableElement:u}=km(s);l===void 0?o(c,s,u):u!==l[1]&&(n.removeObserver(s),o(c,s,u))}else i==="destroyed"&&n.removeObserver(s)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function xO(e,t){e.hasNodes([xr])||ge(255);let{hasNestedTables:n=Ks(!1)}=t??{};return Oe(e.registerCommand(Zv,(o)=>function({rows:r,columns:s,includeHeaders:i},l){let c=K()||Cn();if(!c||!I(c))return!1;if(!l&&Qs(c.anchor.getNode()))return!1;let u=Qv(Number(r),Number(s),i);Lu(u);let d=u.getFirstDescendant();return ne(d)&&d.select(),!0}(o,n.peek()),Ee),e.registerCommand(yu,(o,r)=>e===r&&function(s,i){let{nodes:l,selection:c}=s;if(!l.some((f)=>rt(f)||oN(f).some((p)=>rt(p.node)))){if(ze(c)){let f="",p=!1;for(let h of l){let m=j(h)&&!h.isInline();f.length>0&&(m||p)&&(f+=`
|
|
41
|
+
`),f+=h.getTextContent(),p=m}return c.insertRawText(f),!0}return!1}let u=ze(c),d=I(c);if(!(d&&pe(c.anchor.getNode(),(f)=>_e(f))!==null&&pe(c.focus.getNode(),(f)=>_e(f))!==null||u))return!1;if(l.length===1&&rt(l[0]))return iO(l[0],c);if(d&&i.peek()&&!function(f){if(ze(f)&&!f.focus.getNode().is(f.anchor.getNode()))return!0;if(I(f)&&_e(f.anchor.getNode())&&!f.anchor.getNode().is(f.focus.getNode()))return!0;return!1}(c))return!1;return!0}(o,n),Ee),e.registerCommand(Di,c1,we),e.registerCommand(yi,l1,Ee),e.registerNodeTransform(xr,a1),e.registerNodeTransform(ca,i1),e.registerNodeTransform(mr,s1))}var u1={$accepts:Le,$packageRun:(e)=>e.every(_e)?[_r().splice(0,0,e)]:[],name:"TableSchema"},d1={$accepts:_e,name:"TableRowSchema"},CO=[ut({$import:(e,t)=>{let n=tc();t.hasAttribute("data-lexical-row-striping")&&n.setRowStriping(!0),t.hasAttribute("data-lexical-frozen-column")&&n.setFrozenColumns(1),t.hasAttribute("data-lexical-frozen-row")&&n.setFrozenRows(1);let o=t.querySelector(":scope > colgroup");if(o){let r=[];for(let s of o.querySelectorAll(":scope > col")){let i=s.style.width||"";if(!ia.test(i)&&(i=s.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&n.setColWidths(r)}return[n.splice(0,0,Sl(e.$importChildren(t),Le))]},match:dt.tag("table"),name:"@lexical/table/table"}),ut({$import:(e,t)=>[_r(ia.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,Sl(e.$importChildren(t),_e))],match:dt.tag("tr"),name:"@lexical/table/tr"}),ut({$import:(e,t)=>{let n=t.nodeName==="TH",o=ia.test(t.style.width)?parseFloat(t.style.width):void 0,r=be.NO_STATUS;if(n){let x=t.getAttribute("scope");if(x==="col")r=be.COLUMN;else if(x==="row")r=be.ROW;else{let C=t.parentElement,y=SS(C)&&(C.parentElement&&C.parentElement.nodeName==="THEAD"||C.rowIndex===0),N=t.cellIndex===0;y&&(r|=be.ROW),N&&(r|=be.COLUMN),r===be.NO_STATUS&&(r=be.ROW)}}let s=gn(r,t.colSpan,o);s.__rowSpan=t.rowSpan;let i=t.style.backgroundColor;i!==""&&(s.__backgroundColor=i);let l=t.style.verticalAlign;(function(x){return x==="middle"||x==="bottom"})(l)&&(s.__verticalAlign=l);let c=e.get(nh),u=c|function(x){let C=0,y=x.fontWeight;y!=="700"&&y!=="bold"||(C|=fl),x.fontStyle==="italic"&&(C|=pl);let N=(x.textDecoration||"").split(" ");return N.includes("underline")&&(C|=ml),N.includes("line-through")&&(C|=hl),C}(t.style),d=e.get(oh),f=t.style.color,p=f?{...d,color:f}:d,h=[];u!==c&&h.push(Wi(nh,u)),p!==d&&h.push(Wi(oh,p));let m=function(x){let C=[],y=null,N=()=>{if(y!==null){let E=y.getFirstChild();Pe(E)&&y.getChildrenSize()===1&&E.remove()}};for(let E of x)zg(E)||ne(E)||Pe(E)?y!==null?y.append(E):(y=ye().append(E),C.push(y)):(N(),y=null,C.push(E));return N(),C.length===0&&C.push(ye()),C}(e.$importChildren(t,{context:h})),_=n?m:od(m,t);return[s.splice(0,0,_)]},match:dt.tag("td","th"),name:"@lexical/table/cell"})],yO=me({build:(e,t,n)=>Mt(t),config:Be({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[io,tn(Yo,{rules:CO})],name:"@lexical/table/Table",nodes:()=>[xr,ca,mr],register(e,t,n){let o=n.getOutput(),r=!1;return Oe(yt(()=>{let s=o.hasHorizontalScroll.value,i=o.hasStickyScrollbar.value&&s,l=Ql(e);l!==s&&pO(e,s),l===s&&r===i||e.update(_i),r=i}),xO(e,o),yt(()=>_O(e,o.hasTabHandler.value)),yt(()=>{if(o.hasStickyScrollbar.value&&o.hasHorizontalScroll.value)return e.registerRootListener((s)=>{if(s)return function(i){let l=new Map;return Oe(()=>{for(let{cleanup:c}of l.values())c();l.clear()},i.registerMutationListener(xr,(c)=>{for(let[u,d]of c){let f=l.get(u);if(d==="destroyed"){f&&(f.cleanup(),l.delete(u));continue}let p=i.getElementByKey(u),h=p&&Ce(p)?o1(p):null;f&&h&&f.parts.scrollable===h.scrollable&&f.parts.scrollbar===h.scrollbar&&f.parts.tableElement===h.tableElement?Om(h.scrollable,h.scrollbar):(f&&(f.cleanup(),l.delete(u)),h&&l.set(u,{cleanup:n1(h),parts:h}))}},{skipInitialization:!1}))}(e)})}),yt(()=>o.hasCellMerge.value?void 0:mO(e)),yt(()=>o.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(mr,(s)=>{s.getBackgroundColor()!==null&&s.setBackgroundColor(null)})))}}),f1=me({dependencies:[yO],name:"@lexical/table/Import"});var le=Lm,{$computeTableCellRectBoundary:DW,$computeTableMap:$W,$computeTableMapSkipCellCheck:wW,$createTableCellNode:kW,$createTableNode:IW,$createTableNodeWithDimensions:LW,$createTableRowNode:FW,$createTableSelection:PW,$createTableSelectionFrom:BW,$deleteTableColumn:KW,$deleteTableColumnAtSelection:zW,$deleteTableColumn__EXPERIMENTAL:UW,$deleteTableRowAtSelection:HW,$deleteTableRow__EXPERIMENTAL:WW,$findCellNode:GW,$findTableNode:jW,$getElementForTableNode:YW,$getNodeTriplet:VW,$getTableAndElementByKey:XW,$getTableCellNodeFromLexicalNode:qW,$getTableCellNodeRect:JW,$getTableColumnIndexFromTableCellNode:ZW,$getTableNodeFromLexicalNodeOrThrow:QW,$getTableRowIndexFromTableCellNode:e2,$getTableRowNodeFromTableCellNodeOrThrow:t2,$insertTableColumn:n2,$insertTableColumnAtNode:o2,$insertTableColumnAtSelection:r2,$insertTableColumn__EXPERIMENTAL:s2,$insertTableRow:i2,$insertTableRowAtNode:a2,$insertTableRowAtSelection:l2,$insertTableRow__EXPERIMENTAL:c2,$isScrollableTablesActive:u2,$isSimpleTable:d2,$isStickyScrollbarActive:f2,$isTableCellNode:g2,$isTableNode:p2,$isTableRowNode:h2,$isTableSelection:m2,$mergeCells:_2,$moveTableColumn:x2,$moveTableRow:C2,$removeTableRowAtIndex:y2,$setTableColumnIsHeader:S2,$setTableRowIsHeader:N2,$unmergeCell:E2,$unmergeCellNode:T2,INSERT_TABLE_COMMAND:b2,TableCellHeaderStates:v2,TableCellNode:SO,TableExtension:O2,TableImportExtension:A2,TableImportRules:R2,TableNode:NO,TableObserver:M2,TableRowNode:EO,TableRowSchema:D2,TableSchema:$2,applyTableHandlers:w2,getDOMCellFromTarget:k2,getTableElement:I2,getTableObserverFromTableElement:L2,registerTableCellUnmergeTransform:F2,registerTablePlugin:P2,registerTableSelectionObserver:B2,setScrollableTablesActive:K2}=le;L();var g1={paragraph:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bullet:"Bullet List",number:"Numbered List",check:"Check List",quote:"Quote",code:"Code Block"};function p1(e){let{anchor:t,focus:n}=e,o=e.anchor.getNode(),r=e.focus.getNode();if(o===r)return o;if(e.isBackward())return ip(n)?o:r;else return ip(t)?r:o}function TO({rightContent:e}={}){let[t]=st(),[n,o]=w(!1),[r,s]=w(!1),[i,l]=w("paragraph"),[c,u]=w(!1),[d,f]=w(!1),[p,h]=w(!1),[m,_]=w(!1),[x,C]=w(!1),[y,N]=w(!1),E=G(()=>{let B=K();if(I(B)){u(B.hasFormat("bold")),f(B.hasFormat("italic")),h(B.hasFormat("underline")),_(B.hasFormat("strikethrough")),C(B.hasFormat("code"));let de=p1(B),xe=de.getParent();N(Ji(xe)||Ji(de));let ve=B.anchor.getNode(),te=ve.getKey()==="root"?ve:ve.getTopLevelElementOrThrow(),ae=te.getKey();if(t.getElementByKey(ae)!==null)if(To(te)){let Re=Iu(ve,Vo),Me=Re?Re.getListType():te.getListType();l(Me)}else if(kl(te))l(te.getTag());else{let Re=te.getType();if(Re in g1)l(Re);else l("paragraph")}}},[t]);S(()=>t.registerCommand(no,()=>(E(),!1),Si),[t,E]),S(()=>t.registerUpdateListener(({editorState:B})=>{B.read(()=>{E()})}),[t,E]),S(()=>{let B=t.registerCommand(Ms,(xe)=>(o(xe),!1),we),de=t.registerCommand(Rs,(xe)=>(s(xe),!1),we);return()=>{B(),de()}},[t]);let v=()=>{t.update(()=>{let B=K();if(I(B))Fi(B,()=>ye())})},b=(B)=>{t.update(()=>{let de=K();if(I(de))Fi(de,()=>gd(B))})},A=()=>{if(i!=="bullet")t.dispatchCommand(E0,void 0);else t.dispatchCommand(Ed,void 0)},O=()=>{if(i!=="number")t.dispatchCommand(N0,void 0);else t.dispatchCommand(Ed,void 0)},D=()=>{if(i!=="check")t.dispatchCommand(S0,void 0);else t.dispatchCommand(Ed,void 0)},H=()=>{if(i!=="quote")t.update(()=>{let B=K();if(I(B))Fi(B,()=>pd())});else v()},k=()=>{if(i!=="code")t.update(()=>{let B=K();if(I(B))Fi(B,()=>Wv())});else v()},J=G(()=>{if(!y){let B=prompt("Enter link URL (e.g., https://example.com):");if(B)t.dispatchCommand(kh,B)}else t.dispatchCommand(kh,null)},[t,y]),V=G(()=>{t.update(()=>{let B=K();if(I(B))B.setFormat(0),Fi(B,()=>ye())})},[t]);return g("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[g("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[a("button",{type:"button",disabled:!n,onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Eu,void 0),title:"Undo","aria-label":"Undo",children:a(Vm,{className:"h-4 w-4"})}),a("button",{type:"button",disabled:!r,onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(xu,void 0),title:"Redo","aria-label":"Redo",children:a(Wm,{className:"h-4 w-4"})}),a("div",{className:"toolbar-divider"}),g("select",{value:i,onChange:(B)=>{let de=B.target.value;switch(de){case"paragraph":v();break;case"h1":case"h2":case"h3":b(de);break;case"bullet":A();break;case"number":O();break;case"check":D();break;case"quote":H();break;case"code":k();break}},"aria-label":"Block formatting",children:[a("option",{value:"paragraph",children:"Normal"}),a("option",{value:"h1",children:"Heading 1"}),a("option",{value:"h2",children:"Heading 2"}),a("option",{value:"h3",children:"Heading 3"}),a("option",{value:"bullet",children:"Bullet List"}),a("option",{value:"number",children:"Numbered List"}),a("option",{value:"check",children:"Check List"}),a("option",{value:"quote",children:"Quote"}),a("option",{value:"code",children:"Code Block"})]}),a("div",{className:"toolbar-divider"}),a("button",{type:"button",className:c?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:a(Fm,{className:"h-4 w-4"})}),a("button",{type:"button",className:d?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:a(zm,{className:"h-4 w-4"})}),a("button",{type:"button",className:p?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:a(Ym,{className:"h-4 w-4"})}),a("button",{type:"button",className:m?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:a(jm,{className:"h-4 w-4"})}),a("button",{type:"button",className:x?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>t.dispatchCommand(Uo,"code"),title:"Inline Code","aria-label":"Inline Code",children:a(du,{className:"h-4 w-4"})}),a("button",{type:"button",className:y?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:J,title:"Insert Link","aria-label":"Link",children:a(nc,{className:"h-4 w-4"})}),a("div",{className:"toolbar-divider"}),a("button",{type:"button",className:i==="h1"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>b("h1"),title:"H1","aria-label":"Heading 1",children:a(Pm,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="h2"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>b("h2"),title:"H2","aria-label":"Heading 2",children:a(Bm,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="h3"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:()=>b("h3"),title:"H3","aria-label":"Heading 3",children:a(Km,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="bullet"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:A,title:"Bullet List","aria-label":"Bullet List",children:a(ps,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="number"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:O,title:"Numbered List","aria-label":"Numbered List",children:a(Um,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="check"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:D,title:"Check List","aria-label":"Check List",children:a(Jl,{className:"h-4 w-4"})}),a("button",{type:"button",className:i==="quote"?"active":"",onMouseDown:(B)=>B.preventDefault(),onClick:H,title:"Quote","aria-label":"Quote",children:a(Hm,{className:"h-4 w-4"})}),a("div",{className:"toolbar-divider"}),a("button",{type:"button",onMouseDown:(B)=>B.preventDefault(),onClick:V,title:"Clear Formatting","aria-label":"Clear Formatting",children:a(Gm,{className:"h-4 w-4"})})]}),e&&a("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})]})}var bO={paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3"},list:{checklist:"editor-checklist",listitem:"editor-listitem",listitemChecked:"editor-listitem-checked",listitemUnchecked:"editor-listitem-unchecked",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},link:"editor-link",text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",underlineStrikethrough:"editor-text-underlineStrikethrough",code:"editor-text-code"},code:"editor-code-block"};var oc=[Nv,...Ev,...Tv,...bv,...vv];function h1({value:e,initialContent:t="",onChange:n}){let[o]=st(),r=M(!1),s=M("");return S(()=>{if(!r.current){r.current=!0;let i=e!==void 0?e:t;if(i)o.update(()=>{Qh(i,oc)}),s.current=i}},[o,t,e]),S(()=>{if(r.current&&e!==void 0&&e!==s.current)o.update(()=>{Qh(e,oc)}),s.current=e},[o,e]),a($v,{ignoreSelectionChange:!0,onChange:(i)=>{i.read(()=>{let l=Sv(oc);if(l!==s.current)s.current=l,n?.(l)})}})}function vO({initialContent:e="",value:t,onChange:n,placeholder:o="Write your markdown content here...",readOnly:r=!1,autoFocus:s=!1,className:i="",hideToolbar:l=!1,rightToolbarContent:c}){let u={namespace:"ShumaiWysiwygMarkdownEditor",theme:bO,editable:!r,onError:(d)=>{console.error("[MarkdownEditor] Error:",d)},nodes:[md,_d,Vo,ts,Gv,NO,SO,EO,V0,Zi]};return a("div",{className:`shumai-editor-wrapper ${r?"read-only":""} ${i}`,children:g(vS,{initialConfig:u,children:[!r&&!l?a(TO,{rightContent:c}):c?a("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:c}):null,g(Ie,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[a("div",{className:"relative min-h-full",children:a(IT,{contentEditable:a(KT,{className:"editor-input"}),placeholder:a("div",{className:"editor-placeholder",children:o}),ErrorBoundary:kv})}),a(jT,{}),a(v0,{}),a(O0,{}),a(R0,{}),a(q0,{}),a(Dv,{transformers:oc}),a(h1,{value:t,initialContent:e,onChange:n}),s&&a(J0,{})]})]})})}function OO({projectId:e,assetId:t,rootFolderId:n,isRoot:o}){let r=We(),s=ie(),{canAdmin:i}=Xt(e),{data:l,isLoading:c}=X({queryKey:["folders",t,"agentsmd"],queryFn:async()=>{let V=await R.api.folders[":folderId"].agentsmd.$get({param:{folderId:t}});if(!V.ok)throw Error("Failed to fetch agents.md");return await V.json()}}),[u,d]=w(""),[f,p]=w(!1),[h,m]=w("idle"),_=M(null),x=M(null),C=M(""),y=M(null),N=M(Promise.resolve());S(()=>{if(!f&&l!==void 0){let V=l.content??"";d(V),C.current=V,y.current=V,p(!0)}},[l,f]);let[E,v]=w(!1),b=ee({mutationFn:async(V)=>{let oe=await R.api.folders[":folderId"].agentsmd.$patch({param:{folderId:t},json:{content:V}});if(!oe.ok)throw Error("Failed to save agents.md");return await oe.json()},onSuccess:(V,oe)=>{if(m("saved"),y.current=oe,s.setQueryData(["folders",t,"agentsmd"],{content:oe}),s.invalidateQueries({queryKey:["folders",t]}),x.current)clearTimeout(x.current);x.current=setTimeout(()=>{m("idle")},2500)},onError:()=>{m("error")}}),A=M(b.mutateAsync);A.current=b.mutateAsync;let O=G((V)=>{if(!i)return Promise.resolve();if(y.current===V)return m("saved"),Promise.resolve();m("saving");let oe=N.current.then(async()=>{await A.current(V)}).catch(()=>{});return N.current=oe,oe},[i]),D=G((V)=>{if(!i)return;if(d(V),C.current=V,_.current)clearTimeout(_.current);m("saving"),_.current=setTimeout(()=>{_.current=null,O(V)},1000)},[i,O]),H=G(()=>{if(_.current)return clearTimeout(_.current),_.current=null,O(C.current);return N.current},[O]);S(()=>()=>{if(H(),x.current)clearTimeout(x.current)},[H]);let k=async()=>{v(!0);try{H(),await N.current}catch{}finally{if(o||t===n)r({to:"/projects/$projectId",params:{projectId:e}});else r({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:t}})}},J=g("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[i?g("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(h==="saving"||E)&&g("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[a(ll,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:Xh()})]}),h==="saved"&&!E&&g("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[a(qe,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:Y0()})]}),h==="error"&&!E&&g("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[a(er,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:wb()})]})]}):g("div",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/60 px-2.5 py-1 rounded-md shrink-0",title:QA(),children:[a(Dn,{className:"h-3.5 w-3.5 shrink-0"}),a("span",{children:QA()})]}),g("div",{className:"flex items-center gap-2 shrink-0",children:[i&&a(Bo,{orientation:"vertical",className:"h-4 shrink-0"}),g(F,{variant:"ghost",size:"sm",onClick:k,disabled:E,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Fl(),children:[a(Ge,{className:"h-4 w-4 mr-1 shrink-0"}),a("span",{children:Fl()})]})]})]});if(c||!f)return g("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[a(ll,{className:"h-4 w-4 animate-pulse mr-2"}),a("span",{children:vb()})]});return a("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:a(vO,{value:u,onChange:D,placeholder:bb(),readOnly:!i,rightToolbarContent:J,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function Wl({teamId:e,projectId:t,projectName:n,assetId:o,rootFolderId:r,isRoot:s}){let i=We(),[l,c]=w(240),[u,d]=w(360),{fileListLeftSidebarCollapsed:f,setFileListLeftSidebarCollapsed:p}=lr(),{isChatbotOpen:h,setIsChatbotOpen:m}=Ir(),_=Lr((N)=>Boolean(N.metadata["appearance.hideAgent"])),{data:x}=X({queryKey:["folders",o],queryFn:async()=>{let N=await R.api.folders[":folderId"].$get({param:{folderId:o}});if(!N.ok)throw Error("failed to fetch folder");return await N.json()},enabled:!!o}),{setProjectState:C,clearProjectState:y}=Bn();return S(()=>{let E=s||o===r?[]:x?.name?[{id:o,name:x.name},...x?.ancestorFolders??[]]:x?.ancestorFolders??[];return C({teamId:e,projectId:t,projectName:n,ancestorFolders:E,currentAsset:{name:x?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(v)=>{i({to:"/projects/$projectId/folders/$folderId",params:{projectId:t,folderId:v}})}}),()=>y()},[e,t,n,x?.ancestorFolders,x?.name,s,o,r,C,y,i]),a("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:g("div",{className:"flex-1 flex overflow-hidden relative",children:[!f&&a("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>p(!0)}),h&&a("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>m(!1)}),!f&&g(W,{children:[a("div",{className:"bg-background flex-shrink-0",style:{width:l},children:a($r,{teamId:e,projectId:t,projectName:n,rootFolderId:r,selectedFolderId:o,ancestorFolders:x?.ancestorFolders??[]})}),a(Yr,{onResize:(N)=>{c((E)=>Math.max(180,Math.min(400,E+N)))},className:"hidden md:block"})]}),a("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:a(OO,{projectId:t,assetId:o,rootFolderId:r,isRoot:s})}),h&&!_&&g(W,{children:[a(Yr,{onResize:(N)=>{d((E)=>Math.max(240,Math.min(600,E-N)))},className:"hidden md:block"}),a("div",{style:{width:u},className:"bg-background flex flex-col flex-shrink-0",children:a(ba,{projectId:t,contextAssetId:o})})]})]})})}
|
|
42
|
+
export{Wl};
|