@shumai-one/shumai 0.5.3 → 0.6.0
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-wbmqbpgm.js → chunk-01ym2agz.js} +1 -1
- package/bin/{chunk-ncv8v6mj.js → chunk-047n9gfs.js} +2 -2
- package/bin/chunk-0a4ahz7r.js +2 -0
- package/bin/{chunk-v5hz09a1.js → chunk-0awcpx0a.js} +2 -2
- package/bin/{chunk-bcyvxp1c.js → chunk-0fbgfgxv.js} +4 -4
- package/bin/{chunk-jt6v15wx.js → chunk-0nnqha4f.js} +1 -1
- package/bin/chunk-0tvggyy4.js +1 -0
- package/bin/{chunk-s9sf37dv.js → chunk-113baw0m.js} +1 -1
- package/bin/{chunk-axeq2pq5.js → chunk-1dbjyarc.js} +1 -1
- package/bin/{chunk-d1q1tn36.js → chunk-1qre79kf.js} +1 -1
- package/bin/chunk-27v3yepb.js +1 -0
- package/bin/{chunk-gvcjqcjf.js → chunk-2rq3w8sg.js} +1 -1
- package/bin/{chunk-wperd2h9.js → chunk-3020am4q.js} +1 -1
- package/bin/chunk-3pwwg1xm.js +1 -0
- package/bin/{chunk-scvepfv8.js → chunk-3sfb63fp.js} +1 -1
- package/bin/{chunk-y6xyc4wp.js → chunk-3tg10kwz.js} +1 -1
- package/bin/{chunk-hsx4pns6.js → chunk-4g4pxmef.js} +1 -1
- package/bin/{chunk-9fyb95r5.js → chunk-4jj92zwa.js} +1 -1
- package/bin/{chunk-6pwf7qa6.js → chunk-4yhvexzk.js} +1 -1
- package/bin/chunk-58cbk6e8.js +1 -0
- package/bin/{chunk-59ayg5am.js → chunk-59t9s2jh.js} +1 -1
- package/bin/{chunk-5y3kx4kk.js → chunk-5e7r7a9d.js} +1 -1
- package/bin/{chunk-4nkwe7dz.js → chunk-5m51b7af.js} +1 -1
- package/bin/{chunk-fnkkwna8.js → chunk-65t6rm5d.js} +1 -1
- package/bin/chunk-6bed0rz4.js +1 -0
- package/bin/{chunk-w4adkd0a.js → chunk-6smn0q1n.js} +4 -4
- package/bin/{chunk-b3tkvdfk.js → chunk-6zerk0em.js} +1 -1
- package/bin/{chunk-t6myw0jf.js → chunk-7bbsv8g0.js} +1 -1
- package/bin/chunk-83bdgs2c.js +1 -0
- package/bin/{chunk-zpk87b33.js → chunk-86qtjd30.js} +5 -5
- package/bin/{chunk-b5r0be06.js → chunk-8rekh4h9.js} +1 -1
- package/bin/{chunk-68xsb3t8.js → chunk-8s9fehda.js} +1 -1
- package/bin/{chunk-srv5kvm4.js → chunk-8sf2hf31.js} +1 -1
- package/bin/{chunk-2rrcdhkj.js → chunk-9d3w678j.js} +1 -1
- package/bin/{chunk-ppb4aj0y.js → chunk-9gftd4f7.js} +2 -2
- package/bin/{chunk-6hs63sva.js → chunk-9rcg8zgs.js} +32 -32
- package/bin/{chunk-xfmnfcv2.js → chunk-a23q1kc4.js} +2 -2
- package/bin/{chunk-eshwjf91.js → chunk-a6cdt85k.js} +1 -1
- package/bin/chunk-a76h3ehe.js +1 -0
- package/bin/{chunk-3wcvema0.js → chunk-b1bkd2p4.js} +7 -7
- package/bin/{chunk-np39aknv.js → chunk-bf5m8f6t.js} +1 -1
- package/bin/{chunk-24nx3krz.js → chunk-cf57fk11.js} +1 -1
- package/bin/{chunk-929abwgr.js → chunk-cv5xx81e.js} +1 -1
- package/bin/{chunk-fpjvr3qw.js → chunk-czybv3vy.js} +1 -1
- package/bin/{chunk-fsr83nb1.js → chunk-d4sbcvpa.js} +1 -1
- package/bin/{chunk-b6dbqs39.js → chunk-d6xezgrg.js} +1 -1
- package/bin/{chunk-hy5ncvpf.js → chunk-da86fpjt.js} +1 -1
- package/bin/{chunk-me3zmpj5.js → chunk-dzjmwat0.js} +7 -7
- package/bin/{chunk-909h3qzp.js → chunk-eex8sjfs.js} +1 -1
- package/bin/{chunk-qqapw198.js → chunk-emgyjhmx.js} +1 -1
- package/bin/{chunk-y5h5d5gx.js → chunk-exmwerag.js} +4 -4
- package/bin/{chunk-fznchvm7.js → chunk-f38xyahm.js} +1 -1
- package/bin/{chunk-cqnected.js → chunk-fb1bes2h.js} +1 -1
- package/bin/chunk-fbvak7q2.js +1 -0
- package/bin/{chunk-tqdde9bj.js → chunk-fg9sr6r9.js} +1 -1
- package/bin/{chunk-m41tbrvt.js → chunk-fyb6t7ct.js} +2 -2
- package/bin/{chunk-cfqny70c.js → chunk-g2ptqqm3.js} +2 -2
- package/bin/{chunk-k3ds96cb.js → chunk-ggwqxn95.js} +1 -1
- package/bin/chunk-ghk54h71.js +13 -0
- package/bin/{chunk-40tmh04g.js → chunk-h1fbev9c.js} +1 -1
- package/bin/{chunk-6sq6dfa1.js → chunk-h9akn41s.js} +1 -1
- package/bin/{chunk-zq5j9wsc.js → chunk-hdansxny.js} +1 -1
- package/bin/{chunk-zsg61vr0.js → chunk-hjwpd09v.js} +1 -1
- package/bin/{chunk-03zkxckm.js → chunk-hjzbw975.js} +1 -1
- package/bin/{chunk-mzme3m82.js → chunk-j4p3eqtd.js} +1 -1
- package/bin/chunk-jtkxeat4.js +2 -0
- package/bin/{chunk-5ebb2pdf.js → chunk-jw4g9628.js} +3 -3
- package/bin/{chunk-hbnpx0a5.js → chunk-jxebakyq.js} +1 -1
- package/bin/{chunk-d1rjpbgv.js → chunk-kfewyax2.js} +1 -1
- package/bin/chunk-kk3m4za5.js +1 -0
- package/bin/{chunk-24da4wg9.js → chunk-m7tnj47b.js} +1 -1
- package/bin/{chunk-b88tdt79.js → chunk-maw5ah8t.js} +2 -2
- package/bin/{chunk-hn2g40r6.js → chunk-n0wwtjwv.js} +1 -1
- package/bin/{chunk-qcpeefhr.js → chunk-nahdd2t9.js} +1 -1
- package/bin/{chunk-fa9yq17g.js → chunk-nv7tztvh.js} +28 -28
- package/bin/{chunk-srmx5z3v.js → chunk-nyjwdxyj.js} +2 -2
- package/bin/{chunk-t1h12r3q.js → chunk-p0yfxt5e.js} +5 -5
- package/bin/{chunk-4bc3gqmn.js → chunk-q27qn367.js} +2 -2
- package/bin/{chunk-9ca8a5f2.js → chunk-q36sdt2w.js} +1 -1
- package/bin/{chunk-zzbn0b6c.js → chunk-qbj5pe8t.js} +1 -1
- package/bin/chunk-qj0bxb1m.js +2 -0
- package/bin/{chunk-xdrpahym.js → chunk-qk5hsn6e.js} +1 -1
- package/bin/{chunk-qjdvs1s5.js → chunk-qnyqtaf0.js} +1 -1
- package/bin/{chunk-3ahax79y.js → chunk-qqkr6h07.js} +2 -2
- package/bin/chunk-qyqc5j3a.css +1 -0
- package/bin/chunk-qzaf6bre.js +2 -0
- package/bin/{chunk-nmd1901j.js → chunk-r1e59gf0.js} +1 -1
- package/bin/chunk-ra5csbkr.js +2 -0
- package/bin/{chunk-2w2bknn2.js → chunk-rx9g95wk.js} +3 -3
- package/bin/{chunk-04nqnkzs.js → chunk-rxyy37wa.js} +3 -3
- package/bin/{chunk-bn0taqr3.js → chunk-scez7ppq.js} +2 -2
- package/bin/{chunk-26am2rzm.js → chunk-t2a1vq34.js} +1 -1
- package/bin/chunk-t879v3b7.js +1 -0
- package/bin/{chunk-a8bymrv1.js → chunk-tjavzarz.js} +2 -2
- package/bin/{chunk-n08h1jgx.js → chunk-treyx8em.js} +1 -1
- package/bin/{chunk-p7zw53ep.js → chunk-v3z4z04s.js} +1 -1
- package/bin/{chunk-461gcgrs.js → chunk-v3z63tpw.js} +1 -1
- package/bin/{chunk-s0vfj06y.js → chunk-v9bes1fv.js} +1 -1
- package/bin/{chunk-vsnq4381.js → chunk-vjyget8s.js} +1 -1
- package/bin/{chunk-s6g2mzpn.js → chunk-vmm9m3nv.js} +1 -1
- package/bin/{chunk-qx553512.js → chunk-vvr8tnse.js} +36 -36
- package/bin/{chunk-hgy9rqt1.js → chunk-w3stry4v.js} +1 -1
- package/bin/{chunk-8ts3xkme.js → chunk-w89czwjj.js} +1 -1
- package/bin/{chunk-157axqz1.js → chunk-wk0hk00z.js} +1 -1
- package/bin/{chunk-pwq6dbb5.js → chunk-ww9qq8yq.js} +1 -1
- package/bin/{chunk-q1gfypy3.js → chunk-x4q082e6.js} +1 -1
- package/bin/{chunk-cvfznrnt.js → chunk-x6rf77jm.js} +1 -1
- package/bin/chunk-x7dyj53k.js +2 -0
- package/bin/{chunk-j420aqk8.js → chunk-xcrd0y8v.js} +3 -3
- package/bin/{chunk-q4qqmes7.js → chunk-z0z0jn5h.js} +2 -2
- package/bin/{chunk-1tesbv8w.js → chunk-zasjhrwc.js} +1 -1
- package/bin/chunk-zefds5gg.js +1 -0
- package/bin/{chunk-2pt9h882.js → chunk-zzzgk1d5.js} +2 -2
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +364 -364
- package/package.json +8 -11
- package/bin/chunk-45p7d22e.js +0 -2
- package/bin/chunk-87secbzy.js +0 -1
- package/bin/chunk-8pykp70z.js +0 -1
- package/bin/chunk-cb37q6t0.js +0 -1
- package/bin/chunk-g2z0c39g.js +0 -1
- package/bin/chunk-gnt9gewm.js +0 -2
- package/bin/chunk-hk659cg2.css +0 -1
- package/bin/chunk-k97axrc4.js +0 -13
- package/bin/chunk-m9f21ye9.js +0 -1
- package/bin/chunk-md7pgk86.js +0 -2
- package/bin/chunk-mg6sybt0.js +0 -1
- package/bin/chunk-r3s1x5wp.js +0 -1
- package/bin/chunk-sjbvt3wa.js +0 -2
- package/bin/chunk-t8jfp3vx.js +0 -1
- package/bin/chunk-vk9ecq8n.js +0 -2
- package/bin/chunk-xhngtwn9.js +0 -1
- package/bin/chunk-xjnehexk.js +0 -2
- package/bin/chunk-xzb0t8mx.js +0 -1
- package/bin/chunk-zts21ft7.js +0 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import{Ls,pi,lt,F,P,pt,m,$e,D,_,u,S,L,t,o,V,Z,B,Re,Ji,rn,A,I,Pe,Lo,on,Ne,E,H0,$0,Wm,G0,Da,Jg,Np,ce,Ot,vr,un,ao,$t,ur,_r}from"./chunk-qx553512.js";import{Ti}from"./chunk-s9sf37dv.js";import{Ir}from"./chunk-6pwf7qa6.js";import{ua}from"./chunk-mzme3m82.js";import{Ga}from"./chunk-b3tkvdfk.js";import{Ja}from"./chunk-y6xyc4wp.js";import{nc}from"./chunk-q1gfypy3.js";import{nr}from"./chunk-qqapw198.js";import{H,w,ke}from"./chunk-a8bymrv1.js";var rm=w(function(pH,Pd){var iI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},me=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,s={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function y(N){if(N instanceof a)return new a(N.type,y(N.content),N.alias);else if(Array.isArray(N))return N.map(y);else return N.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){if(!y.__id)Object.defineProperty(y,"__id",{value:++r});return y.__id},clone:function y(N,T){T=T||{};var b,v;switch(i.util.type(N)){case"Object":if(v=i.util.objId(N),T[v])return T[v];b={},T[v]=b;for(var O in N)if(N.hasOwnProperty(O))b[O]=y(N[O],T);return b;case"Array":if(v=i.util.objId(N),T[v])return T[v];return b=[],T[v]=b,N.forEach(function(k,M){b[M]=y(k,T)}),b;default:return N}},getLanguage:function(y){while(y){var N=n.exec(y.className);if(N)return N[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,N){y.className=y.className.replace(RegExp(n,"gi"),""),y.classList.add("language-"+N)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(b){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(y){var N=document.getElementsByTagName("script");for(var T in N)if(N[T].src==y)return N[T]}return null}},isActive:function(y,N,T){var b="no-"+N;while(y){var v=y.classList;if(v.contains(N))return!0;if(v.contains(b))return!1;y=y.parentElement}return!!T}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,N){var T=i.util.clone(i.languages[y]);for(var b in N)T[b]=N[b];return T},insertBefore:function(y,N,T,b){b=b||i.languages;var v=b[y],O={};for(var k in v)if(v.hasOwnProperty(k)){if(k==N){for(var M in T)if(T.hasOwnProperty(M))O[M]=T[M]}if(!T.hasOwnProperty(k))O[k]=v[k]}var z=b[y];return b[y]=O,i.languages.DFS(i.languages,function(K,U){if(U===z&&K!=y)this[K]=O}),O},DFS:function y(N,T,b,v){v=v||{};var O=i.util.objId;for(var k in N)if(N.hasOwnProperty(k)){T.call(N,k,N[k],b||k);var M=N[k],z=i.util.type(M);if(z==="Object"&&!v[O(M)])v[O(M)]=!0,y(M,T,null,v);else if(z==="Array"&&!v[O(M)])v[O(M)]=!0,y(M,T,k,v)}}},plugins:{},highlightAll:function(y,N){i.highlightAllUnder(document,y,N)},highlightAllUnder:function(y,N,T){var b={callback:T,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),i.hooks.run("before-all-elements-highlight",b);for(var v=0,O;O=b.elements[v++];)i.highlightElement(O,N===!0,b.callback)},highlightElement:function(y,N,T){var b=i.util.getLanguage(y),v=i.languages[b];i.util.setLanguage(y,b);var O=y.parentElement;if(O&&O.nodeName.toLowerCase()==="pre")i.util.setLanguage(O,b);var k=y.textContent,M={element:y,language:b,grammar:v,code:k};function z(U){M.highlightedCode=U,i.hooks.run("before-insert",M),M.element.innerHTML=M.highlightedCode,i.hooks.run("after-highlight",M),i.hooks.run("complete",M),T&&T.call(M.element)}if(i.hooks.run("before-sanity-check",M),O=M.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex"))O.setAttribute("tabindex","0");if(!M.code){i.hooks.run("complete",M),T&&T.call(M.element);return}if(i.hooks.run("before-highlight",M),!M.grammar){z(i.util.encode(M.code));return}if(N&&e.Worker){var K=new Worker(i.filename);K.onmessage=function(U){z(U.data)},K.postMessage(JSON.stringify({language:M.language,code:M.code,immediateClose:!0}))}else z(i.highlight(M.code,M.grammar,M.language))},highlight:function(y,N,T){var b={code:y,grammar:N,language:T};if(i.hooks.run("before-tokenize",b),!b.grammar)throw Error('The language "'+b.language+'" has no grammar.');return b.tokens=i.tokenize(b.code,b.grammar),i.hooks.run("after-tokenize",b),a.stringify(i.util.encode(b.tokens),b.language)},tokenize:function(y,N){var T=N.rest;if(T){for(var b in T)N[b]=T[b];delete N.rest}var v=new d;return f(v,v.head,y),c(y,v,N,v.head,0),p(v)},hooks:{all:{},add:function(y,N){var T=i.hooks.all;T[y]=T[y]||[],T[y].push(N)},run:function(y,N){var T=i.hooks.all[y];if(!T||!T.length)return;for(var b=0,v;v=T[b++];)v(N)}},Token:a};e.Prism=i;function a(y,N,T,b){this.type=y,this.content=N,this.alias=T,this.length=(b||"").length|0}a.stringify=function y(N,T){if(typeof N=="string")return N;if(Array.isArray(N)){var b="";return N.forEach(function(z){b+=y(z,T)}),b}var v={type:N.type,content:y(N.content,T),tag:"span",classes:["token",N.type],attributes:{},language:T},O=N.alias;if(O)if(Array.isArray(O))Array.prototype.push.apply(v.classes,O);else v.classes.push(O);i.hooks.run("wrap",v);var k="";for(var M in v.attributes)k+=" "+M+'="'+(v.attributes[M]||"").replace(/"/g,""")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+k+">"+v.content+"</"+v.tag+">"};function l(y,N,T,b){y.lastIndex=N;var v=y.exec(T);if(v&&b&&v[1]){var O=v[1].length;v.index+=O,v[0]=v[0].slice(O)}return v}function c(y,N,T,b,v,O){for(var k in T){if(!T.hasOwnProperty(k)||!T[k])continue;var M=T[k];M=Array.isArray(M)?M:[M];for(var z=0;z<M.length;++z){if(O&&O.cause==k+","+z)return;var K=M[z],U=K.inside,J=!!K.lookbehind,W=!!K.greedy,ne=K.alias;if(W&&!K.pattern.global){var ee=K.pattern.toString().match(/[imsuy]*$/)[0];K.pattern=RegExp(K.pattern.source,ee+"g")}var se=K.pattern||K;for(var Y=b.next,fe=v;Y!==N.tail;fe+=Y.value.length,Y=Y.next){if(O&&fe>=O.reach)break;var Ce=Y.value;if(N.length>y.length)return;if(Ce instanceof a)continue;var Ae=1,oe;if(W){if(oe=l(se,fe,y,J),!oe||oe.index>=y.length)break;var Ie=oe.index,ae=oe.index+oe[0].length,ue=fe;ue+=Y.value.length;while(Ie>=ue)Y=Y.next,ue+=Y.value.length;if(ue-=Y.value.length,fe=ue,Y.value instanceof a)continue;for(var we=Y;we!==N.tail&&(ue<ae||typeof we.value==="string");we=we.next)Ae++,ue+=we.value.length;Ae--,Ce=y.slice(fe,ue),oe.index-=fe}else if(oe=l(se,0,Ce,J),!oe)continue;var Ie=oe.index,ht=oe[0],Qt=Ce.slice(0,Ie),Ke=Ce.slice(Ie+ht.length),_t=fe+Ce.length;if(O&&_t>O.reach)O.reach=_t;var Vt=Y.prev;if(Qt)Vt=f(N,Vt,Qt),fe+=Qt.length;g(N,Vt,Ae);var Nr=new a(k,U?i.tokenize(ht,U):ht,ne,ht);if(Y=f(N,Vt,Nr),Ke)f(N,Y,Ke);if(Ae>1){var Qo={cause:k+","+z,reach:_t};if(c(y,N,T,Y.prev,fe,Qo),O&&Qo.reach>O.reach)O.reach=Qo.reach}}}}}function d(){var y={value:null,prev:null,next:null},N={value:null,prev:y,next:null};y.next=N,this.head=y,this.tail=N,this.length=0}function f(y,N,T){var b=N.next,v={value:T,prev:N,next:b};return N.next=v,b.prev=v,y.length++,v}function g(y,N,T){var b=N.next;for(var v=0;v<T&&b!==y.tail;v++)b=b.next;N.next=b,b.prev=N,y.length-=v}function p(y){var N=[],T=y.head.next;while(T!==y.tail)N.push(T.value),T=T.next;return N}if(!e.document){if(!e.addEventListener)return i;if(!i.disableWorkerMessageHandler)e.addEventListener("message",function(y){var N=JSON.parse(y.data),{language:T,code:b,immediateClose:v}=N;if(e.postMessage(i.highlight(b,i.languages[T],T)),v)e.close()},!1);return i}var h=i.util.currentScript();if(h){if(i.filename=h.src,h.hasAttribute("data-manual"))i.manual=!0}function x(){if(!i.manual)i.highlightAll()}if(!i.manual){var C=document.readyState;if(C==="loading"||C==="interactive"&&h&&h.defer)document.addEventListener("DOMContentLoaded",x);else if(window.requestAnimationFrame)window.requestAnimationFrame(x);else window.setTimeout(x,16)}return i}(iI);if(typeof Pd<"u"&&Pd.exports)Pd.exports=me;if(typeof global<"u")global.Prism=me;me.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]};me.languages.markup.tag.inside["attr-value"].inside.entity=me.languages.markup.entity;me.languages.markup.doctype.inside["internal-subset"].inside=me.languages.markup;me.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&/,"&")});Object.defineProperty(me.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:me.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:me.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},me.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(me.languages.markup.tag,"addAttribute",{value:function(e,n){me.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:[n,"language-"+n],inside:me.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});me.languages.html=me.languages.markup;me.languages.mathml=me.languages.markup;me.languages.svg=me.languages.markup;me.languages.xml=me.languages.extend("markup",{});me.languages.ssml=me.languages.xml;me.languages.atom=me.languages.xml;me.languages.rss=me.languages.xml;(function(e){var n=/(?:"(?:\\(?:\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+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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 r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.tag.addAttribute("style","css")})(me);me.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:/[{}[\];(),.:]/};me.languages.javascript=me.languages.extend("clike",{"class-name":[me.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}|\?\?=?|\?\.?|[~:]/});me.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;me.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:me.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:me.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:me.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:me.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:me.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});me.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:me.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"}});me.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(me.languages.markup)me.languages.markup.tag.addInlined("script","javascript"),me.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");me.languages.js=me.languages.javascript;(function(){if(typeof me>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var e="Loading…",n=function(h,x){return"✖ Error "+h+" while fetching file: "+x},r="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},i="data-src-status",a="loading",l="loaded",c="failed",d="pre[data-src]:not(["+i+'="'+l+'"]):not(['+i+'="'+a+'"])';function f(h,x,C){var y=new XMLHttpRequest;y.open("GET",h,!0),y.onreadystatechange=function(){if(y.readyState==4)if(y.status<400&&y.responseText)x(y.responseText);else if(y.status>=400)C(n(y.status,y.statusText));else C(r)},y.send(null)}function g(h){var x=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(x){var C=Number(x[1]),y=x[2],N=x[3];if(!y)return[C,C];if(!N)return[C,void 0];return[C,Number(N)]}return}me.hooks.add("before-highlightall",function(h){h.selector+=", "+d}),me.hooks.add("before-sanity-check",function(h){var x=h.element;if(x.matches(d)){h.code="",x.setAttribute(i,a);var C=x.appendChild(document.createElement("CODE"));C.textContent=e;var y=x.getAttribute("data-src"),N=h.language;if(N==="none"){var T=(/\.(\w+)$/.exec(y)||[,"none"])[1];N=s[T]||T}me.util.setLanguage(C,N),me.util.setLanguage(x,N);var b=me.plugins.autoloader;if(b)b.loadLanguages(N);f(y,function(v){x.setAttribute(i,l);var O=g(x.getAttribute("data-range"));if(O){var k=v.split(/\r\n?|\n/g),M=O[0],z=O[1]==null?k.length:O[1];if(M<0)M+=k.length;if(M=Math.max(0,Math.min(M-1,k.length)),z<0)z+=k.length;if(z=Math.max(0,Math.min(z,k.length)),v=k.slice(M,z).join(`
|
|
2
|
-
`),!x.hasAttribute("data-start"))x.setAttribute("data-start",String(M+1))}C.textContent=v,me.highlightElement(C)},function(v){x.setAttribute(i,c),C.textContent=v})}}),me.plugins.fileHighlight={highlight:function(x){var C=(x||document).querySelectorAll(d);for(var y=0,N;N=C[y++];)me.highlightElement(N)}};var p=!1;me.fileHighlight=function(){if(!p)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),p=!0;me.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var RO=[["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"}]],Pm=I("bold",RO);var MO=[["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"}]],Bm=I("heading-1",MO);var DO=[["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"}]],Km=I("heading-2",DO);var $O=[["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"}]],zm=I("heading-3",$O);var wO=[["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"}]],Um=I("italic",wO);var kO=[["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"}]],Hm=I("list-ordered",kO);var IO=[["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"}]],Gm=I("quote",IO);var LO=[["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"}]],jm=I("redo-2",LO);var FO=[["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"}]],Ym=I("remove-formatting",FO);var PO=[["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"}]],Vm=I("strikethrough",PO);var BO=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Xm=I("underline",BO);var KO=[["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"}]],qm=I("undo-2",KO);S();S();S();S();var qd={};ke(qd,{LexicalComposerContext:()=>Jm,createLexicalComposerContext:()=>zO,useLexicalComposerContext:()=>UO});var Jm=lt(null);function zO(e,n){let r=null;return e!=null&&(r=e[1]),{getTheme:function(){return n!=null?n:r!=null?r.getTheme():null}}}function UO(){let e=pt(Jm);return e==null&&function(n,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",n);for(let a of r)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${n}; visit ${s.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:Zm,createLexicalComposerContext:Qm,useLexicalComposerContext:st}=Jd;var Fg={};ke(Fg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>el,$assumeActiveEditor:()=>cR,$caretFromPoint:()=>Fr,$caretRangeFromSelection:()=>Ff,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>YR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>XR,$createChildrenArray:()=>Ka,$createLineBreakNode:()=>Bc,$createNodeSelection:()=>vc,$createParagraphNode:()=>Rn,$createPoint:()=>_o,$createRangeSelection:()=>SC,$createRangeSelectionFromDom:()=>sR,$createTabNode:()=>lC,$createTextNode:()=>Cn,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>Er,$formatText:()=>fC,$fullReconcile:()=>bC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>di,$getAdjacentNode:()=>GC,$getAdjacentSiblingOrParentSiblingCaret:()=>iM,$getCaretInDirection:()=>Fo,$getCaretRange:()=>Lr,$getCaretRangeInDirection:()=>Ig,$getCharacterOffsets:()=>Rf,$getChildCaret:()=>lr,$getChildCaretAtIndex:()=>by,$getChildCaretOrSelf:()=>yy,$getCollapsedCaretRange:()=>Sy,$getCommonAncestor:()=>Ic,$getCommonAncestorResultBranchOrder:()=>kg,$getDOMSlot:()=>Dn,$getDOMTextNode:()=>ir,$getDocument:()=>Sn,$getEditor:()=>Co,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>XC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>Mn,$getSelection:()=>Ue,$getSiblingCaret:()=>St,$getSlot:()=>$r,$getSlotFrame:()=>hy,$getSlotHost:()=>Un,$getSlotNameWithinHost:()=>py,$getSlotNames:()=>Gn,$getState:()=>_c,$getStateChange:()=>yA,$getTextContent:()=>aR,$getTextNodeOffset:()=>mo,$getTextPointCaret:()=>kr,$getTextPointCaretSlice:()=>Lf,$getWritableNodeState:()=>Wf,$hasAncestor:()=>Pa,$hasUpdateTag:()=>IR,$insertNodeToNearestRootAtCaret:()=>Oy,$insertNodes:()=>iR,$isBlockElementNode:()=>CC,$isChildCaret:()=>jn,$isDecoratorNode:()=>qe,$isEditorState:()=>fR,$isElementDOMSlot:()=>iy,$isElementNode:()=>j,$isExtendableTextPointCaret:()=>Ty,$isInlineElementOrDecoratorNode:()=>VC,$isInlineFormattable:()=>bc,$isLeafNode:()=>DR,$isLexicalNode:()=>og,$isLineBreakNode:()=>Io,$isNodeCaret:()=>tM,$isNodeSelection:()=>fi,$isParagraphNode:()=>wC,$isRangeSelection:()=>ge,$isRootNode:()=>Kt,$isRootOrShadowRoot:()=>Rt,$isSelectionCapturedInDecoratorInput:()=>zc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>wr,$isSlotChild:()=>Dr,$isSlotHost:()=>Do,$isTabNode:()=>sg,$isTextNode:()=>te,$isTextPointCaret:()=>ho,$isTextPointCaretSlice:()=>sM,$isTokenOrSegmented:()=>Wn,$isTokenOrTab:()=>Fa,$markSlotEditable:()=>dy,$needsBlockCursorBeside:()=>pc,$nodesOfType:()=>kR,$normalizeCaret:()=>$o,$normalizeSelection__EXPERIMENTAL:()=>ni,$onUpdate:()=>YC,$parseSerializedNode:()=>uR,$removeFromParent:()=>zn,$removeSlot:()=>xy,$removeTextFromCaretRange:()=>Ey,$rewindSiblingCaret:()=>Ts,$selectAll:()=>wR,$setCompositionKey:()=>Bt,$setDirectionFromDOM:()=>ly,$setFormatFromDOM:()=>cy,$setPointFromCaret:()=>Ua,$setSelection:()=>tn,$setSelectionFromCaretRange:()=>Ny,$setSlot:()=>Og,$setState:()=>SA,$setTextFormat:()=>oR,$splitAtPointCaretNext:()=>vy,$splitNode:()=>PR,$updateDOMSelection:()=>NC,$updateRangeSelectionFromCaretRange:()=>Ca,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>jf,BLUR_COMMAND:()=>jx,CAN_REDO_COMMAND:()=>IA,CAN_UNDO_COMMAND:()=>LA,CAN_USE_BEFORE_INPUT:()=>ya,CAN_USE_DOM:()=>Vn,CLEAR_EDITOR_COMMAND:()=>wA,CLEAR_HISTORY_COMMAND:()=>kA,CLICK_COMMAND:()=>Ax,COLLABORATION_TAG:()=>tC,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:()=>Tc,COMPOSITION_START_COMMAND:()=>Vf,COMPOSITION_START_TAG:()=>rC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ii,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>VA,DEFAULT_EDITOR_DOM_CONFIG:()=>La,DELETE_CHARACTER_COMMAND:()=>Aa,DELETE_LINE_COMMAND:()=>Ma,DELETE_WORD_COMMAND:()=>Ra,DRAGEND_COMMAND:()=>Hx,DRAGOVER_COMMAND:()=>Ux,DRAGSTART_COMMAND:()=>zx,DROP_COMMAND:()=>Kx,DecoratorNode:()=>Pc,ElementNode:()=>ko,FOCUS_COMMAND:()=>Gx,FORMAT_ELEMENT_COMMAND:()=>$A,FORMAT_TEXT_COMMAND:()=>Tr,HISTORIC_TAG:()=>GA,HISTORY_MERGE_TAG:()=>dc,HISTORY_PUSH_TAG:()=>jA,INDENT_CONTENT_COMMAND:()=>MA,INPUT_COMMAND:()=>Yf,INSERT_LINE_BREAK_COMMAND:()=>_a,INSERT_PARAGRAPH_COMMAND:()=>Nf,INSERT_TAB_COMMAND:()=>RA,INTERNAL_$isBlock:()=>xn,IS_ALL_FORMATTING:()=>eA,IS_ANDROID:()=>Pf,IS_ANDROID_CHROME:()=>Sa,IS_APPLE:()=>Bn,IS_APPLE_WEBKIT:()=>Wa,IS_BOLD:()=>YO,IS_CHROME:()=>Bf,IS_CODE:()=>JO,IS_FIREFOX:()=>wo,IS_HIGHLIGHT:()=>Kf,IS_IOS:()=>gs,IS_ITALIC:()=>VO,IS_SAFARI:()=>Ha,IS_STRIKETHROUGH:()=>XO,IS_SUBSCRIPT:()=>ZO,IS_SUPERSCRIPT:()=>QO,IS_UNDERLINE:()=>qO,KEY_ARROW_DOWN_COMMAND:()=>kx,KEY_ARROW_LEFT_COMMAND:()=>Dx,KEY_ARROW_RIGHT_COMMAND:()=>Rx,KEY_ARROW_UP_COMMAND:()=>wx,KEY_BACKSPACE_COMMAND:()=>Lx,KEY_DELETE_COMMAND:()=>Px,KEY_DOWN_COMMAND:()=>Qf,KEY_ENTER_COMMAND:()=>Cc,KEY_ESCAPE_COMMAND:()=>Fx,KEY_MODIFIER_COMMAND:()=>Yx,KEY_SPACE_COMMAND:()=>Ix,KEY_TAB_COMMAND:()=>Bx,LineBreakNode:()=>Xa,MOVE_TO_END:()=>Mx,MOVE_TO_START:()=>$x,NODE_STATE_DIRECT:()=>ff,NODE_STATE_KEY:()=>gA,NODE_STATE_LATEST:()=>gf,OUTDENT_CONTENT_COMMAND:()=>DA,PASTE_COMMAND:()=>qf,PASTE_TAG:()=>YA,ParagraphNode:()=>qa,REDO_COMMAND:()=>Zf,REMOVE_TEXT_COMMAND:()=>lc,RootNode:()=>Ya,SELECTION_CHANGE_COMMAND:()=>Gf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>OA,SELECT_ALL_COMMAND:()=>Wx,SET_TEXT_FORMAT_COMMAND:()=>AA,SKIP_COLLAB_TAG:()=>XA,SKIP_DOM_SELECTION_TAG:()=>oC,SKIP_SCROLL_INTO_VIEW_TAG:()=>nC,SKIP_SELECTION_FOCUS_TAG:()=>Ec,TEXT_TYPE_TO_FORMAT:()=>Xt,TabNode:()=>ja,TextNode:()=>ms,UNDO_COMMAND:()=>Jf,addClassNamesToElement:()=>pM,buildImportMap:()=>WA,configExtension:()=>uM,createCommand:()=>Te,createEditor:()=>bR,createRefCountedRegistry:()=>Vx,createSharedNodeState:()=>xx,createState:()=>CA,declarePeerDependency:()=>dM,defineExtension:()=>cM,findAllLexicalElementsDeep:()=>ZC,flipDirection:()=>Pr,getActiveElement:()=>kc,getActiveElementDeep:()=>ui,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>mi,getDOMOwnerDocument:()=>Hc,getDOMSelection:()=>Xn,getDOMSelectionFromTarget:()=>qC,getDOMSelectionPoints:()=>Yn,getDOMSelectionRange:()=>ey,getDOMSelectionRangeAndPoints:()=>FR,getDOMShadowRoots:()=>JC,getDOMTextNode:()=>FC,getDeclaredSlots:()=>my,getEditorPropertyFromDOMNode:()=>Qa,getNearestEditorFromDOMNode:()=>fs,getParentElement:()=>Es,getRegisteredNode:()=>Kc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>VR,getRootOwnerDocument:()=>QC,getStaticNodeConfig:()=>tl,getStyleObjectFromCSS:()=>Of,getTextDirection:()=>MR,getTransformSetFromKlass:()=>IC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>Rr,isDOMCapturingSelection:()=>Ba,isDOMDocumentNode:()=>gi,isDOMNode:()=>_i,isDOMShadowRoot:()=>ar,isDOMTextNode:()=>xo,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>ry,isExactShortcutMatch:()=>Qe,isHTMLAnchorElement:()=>BR,isHTMLElement:()=>Ct,isHTMLTableCellElement:()=>zR,isHTMLTableRowElement:()=>KR,isInlineDomNode:()=>sy,isLastChildInBlockNode:()=>$C,isLexicalEditor:()=>Uc,isModifierMatch:()=>WC,isOnlyChildInBlockNode:()=>DC,isSelectionCapturedInDecoratorInput:()=>RR,isSelectionWithinEditor:()=>Za,iterStaticNodeConfigChain:()=>nl,makeStepwiseIterator:()=>$g,mergeRegister:()=>Lg,mountSlotContainer:()=>WR,normalizeClassNames:()=>rl,registerEventListener:()=>ng,registerEventListeners:()=>mM,removeClassNamesFromElement:()=>hM,removeFromParent:()=>$R,resetRandomKey:()=>OR,safeCast:()=>fM,setDOMStyleFromCSS:()=>Af,setDOMStyleObject:()=>JA,setDOMUnmanaged:()=>uy,setNodeIndentFromDOM:()=>ay,shallowMergeConfig:()=>gM,stopLexicalPropagation:()=>bf,toggleTextFormatType:()=>Mr,tokenizeRawText:()=>EC,unmountSlotContainer:()=>GR});function q(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lx(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);r.search=s.toString(),console.warn(`Minified Lexical warning #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Vn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,HO=Vn&&"documentMode"in document?document.documentMode:null,Bn=Vn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),wo=Vn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ya=!(!Vn||!("InputEvent"in window)||HO)&&"getTargetRanges"in new window.InputEvent("input"),gs=Vn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pf=Vn&&/Android/.test(navigator.userAgent),Ha=Vn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Pf,Bf=Vn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Sa=Vn&&Pf&&Bf,Wa=Vn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Bn&&!Bf,WO=0,GO=1,jO=2,YO=1,VO=2,XO=4,qO=8,JO=16,ZO=32,QO=64,Kf=128,eA=2047,tA=1,nA=2,oA=3,rA=4,sA=5,iA=6,Na=Ha||gs||Wa?" ":"",ds=`
|
|
1
|
+
import{Ls,pi,lt,F,P,pt,m,$e,D,_,u,S,L,t,o,G,Z,B,ke,Ji,rn,A,I,Re,Lo,on,Pe,C,H0,$0,Xm,G0,Da,tA,Dp,ue,Ot,vr,un,ao,$t,ur,_r}from"./chunk-vvr8tnse.js";import{Ti}from"./chunk-113baw0m.js";import{Ir}from"./chunk-4yhvexzk.js";import{ua}from"./chunk-j4p3eqtd.js";import{Ga}from"./chunk-6zerk0em.js";import{Ja}from"./chunk-3tg10kwz.js";import{nc}from"./chunk-x4q082e6.js";import{nr}from"./chunk-emgyjhmx.js";import{H,w,je}from"./chunk-tjavzarz.js";var om=w(function(pH,Pd){var iI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},me=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,s={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function N(E){if(E instanceof a)return new a(E.type,N(E.content),E.alias);else if(Array.isArray(E))return E.map(N);else return E.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(N){return Object.prototype.toString.call(N).slice(8,-1)},objId:function(N){if(!N.__id)Object.defineProperty(N,"__id",{value:++r});return N.__id},clone:function N(E,T){T=T||{};var b,v;switch(i.util.type(E)){case"Object":if(v=i.util.objId(E),T[v])return T[v];b={},T[v]=b;for(var O in E)if(E.hasOwnProperty(O))b[O]=N(E[O],T);return b;case"Array":if(v=i.util.objId(E),T[v])return T[v];return b=[],T[v]=b,E.forEach(function(k,M){b[M]=N(k,T)}),b;default:return E}},getLanguage:function(N){while(N){var E=n.exec(N.className);if(E)return E[1].toLowerCase();N=N.parentElement}return"none"},setLanguage:function(N,E){N.className=N.className.replace(RegExp(n,"gi"),""),N.classList.add("language-"+E)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(b){var N=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(N){var E=document.getElementsByTagName("script");for(var T in E)if(E[T].src==N)return E[T]}return null}},isActive:function(N,E,T){var b="no-"+E;while(N){var v=N.classList;if(v.contains(E))return!0;if(v.contains(b))return!1;N=N.parentElement}return!!T}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(N,E){var T=i.util.clone(i.languages[N]);for(var b in E)T[b]=E[b];return T},insertBefore:function(N,E,T,b){b=b||i.languages;var v=b[N],O={};for(var k in v)if(v.hasOwnProperty(k)){if(k==E){for(var M in T)if(T.hasOwnProperty(M))O[M]=T[M]}if(!T.hasOwnProperty(k))O[k]=v[k]}var z=b[N];return b[N]=O,i.languages.DFS(i.languages,function(K,U){if(U===z&&K!=N)this[K]=O}),O},DFS:function N(E,T,b,v){v=v||{};var O=i.util.objId;for(var k in E)if(E.hasOwnProperty(k)){T.call(E,k,E[k],b||k);var M=E[k],z=i.util.type(M);if(z==="Object"&&!v[O(M)])v[O(M)]=!0,N(M,T,null,v);else if(z==="Array"&&!v[O(M)])v[O(M)]=!0,N(M,T,k,v)}}},plugins:{},highlightAll:function(N,E){i.highlightAllUnder(document,N,E)},highlightAllUnder:function(N,E,T){var b={callback:T,container:N,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),i.hooks.run("before-all-elements-highlight",b);for(var v=0,O;O=b.elements[v++];)i.highlightElement(O,E===!0,b.callback)},highlightElement:function(N,E,T){var b=i.util.getLanguage(N),v=i.languages[b];i.util.setLanguage(N,b);var O=N.parentElement;if(O&&O.nodeName.toLowerCase()==="pre")i.util.setLanguage(O,b);var k=N.textContent,M={element:N,language:b,grammar:v,code:k};function z(U){M.highlightedCode=U,i.hooks.run("before-insert",M),M.element.innerHTML=M.highlightedCode,i.hooks.run("after-highlight",M),i.hooks.run("complete",M),T&&T.call(M.element)}if(i.hooks.run("before-sanity-check",M),O=M.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex"))O.setAttribute("tabindex","0");if(!M.code){i.hooks.run("complete",M),T&&T.call(M.element);return}if(i.hooks.run("before-highlight",M),!M.grammar){z(i.util.encode(M.code));return}if(E&&e.Worker){var K=new Worker(i.filename);K.onmessage=function(U){z(U.data)},K.postMessage(JSON.stringify({language:M.language,code:M.code,immediateClose:!0}))}else z(i.highlight(M.code,M.grammar,M.language))},highlight:function(N,E,T){var b={code:N,grammar:E,language:T};if(i.hooks.run("before-tokenize",b),!b.grammar)throw Error('The language "'+b.language+'" has no grammar.');return b.tokens=i.tokenize(b.code,b.grammar),i.hooks.run("after-tokenize",b),a.stringify(i.util.encode(b.tokens),b.language)},tokenize:function(N,E){var T=E.rest;if(T){for(var b in T)E[b]=T[b];delete E.rest}var v=new d;return f(v,v.head,N),c(N,v,E,v.head,0),p(v)},hooks:{all:{},add:function(N,E){var T=i.hooks.all;T[N]=T[N]||[],T[N].push(E)},run:function(N,E){var T=i.hooks.all[N];if(!T||!T.length)return;for(var b=0,v;v=T[b++];)v(E)}},Token:a};e.Prism=i;function a(N,E,T,b){this.type=N,this.content=E,this.alias=T,this.length=(b||"").length|0}a.stringify=function N(E,T){if(typeof E=="string")return E;if(Array.isArray(E)){var b="";return E.forEach(function(z){b+=N(z,T)}),b}var v={type:E.type,content:N(E.content,T),tag:"span",classes:["token",E.type],attributes:{},language:T},O=E.alias;if(O)if(Array.isArray(O))Array.prototype.push.apply(v.classes,O);else v.classes.push(O);i.hooks.run("wrap",v);var k="";for(var M in v.attributes)k+=" "+M+'="'+(v.attributes[M]||"").replace(/"/g,""")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+k+">"+v.content+"</"+v.tag+">"};function l(N,E,T,b){N.lastIndex=E;var v=N.exec(T);if(v&&b&&v[1]){var O=v[1].length;v.index+=O,v[0]=v[0].slice(O)}return v}function c(N,E,T,b,v,O){for(var k in T){if(!T.hasOwnProperty(k)||!T[k])continue;var M=T[k];M=Array.isArray(M)?M:[M];for(var z=0;z<M.length;++z){if(O&&O.cause==k+","+z)return;var K=M[z],U=K.inside,J=!!K.lookbehind,W=!!K.greedy,ne=K.alias;if(W&&!K.pattern.global){var ee=K.pattern.toString().match(/[imsuy]*$/)[0];K.pattern=RegExp(K.pattern.source,ee+"g")}var se=K.pattern||K;for(var V=b.next,fe=v;V!==E.tail;fe+=V.value.length,V=V.next){if(O&&fe>=O.reach)break;var Ce=V.value;if(E.length>N.length)return;if(Ce instanceof a)continue;var Oe=1,oe;if(W){if(oe=l(se,fe,N,J),!oe||oe.index>=N.length)break;var we=oe.index,ae=oe.index+oe[0].length,ce=fe;ce+=V.value.length;while(we>=ce)V=V.next,ce+=V.value.length;if(ce-=V.value.length,fe=ce,V.value instanceof a)continue;for(var De=V;De!==E.tail&&(ce<ae||typeof De.value==="string");De=De.next)Oe++,ce+=De.value.length;Oe--,Ce=N.slice(fe,ce),oe.index-=fe}else if(oe=l(se,0,Ce,J),!oe)continue;var we=oe.index,ht=oe[0],Qt=Ce.slice(0,we),Be=Ce.slice(we+ht.length),_t=fe+Ce.length;if(O&&_t>O.reach)O.reach=_t;var Vt=V.prev;if(Qt)Vt=f(E,Vt,Qt),fe+=Qt.length;g(E,Vt,Oe);var Nr=new a(k,U?i.tokenize(ht,U):ht,ne,ht);if(V=f(E,Vt,Nr),Be)f(E,V,Be);if(Oe>1){var Qo={cause:k+","+z,reach:_t};if(c(N,E,T,V.prev,fe,Qo),O&&Qo.reach>O.reach)O.reach=Qo.reach}}}}}function d(){var N={value:null,prev:null,next:null},E={value:null,prev:N,next:null};N.next=E,this.head=N,this.tail=E,this.length=0}function f(N,E,T){var b=E.next,v={value:T,prev:E,next:b};return E.next=v,b.prev=v,N.length++,v}function g(N,E,T){var b=E.next;for(var v=0;v<T&&b!==N.tail;v++)b=b.next;E.next=b,b.prev=E,N.length-=v}function p(N){var E=[],T=N.head.next;while(T!==N.tail)E.push(T.value),T=T.next;return E}if(!e.document){if(!e.addEventListener)return i;if(!i.disableWorkerMessageHandler)e.addEventListener("message",function(N){var E=JSON.parse(N.data),{language:T,code:b,immediateClose:v}=E;if(e.postMessage(i.highlight(b,i.languages[T],T)),v)e.close()},!1);return i}var h=i.util.currentScript();if(h){if(i.filename=h.src,h.hasAttribute("data-manual"))i.manual=!0}function x(){if(!i.manual)i.highlightAll()}if(!i.manual){var y=document.readyState;if(y==="loading"||y==="interactive"&&h&&h.defer)document.addEventListener("DOMContentLoaded",x);else if(window.requestAnimationFrame)window.requestAnimationFrame(x);else window.setTimeout(x,16)}return i}(iI);if(typeof Pd<"u"&&Pd.exports)Pd.exports=me;if(typeof global<"u")global.Prism=me;me.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]};me.languages.markup.tag.inside["attr-value"].inside.entity=me.languages.markup.entity;me.languages.markup.doctype.inside["internal-subset"].inside=me.languages.markup;me.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&/,"&")});Object.defineProperty(me.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:me.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:me.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},me.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(me.languages.markup.tag,"addAttribute",{value:function(e,n){me.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:[n,"language-"+n],inside:me.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});me.languages.html=me.languages.markup;me.languages.mathml=me.languages.markup;me.languages.svg=me.languages.markup;me.languages.xml=me.languages.extend("markup",{});me.languages.ssml=me.languages.xml;me.languages.atom=me.languages.xml;me.languages.rss=me.languages.xml;(function(e){var n=/(?:"(?:\\(?:\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+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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 r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.tag.addAttribute("style","css")})(me);me.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:/[{}[\];(),.:]/};me.languages.javascript=me.languages.extend("clike",{"class-name":[me.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}|\?\?=?|\?\.?|[~:]/});me.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;me.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:me.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:me.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:me.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:me.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:me.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});me.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:me.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"}});me.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(me.languages.markup)me.languages.markup.tag.addInlined("script","javascript"),me.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");me.languages.js=me.languages.javascript;(function(){if(typeof me>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var e="Loading…",n=function(h,x){return"✖ Error "+h+" while fetching file: "+x},r="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},i="data-src-status",a="loading",l="loaded",c="failed",d="pre[data-src]:not(["+i+'="'+l+'"]):not(['+i+'="'+a+'"])';function f(h,x,y){var N=new XMLHttpRequest;N.open("GET",h,!0),N.onreadystatechange=function(){if(N.readyState==4)if(N.status<400&&N.responseText)x(N.responseText);else if(N.status>=400)y(n(N.status,N.statusText));else y(r)},N.send(null)}function g(h){var x=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(x){var y=Number(x[1]),N=x[2],E=x[3];if(!N)return[y,y];if(!E)return[y,void 0];return[y,Number(E)]}return}me.hooks.add("before-highlightall",function(h){h.selector+=", "+d}),me.hooks.add("before-sanity-check",function(h){var x=h.element;if(x.matches(d)){h.code="",x.setAttribute(i,a);var y=x.appendChild(document.createElement("CODE"));y.textContent=e;var N=x.getAttribute("data-src"),E=h.language;if(E==="none"){var T=(/\.(\w+)$/.exec(N)||[,"none"])[1];E=s[T]||T}me.util.setLanguage(y,E),me.util.setLanguage(x,E);var b=me.plugins.autoloader;if(b)b.loadLanguages(E);f(N,function(v){x.setAttribute(i,l);var O=g(x.getAttribute("data-range"));if(O){var k=v.split(/\r\n?|\n/g),M=O[0],z=O[1]==null?k.length:O[1];if(M<0)M+=k.length;if(M=Math.max(0,Math.min(M-1,k.length)),z<0)z+=k.length;if(z=Math.max(0,Math.min(z,k.length)),v=k.slice(M,z).join(`
|
|
2
|
+
`),!x.hasAttribute("data-start"))x.setAttribute("data-start",String(M+1))}y.textContent=v,me.highlightElement(y)},function(v){x.setAttribute(i,c),y.textContent=v})}}),me.plugins.fileHighlight={highlight:function(x){var y=(x||document).querySelectorAll(d);for(var N=0,E;E=y[N++];)me.highlightElement(E)}};var p=!1;me.fileHighlight=function(){if(!p)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),p=!0;me.plugins.fileHighlight.highlight.apply(this,arguments)}})()});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=I("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=I("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=I("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=I("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=I("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=I("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=I("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=I("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=I("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=I("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=I("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=I("undo-2",BO);S();S();S();S();var qd={};je(qd,{LexicalComposerContext:()=>qm,createLexicalComposerContext:()=>KO,useLexicalComposerContext:()=>zO});var qm=lt(null);function KO(e,n){let r=null;return e!=null&&(r=e[1]),{getTheme:function(){return n!=null?n:r!=null?r.getTheme():null}}}function zO(){let e=pt(qm);return e==null&&function(n,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",n);for(let a of r)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${n}; visit ${s.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:Jm,createLexicalComposerContext:Zm,useLexicalComposerContext:st}=Jd;var Fg={};je(Fg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>el,$assumeActiveEditor:()=>cR,$caretFromPoint:()=>Fr,$caretRangeFromSelection:()=>Ff,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>YR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>XR,$createChildrenArray:()=>Ka,$createLineBreakNode:()=>Bc,$createNodeSelection:()=>vc,$createParagraphNode:()=>Rn,$createPoint:()=>_o,$createRangeSelection:()=>yC,$createRangeSelectionFromDom:()=>sR,$createTabNode:()=>aC,$createTextNode:()=>Cn,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>Er,$formatText:()=>dC,$fullReconcile:()=>TC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>di,$getAdjacentNode:()=>WC,$getAdjacentSiblingOrParentSiblingCaret:()=>iM,$getCaretInDirection:()=>Fo,$getCaretRange:()=>Lr,$getCaretRangeInDirection:()=>Ig,$getCharacterOffsets:()=>Rf,$getChildCaret:()=>lr,$getChildCaretAtIndex:()=>Ty,$getChildCaretOrSelf:()=>Cy,$getCollapsedCaretRange:()=>yy,$getCommonAncestor:()=>Ic,$getCommonAncestorResultBranchOrder:()=>kg,$getDOMSlot:()=>Dn,$getDOMTextNode:()=>ir,$getDocument:()=>Sn,$getEditor:()=>Co,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>VC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>Mn,$getSelection:()=>ze,$getSiblingCaret:()=>St,$getSlot:()=>$r,$getSlotFrame:()=>py,$getSlotHost:()=>Un,$getSlotNameWithinHost:()=>gy,$getSlotNames:()=>Gn,$getState:()=>_c,$getStateChange:()=>yA,$getTextContent:()=>aR,$getTextNodeOffset:()=>mo,$getTextPointCaret:()=>kr,$getTextPointCaretSlice:()=>Lf,$getWritableNodeState:()=>Wf,$hasAncestor:()=>Pa,$hasUpdateTag:()=>IR,$insertNodeToNearestRootAtCaret:()=>vy,$insertNodes:()=>iR,$isBlockElementNode:()=>xC,$isChildCaret:()=>jn,$isDecoratorNode:()=>qe,$isEditorState:()=>fR,$isElementDOMSlot:()=>sy,$isElementNode:()=>Y,$isExtendableTextPointCaret:()=>Ey,$isInlineElementOrDecoratorNode:()=>YC,$isInlineFormattable:()=>bc,$isLeafNode:()=>DR,$isLexicalNode:()=>og,$isLineBreakNode:()=>Io,$isNodeCaret:()=>tM,$isNodeSelection:()=>fi,$isParagraphNode:()=>$C,$isRangeSelection:()=>ge,$isRootNode:()=>Kt,$isRootOrShadowRoot:()=>Rt,$isSelectionCapturedInDecoratorInput:()=>zc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>wr,$isSlotChild:()=>Dr,$isSlotHost:()=>Do,$isTabNode:()=>sg,$isTextNode:()=>te,$isTextPointCaret:()=>ho,$isTextPointCaretSlice:()=>sM,$isTokenOrSegmented:()=>Wn,$isTokenOrTab:()=>Fa,$markSlotEditable:()=>uy,$needsBlockCursorBeside:()=>pc,$nodesOfType:()=>kR,$normalizeCaret:()=>$o,$normalizeSelection__EXPERIMENTAL:()=>ni,$onUpdate:()=>jC,$parseSerializedNode:()=>uR,$removeFromParent:()=>zn,$removeSlot:()=>_y,$removeTextFromCaretRange:()=>Ny,$rewindSiblingCaret:()=>Ts,$selectAll:()=>wR,$setCompositionKey:()=>Bt,$setDirectionFromDOM:()=>ay,$setFormatFromDOM:()=>ly,$setPointFromCaret:()=>Ua,$setSelection:()=>tn,$setSelectionFromCaretRange:()=>Sy,$setSlot:()=>Og,$setState:()=>SA,$setTextFormat:()=>oR,$splitAtPointCaretNext:()=>by,$splitNode:()=>PR,$updateDOMSelection:()=>SC,$updateRangeSelectionFromCaretRange:()=>Ca,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>jf,BLUR_COMMAND:()=>Gx,CAN_REDO_COMMAND:()=>IA,CAN_UNDO_COMMAND:()=>LA,CAN_USE_BEFORE_INPUT:()=>ya,CAN_USE_DOM:()=>Vn,CLEAR_EDITOR_COMMAND:()=>wA,CLEAR_HISTORY_COMMAND:()=>kA,CLICK_COMMAND:()=>Ox,COLLABORATION_TAG:()=>eC,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:()=>Tc,COMPOSITION_START_COMMAND:()=>Vf,COMPOSITION_START_TAG:()=>oC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ii,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>VA,DEFAULT_EDITOR_DOM_CONFIG:()=>La,DELETE_CHARACTER_COMMAND:()=>Aa,DELETE_LINE_COMMAND:()=>Ma,DELETE_WORD_COMMAND:()=>Ra,DRAGEND_COMMAND:()=>Ux,DRAGOVER_COMMAND:()=>zx,DRAGSTART_COMMAND:()=>Kx,DROP_COMMAND:()=>Bx,DecoratorNode:()=>Pc,ElementNode:()=>ko,FOCUS_COMMAND:()=>Wx,FORMAT_ELEMENT_COMMAND:()=>$A,FORMAT_TEXT_COMMAND:()=>Tr,HISTORIC_TAG:()=>GA,HISTORY_MERGE_TAG:()=>dc,HISTORY_PUSH_TAG:()=>jA,INDENT_CONTENT_COMMAND:()=>MA,INPUT_COMMAND:()=>Yf,INSERT_LINE_BREAK_COMMAND:()=>_a,INSERT_PARAGRAPH_COMMAND:()=>Nf,INSERT_TAB_COMMAND:()=>RA,INTERNAL_$isBlock:()=>xn,IS_ALL_FORMATTING:()=>QO,IS_ANDROID:()=>Pf,IS_ANDROID_CHROME:()=>Sa,IS_APPLE:()=>Bn,IS_APPLE_WEBKIT:()=>Wa,IS_BOLD:()=>jO,IS_CHROME:()=>Bf,IS_CODE:()=>qO,IS_FIREFOX:()=>wo,IS_HIGHLIGHT:()=>Kf,IS_IOS:()=>gs,IS_ITALIC:()=>YO,IS_SAFARI:()=>Ha,IS_STRIKETHROUGH:()=>VO,IS_SUBSCRIPT:()=>JO,IS_SUPERSCRIPT:()=>ZO,IS_UNDERLINE:()=>XO,KEY_ARROW_DOWN_COMMAND:()=>wx,KEY_ARROW_LEFT_COMMAND:()=>Mx,KEY_ARROW_RIGHT_COMMAND:()=>Ax,KEY_ARROW_UP_COMMAND:()=>$x,KEY_BACKSPACE_COMMAND:()=>Ix,KEY_DELETE_COMMAND:()=>Fx,KEY_DOWN_COMMAND:()=>Qf,KEY_ENTER_COMMAND:()=>Cc,KEY_ESCAPE_COMMAND:()=>Lx,KEY_MODIFIER_COMMAND:()=>jx,KEY_SPACE_COMMAND:()=>kx,KEY_TAB_COMMAND:()=>Px,LineBreakNode:()=>Xa,MOVE_TO_END:()=>Rx,MOVE_TO_START:()=>Dx,NODE_STATE_DIRECT:()=>ff,NODE_STATE_KEY:()=>gA,NODE_STATE_LATEST:()=>gf,OUTDENT_CONTENT_COMMAND:()=>DA,PASTE_COMMAND:()=>qf,PASTE_TAG:()=>YA,ParagraphNode:()=>qa,REDO_COMMAND:()=>Zf,REMOVE_TEXT_COMMAND:()=>lc,RootNode:()=>Ya,SELECTION_CHANGE_COMMAND:()=>Gf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>OA,SELECT_ALL_COMMAND:()=>Hx,SET_TEXT_FORMAT_COMMAND:()=>AA,SKIP_COLLAB_TAG:()=>XA,SKIP_DOM_SELECTION_TAG:()=>nC,SKIP_SCROLL_INTO_VIEW_TAG:()=>tC,SKIP_SELECTION_FOCUS_TAG:()=>Ec,TEXT_TYPE_TO_FORMAT:()=>Xt,TabNode:()=>ja,TextNode:()=>ms,UNDO_COMMAND:()=>Jf,addClassNamesToElement:()=>pM,buildImportMap:()=>WA,configExtension:()=>uM,createCommand:()=>Ee,createEditor:()=>bR,createRefCountedRegistry:()=>Yx,createSharedNodeState:()=>_x,createState:()=>CA,declarePeerDependency:()=>dM,defineExtension:()=>cM,findAllLexicalElementsDeep:()=>JC,flipDirection:()=>Pr,getActiveElement:()=>kc,getActiveElementDeep:()=>ui,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>mi,getDOMOwnerDocument:()=>Hc,getDOMSelection:()=>Xn,getDOMSelectionFromTarget:()=>XC,getDOMSelectionPoints:()=>Yn,getDOMSelectionRange:()=>QC,getDOMSelectionRangeAndPoints:()=>FR,getDOMShadowRoots:()=>qC,getDOMTextNode:()=>LC,getDeclaredSlots:()=>hy,getEditorPropertyFromDOMNode:()=>Qa,getNearestEditorFromDOMNode:()=>fs,getParentElement:()=>Es,getRegisteredNode:()=>Kc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>VR,getRootOwnerDocument:()=>ZC,getStaticNodeConfig:()=>tl,getStyleObjectFromCSS:()=>Of,getTextDirection:()=>MR,getTransformSetFromKlass:()=>kC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>Rr,isDOMCapturingSelection:()=>Ba,isDOMDocumentNode:()=>gi,isDOMNode:()=>_i,isDOMShadowRoot:()=>ar,isDOMTextNode:()=>xo,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>oy,isExactShortcutMatch:()=>Qe,isHTMLAnchorElement:()=>BR,isHTMLElement:()=>Ct,isHTMLTableCellElement:()=>zR,isHTMLTableRowElement:()=>KR,isInlineDomNode:()=>ry,isLastChildInBlockNode:()=>DC,isLexicalEditor:()=>Uc,isModifierMatch:()=>HC,isOnlyChildInBlockNode:()=>MC,isSelectionCapturedInDecoratorInput:()=>RR,isSelectionWithinEditor:()=>Za,iterStaticNodeConfigChain:()=>nl,makeStepwiseIterator:()=>$g,mergeRegister:()=>Lg,mountSlotContainer:()=>WR,normalizeClassNames:()=>rl,registerEventListener:()=>ng,registerEventListeners:()=>mM,removeClassNamesFromElement:()=>hM,removeFromParent:()=>$R,resetRandomKey:()=>OR,safeCast:()=>fM,setDOMStyleFromCSS:()=>Af,setDOMStyleObject:()=>JA,setDOMUnmanaged:()=>cy,setNodeIndentFromDOM:()=>iy,shallowMergeConfig:()=>gM,stopLexicalPropagation:()=>bf,toggleTextFormatType:()=>Mr,tokenizeRawText:()=>NC,unmountSlotContainer:()=>GR});function q(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ax(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);r.search=s.toString(),console.warn(`Minified Lexical warning #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Vn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UO=Vn&&"documentMode"in document?document.documentMode:null,Bn=Vn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),wo=Vn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ya=!(!Vn||!("InputEvent"in window)||UO)&&"getTargetRanges"in new window.InputEvent("input"),gs=Vn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pf=Vn&&/Android/.test(navigator.userAgent),Ha=Vn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Pf,Bf=Vn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Sa=Vn&&Pf&&Bf,Wa=Vn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Bn&&!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,nA=2,oA=3,rA=4,sA=5,iA=6,Na=Ha||gs||Wa?" ":"",ds=`
|
|
3
3
|
|
|
4
|
-
`,zf=wo?" ":Na,cx="֑-߿יִ-﷽ﹰ-ﻼ",ux="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",aA=new RegExp("^[^"+ux+"]*["+cx+"]"),lA=new RegExp("^[^"+cx+"]*["+ux+"]"),Xt={bold:1,capitalize:1024,code:16,highlight:Kf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},cA={directionless:1,unmergeable:2},hc={center:2,end:6,justify:4,left:1,right:3,start:5},uA={[nA]:"center",[iA]:"end",[rA]:"justify",[tA]:"left",[oA]:"right",[sA]:"start"},dA={normal:0,segmented:2,token:1},fA={[WO]:"normal",[jO]:"segmented",[GO]:"token"},gA="$",e_="$config";function t_(){return Co()._blockCursorElement}function pA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class ri{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||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 n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&q(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&q(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&q(359),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,n,r){if(this.element===e)return n===e&&r===0?"before":"after";let s=n_(e,this.element);if(s===null)return"after";let i=Array.prototype.indexOf.call(e.childNodes,s);if(i<0)return"after";if(n===e)return r<=i?"before":"after";let a=n_(e,n);if(a===null)return"after";let l=Array.prototype.indexOf.call(e.childNodes,a);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}}function n_(e,n){let r=n;for(;r!==null&&r.parentNode!==e;)r=r.parentNode;return r}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(),n=e?e.nextSibling:this.element.firstChild;for(;pA(n);)e=n,n=n.nextSibling;let r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===t_()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let n=e==="decorator"&&(Wa||gs||Ha);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let r=this.element,s=this.before,i=Sn().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,s),e){let a=Sn().createElement("img");a.setAttribute("data-lexical-managed-linebreak","true"),a.style.setProperty("display","inline","important"),a.style.setProperty("border","0px","important"),a.style.setProperty("margin","0px","important"),a.alt="",r.insertBefore(a,i),r.__lexicalLineBreak=a}else r.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),n=this.getInsertionAnchor(),r=0;for(let s=this.element.firstChild;s!==null&&s!==e&&s!==n;s=s.nextSibling)r++;return r}resolveChildIndex(e,n,r,s){if(r===this.element){let c=this.getFirstChildOffset(),d=t_(),f=this.element.childNodes,g=Math.min(s,f.length),p=0;for(let h=c;h<g;h++)f[h]!==d&&p++;return[e,Math.min(p,e.getChildrenSize())]}let i=o_(n,r);i.push(s);let a=o_(n,this.element),l=e.getIndexWithinParent();for(let c=0;c<a.length;c++){let d=i[c],f=a[c];if(d===void 0||d<f)break;if(d>f){l+=1;break}}return[e.getParentOrThrow(),l]}}function o_(e,n){let r=[],s=n;for(;s!==e&&s!==null;s=s.parentNode){let i=0;for(let a=s.previousSibling;a!==null;a=a.previousSibling)i++;r.push(i)}return s!==e&&q(225),r.reverse()}var dx;try{dx="0.49.0+prod.esm"}catch(e){}var fx=dx??'"<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 n of this._back)e.push(n);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}var ls=null;function gx(e,n=1000){return e instanceof Ea?e.clone():e.size<n?new Map(e):new Ea().init(new Map(e),void 0,e.size)}class Ea{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Ea().init(this._old,this._nursery,this._size)}init(e,n,r){return this._old=e,this._nursery=n,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let n=this._nursery&&this._nursery.get(e);return n!==void 0?n:this._old&&this._old.get(e)}get(e){let n=this.getWithTombstone(e);return n===ls?void 0:n}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 n=new Map(this._old);for(let[r,s]of this._nursery)s!==ls?n.set(r,s):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(e,n){let r=this.getWithTombstone(e);if(r===n)return this;let s=this.getNursery();return r!==ls&&r!==void 0||(this._size++,r===ls&&s.delete(e)),s.set(e,n),this}delete(e){let n=this.has(e);return n&&(this.getNursery().set(e,ls),this._size--),n}getOrInsert(e,n){let r=this.get(e);return r!==void 0?r:(this.set(e,n),n)}getOrInsertComputed(e,n){let r=this.get(e);if(r!==void 0)return r;let s=n(e);return this.set(e,s),s}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,n=this._old;if(n)for(let r of n){let s=r[0],i=e?e.get(s):void 0;i!==ls&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(let r of e)r[1]===ls||n&&n.has(r[0])||(yield r)}forEach(e,n){n!==void 0&&(e=e.bind(n));for(let[r,s]of this.entries())e(s,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function mc(e,n,r,s,i,a){if(j(e)){let l=e.getFirstChild();for(;l!==null;){let c=l.__key;l.__parent===n&&((j(l)||Do(l)&&l.__slots!==null)&&mc(l,c,r,s,i,a),r.has(c)||a.delete(c),i.push(c)),l=l.getNextSibling()}}for(let l of Do(e)&&e.__slots!==null?e.__slots.values():[]){let c=s.get(l);c!==void 0&&Dr(c)&&c.__slotHost===n&&((j(c)||Do(c)&&c.__slots!==null)&&mc(c,l,r,s,i,a),r.has(l)||a.delete(l),i.push(l))}}var df=!1,Uf=0;function hA(e){Uf=e.timeStamp}function Zd(e,n,r){let s=e.nodeName==="BR",i=n.__lexicalLineBreak;return i&&(e===i||s&&e.previousSibling===i)||s&&hi(e,r)!==void 0}function mA(e,n,r){let s=Xn(Nn(r)),i=s&&Yn(s,r._rootElement),a=null,l=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,l=i.focusOffset);let c=e.nodeValue;c!==null&&mg(n,c,a,l,!1)}function _A(e,n,r){if(ge(e)){let s=e.anchor.getNode();if(s.is(r)&&e.format!==s.getFormat())return!1}return xo(n)&&r.isAttached()}function xA(e,n,r){for(let s=e;s&&!vg(s);s=Es(s)){let i=hi(s,n);if(i!==void 0){let a=ot(i,r);if(a)return qe(a)||!Ct(s)?void 0:[s,a]}}}function px(e,n,r){df=!0;let s=performance.now()-Uf>100;try{Hn(e,()=>{let i=Ue()||function(p){return p.read("latest",()=>{let h=Ue();return h!==null?h.clone():null})}(e),a=new Map,{_editorState:l,_blockCursorElement:c}=e,d=!1,f="";for(let p=0;p<n.length;p++){let h=n[p],{type:x,target:C}=h,y=xA(C,e,l);if(!y)continue;let[N,T]=y;if(x==="characterData")s&&te(T)&&xo(C)&&_A(i,C,T)&&mA(C,T,e);else if(x==="childList"){d=!0;let b=h.addedNodes;for(let k=0;k<b.length;k++){let M=b[k],z=fg(M),K=M.parentNode;if(!(K==null||M===c||z!==null||Zd(M,K,e)||e._slotsUsed&&Ct(M)&&M.hasAttribute("data-lexical-slot")||vg(M))){if(wo){let U=(Ct(M)?M.innerText:null)||M.nodeValue;U&&(f+=U)}K.removeChild(M)}}let v=h.removedNodes,O=v.length;if(O>0){let k=0;for(let M=0;M<O;M++){let z=v[M];(Zd(z,C,e)||c===z)&&(C.appendChild(z),k++)}O!==k&&a.set(N,T)}}}if(a.size>0)for(let[p,h]of a)h.reconcileObservedMutation(p,e);let g=r.takeRecords();if(g.length>0){for(let p=0;p<g.length;p++){let h=g[p],{addedNodes:x,target:C}=h;for(let y=0;y<x.length;y++){let N=x[y],T=N.parentNode;T==null||N.nodeName!=="BR"||Zd(N,C,e)||T.removeChild(N)}}r.takeRecords()}i!==null&&(d&&tn(i),wo&&jC(e)&&i.insertRawText(f))})}finally{df=!1}}function hx(e){let n=e._observer;if(n!==null)px(e,n.takeRecords(),n)}function mx(e){(function(n){Uf===0&&Nn(n).addEventListener("textInput",hA,!0)})(e),e._observer=new MutationObserver((n,r)=>{px(e,n,r)})}var ff="direct",gf="latest";class _x{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||NA).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}}function CA(e,n){return new _x(e,n)}function _c(e,n,r=gf){let s=(r===gf?e.getLatest():e).__state;return s?s.getValue(n):n.defaultValue}function yA(e,n,r){let s=_c(e,r,ff),i=_c(n,r,ff);return r.isEqual(s,i)?null:[s,i]}function SA(e,n,r){let s;if(Wt(),typeof r=="function"){let a=e.getLatest(),l=_c(a,n);if(s=r(l),n.isEqual(l,s))return a}else s=r;let i=e.getWritable();return Wf(i).updateFromKnown(n,s),i}function xx(e){let n=new Map,r=new Set;for(let{ownNodeConfig:s}of nl(typeof e=="function"?e:e.replace))if(s&&s.stateConfigs)for(let i of s.stateConfigs){let a;"stateConfig"in i?(a=i.stateConfig,i.flat&&r.add(a.key)):a=i,n.set(a.key,a)}return{flatKeys:r,sharedConfigMap:n}}var r_=new Set(["__proto__","constructor","prototype"]);class Hf{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,s=new Map,i=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=s;let{sharedConfigMap:a}=this.sharedNodeState,l=i!==void 0?i:function(c,d,f){let g=f.size;if(d)for(let p in d){let h=c.get(p);h&&f.has(h)||g++}return g}(a,r,s);this.size=l}getValue(e){let n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},n={};for(let[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(let r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return s_(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;let{sharedNodeState:n,unknownState:r}=this,s=new Map(this.knownState);return new Hf(e,n,function(i,a,l){let c;if(l)for(let[d,f]of Object.entries(l)){if(r_.has(d))continue;let g=i.get(d);g?a.has(g)||a.set(g,g.parse(f)):(c=c||{},c[d]=f)}return c}(n.sharedConfigMap,s,r),s,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){let r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);let{knownState:s,unknownState:i}=this;s.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=s_(i)),this.size++),s.set(e,n)}updateFromUnknown(e,n){if(r_.has(e))return;let r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},(e in this.unknownState)||this.size++,this.unknownState[e]=n)}updateFromJSON(e){let{knownState:n}=this;for(let r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(let[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}}function Wf(e){let n=e.getWritable(),r=n.__state?n.__state.getWritable(n):new Hf(n,Cx(n));return n.__state=r,r}function Cx(e){return e.__state?e.__state.sharedNodeState:dg(Co(),e.getType()).sharedNodeState}function s_(e){if(e)for(let n in e)return e}function NA(e){return e}function i_(e,n,r){for(let[s,i]of n.knownState){if(e.has(s.key))continue;e.add(s.key);let a=r?r.getValue(s):s.defaultValue;if(a!==i&&!s.isEqual(a,i))return!0}return!1}function a_(e,n,r){let{unknownState:s}=n,i=r?r.unknownState:void 0;if(s)for(let[a,l]of Object.entries(s)){if(e.has(a))continue;if(e.add(a),l!==(i?i[a]:void 0))return!0}return!1}function l_(e,n){let r=e.__state;return r&&r.node===e?r.getWritable(n):r}function c_(e,n){let{__mode:r,__format:s,__style:i}=e,{__mode:a,__format:l,__style:c}=n,d=e.__state,f=n.__state;return(r===null||r===a)&&(s===null||s===l)&&(i===null||i===c)&&(e.__state===null||d===f||function(g,p){if(g===p)return!0;let h=new Set;return!(g&&i_(h,g,p)||p&&i_(h,p,g)||g&&a_(h,g,p)||p&&a_(h,p,g))}(d,f))}function u_(e,n){let r=e.mergeWithSibling(n),s=Ve()._normalizedNodes;return s.add(e.__key),s.add(n.__key),r}function d_(e){let n,r,s=e;if(s.__text!==""||!s.isSimpleText()||s.isUnmergeable()){for(;(n=s.getPreviousSibling())!==null&&te(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(c_(n,s)){s=u_(n,s);break}break}n.remove()}for(;(r=s.getNextSibling())!==null&&te(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(c_(s,r)){s=u_(s,r);break}break}r.remove()}}else s.remove()}function ni(e){return f_(e.anchor),f_(e.focus),e}function f_(e){for(;e.type==="element";){let n=e.getNode(),r=e.offset,s,i;if(r===n.getChildrenSize()?(s=n.getChildAtIndex(r-1),i=!0):(s=n.getChildAtIndex(r),i=!1),te(s)){e.set(s.__key,i?s.getTextContentSize():0,"text",!0);break}if(!j(s))break;e.set(s.__key,i?s.getChildrenSize():0,"element",!0)}}var Ta=Symbol.for("@lexical/CachedTextSize");function g_(e,n){return hf.read(()=>{let r=0,s=e;for(let i=0;i<n&&s!==null;i++){let a=po.get(s);if(a===void 0&&q(345,s),j(a)){let l=xt.get(s);if(l!==void 0&&j(l)&&l.__parent!==a.__parent)r+=a.getTextContentSize();else{let c=ps.get(s),d=c&&c.__lexicalTextContent;typeof d!="string"&&q(346,a.getType()),r+=d.length}i<n-1&&!a.isInline()&&(r+=2)}else{let l=a[Ta];l===void 0&&q(347,a.getType(),s),r+=l}s=a.__next}return r},{editor:Ye})}function yx(e){j(e)||e[Ta]===void 0&&(e[Ta]=te(e)?e.__text.length:e.getTextContentSize())}var EA=4,ba,Ye,va,Fe="",Tt=null,en=null,qt=null;function Ro(){return{firstTextKey:qt,format:Tt,style:en}}function Kn(e){e.firstTextKey!==null&&(Tt=e.format,en=e.style,qt=e.firstTextKey)}function pf(e){if(qt!==null)return;let n=e.__lexicalFirstTextKey;if(n===void 0&&q(348),n===null)return;let r=xt.get(n);te(r)&&(Tt=r.getFormat(),en=r.getStyle(),qt=n)}var Lc,ha,ma,po,hf,xt,ps,mf,Oa,hs,sr=!1,xc=!1;function Or(e,n){let r=po.get(e),s=xt.has(e);if(n!==null){let i=Sf(e);i.parentNode===n&&n.removeChild(i)}if(!s){if(Ye._keyToDOMMap.delete(e),j(r)){let i=Ka(r,po);_f(i,0,i.length-1,null)}if(r!==void 0){for(let i of An(r).values()){let a=Cf(i);Or(i,null),a!==null&&a.remove()}_g(Oa,va,Lc,r,"destroyed")}}}function _f(e,n,r,s){for(let i=n;i<=r;++i){let a=e[i];a!==void 0&&Or(a,s)}}function cs(e,n){e.setProperty("text-align",n)}var TA="40px";function Sx(e,n){let r=ba.theme.indent;if(typeof r=="string"){let s=e.classList.contains(r);n>0&&!s?e.classList.add(r):n<1&&s&&e.classList.remove(r)}e.style.setProperty("padding-inline-start",n===0?"":`calc(${n} * var(--lexical-indent-base-value, ${TA}))`)}function Nx(e,n){let r=e.style;n===0?cs(r,""):n===1?cs(r,"left"):n===2?cs(r,"center"):n===3?cs(r,"right"):n===4?cs(r,"justify"):n===5?cs(r,"start"):n===6&&cs(r,"end")}function xf(e,n){let r=function(s){let i=s.__dir;if(i!==null)return i;if(Kt(s))return null;let a=s.getParent();return a===null||Rt(a)&&a.__dir===null?"auto":null}(n);r!==null?e.dir=r:e.removeAttribute("dir")}function Ex(e){let n=Sn().createElement("div");return n.setAttribute("data-lexical-slot",e),n.style.display="none",n}function Tx(e,n,r){n||e.contentEditable==="false"?dy(r,Ye):r.removeAttribute("contenteditable")}function p_(e,n,r){let s=Fe,i=Ro();Fe="";let a="",l=qe(e);for(let[c,d]of r){let f=Ex(c);Tx(n,l,f),n.appendChild(f),Fe="";let g=Ro();Ar(d,Dn(e,f,Ye)),Kn(g),bx(e,c,n,f),a+=Fe}return Kn(i),Fe=s,a}function An(e){return Do(e)&&e.__slots!==null?e.__slots:gy}function bx(e,n,r,s){let i=hs.$getSlotTargetElement(e,n,r,Ye);i!==null&&(s.parentElement!==i&&i.appendChild(s),s.style.display="")}function Cf(e){let n=ps.get(e);return n!==void 0?n.parentElement:null}function h_(e,n,r){let s=An(e),i=An(n);for(let[g,p]of s)if(!i.has(g)){let h=Cf(p);Or(p,null),h!==null&&h.remove()}let a=Fe,l=Ro(),c="",d=null,f=qe(n);for(let[g,p]of i){let h=s.get(g),x=h!==void 0?Cf(h):null;Fe="";let C=Ro();if(x===null){x=Ex(g);let y=null;for(let N of r.children)if(!N.hasAttribute("data-lexical-slot")){y=N;break}r.insertBefore(x,y),Ar(p,Dn(n,x,Ye))}else h===p?rr(p,x):(h!==void 0&&Or(h,x),Ar(p,Dn(n,x,Ye)));if(Kn(C),Tx(r,f,x),bx(n,g,r,x),c+=Fe,x.parentElement===r){let y=d===null?r.firstChild:d.nextSibling;y!==x&&r.insertBefore(x,y),d=x}}return Kn(l),Fe=a,c}function Ar(e,n){let r=xt.get(e);if(r===void 0&&q(60),n!==null){let i=po.get(e);if(i!==void 0){let a=ps.get(e);if(a!==void 0){let l=Dr(i)?i.__slotHost:null,c=Dr(r)?r.__slotHost:null,d=i.__parent!==r.__parent||l!==c,f=c!==null&&a.parentElement!==n.element;if(d||f)return n.insertChild(a),rr(e,n.element)}}}let s=hs.$createDOM(r,Ye);if(function(i,a,l){let c=l._keyToDOMMap;BC(a,l,i),c.set(i,a)}(e,s,Ye),te(r)?s.setAttribute("data-lexical-text","true"):qe(r)&&(s.setAttribute("data-lexical-decorator","true"),uy(s,{captureSelection:!0})),j(r)){let{__indent:i,__size:a}=r;xf(s,r),i!==0&&Sx(s,i);let l=An(r),c=l.size>0?p_(r,s,l):"";if(a===0)s.__lexicalTextContent=c,s.__lexicalFirstTextKey=null,Fe+=c,l.size>0&&(s.__lexicalSlotTextLength=c.length);else{let f=Fe,g=a-1;if(yf(Ka(r,xt),r,0,g,Dn(r,s,Ye)),c!==""){let p=s.__lexicalTextContent||"";s.__lexicalTextContent=c+p,Fe=f+c+p}l.size>0&&(s.__lexicalSlotTextLength=c.length)}let d=r.__format;d!==0&&Nx(s,d),r.isInline()||vx(null,r,s)}else{let i=r.getTextContent();if(qe(r)){let a=r.decorate(Ye,ba);a!==null&&Ox(e,a),s.contentEditable="false";let l=An(r);l.size>0&&p_(r,s,l)}Fe+=i}return n!==null&&n.insertChild(s),hs.$decorateDOM(r,null,s,Ye),yx(r),_g(Oa,va,Lc,r,"created"),s}function yf(e,n,r,s,i){let a=Fe,l=Ro();Fe="",Tt=null,en=null,qt=null;let c=r;for(;c<=s;++c){let f=Ro();Ar(e[c],i);let g=xt.get(e[c]);g!==null&&te(g)?Tt===null&&(Tt=g.getFormat(),en=g.getStyle(),qt=g.__key):j(g)&&c<s&&!g.isInline()&&(Fe+=ds),Kn(f)}let d=Ye._keyToDOMMap.get(n.__key);d===void 0&&q(349,n.__key),d.__lexicalTextContent=Fe,d.__lexicalFirstTextKey=qt,Fe=a+Fe,Kn(l)}function vx(e,n,r){let s=Dn(n,r,Ye),i=s.element.__lexicalLastChildKind??null,a=function(l,c){if(l){let d=l.__last;if(d){let f=c.get(d);if(f)return Io(f)?"line-break":qe(f)&&f.isInline()?"decorator":null}return An(l).size>0?null:"empty"}return null}(n,xt);i!==a&&s.setManagedLineBreak(a)}function bA(e,n,r){var s;Tt=null,en=null,qt=null,function(i,a,l){let c=Fe,d=i.__size,f=a.__size;Fe="";let g=l.element,p=Ye._keyToDOMMap.get(a.__key);p===void 0&&q(351,a.__key);let h=f-d;if(!sr&&Math.abs(h)<=1&&d>=EA&&i.__first===a.__first&&(h!==0||!Ye._cloneNotNeeded.has(i.__key))){let x=p.__lexicalTextContent,C=mf.get(i.__key);if(!sr&&typeof x=="string"&&C!==void 0){let y=function(N,T){let b=T.size;if(b===0||b>=N.__size)return null;let v=N.__last,O=null,k=0;for(;v!==null&&k<b;){if(!T.has(v))return null;O=v;let M=xt.get(v);if(M===void 0)return null;v=M.__prev,k++}if(k!==b)return null;if(v!==null&&T.has(v))return null;return O}(a,C);if(y!==null){let N=C.size;if(h===0){let T=g_(y,N),b=y,v=0;for(;b!==null&&v<N;){let K=xt.get(b);if(K===void 0)break;let U=Ro();rr(b,g),te(K)&&Tt===null&&(Tt=K.getFormat(),en=K.getStyle(),qt=K.__key),Kn(U),b=K.__next,v++}let O="";for(b=y,v=0;b!==null&&v<N;){let K=xt.get(b);if(K===void 0)break;let U;if(j(K)){let J=Ye._keyToDOMMap.get(b),W=J&&J.__lexicalTextContent;typeof W!="string"&&q(352,K.getType()),U=W}else U=K.getTextContent();O+=U,v<N-1&&j(K)&&!K.isInline()&&(O+=ds),b=K.__next,v++}let k=p.__lexicalSlotTextLength||0,M=k>0?x.slice(k):x,z=M.slice(0,M.length-T)+O;return p.__lexicalTextContent=z,Fe=c+z,void m_(a,p,C)}if(function(T,b,v,O,k,M,z,K){if(K!==1&&K!==-1)return!1;if(z!==(K===1?2:1))return!1;let J=z-K,W=T.__last;for(let Ke=0;Ke<J-1;Ke++){if(W===null)return!1;let _t=po.get(W);if(_t===void 0)return!1;W=_t.__prev}if(W===null)return!1;let ne=xt.get(M),ee=po.get(W);if(ne===void 0||ee===void 0)return!1;if(ne.__prev!==ee.__prev)return!1;let se=[],Y=M;for(let Ke=0;Ke<z;Ke++){if(Y===null)return!1;se.push(Y);let _t=xt.get(Y);Y=_t?_t.__next:null}let fe=[];Y=W;for(let Ke=0;Ke<J;Ke++){if(Y===null)return!1;fe.push(Y);let _t=po.get(Y);Y=_t?_t.__next:null}let Ce=new Set(fe),Ae=new Set(se),oe=[],ae=0,ue=0;for(;ae<J&&ue<z;)if(se[ue]===fe[ae])oe.push({key:se[ue],kind:"reconcile"}),ae++,ue++;else if(Ae.has(fe[ae])){if(Ce.has(se[ue]))return!1;oe.push({key:se[ue],kind:"create",nextIndex:ue}),ue++}else oe.push({key:fe[ae],kind:"destroy"}),ae++;for(;ae<J;)oe.push({key:fe[ae++],kind:"destroy"});for(;ue<z;)oe.push({key:se[ue],kind:"create",nextIndex:ue}),ue++;let we=g_(W,J);for(let Ke of oe){let _t=Ro();if(Ke.kind==="reconcile")rr(Ke.key,v.element);else if(Ke.kind==="destroy")Or(Ke.key,v.element);else{let Vt=null;for(let Nr=Ke.nextIndex+1;Nr<z;Nr++){let Qo=Ye._keyToDOMMap.get(se[Nr]);if(Qo!==void 0){Vt=Qo;break}}Ar(Ke.key,v.withBefore(Vt??v.before))}if(Ke.kind!=="destroy"){let Vt=xt.get(Ke.key);Vt&&te(Vt)&&Tt===null&&(Tt=Vt.getFormat(),en=Vt.getStyle(),qt=Vt.__key)}Kn(_t)}let Ie="";for(let Ke=0;Ke<z;Ke++){let _t=xt.get(se[Ke]);if(_t===void 0)return!1;let Vt;if(j(_t)){let Nr=Ye._keyToDOMMap.get(se[Ke]),Qo=Nr&&Nr.__lexicalTextContent;typeof Qo!="string"&&q(350,_t.getType()),Vt=Qo}else Vt=_t.getTextContent();Ie+=Vt,Ke<z-1&&j(_t)&&!_t.isInline()&&(Ie+=ds)}let ht=O.__lexicalSlotTextLength||0,Qt=ht>0?k.slice(ht):k;return O.__lexicalTextContent=Qt.slice(0,Qt.length-we)+Ie,!0}(i,0,l,p,x,y,N,h)){let T=p.__lexicalTextContent;return typeof T!="string"&&q(353),Fe=c+T,void m_(a,p,C)}}}if(h===0){let y=i.__first,N=0;for(;y!==null;){let T=xt.get(y);if(T===void 0)break;let b=sr||ma.has(y)||ha.has(y),v=Ro();if(b)rr(y,g);else{let O,k;if(j(T)){k=ps.get(y);let M=k&&k.__lexicalTextContent;typeof M!="string"&&q(354,T.getType()),O=M}else O=T.getTextContent();Fe+=O,k!==void 0&&pf(k)}te(T)?Tt===null&&(Tt=T.getFormat(),en=T.getStyle(),qt=T.__key):j(T)&&N<f-1&&!T.isInline()&&(Fe+=ds),Kn(v),y=T.__next,N++}return p.__lexicalTextContent=Fe,p.__lexicalFirstTextKey=qt,void(Fe=c+Fe)}}if(d===1&&f===1){let x=i.__first,C=a.__first;if(x===C)rr(x,g);else{let N=Sf(x),T=Ar(C,null);try{N.parentNode===g?g.replaceChild(T,N):l.insertChild(T)}catch(b){if(typeof b=="object"&&b!=null){let v=`${b.toString()} Parent: ${g.tagName}, new child: {tag: ${T.tagName} key: ${C}}, old child: {tag: ${N.tagName}, key: ${x}}.`;throw Error(v)}throw b}Or(x,null)}let y=xt.get(C);te(y)&&Tt===null&&(Tt=y.getFormat(),en=y.getStyle(),qt=y.__key)}else{let x=Ka(i,po),C=Ka(a,xt);if(x.length!==d&&q(227),C.length!==f&&q(228),d===0)f!==0&&yf(C,a,0,f-1,l);else if(f===0){if(d!==0){let y=l.after==null&&l.before==null&&An(a).size===0&&l.element.__lexicalLineBreak==null;_f(x,0,d-1,y?null:g),y&&(g.textContent="")}}else(function(y,N,T,b,v,O){let k=b-1,M=v-1,z,K,U=O.getFirstChild(),J=0,W=0;for(;J<=k&&W<=M;){let se=N[J],Y=T[W],fe=Ro();if(se===Y)U=Qd(rr(Y,O.element)),J++,W++;else{if(K===void 0&&(K=__(T,W)),z===void 0)z=__(N,J);else if(!z.has(se)){J++,Kn(fe);continue}if(!K.has(se)){U=Qd(Sf(se)),Or(se,O.element),J++,z.delete(se),Kn(fe);continue}if(z.has(Y)){let Ae=ci(Ye,Y);Ae!==U&&O.withBefore(U??O.before).insertChild(Ae),U=Qd(rr(Y,O.element)),J++,W++}else Ar(Y,O.withBefore(U??O.before)),W++}let Ce=xt.get(Y);Ce!==null&&te(Ce)?Tt===null&&(Tt=Ce.getFormat(),en=Ce.getStyle(),qt=Ce.__key):j(Ce)&&W<=M&&!Ce.isInline()&&(Fe+=ds),Kn(fe)}let ne=J>k,ee=W>M;if(ne&&!ee){let se=T[M+1],Y=se===void 0?null:Ye.getElementByKey(se);yf(T,y,W,M,O.withBefore(Y??O.before))}else ee&&!ne&&_f(N,J,k,O.element)})(a,x,C,d,f,l)}p.__lexicalTextContent=Fe,p.__lexicalFirstTextKey=qt,Fe=c+Fe}(e,n,Dn(n,r,Ye)),Rt(n)||(s=n,Tt==null||Tt===s.__textFormat||xc||s.setTextFormat(Tt),function(i){en==null||en===i.__textStyle||xc||i.setTextStyle(en)}(n))}function m_(e,n,r){let s=n.__lexicalFirstTextKey;if(s!=null){let i=e.__key,a=s;for(;a!==null;){let l=xt.get(a);if(l===void 0){a=null;break}if(l.__parent===i)break;a=l.__parent}if(a!==null&&!r.has(a)){let l=xt.get(s);if(te(l))return Tt=l.getFormat(),void(en=l.getStyle())}}n.__lexicalFirstTextKey=qt}function rr(e,n){let r=po.get(e),s=xt.get(e);r!==void 0&&s!==void 0||q(61);let i=sr||ma.has(e)||ha.has(e),a=ci(Ye,e);if(r===s&&!i){let l;if(j(r)){let c=a.__lexicalTextContent;typeof c!="string"&&q(355,r.getType()),l=c,pf(a)}else l=r.getTextContent();return Fe+=l,a}if(r!==s&&i&&_g(Oa,va,Lc,s,"updated"),hs.$updateDOM(s,r,a,Ye)){let l=Ar(e,null);return n===null&&q(62),n.replaceChild(l,a),Or(e,null),l}if(j(r)){j(s)||q(334,e);let l=s.__indent;(sr||l!==r.__indent)&&Sx(a,l);let c=s.__format;(sr||c!==r.__format)&&Nx(a,c);let d=i&&(An(s).size>0||An(r).size>0)?h_(r,s,a):"";if(i){let f=Fe;if(bA(r,s,a),Kt(s)||s.isInline()||vx(0,s,a),d!==""){let g=a.__lexicalTextContent||"";a.__lexicalTextContent=d+g,Fe=f+d+g,a.__lexicalSlotTextLength=d.length}else(An(s).size>0||An(r).size>0)&&(a.__lexicalSlotTextLength=0)}else{let f=a.__lexicalTextContent;typeof f!="string"&&q(356,r.getType()),Fe+=f,pf(a)}if((sr||s.__dir!==r.__dir||s.__parent!==r.__parent)&&(xf(a,s),Kt(s)&&!sr)){for(let f of s.getChildren())if(j(f))xf(ci(Ye,f.getKey()),f)}}else{let l=s.getTextContent();if(qe(s)){let c=s.decorate(Ye,ba);c!==null&&Ox(e,c),i&&(An(s).size>0||An(r).size>0)&&h_(r,s,a)}Fe+=l}if(!xc&&Kt(s)){let l=s.getLatest();if(l.__cachedText!==Fe){let c=l.getWritable();c.__cachedText=Fe,s=c}}return hs.$decorateDOM(s,r,a,Ye),yx(s),a}function Ox(e,n){let r=Ye._pendingDecorators,s=Ye._decorators;if(r===null){if(s[e]===n)return;r=KC(Ye)}r[e]=n}function Qd(e){let n=e.nextSibling;return n!==null&&n===Ye._blockCursorElement&&(n=n.nextSibling),n}function __(e,n){let r=new Set;for(let s=n;s<e.length;s++)r.add(e[s]);return r}function vA(e,n,r,s,i,a){Fe="",Tt=null,en=null,qt=null,sr=s===2,Ye=r,ba=r._config,hs=r._config.dom||La,va=r._nodes,Lc=Ye._listeners.mutation,ha=i,ma=a,po=e._nodeMap,hf=e,xt=n._nodeMap,xc=n._readOnly,ps=gx(r._keyToDOMMap),mf=function(){let c=new Map,d=(f)=>{for(let g of f){let p=xt.get(g);if(p===void 0)continue;let h=p.__parent;if(h===null)continue;let x=c.get(h);x===void 0&&(x=new Set,c.set(h,x)),x.add(g)}};return d(ha.keys()),d(ma),c}();let l=new Map;return Oa=l,rr("root",null),Ye=void 0,va=void 0,ha=void 0,ma=void 0,po=void 0,hf=void 0,xt=void 0,ba=void 0,ps=void 0,mf=void 0,Oa=void 0,hs=La,l}function Sf(e){let n=ps.get(e);return n===void 0&&q(75,e),n}function Te(e){return{type:e}}var Gf=Te("SELECTION_CHANGE_COMMAND"),OA=Te("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ax=Te("CLICK_COMMAND"),jf=Te("BEFORE_INPUT_COMMAND"),Yf=Te("INPUT_COMMAND"),Vf=Te("COMPOSITION_START_COMMAND"),Xf=Te("COMPOSITION_END_COMMAND"),Aa=Te("DELETE_CHARACTER_COMMAND"),_a=Te("INSERT_LINE_BREAK_COMMAND"),Nf=Te("INSERT_PARAGRAPH_COMMAND"),ii=Te("CONTROLLED_TEXT_INSERTION_COMMAND"),qf=Te("PASTE_COMMAND"),lc=Te("REMOVE_TEXT_COMMAND"),Ra=Te("DELETE_WORD_COMMAND"),Ma=Te("DELETE_LINE_COMMAND"),Tr=Te("FORMAT_TEXT_COMMAND"),AA=Te("SET_TEXT_FORMAT_COMMAND"),Jf=Te("UNDO_COMMAND"),Zf=Te("REDO_COMMAND"),Qf=Te("KEYDOWN_COMMAND"),Rx=Te("KEY_ARROW_RIGHT_COMMAND"),Mx=Te("MOVE_TO_END"),Dx=Te("KEY_ARROW_LEFT_COMMAND"),$x=Te("MOVE_TO_START"),wx=Te("KEY_ARROW_UP_COMMAND"),kx=Te("KEY_ARROW_DOWN_COMMAND"),Cc=Te("KEY_ENTER_COMMAND"),Ix=Te("KEY_SPACE_COMMAND"),Lx=Te("KEY_BACKSPACE_COMMAND"),Fx=Te("KEY_ESCAPE_COMMAND"),Px=Te("KEY_DELETE_COMMAND"),Bx=Te("KEY_TAB_COMMAND"),RA=Te("INSERT_TAB_COMMAND"),MA=Te("INDENT_CONTENT_COMMAND"),DA=Te("OUTDENT_CONTENT_COMMAND"),Kx=Te("DROP_COMMAND"),$A=Te("FORMAT_ELEMENT_COMMAND"),zx=Te("DRAGSTART_COMMAND"),Ux=Te("DRAGOVER_COMMAND"),Hx=Te("DRAGEND_COMMAND"),eg=Te("COPY_COMMAND"),tg=Te("CUT_COMMAND"),Wx=Te("SELECT_ALL_COMMAND"),wA=Te("CLEAR_EDITOR_COMMAND"),kA=Te("CLEAR_HISTORY_COMMAND"),IA=Te("CAN_REDO_COMMAND"),LA=Te("CAN_UNDO_COMMAND"),Gx=Te("FOCUS_COMMAND"),jx=Te("BLUR_COMMAND"),Yx=Te("KEY_MODIFIER_COMMAND");function Vx(e){let n=new Map;return{dispose(){for(let r of n.values())r.dispose();n.clear()},register(r,s){let i=n.get(r);i===void 0&&(i={dispose:e(r,s),holders:new Set},n.set(r,i));let a=()=>{let l=n.get(r);l&&l.holders.delete(a)&&l.holders.size===0&&(n.delete(r),l.dispose())};return i.holders.add(a),a}}}function ng(e,n,r,s){return e.addEventListener(n,r,s),e.removeEventListener.bind(e,n,r,s)}var er=Object.freeze({}),Ef=[["keydown",function(e,n){let r=n._inputState;if(r.lastKeyDownTimeStamp=e.timeStamp,r.lastKeyCode=e.key,e.key!=="Backspace"&&wa(r),n.isComposing())return;ie(n,Qf,e)}],["pointerdown",function(e,n){let r=Ng(e),s=e.pointerType;_i(r)&&s!=="touch"&&s!=="pen"&&e.button===0&&Hn(n,()=>{Ba(r,n)||(n._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,n){ie(n,Vf,e)}],["compositionend",function(e,n){let r=n._inputState;wo?r.compositionPhase="ending-firefox":gs||!Ha&&!Wa?ie(n,Xf,e):(r.compositionPhase="ending-safari",r.compositionEndData=e.data)}],["input",function(e,n){e.stopPropagation();let r=n._inputState;wa(r),Hn(n,()=>{Zx(e,n)||n.dispatchCommand(Yf,e)},{event:e}),r.unprocessedBeforeInputData=null}],["click",function(e,n){Hn(n,()=>{let r=Ue(),s=Xn(Nn(n)),i=Ns();if(s){if(ge(r)){let a=r.anchor,l=a.getNode();a.type==="element"&&a.offset===0&&r.isCollapsed()&&!Kt(l)&&Mn().getChildrenSize()===1&&l.getTopLevelElementOrThrow().isEmpty()&&i!==null&&r.is(i)&&(s.removeAllRanges(),r.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let a=Yn(s,n._rootElement).anchorNode;if(Ct(a)||xo(a))tn(ka(i,s,n,e))}}if(wo&&s!==null&&s.rangeCount===0){let a=n._rootElement;if(a!==null&&e.target===a){let l=e.clientY,c=a.childNodes.length;for(let f=0;f<a.childNodes.length;f++){let g=a.childNodes[f];if(Ct(g)){let p=g.getBoundingClientRect();if(l<=(p.top+p.bottom)/2){c=f;break}}}s.setBaseAndExtent(a,c,a,c);let d=ka(i,s,n,e);d!==null?tn(d):s.removeAllRanges()}}ie(n,Ax,e)})}],["cut",er],["copy",er],["dragstart",er],["dragover",er],["dragend",er],["paste",er],["focus",er],["blur",er],["drop",er]];ya&&Ef.push(["beforeinput",(e,n)=>function(r,s){let i=r.inputType;if(i==="deleteCompositionText"||wo&&jC(s))return;if(i==="insertCompositionText")return;Hn(s,()=>{Zx(r,s)||ie(s,jf,r)},{event:r})}(e,n)]);var Tf=new WeakMap,yc=new WeakMap,FA=Vx((e)=>(e.addEventListener("selectionchange",N_),()=>e.removeEventListener("selectionchange",N_)));function Xx(e,n,r,s,i,a){let{anchor:l,focus:c}=e,d=l.getNode(),f=Ve(),g;if(a!==void 0)g=a;else{let y=Xn(Nn(f));g=y!==null?Yn(y,f._rootElement):null}let p=g!==null?g.anchorNode:null,h=l.key,x=f.getElementByKey(h),C=r.length;return h!==c.key||!te(d)||(!i&&(!ya||f._inputState.lastBeforeInputInsertTextTimeStamp<s+50)||d.isDirty()&&C<2||zC(r))&&l.offset!==c.offset&&!d.isComposing()||Wn(d)||d.isDirty()&&C>1||(i||!ya)&&x!==null&&!d.isComposing()&&p!==ir(d,x,f)||g!==null&&n!==null&&(!n.collapsed||n.startContainer!==g.anchorNode||n.startOffset!==g.anchorOffset)||!d.isComposing()&&(d.getFormat()!==e.format||d.getStyle()!==e.style)||function(y,N){if(N.isSegmented())return!0;if(!y.isCollapsed())return!1;let T=y.anchor.offset,b=N.getParentOrThrow(),v=Fa(N);return T===0?!N.canInsertTextBefore()||!b.canInsertTextBefore()&&!N.isComposing()||v||function(O){let k=O.getPreviousSibling();return(te(k)||j(k)&&k.isInline())&&!k.canInsertTextAfter()}(N):T===N.getTextContentSize()&&(!N.canInsertTextAfter()||!b.canInsertTextAfter()&&!N.isComposing()||v)}(e,d)}function x_(e,n){return xo(e)&&e.nodeValue!==null&&n!==0&&n!==e.nodeValue.length}function C_(e,n,r){let{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:l}=Yn(e,n._rootElement),c=n._inputState;c.isSelectionChangeFromDOMUpdate&&(c.isSelectionChangeFromDOMUpdate=!1,x_(s,i)&&x_(a,l)&&!c.postDeleteSelectionToRestore)||Hn(n,()=>{if(!r)return void tn(null);if(!Za(n,s,a))return;let d=Ue();if(c.postDeleteSelectionToRestore&&ge(d)&&d.isCollapsed()){let f=d.anchor,g=c.postDeleteSelectionToRestore.anchor;(f.key===g.key&&f.offset===g.offset+1||f.offset===1&&g.getNode().is(f.getNode().getPreviousSibling()))&&(d=c.postDeleteSelectionToRestore.clone(),tn(d))}if(c.postDeleteSelectionToRestore=null,ge(d)){let f=d.anchor,g=f.getNode();if(d.isCollapsed()){e.type==="Range"&&s===a&&(d.dirty=!0);let p=Nn(n).event,h=p?p.timeStamp:performance.now(),{format:x,style:C,offset:y,key:N,timeStamp:T}=c.collapsedSelectionFormat,b=Mn(),v=n.isComposing()===!1&&b.getTextContent()==="";if(h<T+200&&f.offset===y&&f.key===N)cc(d,x,C);else if(f.type==="text")te(g)||q(141),qx(d,g);else if(f.type==="element"&&!v){j(g)||q(259);let O=f.getNode();O.isEmpty()?function(k,M){let z=M.getTextFormat(),K=M.getTextStyle();cc(k,z,K)}(d,O):cc(d,d.format,"")}}else{let p=f.key,h=d.focus.key,x=d.getNodes(),C=x.length,y=d.isBackward(),N=y?l:i,T=y?i:l,b=y?h:p,v=y?p:h,O=2047,k=!1;for(let M=0;M<C;M++){let z=x[M],K=z.getTextContentSize();if(te(z)&&K!==0&&!(M===0&&z.__key===b&&N===K||M===C-1&&z.__key===v&&T===0)&&(k=!0,O&=z.getFormat(),O===0))break}d.format=k?O:0}}ie(n,Gf)})}function cc(e,n,r){e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}function qx(e,n){cc(e,n.getFormat(),n.getStyle())}function Jx(e){if(!e.getTargetRanges)return null;let n=e.getTargetRanges();return n.length===0?null:n[0]}function y_(e){let{lastKeyCode:n}=Ve()._inputState;if(e==null||e.length<=1||n==null)return;let r=n.length===1?n:n==="Enter"?`
|
|
5
|
-
`:n==="Tab"?"\t":null;if(!r)return;let s=
|
|
6
|
-
`){if(Io(l))l.selectEnd();else if(!l){let c=Er(i,
|
|
7
|
-
`)e.preventDefault(),ie(s,_a,!1);else if(l===ds)e.preventDefault(),ie(s,Nf);else if(l==null&&e.dataTransfer){let p=e.dataTransfer.getData("text/plain");e.preventDefault(),a.insertRawText(p)}else l!=null&&
|
|
8
|
-
`){let i=Ue();if(ge(i)||fi(i)){if(ge(i)){let a=i.focus;i.anchor.set(a.key,a.offset,a.type)}return ie(e,Cc,null),uc(r),!1}}let s=ot(r);if(s!==null&&te(s)&&Wn(s)){s.markDirty();let i=Ue(),a=s.getTextContentSize(),l=ge(i)&&i.anchor.key===r?i.anchor.offset:a;return s.select(l,l).insertText(n),!0}}return hg(!0,e,n),uc(r),!1}function UA(e){let n=Ve(),r=n._inputState;if(e.key==null)return!0;if(r.compositionPhase==="ending-safari"){let s=J_(e);if(s&&Hn(n,()=>{Sc(n,r.compositionEndData)}),r.compositionPhase="idle",r.compositionEndData="",s)return!0}if(function(s){return Qe(s,"ArrowRight",{shiftKey:"any"})}(e))ie(n,Rx,e);else if(function(s){return Qe(s,"ArrowRight",{...or,shiftKey:"any"})}(e))ie(n,Mx,e);else if(function(s){return Qe(s,"ArrowLeft",{shiftKey:"any"})}(e))ie(n,Dx,e);else if(function(s){return Qe(s,"ArrowLeft",{...or,shiftKey:"any"})}(e))ie(n,$x,e);else if(function(s){return Qe(s,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))ie(n,wx,e);else if(function(s){return Qe(s,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))ie(n,kx,e);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))r.isInsertLineBreak=!0,ie(n,Cc,e);else if(function(s){return s.key===" "}(e))ie(n,Ix,e);else if(function(s){return Bn&&Qe(s,"o",{ctrlKey:!0})}(e))e.preventDefault(),r.isInsertLineBreak=!0,ie(n,_a,!0);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))r.isInsertLineBreak=!1,ie(n,Cc,e);else if(function(s){return Qe(s,"Backspace",{shiftKey:"any"})||Bn&&Qe(s,"h",{ctrlKey:!0})}(e))J_(e)?ie(n,Lx,e)&&S_(r):(e.preventDefault(),ie(n,Aa,!0));else if(function(s){return s.key==="Escape"}(e))ie(n,Fx,e);else if(function(s){return Qe(s,"Delete",{})||Bn&&Qe(s,"d",{ctrlKey:!0})}(e))!function(s){return s.key==="Delete"}(e)?(e.preventDefault(),ie(n,Aa,!1)):ie(n,Px,e);else if(function(s){return Qe(s,"Backspace",q_)}(e))e.preventDefault(),ie(n,Ra,!0);else if(function(s){return Qe(s,"Delete",q_)}(e))e.preventDefault(),ie(n,Ra,!1);else if(function(s){return Bn&&Qe(s,"Backspace",{metaKey:!0})}(e))e.preventDefault(),ie(n,Ma,!0);else if(function(s){return Bn&&(Qe(s,"Delete",{metaKey:!0})||Qe(s,"k",{ctrlKey:!0}))}(e))e.preventDefault(),ie(n,Ma,!1);else if(function(s){return Qe(s,"b",or)}(e))e.preventDefault(),ie(n,Tr,"bold");else if(function(s){return Qe(s,"u",or)}(e))e.preventDefault(),ie(n,Tr,"underline");else if(function(s){return Qe(s,"i",or)}(e))e.preventDefault(),ie(n,Tr,"italic");else if(function(s){return Qe(s,"Tab",{shiftKey:"any"})}(e))ie(n,Bx,e);else if(function(s){return Qe(s,"z",or)}(e))e.preventDefault(),ie(n,Jf);else if(function(s){if(Bn)return Qe(s,"z",{metaKey:!0,shiftKey:!0});return Qe(s,"y",{ctrlKey:!0})||Qe(s,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),ie(n,Zf);else{let s=n._editorState._selection;!function(i){return Qe(i,"a",or)}(e)?s===null||ge(s)||(!function(i){return Qe(i,"c",or)}(e)?function(i){return Qe(i,"x",or)}(e)&&(e.preventDefault(),ie(n,tg,e)):(e.preventDefault(),ie(n,eg,e))):(e.preventDefault(),ie(n,Wx,e)&&S_(r))}return function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey}(e)&&n.dispatchCommand(Yx,e),!0}function Qx(e){let n=e.__lexicalEventHandles;return n===void 0&&(n=[],e.__lexicalEventHandles=n),n}var ai=new Map;function N_(e){let n=qC(e.target);if(n===null)return;let r=Hc(e.target),s=null,i=null,a=r!==null?yc.get(r):void 0;if(r!==null){if(a!==void 0){let{editors:p,hasShadowEditor:h}=a;if(h===void 0){h=!1;for(let x of p)if(x._rootElement!==null&&ar(x._rootElement.getRootNode())){h=!0;break}a.hasShadowEditor=h}if(h){let x=null,C=null;for(let y of p){let N=y._rootElement;if(N===null)continue;let T=Yn(n,N).anchorNode;if(T!==null&&fs(T)===y){if(ar(N.getRootNode())){s=y,i=T;break}x===null&&(x=y,C=T)}}s===null&&x!==null&&(s=x,i=C)}else{let x=n.anchorNode;x===null||Ct(x)&&x.shadowRoot!==null||(s=fs(x),s!==null&&(i=x))}}if(s===null){let p=ui(r);s=p!==null?fs(p):null}}if(s===null)return;if(s._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let p of a.editors)p._inputState.isSelectionChangeFromMouseDown=!1;Hn(s,()=>{let p=Ns(),h=i??Yn(n,s._rootElement).anchorNode;if(Ct(h)||xo(h))tn(ka(p,n,s,e))})}let l=pg(s),c=l[l.length-1],d=c._key,f=ai.get(d),g=f||c;g!==s&&C_(n,g,!1),C_(n,s,!0),s!==c?ai.set(d,s):f&&ai.delete(d)}function bf(e){e._lexicalHandled=!0}function E_(e){return e._lexicalHandled===!0}var T_=()=>{};function HA(e){let n=Tf.get(e);if(n===void 0)return void T_();let r=yc.get(n);if(r===void 0)return void T_();Tf.delete(e);let s=Qa(e);Uc(s)?(function(a){if(a._parentEditor!==null){let l=pg(a),c=l[l.length-1]._key;ai.get(c)===a&&ai.delete(c)}else ai.delete(a._key)}(s),r.editors.delete(s),r.hasShadowEditor=void 0,e.__lexicalEditor=null):s&&q(198);let i=Qx(e);for(let a=0;a<i.length;a++)i[a]();e.__lexicalEventHandles=[]}function vf(e,n,r){Wt();let s=e.__key,i=e.getParent();if(i===null)return void(Jt(e)!==null&&q(367,s,String(Jt(e))));let a=function(c){let d=Ue();if(!ge(d)||!j(c))return d;let{anchor:f,focus:g}=d,p=f.getNode(),h=g.getNode();return Pa(p,c)&&f.set(c.__key,0,"element"),Pa(h,c)&&g.set(c.__key,0,"element"),d}(e),l=!1;if(ge(a)&&n){let{anchor:c,focus:d}=a;c.key===s&&(Oc(c,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0),d.key===s&&(Oc(d,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0)}else fi(a)&&n&&e.isSelected()&&e.selectPrevious();if(ge(a)&&n&&!l){let c=e.getIndexWithinParent();zn(e),us(a,i,c,-1)}else zn(e);r||Rt(i)||i.canBeEmpty()||!i.isEmpty()||vf(i,n),n&&a&&Kt(i)&&i.isEmpty()&&i.selectEnd()}function WA(e){return e}var eC=Symbol.for("ephemeral");function Nc(e){return e[eC]||!1}var b_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class ln{__type;__key;__parent;__prev;__next;__state;[Ta];static getType(){let{ownNodeType:e}=tl(this);return e===void 0&&q(64,this.name),e}static clone(e){q(65,this.name)}$config(){return{}}config(e,n){let r=n.extends||fy(this.constructor);return Object.assign(n,{extends:r}),typeof e=="string"&&Object.assign(n,{type:e}),{[e]:n}}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",b_),Object.defineProperty(this,Ta,b_),PC(this,e)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let n=ot(e);if(n===null)break;e=n.__parent!==null?n.__parent:Jt(n)}return!1}isSelected(e){let n=e||Ue();if(n==null)return!1;let r=n.getNodes().some((s)=>s.__key===this.__key);if(te(this))return r;if(ge(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let s=this.getParent();if(qe(this)&&this.isInline()&&s){let i=n.isBackward()?n.focus:n.anchor;if(s.is(i.getNode())&&i.offset===s.getChildrenSize()&&this.is(s.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:ot(e)}getParentOrThrow(){let e=this.getParent();return e===null&&q(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(Rt(n)||Jt(e)!==null)return j(e)||e===this&&qe(e)||q(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&q(67,this.__key),e}getParents(){let e=[],n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){let e=[],n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:ot(e)}getPreviousSiblings(){let e=[],n=this.getParent();if(n===null)return e;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ot(e)}getNextSiblings(){let e=[],n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){let n=j(this)?this:this.getParent(),r=j(e)?e:e.getParent(),s=n&&r?Ic(n,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let n=Ic(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?kg(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(e){return Pa(e,this)}getNodesBetween(e){let n=this.isBefore(e),r=[],s=new Set,i=this;for(;i!==null;){let a=i.__key;if(s.has(a)||(s.add(a),r.push(i)),i===e)break;let l=j(i)?n?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}let c=n?i.getNextSibling():i.getPreviousSibling();if(c!==null){i=c;continue}let d=i.getParentOrThrow();if(s.has(d.__key)||r.push(d),d===e)break;let f=null,g=d;do{if(g===null&&q(68),f=n?g.getNextSibling():g.getPreviousSibling(),g=g.getParent(),g===null)break;f!==null||s.has(g.__key)||r.push(g)}while(f===null);i=f}return n||r.reverse(),r}isDirty(){let e=Ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Nc(this))return this;let e=ot(this.__key);return e===null&&q(113),e}getWritable(){if(Nc(this))return this;Wt();let e=Po(),n=Ve(),r=e._nodeMap,s=this.__key,i=this.getLatest(),a=n._cloneNotNeeded,l=Ue();if(l!==null&&l.setCachedNodes(null),a.has(s))return $c(i),i;let c=bg(i);return a.add(s),$c(c),r.set(s,c),c}getTextContent(){return _y(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){q(70)}updateDOM(e,n,r){q(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){q(18,this.name)}updateFromJSON(e){return function(n,r){let s=n.getWritable(),i=r.$,a=i;for(let l of Cx(s).flatKeys)l in r&&(a!==void 0&&a!==i||(a={...i}),a[l]=r[l]);return(s.__state||a)&&Wf(n).updateFromJSON(a),s}(this,e)}static transform(){return null}remove(e){vf(this,!0,e)}replace(e,n){Wt();let r=Ue();r!==null&&(r=r.clone()),cf(this,e);let s=this.getLatest(),i=this.__key,a=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),d=c.__size,f=l.getParent(),g=f!==null?l.getIndexWithinParent():-1;zn(l),f!==null&&ge(r)&&us(r,f,g,-1);let p=s.getPreviousSibling(),h=s.getNextSibling(),{__prev:x,__next:C,__parent:y}=s;if(vf(s,!1,!0),p===null)c.__first=a;else p.getWritable().__next=a;if(l.__prev=x,h===null)c.__last=a;else h.getWritable().__prev=a;l.__next=C,l.__parent=y,c.__size=d;let N=0;n&&(j(this)&&j(l)||q(139),N=l.getChildrenSize(),l.splice(N,0,this.getChildren()));let T=Gn(this);if(T.length>0){Do(this)&&Do(l)||q(368,this.__key,l.__key);for(let b of T){let v=$r(this,b);v!==null&&(xy(this,b),Og(l,b,v))}}if(ge(r)){tn(r);let b=r.anchor,v=r.focus;b.key===i&&(n&&b.type==="element"?b.set(l.__key,N+b.offset,"element"):R_(b,l)),v.key===i&&(n&&v.type==="element"?v.set(l.__key,N+v.offset,"element"):R_(v,l))}return Mo()===i&&Bt(a),l}insertAfter(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();sx(this.getParentOrThrow());let i=s.getParent(),a=Ue(),l=!1,c=!1;if(i!==null){let h=e.getIndexWithinParent();if(ge(a)){let x=i.__key,{anchor:C,focus:y}=a;l=C.type==="element"&&C.key===x&&C.offset===h+1,c=y.type==="element"&&y.key===x&&y.offset===h+1}zn(s),n&&ge(a)&&us(a,i,h,-1)}else zn(s);let d=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),g=s.__key,p=r.__next;if(d===null)f.__last=g;else d.getWritable().__prev=g;if(f.__size++,r.__next=g,s.__next=p,s.__prev=r.__key,s.__parent=r.__parent,n&&ge(a)){let h=this.getIndexWithinParent();us(a,f,h+1);let x=f.__key;l&&a.anchor.set(x,h+2,"element"),c&&a.focus.set(x,h+2,"element")}return e}insertBefore(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();sx(this.getParentOrThrow());let i=s.__key,a=Ue(),l=s.getParent(),c=l!==null?s.getIndexWithinParent():-1;zn(s),l!==null&&n&&ge(a)&&us(a,l,c,-1);let d=this.getPreviousSibling(),f=this.getParentOrThrow().getWritable(),g=r.__prev,p=this.getIndexWithinParent();if(d===null)f.__first=i;else d.getWritable().__next=i;if(f.__size++,r.__prev=i,s.__prev=g,s.__next=r.__key,s.__parent=r.__parent,n&&ge(a))us(a,this.getParentOrThrow(),p);return e}isParentRequired(){return!1}createParentElementNode(){return Rn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){Wt();let r=Un(this);if(r!==null)return r.selectPrevious(e,n);let s=this.getPreviousSibling(),i=this.getParentOrThrow();if(s===null)return i.select(0,0);if(j(s))return s.select();if(!te(s)){let a=s.getIndexWithinParent()+1;return i.select(a,a)}return s.select(e,n)}selectNext(e,n){Wt();let r=Un(this);if(r!==null)return r.selectNext(e,n);let s=this.getNextSibling(),i=this.getParentOrThrow();if(s===null)return i.select();if(j(s))return s.select(0,0);if(!te(s)){let a=s.getIndexWithinParent();return i.select(a,a)}return s.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}}function og(e){return e instanceof ln}var GA="historic",jA="history-push",dc="history-merge",YA="paste",VA="cut",tC="collaboration",XA="skip-collab",nC="skip-scroll-into-view",oC="skip-dom-selection",Ec="skip-selection-focus",rC="composition-start",Tc="composition-end",qA="!important";function Of(e){let n={};if(!e)return n;let r="",s="",i=null,a=!1,l=!1,c=!1,d=0,f=e.length,g=-1;for(let x=0;x<f;x++){let C=e[x];if(a)C==="*"&&e[x+1]==="/"&&(a=!1,x++);else if(l)g===-1&&(g=x),l=!1;else if(i===null)if(C!=="/"||e[x+1]!=="*")if(C!=='"'&&C!=="'")if(C!=="(")if(C!==")")if(c||C!==":"||d!==0){if(C===";"&&d===0){g!==-1&&(c?s+=e.slice(g,x):r+=e.slice(g,x),g=-1);let y=r.trim(),N=s.trim();y!==""&&N!==""&&(n[y]=N),r="",s="",c=!1;continue}g===-1&&(g=x)}else g!==-1&&(r+=e.slice(g,x),g=-1),c=!0;else g===-1&&(g=x),d=Math.max(0,d-1);else g===-1&&(g=x),d++;else g===-1&&(g=x),i=C;else g!==-1&&(c?s+=e.slice(g,x):r+=e.slice(g,x),g=-1),a=!0,x++;else g===-1&&(g=x),C==="\\"?l=!0:C===i&&(i=null)}g!==-1&&(c?s+=e.slice(g,f):r+=e.slice(g,f));let p=r.trim(),h=s.trim();return p!==""&&h!==""&&(n[p]=h),n}function sC(e,n,r){let s=r.trimEnd(),i=s.length-10;i>=0&&s.slice(i).toLowerCase()===qA?e.setProperty(n,s.slice(0,i).trim(),"important"):e.setProperty(n,r,"")}function JA(e,n){for(let r in n){let s=n[r];s==null?e.removeProperty(r):sC(e,r,s)}}function Af(e,n,r=""){if(n===r)return;let s=Of(r),i=Of(n);for(let a in i)delete s[a],sC(e,a,i[a]);for(let a in s)e.removeProperty(a)}function ef(e,n){return 16&n?"code":n&Kf?"mark":32&n?"sub":64&n?"sup":null}function tf(e,n){return 1&n?"strong":2&n?"em":"span"}function iC(e,n,r,s,i){let a=s.classList,l=li(i,"base");l!==void 0&&a.add(...l),l=li(i,"underlineStrikethrough");let c=!1,d=8&n&&4&n;l!==void 0&&(8&r&&4&r?(c=!0,d||a.add(...l)):d&&a.remove(...l));for(let f in Xt){let g=Xt[f];if(l=li(i,f),l!==void 0)if(r&g){if(c&&(f==="underline"||f==="strikethrough")){n&g&&a.remove(...l);continue}((n&g)===0||d&&f==="underline"||f==="strikethrough")&&a.add(...l)}else n&g&&a.remove(...l)}}function aC(e,n,r){let s=r.isComposing(),i=e+(s?Na:""),a=Co(),l=Tg(a).$getDOMSlot(r,n,a),c=l.getFirstChild();if(c===null||c.nodeType!==Node.TEXT_NODE)return void l.insertChild(Sn().createTextNode(i));let d=c,f=d.nodeValue;if(f!==i)if(s||wo){let[g,p,h]=function(x,C){let y=x.length,N=C.length,T=0,b=0;for(;T<y&&T<N&&x[T]===C[T];)T++;for(;b+T<y&&b+T<N&&x[y-b-1]===C[N-b-1];)b++;return[T,y-T-b,C.slice(T,N-b)]}(f,i);p!==0&&d.deleteData(g,p),d.insertData(g,h)}else d.nodeValue=i}function v_(e,n,r,s,i,a){aC(i,e,n);let l=a.theme.text;l!==void 0&&iC(0,0,s,e,l)}function sc(e,n){let r=Sn().createElement(n);return r.appendChild(e),r}function bc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends ln{__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:tr,priority:0}),em:()=>({conversion:tr,priority:0}),i:()=>({conversion:tr,priority:0}),mark:()=>({conversion:tr,priority:0}),s:()=>({conversion:tr,priority:0}),span:()=>({conversion:ZA,priority:0}),strong:()=>({conversion:tr,priority:0}),sub:()=>({conversion:tr,priority:0}),sup:()=>({conversion:tr,priority:0}),u:()=>({conversion:tr,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="",n){super(n),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 fA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Mo()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let n=Xt[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return Mr(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){let r=this.__format,s=ef(0,r),i=tf(0,r),a=s===null?i:s,l=Sn().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Sn().createElement(i),l.appendChild(c)),v_(c,this,0,r,this.__text,e);let d=this.__style;return d!==""&&Af(l.style,d),l}updateDOM(e,n,r){let s=this.__text,i=e.__format,a=this.__format,l=ef(0,i),c=ef(0,a),d=tf(0,i),f=tf(0,a);if((l===null?d:l)!==(c===null?f:c))return!0;if(l===c&&d!==f){let C=n.firstChild;C==null&&q(48);let y=Sn().createElement(f);return v_(y,this,0,a,s,r),n.replaceChild(y,C),!1}let g=n;c!==null&&l!==null&&(g=n.firstChild,g==null&&q(49)),aC(s,g,this);let p=r.theme.text;p!==void 0&&i!==a&&iC(0,i,a,g,p);let h=e.__style,x=this.__style;return h!==x&&Af(n.style,x,h),!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:n}=super.exportDOM(e);return Ct(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=sc(n,"b")),this.hasFormat("italic")&&(n=sc(n,"i")),this.hasFormat("strikethrough")&&(n=sc(n,"s")),this.hasFormat("underline")&&(n=sc(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Xt[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?cA[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=Mr(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let n=dA[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){Wt();let r=e,s=n,i=Ue(),a=this.getTextContent(),l=this.__key;if(typeof a=="string"){let c=a.length;r===void 0&&(r=c),s===void 0&&(s=c)}else r=0,s=0;if(!ge(i))return yC(l,r,l,s,"text","text");{let c=Mo();c!==i.anchor.key&&c!==i.focus.key||Bt(l),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,s){let i=this.getWritable(),a=i.__text,l=r.length,c=e;c<0&&(c=l+c,c<0&&(c=0));let d=Ue();if(s&&ge(d)){let g=e+l;d.setTextNodeRange(i,g,i,g)}let f=a.slice(0,c)+r+a.slice(c+n);return i.__text=f,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Wt();let n=this.getLatest(),r=n.getTextContent();if(r==="")return[];let s=n.__key,i=Mo(),a=r.length;e.sort((z,K)=>z-K),e.push(a);let l=[],c=e.length;for(let z=0,K=0;z<a&&K<=c;K++){let U=e[K];U>z&&(l.push(r.slice(z,U)),z=U)}let d=l.length;if(d===1)return[n];let f=l[0],g=n.getParent(),p,h=n.getFormat(),x=n.getStyle(),C=n.__detail,y=!1,N=null,T=null,b=Ue();if(ge(b)){let[z,K]=b.isBackward()?[b.focus,b.anchor]:[b.anchor,b.focus];z.type==="text"&&z.key===s&&(N=z),K.type==="text"&&K.key===s&&(T=K)}n.isSegmented()?(p=Cn(f),p.__format=h,p.__style=x,p.__detail=C,p.__state=l_(n,p),y=!0):p=n.setTextContent(f);let v=[p];for(let z=1;z<d;z++){let K=Cn(l[z]);K.__format=h,K.__style=x,K.__detail=C,K.__state=l_(n,K);let U=K.__key;i===s&&Bt(U),v.push(K)}let O=N?N.offset:null,k=T?T.offset:null,M=0;for(let z of v){if(!N&&!T)break;let K=M+z.getTextContentSize();if(N!==null&&O!==null&&O<=K&&O>=M&&(N.set(z.getKey(),O-M,"text"),O<K&&(N=null)),T!==null&&k!==null&&k<=K&&k>=M){T.set(z.getKey(),k-M,"text");break}M=K}if(g!==null){(function(U){let J=U.getPreviousSibling(),W=U.getNextSibling();J!==null&&$c(J),W!==null&&$c(W)})(this);let z=g.getWritable(),K=this.getIndexWithinParent();y?(z.splice(K,0,v),this.remove()):z.splice(K,1,v),ge(b)&&us(b,g,K,d-1)}return v}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||q(50);let r=this.__key,s=e.__key,i=this.__text,a=i.length;Mo()===s&&Bt(r);let l=Ue();if(ge(l)){let{anchor:g,focus:p}=l;g!==null&&g.key===s&&P_(g,n,r,e,a),p!==null&&p.key===s&&P_(p,n,r,e,a)}let c=e.__text,d=n?c+i:i+c;this.setTextContent(d);let f=this.getWritable();return e.remove(),f}isTextEntity(){return!1}}function ZA(e){return{forChild:rg(e.style),node:null}}function QA(e){let n=e,r=n.style.fontWeight==="normal";return{forChild:rg(n.style,r?void 0:"bold"),node:null}}var O_=new WeakMap;function eR(e){if(!Ct(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function tR(e){let n=e;e.parentElement===null&&q(129);let r=n.textContent||"";if(function(s){let i,a=s.parentNode,l=[s];for(;a!==null&&(i=O_.get(a))===void 0&&!eR(a);)l.push(a),a=a.parentNode;let c=i===void 0?a:i;for(let d=0;d<l.length;d++)O_.set(l[d],c);return c}(n)!==null)return{node:ig(r)};if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),r==="")return{node:null};if(r[0]===" "){let s=n,i=!0;for(;s!==null&&(s=A_(s,!1))!==null;){let a=s.textContent||"";if(a.length>0){/[ \t\n]$/.test(a)&&(r=r.slice(1)),i=!1;break}}i&&(r=r.slice(1))}if(r[r.length-1]===" "){let s=n,i=!0;for(;s!==null&&(s=A_(s,!0))!==null;)if((s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(r=r.slice(0,r.length-1))}return r===""?{node:null}:{node:Cn(r)}}function A_(e,n){let r=e;for(;;){let s;for(;(s=n?r.nextSibling:r.previousSibling)===null;){let a=r.parentElement;if(a===null)return null;r=a}if(r=s,Ct(r)){let a=r.style.display;if(a===""&&!sy(r)||a!==""&&!a.startsWith("inline"))return null}let i=r;for(;(i=n?r.firstChild:r.lastChild)!==null;)r=i;if(xo(r))return r;if(r.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 tr(e){let n=nR[e.nodeName.toLowerCase()];return n===void 0?{node:null}:{forChild:rg(e.style,n),node:null}}function Cn(e=""){return el(new ms(e))}function te(e){return e instanceof ms}function rg(e,n){let r=e.fontWeight,s=e.textDecoration.split(" "),i=r==="700"||r==="bold",a=s.includes("line-through"),l=e.fontStyle==="italic",c=s.includes("underline"),d=e.verticalAlign;return(f)=>te(f)||bc(f)?(i&&!f.hasFormat("bold")&&f.toggleFormat("bold"),a&&!f.hasFormat("strikethrough")&&f.toggleFormat("strikethrough"),l&&!f.hasFormat("italic")&&f.toggleFormat("italic"),c&&!f.hasFormat("underline")&&f.toggleFormat("underline"),d!=="sub"||f.hasFormat("subscript")||f.toggleFormat("subscript"),d!=="super"||f.hasFormat("superscript")||f.toggleFormat("superscript"),n&&!f.hasFormat(n)&&f.toggleFormat(n),f):f}class ja extends ms{$config(){return this.config("tab",{extends:ms})}constructor(e=void 0){super("\t",e),this.__detail=2}createDOM(e){let n=super.createDOM(e),r=li(e.theme,"tab");if(r!==void 0)n.classList.add(...r);return n}setTextContent(e){return super.setTextContent("\t")}spliceText(e,n,r,s){return r===""&&n===0||r==="\t"&&n===1||q(286),this}setDetail(e){return e!==2&&q(127),this}setMode(e){return e!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function lC(){return el(new ja)}function sg(e){return e instanceof ja}class cC{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}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($o(Fr(this,"next")),$o(Fr(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&q(20),e}set(e,n,r,s){let i=this._selection,a=this.key;s&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,Rr()||(Mo()===a&&Bt(e),i!==null&&(i.setCachedNodes(null),ge(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function _o(e,n,r){return new cC(e,n,r)}function nf(e,n){let r=n.__key,s=e.offset,i="element";if(te(n)){i="text";let a=n.getTextContentSize();s>a&&(s=a)}else if(!j(n)){let a=n.getNextSibling();if(te(a))r=a.__key,s=0,i="text";else{let l=n.getParent();l&&(r=l.__key,s=n.getIndexWithinParent()+1)}}e.set(r,s,i)}function R_(e,n){if(j(n)){let r=n.getLastDescendant();j(r)||te(r)?nf(e,r):nf(e,n)}else nf(e,n)}function M_(e,n,r,s){let i=e.getNode(),a=i.getChildAtIndex(e.offset),l=Cn();if(l.setFormat(r),l.setStyle(s),wC(a))a.splice(0,0,[l]);else if(a!==null){let c=Rt(i)?Rn().append(l):l;a.insertBefore(c)}else if(Rt(i)){let c=i.getLastChild();j(c)&&!c.isInline()&&c.isEmpty()?c.append(l):i.append(Rn().append(l))}else i.append(l);e.is(n)&&n.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function D_(e,n,r,s){let i=e.anchor.getNode();te(i)||q(398);let a=e.anchor.offset,l=Cn(n);l.setFormat(r),l.setStyle(s);let c=i.getParentOrThrow();if(a===0)c.isInline()&&!i.__prev?c.insertBefore(l):i.insertBefore(l,!1);else if(a===i.getTextContentSize())c.isInline()&&!i.__next?c.insertAfter(l):i.insertAfter(l,!1);else{let[d]=i.splitText(a);d.insertAfter(l,!1)}i.getTextContent()===""&&i.isAttached()&&i.remove(),l.selectEnd(),l.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-n.length,e.anchor.type)}class Fc{_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 n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).every((s)=>r.has(s))}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 Fc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let n=this.getNodes().filter((a)=>Jt(a)===null),r=n.length;if(r===0)return;let s=n[r-1],i;if(te(s))i=s.select();else{let a=s.getIndexWithinParent()+1;i=s.getParentOrThrow().select(a,a)}i.insertNodes(e);for(let a=0;a<r;a++)n[a].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=this._nodes,r=[];for(let s of n){let i=ot(s);i!==null&&r.push(i)}return Rr()||(this._cachedNodes=r),r}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){let e=this.getNodes().filter((n)=>Jt(n)===null);if((Ue()||Ns())===this&&e[0]){let n=St(e[0],"next");Ny(Lr(n,n))}for(let n of e)n.remove();uC()}}function uC(){let e=Mn();if(e.isEmpty()){let n=Rn();e.append(n),n.select()}}function ge(e){return e instanceof Ss}class Ss{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,n,r,s){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!ge(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 n=function(r){let s=[],[i,a]=r.getTextSlices();i&&s.push(i.caret.origin);let l=new Set,c=new Set;for(let d of r)if(jn(d)){let{origin:f}=d;s.length===0?l.add(f):(c.add(f),s.push(f))}else{let{origin:f}=d;j(f)&&c.has(f)||s.push(f)}if(a&&s.push(a.caret.origin),wr(r.focus)&&j(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let d=lr(r.focus.origin,"previous");jn(d)&&l.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(s[s.length-1]);d=di(d))l.delete(d.origin),s.pop();for(;s.length>1;){let d=s[s.length-1];if(!j(d)||c.has(d)||d.isEmpty()||l.has(d))break;s.pop()}if(s.length===0&&r.isCollapsed()){let d=$o(r.anchor),f=$o(r.anchor.getFlipped()),g=(h)=>ho(h)?h.origin:h.getNodeAtCaret(),p=g(d)||g(f)||(r.anchor.getNodeAtCaret()?d.origin:f.origin);s.push(p)}return s}(Ig(Ff(this),"next"));return Rr()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,s){return this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,s,"text"),this}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let n=e[0],r=e[e.length-1],s=this.anchor,i=this.focus,a=s.isBefore(i),[l,c]=Rf(this),d="",f=!0;for(let g=0;g<e.length;g++){let p=e[g];if(j(p)&&!p.isInline()){f||(d+=`
|
|
9
|
-
`);let h="";for(let x of Gn(p)){let C=$r(p,x);C!==null&&(h+=C.getTextContent())}h!==""?(d+=h,f=!1):f=!p.isEmpty()}else if(f=!1,te(p)){let h=p.getTextContent();p===n?p===r?s.type==="element"&&i.type==="element"&&i.offset!==s.offset||(h=l<c?h.slice(l,c):h.slice(c,l)):h=a?h.slice(l):h.slice(c):p===r&&(h=a?h.slice(0,c):h.slice(0,l)),d+=h}else!qe(p)&&!Io(p)||p===r&&this.isCollapsed()||(d+=p.getTextContent())}return d}applyDOMRange(e){let n=Ve(),r=n.getEditorState()._selection,s=xC(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(s===null)return;let[i,a,l]=s;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),l&&(this.dirty=!0),ni(this)}clone(){let e=this.anchor,n=this.focus;return new Ss(_o(e.key,e.offset,e.type),_o(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Mr(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 n=Xt[e];return(this.format&n)!==0}insertRawText(e){this.insertNodes(ig(e))}insertText(e){let n=this.format,r=this.style;if(!this.isCollapsed()){let g=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(te(g)&&(n=g.getFormat(),r=g.getStyle()),this.removeText(),this.format=n,this.style=r,e==="")return;if(Mo()===null)return this.anchor.type==="element"&&M_(this.anchor,this.focus,n,r),void D_(this,e,n,r)}this.anchor.type==="element"&&M_(this.anchor,this.focus,n,r);let s=this.anchor.getNode();te(s)||q(398);let i=this.anchor.offset,a=s.getParentOrThrow(),l=s.getTextContentSize();if(Wn(s)||i===0&&(!s.canInsertTextBefore()||!a.canInsertTextBefore()&&!s.__prev)||i===l&&(!s.canInsertTextAfter()||!a.canInsertTextAfter()&&!s.__next)){if(s.isSegmented()&&i!==0&&i!==l){if(Mo()!==null)s.setMode("normal").setFormat(n).setStyle(r);else{let p=Cn(s.getTextContent());p.setFormat(n),p.setStyle(r),s.replace(p),p.select(i,i)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(i===0){let p=s.getPreviousSibling();if(te(p)&&p.canInsertTextAfter()&&!Wn(p))p.select();else{let h=Cn();h.setFormat(n),h.setStyle(r),a.canInsertTextBefore()?s.insertBefore(h):a.insertBefore(h),h.select()}return void this.insertText(e)}if(i===l){let p=s.getNextSibling();if(te(p)&&p.canInsertTextBefore()&&!Wn(p))p.select(0,0);else{let h=Cn();h.setFormat(n),h.setStyle(r),a.canInsertTextAfter()?s.insertAfter(h):a.insertAfter(h),h.select(0,0)}return void this.insertText(e)}let g=Cn(e);return g.setFormat(n),g.setStyle(r),s.replace(g),void g.select()}if(e==="")return;let c=a.isInline()&&i===0&&!s.__prev,d=a.isInline()&&i===l&&!s.__next,f=s.getFormat()!==n||s.getStyle()!==r;if(c||d||f){if(s.getTextContent()!==""||c||d)return void D_(this,e,n,r);s.setFormat(n),s.setStyle(r)}s.spliceText(i,0,e,!0),s.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=Ue()===this;Ca(this,Ey(Ff(this))),e&&Ue()!==this&&tn(this)}formatText(e,n=null){fC(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&j(n)&&Jt(n)!==null){let C=n.isShadowRoot()?n.getFirstChild()??n.append(Rn()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&C!==null&&!j(C)){let y=Rn();C.insertBefore(y),C=y}if(C!==null){C.selectStart();let y=Ue();return ge(y)||q(369),y.insertNodes(e)}}if(this.anchor.type==="element"&&Rt(n)){let C=rf(e),y=C.getLastDescendant();return n.splice(this.anchor.offset,0,C.getChildren()),void(y!==null&&y.selectEnd())}let r=(this.isBackward()?this.focus:this.anchor).getNode(),s=Er(r,xn),i=e[e.length-1];if(j(s)&&"__language"in s){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let C=fa(this);s.splice(C,0,e),i.selectEnd()}return}if(!e.some((C)=>(j(C)||qe(C))&&!C.isInline())){j(s)||q(211,r.constructor.name,r.getType());let C=fa(this);return s.splice(C,0,e),void i.selectEnd()}if(j(s)&&Jt(s)!==null){let C=fa(this),y=Df(e);s.splice(C,0,y);let N=y[y.length-1];return void(N!==void 0?N.selectEnd():s.select(C,C))}if(s===null){let C=rf(e),y=C.getLastDescendant(),N=Fr(this.anchor,"next");for(let T of C.getChildren())N=Oy(T,N);return void(y!==null&&y.selectEnd())}if(j(s)&&!s.isParentRequired()&&!Rt(s.getParentOrThrow())){let C=fa(this),y=Df(e);s.splice(C,0,y);let N=y[y.length-1];return void(N!==void 0?N.selectEnd():s.select(C,C))}let a=rf(e),l=a.getLastDescendant(),c=a.getChildren(),d=!j(s)||!s.isEmpty()?this.insertParagraph():null;d&&!s.isAttached()&&(r=this.anchor.getNode(),s=Er(r,xn));let f=c[c.length-1],g=c[0];var p;j(p=g)&&xn(p)&&!p.isEmpty()&&j(s)&&(!s.isEmpty()||s.canMergeWhenEmpty())&&(j(s)||q(211,r.constructor.name,r.getType()),s.append(...g.getChildren()),g=c[1]),g&&(s===null&&q(212,r.constructor.name,r.getType()),function(C,y){let N=y.getParentOrThrow().getLastChild(),T=y,b=[y];for(;T!==N;)T.getNextSibling()||q(140),T=T.getNextSibling(),b.push(T);let v=C;for(let O of b)v=v.insertAfter(O)}(s,g));let h=Er(l,xn);d&&j(h)&&(d.canMergeWhenEmpty()||xn(f))&&(h.append(...d.getChildren()),d.remove()),j(s)&&s.isEmpty()&&s.remove(),l.selectEnd();let x=j(s)?s.getLastChild():null;Io(x)&&h!==s&&x.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&Rt(e)){let l=Rn();return e.splice(this.anchor.offset,0,[l]),l.select(),l}let n=fa(this),r=Er(this.anchor.getNode(),xn);if(r!==null&&Jt(r)!==null)return null;j(r)||q(213);let s=r.getChildAtIndex(n),i=s?[s,...s.getNextSiblings()]:[],a=r.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let n=Bc();if(this.insertNodes([n]),e){let r=n.getParentOrThrow(),s=n.getIndexWithinParent();r.select(s,s)}}extract(){let e=[...this.getNodes()],n=e.length,r=e[0],s=e[n-1],[i,a]=Rf(this),l=this.isBackward(),[c,d]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[f,g]=l?[a,i]:[i,a];if(n===0)return[];if(n===1){if(te(r)&&!this.isCollapsed()){let p=r.splitText(f,g),h=f===0?p[0]:p[1];return h?(c.set(h.getKey(),0,"text"),d.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(te(r)&&(f===r.getTextContentSize()?e.shift():f!==0&&([,r]=r.splitText(f),e[0]=r,c.set(r.getKey(),0,"text"))),te(s)){let p=s.getTextContent().length;g===0?e.pop():g!==p&&([s]=s.splitText(g),e[e.length-1]=s,d.set(s.getKey(),s.getTextContentSize(),"text"))}return e}modify(e,n,r){if(Rc(this,e,n,r))return;let s=e==="move",i=Ve(),a=Xn(Nn(i));if(!a)return;let{_blockCursorElement:l,_rootElement:c}=i,d=this.focus.getNode();c===null||l===null||!j(d)||d.isInline()||d.canBeEmpty()||wc(l,i,c);let f=ci(i,this.focus.key),g=f;if(this.focus.type==="text"&&(g=te(d)?ir(d,f,i):null),this.dirty){let p=ci(i,this.anchor.key),h=p;if(this.anchor.type==="text"){let x=this.anchor.getNode();h=te(x)?ir(x,p,i):null}h&&g&&Ac(a,h,this.anchor.offset,g,this.focus.offset)}if(r==="character"&&te(d)&&d.isUnmergeable()){if(n?this.focus.offset===0:this.focus.offset===d.getTextContentSize()){let p=St(d,n?"previous":"next").getNodeAtCaret();if(te(p)){if(!s){let h=p.getTextContentSize();return n?this.focus.set(p.__key,h-1,"text"):this.focus.set(p.__key,1,"text"),void(this.dirty=!0)}{let h=i.getElementByKey(p.getKey()),x=h?ir(p,h,i):null;if(x){let C=n?x.length:0;Ac(a,x,C,x,C)}}}}}if(pC(a,e,n?"backward":"forward",r),a.rangeCount>0){let p=mi(a,i._rootElement),h=p||a.getRangeAt(0),x=this.anchor.getNode(),C=Kt(x)?x:Cg(x);if(this.applyDOMRange(h),this.dirty=!0,!s)hC(this,n,C),(p?a.direction!=="backward":a.anchorNode===h.startContainer&&a.anchorOffset===h.startOffset)||gC(this)}r==="lineboundary"&&Rc(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&j(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){let s=n.getParent(),i=n.getNextSibling()||(s===null?null:s.getNextSibling());if(j(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){let r=this.anchor,s=r.getNode();if(this.forwardDeletion(r,s,e))return;let i=Dg(Fr(r,e?"previous":"next"));if(i.getTextSlices().every((l)=>l===null||l.distance===0)){let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(jn(c))if(c.origin.isInline());else{if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(j(i.anchor.origin)&&i.anchor.origin.isEmpty()){let d=$o(c);Ca(this,Lr(d,d)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:c,type:"merge-block"})}else{if(l.type==="merge-block")break;if(wr(c)){if(j(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else l={block:c.origin,type:"merge-next-block"};continue}if(qe(c.origin)){if(c.origin.isIsolated());else if(Gn(c.origin).length>0){if(j(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=vc();d.add(c.origin.getKey()),tn(d)}}else if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&j(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=vc();d.add(c.origin.getKey()),tn(d)}else c.origin.remove();return}break}}if(l.type==="merge-block"){let{caret:c,block:d}=l;if(Gn(d).length>0)return;return c.origin.isEmpty()&&!d.isEmpty()&&c.origin.getParent()===d.getParent()?void c.origin.remove(!0):(Ca(this,Lr(!c.origin.isEmpty()&&d.isEmpty()?Ts(St(d,c.direction)):i.anchor,c)),this.removeText())}for(let c=r.getNode();c!==null;){if(Jt(c)!==null)return;if(j(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(of(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&w_(this,r.getNode()))return}else{let l=a.type==="text"?a.getNode():null;if(s=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){let c=a.offset,d=l.getTextContentSize();if(l.is(s)||e&&c!==d||!e&&c!==0)return void k_(l,e,c)}else if(s!==null&&s.isSegmented()){let c=r.offset,d=s.getTextContentSize();if(s.is(l)||e&&c!==0||!e&&c!==d)return void k_(s,e,c)}(function(c,d){let{anchor:f,focus:g}=c,p=f.getNode(),h=g.getNode();if(p===h&&f.type==="text"&&g.type==="text"){let x=f.offset,C=g.offset,y=x<C,N=y?x:C,T=y?C:x,b=T-1;if(N!==b)(function(v){return!(zC(v)||rR(v))})(p.getTextContent().slice(N,T))&&(d?g.set(g.key,b,g.type):f.set(f.key,b,f.type))}})(this,e)}}if(this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let r=this.anchor.getNode();r.isEmpty()&&Kt(r.getParent())&&r.getPreviousSibling()===null&&w_(this,r),uC()}}deleteLine(e){let n=Mf(this.anchor);if(n!==null&&qe(Un(n)))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 Er(this.anchor.getNode(),xn)!==Er(this.focus.getNode(),xn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,e))return;of(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let n=this.focus.isBefore(this.anchor);return Rr()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function fi(e){return e instanceof Fc}function dC(e,n){if(fi(e)){for(let T of e.getNodes())bc(T)&&T.setFormat(n(T.getFormat()));return}if(e.isCollapsed())return e.setFormat(n(e.format)),void Bt(null);let r=[];for(let T of e.getNodes())te(T)?r.push(T):j(T)?T.setTextFormat(n(T.getTextFormat())):bc(T)&&T.setFormat(n(T.getFormat()));let s=r.length;if(s===0)return e.setFormat(n(e.format)),void Bt(null);let{anchor:i,focus:a}=e,l=e.isBackward(),c=l?a:i,d=l?i:a,f=0,g=r[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===g.getTextContentSize()&&(f=1,g=r[1],p=0),g==null)return;let h=s-1,x=r[h],C=d.type==="text"?d.offset:x.getTextContentSize();if(g.is(x)){if(p===C)return;let T=n(g.getFormat());if(Wn(g)||p===0&&C===g.getTextContentSize())g.setFormat(T);else{let b=g.splitText(p,C),v=p===0?b[0]:b[1];v.setFormat(T),c.type==="text"&&c.set(v.__key,0,"text"),d.type==="text"&&d.set(v.__key,C-p,"text")}return void(e.format=T)}p===0||Wn(g)||([,g]=g.splitText(p),p=0);let y=n(g.getFormat());g.setFormat(y);let N=n(x.getFormat());C>0&&(C===x.getTextContentSize()||Wn(x)||([x]=x.splitText(C)),x.setFormat(N));for(let T=f+1;T<h;T++){let b=r[T];b.setFormat(n(b.getFormat()))}c.type==="text"&&c.set(g.__key,p,"text"),d.type==="text"&&d.set(x.__key,C,"text"),e.format=y|N}function oR(e,n){let r=[];for(let[s,i]of Object.entries(n))typeof i=="boolean"&&r.push([s,i]);r.length!==0&&dC(e,(s)=>{for(let[i,a]of r)s=Mr(s,i,a?Xt[i]:0);return s})}function fC(e,n,r=null){let s=r===null&&ge(e)?Mr(e.format,n,null):r;dC(e,(i)=>Mr(i,n,s))}function $_(e){let n=e.offset;if(e.type==="text")return n;let r=e.getNode();return n===r.getChildrenSize()?r.getTextContent().length:0}function Rf(e){let n=e.getStartEndPoints();if(n===null)return[0,0];let[r,s]=n;return r.type==="element"&&s.type==="element"&&r.key===s.key&&r.offset===s.offset?[0,0]:[$_(r),$_(s)]}function w_(e,n){for(let r=n;r;r=r.getParent()){if(j(r)){if(r.collapseAtStart(e))return!0;if(Rt(r))break}if(r.getPreviousSibling())break}return!1}function gC(e){let{focus:n,anchor:r}=e,{key:s,offset:i,type:a}=r;r.set(n.key,n.offset,n.type,!0),n.set(s,i,a,!0)}function pC(e,n,r,s){e.modify(n,r,s)}function hC(e,n,r){let s=e.getNodes(),i=s.filter((c)=>Pa(c,r));if(i.length===0||i.length===s.length)return!1;let a=n?i[0]:i[i.length-1],l=j(a)?a:a.getParentOrThrow();return n?l.selectStart():l.selectEnd(),!0}function of(e,n,r){if(Rc(e,"extend",n,r))return;let s=Ve(),i=Xn(Nn(s));if(!i||typeof i.modify!="function")return;let{_blockCursorElement:a,_rootElement:l}=s,c=e.anchor,d=e.focus.getNode();l===null||a===null||!j(d)||d.isInline()||d.canBeEmpty()||wc(a,s,l);let f=(U)=>{let J=U.getNode(),W=s.getElementByKey(U.key);return W!==null&&U.type==="text"&&te(J)?ir(J,W,s):W},g=c.getNode(),p=f(c);if(p===null)return;let h=c.offset,x=e.isCollapsed(),C=e.focus,y=x?p:f(C);if(y===null)return;let N=C.offset;if(Ac(i,y,N,y,N),pC(i,"move",n?"backward":"forward",r),i.rangeCount===0)return;let T=mi(i,l)||i.getRangeAt(0),{startContainer:b,startOffset:v}=T;if(x&&r==="character"&&c.type==="text"&&te(g)&&g.isUnmergeable()){if(h===(n?0:g.getTextContentSize())){let U=St(g,n?"previous":"next").getNodeAtCaret();if(te(U)){let J=n?U.getTextContentSize()-1:1;return e.focus.set(U.__key,J,"text"),void(e.dirty=!0)}}}if(x&&r==="character"&&c.type==="text"){let U=n?0:g.getTextContentSize(),J=b===p?v:h!==U?U:-1;if(J>=0)return void(J!==h&&(e.focus.set(c.key,J,"text"),e.dirty=!0))}let[O,k,M,z]=n?[b,v,p,h]:[p,h,b,v],K=Kt(g)?g:Cg(g);e.applyDOMRange({collapsed:!1,endContainer:M,endOffset:z,startContainer:O,startOffset:k}),e.dirty=!0,!hC(e,n,K)&&n&&gC(e),r==="lineboundary"&&Rc(e,"extend",n,r,"decorators")}var rR=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),n=e.test.bind(e);if(n("❤️")&&n("#️⃣")&&n("\uD83D\uDC4D"))return n}catch(e){}return()=>!1})();function k_(e,n,r){let s=e,i=s.getTextContent().split(/(?=\s)/g),a=i.length,l=0,c=0;for(let f=0;f<a;f++){let g=f===a-1;if(c=l,l+=i[f].length,n&&l===r||l>r||g){i.splice(f,1),g&&(c=void 0);break}}let d=i.join("").trim();d===""?s.remove():(s.setTextContent(d),s.select(c,c))}function I_(e,n,r,s){let i,a=n,l=!1;if(Ct(e)){let c=!1,d=e.childNodes,f=d.length,g=s._blockCursorElement;a===f&&f>0&&(c=!0,a=f-1),hi(e,s)!==void 0||Ba(e,s)||(l=!0);let p=d[a],h=!1;if(p===g)p=d[a+1],h=!0;else if(g!==null){let x=g.parentNode;if(e===x)n>Array.prototype.indexOf.call(x.children,g)&&a--}if(i=oi(p),te(i))a=mo(i,c?"next":"previous");else{let x=oi(e);if(x===null)return null;if(j(x)){let C=s.getElementByKey(x.getKey());C===null&&q(214),[x,a]=Dn(x,C,s).resolveChildIndex(x,C,e,n),j(x)||q(215),c&&a>=x.getChildrenSize()&&(a=Math.max(0,x.getChildrenSize()-1));let N=x.getChildAtIndex(a);if(j(N)&&function(T,b,v){let O=T.getParent();return v===null||O===null||!O.canBeEmpty()||O!==v.getNode()}(N,0,r)){let T=c?N.getLastDescendant():N.getFirstDescendant();T===null?x=N:(N=T,x=j(N)?N:N.getParentOrThrow()),a=0}te(N)?(i=N,x=null,a=mo(N,c?"next":"previous")):N!==x&&c&&!h&&(j(x)||q(216),a=Math.min(x.getChildrenSize(),a+1))}else{let C=Un(x),y=C!==null?C:x,N=y.getIndexWithinParent(),T=s.getElementByKey(x.getKey()),b="after";if(T!==null&&oi(e)===x){let v=Dn(x,T,s);v.element!==T?b=v.resolveLeafPosition(T,e,n):n===0&&qe(x)&&(b="before")}a=b==="before"?N:N+1,x=y.getParentOrThrow()}if(j(x))return[_o(x.__key,a,"element"),l]}}else i=oi(e);return te(i)?[_o(i.__key,mo(i,a,"clamp"),"text"),l]:null}function L_(e,n,r){let s=e.offset,i=e.getNode();if(s===0){let a=i.getPreviousSibling(),l=i.getParent();if(n){if((r||!n)&&a===null&&j(l)&&l.isInline()){let c=l.getPreviousSibling();te(c)&&e.set(c.__key,c.getTextContent().length,"text")}}else j(a)&&!r&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):te(a)&&!i.isUnmergeable()&&e.set(a.__key,a.getTextContent().length,"text")}else if(s===i.getTextContent().length){let a=i.getNextSibling(),l=i.getParent();if(n&&j(a)&&a.isInline())e.set(a.__key,0,"element");else if((r||n)&&a===null&&j(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let c=l.getNextSibling();te(c)&&e.set(c.__key,0,"text")}}}function Mf(e){let n=ot(e.key);return n===null?null:hy(n)}function mC(e,n,r){let s=Mf(e),i=Mf(n);if(s===i||s!==null&&i!==null&&s.is(i))return!1;let a=r(s,i);if(s!==null)return j(s)?n.set(s.getKey(),a?s.getChildrenSize():0,"element"):n.set(s.getKey(),a?s.getTextContentSize():0,"text"),!0;let l=Un(i);if(l===null)return!1;let c=l.getParent();if(c===null)return!1;let d=l.getIndexWithinParent();return n.set(c.getKey(),a?d+1:d,"element"),!0}function _C(e){let n=mC(e.anchor,e.focus,(r,s)=>function(i,a,l,c){if(l!==null&&c!==null){let g=Un(l),p=Un(c);if(g!==null&&g.is(p)){for(let h of Wc(g).values()){if(h===l.getKey())return!0;if(h===c.getKey())return!1}return!0}return g===null||p===null||g.isBefore(p)}if(l!==null){let g=Un(l),p=ot(a.key);return g===null||p===null||!(!g.is(p)&&!g.isParentOf(p))||g.isBefore(p)}let d=Un(c),f=ot(i.key);return d!==null&&f!==null&&!d.is(f)&&!d.isParentOf(f)&&f.isBefore(d)}(e.anchor,e.focus,r,s));return n&&(e.dirty=!0),n}function xC(e,n,r,s,i,a){if(e===null||r===null||!Za(i,e,r))return null;let l=I_(e,n,ge(a)?a.anchor:null,i);if(l===null)return null;let c=I_(r,s,ge(a)?a.focus:null,i);if(c===null)return null;let[d,f]=l,[g,p]=c;if(d.type==="element"&&g.type==="element"){let x=oi(e),C=oi(r);if(qe(x)&&qe(C))return null}let h=i._slotsUsed&&mC(d,g,()=>(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(x,C){if(x.type==="text"&&C.type==="text"){let y=x.isBefore(C),N=x.is(C);L_(x,y,N),L_(C,!y,N),N&&C.set(x.key,x.offset,x.type)}}(d,g),[d,g,f||p||h]}function CC(e){return j(e)&&!e.isInline()}function yC(e,n,r,s,i,a){let l=Po(),c=new Ss(_o(e,n,i),_o(r,s,a),0,"");return c.dirty=!0,l._selection=c,c}function SC(){let e=_o("root",0,"element"),n=_o("root",0,"element");return new Ss(e,n,0,"")}function vc(){return new Fc(new Set)}function sR(e,n){return ka(null,e,n,null)}function ka(e,n,r,s){let i=r._window;if(i===null)return null;let a=s||i.event,l=a?a.type:void 0,c=l==="selectionchange",d=!df&&(c||l==="beforeinput"||l==="compositionstart"||l==="compositionend"||l==="click"&&a&&a.detail===3||l==="drop"||l===void 0),f,g,p,h;if(ge(e)&&!d)return e.clone();{if(n===null)return null;let O=Yn(n,r._rootElement);if(f=O.anchorNode,g=O.focusNode,p=O.anchorOffset,h=O.focusOffset,(c||l===void 0)&&ge(e)&&!Za(r,f,g))return e.clone()}let x=xC(f,p,g,h,r,e);if(x===null)return null;let[C,y,N]=x,T=0,b="";if(ge(e)){let O=e.anchor;if(C.key===O.key)T=e.format,b=e.style;else{let k=C.getNode();te(k)?(T=k.getFormat(),b=k.getStyle()):j(k)&&(T=k.getTextFormat(),b=k.getTextStyle())}}let v=new Ss(C,y,T,b);return N&&(v.dirty=!0),v}function Ue(){return Po()._selection}function Ns(){return Ve()._editorState._selection}function us(e,n,r,s=1){let{anchor:i,focus:a}=e,l=i.getNode(),c=a.getNode();if(!n.is(l)&&!n.is(c))return;let d=n.__key;if(e.isCollapsed()){let f=i.offset;if(r<=f&&s>0||r<f&&s<0){let g=Math.max(0,f+s);i.set(d,g,"element"),a.set(d,g,"element"),F_(e)}}else{let f=e.isBackward(),g=f?a:i,p=g.getNode(),h=f?i:a,x=h.getNode();if(n.is(p)){let C=g.offset;(r<=C&&s>0||r<C&&s<0)&&g.set(d,Math.max(0,C+s),"element")}if(n.is(x)){let C=h.offset;(r<=C&&s>0||r<C&&s<0)&&h.set(d,Math.max(0,C+s),"element")}}F_(e)}function F_(e){let n=e.anchor,r=n.offset,s=e.focus,i=s.offset,a=n.getNode(),l=s.getNode();if(e.isCollapsed()){if(!j(a))return;let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text"),s.set(f.__key,g,"text")}return}if(j(a)){let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text")}}if(j(l)){let c=l.getChildrenSize(),d=i>=c,f=d?l.getChildAtIndex(c-1):l.getChildAtIndex(i);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),s.set(f.__key,g,"text")}}}function Oc(e,n,r,s,i){let a=null,l=0,c=null;s!==null?(a=s.__key,te(s)?(l=s.getTextContentSize(),c="text"):j(s)&&(l=s.getChildrenSize(),c="element")):i!==null&&(a=i.__key,te(i)?c="text":j(i)&&(c="element")),a!==null&&c!==null?e.set(a,l,c):(l=n.getIndexWithinParent(),l===-1&&(l=r.getChildrenSize()),e.set(r.__key,l,"element"))}function P_(e,n,r,s,i){e.type==="text"?e.set(r,e.offset+(n?0:i),"text"):e.offset>s.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Ac(e,n,r,s,i){try{e.setBaseAndExtent(n,r,s,i)}catch(a){}}function B_(e,n,r){let s=ci(e,n.getKey());if(j(n)){let i=Dn(n,s,e);return[i.element,r+i.getFirstChildOffset()]}return[s,r]}function NC(e,n,r,s,i,a){let l=a.getRootNode(),c=gi(l)||ar(l)?ui(l):null;if(i.has(tC)&&c!==a||c!==null&&zc(c,c))return;let d=Yn(s,a),f;if(!ge(n))return void(e!==null&&Za(r,d.anchorNode,d.focusNode)&&s.removeAllRanges());let{anchor:g,focus:p}=n,h=g.getNode(),x=p.getNode(),[C,y]=B_(r,h,g.offset),[N,T]=B_(r,x,p.offset),{format:b,style:v}=n,O=n.isCollapsed(),k=C,M=N,z=!1;if(g.type==="text"?(k=te(h)?ir(h,C,r):null,z=h.getFormat()!==b||h.getStyle()!==v):ge(e)&&e.anchor.type==="text"&&(z=!0),p.type==="text"&&(M=te(x)?ir(x,N,r):null),k!==null&&M!==null){if(O&&(e===null||z||ge(e)&&(e.format!==b||e.style!==v))&&function(K,U,J,W,ne,ee){K._inputState.collapsedSelectionFormat={format:U,key:ne,offset:W,style:J,timeStamp:ee}}(r,b,v,y,g.key,performance.now()),(s.type!=="Range"||!O)&&d.anchorOffset===y&&d.focusOffset===T&&d.anchorNode===k&&d.focusNode===M){if(c===null||!a.contains(c)){let K=c!==null?fs(c):null;K!==null&&K!==r||i.has(Ec)||a.focus({preventScroll:!0})}if(g.type!=="element")return}if(Ac(s,k,y,M,T),wo&&n.isCollapsed()&&a!==null&&!i.has(Ec)){let K=kc(a);if(K===null||!a.contains(K)){let U=ui(a.ownerDocument),J=U!==null?fs(U):null;J!==null&&J!==r||a.focus({preventScroll:!0})}}if(!i.has(nC)&&n.isCollapsed()&&a!==null&&a===kc(a)){let K=ge(n)&&n.anchor.type==="element"?k.childNodes[y]||null:(f===void 0&&(f=ey(s,a)),f);if(K!==null){let U;if(xo(K)){let J=K.ownerDocument.createRange();J.selectNode(K),U=J.getBoundingClientRect()}else U=K.getBoundingClientRect();(function(J,W,ne){let ee=Hc(ne),se=xg(ee);if(ee===null||se===null)return;let Y=ne.getBoundingClientRect();if(W.bottom<Y.top)return;let{top:fe,bottom:Ce}=W,Ae=0,oe=0,ae=ne;for(;ae!==null;){let ue=ae===ee.body;if(ue){let Ie=se.visualViewport;if(Ie){let _t=Ie.offsetTop;Ae=_t,oe=_t+Ie.height}else Ae=0,oe=Nn(J).innerHeight;let ht=se.getComputedStyle(ee.documentElement),Qt=parseFloat(ht.scrollPaddingTop),Ke=parseFloat(ht.scrollPaddingBottom);isFinite(Qt)&&(Ae+=Qt),isFinite(Ke)&&(oe-=Ke)}else{let Ie=ae===ne?Y:ae.getBoundingClientRect();Ae=Ie.top,oe=Ie.bottom}let we=0;if(fe<Ae?we=-(Ae-fe):Ce>oe&&(we=Ce-oe),we!==0)if(ue)se.scrollBy(0,we);else{let Ie=ae.scrollTop;ae.scrollTop+=we;let ht=ae.scrollTop-Ie;fe-=ht,Ce-=ht}if(ue)break;ae=Es(ae)}})(r,U,a)}}(function(K){K._inputState.isSelectionChangeFromDOMUpdate=!0})(r)}}function iR(e){let n=Ue()||Ns();n===null&&(n=Mn().selectEnd()),n.insertNodes(e)}function EC(e,n){for(let r of e.split(/(\r?\n|\t)/))r===`
|
|
4
|
+
`,zf=wo?" ":Na,lx="֑-߿יִ-﷽ﹰ-ﻼ",cx="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",aA=new RegExp("^[^"+cx+"]*["+lx+"]"),lA=new RegExp("^[^"+lx+"]*["+cx+"]"),Xt={bold:1,capitalize:1024,code:16,highlight:Kf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},cA={directionless:1,unmergeable:2},hc={center:2,end:6,justify:4,left:1,right:3,start:5},uA={[nA]:"center",[iA]:"end",[rA]:"justify",[eA]:"left",[oA]:"right",[sA]:"start"},dA={normal:0,segmented:2,token:1},fA={[HO]:"normal",[GO]:"segmented",[WO]:"token"},gA="$",Qm="$config";function e_(){return Co()._blockCursorElement}function pA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class ri{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||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 n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&q(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&q(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&q(359),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,n,r){if(this.element===e)return n===e&&r===0?"before":"after";let s=t_(e,this.element);if(s===null)return"after";let i=Array.prototype.indexOf.call(e.childNodes,s);if(i<0)return"after";if(n===e)return r<=i?"before":"after";let a=t_(e,n);if(a===null)return"after";let l=Array.prototype.indexOf.call(e.childNodes,a);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}}function t_(e,n){let r=n;for(;r!==null&&r.parentNode!==e;)r=r.parentNode;return r}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(),n=e?e.nextSibling:this.element.firstChild;for(;pA(n);)e=n,n=n.nextSibling;let r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===e_()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let n=e==="decorator"&&(Wa||gs||Ha);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let r=this.element,s=this.before,i=Sn().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,s),e){let a=Sn().createElement("img");a.setAttribute("data-lexical-managed-linebreak","true"),a.style.setProperty("display","inline","important"),a.style.setProperty("border","0px","important"),a.style.setProperty("margin","0px","important"),a.alt="",r.insertBefore(a,i),r.__lexicalLineBreak=a}else r.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),n=this.getInsertionAnchor(),r=0;for(let s=this.element.firstChild;s!==null&&s!==e&&s!==n;s=s.nextSibling)r++;return r}resolveChildIndex(e,n,r,s){if(r===this.element){let c=this.getFirstChildOffset(),d=e_(),f=this.element.childNodes,g=Math.min(s,f.length),p=0;for(let h=c;h<g;h++)f[h]!==d&&p++;return[e,Math.min(p,e.getChildrenSize())]}let i=n_(n,r);i.push(s);let a=n_(n,this.element),l=e.getIndexWithinParent();for(let c=0;c<a.length;c++){let d=i[c],f=a[c];if(d===void 0||d<f)break;if(d>f){l+=1;break}}return[e.getParentOrThrow(),l]}}function n_(e,n){let r=[],s=n;for(;s!==e&&s!==null;s=s.parentNode){let i=0;for(let a=s.previousSibling;a!==null;a=a.previousSibling)i++;r.push(i)}return s!==e&&q(225),r.reverse()}var ux;try{ux="0.49.0+prod.esm"}catch(e){}var dx=ux??'"<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 n of this._back)e.push(n);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}var ls=null;function fx(e,n=1000){return e instanceof Ea?e.clone():e.size<n?new Map(e):new Ea().init(new Map(e),void 0,e.size)}class Ea{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Ea().init(this._old,this._nursery,this._size)}init(e,n,r){return this._old=e,this._nursery=n,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let n=this._nursery&&this._nursery.get(e);return n!==void 0?n:this._old&&this._old.get(e)}get(e){let n=this.getWithTombstone(e);return n===ls?void 0:n}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 n=new Map(this._old);for(let[r,s]of this._nursery)s!==ls?n.set(r,s):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(e,n){let r=this.getWithTombstone(e);if(r===n)return this;let s=this.getNursery();return r!==ls&&r!==void 0||(this._size++,r===ls&&s.delete(e)),s.set(e,n),this}delete(e){let n=this.has(e);return n&&(this.getNursery().set(e,ls),this._size--),n}getOrInsert(e,n){let r=this.get(e);return r!==void 0?r:(this.set(e,n),n)}getOrInsertComputed(e,n){let r=this.get(e);if(r!==void 0)return r;let s=n(e);return this.set(e,s),s}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,n=this._old;if(n)for(let r of n){let s=r[0],i=e?e.get(s):void 0;i!==ls&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(let r of e)r[1]===ls||n&&n.has(r[0])||(yield r)}forEach(e,n){n!==void 0&&(e=e.bind(n));for(let[r,s]of this.entries())e(s,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function mc(e,n,r,s,i,a){if(Y(e)){let l=e.getFirstChild();for(;l!==null;){let c=l.__key;l.__parent===n&&((Y(l)||Do(l)&&l.__slots!==null)&&mc(l,c,r,s,i,a),r.has(c)||a.delete(c),i.push(c)),l=l.getNextSibling()}}for(let l of Do(e)&&e.__slots!==null?e.__slots.values():[]){let c=s.get(l);c!==void 0&&Dr(c)&&c.__slotHost===n&&((Y(c)||Do(c)&&c.__slots!==null)&&mc(c,l,r,s,i,a),r.has(l)||a.delete(l),i.push(l))}}var df=!1,Uf=0;function hA(e){Uf=e.timeStamp}function Zd(e,n,r){let s=e.nodeName==="BR",i=n.__lexicalLineBreak;return i&&(e===i||s&&e.previousSibling===i)||s&&hi(e,r)!==void 0}function mA(e,n,r){let s=Xn(Nn(r)),i=s&&Yn(s,r._rootElement),a=null,l=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,l=i.focusOffset);let c=e.nodeValue;c!==null&&mg(n,c,a,l,!1)}function _A(e,n,r){if(ge(e)){let s=e.anchor.getNode();if(s.is(r)&&e.format!==s.getFormat())return!1}return xo(n)&&r.isAttached()}function xA(e,n,r){for(let s=e;s&&!vg(s);s=Es(s)){let i=hi(s,n);if(i!==void 0){let a=ot(i,r);if(a)return qe(a)||!Ct(s)?void 0:[s,a]}}}function gx(e,n,r){df=!0;let s=performance.now()-Uf>100;try{Hn(e,()=>{let i=ze()||function(p){return p.read("latest",()=>{let h=ze();return h!==null?h.clone():null})}(e),a=new Map,{_editorState:l,_blockCursorElement:c}=e,d=!1,f="";for(let p=0;p<n.length;p++){let h=n[p],{type:x,target:y}=h,N=xA(y,e,l);if(!N)continue;let[E,T]=N;if(x==="characterData")s&&te(T)&&xo(y)&&_A(i,y,T)&&mA(y,T,e);else if(x==="childList"){d=!0;let b=h.addedNodes;for(let k=0;k<b.length;k++){let M=b[k],z=fg(M),K=M.parentNode;if(!(K==null||M===c||z!==null||Zd(M,K,e)||e._slotsUsed&&Ct(M)&&M.hasAttribute("data-lexical-slot")||vg(M))){if(wo){let U=(Ct(M)?M.innerText:null)||M.nodeValue;U&&(f+=U)}K.removeChild(M)}}let v=h.removedNodes,O=v.length;if(O>0){let k=0;for(let M=0;M<O;M++){let z=v[M];(Zd(z,y,e)||c===z)&&(y.appendChild(z),k++)}O!==k&&a.set(E,T)}}}if(a.size>0)for(let[p,h]of a)h.reconcileObservedMutation(p,e);let g=r.takeRecords();if(g.length>0){for(let p=0;p<g.length;p++){let h=g[p],{addedNodes:x,target:y}=h;for(let N=0;N<x.length;N++){let E=x[N],T=E.parentNode;T==null||E.nodeName!=="BR"||Zd(E,y,e)||T.removeChild(E)}}r.takeRecords()}i!==null&&(d&&tn(i),wo&&GC(e)&&i.insertRawText(f))})}finally{df=!1}}function px(e){let n=e._observer;if(n!==null)gx(e,n.takeRecords(),n)}function hx(e){(function(n){Uf===0&&Nn(n).addEventListener("textInput",hA,!0)})(e),e._observer=new MutationObserver((n,r)=>{gx(e,n,r)})}var ff="direct",gf="latest";class mx{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||NA).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}}function CA(e,n){return new mx(e,n)}function _c(e,n,r=gf){let s=(r===gf?e.getLatest():e).__state;return s?s.getValue(n):n.defaultValue}function yA(e,n,r){let s=_c(e,r,ff),i=_c(n,r,ff);return r.isEqual(s,i)?null:[s,i]}function SA(e,n,r){let s;if(Wt(),typeof r=="function"){let a=e.getLatest(),l=_c(a,n);if(s=r(l),n.isEqual(l,s))return a}else s=r;let i=e.getWritable();return Wf(i).updateFromKnown(n,s),i}function _x(e){let n=new Map,r=new Set;for(let{ownNodeConfig:s}of nl(typeof e=="function"?e:e.replace))if(s&&s.stateConfigs)for(let i of s.stateConfigs){let a;"stateConfig"in i?(a=i.stateConfig,i.flat&&r.add(a.key)):a=i,n.set(a.key,a)}return{flatKeys:r,sharedConfigMap:n}}var o_=new Set(["__proto__","constructor","prototype"]);class Hf{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,s=new Map,i=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=s;let{sharedConfigMap:a}=this.sharedNodeState,l=i!==void 0?i:function(c,d,f){let g=f.size;if(d)for(let p in d){let h=c.get(p);h&&f.has(h)||g++}return g}(a,r,s);this.size=l}getValue(e){let n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},n={};for(let[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(let r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return r_(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;let{sharedNodeState:n,unknownState:r}=this,s=new Map(this.knownState);return new Hf(e,n,function(i,a,l){let c;if(l)for(let[d,f]of Object.entries(l)){if(o_.has(d))continue;let g=i.get(d);g?a.has(g)||a.set(g,g.parse(f)):(c=c||{},c[d]=f)}return c}(n.sharedConfigMap,s,r),s,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){let r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);let{knownState:s,unknownState:i}=this;s.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=r_(i)),this.size++),s.set(e,n)}updateFromUnknown(e,n){if(o_.has(e))return;let r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},(e in this.unknownState)||this.size++,this.unknownState[e]=n)}updateFromJSON(e){let{knownState:n}=this;for(let r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(let[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}}function Wf(e){let n=e.getWritable(),r=n.__state?n.__state.getWritable(n):new Hf(n,xx(n));return n.__state=r,r}function xx(e){return e.__state?e.__state.sharedNodeState:dg(Co(),e.getType()).sharedNodeState}function r_(e){if(e)for(let n in e)return e}function NA(e){return e}function s_(e,n,r){for(let[s,i]of n.knownState){if(e.has(s.key))continue;e.add(s.key);let a=r?r.getValue(s):s.defaultValue;if(a!==i&&!s.isEqual(a,i))return!0}return!1}function i_(e,n,r){let{unknownState:s}=n,i=r?r.unknownState:void 0;if(s)for(let[a,l]of Object.entries(s)){if(e.has(a))continue;if(e.add(a),l!==(i?i[a]:void 0))return!0}return!1}function a_(e,n){let r=e.__state;return r&&r.node===e?r.getWritable(n):r}function l_(e,n){let{__mode:r,__format:s,__style:i}=e,{__mode:a,__format:l,__style:c}=n,d=e.__state,f=n.__state;return(r===null||r===a)&&(s===null||s===l)&&(i===null||i===c)&&(e.__state===null||d===f||function(g,p){if(g===p)return!0;let h=new Set;return!(g&&s_(h,g,p)||p&&s_(h,p,g)||g&&i_(h,g,p)||p&&i_(h,p,g))}(d,f))}function c_(e,n){let r=e.mergeWithSibling(n),s=Ve()._normalizedNodes;return s.add(e.__key),s.add(n.__key),r}function u_(e){let n,r,s=e;if(s.__text!==""||!s.isSimpleText()||s.isUnmergeable()){for(;(n=s.getPreviousSibling())!==null&&te(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(l_(n,s)){s=c_(n,s);break}break}n.remove()}for(;(r=s.getNextSibling())!==null&&te(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(l_(s,r)){s=c_(s,r);break}break}r.remove()}}else s.remove()}function ni(e){return d_(e.anchor),d_(e.focus),e}function d_(e){for(;e.type==="element";){let n=e.getNode(),r=e.offset,s,i;if(r===n.getChildrenSize()?(s=n.getChildAtIndex(r-1),i=!0):(s=n.getChildAtIndex(r),i=!1),te(s)){e.set(s.__key,i?s.getTextContentSize():0,"text",!0);break}if(!Y(s))break;e.set(s.__key,i?s.getChildrenSize():0,"element",!0)}}var Ta=Symbol.for("@lexical/CachedTextSize");function f_(e,n){return hf.read(()=>{let r=0,s=e;for(let i=0;i<n&&s!==null;i++){let a=po.get(s);if(a===void 0&&q(345,s),Y(a)){let l=xt.get(s);if(l!==void 0&&Y(l)&&l.__parent!==a.__parent)r+=a.getTextContentSize();else{let c=ps.get(s),d=c&&c.__lexicalTextContent;typeof d!="string"&&q(346,a.getType()),r+=d.length}i<n-1&&!a.isInline()&&(r+=2)}else{let l=a[Ta];l===void 0&&q(347,a.getType(),s),r+=l}s=a.__next}return r},{editor:Ye})}function Cx(e){Y(e)||e[Ta]===void 0&&(e[Ta]=te(e)?e.__text.length:e.getTextContentSize())}var EA=4,ba,Ye,va,Le="",Tt=null,en=null,qt=null;function Ro(){return{firstTextKey:qt,format:Tt,style:en}}function Kn(e){e.firstTextKey!==null&&(Tt=e.format,en=e.style,qt=e.firstTextKey)}function pf(e){if(qt!==null)return;let n=e.__lexicalFirstTextKey;if(n===void 0&&q(348),n===null)return;let r=xt.get(n);te(r)&&(Tt=r.getFormat(),en=r.getStyle(),qt=n)}var Lc,ha,ma,po,hf,xt,ps,mf,Oa,hs,sr=!1,xc=!1;function Or(e,n){let r=po.get(e),s=xt.has(e);if(n!==null){let i=Sf(e);i.parentNode===n&&n.removeChild(i)}if(!s){if(Ye._keyToDOMMap.delete(e),Y(r)){let i=Ka(r,po);_f(i,0,i.length-1,null)}if(r!==void 0){for(let i of An(r).values()){let a=Cf(i);Or(i,null),a!==null&&a.remove()}_g(Oa,va,Lc,r,"destroyed")}}}function _f(e,n,r,s){for(let i=n;i<=r;++i){let a=e[i];a!==void 0&&Or(a,s)}}function cs(e,n){e.setProperty("text-align",n)}var TA="40px";function yx(e,n){let r=ba.theme.indent;if(typeof r=="string"){let s=e.classList.contains(r);n>0&&!s?e.classList.add(r):n<1&&s&&e.classList.remove(r)}e.style.setProperty("padding-inline-start",n===0?"":`calc(${n} * var(--lexical-indent-base-value, ${TA}))`)}function Sx(e,n){let r=e.style;n===0?cs(r,""):n===1?cs(r,"left"):n===2?cs(r,"center"):n===3?cs(r,"right"):n===4?cs(r,"justify"):n===5?cs(r,"start"):n===6&&cs(r,"end")}function xf(e,n){let r=function(s){let i=s.__dir;if(i!==null)return i;if(Kt(s))return null;let a=s.getParent();return a===null||Rt(a)&&a.__dir===null?"auto":null}(n);r!==null?e.dir=r:e.removeAttribute("dir")}function Nx(e){let n=Sn().createElement("div");return n.setAttribute("data-lexical-slot",e),n.style.display="none",n}function Ex(e,n,r){n||e.contentEditable==="false"?uy(r,Ye):r.removeAttribute("contenteditable")}function g_(e,n,r){let s=Le,i=Ro();Le="";let a="",l=qe(e);for(let[c,d]of r){let f=Nx(c);Ex(n,l,f),n.appendChild(f),Le="";let g=Ro();Ar(d,Dn(e,f,Ye)),Kn(g),Tx(e,c,n,f),a+=Le}return Kn(i),Le=s,a}function An(e){return Do(e)&&e.__slots!==null?e.__slots:fy}function Tx(e,n,r,s){let i=hs.$getSlotTargetElement(e,n,r,Ye);i!==null&&(s.parentElement!==i&&i.appendChild(s),s.style.display="")}function Cf(e){let n=ps.get(e);return n!==void 0?n.parentElement:null}function p_(e,n,r){let s=An(e),i=An(n);for(let[g,p]of s)if(!i.has(g)){let h=Cf(p);Or(p,null),h!==null&&h.remove()}let a=Le,l=Ro(),c="",d=null,f=qe(n);for(let[g,p]of i){let h=s.get(g),x=h!==void 0?Cf(h):null;Le="";let y=Ro();if(x===null){x=Nx(g);let N=null;for(let E of r.children)if(!E.hasAttribute("data-lexical-slot")){N=E;break}r.insertBefore(x,N),Ar(p,Dn(n,x,Ye))}else h===p?rr(p,x):(h!==void 0&&Or(h,x),Ar(p,Dn(n,x,Ye)));if(Kn(y),Ex(r,f,x),Tx(n,g,r,x),c+=Le,x.parentElement===r){let N=d===null?r.firstChild:d.nextSibling;N!==x&&r.insertBefore(x,N),d=x}}return Kn(l),Le=a,c}function Ar(e,n){let r=xt.get(e);if(r===void 0&&q(60),n!==null){let i=po.get(e);if(i!==void 0){let a=ps.get(e);if(a!==void 0){let l=Dr(i)?i.__slotHost:null,c=Dr(r)?r.__slotHost:null,d=i.__parent!==r.__parent||l!==c,f=c!==null&&a.parentElement!==n.element;if(d||f)return n.insertChild(a),rr(e,n.element)}}}let s=hs.$createDOM(r,Ye);if(function(i,a,l){let c=l._keyToDOMMap;PC(a,l,i),c.set(i,a)}(e,s,Ye),te(r)?s.setAttribute("data-lexical-text","true"):qe(r)&&(s.setAttribute("data-lexical-decorator","true"),cy(s,{captureSelection:!0})),Y(r)){let{__indent:i,__size:a}=r;xf(s,r),i!==0&&yx(s,i);let l=An(r),c=l.size>0?g_(r,s,l):"";if(a===0)s.__lexicalTextContent=c,s.__lexicalFirstTextKey=null,Le+=c,l.size>0&&(s.__lexicalSlotTextLength=c.length);else{let f=Le,g=a-1;if(yf(Ka(r,xt),r,0,g,Dn(r,s,Ye)),c!==""){let p=s.__lexicalTextContent||"";s.__lexicalTextContent=c+p,Le=f+c+p}l.size>0&&(s.__lexicalSlotTextLength=c.length)}let d=r.__format;d!==0&&Sx(s,d),r.isInline()||bx(null,r,s)}else{let i=r.getTextContent();if(qe(r)){let a=r.decorate(Ye,ba);a!==null&&vx(e,a),s.contentEditable="false";let l=An(r);l.size>0&&g_(r,s,l)}Le+=i}return n!==null&&n.insertChild(s),hs.$decorateDOM(r,null,s,Ye),Cx(r),_g(Oa,va,Lc,r,"created"),s}function yf(e,n,r,s,i){let a=Le,l=Ro();Le="",Tt=null,en=null,qt=null;let c=r;for(;c<=s;++c){let f=Ro();Ar(e[c],i);let g=xt.get(e[c]);g!==null&&te(g)?Tt===null&&(Tt=g.getFormat(),en=g.getStyle(),qt=g.__key):Y(g)&&c<s&&!g.isInline()&&(Le+=ds),Kn(f)}let d=Ye._keyToDOMMap.get(n.__key);d===void 0&&q(349,n.__key),d.__lexicalTextContent=Le,d.__lexicalFirstTextKey=qt,Le=a+Le,Kn(l)}function bx(e,n,r){let s=Dn(n,r,Ye),i=s.element.__lexicalLastChildKind??null,a=function(l,c){if(l){let d=l.__last;if(d){let f=c.get(d);if(f)return Io(f)?"line-break":qe(f)&&f.isInline()?"decorator":null}return An(l).size>0?null:"empty"}return null}(n,xt);i!==a&&s.setManagedLineBreak(a)}function bA(e,n,r){var s;Tt=null,en=null,qt=null,function(i,a,l){let c=Le,d=i.__size,f=a.__size;Le="";let g=l.element,p=Ye._keyToDOMMap.get(a.__key);p===void 0&&q(351,a.__key);let h=f-d;if(!sr&&Math.abs(h)<=1&&d>=EA&&i.__first===a.__first&&(h!==0||!Ye._cloneNotNeeded.has(i.__key))){let x=p.__lexicalTextContent,y=mf.get(i.__key);if(!sr&&typeof x=="string"&&y!==void 0){let N=function(E,T){let b=T.size;if(b===0||b>=E.__size)return null;let v=E.__last,O=null,k=0;for(;v!==null&&k<b;){if(!T.has(v))return null;O=v;let M=xt.get(v);if(M===void 0)return null;v=M.__prev,k++}if(k!==b)return null;if(v!==null&&T.has(v))return null;return O}(a,y);if(N!==null){let E=y.size;if(h===0){let T=f_(N,E),b=N,v=0;for(;b!==null&&v<E;){let K=xt.get(b);if(K===void 0)break;let U=Ro();rr(b,g),te(K)&&Tt===null&&(Tt=K.getFormat(),en=K.getStyle(),qt=K.__key),Kn(U),b=K.__next,v++}let O="";for(b=N,v=0;b!==null&&v<E;){let K=xt.get(b);if(K===void 0)break;let U;if(Y(K)){let J=Ye._keyToDOMMap.get(b),W=J&&J.__lexicalTextContent;typeof W!="string"&&q(352,K.getType()),U=W}else U=K.getTextContent();O+=U,v<E-1&&Y(K)&&!K.isInline()&&(O+=ds),b=K.__next,v++}let k=p.__lexicalSlotTextLength||0,M=k>0?x.slice(k):x,z=M.slice(0,M.length-T)+O;return p.__lexicalTextContent=z,Le=c+z,void h_(a,p,y)}if(function(T,b,v,O,k,M,z,K){if(K!==1&&K!==-1)return!1;if(z!==(K===1?2:1))return!1;let J=z-K,W=T.__last;for(let Be=0;Be<J-1;Be++){if(W===null)return!1;let _t=po.get(W);if(_t===void 0)return!1;W=_t.__prev}if(W===null)return!1;let ne=xt.get(M),ee=po.get(W);if(ne===void 0||ee===void 0)return!1;if(ne.__prev!==ee.__prev)return!1;let se=[],V=M;for(let Be=0;Be<z;Be++){if(V===null)return!1;se.push(V);let _t=xt.get(V);V=_t?_t.__next:null}let fe=[];V=W;for(let Be=0;Be<J;Be++){if(V===null)return!1;fe.push(V);let _t=po.get(V);V=_t?_t.__next:null}let Ce=new Set(fe),Oe=new Set(se),oe=[],ae=0,ce=0;for(;ae<J&&ce<z;)if(se[ce]===fe[ae])oe.push({key:se[ce],kind:"reconcile"}),ae++,ce++;else if(Oe.has(fe[ae])){if(Ce.has(se[ce]))return!1;oe.push({key:se[ce],kind:"create",nextIndex:ce}),ce++}else oe.push({key:fe[ae],kind:"destroy"}),ae++;for(;ae<J;)oe.push({key:fe[ae++],kind:"destroy"});for(;ce<z;)oe.push({key:se[ce],kind:"create",nextIndex:ce}),ce++;let De=f_(W,J);for(let Be of oe){let _t=Ro();if(Be.kind==="reconcile")rr(Be.key,v.element);else if(Be.kind==="destroy")Or(Be.key,v.element);else{let Vt=null;for(let Nr=Be.nextIndex+1;Nr<z;Nr++){let Qo=Ye._keyToDOMMap.get(se[Nr]);if(Qo!==void 0){Vt=Qo;break}}Ar(Be.key,v.withBefore(Vt??v.before))}if(Be.kind!=="destroy"){let Vt=xt.get(Be.key);Vt&&te(Vt)&&Tt===null&&(Tt=Vt.getFormat(),en=Vt.getStyle(),qt=Vt.__key)}Kn(_t)}let we="";for(let Be=0;Be<z;Be++){let _t=xt.get(se[Be]);if(_t===void 0)return!1;let Vt;if(Y(_t)){let Nr=Ye._keyToDOMMap.get(se[Be]),Qo=Nr&&Nr.__lexicalTextContent;typeof Qo!="string"&&q(350,_t.getType()),Vt=Qo}else Vt=_t.getTextContent();we+=Vt,Be<z-1&&Y(_t)&&!_t.isInline()&&(we+=ds)}let ht=O.__lexicalSlotTextLength||0,Qt=ht>0?k.slice(ht):k;return O.__lexicalTextContent=Qt.slice(0,Qt.length-De)+we,!0}(i,0,l,p,x,N,E,h)){let T=p.__lexicalTextContent;return typeof T!="string"&&q(353),Le=c+T,void h_(a,p,y)}}}if(h===0){let N=i.__first,E=0;for(;N!==null;){let T=xt.get(N);if(T===void 0)break;let b=sr||ma.has(N)||ha.has(N),v=Ro();if(b)rr(N,g);else{let O,k;if(Y(T)){k=ps.get(N);let M=k&&k.__lexicalTextContent;typeof M!="string"&&q(354,T.getType()),O=M}else O=T.getTextContent();Le+=O,k!==void 0&&pf(k)}te(T)?Tt===null&&(Tt=T.getFormat(),en=T.getStyle(),qt=T.__key):Y(T)&&E<f-1&&!T.isInline()&&(Le+=ds),Kn(v),N=T.__next,E++}return p.__lexicalTextContent=Le,p.__lexicalFirstTextKey=qt,void(Le=c+Le)}}if(d===1&&f===1){let x=i.__first,y=a.__first;if(x===y)rr(x,g);else{let E=Sf(x),T=Ar(y,null);try{E.parentNode===g?g.replaceChild(T,E):l.insertChild(T)}catch(b){if(typeof b=="object"&&b!=null){let v=`${b.toString()} Parent: ${g.tagName}, new child: {tag: ${T.tagName} key: ${y}}, old child: {tag: ${E.tagName}, key: ${x}}.`;throw Error(v)}throw b}Or(x,null)}let N=xt.get(y);te(N)&&Tt===null&&(Tt=N.getFormat(),en=N.getStyle(),qt=N.__key)}else{let x=Ka(i,po),y=Ka(a,xt);if(x.length!==d&&q(227),y.length!==f&&q(228),d===0)f!==0&&yf(y,a,0,f-1,l);else if(f===0){if(d!==0){let N=l.after==null&&l.before==null&&An(a).size===0&&l.element.__lexicalLineBreak==null;_f(x,0,d-1,N?null:g),N&&(g.textContent="")}}else(function(N,E,T,b,v,O){let k=b-1,M=v-1,z,K,U=O.getFirstChild(),J=0,W=0;for(;J<=k&&W<=M;){let se=E[J],V=T[W],fe=Ro();if(se===V)U=Qd(rr(V,O.element)),J++,W++;else{if(K===void 0&&(K=m_(T,W)),z===void 0)z=m_(E,J);else if(!z.has(se)){J++,Kn(fe);continue}if(!K.has(se)){U=Qd(Sf(se)),Or(se,O.element),J++,z.delete(se),Kn(fe);continue}if(z.has(V)){let Oe=ci(Ye,V);Oe!==U&&O.withBefore(U??O.before).insertChild(Oe),U=Qd(rr(V,O.element)),J++,W++}else Ar(V,O.withBefore(U??O.before)),W++}let Ce=xt.get(V);Ce!==null&&te(Ce)?Tt===null&&(Tt=Ce.getFormat(),en=Ce.getStyle(),qt=Ce.__key):Y(Ce)&&W<=M&&!Ce.isInline()&&(Le+=ds),Kn(fe)}let ne=J>k,ee=W>M;if(ne&&!ee){let se=T[M+1],V=se===void 0?null:Ye.getElementByKey(se);yf(T,N,W,M,O.withBefore(V??O.before))}else ee&&!ne&&_f(E,J,k,O.element)})(a,x,y,d,f,l)}p.__lexicalTextContent=Le,p.__lexicalFirstTextKey=qt,Le=c+Le}(e,n,Dn(n,r,Ye)),Rt(n)||(s=n,Tt==null||Tt===s.__textFormat||xc||s.setTextFormat(Tt),function(i){en==null||en===i.__textStyle||xc||i.setTextStyle(en)}(n))}function h_(e,n,r){let s=n.__lexicalFirstTextKey;if(s!=null){let i=e.__key,a=s;for(;a!==null;){let l=xt.get(a);if(l===void 0){a=null;break}if(l.__parent===i)break;a=l.__parent}if(a!==null&&!r.has(a)){let l=xt.get(s);if(te(l))return Tt=l.getFormat(),void(en=l.getStyle())}}n.__lexicalFirstTextKey=qt}function rr(e,n){let r=po.get(e),s=xt.get(e);r!==void 0&&s!==void 0||q(61);let i=sr||ma.has(e)||ha.has(e),a=ci(Ye,e);if(r===s&&!i){let l;if(Y(r)){let c=a.__lexicalTextContent;typeof c!="string"&&q(355,r.getType()),l=c,pf(a)}else l=r.getTextContent();return Le+=l,a}if(r!==s&&i&&_g(Oa,va,Lc,s,"updated"),hs.$updateDOM(s,r,a,Ye)){let l=Ar(e,null);return n===null&&q(62),n.replaceChild(l,a),Or(e,null),l}if(Y(r)){Y(s)||q(334,e);let l=s.__indent;(sr||l!==r.__indent)&&yx(a,l);let c=s.__format;(sr||c!==r.__format)&&Sx(a,c);let d=i&&(An(s).size>0||An(r).size>0)?p_(r,s,a):"";if(i){let f=Le;if(bA(r,s,a),Kt(s)||s.isInline()||bx(0,s,a),d!==""){let g=a.__lexicalTextContent||"";a.__lexicalTextContent=d+g,Le=f+d+g,a.__lexicalSlotTextLength=d.length}else(An(s).size>0||An(r).size>0)&&(a.__lexicalSlotTextLength=0)}else{let f=a.__lexicalTextContent;typeof f!="string"&&q(356,r.getType()),Le+=f,pf(a)}if((sr||s.__dir!==r.__dir||s.__parent!==r.__parent)&&(xf(a,s),Kt(s)&&!sr)){for(let f of s.getChildren())if(Y(f))xf(ci(Ye,f.getKey()),f)}}else{let l=s.getTextContent();if(qe(s)){let c=s.decorate(Ye,ba);c!==null&&vx(e,c),i&&(An(s).size>0||An(r).size>0)&&p_(r,s,a)}Le+=l}if(!xc&&Kt(s)){let l=s.getLatest();if(l.__cachedText!==Le){let c=l.getWritable();c.__cachedText=Le,s=c}}return hs.$decorateDOM(s,r,a,Ye),Cx(s),a}function vx(e,n){let r=Ye._pendingDecorators,s=Ye._decorators;if(r===null){if(s[e]===n)return;r=BC(Ye)}r[e]=n}function Qd(e){let n=e.nextSibling;return n!==null&&n===Ye._blockCursorElement&&(n=n.nextSibling),n}function m_(e,n){let r=new Set;for(let s=n;s<e.length;s++)r.add(e[s]);return r}function vA(e,n,r,s,i,a){Le="",Tt=null,en=null,qt=null,sr=s===2,Ye=r,ba=r._config,hs=r._config.dom||La,va=r._nodes,Lc=Ye._listeners.mutation,ha=i,ma=a,po=e._nodeMap,hf=e,xt=n._nodeMap,xc=n._readOnly,ps=fx(r._keyToDOMMap),mf=function(){let c=new Map,d=(f)=>{for(let g of f){let p=xt.get(g);if(p===void 0)continue;let h=p.__parent;if(h===null)continue;let x=c.get(h);x===void 0&&(x=new Set,c.set(h,x)),x.add(g)}};return d(ha.keys()),d(ma),c}();let l=new Map;return Oa=l,rr("root",null),Ye=void 0,va=void 0,ha=void 0,ma=void 0,po=void 0,hf=void 0,xt=void 0,ba=void 0,ps=void 0,mf=void 0,Oa=void 0,hs=La,l}function Sf(e){let n=ps.get(e);return n===void 0&&q(75,e),n}function Ee(e){return{type:e}}var Gf=Ee("SELECTION_CHANGE_COMMAND"),OA=Ee("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ox=Ee("CLICK_COMMAND"),jf=Ee("BEFORE_INPUT_COMMAND"),Yf=Ee("INPUT_COMMAND"),Vf=Ee("COMPOSITION_START_COMMAND"),Xf=Ee("COMPOSITION_END_COMMAND"),Aa=Ee("DELETE_CHARACTER_COMMAND"),_a=Ee("INSERT_LINE_BREAK_COMMAND"),Nf=Ee("INSERT_PARAGRAPH_COMMAND"),ii=Ee("CONTROLLED_TEXT_INSERTION_COMMAND"),qf=Ee("PASTE_COMMAND"),lc=Ee("REMOVE_TEXT_COMMAND"),Ra=Ee("DELETE_WORD_COMMAND"),Ma=Ee("DELETE_LINE_COMMAND"),Tr=Ee("FORMAT_TEXT_COMMAND"),AA=Ee("SET_TEXT_FORMAT_COMMAND"),Jf=Ee("UNDO_COMMAND"),Zf=Ee("REDO_COMMAND"),Qf=Ee("KEYDOWN_COMMAND"),Ax=Ee("KEY_ARROW_RIGHT_COMMAND"),Rx=Ee("MOVE_TO_END"),Mx=Ee("KEY_ARROW_LEFT_COMMAND"),Dx=Ee("MOVE_TO_START"),$x=Ee("KEY_ARROW_UP_COMMAND"),wx=Ee("KEY_ARROW_DOWN_COMMAND"),Cc=Ee("KEY_ENTER_COMMAND"),kx=Ee("KEY_SPACE_COMMAND"),Ix=Ee("KEY_BACKSPACE_COMMAND"),Lx=Ee("KEY_ESCAPE_COMMAND"),Fx=Ee("KEY_DELETE_COMMAND"),Px=Ee("KEY_TAB_COMMAND"),RA=Ee("INSERT_TAB_COMMAND"),MA=Ee("INDENT_CONTENT_COMMAND"),DA=Ee("OUTDENT_CONTENT_COMMAND"),Bx=Ee("DROP_COMMAND"),$A=Ee("FORMAT_ELEMENT_COMMAND"),Kx=Ee("DRAGSTART_COMMAND"),zx=Ee("DRAGOVER_COMMAND"),Ux=Ee("DRAGEND_COMMAND"),eg=Ee("COPY_COMMAND"),tg=Ee("CUT_COMMAND"),Hx=Ee("SELECT_ALL_COMMAND"),wA=Ee("CLEAR_EDITOR_COMMAND"),kA=Ee("CLEAR_HISTORY_COMMAND"),IA=Ee("CAN_REDO_COMMAND"),LA=Ee("CAN_UNDO_COMMAND"),Wx=Ee("FOCUS_COMMAND"),Gx=Ee("BLUR_COMMAND"),jx=Ee("KEY_MODIFIER_COMMAND");function Yx(e){let n=new Map;return{dispose(){for(let r of n.values())r.dispose();n.clear()},register(r,s){let i=n.get(r);i===void 0&&(i={dispose:e(r,s),holders:new Set},n.set(r,i));let a=()=>{let l=n.get(r);l&&l.holders.delete(a)&&l.holders.size===0&&(n.delete(r),l.dispose())};return i.holders.add(a),a}}}function ng(e,n,r,s){return e.addEventListener(n,r,s),e.removeEventListener.bind(e,n,r,s)}var er=Object.freeze({}),Ef=[["keydown",function(e,n){let r=n._inputState;if(r.lastKeyDownTimeStamp=e.timeStamp,r.lastKeyCode=e.key,e.key!=="Backspace"&&wa(r),n.isComposing())return;ie(n,Qf,e)}],["pointerdown",function(e,n){let r=Ng(e),s=e.pointerType;_i(r)&&s!=="touch"&&s!=="pen"&&e.button===0&&Hn(n,()=>{Ba(r,n)||(n._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,n){ie(n,Vf,e)}],["compositionend",function(e,n){let r=n._inputState;wo?r.compositionPhase="ending-firefox":gs||!Ha&&!Wa?ie(n,Xf,e):(r.compositionPhase="ending-safari",r.compositionEndData=e.data)}],["input",function(e,n){e.stopPropagation();let r=n._inputState;wa(r),Hn(n,()=>{Jx(e,n)||n.dispatchCommand(Yf,e)},{event:e}),r.unprocessedBeforeInputData=null}],["click",function(e,n){Hn(n,()=>{let r=ze(),s=Xn(Nn(n)),i=Ns();if(s){if(ge(r)){let a=r.anchor,l=a.getNode();a.type==="element"&&a.offset===0&&r.isCollapsed()&&!Kt(l)&&Mn().getChildrenSize()===1&&l.getTopLevelElementOrThrow().isEmpty()&&i!==null&&r.is(i)&&(s.removeAllRanges(),r.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let a=Yn(s,n._rootElement).anchorNode;if(Ct(a)||xo(a))tn(ka(i,s,n,e))}}if(wo&&s!==null&&s.rangeCount===0){let a=n._rootElement;if(a!==null&&e.target===a){let l=e.clientY,c=a.childNodes.length;for(let f=0;f<a.childNodes.length;f++){let g=a.childNodes[f];if(Ct(g)){let p=g.getBoundingClientRect();if(l<=(p.top+p.bottom)/2){c=f;break}}}s.setBaseAndExtent(a,c,a,c);let d=ka(i,s,n,e);d!==null?tn(d):s.removeAllRanges()}}ie(n,Ox,e)})}],["cut",er],["copy",er],["dragstart",er],["dragover",er],["dragend",er],["paste",er],["focus",er],["blur",er],["drop",er]];ya&&Ef.push(["beforeinput",(e,n)=>function(r,s){let i=r.inputType;if(i==="deleteCompositionText"||wo&&GC(s))return;if(i==="insertCompositionText")return;Hn(s,()=>{Jx(r,s)||ie(s,jf,r)},{event:r})}(e,n)]);var Tf=new WeakMap,yc=new WeakMap,FA=Yx((e)=>(e.addEventListener("selectionchange",S_),()=>e.removeEventListener("selectionchange",S_)));function Vx(e,n,r,s,i,a){let{anchor:l,focus:c}=e,d=l.getNode(),f=Ve(),g;if(a!==void 0)g=a;else{let N=Xn(Nn(f));g=N!==null?Yn(N,f._rootElement):null}let p=g!==null?g.anchorNode:null,h=l.key,x=f.getElementByKey(h),y=r.length;return h!==c.key||!te(d)||(!i&&(!ya||f._inputState.lastBeforeInputInsertTextTimeStamp<s+50)||d.isDirty()&&y<2||KC(r))&&l.offset!==c.offset&&!d.isComposing()||Wn(d)||d.isDirty()&&y>1||(i||!ya)&&x!==null&&!d.isComposing()&&p!==ir(d,x,f)||g!==null&&n!==null&&(!n.collapsed||n.startContainer!==g.anchorNode||n.startOffset!==g.anchorOffset)||!d.isComposing()&&(d.getFormat()!==e.format||d.getStyle()!==e.style)||function(N,E){if(E.isSegmented())return!0;if(!N.isCollapsed())return!1;let T=N.anchor.offset,b=E.getParentOrThrow(),v=Fa(E);return T===0?!E.canInsertTextBefore()||!b.canInsertTextBefore()&&!E.isComposing()||v||function(O){let k=O.getPreviousSibling();return(te(k)||Y(k)&&k.isInline())&&!k.canInsertTextAfter()}(E):T===E.getTextContentSize()&&(!E.canInsertTextAfter()||!b.canInsertTextAfter()&&!E.isComposing()||v)}(e,d)}function __(e,n){return xo(e)&&e.nodeValue!==null&&n!==0&&n!==e.nodeValue.length}function x_(e,n,r){let{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:l}=Yn(e,n._rootElement),c=n._inputState;c.isSelectionChangeFromDOMUpdate&&(c.isSelectionChangeFromDOMUpdate=!1,__(s,i)&&__(a,l)&&!c.postDeleteSelectionToRestore)||Hn(n,()=>{if(!r)return void tn(null);if(!Za(n,s,a))return;let d=ze();if(c.postDeleteSelectionToRestore&&ge(d)&&d.isCollapsed()){let f=d.anchor,g=c.postDeleteSelectionToRestore.anchor;(f.key===g.key&&f.offset===g.offset+1||f.offset===1&&g.getNode().is(f.getNode().getPreviousSibling()))&&(d=c.postDeleteSelectionToRestore.clone(),tn(d))}if(c.postDeleteSelectionToRestore=null,ge(d)){let f=d.anchor,g=f.getNode();if(d.isCollapsed()){e.type==="Range"&&s===a&&(d.dirty=!0);let p=Nn(n).event,h=p?p.timeStamp:performance.now(),{format:x,style:y,offset:N,key:E,timeStamp:T}=c.collapsedSelectionFormat,b=Mn(),v=n.isComposing()===!1&&b.getTextContent()==="";if(h<T+200&&f.offset===N&&f.key===E)cc(d,x,y);else if(f.type==="text")te(g)||q(141),Xx(d,g);else if(f.type==="element"&&!v){Y(g)||q(259);let O=f.getNode();O.isEmpty()?function(k,M){let z=M.getTextFormat(),K=M.getTextStyle();cc(k,z,K)}(d,O):cc(d,d.format,"")}}else{let p=f.key,h=d.focus.key,x=d.getNodes(),y=x.length,N=d.isBackward(),E=N?l:i,T=N?i:l,b=N?h:p,v=N?p:h,O=2047,k=!1;for(let M=0;M<y;M++){let z=x[M],K=z.getTextContentSize();if(te(z)&&K!==0&&!(M===0&&z.__key===b&&E===K||M===y-1&&z.__key===v&&T===0)&&(k=!0,O&=z.getFormat(),O===0))break}d.format=k?O:0}}ie(n,Gf)})}function cc(e,n,r){e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}function Xx(e,n){cc(e,n.getFormat(),n.getStyle())}function qx(e){if(!e.getTargetRanges)return null;let n=e.getTargetRanges();return n.length===0?null:n[0]}function C_(e){let{lastKeyCode:n}=Ve()._inputState;if(e==null||e.length<=1||n==null)return;let r=n.length===1?n:n==="Enter"?`
|
|
5
|
+
`:n==="Tab"?"\t":null;if(!r)return;let s=ze();if(!ge(s)||!s.isCollapsed())return;let i=s.anchor.getNode();if(!te(i))return;let{offset:a}=s.anchor;if(i.getTextContentSize()===a){let l=i.getNextSibling();if(r===`
|
|
6
|
+
`){if(Io(l))l.selectEnd();else if(!l){let c=Er(i,xC),d=c&&c.getNextSibling();Y(d)&&d.selectStart()}}else r==="\t"?sg(l)&&l.selectEnd():te(l)&&l.getTextContent()[0]===r&&l.select(1,1)}else i.getTextContent()[a]===r&&i.select(a+1,a+1)}function wa(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function y_(e){wa(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>wa(e),0)}function Jx(e,n){let r=Ng(e);if(Ct(r)&&Ba(r,n))return!0;let s=n.getRootElement();if(s===null)return!1;let i=ui(s.ownerDocument);return i!==null&&s.contains(i)&&Ba(i,n)}function PA(e){let n=e.inputType,r=qx(e),s=Ve(),i=s._inputState,a=ze();if(n==="insertText"&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(wa(i),e.preventDefault(),ge(a)&&!a.isCollapsed()){let p=a.isBackward()?a.anchor:a.focus;a.anchor.set(p.key,p.offset,p.type),a.focus.set(p.key,p.offset,p.type)}return!0}if(n==="deleteContentBackward"){if(a===null){let p=Ns();if(!ge(p))return!0;tn(p.clone())}if(ge(a)){let p=a.anchor.key===a.focus.key;if(function(h,x){return h.lastKeyCode==="MediaLast"&&x<h.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&s.isComposing()&&p){if(Bt(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Hn(s,()=>{Bt(null)})},30),ge(a)){let h=a.anchor.getNode();h.markDirty(),te(h)||q(142),Xx(a,h)}}else{if(Bt(null),gs&&r!==null&&!r.collapsed&&(a.applyDOMRange(r),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let h=a.anchor.getNode(),x=h.getTextContent(),y=h.canInsertTextAfter(),N=a.anchor.offset===0&&a.focus.offset===x.length,E=Sa&&p&&!N&&y;if(E&&a.isCollapsed()&&(E=!qe(WC(a.anchor,!0))),!E){ie(s,Aa,!0);let T=ze();Sa&&ge(T)&&T.isCollapsed()&&(i.postDeleteSelectionToRestore=T,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!ge(a))return!0;let l=e.data;i.unprocessedBeforeInputData!==null&&hg(!1,s,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||Kt(a.anchor.getNode())||r===null||a.applyDOMRange(r),i.unprocessedBeforeInputData=null;let{anchor:c,focus:d}=a,f=c.getNode(),g=d.getNode();if(n==="insertText"||n==="insertTranspose"){if(l===`
|
|
7
|
+
`)e.preventDefault(),ie(s,_a,!1);else if(l===ds)e.preventDefault(),ie(s,Nf);else if(l==null&&e.dataTransfer){let p=e.dataTransfer.getData("text/plain");e.preventDefault(),a.insertRawText(p)}else l!=null&&Vx(a,r,l,e.timeStamp,!0)?(e.preventDefault(),ie(s,ii,l),C_(l)):i.unprocessedBeforeInputData=l;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ie(s,ii,e),C_((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let p=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let h=s._compositionKey;Bt(null),p||ie(s,ii,e),uc(h);break}case"insertLineBreak":Bt(null),ie(s,_a,!1);break;case"insertParagraph":Bt(null),i.isInsertLineBreak&&!gs?(i.isInsertLineBreak=!1,ie(s,_a,!1)):ie(s,Nf);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ie(s,qf,e);break;case"deleteByComposition":(function(p,h){return p!==h||Y(p)||Y(h)||!Fa(p)||!Fa(h)})(f,g)&&ie(s,lc,e);break;case"deleteByDrag":xs(Ec),ie(s,lc,e);break;case"deleteByCut":ie(s,lc,e);break;case"deleteContent":ie(s,Aa,!1);break;case"deleteWordBackward":ie(s,Ra,!0);break;case"deleteWordForward":ie(s,Ra,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ie(s,Ma,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ie(s,Ma,!1);break;case"formatStrikeThrough":ie(s,Tr,"strikethrough");break;case"formatBold":ie(s,Tr,"bold");break;case"formatItalic":ie(s,Tr,"italic");break;case"formatUnderline":ie(s,Tr,"underline");break;case"historyUndo":ie(s,Jf);break;case"historyRedo":ie(s,Zf)}return!0}function BA(e){let n=Ve(),r=n._inputState,s=ze(),i=e.data,a=qx(e),l=!1;if(i!=null&&ge(s)){let c=Xn(Nn(n)),d=c!==null?Yn(c,n._rootElement):null,f=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&!n.isComposing();f&&(r.hadOrphanedCompositionEvents=!0);let g=s.anchor.getNode(),p=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&n.isComposing()&&te(g)&&Wn(g);if(!f&&!p&&Vx(s,a,i,e.timeStamp,!1,d)){if(l=!0,r.compositionPhase==="ending-firefox"){let T=Sc(n,i);if(r.compositionPhase="idle",T)return xs(Tc),V_(),!0}let h=s.anchor.getNode();if(c===null||d===null)return!0;let x=s.isBackward(),y=x?s.anchor.offset:s.focus.offset,N=x?s.focus.offset:s.anchor.offset;ya&&!s.isCollapsed()&&te(h)&&d.anchorNode!==null&&h.getTextContent().slice(0,y)+i+h.getTextContent().slice(y+N)===UC(d.anchorNode)||ie(n,ii,i);let E=i.length;wo&&E>1&&e.inputType==="insertCompositionText"&&!n.isComposing()&&(s.anchor.offset-=E,s._cachedNodes=null,s._cachedIsBackward=null),Sa&&n.isComposing()&&(r.lastKeyDownTimeStamp=0,Bt(null))}}if(!l)hg(!1,n,i!==null?i:void 0),r.compositionPhase==="ending-firefox"&&(Sc(n,i||void 0),xs(Tc),r.compositionPhase="idle");return V_(),!0}function KA(e){let n=Ve(),r=n._inputState,s=ze();if(ge(s)&&!n.isComposing()){r.compositionPhase="composing",r.hadOrphanedCompositionEvents=!1;let i=s.anchor,a=s.anchor.getNode();if(Bt(i.key),xs(oC),e.timeStamp<r.lastKeyDownTimeStamp+30||i.type==="element"||!s.isCollapsed()||!Sa&&(a.getFormat()!==s.format||te(a)&&a.getStyle()!==s.style)||te(a)&&(Wn(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){ie(n,ii,zf);let l=ze();ge(l)&&Bt(l.anchor.key)}}return!0}function zA(e){let n=Ve();return n._inputState.compositionPhase="idle",Sc(n,e.data),xs(Tc),!0}function uc(e){if(e===null)return;let n=ot(e);if(!te(n)||n.getType()==="text"||Wn(n)||!n.isAttached())return;let r=ze(),s=ge(r)&&r.anchor.key===e?r.anchor.offset:null,i=Cn(n.getTextContent());if(i.setFormat(n.getFormat()),i.setStyle(n.getStyle()),n.replace(i),s!==null){let a=Math.min(s,i.getTextContentSize());i.select(a,a)}}function Sc(e,n){let r=e._compositionKey;if(Bt(null),r!==null&&n!=null){if(n===""){let i=ot(r),a=e.getElementByKey(r),l=a!==null&&te(i)?ir(i,a,e):null;if(l!==null&&l.nodeValue!==null&&te(i)){let c=Xn(Nn(e)),d=c&&Yn(c,e._rootElement),f=null,g=null;d!==null&&d.anchorNode===l&&(f=d.anchorOffset,g=d.focusOffset),mg(i,l.nodeValue,f,g,!0)}return uc(r),!1}if(n[n.length-1]===`
|
|
8
|
+
`){let i=ze();if(ge(i)||fi(i)){if(ge(i)){let a=i.focus;i.anchor.set(a.key,a.offset,a.type)}return ie(e,Cc,null),uc(r),!1}}let s=ot(r);if(s!==null&&te(s)&&Wn(s)){s.markDirty();let i=ze(),a=s.getTextContentSize(),l=ge(i)&&i.anchor.key===r?i.anchor.offset:a;return s.select(l,l).insertText(n),!0}}return hg(!0,e,n),uc(r),!1}function UA(e){let n=Ve(),r=n._inputState;if(e.key==null)return!0;if(r.compositionPhase==="ending-safari"){let s=q_(e);if(s&&Hn(n,()=>{Sc(n,r.compositionEndData)}),r.compositionPhase="idle",r.compositionEndData="",s)return!0}if(function(s){return Qe(s,"ArrowRight",{shiftKey:"any"})}(e))ie(n,Ax,e);else if(function(s){return Qe(s,"ArrowRight",{...or,shiftKey:"any"})}(e))ie(n,Rx,e);else if(function(s){return Qe(s,"ArrowLeft",{shiftKey:"any"})}(e))ie(n,Mx,e);else if(function(s){return Qe(s,"ArrowLeft",{...or,shiftKey:"any"})}(e))ie(n,Dx,e);else if(function(s){return Qe(s,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))ie(n,$x,e);else if(function(s){return Qe(s,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))ie(n,wx,e);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))r.isInsertLineBreak=!0,ie(n,Cc,e);else if(function(s){return s.key===" "}(e))ie(n,kx,e);else if(function(s){return Bn&&Qe(s,"o",{ctrlKey:!0})}(e))e.preventDefault(),r.isInsertLineBreak=!0,ie(n,_a,!0);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))r.isInsertLineBreak=!1,ie(n,Cc,e);else if(function(s){return Qe(s,"Backspace",{shiftKey:"any"})||Bn&&Qe(s,"h",{ctrlKey:!0})}(e))q_(e)?ie(n,Ix,e)&&y_(r):(e.preventDefault(),ie(n,Aa,!0));else if(function(s){return s.key==="Escape"}(e))ie(n,Lx,e);else if(function(s){return Qe(s,"Delete",{})||Bn&&Qe(s,"d",{ctrlKey:!0})}(e))!function(s){return s.key==="Delete"}(e)?(e.preventDefault(),ie(n,Aa,!1)):ie(n,Fx,e);else if(function(s){return Qe(s,"Backspace",X_)}(e))e.preventDefault(),ie(n,Ra,!0);else if(function(s){return Qe(s,"Delete",X_)}(e))e.preventDefault(),ie(n,Ra,!1);else if(function(s){return Bn&&Qe(s,"Backspace",{metaKey:!0})}(e))e.preventDefault(),ie(n,Ma,!0);else if(function(s){return Bn&&(Qe(s,"Delete",{metaKey:!0})||Qe(s,"k",{ctrlKey:!0}))}(e))e.preventDefault(),ie(n,Ma,!1);else if(function(s){return Qe(s,"b",or)}(e))e.preventDefault(),ie(n,Tr,"bold");else if(function(s){return Qe(s,"u",or)}(e))e.preventDefault(),ie(n,Tr,"underline");else if(function(s){return Qe(s,"i",or)}(e))e.preventDefault(),ie(n,Tr,"italic");else if(function(s){return Qe(s,"Tab",{shiftKey:"any"})}(e))ie(n,Px,e);else if(function(s){return Qe(s,"z",or)}(e))e.preventDefault(),ie(n,Jf);else if(function(s){if(Bn)return Qe(s,"z",{metaKey:!0,shiftKey:!0});return Qe(s,"y",{ctrlKey:!0})||Qe(s,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),ie(n,Zf);else{let s=n._editorState._selection;!function(i){return Qe(i,"a",or)}(e)?s===null||ge(s)||(!function(i){return Qe(i,"c",or)}(e)?function(i){return Qe(i,"x",or)}(e)&&(e.preventDefault(),ie(n,tg,e)):(e.preventDefault(),ie(n,eg,e))):(e.preventDefault(),ie(n,Hx,e)&&y_(r))}return function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey}(e)&&n.dispatchCommand(jx,e),!0}function Zx(e){let n=e.__lexicalEventHandles;return n===void 0&&(n=[],e.__lexicalEventHandles=n),n}var ai=new Map;function S_(e){let n=XC(e.target);if(n===null)return;let r=Hc(e.target),s=null,i=null,a=r!==null?yc.get(r):void 0;if(r!==null){if(a!==void 0){let{editors:p,hasShadowEditor:h}=a;if(h===void 0){h=!1;for(let x of p)if(x._rootElement!==null&&ar(x._rootElement.getRootNode())){h=!0;break}a.hasShadowEditor=h}if(h){let x=null,y=null;for(let N of p){let E=N._rootElement;if(E===null)continue;let T=Yn(n,E).anchorNode;if(T!==null&&fs(T)===N){if(ar(E.getRootNode())){s=N,i=T;break}x===null&&(x=N,y=T)}}s===null&&x!==null&&(s=x,i=y)}else{let x=n.anchorNode;x===null||Ct(x)&&x.shadowRoot!==null||(s=fs(x),s!==null&&(i=x))}}if(s===null){let p=ui(r);s=p!==null?fs(p):null}}if(s===null)return;if(s._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let p of a.editors)p._inputState.isSelectionChangeFromMouseDown=!1;Hn(s,()=>{let p=Ns(),h=i??Yn(n,s._rootElement).anchorNode;if(Ct(h)||xo(h))tn(ka(p,n,s,e))})}let l=pg(s),c=l[l.length-1],d=c._key,f=ai.get(d),g=f||c;g!==s&&x_(n,g,!1),x_(n,s,!0),s!==c?ai.set(d,s):f&&ai.delete(d)}function bf(e){e._lexicalHandled=!0}function N_(e){return e._lexicalHandled===!0}var E_=()=>{};function HA(e){let n=Tf.get(e);if(n===void 0)return void E_();let r=yc.get(n);if(r===void 0)return void E_();Tf.delete(e);let s=Qa(e);Uc(s)?(function(a){if(a._parentEditor!==null){let l=pg(a),c=l[l.length-1]._key;ai.get(c)===a&&ai.delete(c)}else ai.delete(a._key)}(s),r.editors.delete(s),r.hasShadowEditor=void 0,e.__lexicalEditor=null):s&&q(198);let i=Zx(e);for(let a=0;a<i.length;a++)i[a]();e.__lexicalEventHandles=[]}function vf(e,n,r){Wt();let s=e.__key,i=e.getParent();if(i===null)return void(Jt(e)!==null&&q(367,s,String(Jt(e))));let a=function(c){let d=ze();if(!ge(d)||!Y(c))return d;let{anchor:f,focus:g}=d,p=f.getNode(),h=g.getNode();return Pa(p,c)&&f.set(c.__key,0,"element"),Pa(h,c)&&g.set(c.__key,0,"element"),d}(e),l=!1;if(ge(a)&&n){let{anchor:c,focus:d}=a;c.key===s&&(Oc(c,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0),d.key===s&&(Oc(d,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0)}else fi(a)&&n&&e.isSelected()&&e.selectPrevious();if(ge(a)&&n&&!l){let c=e.getIndexWithinParent();zn(e),us(a,i,c,-1)}else zn(e);r||Rt(i)||i.canBeEmpty()||!i.isEmpty()||vf(i,n),n&&a&&Kt(i)&&i.isEmpty()&&i.selectEnd()}function WA(e){return e}var Qx=Symbol.for("ephemeral");function Nc(e){return e[Qx]||!1}var T_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class ln{__type;__key;__parent;__prev;__next;__state;[Ta];static getType(){let{ownNodeType:e}=tl(this);return e===void 0&&q(64,this.name),e}static clone(e){q(65,this.name)}$config(){return{}}config(e,n){let r=n.extends||dy(this.constructor);return Object.assign(n,{extends:r}),typeof e=="string"&&Object.assign(n,{type:e}),{[e]:n}}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",T_),Object.defineProperty(this,Ta,T_),FC(this,e)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let n=ot(e);if(n===null)break;e=n.__parent!==null?n.__parent:Jt(n)}return!1}isSelected(e){let n=e||ze();if(n==null)return!1;let r=n.getNodes().some((s)=>s.__key===this.__key);if(te(this))return r;if(ge(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let s=this.getParent();if(qe(this)&&this.isInline()&&s){let i=n.isBackward()?n.focus:n.anchor;if(s.is(i.getNode())&&i.offset===s.getChildrenSize()&&this.is(s.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:ot(e)}getParentOrThrow(){let e=this.getParent();return e===null&&q(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(Rt(n)||Jt(e)!==null)return Y(e)||e===this&&qe(e)||q(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&q(67,this.__key),e}getParents(){let e=[],n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){let e=[],n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:ot(e)}getPreviousSiblings(){let e=[],n=this.getParent();if(n===null)return e;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ot(e)}getNextSiblings(){let e=[],n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){let n=Y(this)?this:this.getParent(),r=Y(e)?e:e.getParent(),s=n&&r?Ic(n,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let n=Ic(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?kg(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(e){return Pa(e,this)}getNodesBetween(e){let n=this.isBefore(e),r=[],s=new Set,i=this;for(;i!==null;){let a=i.__key;if(s.has(a)||(s.add(a),r.push(i)),i===e)break;let l=Y(i)?n?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}let c=n?i.getNextSibling():i.getPreviousSibling();if(c!==null){i=c;continue}let d=i.getParentOrThrow();if(s.has(d.__key)||r.push(d),d===e)break;let f=null,g=d;do{if(g===null&&q(68),f=n?g.getNextSibling():g.getPreviousSibling(),g=g.getParent(),g===null)break;f!==null||s.has(g.__key)||r.push(g)}while(f===null);i=f}return n||r.reverse(),r}isDirty(){let e=Ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Nc(this))return this;let e=ot(this.__key);return e===null&&q(113),e}getWritable(){if(Nc(this))return this;Wt();let e=Po(),n=Ve(),r=e._nodeMap,s=this.__key,i=this.getLatest(),a=n._cloneNotNeeded,l=ze();if(l!==null&&l.setCachedNodes(null),a.has(s))return $c(i),i;let c=bg(i);return a.add(s),$c(c),r.set(s,c),c}getTextContent(){return my(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){q(70)}updateDOM(e,n,r){q(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){q(18,this.name)}updateFromJSON(e){return function(n,r){let s=n.getWritable(),i=r.$,a=i;for(let l of xx(s).flatKeys)l in r&&(a!==void 0&&a!==i||(a={...i}),a[l]=r[l]);return(s.__state||a)&&Wf(n).updateFromJSON(a),s}(this,e)}static transform(){return null}remove(e){vf(this,!0,e)}replace(e,n){Wt();let r=ze();r!==null&&(r=r.clone()),cf(this,e);let s=this.getLatest(),i=this.__key,a=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),d=c.__size,f=l.getParent(),g=f!==null?l.getIndexWithinParent():-1;zn(l),f!==null&&ge(r)&&us(r,f,g,-1);let p=s.getPreviousSibling(),h=s.getNextSibling(),{__prev:x,__next:y,__parent:N}=s;if(vf(s,!1,!0),p===null)c.__first=a;else p.getWritable().__next=a;if(l.__prev=x,h===null)c.__last=a;else h.getWritable().__prev=a;l.__next=y,l.__parent=N,c.__size=d;let E=0;n&&(Y(this)&&Y(l)||q(139),E=l.getChildrenSize(),l.splice(E,0,this.getChildren()));let T=Gn(this);if(T.length>0){Do(this)&&Do(l)||q(368,this.__key,l.__key);for(let b of T){let v=$r(this,b);v!==null&&(_y(this,b),Og(l,b,v))}}if(ge(r)){tn(r);let b=r.anchor,v=r.focus;b.key===i&&(n&&b.type==="element"?b.set(l.__key,E+b.offset,"element"):A_(b,l)),v.key===i&&(n&&v.type==="element"?v.set(l.__key,E+v.offset,"element"):A_(v,l))}return Mo()===i&&Bt(a),l}insertAfter(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();rx(this.getParentOrThrow());let i=s.getParent(),a=ze(),l=!1,c=!1;if(i!==null){let h=e.getIndexWithinParent();if(ge(a)){let x=i.__key,{anchor:y,focus:N}=a;l=y.type==="element"&&y.key===x&&y.offset===h+1,c=N.type==="element"&&N.key===x&&N.offset===h+1}zn(s),n&&ge(a)&&us(a,i,h,-1)}else zn(s);let d=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),g=s.__key,p=r.__next;if(d===null)f.__last=g;else d.getWritable().__prev=g;if(f.__size++,r.__next=g,s.__next=p,s.__prev=r.__key,s.__parent=r.__parent,n&&ge(a)){let h=this.getIndexWithinParent();us(a,f,h+1);let x=f.__key;l&&a.anchor.set(x,h+2,"element"),c&&a.focus.set(x,h+2,"element")}return e}insertBefore(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();rx(this.getParentOrThrow());let i=s.__key,a=ze(),l=s.getParent(),c=l!==null?s.getIndexWithinParent():-1;zn(s),l!==null&&n&&ge(a)&&us(a,l,c,-1);let d=this.getPreviousSibling(),f=this.getParentOrThrow().getWritable(),g=r.__prev,p=this.getIndexWithinParent();if(d===null)f.__first=i;else d.getWritable().__next=i;if(f.__size++,r.__prev=i,s.__prev=g,s.__next=r.__key,s.__parent=r.__parent,n&&ge(a))us(a,this.getParentOrThrow(),p);return e}isParentRequired(){return!1}createParentElementNode(){return Rn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){Wt();let r=Un(this);if(r!==null)return r.selectPrevious(e,n);let s=this.getPreviousSibling(),i=this.getParentOrThrow();if(s===null)return i.select(0,0);if(Y(s))return s.select();if(!te(s)){let a=s.getIndexWithinParent()+1;return i.select(a,a)}return s.select(e,n)}selectNext(e,n){Wt();let r=Un(this);if(r!==null)return r.selectNext(e,n);let s=this.getNextSibling(),i=this.getParentOrThrow();if(s===null)return i.select();if(Y(s))return s.select(0,0);if(!te(s)){let a=s.getIndexWithinParent();return i.select(a,a)}return s.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}}function og(e){return e instanceof ln}var GA="historic",jA="history-push",dc="history-merge",YA="paste",VA="cut",eC="collaboration",XA="skip-collab",tC="skip-scroll-into-view",nC="skip-dom-selection",Ec="skip-selection-focus",oC="composition-start",Tc="composition-end",qA="!important";function Of(e){let n={};if(!e)return n;let r="",s="",i=null,a=!1,l=!1,c=!1,d=0,f=e.length,g=-1;for(let x=0;x<f;x++){let y=e[x];if(a)y==="*"&&e[x+1]==="/"&&(a=!1,x++);else if(l)g===-1&&(g=x),l=!1;else if(i===null)if(y!=="/"||e[x+1]!=="*")if(y!=='"'&&y!=="'")if(y!=="(")if(y!==")")if(c||y!==":"||d!==0){if(y===";"&&d===0){g!==-1&&(c?s+=e.slice(g,x):r+=e.slice(g,x),g=-1);let N=r.trim(),E=s.trim();N!==""&&E!==""&&(n[N]=E),r="",s="",c=!1;continue}g===-1&&(g=x)}else g!==-1&&(r+=e.slice(g,x),g=-1),c=!0;else g===-1&&(g=x),d=Math.max(0,d-1);else g===-1&&(g=x),d++;else g===-1&&(g=x),i=y;else g!==-1&&(c?s+=e.slice(g,x):r+=e.slice(g,x),g=-1),a=!0,x++;else g===-1&&(g=x),y==="\\"?l=!0:y===i&&(i=null)}g!==-1&&(c?s+=e.slice(g,f):r+=e.slice(g,f));let p=r.trim(),h=s.trim();return p!==""&&h!==""&&(n[p]=h),n}function rC(e,n,r){let s=r.trimEnd(),i=s.length-10;i>=0&&s.slice(i).toLowerCase()===qA?e.setProperty(n,s.slice(0,i).trim(),"important"):e.setProperty(n,r,"")}function JA(e,n){for(let r in n){let s=n[r];s==null?e.removeProperty(r):rC(e,r,s)}}function Af(e,n,r=""){if(n===r)return;let s=Of(r),i=Of(n);for(let a in i)delete s[a],rC(e,a,i[a]);for(let a in s)e.removeProperty(a)}function ef(e,n){return 16&n?"code":n&Kf?"mark":32&n?"sub":64&n?"sup":null}function tf(e,n){return 1&n?"strong":2&n?"em":"span"}function sC(e,n,r,s,i){let a=s.classList,l=li(i,"base");l!==void 0&&a.add(...l),l=li(i,"underlineStrikethrough");let c=!1,d=8&n&&4&n;l!==void 0&&(8&r&&4&r?(c=!0,d||a.add(...l)):d&&a.remove(...l));for(let f in Xt){let g=Xt[f];if(l=li(i,f),l!==void 0)if(r&g){if(c&&(f==="underline"||f==="strikethrough")){n&g&&a.remove(...l);continue}((n&g)===0||d&&f==="underline"||f==="strikethrough")&&a.add(...l)}else n&g&&a.remove(...l)}}function iC(e,n,r){let s=r.isComposing(),i=e+(s?Na:""),a=Co(),l=Tg(a).$getDOMSlot(r,n,a),c=l.getFirstChild();if(c===null||c.nodeType!==Node.TEXT_NODE)return void l.insertChild(Sn().createTextNode(i));let d=c,f=d.nodeValue;if(f!==i)if(s||wo){let[g,p,h]=function(x,y){let N=x.length,E=y.length,T=0,b=0;for(;T<N&&T<E&&x[T]===y[T];)T++;for(;b+T<N&&b+T<E&&x[N-b-1]===y[E-b-1];)b++;return[T,N-T-b,y.slice(T,E-b)]}(f,i);p!==0&&d.deleteData(g,p),d.insertData(g,h)}else d.nodeValue=i}function b_(e,n,r,s,i,a){iC(i,e,n);let l=a.theme.text;l!==void 0&&sC(0,0,s,e,l)}function sc(e,n){let r=Sn().createElement(n);return r.appendChild(e),r}function bc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends ln{__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:tr,priority:0}),em:()=>({conversion:tr,priority:0}),i:()=>({conversion:tr,priority:0}),mark:()=>({conversion:tr,priority:0}),s:()=>({conversion:tr,priority:0}),span:()=>({conversion:ZA,priority:0}),strong:()=>({conversion:tr,priority:0}),sub:()=>({conversion:tr,priority:0}),sup:()=>({conversion:tr,priority:0}),u:()=>({conversion:tr,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="",n){super(n),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 fA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Mo()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let n=Xt[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return Mr(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){let r=this.__format,s=ef(0,r),i=tf(0,r),a=s===null?i:s,l=Sn().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Sn().createElement(i),l.appendChild(c)),b_(c,this,0,r,this.__text,e);let d=this.__style;return d!==""&&Af(l.style,d),l}updateDOM(e,n,r){let s=this.__text,i=e.__format,a=this.__format,l=ef(0,i),c=ef(0,a),d=tf(0,i),f=tf(0,a);if((l===null?d:l)!==(c===null?f:c))return!0;if(l===c&&d!==f){let y=n.firstChild;y==null&&q(48);let N=Sn().createElement(f);return b_(N,this,0,a,s,r),n.replaceChild(N,y),!1}let g=n;c!==null&&l!==null&&(g=n.firstChild,g==null&&q(49)),iC(s,g,this);let p=r.theme.text;p!==void 0&&i!==a&&sC(0,i,a,g,p);let h=e.__style,x=this.__style;return h!==x&&Af(n.style,x,h),!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:n}=super.exportDOM(e);return Ct(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=sc(n,"b")),this.hasFormat("italic")&&(n=sc(n,"i")),this.hasFormat("strikethrough")&&(n=sc(n,"s")),this.hasFormat("underline")&&(n=sc(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Xt[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?cA[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=Mr(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let n=dA[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){Wt();let r=e,s=n,i=ze(),a=this.getTextContent(),l=this.__key;if(typeof a=="string"){let c=a.length;r===void 0&&(r=c),s===void 0&&(s=c)}else r=0,s=0;if(!ge(i))return CC(l,r,l,s,"text","text");{let c=Mo();c!==i.anchor.key&&c!==i.focus.key||Bt(l),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,s){let i=this.getWritable(),a=i.__text,l=r.length,c=e;c<0&&(c=l+c,c<0&&(c=0));let d=ze();if(s&&ge(d)){let g=e+l;d.setTextNodeRange(i,g,i,g)}let f=a.slice(0,c)+r+a.slice(c+n);return i.__text=f,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Wt();let n=this.getLatest(),r=n.getTextContent();if(r==="")return[];let s=n.__key,i=Mo(),a=r.length;e.sort((z,K)=>z-K),e.push(a);let l=[],c=e.length;for(let z=0,K=0;z<a&&K<=c;K++){let U=e[K];U>z&&(l.push(r.slice(z,U)),z=U)}let d=l.length;if(d===1)return[n];let f=l[0],g=n.getParent(),p,h=n.getFormat(),x=n.getStyle(),y=n.__detail,N=!1,E=null,T=null,b=ze();if(ge(b)){let[z,K]=b.isBackward()?[b.focus,b.anchor]:[b.anchor,b.focus];z.type==="text"&&z.key===s&&(E=z),K.type==="text"&&K.key===s&&(T=K)}n.isSegmented()?(p=Cn(f),p.__format=h,p.__style=x,p.__detail=y,p.__state=a_(n,p),N=!0):p=n.setTextContent(f);let v=[p];for(let z=1;z<d;z++){let K=Cn(l[z]);K.__format=h,K.__style=x,K.__detail=y,K.__state=a_(n,K);let U=K.__key;i===s&&Bt(U),v.push(K)}let O=E?E.offset:null,k=T?T.offset:null,M=0;for(let z of v){if(!E&&!T)break;let K=M+z.getTextContentSize();if(E!==null&&O!==null&&O<=K&&O>=M&&(E.set(z.getKey(),O-M,"text"),O<K&&(E=null)),T!==null&&k!==null&&k<=K&&k>=M){T.set(z.getKey(),k-M,"text");break}M=K}if(g!==null){(function(U){let J=U.getPreviousSibling(),W=U.getNextSibling();J!==null&&$c(J),W!==null&&$c(W)})(this);let z=g.getWritable(),K=this.getIndexWithinParent();N?(z.splice(K,0,v),this.remove()):z.splice(K,1,v),ge(b)&&us(b,g,K,d-1)}return v}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||q(50);let r=this.__key,s=e.__key,i=this.__text,a=i.length;Mo()===s&&Bt(r);let l=ze();if(ge(l)){let{anchor:g,focus:p}=l;g!==null&&g.key===s&&F_(g,n,r,e,a),p!==null&&p.key===s&&F_(p,n,r,e,a)}let c=e.__text,d=n?c+i:i+c;this.setTextContent(d);let f=this.getWritable();return e.remove(),f}isTextEntity(){return!1}}function ZA(e){return{forChild:rg(e.style),node:null}}function QA(e){let n=e,r=n.style.fontWeight==="normal";return{forChild:rg(n.style,r?void 0:"bold"),node:null}}var v_=new WeakMap;function eR(e){if(!Ct(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function tR(e){let n=e;e.parentElement===null&&q(129);let r=n.textContent||"";if(function(s){let i,a=s.parentNode,l=[s];for(;a!==null&&(i=v_.get(a))===void 0&&!eR(a);)l.push(a),a=a.parentNode;let c=i===void 0?a:i;for(let d=0;d<l.length;d++)v_.set(l[d],c);return c}(n)!==null)return{node:ig(r)};if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),r==="")return{node:null};if(r[0]===" "){let s=n,i=!0;for(;s!==null&&(s=O_(s,!1))!==null;){let a=s.textContent||"";if(a.length>0){/[ \t\n]$/.test(a)&&(r=r.slice(1)),i=!1;break}}i&&(r=r.slice(1))}if(r[r.length-1]===" "){let s=n,i=!0;for(;s!==null&&(s=O_(s,!0))!==null;)if((s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(r=r.slice(0,r.length-1))}return r===""?{node:null}:{node:Cn(r)}}function O_(e,n){let r=e;for(;;){let s;for(;(s=n?r.nextSibling:r.previousSibling)===null;){let a=r.parentElement;if(a===null)return null;r=a}if(r=s,Ct(r)){let a=r.style.display;if(a===""&&!ry(r)||a!==""&&!a.startsWith("inline"))return null}let i=r;for(;(i=n?r.firstChild:r.lastChild)!==null;)r=i;if(xo(r))return r;if(r.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 tr(e){let n=nR[e.nodeName.toLowerCase()];return n===void 0?{node:null}:{forChild:rg(e.style,n),node:null}}function Cn(e=""){return el(new ms(e))}function te(e){return e instanceof ms}function rg(e,n){let r=e.fontWeight,s=e.textDecoration.split(" "),i=r==="700"||r==="bold",a=s.includes("line-through"),l=e.fontStyle==="italic",c=s.includes("underline"),d=e.verticalAlign;return(f)=>te(f)||bc(f)?(i&&!f.hasFormat("bold")&&f.toggleFormat("bold"),a&&!f.hasFormat("strikethrough")&&f.toggleFormat("strikethrough"),l&&!f.hasFormat("italic")&&f.toggleFormat("italic"),c&&!f.hasFormat("underline")&&f.toggleFormat("underline"),d!=="sub"||f.hasFormat("subscript")||f.toggleFormat("subscript"),d!=="super"||f.hasFormat("superscript")||f.toggleFormat("superscript"),n&&!f.hasFormat(n)&&f.toggleFormat(n),f):f}class ja extends ms{$config(){return this.config("tab",{extends:ms})}constructor(e=void 0){super("\t",e),this.__detail=2}createDOM(e){let n=super.createDOM(e),r=li(e.theme,"tab");if(r!==void 0)n.classList.add(...r);return n}setTextContent(e){return super.setTextContent("\t")}spliceText(e,n,r,s){return r===""&&n===0||r==="\t"&&n===1||q(286),this}setDetail(e){return e!==2&&q(127),this}setMode(e){return e!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function aC(){return el(new ja)}function sg(e){return e instanceof ja}class lC{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}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($o(Fr(this,"next")),$o(Fr(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&q(20),e}set(e,n,r,s){let i=this._selection,a=this.key;s&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,Rr()||(Mo()===a&&Bt(e),i!==null&&(i.setCachedNodes(null),ge(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function _o(e,n,r){return new lC(e,n,r)}function nf(e,n){let r=n.__key,s=e.offset,i="element";if(te(n)){i="text";let a=n.getTextContentSize();s>a&&(s=a)}else if(!Y(n)){let a=n.getNextSibling();if(te(a))r=a.__key,s=0,i="text";else{let l=n.getParent();l&&(r=l.__key,s=n.getIndexWithinParent()+1)}}e.set(r,s,i)}function A_(e,n){if(Y(n)){let r=n.getLastDescendant();Y(r)||te(r)?nf(e,r):nf(e,n)}else nf(e,n)}function R_(e,n,r,s){let i=e.getNode(),a=i.getChildAtIndex(e.offset),l=Cn();if(l.setFormat(r),l.setStyle(s),$C(a))a.splice(0,0,[l]);else if(a!==null){let c=Rt(i)?Rn().append(l):l;a.insertBefore(c)}else if(Rt(i)){let c=i.getLastChild();Y(c)&&!c.isInline()&&c.isEmpty()?c.append(l):i.append(Rn().append(l))}else i.append(l);e.is(n)&&n.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function M_(e,n,r,s){let i=e.anchor.getNode();te(i)||q(398);let a=e.anchor.offset,l=Cn(n);l.setFormat(r),l.setStyle(s);let c=i.getParentOrThrow();if(a===0)c.isInline()&&!i.__prev?c.insertBefore(l):i.insertBefore(l,!1);else if(a===i.getTextContentSize())c.isInline()&&!i.__next?c.insertAfter(l):i.insertAfter(l,!1);else{let[d]=i.splitText(a);d.insertAfter(l,!1)}i.getTextContent()===""&&i.isAttached()&&i.remove(),l.selectEnd(),l.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-n.length,e.anchor.type)}class Fc{_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 n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).every((s)=>r.has(s))}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 Fc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let n=this.getNodes().filter((a)=>Jt(a)===null),r=n.length;if(r===0)return;let s=n[r-1],i;if(te(s))i=s.select();else{let a=s.getIndexWithinParent()+1;i=s.getParentOrThrow().select(a,a)}i.insertNodes(e);for(let a=0;a<r;a++)n[a].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=this._nodes,r=[];for(let s of n){let i=ot(s);i!==null&&r.push(i)}return Rr()||(this._cachedNodes=r),r}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){let e=this.getNodes().filter((n)=>Jt(n)===null);if((ze()||Ns())===this&&e[0]){let n=St(e[0],"next");Sy(Lr(n,n))}for(let n of e)n.remove();cC()}}function cC(){let e=Mn();if(e.isEmpty()){let n=Rn();e.append(n),n.select()}}function ge(e){return e instanceof Ss}class Ss{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,n,r,s){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!ge(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 n=function(r){let s=[],[i,a]=r.getTextSlices();i&&s.push(i.caret.origin);let l=new Set,c=new Set;for(let d of r)if(jn(d)){let{origin:f}=d;s.length===0?l.add(f):(c.add(f),s.push(f))}else{let{origin:f}=d;Y(f)&&c.has(f)||s.push(f)}if(a&&s.push(a.caret.origin),wr(r.focus)&&Y(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let d=lr(r.focus.origin,"previous");jn(d)&&l.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(s[s.length-1]);d=di(d))l.delete(d.origin),s.pop();for(;s.length>1;){let d=s[s.length-1];if(!Y(d)||c.has(d)||d.isEmpty()||l.has(d))break;s.pop()}if(s.length===0&&r.isCollapsed()){let d=$o(r.anchor),f=$o(r.anchor.getFlipped()),g=(h)=>ho(h)?h.origin:h.getNodeAtCaret(),p=g(d)||g(f)||(r.anchor.getNodeAtCaret()?d.origin:f.origin);s.push(p)}return s}(Ig(Ff(this),"next"));return Rr()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,s){return this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,s,"text"),this}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let n=e[0],r=e[e.length-1],s=this.anchor,i=this.focus,a=s.isBefore(i),[l,c]=Rf(this),d="",f=!0;for(let g=0;g<e.length;g++){let p=e[g];if(Y(p)&&!p.isInline()){f||(d+=`
|
|
9
|
+
`);let h="";for(let x of Gn(p)){let y=$r(p,x);y!==null&&(h+=y.getTextContent())}h!==""?(d+=h,f=!1):f=!p.isEmpty()}else if(f=!1,te(p)){let h=p.getTextContent();p===n?p===r?s.type==="element"&&i.type==="element"&&i.offset!==s.offset||(h=l<c?h.slice(l,c):h.slice(c,l)):h=a?h.slice(l):h.slice(c):p===r&&(h=a?h.slice(0,c):h.slice(0,l)),d+=h}else!qe(p)&&!Io(p)||p===r&&this.isCollapsed()||(d+=p.getTextContent())}return d}applyDOMRange(e){let n=Ve(),r=n.getEditorState()._selection,s=_C(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(s===null)return;let[i,a,l]=s;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),l&&(this.dirty=!0),ni(this)}clone(){let e=this.anchor,n=this.focus;return new Ss(_o(e.key,e.offset,e.type),_o(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Mr(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 n=Xt[e];return(this.format&n)!==0}insertRawText(e){this.insertNodes(ig(e))}insertText(e){let n=this.format,r=this.style;if(!this.isCollapsed()){let g=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(te(g)&&(n=g.getFormat(),r=g.getStyle()),this.removeText(),this.format=n,this.style=r,e==="")return;if(Mo()===null)return this.anchor.type==="element"&&R_(this.anchor,this.focus,n,r),void M_(this,e,n,r)}this.anchor.type==="element"&&R_(this.anchor,this.focus,n,r);let s=this.anchor.getNode();te(s)||q(398);let i=this.anchor.offset,a=s.getParentOrThrow(),l=s.getTextContentSize();if(Wn(s)||i===0&&(!s.canInsertTextBefore()||!a.canInsertTextBefore()&&!s.__prev)||i===l&&(!s.canInsertTextAfter()||!a.canInsertTextAfter()&&!s.__next)){if(s.isSegmented()&&i!==0&&i!==l){if(Mo()!==null)s.setMode("normal").setFormat(n).setStyle(r);else{let p=Cn(s.getTextContent());p.setFormat(n),p.setStyle(r),s.replace(p),p.select(i,i)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(i===0){let p=s.getPreviousSibling();if(te(p)&&p.canInsertTextAfter()&&!Wn(p))p.select();else{let h=Cn();h.setFormat(n),h.setStyle(r),a.canInsertTextBefore()?s.insertBefore(h):a.insertBefore(h),h.select()}return void this.insertText(e)}if(i===l){let p=s.getNextSibling();if(te(p)&&p.canInsertTextBefore()&&!Wn(p))p.select(0,0);else{let h=Cn();h.setFormat(n),h.setStyle(r),a.canInsertTextAfter()?s.insertAfter(h):a.insertAfter(h),h.select(0,0)}return void this.insertText(e)}let g=Cn(e);return g.setFormat(n),g.setStyle(r),s.replace(g),void g.select()}if(e==="")return;let c=a.isInline()&&i===0&&!s.__prev,d=a.isInline()&&i===l&&!s.__next,f=s.getFormat()!==n||s.getStyle()!==r;if(c||d||f){if(s.getTextContent()!==""||c||d)return void M_(this,e,n,r);s.setFormat(n),s.setStyle(r)}s.spliceText(i,0,e,!0),s.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=ze()===this;Ca(this,Ny(Ff(this))),e&&ze()!==this&&tn(this)}formatText(e,n=null){dC(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&Y(n)&&Jt(n)!==null){let y=n.isShadowRoot()?n.getFirstChild()??n.append(Rn()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&y!==null&&!Y(y)){let N=Rn();y.insertBefore(N),y=N}if(y!==null){y.selectStart();let N=ze();return ge(N)||q(369),N.insertNodes(e)}}if(this.anchor.type==="element"&&Rt(n)){let y=rf(e),N=y.getLastDescendant();return n.splice(this.anchor.offset,0,y.getChildren()),void(N!==null&&N.selectEnd())}let r=(this.isBackward()?this.focus:this.anchor).getNode(),s=Er(r,xn),i=e[e.length-1];if(Y(s)&&"__language"in s){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let y=fa(this);s.splice(y,0,e),i.selectEnd()}return}if(!e.some((y)=>(Y(y)||qe(y))&&!y.isInline())){Y(s)||q(211,r.constructor.name,r.getType());let y=fa(this);return s.splice(y,0,e),void i.selectEnd()}if(Y(s)&&Jt(s)!==null){let y=fa(this),N=Df(e);s.splice(y,0,N);let E=N[N.length-1];return void(E!==void 0?E.selectEnd():s.select(y,y))}if(s===null){let y=rf(e),N=y.getLastDescendant(),E=Fr(this.anchor,"next");for(let T of y.getChildren())E=vy(T,E);return void(N!==null&&N.selectEnd())}if(Y(s)&&!s.isParentRequired()&&!Rt(s.getParentOrThrow())){let y=fa(this),N=Df(e);s.splice(y,0,N);let E=N[N.length-1];return void(E!==void 0?E.selectEnd():s.select(y,y))}let a=rf(e),l=a.getLastDescendant(),c=a.getChildren(),d=!Y(s)||!s.isEmpty()?this.insertParagraph():null;d&&!s.isAttached()&&(r=this.anchor.getNode(),s=Er(r,xn));let f=c[c.length-1],g=c[0];var p;Y(p=g)&&xn(p)&&!p.isEmpty()&&Y(s)&&(!s.isEmpty()||s.canMergeWhenEmpty())&&(Y(s)||q(211,r.constructor.name,r.getType()),s.append(...g.getChildren()),g=c[1]),g&&(s===null&&q(212,r.constructor.name,r.getType()),function(y,N){let E=N.getParentOrThrow().getLastChild(),T=N,b=[N];for(;T!==E;)T.getNextSibling()||q(140),T=T.getNextSibling(),b.push(T);let v=y;for(let O of b)v=v.insertAfter(O)}(s,g));let h=Er(l,xn);d&&Y(h)&&(d.canMergeWhenEmpty()||xn(f))&&(h.append(...d.getChildren()),d.remove()),Y(s)&&s.isEmpty()&&s.remove(),l.selectEnd();let x=Y(s)?s.getLastChild():null;Io(x)&&h!==s&&x.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&Rt(e)){let l=Rn();return e.splice(this.anchor.offset,0,[l]),l.select(),l}let n=fa(this),r=Er(this.anchor.getNode(),xn);if(r!==null&&Jt(r)!==null)return null;Y(r)||q(213);let s=r.getChildAtIndex(n),i=s?[s,...s.getNextSiblings()]:[],a=r.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let n=Bc();if(this.insertNodes([n]),e){let r=n.getParentOrThrow(),s=n.getIndexWithinParent();r.select(s,s)}}extract(){let e=[...this.getNodes()],n=e.length,r=e[0],s=e[n-1],[i,a]=Rf(this),l=this.isBackward(),[c,d]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[f,g]=l?[a,i]:[i,a];if(n===0)return[];if(n===1){if(te(r)&&!this.isCollapsed()){let p=r.splitText(f,g),h=f===0?p[0]:p[1];return h?(c.set(h.getKey(),0,"text"),d.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(te(r)&&(f===r.getTextContentSize()?e.shift():f!==0&&([,r]=r.splitText(f),e[0]=r,c.set(r.getKey(),0,"text"))),te(s)){let p=s.getTextContent().length;g===0?e.pop():g!==p&&([s]=s.splitText(g),e[e.length-1]=s,d.set(s.getKey(),s.getTextContentSize(),"text"))}return e}modify(e,n,r){if(Rc(this,e,n,r))return;let s=e==="move",i=Ve(),a=Xn(Nn(i));if(!a)return;let{_blockCursorElement:l,_rootElement:c}=i,d=this.focus.getNode();c===null||l===null||!Y(d)||d.isInline()||d.canBeEmpty()||wc(l,i,c);let f=ci(i,this.focus.key),g=f;if(this.focus.type==="text"&&(g=te(d)?ir(d,f,i):null),this.dirty){let p=ci(i,this.anchor.key),h=p;if(this.anchor.type==="text"){let x=this.anchor.getNode();h=te(x)?ir(x,p,i):null}h&&g&&Ac(a,h,this.anchor.offset,g,this.focus.offset)}if(r==="character"&&te(d)&&d.isUnmergeable()){if(n?this.focus.offset===0:this.focus.offset===d.getTextContentSize()){let p=St(d,n?"previous":"next").getNodeAtCaret();if(te(p)){if(!s){let h=p.getTextContentSize();return n?this.focus.set(p.__key,h-1,"text"):this.focus.set(p.__key,1,"text"),void(this.dirty=!0)}{let h=i.getElementByKey(p.getKey()),x=h?ir(p,h,i):null;if(x){let y=n?x.length:0;Ac(a,x,y,x,y)}}}}}if(gC(a,e,n?"backward":"forward",r),a.rangeCount>0){let p=mi(a,i._rootElement),h=p||a.getRangeAt(0),x=this.anchor.getNode(),y=Kt(x)?x:Cg(x);if(this.applyDOMRange(h),this.dirty=!0,!s)pC(this,n,y),(p?a.direction!=="backward":a.anchorNode===h.startContainer&&a.anchorOffset===h.startOffset)||fC(this)}r==="lineboundary"&&Rc(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&Y(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){let s=n.getParent(),i=n.getNextSibling()||(s===null?null:s.getNextSibling());if(Y(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){let r=this.anchor,s=r.getNode();if(this.forwardDeletion(r,s,e))return;let i=Dg(Fr(r,e?"previous":"next"));if(i.getTextSlices().every((l)=>l===null||l.distance===0)){let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(jn(c))if(c.origin.isInline());else{if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){let d=$o(c);Ca(this,Lr(d,d)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:c,type:"merge-block"})}else{if(l.type==="merge-block")break;if(wr(c)){if(Y(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else l={block:c.origin,type:"merge-next-block"};continue}if(qe(c.origin)){if(c.origin.isIsolated());else if(Gn(c.origin).length>0){if(Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=vc();d.add(c.origin.getKey()),tn(d)}}else if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=vc();d.add(c.origin.getKey()),tn(d)}else c.origin.remove();return}break}}if(l.type==="merge-block"){let{caret:c,block:d}=l;if(Gn(d).length>0)return;return c.origin.isEmpty()&&!d.isEmpty()&&c.origin.getParent()===d.getParent()?void c.origin.remove(!0):(Ca(this,Lr(!c.origin.isEmpty()&&d.isEmpty()?Ts(St(d,c.direction)):i.anchor,c)),this.removeText())}for(let c=r.getNode();c!==null;){if(Jt(c)!==null)return;if(Y(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(of(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&$_(this,r.getNode()))return}else{let l=a.type==="text"?a.getNode():null;if(s=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){let c=a.offset,d=l.getTextContentSize();if(l.is(s)||e&&c!==d||!e&&c!==0)return void w_(l,e,c)}else if(s!==null&&s.isSegmented()){let c=r.offset,d=s.getTextContentSize();if(s.is(l)||e&&c!==0||!e&&c!==d)return void w_(s,e,c)}(function(c,d){let{anchor:f,focus:g}=c,p=f.getNode(),h=g.getNode();if(p===h&&f.type==="text"&&g.type==="text"){let x=f.offset,y=g.offset,N=x<y,E=N?x:y,T=N?y:x,b=T-1;if(E!==b)(function(v){return!(KC(v)||rR(v))})(p.getTextContent().slice(E,T))&&(d?g.set(g.key,b,g.type):f.set(f.key,b,f.type))}})(this,e)}}if(this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let r=this.anchor.getNode();r.isEmpty()&&Kt(r.getParent())&&r.getPreviousSibling()===null&&$_(this,r),cC()}}deleteLine(e){let n=Mf(this.anchor);if(n!==null&&qe(Un(n)))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 Er(this.anchor.getNode(),xn)!==Er(this.focus.getNode(),xn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,e))return;of(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let n=this.focus.isBefore(this.anchor);return Rr()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function fi(e){return e instanceof Fc}function uC(e,n){if(fi(e)){for(let T of e.getNodes())bc(T)&&T.setFormat(n(T.getFormat()));return}if(e.isCollapsed())return e.setFormat(n(e.format)),void Bt(null);let r=[];for(let T of e.getNodes())te(T)?r.push(T):Y(T)?T.setTextFormat(n(T.getTextFormat())):bc(T)&&T.setFormat(n(T.getFormat()));let s=r.length;if(s===0)return e.setFormat(n(e.format)),void Bt(null);let{anchor:i,focus:a}=e,l=e.isBackward(),c=l?a:i,d=l?i:a,f=0,g=r[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===g.getTextContentSize()&&(f=1,g=r[1],p=0),g==null)return;let h=s-1,x=r[h],y=d.type==="text"?d.offset:x.getTextContentSize();if(g.is(x)){if(p===y)return;let T=n(g.getFormat());if(Wn(g)||p===0&&y===g.getTextContentSize())g.setFormat(T);else{let b=g.splitText(p,y),v=p===0?b[0]:b[1];v.setFormat(T),c.type==="text"&&c.set(v.__key,0,"text"),d.type==="text"&&d.set(v.__key,y-p,"text")}return void(e.format=T)}p===0||Wn(g)||([,g]=g.splitText(p),p=0);let N=n(g.getFormat());g.setFormat(N);let E=n(x.getFormat());y>0&&(y===x.getTextContentSize()||Wn(x)||([x]=x.splitText(y)),x.setFormat(E));for(let T=f+1;T<h;T++){let b=r[T];b.setFormat(n(b.getFormat()))}c.type==="text"&&c.set(g.__key,p,"text"),d.type==="text"&&d.set(x.__key,y,"text"),e.format=N|E}function oR(e,n){let r=[];for(let[s,i]of Object.entries(n))typeof i=="boolean"&&r.push([s,i]);r.length!==0&&uC(e,(s)=>{for(let[i,a]of r)s=Mr(s,i,a?Xt[i]:0);return s})}function dC(e,n,r=null){let s=r===null&&ge(e)?Mr(e.format,n,null):r;uC(e,(i)=>Mr(i,n,s))}function D_(e){let n=e.offset;if(e.type==="text")return n;let r=e.getNode();return n===r.getChildrenSize()?r.getTextContent().length:0}function Rf(e){let n=e.getStartEndPoints();if(n===null)return[0,0];let[r,s]=n;return r.type==="element"&&s.type==="element"&&r.key===s.key&&r.offset===s.offset?[0,0]:[D_(r),D_(s)]}function $_(e,n){for(let r=n;r;r=r.getParent()){if(Y(r)){if(r.collapseAtStart(e))return!0;if(Rt(r))break}if(r.getPreviousSibling())break}return!1}function fC(e){let{focus:n,anchor:r}=e,{key:s,offset:i,type:a}=r;r.set(n.key,n.offset,n.type,!0),n.set(s,i,a,!0)}function gC(e,n,r,s){e.modify(n,r,s)}function pC(e,n,r){let s=e.getNodes(),i=s.filter((c)=>Pa(c,r));if(i.length===0||i.length===s.length)return!1;let a=n?i[0]:i[i.length-1],l=Y(a)?a:a.getParentOrThrow();return n?l.selectStart():l.selectEnd(),!0}function of(e,n,r){if(Rc(e,"extend",n,r))return;let s=Ve(),i=Xn(Nn(s));if(!i||typeof i.modify!="function")return;let{_blockCursorElement:a,_rootElement:l}=s,c=e.anchor,d=e.focus.getNode();l===null||a===null||!Y(d)||d.isInline()||d.canBeEmpty()||wc(a,s,l);let f=(U)=>{let J=U.getNode(),W=s.getElementByKey(U.key);return W!==null&&U.type==="text"&&te(J)?ir(J,W,s):W},g=c.getNode(),p=f(c);if(p===null)return;let h=c.offset,x=e.isCollapsed(),y=e.focus,N=x?p:f(y);if(N===null)return;let E=y.offset;if(Ac(i,N,E,N,E),gC(i,"move",n?"backward":"forward",r),i.rangeCount===0)return;let T=mi(i,l)||i.getRangeAt(0),{startContainer:b,startOffset:v}=T;if(x&&r==="character"&&c.type==="text"&&te(g)&&g.isUnmergeable()){if(h===(n?0:g.getTextContentSize())){let U=St(g,n?"previous":"next").getNodeAtCaret();if(te(U)){let J=n?U.getTextContentSize()-1:1;return e.focus.set(U.__key,J,"text"),void(e.dirty=!0)}}}if(x&&r==="character"&&c.type==="text"){let U=n?0:g.getTextContentSize(),J=b===p?v:h!==U?U:-1;if(J>=0)return void(J!==h&&(e.focus.set(c.key,J,"text"),e.dirty=!0))}let[O,k,M,z]=n?[b,v,p,h]:[p,h,b,v],K=Kt(g)?g:Cg(g);e.applyDOMRange({collapsed:!1,endContainer:M,endOffset:z,startContainer:O,startOffset:k}),e.dirty=!0,!pC(e,n,K)&&n&&fC(e),r==="lineboundary"&&Rc(e,"extend",n,r,"decorators")}var rR=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),n=e.test.bind(e);if(n("❤️")&&n("#️⃣")&&n("\uD83D\uDC4D"))return n}catch(e){}return()=>!1})();function w_(e,n,r){let s=e,i=s.getTextContent().split(/(?=\s)/g),a=i.length,l=0,c=0;for(let f=0;f<a;f++){let g=f===a-1;if(c=l,l+=i[f].length,n&&l===r||l>r||g){i.splice(f,1),g&&(c=void 0);break}}let d=i.join("").trim();d===""?s.remove():(s.setTextContent(d),s.select(c,c))}function k_(e,n,r,s){let i,a=n,l=!1;if(Ct(e)){let c=!1,d=e.childNodes,f=d.length,g=s._blockCursorElement;a===f&&f>0&&(c=!0,a=f-1),hi(e,s)!==void 0||Ba(e,s)||(l=!0);let p=d[a],h=!1;if(p===g)p=d[a+1],h=!0;else if(g!==null){let x=g.parentNode;if(e===x)n>Array.prototype.indexOf.call(x.children,g)&&a--}if(i=oi(p),te(i))a=mo(i,c?"next":"previous");else{let x=oi(e);if(x===null)return null;if(Y(x)){let y=s.getElementByKey(x.getKey());y===null&&q(214),[x,a]=Dn(x,y,s).resolveChildIndex(x,y,e,n),Y(x)||q(215),c&&a>=x.getChildrenSize()&&(a=Math.max(0,x.getChildrenSize()-1));let E=x.getChildAtIndex(a);if(Y(E)&&function(T,b,v){let O=T.getParent();return v===null||O===null||!O.canBeEmpty()||O!==v.getNode()}(E,0,r)){let T=c?E.getLastDescendant():E.getFirstDescendant();T===null?x=E:(E=T,x=Y(E)?E:E.getParentOrThrow()),a=0}te(E)?(i=E,x=null,a=mo(E,c?"next":"previous")):E!==x&&c&&!h&&(Y(x)||q(216),a=Math.min(x.getChildrenSize(),a+1))}else{let y=Un(x),N=y!==null?y:x,E=N.getIndexWithinParent(),T=s.getElementByKey(x.getKey()),b="after";if(T!==null&&oi(e)===x){let v=Dn(x,T,s);v.element!==T?b=v.resolveLeafPosition(T,e,n):n===0&&qe(x)&&(b="before")}a=b==="before"?E:E+1,x=N.getParentOrThrow()}if(Y(x))return[_o(x.__key,a,"element"),l]}}else i=oi(e);return te(i)?[_o(i.__key,mo(i,a,"clamp"),"text"),l]:null}function I_(e,n,r){let s=e.offset,i=e.getNode();if(s===0){let a=i.getPreviousSibling(),l=i.getParent();if(n){if((r||!n)&&a===null&&Y(l)&&l.isInline()){let c=l.getPreviousSibling();te(c)&&e.set(c.__key,c.getTextContent().length,"text")}}else Y(a)&&!r&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):te(a)&&!i.isUnmergeable()&&e.set(a.__key,a.getTextContent().length,"text")}else if(s===i.getTextContent().length){let a=i.getNextSibling(),l=i.getParent();if(n&&Y(a)&&a.isInline())e.set(a.__key,0,"element");else if((r||n)&&a===null&&Y(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let c=l.getNextSibling();te(c)&&e.set(c.__key,0,"text")}}}function Mf(e){let n=ot(e.key);return n===null?null:py(n)}function hC(e,n,r){let s=Mf(e),i=Mf(n);if(s===i||s!==null&&i!==null&&s.is(i))return!1;let a=r(s,i);if(s!==null)return Y(s)?n.set(s.getKey(),a?s.getChildrenSize():0,"element"):n.set(s.getKey(),a?s.getTextContentSize():0,"text"),!0;let l=Un(i);if(l===null)return!1;let c=l.getParent();if(c===null)return!1;let d=l.getIndexWithinParent();return n.set(c.getKey(),a?d+1:d,"element"),!0}function mC(e){let n=hC(e.anchor,e.focus,(r,s)=>function(i,a,l,c){if(l!==null&&c!==null){let g=Un(l),p=Un(c);if(g!==null&&g.is(p)){for(let h of Wc(g).values()){if(h===l.getKey())return!0;if(h===c.getKey())return!1}return!0}return g===null||p===null||g.isBefore(p)}if(l!==null){let g=Un(l),p=ot(a.key);return g===null||p===null||!(!g.is(p)&&!g.isParentOf(p))||g.isBefore(p)}let d=Un(c),f=ot(i.key);return d!==null&&f!==null&&!d.is(f)&&!d.isParentOf(f)&&f.isBefore(d)}(e.anchor,e.focus,r,s));return n&&(e.dirty=!0),n}function _C(e,n,r,s,i,a){if(e===null||r===null||!Za(i,e,r))return null;let l=k_(e,n,ge(a)?a.anchor:null,i);if(l===null)return null;let c=k_(r,s,ge(a)?a.focus:null,i);if(c===null)return null;let[d,f]=l,[g,p]=c;if(d.type==="element"&&g.type==="element"){let x=oi(e),y=oi(r);if(qe(x)&&qe(y))return null}let h=i._slotsUsed&&hC(d,g,()=>(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(x,y){if(x.type==="text"&&y.type==="text"){let N=x.isBefore(y),E=x.is(y);I_(x,N,E),I_(y,!N,E),E&&y.set(x.key,x.offset,x.type)}}(d,g),[d,g,f||p||h]}function xC(e){return Y(e)&&!e.isInline()}function CC(e,n,r,s,i,a){let l=Po(),c=new Ss(_o(e,n,i),_o(r,s,a),0,"");return c.dirty=!0,l._selection=c,c}function yC(){let e=_o("root",0,"element"),n=_o("root",0,"element");return new Ss(e,n,0,"")}function vc(){return new Fc(new Set)}function sR(e,n){return ka(null,e,n,null)}function ka(e,n,r,s){let i=r._window;if(i===null)return null;let a=s||i.event,l=a?a.type:void 0,c=l==="selectionchange",d=!df&&(c||l==="beforeinput"||l==="compositionstart"||l==="compositionend"||l==="click"&&a&&a.detail===3||l==="drop"||l===void 0),f,g,p,h;if(ge(e)&&!d)return e.clone();{if(n===null)return null;let O=Yn(n,r._rootElement);if(f=O.anchorNode,g=O.focusNode,p=O.anchorOffset,h=O.focusOffset,(c||l===void 0)&&ge(e)&&!Za(r,f,g))return e.clone()}let x=_C(f,p,g,h,r,e);if(x===null)return null;let[y,N,E]=x,T=0,b="";if(ge(e)){let O=e.anchor;if(y.key===O.key)T=e.format,b=e.style;else{let k=y.getNode();te(k)?(T=k.getFormat(),b=k.getStyle()):Y(k)&&(T=k.getTextFormat(),b=k.getTextStyle())}}let v=new Ss(y,N,T,b);return E&&(v.dirty=!0),v}function ze(){return Po()._selection}function Ns(){return Ve()._editorState._selection}function us(e,n,r,s=1){let{anchor:i,focus:a}=e,l=i.getNode(),c=a.getNode();if(!n.is(l)&&!n.is(c))return;let d=n.__key;if(e.isCollapsed()){let f=i.offset;if(r<=f&&s>0||r<f&&s<0){let g=Math.max(0,f+s);i.set(d,g,"element"),a.set(d,g,"element"),L_(e)}}else{let f=e.isBackward(),g=f?a:i,p=g.getNode(),h=f?i:a,x=h.getNode();if(n.is(p)){let y=g.offset;(r<=y&&s>0||r<y&&s<0)&&g.set(d,Math.max(0,y+s),"element")}if(n.is(x)){let y=h.offset;(r<=y&&s>0||r<y&&s<0)&&h.set(d,Math.max(0,y+s),"element")}}L_(e)}function L_(e){let n=e.anchor,r=n.offset,s=e.focus,i=s.offset,a=n.getNode(),l=s.getNode();if(e.isCollapsed()){if(!Y(a))return;let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text"),s.set(f.__key,g,"text")}return}if(Y(a)){let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text")}}if(Y(l)){let c=l.getChildrenSize(),d=i>=c,f=d?l.getChildAtIndex(c-1):l.getChildAtIndex(i);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),s.set(f.__key,g,"text")}}}function Oc(e,n,r,s,i){let a=null,l=0,c=null;s!==null?(a=s.__key,te(s)?(l=s.getTextContentSize(),c="text"):Y(s)&&(l=s.getChildrenSize(),c="element")):i!==null&&(a=i.__key,te(i)?c="text":Y(i)&&(c="element")),a!==null&&c!==null?e.set(a,l,c):(l=n.getIndexWithinParent(),l===-1&&(l=r.getChildrenSize()),e.set(r.__key,l,"element"))}function F_(e,n,r,s,i){e.type==="text"?e.set(r,e.offset+(n?0:i),"text"):e.offset>s.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Ac(e,n,r,s,i){try{e.setBaseAndExtent(n,r,s,i)}catch(a){}}function P_(e,n,r){let s=ci(e,n.getKey());if(Y(n)){let i=Dn(n,s,e);return[i.element,r+i.getFirstChildOffset()]}return[s,r]}function SC(e,n,r,s,i,a){let l=a.getRootNode(),c=gi(l)||ar(l)?ui(l):null;if(i.has(eC)&&c!==a||c!==null&&zc(c,c))return;let d=Yn(s,a),f;if(!ge(n))return void(e!==null&&Za(r,d.anchorNode,d.focusNode)&&s.removeAllRanges());let{anchor:g,focus:p}=n,h=g.getNode(),x=p.getNode(),[y,N]=P_(r,h,g.offset),[E,T]=P_(r,x,p.offset),{format:b,style:v}=n,O=n.isCollapsed(),k=y,M=E,z=!1;if(g.type==="text"?(k=te(h)?ir(h,y,r):null,z=h.getFormat()!==b||h.getStyle()!==v):ge(e)&&e.anchor.type==="text"&&(z=!0),p.type==="text"&&(M=te(x)?ir(x,E,r):null),k!==null&&M!==null){if(O&&(e===null||z||ge(e)&&(e.format!==b||e.style!==v))&&function(K,U,J,W,ne,ee){K._inputState.collapsedSelectionFormat={format:U,key:ne,offset:W,style:J,timeStamp:ee}}(r,b,v,N,g.key,performance.now()),(s.type!=="Range"||!O)&&d.anchorOffset===N&&d.focusOffset===T&&d.anchorNode===k&&d.focusNode===M){if(c===null||!a.contains(c)){let K=c!==null?fs(c):null;K!==null&&K!==r||i.has(Ec)||a.focus({preventScroll:!0})}if(g.type!=="element")return}if(Ac(s,k,N,M,T),wo&&n.isCollapsed()&&a!==null&&!i.has(Ec)){let K=kc(a);if(K===null||!a.contains(K)){let U=ui(a.ownerDocument),J=U!==null?fs(U):null;J!==null&&J!==r||a.focus({preventScroll:!0})}}if(!i.has(tC)&&n.isCollapsed()&&a!==null&&a===kc(a)){let K=ge(n)&&n.anchor.type==="element"?k.childNodes[N]||null:(f===void 0&&(f=QC(s,a)),f);if(K!==null){let U;if(xo(K)){let J=K.ownerDocument.createRange();J.selectNode(K),U=J.getBoundingClientRect()}else U=K.getBoundingClientRect();(function(J,W,ne){let ee=Hc(ne),se=xg(ee);if(ee===null||se===null)return;let V=ne.getBoundingClientRect();if(W.bottom<V.top)return;let{top:fe,bottom:Ce}=W,Oe=0,oe=0,ae=ne;for(;ae!==null;){let ce=ae===ee.body;if(ce){let we=se.visualViewport;if(we){let _t=we.offsetTop;Oe=_t,oe=_t+we.height}else Oe=0,oe=Nn(J).innerHeight;let ht=se.getComputedStyle(ee.documentElement),Qt=parseFloat(ht.scrollPaddingTop),Be=parseFloat(ht.scrollPaddingBottom);isFinite(Qt)&&(Oe+=Qt),isFinite(Be)&&(oe-=Be)}else{let we=ae===ne?V:ae.getBoundingClientRect();Oe=we.top,oe=we.bottom}let De=0;if(fe<Oe?De=-(Oe-fe):Ce>oe&&(De=Ce-oe),De!==0)if(ce)se.scrollBy(0,De);else{let we=ae.scrollTop;ae.scrollTop+=De;let ht=ae.scrollTop-we;fe-=ht,Ce-=ht}if(ce)break;ae=Es(ae)}})(r,U,a)}}(function(K){K._inputState.isSelectionChangeFromDOMUpdate=!0})(r)}}function iR(e){let n=ze()||Ns();n===null&&(n=Mn().selectEnd()),n.insertNodes(e)}function NC(e,n){for(let r of e.split(/(\r?\n|\t)/))r===`
|
|
10
10
|
`||r===`\r
|
|
11
|
-
`?n.linebreak():r==="\t"?n.tab():r!==""&&n.text(r)}function ig(e){let n=[];return EC(e,{linebreak:()=>n.push(Bc()),tab:()=>n.push(lC()),text:(r)=>n.push(Cn(r))}),n}function aR(){let e=Ue();return e===null?"":e.getTextContent()}function Df(e){let n=[];for(let r of e)Io(r)||(!j(r)&&!qe(r)||r.isInline()?n.push(r):j(r)&&n.push(...Df(r.getChildren())));return n}function fa(e){let n=e;e.isCollapsed()||n.removeText();let r=Ue();ge(r)&&(n=r),ge(n)||q(161);let s=n.anchor,i=s.getNode(),a=s.offset;for(;!xn(i)&&Jt(i)===null;){let l=i;if([i,a]=lR(i,a),l.is(i))break}return a}function lR(e,n){let r=e.getParent();if(!r){let i=Rn();return Mn().append(i),i.select(),[Mn(),0]}if(te(e)){let i=e.splitText(n);if(i.length===0)return[r,e.getIndexWithinParent()];let a=n===0?0:1;return[r,i[0].getIndexWithinParent()+a]}if(!j(e)||n===0)return[r,e.getIndexWithinParent()];let s=e.getChildAtIndex(n);if(s){let i=new Ss(_o(e.__key,n,"element"),_o(e.__key,n,"element"),0,""),a=e.insertNewAfter(i);a&&a.append(s,...s.getNextSiblings())}return[r,e.getIndexWithinParent()+1]}function K_(e){return Io(e)||VC(e)||te(e)||e.isParentRequired()}function rf(e){let n=Rn(),r=null;for(let s=0;s<e.length;s++){let i=e[s];if(K_(i)){if(r===null){r=i.createParentElementNode(),n.append(r);let a=e[s+1];if(Io(i)&&(a===void 0||!K_(a)))continue}r.append(i)}else n.append(i),r=null}return n}function Rc(e,n,r,s,i="decorators-and-blocks"){if(n==="move"&&s==="character"&&!e.isCollapsed()){let[g,p]=r===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(g.key,g.offset,g.type),!0}let a=Fr(e.focus,r?"previous":"next"),l=s==="lineboundary",c=n==="move",d=a,f=i==="decorators-and-blocks";if(!Ty(d)){for(let g of d){f=!1;let{origin:p}=g;if(!qe(p)||p.isIsolated()||(d=g,!l||!p.isInline()))break}if(f)for(let g of Dg(a).iterNodeCarets(n==="extend"?"shadowRoot":"root")){if(jn(g))g.origin.isInline()||(d=g);else{if(j(g.origin))continue;qe(g.origin)&&!g.origin.isInline()&&(d=g)}break}}if(d===a)return!1;if(c&&!l&&qe(d.origin)&&d.origin.isKeyboardSelectable()){let g=vc();return g.add(d.origin.getKey()),tn(g),!0}return d=$o(d),c&&Ua(e.anchor,d),Ua(e.focus,d),f||!l}var Gt=null,At=null,yn=!1,sf=!1,fc=!1,af=new Set,gc=0,z_={characterData:!0,childList:!0,subtree:!0};function Rr(){return yn||Gt!==null&&Gt._readOnly}function Wt(){yn&&q(13)}function TC(){gc>99&&q(14)}function Po(){return Gt===null&&q(195,vC()),Gt}function cR(e){Po()!==null&&At===null&&(At=e),At!==e&&lx(378)}function Ve(){return At===null&&q(337,vC()),At}function bC(){Ve()._dirtyType=2}function vC(){let e=0,n=new Set,r=_s.version;if(typeof window<"u")for(let i of ZC(document)){let a=Qa(i);if(Uc(a))e++;else if(a){let l=String(a.constructor.version||"<0.17.1");l===r&&(l+=" (separately built, likely a bundler configuration issue)"),n.add(l)}}let s=` Detected on the page: ${e} compatible editor(s) with version ${r}`;return n.size&&(s+=` and incompatible editors with versions ${Array.from(n).join(", ")}`),s}function OC(){return At}function U_(e,n,r){let s=n.__type,i=dg(e,s),a=r.get(s);a===void 0&&(a=Array.from(i.transforms),r.set(s,a));let l=a.length;for(let c=0;c<l&&(a[c](n),n.isAttached());c++);}function H_(e,n){return e!==void 0&&e.__key!==n&&e.isAttached()}function AC(e,n){if(!n)return;let r=e._updateTags,s=n;Array.isArray(n)||(s=[n]);for(let i of s)r.add(i)}function uR(e){return Mc(e,Ve()._nodes)}function Mc(e,n){let r=e.type,s=n.get(r);s===void 0&&q(17,r);let i=s.klass;e.type!==i.getType()&&q(18,i.name);let a=i.importJSON(e),l=e.children;if(j(a)&&Array.isArray(l))for(let d=0;d<l.length;d++){let f=Mc(l[d],n);a.append(f)}let c=e.$slots;if(c){Do(a)||q(379,i.name);for(let d in c)Og(a,d,Mc(c[d],n))}return a}function W_(e,n,r){let s=Gt,i=yn,a=At;Gt=n,yn=!0,At=e;try{return r()}finally{Gt=s,yn=i,At=a}}function br(e,n){let r=fc;fc=!0;try{(function(s,i){let{_pendingEditorState:a,_rootElement:l}=s,c=s._headless||l===null;if(a===null)return void(!s._updating&&s._deferred.length>0&&G_(s,s._deferred));let d=s._editorState,f=d._selection,g=a._selection,p=s._dirtyType!==0,h=Gt,x=yn,C=At,{_updating:y,_observer:N}=s,T=null;if(s._pendingEditorState=null,s._editorState=a,!c&&p&&N!==null){At=s,Gt=a,yn=!1,s._updating=!0;try{let{_dirtyType:K,_dirtyElements:U,_dirtyLeaves:J}=s;N.disconnect(),T=vA(d,a,s,K,U,J)}catch(K){if(K instanceof Error&&s._onError(K),sf)throw K;return kC(s,null,l,a),mx(s),s._dirtyType=2,sf=!0,br(s,d),void(sf=!1)}finally{N.observe(l,z_),s._updating=y,Gt=h,yn=x,At=C}}a._readOnly||(a._readOnly=!0);let{_dirtyLeaves:b,_dirtyElements:v,_normalizedNodes:O,_updateTags:k}=s;p&&(s._dirtyType=0,s._cloneNotNeeded.clear(),s._dirtyLeaves=new Set,s._dirtyElements=new Map,s._normalizedNodes=new Set),s._updateTags=new Set,function(K,U){let J=K._decorators,W=K._pendingDecorators||J,ne=U._nodeMap,ee;for(ee in W)ne.has(ee)||(W===J&&(W=KC(K)),delete W[ee])}(s,a);let M=c?null:Xn(Nn(s));if(s._editable&&M!==null&&(p||g===null||g.dirty||!g.is(f))&&l!==null&&!k.has(oC)){At=s,Gt=a;try{if(N!==null&&N.disconnect(),p||g===null||g.dirty){let K=s._blockCursorElement;K!==null&&wc(K,s,l),NC(f,g,s,M,k,l)}(function(K,U,J){let W=K._blockCursorElement;if(ge(J)&&J.isCollapsed()&&J.anchor.type==="element"&&U.contains(kc(U))){let ne=J.anchor,ee=ne.getNode(),se=ne.offset,Y=!1,fe=null;if(se===ee.getChildrenSize())pc(ee.getChildAtIndex(se-1))&&(Y=!0);else{let Ce=ee.getChildAtIndex(se);if(Ce!==null&&pc(Ce)){let Ae=Ce.getPreviousSibling();(Ae===null||pc(Ae))&&(Y=!0,fe=K.getElementByKey(Ce.__key))}}if(Y){let Ce=Dn(ee,K.getElementByKey(ee.__key),K).element;return W===null&&(K._blockCursorElement=W=function(Ae){let oe=Ae.theme,ae=Sn().createElement("div");ae.contentEditable="false",ae.setAttribute("data-lexical-cursor","true");let ue=oe.blockCursor;if(ue!==void 0){if(typeof ue=="string"){let we=rl(ue);ue=oe.blockCursor=we}ue!==void 0&&ae.classList.add(...ue)}return ae}(K._config)),U.style.caretColor="transparent",void(fe===null?Ce.appendChild(W):Ce.insertBefore(W,fe))}}W!==null&&wc(W,K,U)})(s,l,g)}finally{N!==null&&N.observe(l,z_),At=C,Gt=h}}T!==null&&function(K,U,J,W,ne){let ee=Array.from(K._listeners.mutation),se=ee.length;for(let Y=0;Y<se;Y++){let[fe,Ce]=ee[Y];for(let Ae of Ce){let oe=U.get(Ae);oe!==void 0&&fe(oe,{dirtyLeaves:W,prevEditorState:ne,updateTags:J})}}}(s,T,k,b,d),ge(g)||g===null||f!==null&&f.is(g)||s.dispatchCommand(Gf);let z=s._pendingDecorators;if(z!==null&&(s._decorators=z,s._pendingDecorators=null,xa("decorator",s,!0,z)),function(K,U,J){let W=V_(U),ne=V_(J);W!==ne&&xa("textcontent",K,!0,ne)}(s,i||d,a),xa("update",s,!0,{dirtyElements:v,dirtyLeaves:b,editorState:a,mutatedNodes:T,normalizedNodes:O,prevEditorState:i||d,tags:k}),!y)G_(s,s._deferred);(function(K){let U=K._updates;if(U.length===0)return void(K._cascadeCount=0);if(function(W){if(af.has(W))return;af.add(W),setTimeout(()=>{af.delete(W),W._cascadeCount=0},0)}(K),K._cascadeCount++>99)return K._updates=[],K._cascadeCount=0,void K._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: ${K._config.namespace}`));let J=U.shift();if(J){let[W,ne]=J;Ia(K,W,ne)}})(s)})(e,n)}finally{fc=r}}function xa(e,n,r,...s){let i=n._updating;n._updating=r;try{let a=n._listeners[e],l=Array.from(a);for(let[c,d]of l){d&&d();let f=c(...s);a.has(c)?a.set(c,f):f&&f()}}finally{n._updating=i}}function RC(e,n,r,s){let i=pg(e),a;if(!fc)for(let l=0;l<i.length;l++)i[l]._updating||(i[l]._cascadeCount=0);for(let l=4;l>=0;l--)for(let c=0;c<i.length;c++){let d=i[c];if(c>0&&d._updating){a=d;break}let f=d._commands.get(n);if(f!==void 0){let g=f[l];if(g.size>0){let p=!1;if(Hn(d,()=>{for(let h of g)if(h(r,s))return void(p=!0)}),p)return p}}}return a&&a.update(()=>{RC(a,n,r,s)}),!1}function G_(e,n){if(e._deferred=[],n.length!==0){let r=e._updating;e._updating=!0;try{for(let s=0;s<n.length;s++)n[s]()}finally{e._updating=r}}}function j_(e,n){let r=e._updates,s=n||!1;for(;r.length!==0;){let i=r.shift();if(i){let[a,l]=i,c=e._pendingEditorState,d;l!==void 0&&(d=l.onUpdate,l.skipTransforms&&(s=!0),l.discrete&&(c===null&&q(191),c._flushSync=!0),d&&e._deferred.push(d),AC(e,l.tag)),c==null?Ia(e,a,l):a()}}return s}function Ia(e,n,r){let s=e._updateTags,i,a=!1,l=!1;r!==void 0&&(i=r.onUpdate,AC(e,r.tag),a=r.skipTransforms||!1,l=r.discrete||!1),i&&e._deferred.push(i);let{_editorState:c,_pendingEditorState:d}=e,f=!1;(d===null||d._readOnly)&&(d=e._pendingEditorState=MC(d||c),f=!0),d._flushSync=l;let g=Gt,p=yn,h=At,x=e._updating;Gt=d,yn=!1,e._updating=!0,At=e;let C=e._headless||e.getRootElement()===null;cg(null);try{f&&(C?c._selection!==null&&(d._selection=c._selection.clone()):d._selection=function(b,v){let O=b.getEditorState()._selection,k=Xn(Nn(b));return ge(O)||O==null?ka(O,k,b,v):O.clone()}(e,r&&r.event||null));let N=e._compositionKey;n(),a=j_(e,a),function(b,v){let O=v.getEditorState()._selection,k=b._selection;if(ge(k)){let{anchor:M,focus:z}=k,K;if(M.type==="text"&&(K=M.getNode(),K.selectionTransform(O,k)),z.type==="text"){let U=z.getNode();K!==U&&U.selectionTransform(O,k)}}}(d,e),e._dirtyType!==0&&(a?function(b,v){let O=v._dirtyLeaves,k=b._nodeMap;for(let M of O){let z=k.get(M);te(z)&&z.isAttached()&&z.isSimpleText()&&!z.isUnmergeable()&&d_(z)}}(d,e):function(b,v){let{_dirtyLeaves:O,_dirtyElements:k}=v,M=b._nodeMap,z=Mo(),K=new Map,U=O,J=U.size,W=k,ne=W.size;for(;J>0||ne>0;){if(J>0){v._dirtyLeaves=new Set;for(let ee of U){let se=M.get(ee);te(se)&&se.isAttached()&&se.isSimpleText()&&!se.isUnmergeable()&&d_(se),se!==void 0&&H_(se,z)&&U_(v,se,K),O.add(ee)}if(U=v._dirtyLeaves,J=U.size,J>0){gc++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,W.delete("root")&&W.set("root",!0);for(let ee of W){let se=ee[0],Y=ee[1];if(k.set(se,Y),!Y)continue;let fe=M.get(se);fe!==void 0&&H_(fe,z)&&U_(v,fe,K)}U=v._dirtyLeaves,J=U.size,W=v._dirtyElements,ne=W.size,gc++}v._dirtyLeaves=O,v._dirtyElements=k}(d,e),j_(e),function(b,v,O,k){let M=b._nodeMap,z=v._nodeMap,K=[];for(let[W]of k){let ne=z.get(W);ne!==void 0&&(ne.isAttached()||(j(ne)&&mc(ne,W,M,z,K,k),M.has(W)||k.delete(W),K.push(W)))}for(let W of O){let ne=z.get(W);ne===void 0||ne.isAttached()||(Do(ne)&&ne.__slots!==null&&mc(ne,W,M,z,K,O),M.has(W)||O.delete(W),K.push(W))}for(let W of K)z.delete(W);let U=Ve(),J=U._compositionKey;J===null||z.has(J)||(U._compositionKey=null)}(c,d,e._dirtyLeaves,e._dirtyElements)),N!==e._compositionKey&&(d._flushSync=!0);let T=d._selection;if(ge(T)){e._slotsUsed&&_C(T);let b=d._nodeMap,v=T.anchor.key,O=T.focus.key;b.get(v)!==void 0&&b.get(O)!==void 0||q(19)}else fi(T)&&T._nodes.size===0&&(d._selection=null)}catch(N){return N instanceof Error&&e._onError(N),e._pendingEditorState=c,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void br(e)}finally{Gt=g,yn=p,At=h,e._updating=x,gc=0}e._dirtyType!==0||e._deferred.length>0||function(N,T){let b=T.getEditorState()._selection,v=N._selection;if(v!==null){if(v.dirty||!v.is(b))return!0}else if(b!==null)return!0;return!1}(d,e)?d._flushSync?(d._flushSync=!1,br(e)):f&&AR(()=>{br(e)}):(d._flushSync=!1,f&&(s.clear(),e._deferred=[],e._pendingEditorState=null))}function Hn(e,n,r){At===e&&r===void 0?Rr()?Ia(e,n,r):n():Ia(e,n,r)}function dR(e){if(Rt(e)){let n=null;for(let r of e.getChildren())n=r.isInline()?(n||r.replace(r.createParentElementNode())).append(r):null}}class ko extends ln{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:dR,extends:ln})}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&&q(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 uA[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Gn(this).length===0}isDirty(){let e=Ve()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[];for(let r of Gn(this)){let s=$r(this,r);j(s)&&e.push(...s.getAllTextNodes())}let n=this.getFirstChild();for(;n!==null;){if(te(n)&&e.push(n),j(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;j(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;j(e);){let n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;if(e>=r){let i=n[r-1];return j(i)&&i.getLastDescendant()||i||null}let s=n[e];return j(s)&&s.getFirstDescendant()||s||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:ot(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&q(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:ot(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&q(96,this.__key),e}getChildAtIndex(e){let n=this.getChildrenSize(),r,s;if(e<n/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=e;){if(s===e)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=n-1;r!==null&&s>=e;){if(s===e)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let e=_y(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContent(),j(i)&&s!==r-1&&!i.isInline()&&(e+=ds)}return e}getTextContentSize(){let e=function(s){let i=0;for(let a of Gn(s)){let l=$r(s,a);l!==null&&(i+=l.getTextContentSize())}return i}(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContentSize(),j(i)&&s!==r-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let n=hc[e];return(this.getFormat()&n)!==0}return!1}hasTextFormat(e){let n=Xt[e];return(this.getTextFormat()&n)!==0}getFormatFlags(e,n){return Mr(this.getLatest().__textFormat,e,n)}getTextStyle(){return this.getLatest().__textStyle}select(e,n){Wt();let r=Ue(),s=e,i=n,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){let c=this.getFirstChild();if(te(c)||j(c))return c.select(0,0)}else if(!(e!==void 0&&e!==a||n!==void 0&&n!==a)){let c=this.getLastChild();if(te(c)||j(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return ge(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):yC(l,s,l,i,"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((n)=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""&&hc[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let n=this.getWritable();return n.__textFormat=e,n}setTextStyle(e){let n=this.getWritable();return n.__textStyle=e,n}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){Nc(this)&&q(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();e+n<=s||q(226,String(e),String(n),String(s));for(let h of r);let a=i.__key,l=[],c=[],d=this.getChildAtIndex(e+n),f=null,g=s-n+r.length;if(e!==0)if(e===s)f=this.getLastChild();else{let h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(n>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let x=0;x<n;x++){h===null&&q(100);let C=h.getNextSibling(),y=h.__key;zn(h.getWritable()),c.push(y),h=C}}let p=f;for(let h of r){p!==null&&h.is(p)&&(f=p=p.getPreviousSibling());let x=h.getWritable();x.__parent===a&&g--,zn(x);let C=h.__key;if(p===null)i.__first=C,x.__prev=null;else{let y=p.getWritable();y.__next=C,x.__prev=y.__key}h.__key===a&&q(76),x.__parent=a,l.push(C),p=h}if(e+n===s){if(p!==null)p.getWritable().__next=null,i.__last=p.__key}else if(d!==null){let h=d.getWritable();if(p!==null){let x=p.getWritable();h.__prev=p.__key,x.__next=d.__key}else h.__prev=null}if(i.__size=g,c.length){let h=Ue();if(ge(h)){let x=new Set(c),C=new Set(l),{anchor:y,focus:N}=h;Y_(y,x,C)&&Oc(y,y.getNode(),this,f,d),Y_(N,x,C)&&Oc(N,N.getNode(),this,f,d),g!==0||this.canBeEmpty()||Rt(this)||this.remove()}}return i}getDOMSlot(e){return new si(e)}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){let r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px",n.setAttribute("data-lexical-indent",String(r)));let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||Rt(this)||this.getChildren().some(te)||(n!==0&&(e.textFormat=n),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,n){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,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,n){let r=Dn(this,e,n),s=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){let a=n.getElementByKey(i.getKey());a!==null&&(s==null?(r.insertChild(a),s=a):s!==a&&r.replaceChild(a,s),s=s.nextSibling)}}}function j(e){return e instanceof ko}function Y_(e,n,r){let s=e.getNode();for(;s;){let i=s.__key;if(n.has(i)&&!r.has(i))return!0;s=s.getParent()}return!1}class Pc extends ln{__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&&q(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function qe(e){return e instanceof Pc}class Ya extends ko{__cachedText;$config(){return this.config("root",{extends:ko})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){let e=this.__cachedText;return e===null||!Rr()&&Ve()._dirtyType!==0?super.getTextContent():e}remove(){q(52)}replace(e){q(53)}insertBefore(e){q(54)}insertAfter(e){q(55)}updateDOM(e,n){return!1}splice(e,n,r){for(let s of r)j(s)||qe(s)||q(282);return super.splice(e,n,r)}static importJSON(e){return Mn().updateFromJSON(e)}collapseAtStart(){return!0}}function Kt(e){return e instanceof Ya}function MC(e){return new Va(gx(e._nodeMap),null,e._slotsUsed)}function ag(){return new Va(new Map([["root",new Ya]]),null,!1)}function $f(e){let n=e.exportJSON(),r=e.constructor;if(n.type!==r.getType()&&q(130,r.name),j(e)){let i=n.children;Array.isArray(i)||q(59,r.name);let a=e.getChildren();for(let l=0;l<a.length;l++){let c=$f(a[l]);i.push(c)}}let s=Gn(e);if(s.length>0){let i={};for(let a of s){let l=$r(e,a);l===null&&q(366,r.name,a),i[a]=$f(l)}n.$slots=i}return n}function fR(e){return e instanceof Va}class Va{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,n=null,r=!1){this._nodeMap=e,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=r}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,n){return W_(n&&n.editor||null,this,e)}clone(e){let n=new Va(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return W_(null,this,()=>({root:$f(Mn())}))}}class lg extends ko{$config(){return this.config("artificial",{extends:ko})}createDOM(e){return Sn().createElement("div")}}class Xa extends ln{$config(){return this.config("linebreak",{importDOM:{br:(e)=>DC(e)||$C(e)?null:{conversion:gR,priority:0}}})}getTextContent(){return`
|
|
12
|
-
`}createDOM(){return Sn().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function gR(e){return{node:Bc()}}function Bc(){return el(new Xa)}function Io(e){return e instanceof Xa}function DC(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Dc(r)){let s=n.lastChild;if(s===e||s.previousSibling===e&&Dc(s))return!0}}return!1}function $C(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Dc(r))return!1;let s=n.lastChild;if(s===e||s.previousSibling===e&&Dc(s))return!0}return!1}function Dc(e){return xo(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class qa extends ko{$config(){return this.config("paragraph",{extends:ko,importDOM:{p:()=>({conversion:pR,priority:0})}})}createDOM(e){let n=Sn().createElement("p"),r=li(e.theme,"paragraph");if(r!==void 0)n.classList.add(...r);return n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){this.isEmpty()&&n.append(Sn().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let n=this.getChildren().find(te);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){let r=Rn();r.setTextFormat(e.format),r.setTextStyle(e.style);let s=this.getDirection();return r.setDirection(s),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||te(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 n=Rn();if(cy(n,e),ay(e,n),n.getFormatType()===""){let r=e.getAttribute("align");r&&r&&r in hc&&n.setFormat(r)}return ly(n,e),{node:n}}function Rn(){return el(new qa)}function wC(e){return e instanceof qa}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 kC(e,n,r,s,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ag(),e._pendingEditorState=s,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.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 l=e._observer;l!==null&&(l.disconnect(),e._observer=null),n!==null&&(n.textContent="",function(c,d){let f=`__lexicalKey_${d._key}`;delete c[f]}(n,e)),r!==null&&(r.textContent="",a.set("root",r),BC(r,e,"root"))}function IC(e){let n=new Set,r=new Set;for(let{klass:s,ownNodeConfig:i}of nl(e)){let a=s.transform;if(!r.has(a)){r.add(a);let l=s.transform();l&&n.add(l)}if(i){let l=i.$transform;l&&n.add(l)}}return n}var La={$createDOM:(e,n)=>e.createDOM(n._config,n),$decorateDOM:(e,n,r,s)=>{},$exportDOM:(e,n)=>{let r=Kc(n,e.getType());return r&&r.exportDOM!==void 0?r.exportDOM(n,e):e.exportDOM(n)},$extractWithChild:(e,n,r,s,i)=>j(e)&&e.extractWithChild(n,r,s),$getDOMSlot:(e,n,r)=>e.getDOMSlot(n),$getSlotTargetElement:(e,n,r,s)=>null,$shouldExclude:(e,n,r)=>j(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,n,r)=>!n||e.isSelected(n),$updateDOM:(e,n,r,s)=>e.updateDOM(n,r,s._config)};function bR(e){let n=e||{},r=OC(),s=n.theme||{},i=e===void 0?r:n.parentEditor||null,a=n.disableEvents||!1,l=ag(),c=n.namespace||(i!==null?i._config.namespace:UC()),d=n.editorState,f=[Ya,ms,Xa,ja,qa,lg,...n.nodes||[]],{onError:g,onWarn:p,html:h}=n,x=n.editable===void 0||n.editable,C;if(e===void 0&&r!==null)C=r._nodes;else{C=new Map;for(let N=0;N<f.length;N++){let T=f[N],b=null,v=null;if(T&&typeof T=="object"){let M=T;T=M.replace,b=M.with,v=M.withKlass||null}if(typeof T!="function"||!T.prototype||!(T===ln||T.prototype instanceof ln)){let M="<unknown>";try{M=JSON.parse(fx)}catch(z){}q(365,String(N-f.length+(n.nodes?n.nodes.length:0)),typeof T=="function"?`${T.name}${typeof T.getType=="function"?` (type ${String(T.getType())})`:""}`:String(T),String(M))}tl(T);let O=T.getType(),k=IC(T);C.set(O,{exportDOM:h&&h.export?h.export.get(T):void 0,klass:T,replace:b,replaceWithKlass:v,sharedNodeState:xx(f[N]),transforms:k})}}let y=new _s(l,i,C,{disableEvents:a,dom:{...La,...e&&e.dom},namespace:c,theme:s},g||console.error,p||hR,function(N,T){let b=new Map,v=new Set,O=(k)=>{Object.keys(k).forEach((M)=>{let z=b.get(M);z===void 0&&(z=[],b.set(M,z)),z.push(k[M])})};return N.forEach((k)=>{let M=k.klass.importDOM;if(M==null||v.has(M))return;v.add(M);let z=M.call(k.klass);z!==null&&O(z)}),T&&O(T),b}(C,h?h.import:void 0),x,e);return d!==void 0&&(y._pendingEditorState=d,y._dirtyType=2),function(N){N.registerCommand(jf,PA,ti),N.registerCommand(Yf,BA,ti),N.registerCommand(Vf,KA,ti),N.registerCommand(Xf,zA,ti),N.registerCommand(Qf,UA,ti)}(y),y}function vR(e,n){let r=e.get(n);e.delete(n),r&&r()}function ga(e,n,r){return e.set(n,r),vR.bind(null,e,n)}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,n,r,s,i,a,l,c,d){this._createEditorArgs=d,this._parentEditor=n,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Ea,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=s,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=UC(),this._onError=i,this._onWarn=a,this._htmlConversions=l,this._editable=c,this._headless=n!==null&&n._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 ga(this._listeners.update,e)}registerEditableListener(e){return ga(this._listeners.editable,e)}registerDecoratorListener(e){return ga(this._listeners.decorator,e)}registerTextContentListener(e){return ga(this._listeners.textcontent,e)}registerRootListener(e){let n=this._listeners.root;return Lg(ga(n,e,e(this._rootElement,null)||void 0),()=>function(r,s,i){let a=r.get(s);a&&a(),r.set(s,s(...i)||void 0)}(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&q(35);let s=this._commands;s.has(e)||s.set(e,[new ei,new ei,new ei,new ei,new ei]);let i=s.get(e);i===void 0&&q(36,String(e));let a=function(c){return 7&c}(r),l=i[a];return a!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),i.every((c)=>c.size===0)&&s.delete(e)}}registerMutationListener(e,n,r){let s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(n);a===void 0&&(a=new Set,i.set(n,a)),a.add(s);let l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,s),()=>{a.delete(s),a.size===0&&i.delete(n)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return n===void 0&&q(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){let r=this._editorState,s=kf(r).get(n.getType());if(!s)return;let i=new Map;for(let a of s.keys())i.set(a,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,n){let r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){let r=this.registerNodeTransformToKlass(e,n),s=[r],i=r.replaceWithKlass;if(i!=null){let a=this.registerNodeTransformToKlass(i,n);s.push(a)}return function(a,l){let c=kf(a.getEditorState()),d=[];for(let f of l){let g=c.get(f);g&&d.push(g)}if(d.length===0)return;a.update(()=>{for(let f of d)for(let g of f.keys()){let p=ot(g);p&&p.markDirty()}},a._pendingEditorState===null?{tag:dc}:void 0)}(this,s.map((a)=>a.klass.getType())),()=>{s.forEach((a)=>a.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...n){return ie(this,e,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let r=li(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,kC(this,n,e,s,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||HA(n),r!=null&&n.classList.remove(...r)),e!==null){let i=xg(e),a=e.style;a.userSelect="text",a.whiteSpace="pre-wrap",a.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,mx(this),this._updateTags.add(dc),br(this),this._config.disableEvents||function(l,c){let d=l.ownerDocument;Tf.set(l,d);let f=yc.get(d);f===void 0&&(f={editors:new Set,hasShadowEditor:void 0},yc.set(d,f)),f.editors.add(c),f.hasShadowEditor=void 0,l.__lexicalEditor=c;let g=Qx(l);g.push(FA.register(d));for(let p=0;p<Ef.length;p++){let[h,x]=Ef[p],C=typeof x=="function"?(y)=>{E_(y)||(bf(y),(c.isEditable()||h==="click")&&x(y,c))}:(y)=>{if(E_(y))return;bf(y);let N=c.isEditable();switch(h){case"cut":return N&&ie(c,tg,y);case"copy":return ie(c,eg,y);case"paste":return N&&ie(c,qf,y);case"dragstart":return N&&ie(c,zx,y);case"dragover":return N&&ie(c,Ux,y);case"dragend":return N&&ie(c,Hx,y);case"focus":return N&&ie(c,Gx,y);case"blur":return N&&ie(c,jx,y);case"drop":return N&&ie(c,Kx,y)}};g.push(ng(l,h,C))}}(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(dc),br(this);xa("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&q(38);let r=e;r._readOnly&&(r=MC(e),r._selection=e._selection?e._selection.clone():null),hx(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),br(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Hn(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[a,l]of r._nodeMap.entries())j(l)?this._dirtyElements.set(a,!0):this._dirtyLeaves.add(a)},{discrete:!this._updating||void 0})}parseEditorState(e,n){return function(r,s,i){let a=ag(),l=Gt,c=yn,d=At,{_dirtyElements:f,_dirtyLeaves:g,_cloneNotNeeded:p,_dirtyType:h}=s;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Gt=a,yn=!1,At=s,cg(null);try{let x=s._nodes;Mc(r.root,x),i&&i(),a._readOnly=!0,a._parsed=!0}catch(x){x instanceof Error&&s._onError(x)}finally{s._dirtyElements=f,s._dirtyLeaves=g,s._cloneNotNeeded=p,s._dirtyType=h,Gt=l,yn=c,At=d}return a}(typeof e=="string"?JSON.parse(e):e,this,n)}read(...e){let[n,r]=e.length===1?["force-commit",e[0]]:e;return n==="force-commit"&&br(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(r,{editor:this})}update(e,n){(function(r,s,i){r._updating?r._updates.push([s,i]):Ia(r,s,i)})(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{let s=Ue(),i=Mn();s!==null?s.dirty||tn(s.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),xs("focus"),YC(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let n=Xn(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,xa("editable",this,!0,e),this._slotsUsed&&this.update(()=>bC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=fx;var wf=null;function cg(e){wf=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),LC=1;function OR(){LC=1}function dg(e,n){let r=Kc(e,n);return r===void 0&&q(30,n),r}function Kc(e,n){return e._nodes.get(n)}var AR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function zc(e,n){let r=n!==void 0?n:(()=>{let a=e.getRootNode();return gi(a)||ar(a)?ui(a):null})();if(!Ct(r))return!1;if(r.hasAttribute("data-lexical-slot"))return!1;let s=gg(r),i=r.nodeName;return og(s)&&(i==="INPUT"||i==="TEXTAREA"||r.contentEditable==="true"&&Qa(r)==null)}var RR=zc;function Za(e,n,r){let s=e.getRootElement();if(!s)return!1;try{if(!n||!s.contains(n)||!s.contains(r))return!1}catch(i){return!1}return fs(n)===e&&e.read("latest",()=>!zc(n))}function Uc(e){return e instanceof _s}function fs(e){let n=e;for(;n!=null;){let r=Qa(n);if(Uc(r))return r;n=Es(n)}return null}function Qa(e){return e?e.__lexicalEditor:null}function MR(e){return aA.test(e)?"rtl":lA.test(e)?"ltr":null}function Fa(e){return sg(e)||e.isToken()}function Wn(e){return Fa(e)||e.isSegmented()}function xo(e){return _i(e)&&e.nodeType===3}function gi(e){return _i(e)&&e.nodeType===9}function FC(e){let n=e;for(;n!=null;){if(xo(n))return n;n=n.firstChild}return null}function Mr(e,n,r){let s=Xt[n];if(r!==null&&(e&s)===(r&s))return e;let i=e^s;return n==="subscript"?i&=~Xt.superscript:n==="superscript"?i&=~Xt.subscript:n==="lowercase"?(i&=~Xt.uppercase,i&=~Xt.capitalize):n==="uppercase"?(i&=~Xt.lowercase,i&=~Xt.capitalize):n==="capitalize"&&(i&=~Xt.lowercase,i&=~Xt.uppercase),i}function DR(e){return te(e)||Io(e)||qe(e)}function PC(e,n){let r=function(){let l=wf;return wf=null,l}();if((n=n||r&&r.__key)!=null)return void(e.__key=n);Wt(),TC();let s=Ve(),i=Po(),a=""+LC++;i._nodeMap.set(a,e),j(e)?s._dirtyElements.set(a,!0):s._dirtyLeaves.add(a),s._cloneNotNeeded.add(a),s._dirtyType===0&&(s._dirtyType=1),e.__key=a}function zn(e){Jt(e)!==null&&q(380,e.__key,String(Jt(e)));let n=e.getParent();if(n!==null){let r=e.getWritable(),s=n.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),l=a!==null?a.__key:null,c=i!==null?i.__key:null,d=i!==null?i.getWritable():null,f=a!==null?a.getWritable():null;i===null&&(s.__first=l),a===null&&(s.__last=c),d!==null&&(d.__next=l),f!==null&&(f.__prev=c),r.__prev=null,r.__next=null,r.__parent=null,s.__size--}}var $R=zn;function $c(e){TC(),Nc(e)&&q(323,e.__key,e.__type);let n=e.getLatest(),r=n.__parent!==null?n.__parent:Dr(n)?n.__slotHost:null,s=Po(),i=Ve(),a=s._nodeMap,l=i._dirtyElements;r!==null&&function(d,f,g){let p=d;for(;p!==null;){if(g.has(p))return;let h=f.get(p);if(h===void 0)break;g.set(p,!1),p=h.__parent!==null?h.__parent:Dr(h)?h.__slotHost:null}}(r,a,l);let c=n.__key;i._dirtyType===0&&(i._dirtyType=1),j(e)?l.set(c,!0):i._dirtyLeaves.add(c)}function Bt(e){Wt();let n=Ve(),r=n._compositionKey;if(e!==r){if(n._compositionKey=e,r!==null){let s=ot(r);s!==null&&s.getWritable()}if(e!==null){let s=ot(e);s!==null&&s.getWritable()}}}function Mo(){if(Rr())return null;return Ve()._compositionKey}function ot(e,n){let r=(n||Po())._nodeMap.get(e);return r===void 0?null:r}function fg(e,n){let r=hi(e,Ve());return r!==void 0?ot(r,n):null}function BC(e,n,r){e[`__lexicalKey_${n._key}`]=r}function hi(e,n){return e[`__lexicalKey_${n._key}`]}function gg(e,n){let r=e;for(;r!=null;){let s=fg(r,n);if(s!==null)return s;r=Es(r)}return null}function KC(e){let n=e._decorators,r=Object.assign({},n);return e._pendingDecorators=r,r}function V_(e){return e.read(()=>Mn().getTextContent())}function Mn(){return Po()._nodeMap.get("root")}function tn(e){Wt();let n=Po();e!==null&&(e.dirty=!0,e.setCachedNodes(null),ge(e)&&Ve()._slotsUsed&&_C(e)),n._selection=e}function X_(){Wt(),hx(Ve())}function oi(e){let n=function(r,s){let i=r;for(;i!=null;){let a=hi(i,s);if(a!==void 0)return a;i=Es(i)}return null}(e,Ve());return n===null?null:ot(n)}function zC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pg(e){let n=[];for(let r=e;r!==null;r=r._parentEditor)n.push(r);return n}function UC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function HC(e){return xo(e)?e.nodeValue:null}function hg(e,n,r){let s=Xn(Nn(n));if(s===null)return;let i=Yn(s,n._rootElement),a=i.anchorNode,{anchorOffset:l,focusOffset:c}=i;if(a!==null){let d=HC(a),f=gg(a);if(d!==null&&te(f)){if((d===Na||d===zf)&&r){let g=r.length;d=r,l=g,c=g}d!==null&&mg(f,d,l,c,e)}}}function mg(e,n,r,s,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let l=a.isComposing();if(a.isToken()&&l)return;let c=n;if((l||i)&&(n.endsWith(Na)&&(c=n.slice(0,-Na.length)),i)){let f=zf,g;for(;(g=c.indexOf(f))!==-1;)c=c.slice(0,g)+c.slice(g+f.length),r!==null&&r>g&&(r=Math.max(g,r-f.length)),s!==null&&s>g&&(s=Math.max(g,s-f.length))}let d=a.getTextContent();if(i||c!==d){let f=Ue();if(c===""){if(Bt(null),Ha||gs||Wa)a.remove();else{let y=Ve();lf(a,"",f),setTimeout(()=>{y.update(()=>{a.isAttached()&&a.getTextContent()===""&&a.remove()})},20)}return}let g=a.getParent(),p=Ns(),h=a.getTextContentSize(),x=Mo(),C=a.getKey();if(a.isToken()&&!l||x!==null&&C===x&&!l||ge(p)&&(g!==null&&!g.canInsertTextBefore()&&p.anchor.offset===0||p.anchor.key===e.__key&&p.anchor.offset===0&&!a.canInsertTextBefore()&&!l||p.focus.key===e.__key&&p.focus.offset===h&&!a.canInsertTextAfter()&&!l))return void a.markDirty();if(!ge(f)||r===null||s===null)return void lf(a,c,f);if(f.setTextNodeRange(a,r,a,s),a.isSegmented()){let y=Cn(a.getTextContent());a.replace(y),a=y}lf(a,c,f)}}}function lf(e,n,r){if(e.setTextContent(n),ge(r)){let s=e.getKey(),i=!1;for(let a of["anchor","focus"]){let l=r[a];l.type==="text"&&l.key===s&&(l.offset=mo(e,l.offset,"clamp"),i=!0)}i&&(r._cachedNodes=null,r._cachedIsBackward=null)}}function ic(e,n,r){let s=n[r]||!1;return s==="any"||s===e[r]}function WC(e,n){return ic(e,n,"altKey")&&ic(e,n,"ctrlKey")&&ic(e,n,"shiftKey")&&ic(e,n,"metaKey")}function Qe(e,n,r){if(!WC(e,r))return!1;if(e.key.toLowerCase()===n.toLowerCase())return!0;if(n.length>1)return!1;if(e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(n))return e.code===`Digit${n}`;let s="Key"+n.toUpperCase();return e.code===s}var or={ctrlKey:!Bn,metaKey:Bn},q_={altKey:Bn,ctrlKey:!Bn};function J_(e){return e.key==="Backspace"}function wR(e){let n=Mn();if(ge(e)){let{anchor:r,focus:s}=e,i=r.getNode();if(Kt(i))return r.set(i.getKey(),0,"element"),s.set(i.getKey(),i.getChildrenSize(),"element"),ni(e),e;let a=i.getTopLevelElementOrThrow(),l=a.getParent();if(l===null)return j(a)&&(r.set(a.getKey(),0,"element"),s.set(a.getKey(),a.getChildrenSize(),"element"),ni(e)),e;let c=l;return r.set(c.getKey(),0,"element"),s.set(c.getKey(),c.getChildrenSize(),"element"),ni(e),e}{let r=n.select(0,n.getChildrenSize());return tn(ni(r)),r}}function li(e,n){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let r=e.__lexicalClassNameCache,s=r[n];if(s!==void 0)return s;let i=e[n];if(typeof i=="string"){let a=rl(i);return r[n]=a,a}return i}function _g(e,n,r,s,i){if(r.size===0)return;let{__type:a,__key:l}=s,c=n.get(a);c===void 0&&q(33,a);let d=c.klass,f=e.get(d);f===void 0&&(f=new Map,e.set(d,f));let g=f.get(l),p=g==="destroyed"&&i==="created";(g===void 0||p)&&f.set(l,p?"updated":i)}function kR(e){let n=e.getType(),r=Po();if(r._readOnly){let a=kf(r).get(n);return a?Array.from(a.values()):[]}let s=r._nodeMap,i=[];for(let[,a]of s)a instanceof e&&a.__type===n&&a.isAttached()&&i.push(a);return i}function Z_(e,n,r){let s=e.getParent(),i=r,a=e;return s!==null&&(n&&r===0?(i=a.getIndexWithinParent(),a=s):n||r!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=s)),a.getChildAtIndex(n?i-1:i)}function GC(e,n){let r=e.offset;if(e.type==="element")return Z_(e.getNode(),n,r);{let s=e.getNode();if(n&&r===0||!n&&r===s.getTextContentSize()){let i=n?s.getPreviousSibling():s.getNextSibling();return i===null?Z_(s.getParentOrThrow(),n,s.getIndexWithinParent()+(n?0:1)):i}}return null}function jC(e){let n=Nn(e).event,r=n&&n.inputType;return r==="insertFromPaste"||r==="insertFromPasteAsQuotation"}function ie(e,n,...r){return RC(e,n,r[0],e)}function ci(e,n){let r=e._keyToDOMMap.get(n);return r===void 0&&q(75,n),r}function Es(e){let n=e.assignedSlot||e.parentElement;if(n!==null)return n;let r=e.parentNode;return ar(r)?r.host:null}function Hc(e){return gi(e)?e:Ct(e)?e.ownerDocument:null}function IR(e){return Ve()._updateTags.has(e)}function xs(e){Wt(),Ve()._updateTags.add(e)}function YC(e){Wt(),Ve()._deferred.push(e)}function Pa(e,n){let r=e.getParent();for(;r!==null;){if(r.is(n))return!0;r=r.getParent()}return!1}function xg(e){let n=Hc(e);return n?n.defaultView:null}function Nn(e){let n=e._window;return n===null&&q(78),n}function VC(e){return j(e)&&e.isInline()||qe(e)&&e.isInline()}function Cg(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null&&j(n))return n;let r=n.getParentOrThrow();if(Rt(r))return r;n=r}return n}function yg(e){return j(e)&&e.isShadowRoot()}function Rt(e){return Kt(e)||yg(e)}function Sg(e,n=!1){let r=e.constructor.clone(e,ug);return PC(r,null),r.afterCloneFrom(e),n||r.resetOnCopyNodeFrom(e),r}function el(e){let n=Ve(),r=e.getType(),s=Kc(n,r);s===void 0&&q(200,e.constructor.name,r);let{replace:i,replaceWithKlass:a}=s;if(i!==null){let l=i(e),c=l.constructor;return a!==null?l instanceof a||q(201,a.name,a.getType(),c.name,c.getType(),e.constructor.name,r):l instanceof e.constructor&&c!==e.constructor||q(202,c.name,c.getType(),e.constructor.name,r),l.__key===e.__key&&q(203,e.constructor.name,r,c.name,c.getType()),l}return e}function cf(e,n){!Kt(e.getParent())||j(n)||qe(n)||q(99)}function XC(e){let n=ot(e);return n===null&&q(63,e),n}function pc(e){if(!e||e.isInline())return!1;if(qe(e))return!0;if(j(e)){if(e.isShadowRoot()){let n=e.getParent();return!(j(n)&&n.isShadowRoot())}return!e.canBeEmpty()}return!1}function wc(e,n,r){r.style.removeProperty("caret-color"),n._blockCursorElement=null;let s=e.parentElement;s!==null&&s.removeChild(e)}function Xn(e){return Vn?(e||window).getSelection():null}function qC(e){let n=xg(e);return n?n.getSelection():null}function ar(e){return ry(e)&&"host"in e}var LR=[];function JC(e){let n=e.getRootNode();if(n===e||!ar(n))return LR;let r=[n],s=n.host;for(;;){let i=s.getRootNode();if(i===s||!ar(i))break;r.push(i),s=i.host}return r}function*ZC(e){let n=[e],r;for(;r=n.pop();){yield*r.querySelectorAll('[data-lexical-editor="true"]');let s=(gi(r)?r:r.ownerDocument).createTreeWalker(r,NodeFilter.SHOW_ELEMENT),i;for(;i=s.nextNode();)i.shadowRoot&&n.push(i.shadowRoot)}}function QC(e){return e!==null?e.ownerDocument:document}function Sn(){let e=OC();return QC(e!==null?e._rootElement:null)}function mi(e,n){if(n===null||typeof e.getComposedRanges!="function")return null;let r=JC(n);if(r.length===0)return null;let s=e.getComposedRanges;try{let i=s.call(e,{shadowRoots:r})[0];if(i!==void 0)return i}catch(i){}try{let i=s.apply(e,r)[0];if(i!==void 0)return i}catch(i){}return null}function ey(e,n){let r=mi(e,n);if(r!==null){let s=ty(r);if(s!==null)return s}return e.rangeCount>0?e.getRangeAt(0):null}function Yn(e,n){let r=mi(e,n);return r===null?e:ny(r,oy(e))}function FR(e,n){let r=mi(e,n);if(r===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let s=ty(r)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ny(r,oy(e)),range:s}}function ty(e){let n=e.startContainer.ownerDocument;if(n===null)return null;let r=n.createRange();try{return r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset),r}catch(s){return null}}function ny(e,n){let{startContainer:r,startOffset:s,endContainer:i,endOffset:a}=e;return n==="backward"?{anchorNode:i,anchorOffset:a,direction:n,focusNode:r,focusOffset:s}:{anchorNode:r,anchorOffset:s,direction:n,focusNode:i,focusOffset:a}}function oy(e){return e.direction}function kc(e){let n=e.getRootNode();return gi(n)||ar(n)?n.activeElement:null}function ui(e){let n=e.activeElement;for(;n!==null&&n.shadowRoot!==null;){let r=n.shadowRoot.activeElement;if(r===null)break;n=r}return n}function Ng(e){let n=e.target;if(n!==null&&Ct(n)&&n.shadowRoot!==null&&typeof e.composedPath=="function"){let r=e.composedPath();if(r.length>0)return r[0]}return n}function PR(e,n){let r=e.getChildAtIndex(n);r==null&&(r=e),Rt(e)&&q(102);let s=(l)=>{let c=l.getParentOrThrow(),d=Rt(c),f=l!==r||d?Sg(l):l;if(d)return j(l)&&j(f)||q(133),l.insertAfter(f),[l,f,f];{let[g,p,h]=s(c),x=l.getNextSiblings();return h.append(f,...x),[g,p,f]}},[i,a]=s(r);return[i,a]}function BR(e){return Ct(e)&&e.tagName==="A"}function KR(e){return Ct(e)&&e.tagName==="TR"}function zR(e){return Ct(e)&&(e.tagName==="TD"||e.tagName==="TH")}function Ct(e){return _i(e)&&e.nodeType===1}function _i(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function ry(e){return _i(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 sy(e){return!(!Ct(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(!Ct(e)||!e.style.display.startsWith("inline"))&&HR.test(e.nodeName)}function xn(e){if(qe(e)&&!e.isInline())return!0;if(!j(e)||Rt(e))return!1;let n=e.getFirstChild(),r=n===null||Io(n)||te(n)||n.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&r}function Co(){return Ve()}function Tg(e=Co()){return e._config.dom||La}function Dn(e,n,r=Co()){let s=Tg(r).$getDOMSlot(e,n,r);return j(e)&&(iy(s)||q(344,e.getKey(),e.getType())),s}function WR(e,n,r,s){let i=e.read("latest",()=>{let a=ot(n);return a!==null?function(l,c,d=Co()){let f=$r(l,c);if(f===null)return null;let g=d.getElementByKey(f.getKey());return g!==null?g.parentElement:null}(a,r,e):null});return i!==null&&(i.parentElement!==s&&s.appendChild(i),i.style.display=""),i}function GR(e,n,r){r.style.display="none";let s=e.getElementByKey(n);s!==null&&r.parentElement!==s&&s.insertBefore(r,s.firstChild)}function iy(e){return e instanceof si}function ir(e,n,r=Co()){return FC(Dn(e,n,r).element)}var Q_=new WeakMap,jR=new Map;function kf(e){if(!e._readOnly&&e.isEmpty())return jR;e._readOnly||q(192);let n=Q_.get(e);return n||(n=function(r){let s=new Map;for(let[i,a]of r._nodeMap){let l=a.__type,c=s.get(l);c||(c=new Map,s.set(l,c)),c.set(i,a)}return s}(e),Q_.set(e,n)),n}function bg(e){let n=e.constructor.clone(e,ug);return n.afterCloneFrom(e),n}function YR(e){return(n=bg(e))[eC]=!0,n;var n}function ay(e,n){let r=e.getAttribute("data-lexical-indent");if(r!==null){let a=parseInt(r,10);if(Number.isFinite(a)&&a>=0)return void n.setIndent(a)}let s=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(s/40);n.setIndent(i)}function ly(e,n){let r=n.getAttribute("dir");return r==="ltr"||r==="rtl"?e.setDirection(r):e}function cy(e,n){let r=n.style.textAlign;return r&&r in hc?e.setFormat(r):e}function uy(e,n){e.__lexicalUnmanaged=!0,n&&n.captureSelection!==void 0&&(e.__lexicalCapturedSelection=n.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function dy(e,n=Co()){let r=n.isEditable();e.contentEditable=r?"true":"false",r?e.__lexicalEditor=n:delete e.__lexicalEditor}function Ba(e,n){let r=e;for(;r!=null;){if(r.__lexicalCapturedSelection===!0)return!0;if(Ct(r)&&r.hasAttribute("data-lexical-slot"))return!1;if(hi(r,n)!==void 0)return!1;r=Es(r)}return!1}function pa(e,n){return function(r,s){return Object.prototype.hasOwnProperty.call(r,s)}(e,n)&&e[n]!==ln[n]}var ex=new WeakMap,tx=Symbol("lexical.synthesizedGetType");function tl(e){let n=ex.get(e);if(n)return n;let r=e.prototype!=null&&e_ in e.prototype?e.prototype[e_]():void 0,s=function(f){if(!(f===ln||f.prototype instanceof ln)){let g="<unknown>",p="<unknown>";try{g=f.getType()}catch(h){}try{_s.version&&(p=JSON.parse(_s.version))}catch(h){}q(290,f.name,g,p)}return f===Pc||f===ko||f===ln}(e),i=!s&&pa(e,"getType")?e.getType:void 0,a=i&&!(tx in i)?i.call(e):void 0,l,c=a;if(r)if(a)l=r[a];else{for(let[f,g]of Object.entries(r))c=f,l=g;if(!l)for(let f of Object.getOwnPropertySymbols(r)){let g=r[f];if(g){l=g;break}}}if(!s&&c){if(!pa(e,"getType")){let f=e,g=function(){return this!==f?ln.getType.call(this):c};g[tx]=!0,e.getType=g}if(pa(e,"clone")||(e.clone=(f,g)=>{cg(f);let p=new e;return g!==ug&&p.afterCloneFrom(f),p}),pa(e,"importJSON")||(e.importJSON=l&&l.$importJSON||((f)=>new e().updateFromJSON(f))),!pa(e,"importDOM")&&l){let{importDOM:f}=l;f&&(e.importDOM=()=>f)}}let d={klass:e,ownNodeConfig:l,ownNodeType:c};return ex.set(e,d),d}function*nl(e){for(let n=e;n&&(n===ln||og(n.prototype));){let r=tl(n);yield r,n=r.ownNodeConfig&&r.ownNodeConfig.extends||fy(n)}}function VR(e){let n=new Map,r=new Map;for(let s of e){let{ownNodeType:i}=tl(s);i&&(r.set(i,s),n.set(i,new Set))}for(let[s,i]of r)for(let{ownNodeType:a}of nl(i)){let l=a&&n.get(a);l&&l.add(s)}return n}function XR(e){let n=Co();return Wt(),new(n.resolveRegisteredNodeAfterReplacements(n.getRegisteredNode(e))).klass}var Er=(e,n)=>{let r=e;for(;r!=null&&!Kt(r);){if(n(r))return r;r=r.getParent()}return null};function Ka(e,n){let r=[],s=e.__first;for(;s!==null;){let i=n===null?ot(s):n.get(s);i==null&&q(174),r.push(s),s=i.__next}return r}function fy(e){let n=Object.getPrototypeOf(e);if(typeof n=="function"&&n!==Function.prototype)return n;let r=e.prototype&&Object.getPrototypeOf(e.prototype);return r?r.constructor:null}var gy=new Map;function Do(e){return j(e)||qe(e)}function Dr(e){return j(e)||qe(e)}function Jt(e){let n=e.getLatest();return Dr(n)?n.__slotHost:null}function Un(e){let n=Jt(e);if(n===null)return null;let r=ot(n);return j(r)||qe(r)||q(370),r}function py(e){let n=Un(e);if(n===null)return null;let r=e.getLatest().__key;for(let[s,i]of Wc(n))if(i===r)return s;return null}function hy(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null)return n;n=n.getParent()}return null}function Wc(e){let n=e.getLatest();return Do(n)&&n.__slots!==null?n.__slots:gy}function Gn(e){return Array.from(Wc(e).keys())}function $r(e,n){let r=Wc(e).get(n);return r===void 0?null:ot(r)}var qR=["__proto__","constructor","prototype"],nx=Symbol("slotMapOwner");function If(e){let n=e.__slots;return n!==null&&n[nx]===e||(n=new Map(n),n[nx]=e,e.__slots=n),n}var ox=new WeakMap,JR=[];function my(e){for(let{ownNodeConfig:n}of nl(e)){let r=n&&n.slots;if(r)return r}return JR}function _y(e){let n="";for(let r of Gn(e)){let s=$r(e,r);s!==null&&(n+=s.getTextContent())}return n}function rx(e,n,r){let s=r.get(e),i=r.get(n);return s!==void 0?i!==void 0?s-i:-1:i!==void 0?1:e<n?-1:e>n?1:0}function ZR(e){let n=e.__slots;if(n===null||n.size<2)return;let r=function(l){let c=ox.get(l);if(c===void 0){let d=my(l),f=new Map;for(let g of d)qR.includes(g)&&q(371,l.name,g),f.has(g)&&q(372,l.name,g),f.set(g,f.size);c=f,ox.set(l,c)}return c}(e.constructor),s=null,i=!0;for(let l of n.keys()){if(s!==null&&rx(s,l,r)>0){i=!1;break}s=l}if(i)return;let a=Array.from(n).sort(([l],[c])=>rx(l,c,r));n.clear();for(let[l,c]of a)n.set(l,c)}function Og(e,n,r){n!=="__proto__"&&n!=="constructor"&&n!=="prototype"||q(373,n);let s=e.getLatest();if(s.__slots!==null&&s.__slots.get(n)===r.getLatest().__key)return s;(!j(r)&&!qe(r)||r.isInline())&&q(374,r.__key);let i=e.getWritable(),a=If(i),l=a.get(n);l!==void 0&&Cy(l);let c=r.getWritable(),d=Un(c);if(d!==null){let f=py(c);f!==null&&If(d.getWritable()).delete(f),c.__slotHost=null}return zn(c),c.__slotHost=i.__key,a.set(n,c.__key),ZR(i),function(){let f=Co();f._slotsUsed=!0,f._pendingEditorState&&(f._pendingEditorState._slotsUsed=!0)}(),i}function xy(e,n){let r=e.getWritable();if(r.__slots===null)return r;let s=r.__slots.get(n);return s!==void 0&&(Cy(s),If(r).delete(n)),r}function sx(e,n){}function Cy(e){let n=ot(e);if(n===null)return;let r=n.getWritable();Dr(r)||q(377,e),r.__slotHost=null,r.remove()}var QR={next:"previous",previous:"next"};class ol{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:wr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return St(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return St(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){let r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){let s=r===this.direction?n:Array.from(n).reverse(),i=this,a=this.getParentAtCaret(),l=new Map;for(let c=i.getAdjacentCaret();c!==null&&l.size<e;c=c.getAdjacentCaret()){let d=c.origin.getWritable();l.set(d.getKey(),d)}for(let c of s){if(l.size>0){let d=i.getNodeAtCaret();if(d)if(l.delete(d.getKey()),l.delete(c.getKey()),d.is(c)||i.origin.is(c));else{let f=c.getParent();f&&f.is(a)&&c.remove(),d.replace(c)}else d===null&&q(263,Array.from(l).join(" "))}else i.insert(c);i=St(c,this.direction)}for(let c of l.values())c.remove();return this}}class za extends ol{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lr(e,this.direction)}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||lr(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof za&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var eM={root:Kt,shadowRoot:Rt};function Pr(e){return QR[e]}function Ag(e,n="root"){return e===null||eM[n](e)?null:Jt(e)===null?e:null}class Cs extends ol{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:St(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return j(this.origin)?lr(this.origin,this.direction):null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||lr(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 ol{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:kr(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return kr(this.origin,Pr(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 St(this.origin,this.direction)}}function ho(e){return e instanceof ys}function tM(e){return e instanceof ol}function wr(e){return e instanceof Cs}function jn(e){return e instanceof za}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 za{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends za{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function St(e,n){return e?new oM[n](e):null}function kr(e,n,r){return e?new nM[n](e,mo(e,r)):null}function mo(e,n,r="error"){let s=e.getTextContentSize(),i=n==="next"?s:n==="previous"?0:n;return(i<0||i>s)&&(r!=="clamp"&&lx(284,String(n),String(s),e.getKey()),i=i<0?0:s),i}function Lf(e,n){return new Mg(e,n)}function lr(e,n){return j(e)?new rM[n](e):null}function yy(e){return e&&e.getChildCaret()||e}function di(e){return e&&yy(e.getAdjacentCaret())}class Rg{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){let e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new Rg(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=(s)=>{let i=this[s].getLatest();return ho(i)?function(a,l){let{direction:c,origin:d}=a,f=mo(d,l==="focus"?Pr(c):c);return Lf(a,f-a.offset)}(i,s):null},n=e("anchor"),r=e("focus");if(n&&r){let{caret:s}=n,{caret:i}=r;if(s.isSameNodeCaret(i))return[Lf(s,i.offset-s.offset),null]}return[n,r]}iterNodeCarets(e="root"){let n=ho(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=ho(r),i=(a)=>a.isSameNodeCaret(r)?null:di(a)||a.getParentCaret(e);return $g({hasNext:(a)=>a!==null&&!(s&&r.isSameNodeCaret(a)),initial:n.isSameNodeCaret(r)?null:i(n),map:(a)=>a,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Mg{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){let{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){let[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:n}}=this,[r,s]=this.getSliceIndices(),i=e.getTextContent();return kr(e.setTextContent(i.slice(0,r)+i.slice(s)),n,r)}}function sM(e){return e instanceof Mg}function Dg(e){return Lr(e,St(Mn(),e.direction))}function Sy(e){return Lr(e,e)}function Lr(e,n){return e.direction!==n.direction&&q(265),new Rg(e,n,e.direction)}function $g(e){let{initial:n,hasNext:r,step:s,map:i}=e,a=n;return{[Symbol.iterator](){return this},next(){if(!r(a))return{done:!0,value:void 0};let l={done:!1,value:i(a)};return a=s(a),l}}}function wg(e,n){let r=Ic(e.origin,n.origin);switch(r===null&&q(275,e.origin.getKey(),n.origin.getKey()),r.type){case"same":{let s=e.type==="text",i=n.type==="text";return s&&i?function(a,l){return Math.sign(a-l)}(e.offset,n.offset):e.type===n.type?0:s?-1:i?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return n.type==="child"?1:-1;case"branch":return kg(r)}}function kg(e){let{a:n,b:r}=e,s=n.__key,i=r.__key,a=n,l=r;for(;a&&l;a=a.getNextSibling(),l=l.getNextSibling()){if(a.__key===i)return-1;if(l.__key===s)return 1}return a===null?1:-1}function ac(e,n){return n.is(e)}function ix(e){return j(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ic(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};let r=new Map;for(let[s,i]=ix(e);s;i=s,s=s.getParent())r.set(s,i);for(let[s,i]=ix(n);s;i=s,s=s.getParent()){let a=r.get(s);if(a!==void 0)return a===null?(ac(e,s)||q(276),{commonAncestor:s,type:"ancestor"}):i===null?(ac(n,s)||q(277),{commonAncestor:s,type:"descendant"}):((j(a)||ac(e,a))&&(j(i)||ac(n,i))&&s.is(a.getParent())&&s.is(i.getParent())||q(278),{a,b:i,commonAncestor:s,type:"branch"})}return null}function Fr(e,n){let{type:r,key:s,offset:i}=e,a=XC(e.key);return r==="text"?(te(a)||q(266,a.getType(),s),kr(a,n,i)):(j(a)||q(267,a.getType(),s),by(a,e.offset,n))}function Ua(e,n){let{origin:r,direction:s}=n,i=s==="next";ho(n)?e.set(r.getKey(),n.offset,"text"):wr(n)?te(r)?e.set(r.getKey(),mo(r,s),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(i?1:0),"element"):(jn(n)&&j(r)||q(268),e.set(r.getKey(),i?0:r.getChildrenSize(),"element"))}function Ny(e){let n=Ue(),r=ge(n)?n:SC();return Ca(r,e),tn(r),r}function Ca(e,n){Ua(e.anchor,n.anchor),Ua(e.focus,n.focus)}function Ff(e){let{anchor:n,focus:r}=e,s=Fr(n,"next"),i=Fr(r,"next"),a=wg(s,i)<=0?"next":"previous";return Lr(Fo(s,a),Fo(i,a))}function Ts(e){let{direction:n,origin:r}=e,s=St(r,Pr(n)).getNodeAtCaret();return s?St(s,n):lr(r.getParentOrThrow(),n)}function ax(e,n="root"){let r=[e];for(let s=jn(e)?e.getParentCaret(n):e.getSiblingCaret();s!==null;s=s.getParentCaret(n))r.push(Ts(s));return r}function uf(e){return!!e&&e.origin.isAttached()}function Ey(e,n="removeEmptySlices"){if(e.isCollapsed())return e;let r="root",s="next",i=n,a=Ig(e,s),l=ax(a.anchor,r),c=ax(a.focus.getFlipped(),r),d=new Set,f=[];for(let y of a.iterNodeCarets(r))if(jn(y))d.add(y.origin.getKey());else if(wr(y)){let{origin:N}=y;j(N)&&!d.has(N.getKey())||f.push(N)}let g=new Set;for(let y of f){let N=y.getParent();N===null||d.has(N.getKey())||g.add(N),zn(y)}for(let y of g)!y.canBeEmpty()&&!Rt(y)&&y.isEmpty()&&y.isAttached()&&y.remove();for(let y of a.getTextSlices()){if(!y)continue;let{origin:N}=y.caret,T=N.getTextContentSize(),b=Ts(St(N,s)),v=N.getMode();if(Math.abs(y.distance)===T&&i==="removeEmptySlices"||v==="token"&&y.distance!==0)b.remove();else if(y.distance!==0){i="removeEmptySlices";let O=y.removeTextSlice(),k=y.caret.origin;if(v==="segmented"){let M=O.origin,z=Cn(M.getTextContent()).setStyle(M.getStyle()).setFormat(M.getFormat());b.replaceOrInsert(z),O=kr(z,s,O.offset)}k.is(l[0].origin)&&(l[0]=O),k.is(c[0].origin)&&(c[0]=O.getFlipped())}}let p,h;for(let y of l)if(uf(y)){p=$o(y);break}for(let y of c)if(uf(y)){h=$o(y);break}let x=function(y,N,T){if(!y||!N)return null;let b=y.getParentAtCaret(),v=N.getParentAtCaret();if(!b||!v)return null;let O=b.getParents().reverse();O.push(b);let k=v.getParents().reverse();k.push(v);let M=Math.min(O.length,k.length),z;for(z=0;z<M&&O[z]===k[z];z++);let K=(W,ne)=>{let ee;for(let se=z;se<W.length;se++){let Y=W[se];if(Rt(Y))return;!ee&&ne(Y)&&(ee=Y)}return ee},U=K(O,xn),J=U&&K(k,(W)=>T.has(W.getKey())&&xn(W));if(J&&Gn(J).length>0)return null;return U&&J?[U,J]:null}(p,h,d);if(x){let[y,N]=x;lr(y,"previous").splice(0,N.getChildren());let T=N.getParent();for(N.remove(!0);T&&T.isEmpty();){let b=T;T=T.getParent(),b.remove(!0)}}else if(h){let y=function(b){if(jn(b)){let v=b.origin;if(xn(v))return v}else{let v=b.getParentAtCaret();if(v&&xn(v))return v}return null}(h),N=y&&y.getParent(),T=y&&y.getParents().findLast(yg);if(y&&N&&!Kt(N)&&y.isEmpty()&&d.has(y.getKey())&&Gn(y).length===0&&(!T||d.has(T.getKey()))){y.remove(!0);let b=N;for(;b&&!Kt(b)&&b.isEmpty();){let v=b.getParent();if(v&&Kt(v)&&v.getChildrenSize()<=1)break;let O=b;b=v,O.remove(!0)}}}let C=[p,h,...l,...c].find(uf);if(C)return Sy(Fo($o(C),e.direction));q(269,JSON.stringify(l.map((y)=>y.origin.__key)))}function $o(e){let n=function(i){let a=i;for(;jn(a);){let l=di(a);if(!jn(l))break;a=l}return a}(e.getLatest()),{direction:r}=n;if(te(n.origin))return ho(n)?n:kr(n.origin,r,r);let s=n.getAdjacentCaret();return wr(s)&&te(s.origin)?kr(s.origin,r,Pr(r)):n}function Ty(e){return ho(e)&&e.offset!==mo(e.origin,e.direction)}function Fo(e,n){return e.direction===n?e:e.getFlipped()}function Ig(e,n){return e.direction===n?e:Lr(Fo(e.focus,n),Fo(e.anchor,n))}function by(e,n,r){let s=lr(e,"next");for(let i=0;i<n;i++){let a=s.getAdjacentCaret();if(a===null)break;s=a}return Fo(s,r)}function iM(e,n="root"){let r=0,s=e,i=di(s);for(;i===null;){if(r--,i=s.getParentCaret(n),!i)return null;s=i,i=di(s)}return i&&[i,r]}function aM(e){let{origin:n,offset:r,direction:s}=e;if(r===mo(n,s))return e.getSiblingCaret();if(r===mo(n,Pr(s)))return Ts(e.getSiblingCaret());let[i]=n.splitText(r);return te(i)||q(281),Fo(St(i,"next"),s)}function lM(e,n){return!0}function vy(e,{$copyElementNode:n=Sg,$splitTextPointCaretNext:r=aM,rootMode:s="shadowRoot",$shouldSplit:i=lM,removeEmptyDestination:a=!1}={}){if(ho(e))return r(e);let l=e.getParentCaret(s);if(l){let{origin:c}=l;if(jn(e)){let f=Ts(l);if(a&&c.isEmpty())return c.remove(),f;if(!c.canBeEmpty()||!i(c,"first"))return f}let d=function(f){let g=[];for(let p=f.getAdjacentCaret();p;p=p.getAdjacentCaret())g.push(p.origin);return g}(e);(d.length>0||!a&&c.canBeEmpty()&&i(c,"last"))&&l.insert(n(c).splice(0,0,d))}return l}function Oy(e,n,r){let s=Fo(n,"next");ho(s)&&(s.offset===0?s=St(s.origin,"previous").getFlipped():s.offset===s.origin.getTextContentSize()&&(s=St(s.origin,"next"))),s.origin.is(e)&&(wr(s)||q(342,e.getKey(),e.getType()),s=Ts(s)),(e.is(s.getNodeAtCaret())||e.is(s.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=s;i;i=vy(i,r))s=i;return ho(s)&&q(283),s.insert(e.isInline()?Rn().append(e):e),Fo(St(e.getLatest(),"next"),n.direction)}function cM(e){return e}function uM(...e){return e}function dM(e,n){return[e,n]}function fM(e){return e}function gM(e,n){if(!n||e===n)return e;for(let r in n)if(e[r]!==n[r])return{...e,...n};return e}function rl(...e){let n=[];for(let r of e)if(r&&typeof r=="string")for(let[s]of r.matchAll(/\S+/g))n.push(s);return n}function pM(e,...n){let r=rl(...n);r.length>0&&e.classList.add(...r)}function hM(e,...n){let r=rl(...n);r.length>0&&e.classList.remove(...r)}function Lg(...e){return()=>{for(let n=e.length-1;n>=0;n--)e[n]();e.length=0}}function mM(e,n,r){return Lg(...Object.entries(n).map(([s,i])=>ng(e,s,i,r)))}var R=Fg,{$addUpdateTag:sl,$applyNodeReplacement:cn,$assumeActiveEditor:Ay,$caretFromPoint:dn,$caretRangeFromSelection:cr,$cloneWithProperties:Gc,$cloneWithPropertiesEphemeral:Ry,$comparePointCaretNext:Br,$copyNode:jt,$create:jc,$createChildrenArray:V1,$createLineBreakNode:fn,$createNodeSelection:Yc,$createParagraphNode:Se,$createPoint:qn,$createRangeSelection:Kr,$createRangeSelectionFromDom:My,$createTabNode:gn,$createTextNode:yt,$extendCaretToRange:bs,$findMatchingParent:he,$formatText:Dy,$fullReconcile:xi,$generateNodesFromRawText:il,$getAdjacentChildCaret:al,$getAdjacentNode:X1,$getAdjacentSiblingOrParentSiblingCaret:vs,$getCaretInDirection:$y,$getCaretRange:Jn,$getCaretRangeInDirection:dr,$getCharacterOffsets:wy,$getChildCaret:bt,$getChildCaretAtIndex:Pg,$getChildCaretOrSelf:Bg,$getCollapsedCaretRange:Os,$getCommonAncestor:q1,$getCommonAncestorResultBranchOrder:J1,$getDOMSlot:ky,$getDOMTextNode:Iy,$getDocument:Xe,$getEditor:Ge,$getEditorDOMRenderConfig:Kg,$getNearestNodeFromDOMNode:vt,$getNearestRootOrShadowRoot:Z1,$getNodeByKey:Mt,$getNodeByKeyOrThrow:Ly,$getNodeFromDOMNode:Fy,$getPreviousSelection:En,$getRoot:Je,$getSelection:X,$getSiblingCaret:it,$getSlot:Ci,$getSlotFrame:Zn,$getSlotHost:Vc,$getSlotNameWithinHost:Q1,$getSlotNames:As,$getState:Bo,$getStateChange:eL,$getTextContent:tL,$getTextNodeOffset:nL,$getTextPointCaret:Xc,$getTextPointCaretSlice:oL,$getWritableNodeState:rL,$hasAncestor:ll,$hasUpdateTag:sL,$insertNodeToNearestRootAtCaret:zr,$insertNodes:qc,$isBlockElementNode:Ur,$isChildCaret:Ko,$isDecoratorNode:kt,$isEditorState:Py,$isElementDOMSlot:iL,$isElementNode:Q,$isExtendableTextPointCaret:cl,$isInlineElementOrDecoratorNode:zg,$isInlineFormattable:aL,$isLeafNode:ul,$isLexicalNode:Ug,$isLineBreakNode:He,$isNodeCaret:lL,$isNodeSelection:Ze,$isParagraphNode:$n,$isRangeSelection:G,$isRootNode:yo,$isRootOrShadowRoot:Dt,$isSelectionCapturedInDecoratorInput:By,$isShadowRootNode:Jc,$isSiblingCaret:So,$isSlotChild:cL,$isSlotHost:dl,$isTabNode:Yt,$isTextNode:re,$isTextPointCaret:Hr,$isTextPointCaretSlice:uL,$isTokenOrSegmented:Hg,$isTokenOrTab:dL,$markSlotEditable:fL,$needsBlockCursorBeside:Ky,$nodesOfType:gL,$normalizeCaret:It,$normalizeSelection__EXPERIMENTAL:zo,$onUpdate:zy,$parseSerializedNode:Uy,$removeFromParent:pL,$removeSlot:hL,$removeTextFromCaretRange:Hy,$rewindSiblingCaret:Uo,$selectAll:Wr,$setCompositionKey:mL,$setDirectionFromDOM:Tn,$setFormatFromDOM:Qn,$setPointFromCaret:Ho,$setSelection:mt,$setSelectionFromCaretRange:wn,$setSlot:_L,$setState:eo,$setTextFormat:Wy,$splitAtPointCaretNext:Zc,$splitNode:Gy,$updateDOMSelection:jy,$updateRangeSelectionFromCaretRange:xL,ArtificialNode__DO_NOT_USE:fl,BEFORE_INPUT_COMMAND:CL,BLUR_COMMAND:yL,CAN_REDO_COMMAND:Rs,CAN_UNDO_COMMAND:Ms,CAN_USE_BEFORE_INPUT:gl,CAN_USE_DOM:pn,CLEAR_EDITOR_COMMAND:Qc,CLEAR_HISTORY_COMMAND:Yy,CLICK_COMMAND:yi,COLLABORATION_TAG:Vy,COMMAND_PRIORITY_BEFORE_CRITICAL:Xy,COMMAND_PRIORITY_BEFORE_EDITOR:eu,COMMAND_PRIORITY_BEFORE_HIGH:SL,COMMAND_PRIORITY_BEFORE_LOW:NL,COMMAND_PRIORITY_BEFORE_NORMAL:EL,COMMAND_PRIORITY_CRITICAL:Si,COMMAND_PRIORITY_EDITOR:be,COMMAND_PRIORITY_HIGH:kn,COMMAND_PRIORITY_LOW:Be,COMMAND_PRIORITY_NORMAL:TL,COMPOSITION_END_COMMAND:bL,COMPOSITION_END_TAG:tu,COMPOSITION_START_COMMAND:qy,COMPOSITION_START_TAG:nu,CONTROLLED_TEXT_INSERTION_COMMAND:ou,COPY_COMMAND:Ni,CUT_COMMAND:ru,CUT_TAG:su,DEFAULT_EDITOR_DOM_CONFIG:Wg,DELETE_CHARACTER_COMMAND:Ei,DELETE_LINE_COMMAND:iu,DELETE_WORD_COMMAND:au,DRAGEND_COMMAND:vL,DRAGOVER_COMMAND:Jy,DRAGSTART_COMMAND:Zy,DROP_COMMAND:Qy,DecoratorNode:lu,ElementNode:ct,FOCUS_COMMAND:eS,FORMAT_ELEMENT_COMMAND:cu,FORMAT_TEXT_COMMAND:Wo,HISTORIC_TAG:bi,HISTORY_MERGE_TAG:Gr,HISTORY_PUSH_TAG:uu,INDENT_CONTENT_COMMAND:to,INPUT_COMMAND:OL,INSERT_LINE_BREAK_COMMAND:Gg,INSERT_PARAGRAPH_COMMAND:jr,INSERT_TAB_COMMAND:Ds,INTERNAL_$isBlock:pl,IS_ALL_FORMATTING:AL,IS_ANDROID:tS,IS_ANDROID_CHROME:nS,IS_APPLE:hl,IS_APPLE_WEBKIT:du,IS_BOLD:ml,IS_CHROME:oS,IS_CODE:rS,IS_FIREFOX:$s,IS_HIGHLIGHT:sS,IS_IOS:_l,IS_ITALIC:xl,IS_SAFARI:fu,IS_STRIKETHROUGH:Cl,IS_SUBSCRIPT:gu,IS_SUPERSCRIPT:pu,IS_UNDERLINE:yl,KEY_ARROW_DOWN_COMMAND:Go,KEY_ARROW_LEFT_COMMAND:Yr,KEY_ARROW_RIGHT_COMMAND:vi,KEY_ARROW_UP_COMMAND:no,KEY_BACKSPACE_COMMAND:Oi,KEY_DELETE_COMMAND:hu,KEY_DOWN_COMMAND:RL,KEY_ENTER_COMMAND:Ai,KEY_ESCAPE_COMMAND:Ri,KEY_MODIFIER_COMMAND:ML,KEY_SPACE_COMMAND:mu,KEY_TAB_COMMAND:Vr,LineBreakNode:iS,MOVE_TO_END:Sl,MOVE_TO_START:Mi,NODE_STATE_DIRECT:DL,NODE_STATE_KEY:$L,NODE_STATE_LATEST:wL,OUTDENT_CONTENT_COMMAND:jo,PASTE_COMMAND:Di,PASTE_TAG:_u,ParagraphNode:aS,REDO_COMMAND:xu,REMOVE_TEXT_COMMAND:lS,RootNode:Cu,SELECTION_CHANGE_COMMAND:oo,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:yu,SELECT_ALL_COMMAND:$i,SET_TEXT_FORMAT_COMMAND:cS,SKIP_COLLAB_TAG:kL,SKIP_DOM_SELECTION_TAG:uS,SKIP_SCROLL_INTO_VIEW_TAG:dS,SKIP_SELECTION_FOCUS_TAG:Su,TEXT_TYPE_TO_FORMAT:wi,TabNode:Nu,TextNode:In,UNDO_COMMAND:Eu,addClassNamesToElement:et,buildImportMap:jg,configExtension:nn,createCommand:bn,createEditor:Tu,createRefCountedRegistry:IL,createSharedNodeState:LL,createState:Yo,declarePeerDependency:fS,defineExtension:_e,findAllLexicalElementsDeep:gS,flipDirection:pS,getActiveElement:No,getActiveElementDeep:hS,getComposedEventTarget:Nl,getComposedStaticRange:FL,getDOMOwnerDocument:PL,getDOMSelection:Ln,getDOMSelectionFromTarget:BL,getDOMSelectionPoints:ws,getDOMSelectionRange:mS,getDOMSelectionRangeAndPoints:KL,getDOMShadowRoots:_S,getDOMTextNode:xS,getDeclaredSlots:zL,getEditorPropertyFromDOMNode:bu,getNearestEditorFromDOMNode:vu,getParentElement:El,getRegisteredNode:UL,getRegisteredNodeOrThrow:HL,getRegisteredSubtypeMap:Ou,getRootOwnerDocument:ks,getStaticNodeConfig:CS,getStyleObjectFromCSS:Xr,getTextDirection:yS,getTransformSetFromKlass:WL,isBlockDomNode:Is,isCurrentlyReadOnlyMode:SS,isDOMCapturingSelection:GL,isDOMDocumentNode:qr,isDOMNode:ro,isDOMShadowRoot:Au,isDOMTextNode:Fs,isDOMUnmanaged:jL,isDocumentFragment:Yg,isExactShortcutMatch:NS,isHTMLAnchorElement:ki,isHTMLElement:ye,isHTMLTableCellElement:YL,isHTMLTableRowElement:ES,isInlineDomNode:Ii,isLastChildInBlockNode:TS,isLexicalEditor:Ru,isModifierMatch:VL,isOnlyChildInBlockNode:bS,isSelectionCapturedInDecoratorInput:XL,isSelectionWithinEditor:vS,iterStaticNodeConfigChain:OS,makeStepwiseIterator:Vg,mergeRegister:Me,mountSlotContainer:qL,normalizeClassNames:Li,registerEventListener:so,registerEventListeners:Jr,removeClassNamesFromElement:sn,removeFromParent:JL,resetRandomKey:ZL,safeCast:We,setDOMStyleFromCSS:fr,setDOMStyleObject:QL,setDOMUnmanaged:Mu,setNodeIndentFromDOM:Zr,shallowMergeConfig:zt,stopLexicalPropagation:Xg,toggleTextFormatType:qg,tokenizeRawText:Fi,unmountSlotContainer:eF}=R;var Zg={};ke(Zg,{LexicalComposer:()=>xM});S();var _M=pn?$e:m,Du={tag:Gr};function xM({initialConfig:e,children:n}){let r=D(()=>{let{theme:s,namespace:i,nodes:a,onError:l,onWarn:c,editorState:d,html:f}=e,g=Qm(null,s),p=Tu({editable:e.editable,html:f,namespace:i,nodes:a,onError:(h)=>l(h,p),...c?{onWarn:(h)=>c(h,p)}:{},theme:s});return function(h,x){if(x===null)return;if(x===void 0)h.update(()=>{let C=Je();if(C.isEmpty()){let y=Se();C.append(y);let N=h.getRootElement(),T=pn&&N!==null?No(N):null;(X()!==null||T!==null&&T===N)&&y.select()}},Du);else if(x!==null)switch(typeof x){case"string":{let C=h.parseEditorState(x);h.setEditorState(C,Du);break}case"object":h.setEditorState(x,Du);break;case"function":h.update(()=>{Je().isEmpty()&&x(h)},Du)}}(p,d),[p,g]},[]);return _M(()=>{let s=e.editable,[i]=r;i.setEditable(s===void 0||s)},[]),t(Zm.Provider,{value:r,children:n})}var CM=Zg,AS=CM.LexicalComposer;var Qg={};ke(Qg,{useLexicalEditable:()=>NM});S();var yM=pn?$e:m;function SM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(n)=>e.registerEditableListener(n)}}function NM(){return function(e){let[n]=st(),r=D(()=>e(n),[n,e]),[s,i]=u(()=>r.initialValueFn()),a=_(s);return yM(()=>{let{initialValueFn:l,subscribe:c}=r,d=l();return a.current!==d&&(a.current=d,i(d)),c((f)=>{a.current=f,i(f)})},[r,e]),s}(SM)}var EM=Qg,RS=EM.useLexicalEditable;var sp={};ke(sp,{$addNodeStyle:()=>RM,$cloneWithProperties:()=>Gc,$copyBlockFormatIndent:()=>FS,$ensureForwardRangeSelection:()=>LS,$forEachSelectedTextNode:()=>IS,$getComputedStyleForElement:()=>np,$getComputedStyleForParent:()=>op,$getSelectionStyleValueForProperty:()=>FM,$isAtEdgeOfElement:()=>PS,$isAtNodeEnd:()=>AM,$isParentElementRTL:()=>rp,$isParentRTL:()=>vM,$moveCaretSelection:()=>zS,$moveCharacter:()=>IM,$patchStyleText:()=>MM,$selectAll:()=>Wr,$setBlocksType:()=>DM,$shouldOverrideDefaultCharacterSelection:()=>kM,$sliceSelectedTextNodeContent:()=>OM,$trimTextContentFromAnchor:()=>kS,$wrapNodes:()=>wM,createDOMRange:()=>TM,createRectsFromDOMRange:()=>bM,getCSSFromStyleObject:()=>wS,getStyleObjectFromCSS:()=>PM,trimTextContentFromAnchor:()=>BM});function tp(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function MS(e){let n=e;for(;n!=null;){if(n.nodeType===Node.TEXT_NODE)return n;n=n.firstChild}return null}function DS(e){let n=e.parentNode;if(n==null)throw Error("Should never happen");return[n,Array.from(n.childNodes).indexOf(e)]}function TM(e,n,r,s,i){let a=n.getKey(),l=s.getKey(),c=ks(e.getRootElement()).createRange(),d=e.getElementByKey(a),f=e.getElementByKey(l),g=r,p=i;if(re(n)&&(d=MS(d)),re(s)&&(f=MS(f)),n===void 0||s===void 0||d===null||f===null)return null;d.nodeName==="BR"&&([d,g]=DS(d)),f.nodeName==="BR"&&([f,p]=DS(f));let h=d.firstChild;d===f&&h!=null&&h.nodeName==="BR"&&g===0&&p===0&&(p=1);try{c.setStart(d,g),c.setEnd(f,p)}catch(x){return null}return!c.collapsed||g===p&&a===l||(c.setStart(f,p),c.setEnd(d,g)),c}function bM(e,n){let r=e.getRootElement();if(r===null)return[];let s=r.getBoundingClientRect(),i=getComputedStyle(r),a=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),l=Array.from(n.getClientRects()),c,d=l.length;l.sort((f,g)=>{let p=f.top-g.top;return Math.abs(p)<=3?f.left-g.left:p});for(let f=0;f<d;f++){let g=l[f],p=c&&c.top<=g.top&&c.top+c.height>g.top&&c.left+c.width>g.left,h=g.width+a===s.width;p||h?(l.splice(f--,1),d--):c=g}return l}function wS(e){let n="";for(let r in e)r&&(n+=`${r}: ${e[r]};`);return n}function np(e){let n=Ge().getElementByKey(e.getKey());if(n===null)return null;let r=n.ownerDocument.defaultView;return r===null?null:r.getComputedStyle(n)}function op(e){return np(yo(e)?e:e.getParentOrThrow())}function vM(e){let n=op(e);return n!==null&&n.direction==="rtl"}function OM(e,n,r="self"){let s=e.getStartEndPoints();if(n.isSelected(e)&&!Hg(n)&&s!==null){let[i,a]=s,l=e.isBackward(),c=i.getNode(),d=a.getNode(),f=n.is(c),g=n.is(d);if(f||g){let[p,h]=wy(e),x=c.is(d),C=n.is(l?d:c),y=n.is(l?c:d),N,T=0;if(x)T=p>h?h:p,N=p>h?p:h;else if(C)T=l?h:p,N=void 0;else if(y)T=0,N=l?p:h;let b=n.__text.slice(T,N);b!==n.__text&&(r==="clone"&&(n=Ry(n)),n.__text=b)}}return n}function AM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let n=e.getNode();return Q(n)||tp(177),e.offset===n.getChildrenSize()}function kS(e,n,r){let s=n.getNode(),i=r;if(Q(s)){let a=s.getDescendantByIndex(n.offset);a!==null&&(s=a)}for(;i>0&&s!==null;){if(Q(s)){let f=s.getLastDescendant();f!==null&&(s=f)}let a=s.getPreviousSibling(),l=0;if(a===null){let f=s.getParentOrThrow(),g=f.getPreviousSibling();for(;g===null;){if(f=f.getParent(),f===null){a=null;break}g=f.getPreviousSibling()}f!==null&&(l=f.isInline()?0:2,a=g)}let c=s.getTextContent();c===""&&Q(s)&&!s.isInline()&&(c=`
|
|
11
|
+
`?n.linebreak():r==="\t"?n.tab():r!==""&&n.text(r)}function ig(e){let n=[];return NC(e,{linebreak:()=>n.push(Bc()),tab:()=>n.push(aC()),text:(r)=>n.push(Cn(r))}),n}function aR(){let e=ze();return e===null?"":e.getTextContent()}function Df(e){let n=[];for(let r of e)Io(r)||(!Y(r)&&!qe(r)||r.isInline()?n.push(r):Y(r)&&n.push(...Df(r.getChildren())));return n}function fa(e){let n=e;e.isCollapsed()||n.removeText();let r=ze();ge(r)&&(n=r),ge(n)||q(161);let s=n.anchor,i=s.getNode(),a=s.offset;for(;!xn(i)&&Jt(i)===null;){let l=i;if([i,a]=lR(i,a),l.is(i))break}return a}function lR(e,n){let r=e.getParent();if(!r){let i=Rn();return Mn().append(i),i.select(),[Mn(),0]}if(te(e)){let i=e.splitText(n);if(i.length===0)return[r,e.getIndexWithinParent()];let a=n===0?0:1;return[r,i[0].getIndexWithinParent()+a]}if(!Y(e)||n===0)return[r,e.getIndexWithinParent()];let s=e.getChildAtIndex(n);if(s){let i=new Ss(_o(e.__key,n,"element"),_o(e.__key,n,"element"),0,""),a=e.insertNewAfter(i);a&&a.append(s,...s.getNextSiblings())}return[r,e.getIndexWithinParent()+1]}function B_(e){return Io(e)||YC(e)||te(e)||e.isParentRequired()}function rf(e){let n=Rn(),r=null;for(let s=0;s<e.length;s++){let i=e[s];if(B_(i)){if(r===null){r=i.createParentElementNode(),n.append(r);let a=e[s+1];if(Io(i)&&(a===void 0||!B_(a)))continue}r.append(i)}else n.append(i),r=null}return n}function Rc(e,n,r,s,i="decorators-and-blocks"){if(n==="move"&&s==="character"&&!e.isCollapsed()){let[g,p]=r===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(g.key,g.offset,g.type),!0}let a=Fr(e.focus,r?"previous":"next"),l=s==="lineboundary",c=n==="move",d=a,f=i==="decorators-and-blocks";if(!Ey(d)){for(let g of d){f=!1;let{origin:p}=g;if(!qe(p)||p.isIsolated()||(d=g,!l||!p.isInline()))break}if(f)for(let g of Dg(a).iterNodeCarets(n==="extend"?"shadowRoot":"root")){if(jn(g))g.origin.isInline()||(d=g);else{if(Y(g.origin))continue;qe(g.origin)&&!g.origin.isInline()&&(d=g)}break}}if(d===a)return!1;if(c&&!l&&qe(d.origin)&&d.origin.isKeyboardSelectable()){let g=vc();return g.add(d.origin.getKey()),tn(g),!0}return d=$o(d),c&&Ua(e.anchor,d),Ua(e.focus,d),f||!l}var Gt=null,At=null,yn=!1,sf=!1,fc=!1,af=new Set,gc=0,K_={characterData:!0,childList:!0,subtree:!0};function Rr(){return yn||Gt!==null&&Gt._readOnly}function Wt(){yn&&q(13)}function EC(){gc>99&&q(14)}function Po(){return Gt===null&&q(195,bC()),Gt}function cR(e){Po()!==null&&At===null&&(At=e),At!==e&&ax(378)}function Ve(){return At===null&&q(337,bC()),At}function TC(){Ve()._dirtyType=2}function bC(){let e=0,n=new Set,r=_s.version;if(typeof window<"u")for(let i of JC(document)){let a=Qa(i);if(Uc(a))e++;else if(a){let l=String(a.constructor.version||"<0.17.1");l===r&&(l+=" (separately built, likely a bundler configuration issue)"),n.add(l)}}let s=` Detected on the page: ${e} compatible editor(s) with version ${r}`;return n.size&&(s+=` and incompatible editors with versions ${Array.from(n).join(", ")}`),s}function vC(){return At}function z_(e,n,r){let s=n.__type,i=dg(e,s),a=r.get(s);a===void 0&&(a=Array.from(i.transforms),r.set(s,a));let l=a.length;for(let c=0;c<l&&(a[c](n),n.isAttached());c++);}function U_(e,n){return e!==void 0&&e.__key!==n&&e.isAttached()}function OC(e,n){if(!n)return;let r=e._updateTags,s=n;Array.isArray(n)||(s=[n]);for(let i of s)r.add(i)}function uR(e){return Mc(e,Ve()._nodes)}function Mc(e,n){let r=e.type,s=n.get(r);s===void 0&&q(17,r);let i=s.klass;e.type!==i.getType()&&q(18,i.name);let a=i.importJSON(e),l=e.children;if(Y(a)&&Array.isArray(l))for(let d=0;d<l.length;d++){let f=Mc(l[d],n);a.append(f)}let c=e.$slots;if(c){Do(a)||q(379,i.name);for(let d in c)Og(a,d,Mc(c[d],n))}return a}function H_(e,n,r){let s=Gt,i=yn,a=At;Gt=n,yn=!0,At=e;try{return r()}finally{Gt=s,yn=i,At=a}}function br(e,n){let r=fc;fc=!0;try{(function(s,i){let{_pendingEditorState:a,_rootElement:l}=s,c=s._headless||l===null;if(a===null)return void(!s._updating&&s._deferred.length>0&&W_(s,s._deferred));let d=s._editorState,f=d._selection,g=a._selection,p=s._dirtyType!==0,h=Gt,x=yn,y=At,{_updating:N,_observer:E}=s,T=null;if(s._pendingEditorState=null,s._editorState=a,!c&&p&&E!==null){At=s,Gt=a,yn=!1,s._updating=!0;try{let{_dirtyType:K,_dirtyElements:U,_dirtyLeaves:J}=s;E.disconnect(),T=vA(d,a,s,K,U,J)}catch(K){if(K instanceof Error&&s._onError(K),sf)throw K;return wC(s,null,l,a),hx(s),s._dirtyType=2,sf=!0,br(s,d),void(sf=!1)}finally{E.observe(l,K_),s._updating=N,Gt=h,yn=x,At=y}}a._readOnly||(a._readOnly=!0);let{_dirtyLeaves:b,_dirtyElements:v,_normalizedNodes:O,_updateTags:k}=s;p&&(s._dirtyType=0,s._cloneNotNeeded.clear(),s._dirtyLeaves=new Set,s._dirtyElements=new Map,s._normalizedNodes=new Set),s._updateTags=new Set,function(K,U){let J=K._decorators,W=K._pendingDecorators||J,ne=U._nodeMap,ee;for(ee in W)ne.has(ee)||(W===J&&(W=BC(K)),delete W[ee])}(s,a);let M=c?null:Xn(Nn(s));if(s._editable&&M!==null&&(p||g===null||g.dirty||!g.is(f))&&l!==null&&!k.has(nC)){At=s,Gt=a;try{if(E!==null&&E.disconnect(),p||g===null||g.dirty){let K=s._blockCursorElement;K!==null&&wc(K,s,l),SC(f,g,s,M,k,l)}(function(K,U,J){let W=K._blockCursorElement;if(ge(J)&&J.isCollapsed()&&J.anchor.type==="element"&&U.contains(kc(U))){let ne=J.anchor,ee=ne.getNode(),se=ne.offset,V=!1,fe=null;if(se===ee.getChildrenSize())pc(ee.getChildAtIndex(se-1))&&(V=!0);else{let Ce=ee.getChildAtIndex(se);if(Ce!==null&&pc(Ce)){let Oe=Ce.getPreviousSibling();(Oe===null||pc(Oe))&&(V=!0,fe=K.getElementByKey(Ce.__key))}}if(V){let Ce=Dn(ee,K.getElementByKey(ee.__key),K).element;return W===null&&(K._blockCursorElement=W=function(Oe){let oe=Oe.theme,ae=Sn().createElement("div");ae.contentEditable="false",ae.setAttribute("data-lexical-cursor","true");let ce=oe.blockCursor;if(ce!==void 0){if(typeof ce=="string"){let De=rl(ce);ce=oe.blockCursor=De}ce!==void 0&&ae.classList.add(...ce)}return ae}(K._config)),U.style.caretColor="transparent",void(fe===null?Ce.appendChild(W):Ce.insertBefore(W,fe))}}W!==null&&wc(W,K,U)})(s,l,g)}finally{E!==null&&E.observe(l,K_),At=y,Gt=h}}T!==null&&function(K,U,J,W,ne){let ee=Array.from(K._listeners.mutation),se=ee.length;for(let V=0;V<se;V++){let[fe,Ce]=ee[V];for(let Oe of Ce){let oe=U.get(Oe);oe!==void 0&&fe(oe,{dirtyLeaves:W,prevEditorState:ne,updateTags:J})}}}(s,T,k,b,d),ge(g)||g===null||f!==null&&f.is(g)||s.dispatchCommand(Gf);let z=s._pendingDecorators;if(z!==null&&(s._decorators=z,s._pendingDecorators=null,xa("decorator",s,!0,z)),function(K,U,J){let W=Y_(U),ne=Y_(J);W!==ne&&xa("textcontent",K,!0,ne)}(s,i||d,a),xa("update",s,!0,{dirtyElements:v,dirtyLeaves:b,editorState:a,mutatedNodes:T,normalizedNodes:O,prevEditorState:i||d,tags:k}),!N)W_(s,s._deferred);(function(K){let U=K._updates;if(U.length===0)return void(K._cascadeCount=0);if(function(W){if(af.has(W))return;af.add(W),setTimeout(()=>{af.delete(W),W._cascadeCount=0},0)}(K),K._cascadeCount++>99)return K._updates=[],K._cascadeCount=0,void K._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: ${K._config.namespace}`));let J=U.shift();if(J){let[W,ne]=J;Ia(K,W,ne)}})(s)})(e,n)}finally{fc=r}}function xa(e,n,r,...s){let i=n._updating;n._updating=r;try{let a=n._listeners[e],l=Array.from(a);for(let[c,d]of l){d&&d();let f=c(...s);a.has(c)?a.set(c,f):f&&f()}}finally{n._updating=i}}function AC(e,n,r,s){let i=pg(e),a;if(!fc)for(let l=0;l<i.length;l++)i[l]._updating||(i[l]._cascadeCount=0);for(let l=4;l>=0;l--)for(let c=0;c<i.length;c++){let d=i[c];if(c>0&&d._updating){a=d;break}let f=d._commands.get(n);if(f!==void 0){let g=f[l];if(g.size>0){let p=!1;if(Hn(d,()=>{for(let h of g)if(h(r,s))return void(p=!0)}),p)return p}}}return a&&a.update(()=>{AC(a,n,r,s)}),!1}function W_(e,n){if(e._deferred=[],n.length!==0){let r=e._updating;e._updating=!0;try{for(let s=0;s<n.length;s++)n[s]()}finally{e._updating=r}}}function G_(e,n){let r=e._updates,s=n||!1;for(;r.length!==0;){let i=r.shift();if(i){let[a,l]=i,c=e._pendingEditorState,d;l!==void 0&&(d=l.onUpdate,l.skipTransforms&&(s=!0),l.discrete&&(c===null&&q(191),c._flushSync=!0),d&&e._deferred.push(d),OC(e,l.tag)),c==null?Ia(e,a,l):a()}}return s}function Ia(e,n,r){let s=e._updateTags,i,a=!1,l=!1;r!==void 0&&(i=r.onUpdate,OC(e,r.tag),a=r.skipTransforms||!1,l=r.discrete||!1),i&&e._deferred.push(i);let{_editorState:c,_pendingEditorState:d}=e,f=!1;(d===null||d._readOnly)&&(d=e._pendingEditorState=RC(d||c),f=!0),d._flushSync=l;let g=Gt,p=yn,h=At,x=e._updating;Gt=d,yn=!1,e._updating=!0,At=e;let y=e._headless||e.getRootElement()===null;cg(null);try{f&&(y?c._selection!==null&&(d._selection=c._selection.clone()):d._selection=function(b,v){let O=b.getEditorState()._selection,k=Xn(Nn(b));return ge(O)||O==null?ka(O,k,b,v):O.clone()}(e,r&&r.event||null));let E=e._compositionKey;n(),a=G_(e,a),function(b,v){let O=v.getEditorState()._selection,k=b._selection;if(ge(k)){let{anchor:M,focus:z}=k,K;if(M.type==="text"&&(K=M.getNode(),K.selectionTransform(O,k)),z.type==="text"){let U=z.getNode();K!==U&&U.selectionTransform(O,k)}}}(d,e),e._dirtyType!==0&&(a?function(b,v){let O=v._dirtyLeaves,k=b._nodeMap;for(let M of O){let z=k.get(M);te(z)&&z.isAttached()&&z.isSimpleText()&&!z.isUnmergeable()&&u_(z)}}(d,e):function(b,v){let{_dirtyLeaves:O,_dirtyElements:k}=v,M=b._nodeMap,z=Mo(),K=new Map,U=O,J=U.size,W=k,ne=W.size;for(;J>0||ne>0;){if(J>0){v._dirtyLeaves=new Set;for(let ee of U){let se=M.get(ee);te(se)&&se.isAttached()&&se.isSimpleText()&&!se.isUnmergeable()&&u_(se),se!==void 0&&U_(se,z)&&z_(v,se,K),O.add(ee)}if(U=v._dirtyLeaves,J=U.size,J>0){gc++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,W.delete("root")&&W.set("root",!0);for(let ee of W){let se=ee[0],V=ee[1];if(k.set(se,V),!V)continue;let fe=M.get(se);fe!==void 0&&U_(fe,z)&&z_(v,fe,K)}U=v._dirtyLeaves,J=U.size,W=v._dirtyElements,ne=W.size,gc++}v._dirtyLeaves=O,v._dirtyElements=k}(d,e),G_(e),function(b,v,O,k){let M=b._nodeMap,z=v._nodeMap,K=[];for(let[W]of k){let ne=z.get(W);ne!==void 0&&(ne.isAttached()||(Y(ne)&&mc(ne,W,M,z,K,k),M.has(W)||k.delete(W),K.push(W)))}for(let W of O){let ne=z.get(W);ne===void 0||ne.isAttached()||(Do(ne)&&ne.__slots!==null&&mc(ne,W,M,z,K,O),M.has(W)||O.delete(W),K.push(W))}for(let W of K)z.delete(W);let U=Ve(),J=U._compositionKey;J===null||z.has(J)||(U._compositionKey=null)}(c,d,e._dirtyLeaves,e._dirtyElements)),E!==e._compositionKey&&(d._flushSync=!0);let T=d._selection;if(ge(T)){e._slotsUsed&&mC(T);let b=d._nodeMap,v=T.anchor.key,O=T.focus.key;b.get(v)!==void 0&&b.get(O)!==void 0||q(19)}else fi(T)&&T._nodes.size===0&&(d._selection=null)}catch(E){return E instanceof Error&&e._onError(E),e._pendingEditorState=c,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void br(e)}finally{Gt=g,yn=p,At=h,e._updating=x,gc=0}e._dirtyType!==0||e._deferred.length>0||function(E,T){let b=T.getEditorState()._selection,v=E._selection;if(v!==null){if(v.dirty||!v.is(b))return!0}else if(b!==null)return!0;return!1}(d,e)?d._flushSync?(d._flushSync=!1,br(e)):f&&AR(()=>{br(e)}):(d._flushSync=!1,f&&(s.clear(),e._deferred=[],e._pendingEditorState=null))}function Hn(e,n,r){At===e&&r===void 0?Rr()?Ia(e,n,r):n():Ia(e,n,r)}function dR(e){if(Rt(e)){let n=null;for(let r of e.getChildren())n=r.isInline()?(n||r.replace(r.createParentElementNode())).append(r):null}}class ko extends ln{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:dR,extends:ln})}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&&q(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 uA[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Gn(this).length===0}isDirty(){let e=Ve()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[];for(let r of Gn(this)){let s=$r(this,r);Y(s)&&e.push(...s.getAllTextNodes())}let n=this.getFirstChild();for(;n!==null;){if(te(n)&&e.push(n),Y(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Y(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;Y(e);){let n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;if(e>=r){let i=n[r-1];return Y(i)&&i.getLastDescendant()||i||null}let s=n[e];return Y(s)&&s.getFirstDescendant()||s||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:ot(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&q(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:ot(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&q(96,this.__key),e}getChildAtIndex(e){let n=this.getChildrenSize(),r,s;if(e<n/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=e;){if(s===e)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=n-1;r!==null&&s>=e;){if(s===e)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let e=my(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContent(),Y(i)&&s!==r-1&&!i.isInline()&&(e+=ds)}return e}getTextContentSize(){let e=function(s){let i=0;for(let a of Gn(s)){let l=$r(s,a);l!==null&&(i+=l.getTextContentSize())}return i}(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContentSize(),Y(i)&&s!==r-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let n=hc[e];return(this.getFormat()&n)!==0}return!1}hasTextFormat(e){let n=Xt[e];return(this.getTextFormat()&n)!==0}getFormatFlags(e,n){return Mr(this.getLatest().__textFormat,e,n)}getTextStyle(){return this.getLatest().__textStyle}select(e,n){Wt();let r=ze(),s=e,i=n,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){let c=this.getFirstChild();if(te(c)||Y(c))return c.select(0,0)}else if(!(e!==void 0&&e!==a||n!==void 0&&n!==a)){let c=this.getLastChild();if(te(c)||Y(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return ge(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):CC(l,s,l,i,"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((n)=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""&&hc[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let n=this.getWritable();return n.__textFormat=e,n}setTextStyle(e){let n=this.getWritable();return n.__textStyle=e,n}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){Nc(this)&&q(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();e+n<=s||q(226,String(e),String(n),String(s));for(let h of r);let a=i.__key,l=[],c=[],d=this.getChildAtIndex(e+n),f=null,g=s-n+r.length;if(e!==0)if(e===s)f=this.getLastChild();else{let h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(n>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let x=0;x<n;x++){h===null&&q(100);let y=h.getNextSibling(),N=h.__key;zn(h.getWritable()),c.push(N),h=y}}let p=f;for(let h of r){p!==null&&h.is(p)&&(f=p=p.getPreviousSibling());let x=h.getWritable();x.__parent===a&&g--,zn(x);let y=h.__key;if(p===null)i.__first=y,x.__prev=null;else{let N=p.getWritable();N.__next=y,x.__prev=N.__key}h.__key===a&&q(76),x.__parent=a,l.push(y),p=h}if(e+n===s){if(p!==null)p.getWritable().__next=null,i.__last=p.__key}else if(d!==null){let h=d.getWritable();if(p!==null){let x=p.getWritable();h.__prev=p.__key,x.__next=d.__key}else h.__prev=null}if(i.__size=g,c.length){let h=ze();if(ge(h)){let x=new Set(c),y=new Set(l),{anchor:N,focus:E}=h;j_(N,x,y)&&Oc(N,N.getNode(),this,f,d),j_(E,x,y)&&Oc(E,E.getNode(),this,f,d),g!==0||this.canBeEmpty()||Rt(this)||this.remove()}}return i}getDOMSlot(e){return new si(e)}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){let r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px",n.setAttribute("data-lexical-indent",String(r)));let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||Rt(this)||this.getChildren().some(te)||(n!==0&&(e.textFormat=n),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,n){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,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,n){let r=Dn(this,e,n),s=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){let a=n.getElementByKey(i.getKey());a!==null&&(s==null?(r.insertChild(a),s=a):s!==a&&r.replaceChild(a,s),s=s.nextSibling)}}}function Y(e){return e instanceof ko}function j_(e,n,r){let s=e.getNode();for(;s;){let i=s.__key;if(n.has(i)&&!r.has(i))return!0;s=s.getParent()}return!1}class Pc extends ln{__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&&q(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function qe(e){return e instanceof Pc}class Ya extends ko{__cachedText;$config(){return this.config("root",{extends:ko})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){let e=this.__cachedText;return e===null||!Rr()&&Ve()._dirtyType!==0?super.getTextContent():e}remove(){q(52)}replace(e){q(53)}insertBefore(e){q(54)}insertAfter(e){q(55)}updateDOM(e,n){return!1}splice(e,n,r){for(let s of r)Y(s)||qe(s)||q(282);return super.splice(e,n,r)}static importJSON(e){return Mn().updateFromJSON(e)}collapseAtStart(){return!0}}function Kt(e){return e instanceof Ya}function RC(e){return new Va(fx(e._nodeMap),null,e._slotsUsed)}function ag(){return new Va(new Map([["root",new Ya]]),null,!1)}function $f(e){let n=e.exportJSON(),r=e.constructor;if(n.type!==r.getType()&&q(130,r.name),Y(e)){let i=n.children;Array.isArray(i)||q(59,r.name);let a=e.getChildren();for(let l=0;l<a.length;l++){let c=$f(a[l]);i.push(c)}}let s=Gn(e);if(s.length>0){let i={};for(let a of s){let l=$r(e,a);l===null&&q(366,r.name,a),i[a]=$f(l)}n.$slots=i}return n}function fR(e){return e instanceof Va}class Va{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,n=null,r=!1){this._nodeMap=e,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=r}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,n){return H_(n&&n.editor||null,this,e)}clone(e){let n=new Va(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return H_(null,this,()=>({root:$f(Mn())}))}}class lg extends ko{$config(){return this.config("artificial",{extends:ko})}createDOM(e){return Sn().createElement("div")}}class Xa extends ln{$config(){return this.config("linebreak",{importDOM:{br:(e)=>MC(e)||DC(e)?null:{conversion:gR,priority:0}}})}getTextContent(){return`
|
|
12
|
+
`}createDOM(){return Sn().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function gR(e){return{node:Bc()}}function Bc(){return el(new Xa)}function Io(e){return e instanceof Xa}function MC(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Dc(r)){let s=n.lastChild;if(s===e||s.previousSibling===e&&Dc(s))return!0}}return!1}function DC(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Dc(r))return!1;let s=n.lastChild;if(s===e||s.previousSibling===e&&Dc(s))return!0}return!1}function Dc(e){return xo(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class qa extends ko{$config(){return this.config("paragraph",{extends:ko,importDOM:{p:()=>({conversion:pR,priority:0})}})}createDOM(e){let n=Sn().createElement("p"),r=li(e.theme,"paragraph");if(r!==void 0)n.classList.add(...r);return n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){this.isEmpty()&&n.append(Sn().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let n=this.getChildren().find(te);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){let r=Rn();r.setTextFormat(e.format),r.setTextStyle(e.style);let s=this.getDirection();return r.setDirection(s),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||te(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 n=Rn();if(ly(n,e),iy(e,n),n.getFormatType()===""){let r=e.getAttribute("align");r&&r&&r in hc&&n.setFormat(r)}return ay(n,e),{node:n}}function Rn(){return el(new qa)}function $C(e){return e instanceof qa}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 wC(e,n,r,s,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ag(),e._pendingEditorState=s,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.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 l=e._observer;l!==null&&(l.disconnect(),e._observer=null),n!==null&&(n.textContent="",function(c,d){let f=`__lexicalKey_${d._key}`;delete c[f]}(n,e)),r!==null&&(r.textContent="",a.set("root",r),PC(r,e,"root"))}function kC(e){let n=new Set,r=new Set;for(let{klass:s,ownNodeConfig:i}of nl(e)){let a=s.transform;if(!r.has(a)){r.add(a);let l=s.transform();l&&n.add(l)}if(i){let l=i.$transform;l&&n.add(l)}}return n}var La={$createDOM:(e,n)=>e.createDOM(n._config,n),$decorateDOM:(e,n,r,s)=>{},$exportDOM:(e,n)=>{let r=Kc(n,e.getType());return r&&r.exportDOM!==void 0?r.exportDOM(n,e):e.exportDOM(n)},$extractWithChild:(e,n,r,s,i)=>Y(e)&&e.extractWithChild(n,r,s),$getDOMSlot:(e,n,r)=>e.getDOMSlot(n),$getSlotTargetElement:(e,n,r,s)=>null,$shouldExclude:(e,n,r)=>Y(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,n,r)=>!n||e.isSelected(n),$updateDOM:(e,n,r,s)=>e.updateDOM(n,r,s._config)};function bR(e){let n=e||{},r=vC(),s=n.theme||{},i=e===void 0?r:n.parentEditor||null,a=n.disableEvents||!1,l=ag(),c=n.namespace||(i!==null?i._config.namespace:zC()),d=n.editorState,f=[Ya,ms,Xa,ja,qa,lg,...n.nodes||[]],{onError:g,onWarn:p,html:h}=n,x=n.editable===void 0||n.editable,y;if(e===void 0&&r!==null)y=r._nodes;else{y=new Map;for(let E=0;E<f.length;E++){let T=f[E],b=null,v=null;if(T&&typeof T=="object"){let M=T;T=M.replace,b=M.with,v=M.withKlass||null}if(typeof T!="function"||!T.prototype||!(T===ln||T.prototype instanceof ln)){let M="<unknown>";try{M=JSON.parse(dx)}catch(z){}q(365,String(E-f.length+(n.nodes?n.nodes.length:0)),typeof T=="function"?`${T.name}${typeof T.getType=="function"?` (type ${String(T.getType())})`:""}`:String(T),String(M))}tl(T);let O=T.getType(),k=kC(T);y.set(O,{exportDOM:h&&h.export?h.export.get(T):void 0,klass:T,replace:b,replaceWithKlass:v,sharedNodeState:_x(f[E]),transforms:k})}}let N=new _s(l,i,y,{disableEvents:a,dom:{...La,...e&&e.dom},namespace:c,theme:s},g||console.error,p||hR,function(E,T){let b=new Map,v=new Set,O=(k)=>{Object.keys(k).forEach((M)=>{let z=b.get(M);z===void 0&&(z=[],b.set(M,z)),z.push(k[M])})};return E.forEach((k)=>{let M=k.klass.importDOM;if(M==null||v.has(M))return;v.add(M);let z=M.call(k.klass);z!==null&&O(z)}),T&&O(T),b}(y,h?h.import:void 0),x,e);return d!==void 0&&(N._pendingEditorState=d,N._dirtyType=2),function(E){E.registerCommand(jf,PA,ti),E.registerCommand(Yf,BA,ti),E.registerCommand(Vf,KA,ti),E.registerCommand(Xf,zA,ti),E.registerCommand(Qf,UA,ti)}(N),N}function vR(e,n){let r=e.get(n);e.delete(n),r&&r()}function ga(e,n,r){return e.set(n,r),vR.bind(null,e,n)}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,n,r,s,i,a,l,c,d){this._createEditorArgs=d,this._parentEditor=n,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Ea,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=s,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=zC(),this._onError=i,this._onWarn=a,this._htmlConversions=l,this._editable=c,this._headless=n!==null&&n._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 ga(this._listeners.update,e)}registerEditableListener(e){return ga(this._listeners.editable,e)}registerDecoratorListener(e){return ga(this._listeners.decorator,e)}registerTextContentListener(e){return ga(this._listeners.textcontent,e)}registerRootListener(e){let n=this._listeners.root;return Lg(ga(n,e,e(this._rootElement,null)||void 0),()=>function(r,s,i){let a=r.get(s);a&&a(),r.set(s,s(...i)||void 0)}(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&q(35);let s=this._commands;s.has(e)||s.set(e,[new ei,new ei,new ei,new ei,new ei]);let i=s.get(e);i===void 0&&q(36,String(e));let a=function(c){return 7&c}(r),l=i[a];return a!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),i.every((c)=>c.size===0)&&s.delete(e)}}registerMutationListener(e,n,r){let s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(n);a===void 0&&(a=new Set,i.set(n,a)),a.add(s);let l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,s),()=>{a.delete(s),a.size===0&&i.delete(n)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return n===void 0&&q(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){let r=this._editorState,s=kf(r).get(n.getType());if(!s)return;let i=new Map;for(let a of s.keys())i.set(a,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,n){let r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){let r=this.registerNodeTransformToKlass(e,n),s=[r],i=r.replaceWithKlass;if(i!=null){let a=this.registerNodeTransformToKlass(i,n);s.push(a)}return function(a,l){let c=kf(a.getEditorState()),d=[];for(let f of l){let g=c.get(f);g&&d.push(g)}if(d.length===0)return;a.update(()=>{for(let f of d)for(let g of f.keys()){let p=ot(g);p&&p.markDirty()}},a._pendingEditorState===null?{tag:dc}:void 0)}(this,s.map((a)=>a.klass.getType())),()=>{s.forEach((a)=>a.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...n){return ie(this,e,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let r=li(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,wC(this,n,e,s,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||HA(n),r!=null&&n.classList.remove(...r)),e!==null){let i=xg(e),a=e.style;a.userSelect="text",a.whiteSpace="pre-wrap",a.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,hx(this),this._updateTags.add(dc),br(this),this._config.disableEvents||function(l,c){let d=l.ownerDocument;Tf.set(l,d);let f=yc.get(d);f===void 0&&(f={editors:new Set,hasShadowEditor:void 0},yc.set(d,f)),f.editors.add(c),f.hasShadowEditor=void 0,l.__lexicalEditor=c;let g=Zx(l);g.push(FA.register(d));for(let p=0;p<Ef.length;p++){let[h,x]=Ef[p],y=typeof x=="function"?(N)=>{N_(N)||(bf(N),(c.isEditable()||h==="click")&&x(N,c))}:(N)=>{if(N_(N))return;bf(N);let E=c.isEditable();switch(h){case"cut":return E&&ie(c,tg,N);case"copy":return ie(c,eg,N);case"paste":return E&&ie(c,qf,N);case"dragstart":return E&&ie(c,Kx,N);case"dragover":return E&&ie(c,zx,N);case"dragend":return E&&ie(c,Ux,N);case"focus":return E&&ie(c,Wx,N);case"blur":return E&&ie(c,Gx,N);case"drop":return E&&ie(c,Bx,N)}};g.push(ng(l,h,y))}}(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(dc),br(this);xa("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&q(38);let r=e;r._readOnly&&(r=RC(e),r._selection=e._selection?e._selection.clone():null),px(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),br(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Hn(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[a,l]of r._nodeMap.entries())Y(l)?this._dirtyElements.set(a,!0):this._dirtyLeaves.add(a)},{discrete:!this._updating||void 0})}parseEditorState(e,n){return function(r,s,i){let a=ag(),l=Gt,c=yn,d=At,{_dirtyElements:f,_dirtyLeaves:g,_cloneNotNeeded:p,_dirtyType:h}=s;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Gt=a,yn=!1,At=s,cg(null);try{let x=s._nodes;Mc(r.root,x),i&&i(),a._readOnly=!0,a._parsed=!0}catch(x){x instanceof Error&&s._onError(x)}finally{s._dirtyElements=f,s._dirtyLeaves=g,s._cloneNotNeeded=p,s._dirtyType=h,Gt=l,yn=c,At=d}return a}(typeof e=="string"?JSON.parse(e):e,this,n)}read(...e){let[n,r]=e.length===1?["force-commit",e[0]]:e;return n==="force-commit"&&br(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(r,{editor:this})}update(e,n){(function(r,s,i){r._updating?r._updates.push([s,i]):Ia(r,s,i)})(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{let s=ze(),i=Mn();s!==null?s.dirty||tn(s.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),xs("focus"),jC(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let n=Xn(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,xa("editable",this,!0,e),this._slotsUsed&&this.update(()=>TC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=dx;var wf=null;function cg(e){wf=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),IC=1;function OR(){IC=1}function dg(e,n){let r=Kc(e,n);return r===void 0&&q(30,n),r}function Kc(e,n){return e._nodes.get(n)}var AR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function zc(e,n){let r=n!==void 0?n:(()=>{let a=e.getRootNode();return gi(a)||ar(a)?ui(a):null})();if(!Ct(r))return!1;if(r.hasAttribute("data-lexical-slot"))return!1;let s=gg(r),i=r.nodeName;return og(s)&&(i==="INPUT"||i==="TEXTAREA"||r.contentEditable==="true"&&Qa(r)==null)}var RR=zc;function Za(e,n,r){let s=e.getRootElement();if(!s)return!1;try{if(!n||!s.contains(n)||!s.contains(r))return!1}catch(i){return!1}return fs(n)===e&&e.read("latest",()=>!zc(n))}function Uc(e){return e instanceof _s}function fs(e){let n=e;for(;n!=null;){let r=Qa(n);if(Uc(r))return r;n=Es(n)}return null}function Qa(e){return e?e.__lexicalEditor:null}function MR(e){return aA.test(e)?"rtl":lA.test(e)?"ltr":null}function Fa(e){return sg(e)||e.isToken()}function Wn(e){return Fa(e)||e.isSegmented()}function xo(e){return _i(e)&&e.nodeType===3}function gi(e){return _i(e)&&e.nodeType===9}function LC(e){let n=e;for(;n!=null;){if(xo(n))return n;n=n.firstChild}return null}function Mr(e,n,r){let s=Xt[n];if(r!==null&&(e&s)===(r&s))return e;let i=e^s;return n==="subscript"?i&=~Xt.superscript:n==="superscript"?i&=~Xt.subscript:n==="lowercase"?(i&=~Xt.uppercase,i&=~Xt.capitalize):n==="uppercase"?(i&=~Xt.lowercase,i&=~Xt.capitalize):n==="capitalize"&&(i&=~Xt.lowercase,i&=~Xt.uppercase),i}function DR(e){return te(e)||Io(e)||qe(e)}function FC(e,n){let r=function(){let l=wf;return wf=null,l}();if((n=n||r&&r.__key)!=null)return void(e.__key=n);Wt(),EC();let s=Ve(),i=Po(),a=""+IC++;i._nodeMap.set(a,e),Y(e)?s._dirtyElements.set(a,!0):s._dirtyLeaves.add(a),s._cloneNotNeeded.add(a),s._dirtyType===0&&(s._dirtyType=1),e.__key=a}function zn(e){Jt(e)!==null&&q(380,e.__key,String(Jt(e)));let n=e.getParent();if(n!==null){let r=e.getWritable(),s=n.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),l=a!==null?a.__key:null,c=i!==null?i.__key:null,d=i!==null?i.getWritable():null,f=a!==null?a.getWritable():null;i===null&&(s.__first=l),a===null&&(s.__last=c),d!==null&&(d.__next=l),f!==null&&(f.__prev=c),r.__prev=null,r.__next=null,r.__parent=null,s.__size--}}var $R=zn;function $c(e){EC(),Nc(e)&&q(323,e.__key,e.__type);let n=e.getLatest(),r=n.__parent!==null?n.__parent:Dr(n)?n.__slotHost:null,s=Po(),i=Ve(),a=s._nodeMap,l=i._dirtyElements;r!==null&&function(d,f,g){let p=d;for(;p!==null;){if(g.has(p))return;let h=f.get(p);if(h===void 0)break;g.set(p,!1),p=h.__parent!==null?h.__parent:Dr(h)?h.__slotHost:null}}(r,a,l);let c=n.__key;i._dirtyType===0&&(i._dirtyType=1),Y(e)?l.set(c,!0):i._dirtyLeaves.add(c)}function Bt(e){Wt();let n=Ve(),r=n._compositionKey;if(e!==r){if(n._compositionKey=e,r!==null){let s=ot(r);s!==null&&s.getWritable()}if(e!==null){let s=ot(e);s!==null&&s.getWritable()}}}function Mo(){if(Rr())return null;return Ve()._compositionKey}function ot(e,n){let r=(n||Po())._nodeMap.get(e);return r===void 0?null:r}function fg(e,n){let r=hi(e,Ve());return r!==void 0?ot(r,n):null}function PC(e,n,r){e[`__lexicalKey_${n._key}`]=r}function hi(e,n){return e[`__lexicalKey_${n._key}`]}function gg(e,n){let r=e;for(;r!=null;){let s=fg(r,n);if(s!==null)return s;r=Es(r)}return null}function BC(e){let n=e._decorators,r=Object.assign({},n);return e._pendingDecorators=r,r}function Y_(e){return e.read(()=>Mn().getTextContent())}function Mn(){return Po()._nodeMap.get("root")}function tn(e){Wt();let n=Po();e!==null&&(e.dirty=!0,e.setCachedNodes(null),ge(e)&&Ve()._slotsUsed&&mC(e)),n._selection=e}function V_(){Wt(),px(Ve())}function oi(e){let n=function(r,s){let i=r;for(;i!=null;){let a=hi(i,s);if(a!==void 0)return a;i=Es(i)}return null}(e,Ve());return n===null?null:ot(n)}function KC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pg(e){let n=[];for(let r=e;r!==null;r=r._parentEditor)n.push(r);return n}function zC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function UC(e){return xo(e)?e.nodeValue:null}function hg(e,n,r){let s=Xn(Nn(n));if(s===null)return;let i=Yn(s,n._rootElement),a=i.anchorNode,{anchorOffset:l,focusOffset:c}=i;if(a!==null){let d=UC(a),f=gg(a);if(d!==null&&te(f)){if((d===Na||d===zf)&&r){let g=r.length;d=r,l=g,c=g}d!==null&&mg(f,d,l,c,e)}}}function mg(e,n,r,s,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let l=a.isComposing();if(a.isToken()&&l)return;let c=n;if((l||i)&&(n.endsWith(Na)&&(c=n.slice(0,-Na.length)),i)){let f=zf,g;for(;(g=c.indexOf(f))!==-1;)c=c.slice(0,g)+c.slice(g+f.length),r!==null&&r>g&&(r=Math.max(g,r-f.length)),s!==null&&s>g&&(s=Math.max(g,s-f.length))}let d=a.getTextContent();if(i||c!==d){let f=ze();if(c===""){if(Bt(null),Ha||gs||Wa)a.remove();else{let N=Ve();lf(a,"",f),setTimeout(()=>{N.update(()=>{a.isAttached()&&a.getTextContent()===""&&a.remove()})},20)}return}let g=a.getParent(),p=Ns(),h=a.getTextContentSize(),x=Mo(),y=a.getKey();if(a.isToken()&&!l||x!==null&&y===x&&!l||ge(p)&&(g!==null&&!g.canInsertTextBefore()&&p.anchor.offset===0||p.anchor.key===e.__key&&p.anchor.offset===0&&!a.canInsertTextBefore()&&!l||p.focus.key===e.__key&&p.focus.offset===h&&!a.canInsertTextAfter()&&!l))return void a.markDirty();if(!ge(f)||r===null||s===null)return void lf(a,c,f);if(f.setTextNodeRange(a,r,a,s),a.isSegmented()){let N=Cn(a.getTextContent());a.replace(N),a=N}lf(a,c,f)}}}function lf(e,n,r){if(e.setTextContent(n),ge(r)){let s=e.getKey(),i=!1;for(let a of["anchor","focus"]){let l=r[a];l.type==="text"&&l.key===s&&(l.offset=mo(e,l.offset,"clamp"),i=!0)}i&&(r._cachedNodes=null,r._cachedIsBackward=null)}}function ic(e,n,r){let s=n[r]||!1;return s==="any"||s===e[r]}function HC(e,n){return ic(e,n,"altKey")&&ic(e,n,"ctrlKey")&&ic(e,n,"shiftKey")&&ic(e,n,"metaKey")}function Qe(e,n,r){if(!HC(e,r))return!1;if(e.key.toLowerCase()===n.toLowerCase())return!0;if(n.length>1)return!1;if(e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(n))return e.code===`Digit${n}`;let s="Key"+n.toUpperCase();return e.code===s}var or={ctrlKey:!Bn,metaKey:Bn},X_={altKey:Bn,ctrlKey:!Bn};function q_(e){return e.key==="Backspace"}function wR(e){let n=Mn();if(ge(e)){let{anchor:r,focus:s}=e,i=r.getNode();if(Kt(i))return r.set(i.getKey(),0,"element"),s.set(i.getKey(),i.getChildrenSize(),"element"),ni(e),e;let a=i.getTopLevelElementOrThrow(),l=a.getParent();if(l===null)return Y(a)&&(r.set(a.getKey(),0,"element"),s.set(a.getKey(),a.getChildrenSize(),"element"),ni(e)),e;let c=l;return r.set(c.getKey(),0,"element"),s.set(c.getKey(),c.getChildrenSize(),"element"),ni(e),e}{let r=n.select(0,n.getChildrenSize());return tn(ni(r)),r}}function li(e,n){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let r=e.__lexicalClassNameCache,s=r[n];if(s!==void 0)return s;let i=e[n];if(typeof i=="string"){let a=rl(i);return r[n]=a,a}return i}function _g(e,n,r,s,i){if(r.size===0)return;let{__type:a,__key:l}=s,c=n.get(a);c===void 0&&q(33,a);let d=c.klass,f=e.get(d);f===void 0&&(f=new Map,e.set(d,f));let g=f.get(l),p=g==="destroyed"&&i==="created";(g===void 0||p)&&f.set(l,p?"updated":i)}function kR(e){let n=e.getType(),r=Po();if(r._readOnly){let a=kf(r).get(n);return a?Array.from(a.values()):[]}let s=r._nodeMap,i=[];for(let[,a]of s)a instanceof e&&a.__type===n&&a.isAttached()&&i.push(a);return i}function J_(e,n,r){let s=e.getParent(),i=r,a=e;return s!==null&&(n&&r===0?(i=a.getIndexWithinParent(),a=s):n||r!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=s)),a.getChildAtIndex(n?i-1:i)}function WC(e,n){let r=e.offset;if(e.type==="element")return J_(e.getNode(),n,r);{let s=e.getNode();if(n&&r===0||!n&&r===s.getTextContentSize()){let i=n?s.getPreviousSibling():s.getNextSibling();return i===null?J_(s.getParentOrThrow(),n,s.getIndexWithinParent()+(n?0:1)):i}}return null}function GC(e){let n=Nn(e).event,r=n&&n.inputType;return r==="insertFromPaste"||r==="insertFromPasteAsQuotation"}function ie(e,n,...r){return AC(e,n,r[0],e)}function ci(e,n){let r=e._keyToDOMMap.get(n);return r===void 0&&q(75,n),r}function Es(e){let n=e.assignedSlot||e.parentElement;if(n!==null)return n;let r=e.parentNode;return ar(r)?r.host:null}function Hc(e){return gi(e)?e:Ct(e)?e.ownerDocument:null}function IR(e){return Ve()._updateTags.has(e)}function xs(e){Wt(),Ve()._updateTags.add(e)}function jC(e){Wt(),Ve()._deferred.push(e)}function Pa(e,n){let r=e.getParent();for(;r!==null;){if(r.is(n))return!0;r=r.getParent()}return!1}function xg(e){let n=Hc(e);return n?n.defaultView:null}function Nn(e){let n=e._window;return n===null&&q(78),n}function YC(e){return Y(e)&&e.isInline()||qe(e)&&e.isInline()}function Cg(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null&&Y(n))return n;let r=n.getParentOrThrow();if(Rt(r))return r;n=r}return n}function yg(e){return Y(e)&&e.isShadowRoot()}function Rt(e){return Kt(e)||yg(e)}function Sg(e,n=!1){let r=e.constructor.clone(e,ug);return FC(r,null),r.afterCloneFrom(e),n||r.resetOnCopyNodeFrom(e),r}function el(e){let n=Ve(),r=e.getType(),s=Kc(n,r);s===void 0&&q(200,e.constructor.name,r);let{replace:i,replaceWithKlass:a}=s;if(i!==null){let l=i(e),c=l.constructor;return a!==null?l instanceof a||q(201,a.name,a.getType(),c.name,c.getType(),e.constructor.name,r):l instanceof e.constructor&&c!==e.constructor||q(202,c.name,c.getType(),e.constructor.name,r),l.__key===e.__key&&q(203,e.constructor.name,r,c.name,c.getType()),l}return e}function cf(e,n){!Kt(e.getParent())||Y(n)||qe(n)||q(99)}function VC(e){let n=ot(e);return n===null&&q(63,e),n}function pc(e){if(!e||e.isInline())return!1;if(qe(e))return!0;if(Y(e)){if(e.isShadowRoot()){let n=e.getParent();return!(Y(n)&&n.isShadowRoot())}return!e.canBeEmpty()}return!1}function wc(e,n,r){r.style.removeProperty("caret-color"),n._blockCursorElement=null;let s=e.parentElement;s!==null&&s.removeChild(e)}function Xn(e){return Vn?(e||window).getSelection():null}function XC(e){let n=xg(e);return n?n.getSelection():null}function ar(e){return oy(e)&&"host"in e}var LR=[];function qC(e){let n=e.getRootNode();if(n===e||!ar(n))return LR;let r=[n],s=n.host;for(;;){let i=s.getRootNode();if(i===s||!ar(i))break;r.push(i),s=i.host}return r}function*JC(e){let n=[e],r;for(;r=n.pop();){yield*r.querySelectorAll('[data-lexical-editor="true"]');let s=(gi(r)?r:r.ownerDocument).createTreeWalker(r,NodeFilter.SHOW_ELEMENT),i;for(;i=s.nextNode();)i.shadowRoot&&n.push(i.shadowRoot)}}function ZC(e){return e!==null?e.ownerDocument:document}function Sn(){let e=vC();return ZC(e!==null?e._rootElement:null)}function mi(e,n){if(n===null||typeof e.getComposedRanges!="function")return null;let r=qC(n);if(r.length===0)return null;let s=e.getComposedRanges;try{let i=s.call(e,{shadowRoots:r})[0];if(i!==void 0)return i}catch(i){}try{let i=s.apply(e,r)[0];if(i!==void 0)return i}catch(i){}return null}function QC(e,n){let r=mi(e,n);if(r!==null){let s=ey(r);if(s!==null)return s}return e.rangeCount>0?e.getRangeAt(0):null}function Yn(e,n){let r=mi(e,n);return r===null?e:ty(r,ny(e))}function FR(e,n){let r=mi(e,n);if(r===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let s=ey(r)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ty(r,ny(e)),range:s}}function ey(e){let n=e.startContainer.ownerDocument;if(n===null)return null;let r=n.createRange();try{return r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset),r}catch(s){return null}}function ty(e,n){let{startContainer:r,startOffset:s,endContainer:i,endOffset:a}=e;return n==="backward"?{anchorNode:i,anchorOffset:a,direction:n,focusNode:r,focusOffset:s}:{anchorNode:r,anchorOffset:s,direction:n,focusNode:i,focusOffset:a}}function ny(e){return e.direction}function kc(e){let n=e.getRootNode();return gi(n)||ar(n)?n.activeElement:null}function ui(e){let n=e.activeElement;for(;n!==null&&n.shadowRoot!==null;){let r=n.shadowRoot.activeElement;if(r===null)break;n=r}return n}function Ng(e){let n=e.target;if(n!==null&&Ct(n)&&n.shadowRoot!==null&&typeof e.composedPath=="function"){let r=e.composedPath();if(r.length>0)return r[0]}return n}function PR(e,n){let r=e.getChildAtIndex(n);r==null&&(r=e),Rt(e)&&q(102);let s=(l)=>{let c=l.getParentOrThrow(),d=Rt(c),f=l!==r||d?Sg(l):l;if(d)return Y(l)&&Y(f)||q(133),l.insertAfter(f),[l,f,f];{let[g,p,h]=s(c),x=l.getNextSiblings();return h.append(f,...x),[g,p,f]}},[i,a]=s(r);return[i,a]}function BR(e){return Ct(e)&&e.tagName==="A"}function KR(e){return Ct(e)&&e.tagName==="TR"}function zR(e){return Ct(e)&&(e.tagName==="TD"||e.tagName==="TH")}function Ct(e){return _i(e)&&e.nodeType===1}function _i(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function oy(e){return _i(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 ry(e){return!(!Ct(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(!Ct(e)||!e.style.display.startsWith("inline"))&&HR.test(e.nodeName)}function xn(e){if(qe(e)&&!e.isInline())return!0;if(!Y(e)||Rt(e))return!1;let n=e.getFirstChild(),r=n===null||Io(n)||te(n)||n.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&r}function Co(){return Ve()}function Tg(e=Co()){return e._config.dom||La}function Dn(e,n,r=Co()){let s=Tg(r).$getDOMSlot(e,n,r);return Y(e)&&(sy(s)||q(344,e.getKey(),e.getType())),s}function WR(e,n,r,s){let i=e.read("latest",()=>{let a=ot(n);return a!==null?function(l,c,d=Co()){let f=$r(l,c);if(f===null)return null;let g=d.getElementByKey(f.getKey());return g!==null?g.parentElement:null}(a,r,e):null});return i!==null&&(i.parentElement!==s&&s.appendChild(i),i.style.display=""),i}function GR(e,n,r){r.style.display="none";let s=e.getElementByKey(n);s!==null&&r.parentElement!==s&&s.insertBefore(r,s.firstChild)}function sy(e){return e instanceof si}function ir(e,n,r=Co()){return LC(Dn(e,n,r).element)}var Z_=new WeakMap,jR=new Map;function kf(e){if(!e._readOnly&&e.isEmpty())return jR;e._readOnly||q(192);let n=Z_.get(e);return n||(n=function(r){let s=new Map;for(let[i,a]of r._nodeMap){let l=a.__type,c=s.get(l);c||(c=new Map,s.set(l,c)),c.set(i,a)}return s}(e),Z_.set(e,n)),n}function bg(e){let n=e.constructor.clone(e,ug);return n.afterCloneFrom(e),n}function YR(e){return(n=bg(e))[Qx]=!0,n;var n}function iy(e,n){let r=e.getAttribute("data-lexical-indent");if(r!==null){let a=parseInt(r,10);if(Number.isFinite(a)&&a>=0)return void n.setIndent(a)}let s=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(s/40);n.setIndent(i)}function ay(e,n){let r=n.getAttribute("dir");return r==="ltr"||r==="rtl"?e.setDirection(r):e}function ly(e,n){let r=n.style.textAlign;return r&&r in hc?e.setFormat(r):e}function cy(e,n){e.__lexicalUnmanaged=!0,n&&n.captureSelection!==void 0&&(e.__lexicalCapturedSelection=n.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function uy(e,n=Co()){let r=n.isEditable();e.contentEditable=r?"true":"false",r?e.__lexicalEditor=n:delete e.__lexicalEditor}function Ba(e,n){let r=e;for(;r!=null;){if(r.__lexicalCapturedSelection===!0)return!0;if(Ct(r)&&r.hasAttribute("data-lexical-slot"))return!1;if(hi(r,n)!==void 0)return!1;r=Es(r)}return!1}function pa(e,n){return function(r,s){return Object.prototype.hasOwnProperty.call(r,s)}(e,n)&&e[n]!==ln[n]}var Q_=new WeakMap,ex=Symbol("lexical.synthesizedGetType");function tl(e){let n=Q_.get(e);if(n)return n;let r=e.prototype!=null&&Qm in e.prototype?e.prototype[Qm]():void 0,s=function(f){if(!(f===ln||f.prototype instanceof ln)){let g="<unknown>",p="<unknown>";try{g=f.getType()}catch(h){}try{_s.version&&(p=JSON.parse(_s.version))}catch(h){}q(290,f.name,g,p)}return f===Pc||f===ko||f===ln}(e),i=!s&&pa(e,"getType")?e.getType:void 0,a=i&&!(ex in i)?i.call(e):void 0,l,c=a;if(r)if(a)l=r[a];else{for(let[f,g]of Object.entries(r))c=f,l=g;if(!l)for(let f of Object.getOwnPropertySymbols(r)){let g=r[f];if(g){l=g;break}}}if(!s&&c){if(!pa(e,"getType")){let f=e,g=function(){return this!==f?ln.getType.call(this):c};g[ex]=!0,e.getType=g}if(pa(e,"clone")||(e.clone=(f,g)=>{cg(f);let p=new e;return g!==ug&&p.afterCloneFrom(f),p}),pa(e,"importJSON")||(e.importJSON=l&&l.$importJSON||((f)=>new e().updateFromJSON(f))),!pa(e,"importDOM")&&l){let{importDOM:f}=l;f&&(e.importDOM=()=>f)}}let d={klass:e,ownNodeConfig:l,ownNodeType:c};return Q_.set(e,d),d}function*nl(e){for(let n=e;n&&(n===ln||og(n.prototype));){let r=tl(n);yield r,n=r.ownNodeConfig&&r.ownNodeConfig.extends||dy(n)}}function VR(e){let n=new Map,r=new Map;for(let s of e){let{ownNodeType:i}=tl(s);i&&(r.set(i,s),n.set(i,new Set))}for(let[s,i]of r)for(let{ownNodeType:a}of nl(i)){let l=a&&n.get(a);l&&l.add(s)}return n}function XR(e){let n=Co();return Wt(),new(n.resolveRegisteredNodeAfterReplacements(n.getRegisteredNode(e))).klass}var Er=(e,n)=>{let r=e;for(;r!=null&&!Kt(r);){if(n(r))return r;r=r.getParent()}return null};function Ka(e,n){let r=[],s=e.__first;for(;s!==null;){let i=n===null?ot(s):n.get(s);i==null&&q(174),r.push(s),s=i.__next}return r}function dy(e){let n=Object.getPrototypeOf(e);if(typeof n=="function"&&n!==Function.prototype)return n;let r=e.prototype&&Object.getPrototypeOf(e.prototype);return r?r.constructor:null}var fy=new Map;function Do(e){return Y(e)||qe(e)}function Dr(e){return Y(e)||qe(e)}function Jt(e){let n=e.getLatest();return Dr(n)?n.__slotHost:null}function Un(e){let n=Jt(e);if(n===null)return null;let r=ot(n);return Y(r)||qe(r)||q(370),r}function gy(e){let n=Un(e);if(n===null)return null;let r=e.getLatest().__key;for(let[s,i]of Wc(n))if(i===r)return s;return null}function py(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null)return n;n=n.getParent()}return null}function Wc(e){let n=e.getLatest();return Do(n)&&n.__slots!==null?n.__slots:fy}function Gn(e){return Array.from(Wc(e).keys())}function $r(e,n){let r=Wc(e).get(n);return r===void 0?null:ot(r)}var qR=["__proto__","constructor","prototype"],tx=Symbol("slotMapOwner");function If(e){let n=e.__slots;return n!==null&&n[tx]===e||(n=new Map(n),n[tx]=e,e.__slots=n),n}var nx=new WeakMap,JR=[];function hy(e){for(let{ownNodeConfig:n}of nl(e)){let r=n&&n.slots;if(r)return r}return JR}function my(e){let n="";for(let r of Gn(e)){let s=$r(e,r);s!==null&&(n+=s.getTextContent())}return n}function ox(e,n,r){let s=r.get(e),i=r.get(n);return s!==void 0?i!==void 0?s-i:-1:i!==void 0?1:e<n?-1:e>n?1:0}function ZR(e){let n=e.__slots;if(n===null||n.size<2)return;let r=function(l){let c=nx.get(l);if(c===void 0){let d=hy(l),f=new Map;for(let g of d)qR.includes(g)&&q(371,l.name,g),f.has(g)&&q(372,l.name,g),f.set(g,f.size);c=f,nx.set(l,c)}return c}(e.constructor),s=null,i=!0;for(let l of n.keys()){if(s!==null&&ox(s,l,r)>0){i=!1;break}s=l}if(i)return;let a=Array.from(n).sort(([l],[c])=>ox(l,c,r));n.clear();for(let[l,c]of a)n.set(l,c)}function Og(e,n,r){n!=="__proto__"&&n!=="constructor"&&n!=="prototype"||q(373,n);let s=e.getLatest();if(s.__slots!==null&&s.__slots.get(n)===r.getLatest().__key)return s;(!Y(r)&&!qe(r)||r.isInline())&&q(374,r.__key);let i=e.getWritable(),a=If(i),l=a.get(n);l!==void 0&&xy(l);let c=r.getWritable(),d=Un(c);if(d!==null){let f=gy(c);f!==null&&If(d.getWritable()).delete(f),c.__slotHost=null}return zn(c),c.__slotHost=i.__key,a.set(n,c.__key),ZR(i),function(){let f=Co();f._slotsUsed=!0,f._pendingEditorState&&(f._pendingEditorState._slotsUsed=!0)}(),i}function _y(e,n){let r=e.getWritable();if(r.__slots===null)return r;let s=r.__slots.get(n);return s!==void 0&&(xy(s),If(r).delete(n)),r}function rx(e,n){}function xy(e){let n=ot(e);if(n===null)return;let r=n.getWritable();Dr(r)||q(377,e),r.__slotHost=null,r.remove()}var QR={next:"previous",previous:"next"};class ol{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:wr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return St(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return St(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){let r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){let s=r===this.direction?n:Array.from(n).reverse(),i=this,a=this.getParentAtCaret(),l=new Map;for(let c=i.getAdjacentCaret();c!==null&&l.size<e;c=c.getAdjacentCaret()){let d=c.origin.getWritable();l.set(d.getKey(),d)}for(let c of s){if(l.size>0){let d=i.getNodeAtCaret();if(d)if(l.delete(d.getKey()),l.delete(c.getKey()),d.is(c)||i.origin.is(c));else{let f=c.getParent();f&&f.is(a)&&c.remove(),d.replace(c)}else d===null&&q(263,Array.from(l).join(" "))}else i.insert(c);i=St(c,this.direction)}for(let c of l.values())c.remove();return this}}class za extends ol{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lr(e,this.direction)}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||lr(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof za&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var eM={root:Kt,shadowRoot:Rt};function Pr(e){return QR[e]}function Ag(e,n="root"){return e===null||eM[n](e)?null:Jt(e)===null?e:null}class Cs extends ol{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:St(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Y(this.origin)?lr(this.origin,this.direction):null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||lr(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 ol{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:kr(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return kr(this.origin,Pr(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 St(this.origin,this.direction)}}function ho(e){return e instanceof ys}function tM(e){return e instanceof ol}function wr(e){return e instanceof Cs}function jn(e){return e instanceof za}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 za{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends za{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function St(e,n){return e?new oM[n](e):null}function kr(e,n,r){return e?new nM[n](e,mo(e,r)):null}function mo(e,n,r="error"){let s=e.getTextContentSize(),i=n==="next"?s:n==="previous"?0:n;return(i<0||i>s)&&(r!=="clamp"&&ax(284,String(n),String(s),e.getKey()),i=i<0?0:s),i}function Lf(e,n){return new Mg(e,n)}function lr(e,n){return Y(e)?new rM[n](e):null}function Cy(e){return e&&e.getChildCaret()||e}function di(e){return e&&Cy(e.getAdjacentCaret())}class Rg{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){let e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new Rg(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=(s)=>{let i=this[s].getLatest();return ho(i)?function(a,l){let{direction:c,origin:d}=a,f=mo(d,l==="focus"?Pr(c):c);return Lf(a,f-a.offset)}(i,s):null},n=e("anchor"),r=e("focus");if(n&&r){let{caret:s}=n,{caret:i}=r;if(s.isSameNodeCaret(i))return[Lf(s,i.offset-s.offset),null]}return[n,r]}iterNodeCarets(e="root"){let n=ho(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=ho(r),i=(a)=>a.isSameNodeCaret(r)?null:di(a)||a.getParentCaret(e);return $g({hasNext:(a)=>a!==null&&!(s&&r.isSameNodeCaret(a)),initial:n.isSameNodeCaret(r)?null:i(n),map:(a)=>a,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Mg{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){let{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){let[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:n}}=this,[r,s]=this.getSliceIndices(),i=e.getTextContent();return kr(e.setTextContent(i.slice(0,r)+i.slice(s)),n,r)}}function sM(e){return e instanceof Mg}function Dg(e){return Lr(e,St(Mn(),e.direction))}function yy(e){return Lr(e,e)}function Lr(e,n){return e.direction!==n.direction&&q(265),new Rg(e,n,e.direction)}function $g(e){let{initial:n,hasNext:r,step:s,map:i}=e,a=n;return{[Symbol.iterator](){return this},next(){if(!r(a))return{done:!0,value:void 0};let l={done:!1,value:i(a)};return a=s(a),l}}}function wg(e,n){let r=Ic(e.origin,n.origin);switch(r===null&&q(275,e.origin.getKey(),n.origin.getKey()),r.type){case"same":{let s=e.type==="text",i=n.type==="text";return s&&i?function(a,l){return Math.sign(a-l)}(e.offset,n.offset):e.type===n.type?0:s?-1:i?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return n.type==="child"?1:-1;case"branch":return kg(r)}}function kg(e){let{a:n,b:r}=e,s=n.__key,i=r.__key,a=n,l=r;for(;a&&l;a=a.getNextSibling(),l=l.getNextSibling()){if(a.__key===i)return-1;if(l.__key===s)return 1}return a===null?1:-1}function ac(e,n){return n.is(e)}function sx(e){return Y(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ic(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};let r=new Map;for(let[s,i]=sx(e);s;i=s,s=s.getParent())r.set(s,i);for(let[s,i]=sx(n);s;i=s,s=s.getParent()){let a=r.get(s);if(a!==void 0)return a===null?(ac(e,s)||q(276),{commonAncestor:s,type:"ancestor"}):i===null?(ac(n,s)||q(277),{commonAncestor:s,type:"descendant"}):((Y(a)||ac(e,a))&&(Y(i)||ac(n,i))&&s.is(a.getParent())&&s.is(i.getParent())||q(278),{a,b:i,commonAncestor:s,type:"branch"})}return null}function Fr(e,n){let{type:r,key:s,offset:i}=e,a=VC(e.key);return r==="text"?(te(a)||q(266,a.getType(),s),kr(a,n,i)):(Y(a)||q(267,a.getType(),s),Ty(a,e.offset,n))}function Ua(e,n){let{origin:r,direction:s}=n,i=s==="next";ho(n)?e.set(r.getKey(),n.offset,"text"):wr(n)?te(r)?e.set(r.getKey(),mo(r,s),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(i?1:0),"element"):(jn(n)&&Y(r)||q(268),e.set(r.getKey(),i?0:r.getChildrenSize(),"element"))}function Sy(e){let n=ze(),r=ge(n)?n:yC();return Ca(r,e),tn(r),r}function Ca(e,n){Ua(e.anchor,n.anchor),Ua(e.focus,n.focus)}function Ff(e){let{anchor:n,focus:r}=e,s=Fr(n,"next"),i=Fr(r,"next"),a=wg(s,i)<=0?"next":"previous";return Lr(Fo(s,a),Fo(i,a))}function Ts(e){let{direction:n,origin:r}=e,s=St(r,Pr(n)).getNodeAtCaret();return s?St(s,n):lr(r.getParentOrThrow(),n)}function ix(e,n="root"){let r=[e];for(let s=jn(e)?e.getParentCaret(n):e.getSiblingCaret();s!==null;s=s.getParentCaret(n))r.push(Ts(s));return r}function uf(e){return!!e&&e.origin.isAttached()}function Ny(e,n="removeEmptySlices"){if(e.isCollapsed())return e;let r="root",s="next",i=n,a=Ig(e,s),l=ix(a.anchor,r),c=ix(a.focus.getFlipped(),r),d=new Set,f=[];for(let N of a.iterNodeCarets(r))if(jn(N))d.add(N.origin.getKey());else if(wr(N)){let{origin:E}=N;Y(E)&&!d.has(E.getKey())||f.push(E)}let g=new Set;for(let N of f){let E=N.getParent();E===null||d.has(E.getKey())||g.add(E),zn(N)}for(let N of g)!N.canBeEmpty()&&!Rt(N)&&N.isEmpty()&&N.isAttached()&&N.remove();for(let N of a.getTextSlices()){if(!N)continue;let{origin:E}=N.caret,T=E.getTextContentSize(),b=Ts(St(E,s)),v=E.getMode();if(Math.abs(N.distance)===T&&i==="removeEmptySlices"||v==="token"&&N.distance!==0)b.remove();else if(N.distance!==0){i="removeEmptySlices";let O=N.removeTextSlice(),k=N.caret.origin;if(v==="segmented"){let M=O.origin,z=Cn(M.getTextContent()).setStyle(M.getStyle()).setFormat(M.getFormat());b.replaceOrInsert(z),O=kr(z,s,O.offset)}k.is(l[0].origin)&&(l[0]=O),k.is(c[0].origin)&&(c[0]=O.getFlipped())}}let p,h;for(let N of l)if(uf(N)){p=$o(N);break}for(let N of c)if(uf(N)){h=$o(N);break}let x=function(N,E,T){if(!N||!E)return null;let b=N.getParentAtCaret(),v=E.getParentAtCaret();if(!b||!v)return null;let O=b.getParents().reverse();O.push(b);let k=v.getParents().reverse();k.push(v);let M=Math.min(O.length,k.length),z;for(z=0;z<M&&O[z]===k[z];z++);let K=(W,ne)=>{let ee;for(let se=z;se<W.length;se++){let V=W[se];if(Rt(V))return;!ee&&ne(V)&&(ee=V)}return ee},U=K(O,xn),J=U&&K(k,(W)=>T.has(W.getKey())&&xn(W));if(J&&Gn(J).length>0)return null;return U&&J?[U,J]:null}(p,h,d);if(x){let[N,E]=x;lr(N,"previous").splice(0,E.getChildren());let T=E.getParent();for(E.remove(!0);T&&T.isEmpty();){let b=T;T=T.getParent(),b.remove(!0)}}else if(h){let N=function(b){if(jn(b)){let v=b.origin;if(xn(v))return v}else{let v=b.getParentAtCaret();if(v&&xn(v))return v}return null}(h),E=N&&N.getParent(),T=N&&N.getParents().findLast(yg);if(N&&E&&!Kt(E)&&N.isEmpty()&&d.has(N.getKey())&&Gn(N).length===0&&(!T||d.has(T.getKey()))){N.remove(!0);let b=E;for(;b&&!Kt(b)&&b.isEmpty();){let v=b.getParent();if(v&&Kt(v)&&v.getChildrenSize()<=1)break;let O=b;b=v,O.remove(!0)}}}let y=[p,h,...l,...c].find(uf);if(y)return yy(Fo($o(y),e.direction));q(269,JSON.stringify(l.map((N)=>N.origin.__key)))}function $o(e){let n=function(i){let a=i;for(;jn(a);){let l=di(a);if(!jn(l))break;a=l}return a}(e.getLatest()),{direction:r}=n;if(te(n.origin))return ho(n)?n:kr(n.origin,r,r);let s=n.getAdjacentCaret();return wr(s)&&te(s.origin)?kr(s.origin,r,Pr(r)):n}function Ey(e){return ho(e)&&e.offset!==mo(e.origin,e.direction)}function Fo(e,n){return e.direction===n?e:e.getFlipped()}function Ig(e,n){return e.direction===n?e:Lr(Fo(e.focus,n),Fo(e.anchor,n))}function Ty(e,n,r){let s=lr(e,"next");for(let i=0;i<n;i++){let a=s.getAdjacentCaret();if(a===null)break;s=a}return Fo(s,r)}function iM(e,n="root"){let r=0,s=e,i=di(s);for(;i===null;){if(r--,i=s.getParentCaret(n),!i)return null;s=i,i=di(s)}return i&&[i,r]}function aM(e){let{origin:n,offset:r,direction:s}=e;if(r===mo(n,s))return e.getSiblingCaret();if(r===mo(n,Pr(s)))return Ts(e.getSiblingCaret());let[i]=n.splitText(r);return te(i)||q(281),Fo(St(i,"next"),s)}function lM(e,n){return!0}function by(e,{$copyElementNode:n=Sg,$splitTextPointCaretNext:r=aM,rootMode:s="shadowRoot",$shouldSplit:i=lM,removeEmptyDestination:a=!1}={}){if(ho(e))return r(e);let l=e.getParentCaret(s);if(l){let{origin:c}=l;if(jn(e)){let f=Ts(l);if(a&&c.isEmpty())return c.remove(),f;if(!c.canBeEmpty()||!i(c,"first"))return f}let d=function(f){let g=[];for(let p=f.getAdjacentCaret();p;p=p.getAdjacentCaret())g.push(p.origin);return g}(e);(d.length>0||!a&&c.canBeEmpty()&&i(c,"last"))&&l.insert(n(c).splice(0,0,d))}return l}function vy(e,n,r){let s=Fo(n,"next");ho(s)&&(s.offset===0?s=St(s.origin,"previous").getFlipped():s.offset===s.origin.getTextContentSize()&&(s=St(s.origin,"next"))),s.origin.is(e)&&(wr(s)||q(342,e.getKey(),e.getType()),s=Ts(s)),(e.is(s.getNodeAtCaret())||e.is(s.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=s;i;i=by(i,r))s=i;return ho(s)&&q(283),s.insert(e.isInline()?Rn().append(e):e),Fo(St(e.getLatest(),"next"),n.direction)}function cM(e){return e}function uM(...e){return e}function dM(e,n){return[e,n]}function fM(e){return e}function gM(e,n){if(!n||e===n)return e;for(let r in n)if(e[r]!==n[r])return{...e,...n};return e}function rl(...e){let n=[];for(let r of e)if(r&&typeof r=="string")for(let[s]of r.matchAll(/\S+/g))n.push(s);return n}function pM(e,...n){let r=rl(...n);r.length>0&&e.classList.add(...r)}function hM(e,...n){let r=rl(...n);r.length>0&&e.classList.remove(...r)}function Lg(...e){return()=>{for(let n=e.length-1;n>=0;n--)e[n]();e.length=0}}function mM(e,n,r){return Lg(...Object.entries(n).map(([s,i])=>ng(e,s,i,r)))}var R=Fg,{$addUpdateTag:sl,$applyNodeReplacement:cn,$assumeActiveEditor:Oy,$caretFromPoint:dn,$caretRangeFromSelection:cr,$cloneWithProperties:Gc,$cloneWithPropertiesEphemeral:Ay,$comparePointCaretNext:Br,$copyNode:jt,$create:jc,$createChildrenArray:V1,$createLineBreakNode:fn,$createNodeSelection:Yc,$createParagraphNode:Se,$createPoint:qn,$createRangeSelection:Kr,$createRangeSelectionFromDom:Ry,$createTabNode:gn,$createTextNode:yt,$extendCaretToRange:bs,$findMatchingParent:he,$formatText:My,$fullReconcile:xi,$generateNodesFromRawText:il,$getAdjacentChildCaret:al,$getAdjacentNode:X1,$getAdjacentSiblingOrParentSiblingCaret:vs,$getCaretInDirection:Dy,$getCaretRange:Jn,$getCaretRangeInDirection:dr,$getCharacterOffsets:$y,$getChildCaret:bt,$getChildCaretAtIndex:Pg,$getChildCaretOrSelf:Bg,$getCollapsedCaretRange:Os,$getCommonAncestor:q1,$getCommonAncestorResultBranchOrder:J1,$getDOMSlot:wy,$getDOMTextNode:ky,$getDocument:Xe,$getEditor:We,$getEditorDOMRenderConfig:Kg,$getNearestNodeFromDOMNode:vt,$getNearestRootOrShadowRoot:Z1,$getNodeByKey:Mt,$getNodeByKeyOrThrow:Iy,$getNodeFromDOMNode:Ly,$getPreviousSelection:En,$getRoot:Je,$getSelection:X,$getSiblingCaret:it,$getSlot:Ci,$getSlotFrame:Zn,$getSlotHost:Vc,$getSlotNameWithinHost:Q1,$getSlotNames:As,$getState:Bo,$getStateChange:eL,$getTextContent:tL,$getTextNodeOffset:nL,$getTextPointCaret:Xc,$getTextPointCaretSlice:oL,$getWritableNodeState:rL,$hasAncestor:ll,$hasUpdateTag:sL,$insertNodeToNearestRootAtCaret:zr,$insertNodes:qc,$isBlockElementNode:Ur,$isChildCaret:Ko,$isDecoratorNode:kt,$isEditorState:Fy,$isElementDOMSlot:iL,$isElementNode:Q,$isExtendableTextPointCaret:cl,$isInlineElementOrDecoratorNode:zg,$isInlineFormattable:aL,$isLeafNode:ul,$isLexicalNode:Ug,$isLineBreakNode:Ue,$isNodeCaret:lL,$isNodeSelection:Ze,$isParagraphNode:$n,$isRangeSelection:j,$isRootNode:yo,$isRootOrShadowRoot:Dt,$isSelectionCapturedInDecoratorInput:Py,$isShadowRootNode:Jc,$isSiblingCaret:So,$isSlotChild:cL,$isSlotHost:dl,$isTabNode:Yt,$isTextNode:re,$isTextPointCaret:Hr,$isTextPointCaretSlice:uL,$isTokenOrSegmented:Hg,$isTokenOrTab:dL,$markSlotEditable:fL,$needsBlockCursorBeside:By,$nodesOfType:gL,$normalizeCaret:It,$normalizeSelection__EXPERIMENTAL:zo,$onUpdate:Ky,$parseSerializedNode:zy,$removeFromParent:pL,$removeSlot:hL,$removeTextFromCaretRange:Uy,$rewindSiblingCaret:Uo,$selectAll:Wr,$setCompositionKey:mL,$setDirectionFromDOM:Tn,$setFormatFromDOM:Qn,$setPointFromCaret:Ho,$setSelection:mt,$setSelectionFromCaretRange:wn,$setSlot:_L,$setState:eo,$setTextFormat:Hy,$splitAtPointCaretNext:Zc,$splitNode:Wy,$updateDOMSelection:Gy,$updateRangeSelectionFromCaretRange:xL,ArtificialNode__DO_NOT_USE:fl,BEFORE_INPUT_COMMAND:CL,BLUR_COMMAND:yL,CAN_REDO_COMMAND:Rs,CAN_UNDO_COMMAND:Ms,CAN_USE_BEFORE_INPUT:gl,CAN_USE_DOM:pn,CLEAR_EDITOR_COMMAND:Qc,CLEAR_HISTORY_COMMAND:jy,CLICK_COMMAND:yi,COLLABORATION_TAG:Yy,COMMAND_PRIORITY_BEFORE_CRITICAL:Vy,COMMAND_PRIORITY_BEFORE_EDITOR:eu,COMMAND_PRIORITY_BEFORE_HIGH:SL,COMMAND_PRIORITY_BEFORE_LOW:NL,COMMAND_PRIORITY_BEFORE_NORMAL:EL,COMMAND_PRIORITY_CRITICAL:Si,COMMAND_PRIORITY_EDITOR:Te,COMMAND_PRIORITY_HIGH:kn,COMMAND_PRIORITY_LOW:Fe,COMMAND_PRIORITY_NORMAL:TL,COMPOSITION_END_COMMAND:bL,COMPOSITION_END_TAG:tu,COMPOSITION_START_COMMAND:Xy,COMPOSITION_START_TAG:nu,CONTROLLED_TEXT_INSERTION_COMMAND:ou,COPY_COMMAND:Ni,CUT_COMMAND:ru,CUT_TAG:su,DEFAULT_EDITOR_DOM_CONFIG:Wg,DELETE_CHARACTER_COMMAND:Ei,DELETE_LINE_COMMAND:iu,DELETE_WORD_COMMAND:au,DRAGEND_COMMAND:vL,DRAGOVER_COMMAND:qy,DRAGSTART_COMMAND:Jy,DROP_COMMAND:Zy,DecoratorNode:lu,ElementNode:ct,FOCUS_COMMAND:Qy,FORMAT_ELEMENT_COMMAND:cu,FORMAT_TEXT_COMMAND:Wo,HISTORIC_TAG:bi,HISTORY_MERGE_TAG:Gr,HISTORY_PUSH_TAG:uu,INDENT_CONTENT_COMMAND:to,INPUT_COMMAND:OL,INSERT_LINE_BREAK_COMMAND:Gg,INSERT_PARAGRAPH_COMMAND:jr,INSERT_TAB_COMMAND:Ds,INTERNAL_$isBlock:pl,IS_ALL_FORMATTING:AL,IS_ANDROID:eS,IS_ANDROID_CHROME:tS,IS_APPLE:hl,IS_APPLE_WEBKIT:du,IS_BOLD:ml,IS_CHROME:nS,IS_CODE:oS,IS_FIREFOX:$s,IS_HIGHLIGHT:rS,IS_IOS:_l,IS_ITALIC:xl,IS_SAFARI:fu,IS_STRIKETHROUGH:Cl,IS_SUBSCRIPT:gu,IS_SUPERSCRIPT:pu,IS_UNDERLINE:yl,KEY_ARROW_DOWN_COMMAND:Go,KEY_ARROW_LEFT_COMMAND:Yr,KEY_ARROW_RIGHT_COMMAND:vi,KEY_ARROW_UP_COMMAND:no,KEY_BACKSPACE_COMMAND:Oi,KEY_DELETE_COMMAND:hu,KEY_DOWN_COMMAND:RL,KEY_ENTER_COMMAND:Ai,KEY_ESCAPE_COMMAND:Ri,KEY_MODIFIER_COMMAND:ML,KEY_SPACE_COMMAND:mu,KEY_TAB_COMMAND:Vr,LineBreakNode:sS,MOVE_TO_END:Sl,MOVE_TO_START:Mi,NODE_STATE_DIRECT:DL,NODE_STATE_KEY:$L,NODE_STATE_LATEST:wL,OUTDENT_CONTENT_COMMAND:jo,PASTE_COMMAND:Di,PASTE_TAG:_u,ParagraphNode:iS,REDO_COMMAND:xu,REMOVE_TEXT_COMMAND:aS,RootNode:Cu,SELECTION_CHANGE_COMMAND:oo,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:yu,SELECT_ALL_COMMAND:$i,SET_TEXT_FORMAT_COMMAND:lS,SKIP_COLLAB_TAG:kL,SKIP_DOM_SELECTION_TAG:cS,SKIP_SCROLL_INTO_VIEW_TAG:uS,SKIP_SELECTION_FOCUS_TAG:Su,TEXT_TYPE_TO_FORMAT:wi,TabNode:Nu,TextNode:In,UNDO_COMMAND:Eu,addClassNamesToElement:et,buildImportMap:jg,configExtension:nn,createCommand:bn,createEditor:Tu,createRefCountedRegistry:IL,createSharedNodeState:LL,createState:Yo,declarePeerDependency:dS,defineExtension:_e,findAllLexicalElementsDeep:fS,flipDirection:gS,getActiveElement:No,getActiveElementDeep:pS,getComposedEventTarget:Nl,getComposedStaticRange:FL,getDOMOwnerDocument:PL,getDOMSelection:Ln,getDOMSelectionFromTarget:BL,getDOMSelectionPoints:ws,getDOMSelectionRange:hS,getDOMSelectionRangeAndPoints:KL,getDOMShadowRoots:mS,getDOMTextNode:_S,getDeclaredSlots:zL,getEditorPropertyFromDOMNode:bu,getNearestEditorFromDOMNode:vu,getParentElement:El,getRegisteredNode:UL,getRegisteredNodeOrThrow:HL,getRegisteredSubtypeMap:Ou,getRootOwnerDocument:ks,getStaticNodeConfig:xS,getStyleObjectFromCSS:Xr,getTextDirection:CS,getTransformSetFromKlass:WL,isBlockDomNode:Is,isCurrentlyReadOnlyMode:yS,isDOMCapturingSelection:GL,isDOMDocumentNode:qr,isDOMNode:ro,isDOMShadowRoot:Au,isDOMTextNode:Fs,isDOMUnmanaged:jL,isDocumentFragment:Yg,isExactShortcutMatch:SS,isHTMLAnchorElement:ki,isHTMLElement:ye,isHTMLTableCellElement:YL,isHTMLTableRowElement:NS,isInlineDomNode:Ii,isLastChildInBlockNode:ES,isLexicalEditor:Ru,isModifierMatch:VL,isOnlyChildInBlockNode:TS,isSelectionCapturedInDecoratorInput:XL,isSelectionWithinEditor:bS,iterStaticNodeConfigChain:vS,makeStepwiseIterator:Vg,mergeRegister:Ae,mountSlotContainer:qL,normalizeClassNames:Li,registerEventListener:so,registerEventListeners:Jr,removeClassNamesFromElement:sn,removeFromParent:JL,resetRandomKey:ZL,safeCast:He,setDOMStyleFromCSS:fr,setDOMStyleObject:QL,setDOMUnmanaged:Mu,setNodeIndentFromDOM:Zr,shallowMergeConfig:zt,stopLexicalPropagation:Xg,toggleTextFormatType:qg,tokenizeRawText:Fi,unmountSlotContainer:eF}=R;var Jg={};je(Jg,{LexicalComposer:()=>xM});S();var _M=pn?$e:m,Du={tag:Gr};function xM({initialConfig:e,children:n}){let r=D(()=>{let{theme:s,namespace:i,nodes:a,onError:l,onWarn:c,editorState:d,html:f}=e,g=Zm(null,s),p=Tu({editable:e.editable,html:f,namespace:i,nodes:a,onError:(h)=>l(h,p),...c?{onWarn:(h)=>c(h,p)}:{},theme:s});return function(h,x){if(x===null)return;if(x===void 0)h.update(()=>{let y=Je();if(y.isEmpty()){let N=Se();y.append(N);let E=h.getRootElement(),T=pn&&E!==null?No(E):null;(X()!==null||T!==null&&T===E)&&N.select()}},Du);else if(x!==null)switch(typeof x){case"string":{let y=h.parseEditorState(x);h.setEditorState(y,Du);break}case"object":h.setEditorState(x,Du);break;case"function":h.update(()=>{Je().isEmpty()&&x(h)},Du)}}(p,d),[p,g]},[]);return _M(()=>{let s=e.editable,[i]=r;i.setEditable(s===void 0||s)},[]),t(Jm.Provider,{value:r,children:n})}var CM=Jg,OS=CM.LexicalComposer;var Zg={};je(Zg,{useLexicalEditable:()=>NM});S();var yM=pn?$e:m;function SM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(n)=>e.registerEditableListener(n)}}function NM(){return function(e){let[n]=st(),r=D(()=>e(n),[n,e]),[s,i]=u(()=>r.initialValueFn()),a=_(s);return yM(()=>{let{initialValueFn:l,subscribe:c}=r,d=l();return a.current!==d&&(a.current=d,i(d)),c((f)=>{a.current=f,i(f)})},[r,e]),s}(SM)}var EM=Zg,AS=EM.useLexicalEditable;var rp={};je(rp,{$addNodeStyle:()=>RM,$cloneWithProperties:()=>Gc,$copyBlockFormatIndent:()=>LS,$ensureForwardRangeSelection:()=>IS,$forEachSelectedTextNode:()=>kS,$getComputedStyleForElement:()=>tp,$getComputedStyleForParent:()=>np,$getSelectionStyleValueForProperty:()=>FM,$isAtEdgeOfElement:()=>FS,$isAtNodeEnd:()=>AM,$isParentElementRTL:()=>op,$isParentRTL:()=>vM,$moveCaretSelection:()=>KS,$moveCharacter:()=>IM,$patchStyleText:()=>MM,$selectAll:()=>Wr,$setBlocksType:()=>DM,$shouldOverrideDefaultCharacterSelection:()=>kM,$sliceSelectedTextNodeContent:()=>OM,$trimTextContentFromAnchor:()=>wS,$wrapNodes:()=>wM,createDOMRange:()=>TM,createRectsFromDOMRange:()=>bM,getCSSFromStyleObject:()=>$S,getStyleObjectFromCSS:()=>PM,trimTextContentFromAnchor:()=>BM});function ep(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function RS(e){let n=e;for(;n!=null;){if(n.nodeType===Node.TEXT_NODE)return n;n=n.firstChild}return null}function MS(e){let n=e.parentNode;if(n==null)throw Error("Should never happen");return[n,Array.from(n.childNodes).indexOf(e)]}function TM(e,n,r,s,i){let a=n.getKey(),l=s.getKey(),c=ks(e.getRootElement()).createRange(),d=e.getElementByKey(a),f=e.getElementByKey(l),g=r,p=i;if(re(n)&&(d=RS(d)),re(s)&&(f=RS(f)),n===void 0||s===void 0||d===null||f===null)return null;d.nodeName==="BR"&&([d,g]=MS(d)),f.nodeName==="BR"&&([f,p]=MS(f));let h=d.firstChild;d===f&&h!=null&&h.nodeName==="BR"&&g===0&&p===0&&(p=1);try{c.setStart(d,g),c.setEnd(f,p)}catch(x){return null}return!c.collapsed||g===p&&a===l||(c.setStart(f,p),c.setEnd(d,g)),c}function bM(e,n){let r=e.getRootElement();if(r===null)return[];let s=r.getBoundingClientRect(),i=getComputedStyle(r),a=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),l=Array.from(n.getClientRects()),c,d=l.length;l.sort((f,g)=>{let p=f.top-g.top;return Math.abs(p)<=3?f.left-g.left:p});for(let f=0;f<d;f++){let g=l[f],p=c&&c.top<=g.top&&c.top+c.height>g.top&&c.left+c.width>g.left,h=g.width+a===s.width;p||h?(l.splice(f--,1),d--):c=g}return l}function $S(e){let n="";for(let r in e)r&&(n+=`${r}: ${e[r]};`);return n}function tp(e){let n=We().getElementByKey(e.getKey());if(n===null)return null;let r=n.ownerDocument.defaultView;return r===null?null:r.getComputedStyle(n)}function np(e){return tp(yo(e)?e:e.getParentOrThrow())}function vM(e){let n=np(e);return n!==null&&n.direction==="rtl"}function OM(e,n,r="self"){let s=e.getStartEndPoints();if(n.isSelected(e)&&!Hg(n)&&s!==null){let[i,a]=s,l=e.isBackward(),c=i.getNode(),d=a.getNode(),f=n.is(c),g=n.is(d);if(f||g){let[p,h]=$y(e),x=c.is(d),y=n.is(l?d:c),N=n.is(l?c:d),E,T=0;if(x)T=p>h?h:p,E=p>h?p:h;else if(y)T=l?h:p,E=void 0;else if(N)T=0,E=l?p:h;let b=n.__text.slice(T,E);b!==n.__text&&(r==="clone"&&(n=Ay(n)),n.__text=b)}}return n}function AM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let n=e.getNode();return Q(n)||ep(177),e.offset===n.getChildrenSize()}function wS(e,n,r){let s=n.getNode(),i=r;if(Q(s)){let a=s.getDescendantByIndex(n.offset);a!==null&&(s=a)}for(;i>0&&s!==null;){if(Q(s)){let f=s.getLastDescendant();f!==null&&(s=f)}let a=s.getPreviousSibling(),l=0;if(a===null){let f=s.getParentOrThrow(),g=f.getPreviousSibling();for(;g===null;){if(f=f.getParent(),f===null){a=null;break}g=f.getPreviousSibling()}f!==null&&(l=f.isInline()?0:2,a=g)}let c=s.getTextContent();c===""&&Q(s)&&!s.isInline()&&(c=`
|
|
13
13
|
|
|
14
|
-
`);let d=c.length;if(!re(s)||i>=d){let f=s.getParent();s.remove(),f==null||f.getChildrenSize()!==0||yo(f)||f.remove(),i-=d+l,s=a}else{let f=s.getKey(),g=e.read("latest",()=>{let x=Mt(f);return re(x)&&x.isSimpleText()?x.getTextContent():null}),p=d-i,h=c.slice(0,p);if(g!==null&&g!==c){let x=En(),C=s;if(s.isSimpleText())s.setTextContent(g);else{let y=yt(g);s.replace(y),C=y}if(G(x)&&x.isCollapsed()){let y=x.anchor.offset;C.select(y,y)}}else if(s.isSimpleText()){let x=n.key===f,C=n.offset;C<i&&(C=d);let y=x?C-i:0,N=x?C:p;if(x&&y===0){let[T]=s.splitText(y,N);T.remove()}else{let[,T]=s.splitText(y,N);T.remove()}}else{let x=yt(h);s.replace(x)}i=0}}}var RM=()=>{};function $u(e,n){(G(e)?e.isCollapsed():re(e)||Q(e))||tp(280);let r=Xr(G(e)?e.style:re(e)?e.getStyle():e.getTextStyle()),s=wS(Object.entries(n).reduce((i,[a,l])=>(typeof l=="function"?i[a]=l(r[a],e):l===null?delete i[a]:i[a]=l,i),{...r}));G(e)||re(e)?e.setStyle(s):e.setTextStyle(s)}function MM(e,n){if(G(e)&&e.isCollapsed()){$u(e,n);let s=e.anchor.getNode();Q(s)&&s.isEmpty()&&$u(s,n)}IS((s)=>{$u(s,n)});let r=e.getNodes();if(r.length>0){let s=new Set;for(let i of r){if(!Q(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let a=i.getKey();s.has(a)||(s.add(a),$u(i,n))}}}function IS(e){let n=X();if(!n)return;let r=new Map,s=(a)=>r.get(a.getKey())||[0,a.getTextContentSize()];if(G(n))for(let a of cr(n).getTextSlices())a&&r.set(a.caret.origin.getKey(),a.getSliceIndices());let i=n.getNodes();for(let a of i){if(!re(a)||!a.canHaveFormat())continue;let[l,c]=s(a);if(c!==l)if(Hg(a)||l===0&&c===a.getTextContentSize())e(a);else e(a.splitText(l,c)[l===0?0:1])}G(n)&&n.anchor.type==="text"&&n.focus.type==="text"&&n.anchor.key===n.focus.key&&LS(n)}function LS(e){if(e.isBackward()){let{anchor:n,focus:r}=e,{key:s,offset:i,type:a}=n;n.set(r.key,r.offset,r.type),r.set(s,i,a)}}function FS(e,n){let r=e.getFormatType(),s=e.getIndent();r!==n.getFormatType()&&n.setFormat(r),s!==n.getIndent()&&n.setIndent(s)}function PS(e,n,r){let s=dn(e,r);if(cl(s))return!1;for(;s;s=s.getParentCaret()){let i=s.getParentAtCaret();if(!i||s.getNodeAtCaret())return!1;if(n.is(i))return!0}return!1}function DM(e,n,r=FS){if(!e)return;let s=e.getStartEndPoints(),i=!1,a=null,l=new Map;if(s){let[c,d]=s,f=he(c.getNode(),pl);a=he(d.getNode(),pl);let g=e.isBackward()?"previous":"next";i=Q(a)&&!a.is(f)&&function(p,h,x){let C=p.getNode();return(!Q(C)||!C.isEmpty())&&PS(p,h,x)}(d,a,pS(g)),Q(f)&&l.set(f.getKey(),f),Q(a)&&!i&&l.set(a.getKey(),a)}for(let c of e.getNodes())if(Q(c)&&pl(c)){if(i&&c.is(a))continue;l.set(c.getKey(),c)}else if(!s){let d=he(c,pl);Q(d)&&l.set(d.getKey(),d)}for(let c of l.values()){let d=n();r(c,d),c.replace(d,!0)}}function $S(e){return e.getNode().isAttached()}function $M(e){let n=e;for(;n!==null&&!Dt(n);){let r=n.getLatest(),s=n.getParent();r.getChildrenSize()===0&&n.remove(!0),n=s}}function wM(e,n,r=null){let s=e.getStartEndPoints(),i=s?s[0]:null,a=e.getNodes(),l=a.length;if(i!==null&&(l===0||l===1&&i.type==="element"&&i.getNode().getChildrenSize()===0)){let f=i.type==="text"?i.getNode().getParentOrThrow():i.getNode(),g=f.getChildren(),p=n();return p.setFormat(f.getFormatType()),p.setIndent(f.getIndent()),g.forEach((h)=>p.append(h)),r&&(p=r.append(p)),void f.replace(p)}let c=null,d=[];for(let f=0;f<l;f++){let g=a[f];Dt(g)?(ep(e,d,d.length,n,r),d=[],c=g):c===null||c!==null&&ll(g,c)?d.push(g):(ep(e,d,d.length,n,r),d=[g])}ep(e,d,d.length,n,r)}function ep(e,n,r,s,i=null){if(n.length===0)return;let a=n[0],l=new Map,c=[],d=Q(a)?a:a.getParentOrThrow(),f=d.isInline()?d.getParentOrThrow():d,g=!1;for(;f!==null;){let y=f.getPreviousSibling();if(y!==null){f=y,g=!0;break}if(f=f.getParentOrThrow(),Dt(f))break}let p=new Set;for(let y=0;y<r;y++){let N=n[y];Q(N)&&N.getChildrenSize()===0&&p.add(N.getKey())}let h=new Set;for(let y=0;y<r;y++){let N=n[y],T=N.getParent();if(T!==null&&T.isInline()&&(T=T.getParent()),T!==null&&ul(N)&&!h.has(N.getKey())){let b=T.getKey();if(l.get(b)===void 0){let v=s();v.setFormat(T.getFormatType()),v.setIndent(T.getIndent()),c.push(v),l.set(b,v);let O=T.getChildren();v.splice(v.getChildrenSize(),0,O);for(let k of O)if(h.add(k.getKey()),Q(k))for(let M of k.getChildrenKeys())h.add(M);$M(T)}}else if(p.has(N.getKey())){Q(N)||tp(179);let b=s();b.setFormat(N.getFormatType()),b.setIndent(N.getIndent()),c.push(b),N.remove(!0)}}if(i!==null)for(let y=0;y<c.length;y++){let N=c[y];i.append(N)}let x=null;if(Dt(f))if(g)if(i!==null)f.insertAfter(i);else for(let y=c.length-1;y>=0;y--){let N=c[y];f.insertAfter(N)}else{let y=f,N=y.getFirstChild();if(Q(N)&&(f=N),N===null)if(i)y.append(i);else for(let T=0;T<c.length;T++){let b=c[T];y.append(b),x=b}else if(i!==null)N.insertBefore(i);else for(let T=0;T<c.length;T++){let b=c[T];N.insertBefore(b),x=b}}else if(i)f.insertAfter(i);else for(let y=c.length-1;y>=0;y--){let N=c[y];f.insertAfter(N),x=N}let C=En();G(C)&&$S(C.anchor)&&$S(C.focus)?mt(C.clone()):x!==null?x.selectEnd():e.dirty=!0}function BS(e){let n=KS(e);return n!==null&&n.writingMode==="vertical-rl"}function KS(e){let n=e.anchor.getNode();return Q(n)?np(n):op(n)}function kM(e,n){let r=BS(e)?!n:n;rp(e)&&(r=!r);let s=dn(e.focus,r?"previous":"next");if(cl(s))return!1;if(Hr(s)&&!Yt(s.origin)&&s.origin.isUnmergeable()){let i=s.getNodeAtCaret();if(re(i)&&!Yt(i))return!0}for(let i of bs(s)){if(Ko(i))return!i.origin.isInline();if(!Q(i.origin)){if(kt(i.origin))return!0;break}}return!1}function zS(e,n,r,s){e.modify(n?"extend":"move",r,s)}function rp(e){let n=KS(e);return n!==null&&n.direction==="rtl"}function IM(e,n,r){let s=rp(e),i;i=BS(e)||s?!r:r,zS(e,n,i,"character")}function LM(e,n,r){let s=e.getStyle(),i=Xr(s);return i!==null&&i[n]||r}function FM(e,n,r=""){let s=null,i=e.getNodes(),a,l;if(G(e)){if(e.isCollapsed()&&e.style!==""){let C=Xr(e.style);if(C!==null&&n in C)return C[n]}let{anchor:c,focus:d}=e,f=e.isBackward(),g=f?d.getNode():c.getNode(),p=f?c.getNode():d.getNode(),h=f?d.offset:c.offset,x=f?c.offset:d.offset;re(g)&&h===g.getTextContentSize()&&(a=g),x===0&&(l=p)}for(let c=0;c<i.length;c++){let d=i[c];if(re(d)&&!d.is(c===0?a:l)){let f=LM(d,n,r);if(s===null)s=f;else if(s!==f){s="";break}}}return s===null?r:s}var PM=Xr,BM=kS;var ut=sp,{$addNodeStyle:gF,$cloneWithProperties:pF,$copyBlockFormatIndent:hF,$ensureForwardRangeSelection:mF,$forEachSelectedTextNode:_F,$getComputedStyleForElement:xF,$getComputedStyleForParent:CF,$getSelectionStyleValueForProperty:yF,$isAtEdgeOfElement:ip,$isAtNodeEnd:ap,$isParentElementRTL:SF,$isParentRTL:Tl,$moveCaretSelection:NF,$moveCharacter:lp,$patchStyleText:EF,$selectAll:TF,$setBlocksType:Pi,$shouldOverrideDefaultCharacterSelection:cp,$sliceSelectedTextNodeContent:Ps,$trimTextContentFromAnchor:bF,$wrapNodes:vF,createDOMRange:OF,createRectsFromDOMRange:US,getCSSFromStyleObject:AF,getStyleObjectFromCSS:RF,trimTextContentFromAnchor:MF}=ut;var mp={};ke(mp,{$descendantsMatching:()=>gD,$dfs:()=>GM,$dfsIterator:()=>XS,$dfsWithSlots:()=>VM,$dfsWithSlotsIterator:()=>qS,$filter:()=>aD,$findMatchingParent:()=>he,$firstToLastIterator:()=>pD,$getAdjacentCaret:()=>jM,$getAdjacentSiblingOrParentSiblingCaret:()=>vs,$getDepth:()=>JS,$getNearestBlockElementAncestorOrThrow:()=>QM,$getNearestNodeOfType:()=>ZM,$getNextRightPreorderNode:()=>qM,$getNextSiblingOrParentSibling:()=>XM,$handleIndentAndOutdent:()=>lD,$insertFirst:()=>cD,$insertNodeIntoLeaf:()=>rD,$insertNodeToNearestRoot:()=>oD,$insertNodeToNearestRootAtCaret:()=>zr,$isAtEndOfNode:()=>rN,$isAtStartOfNode:()=>oN,$isBlockFullySelected:()=>eD,$isEditorIsNestedEditor:()=>dD,$lastToFirstIterator:()=>hp,$onEscapeDown:()=>xD,$onEscapeUp:()=>_D,$restoreEditorState:()=>nD,$reverseDfs:()=>YM,$reverseDfsIterator:()=>ZS,$reverseDfsWithSlots:()=>JM,$reverseDfsWithSlotsIterator:()=>QS,$splitNode:()=>Gy,$unwrapAndFilterDescendants:()=>fD,$unwrapNode:()=>hD,$wrapNodeInElement:()=>sD,CAN_USE_BEFORE_INPUT:()=>gl,CAN_USE_DOM:()=>pn,IS_ANDROID:()=>tS,IS_ANDROID_CHROME:()=>nS,IS_APPLE:()=>hl,IS_APPLE_WEBKIT:()=>du,IS_CHROME:()=>oS,IS_FIREFOX:()=>$s,IS_IOS:()=>_l,IS_SAFARI:()=>fu,addClassNamesToElement:()=>et,calculateZoomLevel:()=>uD,dedupeSelectionRects:()=>GS,eventFiles:()=>iD,getScrollParent:()=>HM,isBlockDomNode:()=>Is,isHTMLAnchorElement:()=>ki,isHTMLElement:()=>ye,isInlineDomNode:()=>Ii,isMimeType:()=>VS,makeStateWrapper:()=>mD,markSelection:()=>YS,mediaFileReader:()=>WM,mergeRegister:()=>Me,objectKlassEquals:()=>pp,positionNodeOnRange:()=>jS,registerNestedElementResolver:()=>tD,removeClassNamesFromElement:()=>sn,selectionAlwaysOnDisplay:()=>UM});function dp(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function GS(e){let n=(s,i)=>i.left>=s.left-1&&i.top>=s.top-1&&i.right<=s.right+1&&i.bottom<=s.bottom+1,r=[];for(let s of Array.from(e))if(!(s.width<0.5||s.height<0.5||r.some((i)=>n(s,i)))){for(let i=r.length-1;i>=0;i--)n(r[i],s)&&r.splice(i,1);r.push(s)}return r}function Vo(e){return`${e}px`}var KM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function jS(e,n,r){let s=null,i=null,a=null,l=[],c=ks(e.getRootElement()).createElement("div");function d(){s===null&&dp(182),i===null&&dp(183);let{left:p,top:h}=i.getBoundingClientRect(),x=GS(US(e,n));var C,y;c.isConnected||(y=c,(C=i).insertBefore(y,C.firstChild));let N=!1;for(let T=0;T<x.length;T++){let b=x[T],v=l[T]||ks(s).createElement("div"),O=v.style;O.position!=="absolute"&&(O.position="absolute",N=!0);let k=Vo(b.left-p);O.left!==k&&(O.left=k,N=!0);let M=Vo(b.top-h);O.top!==M&&(v.style.top=M,N=!0);let z=Vo(b.width);O.width!==z&&(v.style.width=z,N=!0);let K=Vo(b.height);O.height!==K&&(v.style.height=K,N=!0),v.parentNode!==c&&(c.append(v),N=!0),l[T]=v}for(;l.length>x.length;){let T=l.pop();T!=null&&T.remove()}N&&r(l)}function f(){i=null,s=null,a!==null&&a.disconnect(),a=null,c.remove();for(let p of l)p.remove();l=[]}c.style.position="relative";let g=e.registerRootListener(function p(){let h=e.getRootElement();if(h===null)return f();let x=h.parentElement;if(!ye(x))return f();f(),s=h,i=x,a=new MutationObserver((C)=>{let y=e.getRootElement(),N=y&&y.parentElement;if(y!==s||N!==i)return p();for(let T of C)if(!c.contains(T.target))return d()}),a.observe(x,KM),d()});return()=>{g(),f()}}function HS(e,n,r,s){if(n.type!=="text"&&Q(r)){let i=ky(r,s,e);return[i.element,i.getFirstChildOffset()+n.offset]}return[(re(r)?Iy(r,s,e):xS(s))||s,n.offset]}function zM(e){for(let n of e){let r=n.style;r.background!=="Highlight"&&(r.background="Highlight"),r.color!=="HighlightText"&&(r.color="HighlightText"),r.marginTop!==Vo(-1.5)&&(r.marginTop=Vo(-1.5)),r.paddingTop!==Vo(4)&&(r.paddingTop=Vo(4)),r.paddingBottom!==Vo(0)&&(r.paddingBottom=Vo(0))}}function YS(e,n=zM){let r=null,s=null,i=null,a=null,l=null,c=null,d=()=>{};function f(g){g.read(()=>{let p=X();if(!G(p))return r=null,i=null,a=null,c=null,d(),void(d=()=>{});let[h,x]=function(K){let U=K.getStartEndPoints();return K.isBackward()?[U[1],U[0]]:U}(p),C=h.getNode(),y=C.getKey(),N=h.offset,T=x.getNode(),b=T.getKey(),v=x.offset,O=e.getElementByKey(y),k=e.getElementByKey(b),M=r===null||O!==s||N!==i||y!==r.getKey(),z=a===null||k!==l||v!==c||b!==a.getKey();if((M||z)&&O!==null&&k!==null){let K=function(U,J,W,ne,ee,se,Y){let fe=(U._window?U._window.document:document).createRange();return fe.setStart(...HS(U,J,W,ne)),fe.setEnd(...HS(U,ee,se,Y)),fe}(e,h,C,O,x,T,k);d(),d=jS(e,K,n)}r=C,s=O,i=N,a=T,l=k,c=v},{editor:e})}return f(e.getEditorState()),Me(e.registerUpdateListener(({editorState:g})=>f(g)),()=>{d()})}function UM(e,n){let r=null,s=()=>{let i=e.getRootElement(),a=i!==null?i.ownerDocument.defaultView:null,l=a!==null?a.getSelection():null,c=l!==null?ws(l,i).anchorNode:null;c!==null&&i!==null&&i.contains(c)?r!==null&&(r(),r=null):r===null&&(r=YS(e,n))};return e.registerRootListener((i)=>{if(i){let a=i.ownerDocument,l=Me(so(a,"selectionchange",s),()=>{r!==null&&r()});return s(),l}})}function HM(e,n){let r=e.ownerDocument,s=r.defaultView||window,i=s.getComputedStyle(e),a=i.position==="absolute",l=n?/(auto|scroll|hidden)/:/(auto|scroll)/;if(i.position==="fixed")return r.body;for(let c=e;c=El(c);)if(i=s.getComputedStyle(c),(!a||i.position!=="static")&&l.test(i.overflow+i.overflowY+i.overflowX))return c;return r.body}function VS(e,n){for(let r of n)if(e.type.startsWith(r))return!0;return!1}function WM(e,n){let r=e[Symbol.iterator]();return new Promise((s,i)=>{let a=[],l=()=>{let{done:c,value:d}=r.next();if(c)return s(a);let f=new FileReader;f.addEventListener("error",i),f.addEventListener("load",()=>{let g=f.result;typeof g=="string"&&a.push({file:d,result:g}),l()}),VS(d,n)?f.readAsDataURL(d):l()};l()})}function GM(e,n){return Array.from(XS(e,n))}function jM(e){return e?e.getAdjacentCaret():null}function YM(e,n){return Array.from(ZS(e,n))}function XS(e,n){return wu("next",e,n)}function VM(e,n){return Array.from(qS(e,n))}function*qS(e,n){for(let r of wu("next",e,n)){yield r;let{node:s,depth:i}=r;if(dl(s)&&!s.is(n))for(let a of As(s)){let l=Ci(s,a);l!==null&&(yield*fp(l,i+1))}}}function*fp(e,n){yield{depth:n,node:e};let r=n+1;if(dl(e))for(let s of As(e)){let i=Ci(e,s);i!==null&&(yield*fp(i,r))}if(Q(e))for(let s of e.getChildren())yield*fp(s,r)}function WS(e,n){let r=vs(it(e,n));return r&&r[0]}function wu(e,n,r){let s=Je(),i=n||s,a=Q(i)?bt(i,e):it(i,e),l=JS(i),c=r?al(Bg(it(r,e)))||WS(r,e):WS(i,e),d=l;return Vg({hasNext:(f)=>f!==null,initial:a,map:(f)=>({depth:d,node:f.origin}),step:(f)=>{if(f.isSameNodeCaret(c))return null;Ko(f)&&d++;let g=vs(f);return!g||g[0].isSameNodeCaret(c)?null:(d+=g[1],g[0])}})}function XM(e){let n=vs(it(e,"next"));return n&&[n[0].origin,n[1]]}function JS(e){let n=-1;for(let r=e;r!==null;r=r.getParent()??Vc(r))n++;return n}function qM(e){let n=Bg(it(e,"previous")),r=vs(n,"root");return r&&r[0].origin}function ZS(e,n){return wu("previous",e,n)}function JM(e,n){return Array.from(QS(e,n))}function*QS(e,n){let r=[];for(let s of wu("previous",e,n)){for(;r.length>0&&s.depth<=r[r.length-1].depth;){let l=r.pop();yield*gp(l.node,l.depth+1)}yield s;let{node:i,depth:a}=s;dl(i)&&As(i).length>0&&!i.is(n)&&r.push({depth:a,node:i})}for(;r.length>0;){let s=r.pop();yield*gp(s.node,s.depth+1)}}function*gp(e,n){let r=As(e);for(let s=r.length-1;s>=0;s--){let i=Ci(e,r[s]);i!==null&&(yield*eN(i,n))}}function*eN(e,n){yield{depth:n,node:e};let r=n+1;if(Q(e)){let s=e.getChildren();for(let i=s.length-1;i>=0;i--)yield*eN(s[i],r)}dl(e)&&(yield*gp(e,r))}function ZM(e,n){let r=e;for(;r!=null;){if(r instanceof n)return r;r=r.getParent()}return null}function QM(e){let n=he(e,(r)=>Q(r)&&!r.isInline());return Q(n)||dp(4,e.__key),n}function eD(e,n){let r=dr(G(n)?cr(n):n,"next"),s=Zn(r.anchor.origin),i=Zn(e.getLatest());if(s===null?i!==null:!s.is(i))return!1;let a=It(bt(e,"next")),l=$y(It(bt(e,"previous")),"next");return Br(r.anchor,a)<=0&&Br(r.focus,l)>=0}function tD(e,n,r,s){let i=(a)=>a instanceof n;return e.registerNodeTransform(n,(a)=>{let l=((c)=>{let d=c.getChildren();for(let p=0;p<d.length;p++){let h=d[p];if(i(h))return null}let f=c,g=c;for(;f!==null;)if(g=f,f=f.getParent(),i(f))return{child:g,parent:f};return null})(a);if(l!==null){let{child:c,parent:d}=l;if(c.is(a)){s(d,a);let f=c.getNextSiblings(),g=f.length;if(d.insertAfter(c),g!==0){let p=r(d);c.insertAfter(p);for(let h=0;h<g;h++)p.append(f[h])}d.canBeEmpty()||d.getChildrenSize()!==0||d.remove()}}})}function nD(e,n){let r=new Map,s=e._pendingEditorState;for(let[a,l]of n._nodeMap)r.set(a,Gc(l));s&&(s._nodeMap=r),xi();let i=n._selection;mt(i===null?null:i.clone())}function oD(e){let n=X()||En(),r;if(G(n))r=dn(n.focus,"next");else{if(n!=null){let l=n.getNodes(),c=l[l.length-1];c&&(r=it(c,"next"))}r=r||bt(Je(),"previous").getFlipped().insert(Se())}let s=zr(e,r),i=al(s),a=Ko(i)?It(i):s;return wn(Os(a)),e.getLatest()}function rD(e){let n=X();if(!G(n))return void(n&&n.insertNodes([e]));let r=cr(n),s=dr(Hy(r),"next").anchor;if(Hr(s)){let a=Zc(s);if(!a)return;s=a}let i=s.getFlipped();i.insert(e),wn(Jn(i,i))}function sD(e,n){let r=n();return e.replace(r),r.append(e),r}function pp(e,n){return e!==null&&Object.getPrototypeOf(e).constructor.name===n.name}function iD(e){let n=null;if(pp(e,DragEvent)?n=e.dataTransfer:pp(e,ClipboardEvent)&&(n=e.clipboardData),n===null)return[!1,[],!1];let r=n.types,s=r.includes("Files"),i=r.includes("text/html")||r.includes("text/plain");return[s,Array.from(n.files),i]}function aD(e,n){let r=[];for(let s=0;s<e.length;s++){let i=n(e[s]);i!==null&&r.push(i)}return r}function lD(e){let n=X();if(!G(n))return!1;let r=new Set,s=n.getNodes();for(let i=0;i<s.length;i++){let a=s[i],l=a.getKey();if(r.has(l))continue;let c=he(a,(f)=>Q(f)&&!f.isInline());if(c===null)continue;let d=c.getKey();c.canIndent()&&!r.has(d)&&(r.add(d),e(c))}return r.size>0}function cD(e,n){bt(e,"next").insert(n)}var up=!($s||!pn)&&void 0;function uD(e,n=!1){let r=1;if(function(){if(up===void 0){let s=document.createElement("div");s.style.position="absolute",s.style.opacity="0",s.style.width="100px",s.style.left="-1000px",document.body.appendChild(s);let i=s.getBoundingClientRect();s.style.setProperty("zoom","2"),up=s.getBoundingClientRect().width===i.width,document.body.removeChild(s)}return up}()||n){let s=e&&e.ownerDocument.defaultView||window;for(;e;)r*=Number(s.getComputedStyle(e).getPropertyValue("zoom")),e=El(e)}return r}function dD(e){return e._parentEditor!==null}function fD(e,n){return tN(e,n,null)}function tN(e,n,r){let s=!1;for(let i of hp(e))n(i)?r!==null&&r(i):(s=!0,Q(i)&&tN(i,n,r||((a)=>i.insertAfter(a))),i.remove());return s}function gD(e,n){let r=[],s=Array.from(e).reverse();for(let i=s.pop();i!==void 0;i=s.pop())if(n(i))r.push(i);else if(Q(i))for(let a of hp(i))s.push(a);return r}function pD(e){return nN(bt(e,"next"))}function hp(e){return nN(bt(e,"previous"))}function nN(e){return Vg({hasNext:So,initial:e.getAdjacentCaret(),map:(n)=>n.origin.getLatest(),step:(n)=>n.getAdjacentCaret()})}function hD(e){Uo(it(e,"next")).splice(1,e.getChildren())}function mD(e){let n=(s)=>Bo(s,e),r=(s,i)=>eo(s,e,i);return{$get:n,$set:r,accessors:[n,r],makeGetterMethod:()=>function(){return n(this)},makeSetterMethod:()=>function(s){return r(this,s)},stateConfig:e}}function _D(e,n){let r=X();if(G(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getFirstChild()===s&&oN(r.anchor,s))return s.insertBefore(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function xD(e,n){let r=X();if(G(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getLastChild()===s&&rN(r.anchor,s))return s.insertAfter(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function oN(e,n){return ip(e,n,"previous")}function rN(e,n){return ip(e,n,"next")}var de=mp,{$descendantsMatching:bl,$dfs:sN,$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:vl,$insertFirst:iN,$insertNodeIntoLeaf:jF,$insertNodeToNearestRoot:Lu,$insertNodeToNearestRootAtCaret:YF,$isAtEndOfNode:VF,$isAtStartOfNode:XF,$isBlockFullySelected:Ol,$isEditorIsNestedEditor:qF,$lastToFirstIterator:JF,$onEscapeDown:_p,$onEscapeUp:xp,$restoreEditorState:ZF,$reverseDfs:QF,$reverseDfsIterator:eP,$reverseDfsWithSlots:tP,$reverseDfsWithSlotsIterator:nP,$splitNode:oP,$unwrapAndFilterDescendants:Cp,$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:aN,dedupeSelectionRects:_P,eventFiles:Bs,getScrollParent:xP,isBlockDomNode:CP,isHTMLAnchorElement:yP,isHTMLElement:SP,isInlineDomNode:NP,isMimeType:EP,makeStateWrapper:TP,markSelection:bP,mediaFileReader:vP,mergeRegister:OP,objectKlassEquals:Fn,positionNodeOnRange:AP,registerNestedElementResolver:RP,removeClassNamesFromElement:MP,selectionAlwaysOnDisplay:lN}=de;var Ip={};ke(Ip,{$applyFormatToDom:()=>OD,$createHorizontalRuleNode:()=>kp,$defaultShouldInsertAfter:()=>EN,$getExtensionDependency:()=>kN,$getExtensionOutput:()=>BD,$getPeerDependency:()=>KD,$isDecoratorTextNode:()=>bD,$isHorizontalRuleNode:()=>LN,AutoFocusExtension:()=>ND,ClearEditorExtension:()=>ED,ClickAfterLastBlockExtension:()=>TD,DecoratorTextExtension:()=>MD,DecoratorTextNode:()=>Wu,EditorStateExtension:()=>Uu,HorizontalRuleExtension:()=>HD,HorizontalRuleNode:()=>zi,IMEExtension:()=>WD,INSERT_HORIZONTAL_RULE_COMMAND:()=>IN,InitialStateExtension:()=>$N,LexicalBuilder:()=>pr,NestedEditorExtension:()=>GD,NodeSelectionDataSelectedExtension:()=>jD,NodeSelectionExtension:()=>Rp,NormalizeInlineElementsExtension:()=>YD,NormalizeTripleClickSelectionExtension:()=>XD,PreventSelectAllExtension:()=>Mp,RootElementExtension:()=>JD,SelectBlockExtension:()=>ZD,SelectionAlwaysOnDisplayExtension:()=>QD,TabIndentationExtension:()=>e$,WatchEditableExtension:()=>t$,applyFormatFromStyle:()=>vD,applyFormatToDom:()=>vN,batch:()=>mN,buildEditorFromExtensions:()=>LD,computed:()=>CN,configExtension:()=>nn,declarePeerDependency:()=>fS,defineExtension:()=>_e,effect:()=>Zt,getExtensionDependencyFromEditor:()=>wN,getKnownTypesAndNodes:()=>TN,getPeerDependencyFromEditor:()=>wp,getPeerDependencyFromEditorOrThrow:()=>PD,namedSignals:()=>Eo,registerClearEditor:()=>NN,registerTabIndentation:()=>PN,safeCast:()=>We,shallowMergeConfig:()=>zt,signal:()=>Qr,untracked:()=>vp,watchedSignal:()=>Ml});var CD=Symbol.for("preact-signals");function Hu(){if(gr>1)return void gr--;let e,n=!1;for(!function(){let r=Ku;for(Ku=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o}();Rl!==void 0;){let r=Rl;for(Rl=void 0,zu++;r!==void 0;){let s=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&_N(r))try{r.c()}catch(i){n||(e=i,n=!0)}r=s}}if(zu=0,gr--,n)throw e}function mN(e){if(gr>0)return e();Op=++yD,gr++;try{return e()}finally{Hu()}}var nt,Rl;function vp(e){let n=nt;nt=void 0;try{return e()}finally{nt=n}}var Ku,gr=0,zu=0,yD=0,Op=0,Bu=0;function cN(e){if(nt===void 0)return;let n=e.n;return n===void 0||n.t!==nt?(n={i:0,S:e,p:nt.s,n:void 0,t:nt,e:void 0,x:void 0,r:n},nt.s!==void 0&&(nt.s.n=n),nt.s=n,e.n=n,32&nt.f&&e.S(n),n):n.i===-1?(n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=nt.s,n.n=void 0,nt.s.n=n,nt.s=n),n):void 0}function hn(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function Qr(e,n){return new hn(e,n)}function _N(e){for(let n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function uN(e){for(let n=e.s;n!==void 0;n=n.n){let r=n.S.n;if(r!==void 0&&(n.r=r),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function xN(e){let n,r=e.s;for(;r!==void 0;){let s=r.p;r.i===-1?(r.S.U(r),s!==void 0&&(s.n=r.n),r.n!==void 0&&(r.n.p=s)):n=r,r.S.n=r.r,r.r!==void 0&&(r.r=void 0),r=s}e.s=n}function Ks(e,n){hn.call(this,void 0),this.x=e,this.s=void 0,this.g=Bu-1,this.f=4,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function CN(e,n){return new Ks(e,n)}function yN(e){let n=e.m;if(e.m=void 0,typeof n=="function"){gr++;let r=nt;nt=void 0;try{n()}catch(s){throw e.f&=-2,e.f|=8,Dp(e),s}finally{nt=r,Hu()}}}function Dp(e){for(let n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,yN(e)}function SD(e){if(nt!==this)throw Error("Out-of-order effect");xN(this),nt=e,this.f&=-2,8&this.f&&Dp(this),Hu()}function Ki(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n==null?void 0:n.name}function Zt(e,n){let r=new Ki(e,n);try{r.c()}catch(i){throw r.d(),i}let s=r.d.bind(r);return s[Symbol.dispose]=s,s}function Eo(e,n={}){let r={};for(let s in e){let i=n[s],a=Qr(i===void 0?e[s]:i);r[s]=a}return r}hn.prototype.brand=CD,hn.prototype.h=function(){return!0},hn.prototype.S=function(e){let n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:vp(()=>{var r;(r=this.W)==null||r.call(this)}))},hn.prototype.U=function(e){if(this.t!==void 0){let{e:n,x:r}=e;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&vp(()=>{var s;(s=this.Z)==null||s.call(this)}))}},hn.prototype.subscribe=function(e){return Zt(()=>{let n=this.value,r=nt;nt=void 0;try{e(n)}finally{nt=r}},{name:"sub"})},hn.prototype.valueOf=function(){return this.value},hn.prototype.toString=function(){return this.value+""},hn.prototype.toJSON=function(){return this.value},hn.prototype.peek=function(){let e=nt;nt=void 0;try{return this.value}finally{nt=e}},Object.defineProperty(hn.prototype,"value",{get(){let e=cN(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(n){gr!==0&&zu===0&&n.l!==Op&&(n.l=Op,Ku={S:n,v:n.v,i:n.i,o:Ku})})(this),this.v=e,this.i++,Bu++,gr++;try{for(let n=this.t;n!==void 0;n=n.x)n.t.N()}finally{Hu()}}}}),Ks.prototype=new hn,Ks.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&&!_N(this))return this.f&=-2,!0;let e=nt;try{uN(this),nt=this;let n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return nt=e,xN(this),this.f&=-2,!0},Ks.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let n=this.s;n!==void 0;n=n.n)n.S.S(n)}hn.prototype.S.call(this,e)},Ks.prototype.U=function(e){if(this.t!==void 0&&(hn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let n=this.s;n!==void 0;n=n.n)n.S.U(n)}},Ks.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(Ks.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=cN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ki.prototype.c=function(){let e=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}},Ki.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,yN(this),uN(this),gr++;let e=nt;return nt=this,SD.bind(this,e)},Ki.prototype.N=function(){2&this.f||(this.f|=2,this.u=Rl,Rl=this)},Ki.prototype.d=function(){this.f|=8,1&this.f||Dp(this)},Ki.prototype.dispose=function(){this.d()};var ND=_e({build:(e,n,r)=>Eo(n),config:We({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,n,r){let s=r.getOutput();return Zt(()=>s.disabled.value?void 0:e.registerRootListener((i)=>{e.focus(()=>{let a=i!==null?No(i):null;i===null||a!==null&&i.contains(a)||i.focus({preventScroll:!0})},{defaultSelection:s.defaultSelection.peek()})}))}});function SN(){let e=Je(),n=X(),r=Se();e.clear(),e.append(r),n!==null&&r.select(),G(n)&&(n.format=0)}function NN(e,n=SN){return e.registerCommand(Qc,()=>(n(),!0),be)}var ED=_e({build:(e,n,r)=>Eo(n),config:We({$onClear:SN}),name:"@lexical/extension/ClearEditor",register(e,n,r){let{$onClear:s}=r.getOutput();return Zt(()=>NN(e,s.value))}});function EN(e){return!!kt(e)||!(!Q(e)||!e.isShadowRoot())}function dN(e,n,r,s){return!!e.isEditable()&&(r.target===n&&e.read("latest",()=>{let i=Je().getLastChild();if(i===null)return!1;let a=e.getElementByKey(i.getKey());return a!==null&&(!(r.clientY<=a.getBoundingClientRect().bottom)&&s(i))}))}var TD=_e({build:(e,n)=>Eo(n),config:We({$shouldInsertAfter:EN,disabled:!1}),name:"@lexical/ClickAfterLastBlock",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(i===null)return;return Jr(i,{click:(a)=>{dN(e,i,a,s.$shouldInsertAfter.peek())&&(a.preventDefault(),Xg(a),e.update(()=>{let l=Je().getLastChild();if(l===null)return;if(!s.$shouldInsertAfter.peek()(l))return;let c=Se();l.insertAfter(c),c.select()}))},mousedown:(a)=>{dN(e,i,a,s.$shouldInsertAfter.peek())&&a.preventDefault()}},!0)})})});function TN(e){let n=new Set,r=new Set;for(let s of bN(e)){let i=typeof s=="function"?s:s.replace;CS(i),n.add(i.getType()),r.add(i)}return{nodes:r,types:n}}function bN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var yp=Yo("format",{parse:(e)=>typeof e=="number"?e:0});class Wu extends lu{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:lu,stateConfigs:[{flat:!0,stateConfig:yp}]})}getFormat(e){return Bo(this,yp,e)}getFormatFlags(e,n){return qg(this.getFormat(),e,n)}hasFormat(e){let n=wi[e];return(this.getFormat()&n)!==0}setFormat(e){return eo(this,yp,e)}toggleFormat(e){let n=this.getFormat(),r=qg(n,e,null);return this.setFormat(r)}isInline(){return!0}createDOM(e,n){return Xe().createElement("span")}}function bD(e){return e instanceof Wu}function vD(e,n,r){let s=n.fontWeight,i=n.textDecoration.split(" "),a=s==="700"||s==="bold",l=i.includes("line-through"),c=n.fontStyle==="italic",d=i.includes("underline"),f=n.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),c&&!e.hasFormat("italic")&&e.toggleFormat("italic"),d&&!e.hasFormat("underline")&&e.toggleFormat("underline"),f!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),f!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),r&&!e.hasFormat(r)&&e.toggleFormat(r),e}function vN(e,n,r=RD){let s=n;for(let[i,a]of Object.entries(r))e.hasFormat(a)&&(s=AD(s,i));return s}var OD=vN;function AD(e,n){let r=e.ownerDocument.createElement(n);return r.appendChild(e),r}var RD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},MD=_e({name:"@lexical/extension/DecoratorText",nodes:()=>[Wu]});function Ml(e,n){let r;return Qr(e(),{unwatched(){r&&(r(),r=void 0)},watched(){this.value=e(),r=n(this)}})}var Uu=_e({build:(e)=>Ml(()=>e.getEditorState(),(n)=>e.registerUpdateListener((r)=>{n.value=r.editorState})),name:"@lexical/extension/EditorState"});function tt(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ON;try{ON="0.49.0+prod.esm"}catch(e){}var DD=ON??'"<unknown>+source"',$D=new Set(["__proto__","constructor","prototype"]);function AN(e,n){if(e&&n&&!Array.isArray(n)&&typeof e=="object"&&typeof n=="object"){let r=e,s=n;for(let i in s)!$D.has(i)&&Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=AN(r[i],s[i]));return e}return n}var $p=0,Ap=1,RN=2,Sp=3,Fu=4,Bi=5,Ep=6,Al=7;function Tp(e){return e.id===$p}function MN(e){return e.id===RN}function wD(e){return function(n){return n.id===Ap}(e)||tt(305,String(e.id),String(Ap)),Object.assign(e,{id:RN})}var kD=new Set;class DN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:$p}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):zt;for(let r of this.configs)e=n(e,r);return e}init(e){let n=this.state;MN(n)||tt(306,String(n.id));let r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},s={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(l,c,d){return Object.assign(l,{config:c,id:Sp,registerState:d})}(n,this.mergeConfigs(),r),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,r)),this.state=function(l,c,d){return Object.assign(l,{id:Fu,initResult:c,registerState:d})}(i,a,s)}build(e){let n=this.state,r;n.id!==Fu&&tt(307,String(n.id),String(Bi)),this.extension.build&&(r=this.extension.build(e,n.config,n.registerState));let s={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=function(i,a,l){return Object.assign(i,{id:Bi,output:a,registerState:l})}(n,r,s)}register(e,n){this._signal=n;let r=this.state;r.id!==Bi&&tt(308,String(r.id),String(Bi));let s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=function(i){return Object.assign(i,{id:Ep})}(r),()=>{let i=this.state;i.id!==Al&&tt(309,String(r.id),String(Al)),this.state=function(a){return Object.assign(a,{id:Bi})}(i),s&&s()}}afterRegistration(e){let n=this.state,r;return n.id!==Ep&&tt(310,String(n.id),String(Ep)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=function(s){return Object.assign(s,{id:Al})}(n),r}getSignal(){return this._signal===void 0&&tt(311),this._signal}getInitResult(){this.extension.init===void 0&&tt(312,this.extension.name);let e=this.state;return function(n){return n.id>=Fu}(e)||tt(313,String(e.id),String(Fu)),e.initResult}getInitPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(n){return n.id>=Sp}(e)||tt(314,String(e.id),String(Sp)),{config:e.config}}getPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}getInitDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionInitDependency()}getDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionDependency()}getState(){let e=this.state;return function(n){return n.id>=Al}(e)||tt(316,String(e.id),String(Al)),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(([n])=>n)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(n){return n.id>=Bi})(e)||tt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var fN={tag:Gr};function ID(){let e=Je();e.isEmpty()&&e.append(Se())}var $N=_e({config:We({setOptions:fN,updateOptions:fN}),init:({$initialEditorState:e=ID})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},s){let i=s.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:a}=i;if(Py(a))e.setEditorState(a,r);else if(typeof a=="function")e.update(()=>{a(e)},n);else if(a&&(typeof a=="string"||typeof a=="object")){let l=e.parseEditorState(a);e.setEditorState(l,r)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cu,In,iS,Nu,aS]}),gN=Symbol.for("@lexical/extension/LexicalBuilder");function LD(...e){return pr.fromExtensions(e).buildEditor()}function pN(){}function FD(e){throw e}function Pu(e){return Array.isArray(e)?e:[e]}var bp=DD;class pr{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=bp,this.roots=e;for(let n of e)this.addExtension(n)}static fromExtensions(e){let n=[Pu($N)];for(let r of e)n.push(Pu(r));return new pr(n)}static maybeFromEditor(e){let n=e[gN];return n&&(n.PACKAGE_VERSION!==bp&&tt(292,n.PACKAGE_VERSION,bp),n instanceof pr||tt(293)),n}static fromEditor(e){let n=pr.maybeFromEditor(e);return n===void 0&&tt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,onWarn:r,...s}=this.buildCreateEditorArgs(),i=Object.assign(Tu({...s,...n?{onError:(a)=>{n(a,i)}}:{},...r?{onWarn:(a)=>{r(a,i)}}:{}}),{[gN]:this});for(let a of this.sortedExtensionReps())a.build(i);return i}buildEditor(){let e=pN;function n(){try{e()}finally{e=pN}}let r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=Me(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let n=this.extensionNameMap.get(e.name);if(n)return n.extension!==e&&tt(295,e.name),n}addEdge(e,n,r){let s=this.outgoingConfigEdges.get(e);s?s.set(n,r):this.outgoingConfigEdges.set(e,new Map([[n,r]]));let i=this.incomingEdges.get(n);i?i.add(e):this.incomingEdges.set(n,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&tt(296);let n=Pu(e),[r]=n;typeof r.name!="string"&&tt(297,typeof r.name);let s=this.extensionNameMap.get(r.name);if(s!==void 0&&s.extension!==r&&tt(298,r.name),!s){s=new DN(this,r),this.extensionNameMap.set(r.name,s);let i=this.conflicts.get(r.name);typeof i=="string"&&tt(299,r.name,i);for(let a of r.conflictsWith||[])this.extensionNameMap.has(a)&&tt(299,r.name,a),this.conflicts.set(a,r.name);for(let a of r.dependencies||[]){let l=Pu(a);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(let[a,l]of r.peerDependencies||[])this.addEdge(r.name,a,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],n=(r,s)=>{let i=r.state;if(MN(i))return;let a=r.extension.name;var l;Tp(i)||tt(300,a,s||"[unknown]"),Tp(l=i)||tt(304,String(l.id),String($p)),i=Object.assign(l,{id:Ap}),r.state=i;let c=this.outgoingConfigEdges.get(a);if(c)for(let d of c.keys()){let f=this.extensionNameMap.get(d);f&&n(f,a)}i=wD(i),r.state=i,e.push(r)};for(let r of this.extensionNameMap.values())Tp(r.state)&&n(r);for(let r of e)for(let[s,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){let a=this.extensionNameMap.get(s);if(a)for(let l of i)a.configs.add(l)}for(let[r,...s]of this.roots)if(s.length>0){let i=this.extensionNameMap.get(r.name);i===void 0&&tt(301,r.name);for(let a of s)i.configs.add(a)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let n=this.sortedExtensionReps(),r=new AbortController,s=[()=>r.abort()],i=r.signal;for(let a of n){let l=a.register(e,i);l&&s.push(l)}for(let a of n){let l=a.afterRegistration(e);l&&s.push(l)}return Me(...s)}buildCreateEditorArgs(){let e={},n=new Set,r=new Map,s=new Map,i={},a={},l=this.sortedExtensionReps();for(let f of l){let{extension:g}=f;if(g.onError!==void 0&&(e.onError=g.onError),g.onWarn!==void 0&&(e.onWarn=g.onWarn),g.disableEvents!==void 0&&(e.disableEvents=g.disableEvents),g.parentEditor!==void 0&&(e.parentEditor=g.parentEditor),g.editable!==void 0&&(e.editable=g.editable),g.namespace!==void 0&&(e.namespace=g.namespace),g.$initialEditorState!==void 0&&(e.$initialEditorState=g.$initialEditorState),g.nodes)for(let p of bN(g)){if(typeof p!="function"){let h=r.get(p.replace);h&&tt(302,g.name,p.replace.name,h.extension.name),r.set(p.replace,f)}n.add(p)}if(g.html){if(g.html.export)for(let[p,h]of g.html.export.entries())s.set(p,h);g.html.import&&Object.assign(i,g.html.import)}g.theme&&AN(a,g.theme)}Object.keys(a).length>0&&(e.theme=a),n.size&&(e.nodes=[...n]);let c=Object.keys(i).length>0,d=s.size>0;(c||d)&&(e.html={},c&&(e.html.import=i),d&&(e.html.export=s));for(let f of l)f.init(e);return e.onError||(e.onError=FD),e}}function wN(e,n){let r=pr.fromEditor(e).getExtensionRep(n);return r===void 0&&tt(303,n.name),r.getExtensionDependency()}function wp(e,n){let r=pr.maybeFromEditor(e);if(!r)return;let s=r.extensionNameMap.get(n);return s?s.getExtensionDependency():void 0}function PD(e,n){let r=wp(e,n);return r===void 0&&tt(291,n),r}function kN(e){return wN(Ge(),e)}function BD(e){return kN(e).output}function KD(e){return wp(Ge(),e)}var zD=new Set,Rp=_e({build(e,n,r){let s=r.getDependency(Uu).output,i=Qr({watchedNodeKeys:new Map}),a=Ml(()=>{},()=>Zt(()=>{let l=a.peek(),{watchedNodeKeys:c}=i.value,d,f=!1;s.value.read(()=>{if(X())for(let[g,p]of c.entries()){if(p.size===0){c.delete(g);continue}let h=Mt(g),x=h&&h.isSelected()||!1;f=f||x!==(!!l&&l.has(g)),x&&(d=d||new Set,d.add(g))}}),!f&&d&&l&&d.size===l.size||(a.value=d)}));return{watchNodeKey:function(l){let c=CN(()=>(a.value||zD).has(l)),{watchedNodeKeys:d}=i.peek(),f=d.get(l),g=f!==void 0;return f=f||new Set,f.add(c),g||(d.set(l,f),i.value={watchedNodeKeys:d}),c}}},dependencies:[Uu],name:"@lexical/extension/NodeSelection"}),IN=bn("INSERT_HORIZONTAL_RULE_COMMAND");class zi extends lu{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:UD,priority:0})}})}exportDOM(){return{element:Xe().createElement("hr")}}createDOM(e){let n=Xe().createElement("hr");return et(n,e.theme.hr),n}getTextContent(){return`
|
|
15
|
-
`}isInline(){return!1}updateDOM(){return!1}}function UD(){return{node:kp()}}function kp(){return jc(zi)}function LN(e){return e instanceof zi}var HD=_e({dependencies:[Uu,Rp],name:"@lexical/extension/HorizontalRule",nodes:()=>[zi],register(e,n,r){let{watchNodeKey:s}=r.getDependency(Rp).output,i=Qr({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return Me(e.registerCommand(IN,(l)=>{let c=X();if(!G(c))return!1;if(c.focus.getNode()!==null){let d=kp();Lu(d)}return!0},be),e.registerCommand(yi,(l)=>{if(ro(l.target)){let c=Fy(l.target);if(LN(c))return function(d,f=!1){let g=X(),p=d.isSelected(),h=d.getKey(),x;f&&Ze(g)?x=g:(x=Yc(),mt(x)),p?x.delete(h):x.add(h)}(c,l.shiftKey),!0}return!1},Be),e.registerMutationListener(zi,(l,c)=>{mN(()=>{let d=!1,{nodeSelections:f}=i.peek();for(let[g,p]of l.entries())if(p==="destroyed")f.delete(g),d=!0;else{let h=f.get(g),x=e.getElementByKey(g);h?h.domNode.value=x:(d=!0,f.set(g,{domNode:Qr(x),selectedSignal:s(g)}))}d&&(i.value={nodeSelections:f})})}),Zt(()=>{let l=[];for(let{domNode:c,selectedSignal:d}of i.value.nodeSelections.values())l.push(Zt(()=>{let f=c.value;if(f)d.value?et(f,a):sn(f,a)}));return Me(...l)}))}}),WD=_e({build:(e)=>({composingTextNode:Qr(null),compositionKey:Qr(null)}),name:"@lexical/extension/IME",register(e,n,r){let{compositionKey:s,composingTextNode:i}=r.getOutput(),a=e.registerCommand(qy,()=>{let f=X();return G(f)&&(s.value=f.anchor.key),!1},eu),l=Zt(()=>{let f=s.value;i.value=f!==null?e.read("latest",()=>{let g=Mt(f);return re(g)?g:null}):null}),c=e.registerUpdateListener(({tags:f,editorState:g})=>{f.has(nu)&&g.read(()=>{let p=X();if(!G(p))return;let h=p.anchor.getNode();re(h)&&(i.value=h)})}),d=e.registerRootListener((f)=>{if(f===null)return void(s.value=null);return so(f,"compositionend",()=>{s.value=null})});return Me(a,l,c,d)}}),GD=_e({build:(e,n)=>Eo({inheritEditableFromParent:n.inheritEditableFromParent}),config:We({$getParentEditor:function(){let e=Ge();return pr.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,n,r)=>{let s=n.$getParentEditor();e.parentEditor=s,e.theme=e.theme||s._config.theme},name:"@lexical/extension/NestedEditor",register:(e,n,r)=>Zt(()=>{let s=e._parentEditor;if(s&&r.getOutput().inheritEditableFromParent.value)return e.setEditable(s.isEditable()),s.registerEditableListener(e.setEditable.bind(e))})}),jD=_e({config:We({attribute:"data-selected",nodes:[]}),init(e,n){let r=new Set,s=Ou(TN(e).nodes);for(let i of n.nodes){let a=i.getType(),l=s.get(a);l===void 0&&tt(339,i.name,a),r.add(a);for(let c of l)r.add(c)}return{matchTypes:r}},mergeConfig:(e,n)=>zt(e,{...n,...n.nodes&&{nodes:[...e.nodes,...n.nodes]}}),name:"@lexical/extension/NodeSelectionDataSelected",register(e,n,r){let{attribute:s}=n,{matchTypes:i}=r.getInitResult(),a=new Map,l=(d)=>{let f=new Set;d.read(()=>{let g=X();if(Ze(g))for(let p of g.getNodes())i.has(p.getType())&&f.add(p.getKey())});for(let[g,p]of a)f.has(g)||(p.removeAttribute(s),a.delete(g));for(let g of f){let p=e.getElementByKey(g);p!==null&&(p.setAttribute(s,"true"),a.set(g,p))}};l(e.getEditorState());let c=e.registerUpdateListener(({editorState:d})=>l(d));return()=>{c();for(let d of a.values())d.removeAttribute(s);a.clear()}}});function hN(e){Q(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var YD=_e({build:(e,n,r)=>Eo(n),config:We({disabled:!1}),name:"@lexical/NormalizeInlineElements",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value){let i=[];for(let{klass:a,transforms:l}of e._nodes.values())a.prototype instanceof ct&&a.prototype.isInline!==ct.prototype.isInline&&(l.add(hN),i.push(()=>l.delete(hN)));return()=>i.forEach((a)=>a())}})}}),VD=new Set([Su,dS]),XD=_e({build:(e,n,r)=>Eo(n),config:We({$fixFocusOverselection:function(){let e=X();if(G(e)&&!e.isCollapsed()){let n=dr(cr(e),"next"),r=n.focus;for(Hr(r)&&n.anchor.origin!==r.origin&&r.offset===0&&(r=Uo(r.getSiblingCaret())),So(r)&&n.anchor.origin!==r.origin&&He(r.origin)&&(r=Uo(r));Ko(r)&&n.anchor.origin!==r.origin;)r=Uo(it(r.origin,"next"));if(So(r)&&Q(r.origin)&&(r=It(bt(r.origin,"previous")).getFlipped()),r=It(r),!r.isSamePointCaret(n.focus)){let s=wn(Jn(n.anchor,r)),i=Ge().getRootElement(),a=i&&Ln(i.ownerDocument.defaultView);a&&jy(En(),s,Ge(),a,VD,i)}}},dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(!i)return;let a=0,l=(c)=>{if(c?c.detail===3:a>0){let d=s.dateNow.peek()();a=c&&c.type==="mousedown"||d-a<=s.thresholdMsec.peek()?d:0}return a};return Me(e.registerCommand(oo,()=>(l(null)&&(a=0,s.$fixFocusOverselection.peek()()),!1),Xy),Jr(i,{mousedown:l,mouseup:l},!0))})})});function qD(e){let n=e.target;NS(e,"a",{ctrlKey:!hl,metaKey:hl})&&ye(n)&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.addEventListener("keydown",Xg,{once:!0})}var Mp=_e({build:(e,n,r)=>Eo(n),config:We({disabled:!1}),name:"@lexical/extension/PreventSelectAll",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return e.registerRootListener((i)=>{if(i)return so(i,"keydown",qD,!0)})})}}),JD=_e({build:(e)=>Ml(()=>e.getRootElement(),(n)=>e.registerRootListener((r)=>{n.value=r})),name:"@lexical/extension/RootElement"}),ZD=_e({build:(e,n,r)=>Eo(n),config:We({cascadeSelection:!1,disabled:!1}),dependencies:[Mp],name:"@lexical/extension/SelectBlock",register:(e,n,r)=>{let s=r.getOutput(),i=r.getDependency(Mp).output;return Me(Zt(()=>{i.disabled.value=s.disabled.value}),Zt(()=>{if(!s.disabled.value)return e.registerCommand($i,(a,l)=>{if(l!==e){if(!s.cascadeSelection.peek())return!1;return!!l.read("pending",()=>{let h=X();return G(h)&&Ol(Je(),h)})&&(Wr(),!0)}let c=X();if(Ze(c)){let h=c.getNodes(),x=h[0];if(!x)return!1;let C=x.getTopLevelElement();return!C||yo(C)||C.is(x)||h.length>1&&(d=C,!h.every((y)=>d.is(y.getTopLevelElement())))?Wr():Q(C)&&C.select(0,C.getChildrenSize()),!0}var d;if(!G(c))return!1;let f=c.anchor.getNode(),g=f.getTopLevelElement();if(g&&g.is(c.focus.getNode().getTopLevelElement())&&!Ol(g,c))return g.select(0,g.getChildrenSize()),!0;let p=Zn(f);for(;p!==null;){if(Q(p)&&!Ol(p,c))return p.select(0,p.getChildrenSize()),!0;let h=Vc(p);p=h===null?null:Zn(h)}return Ol(Je(),c)||Wr(),!0},Be)}))}}),QD=_e({build:(e,n,r)=>Eo(n),config:We({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return lN(e,s.onReposition.value)})}});function FN(e){return e.canIndent()}function PN(e,n,r=FN){return Me(e.registerCommand(Vr,(s)=>{let i=X();if(!G(i))return!1;s.preventDefault();let a=function(l){if(l.getNodes().filter((h)=>Ur(h)&&h.canIndent()).length>0)return!0;let{anchor:c,focus:d}=l,f=d.isBefore(c)?d:c,g=f.getNode(),p=ku(g);if(p.canIndent()){let h=p.getKey(),x=Kr();if(x.anchor.set(h,0,"element"),x.focus.set(h,0,"element"),x=zo(x),x.anchor.is(f))return!0}return!1}(i)?s.shiftKey?jo:to:Ds;return e.dispatchCommand(a)},be),e.registerCommand(to,()=>{let s=typeof n=="number"?n:n?n.peek():null,i=X();if(!G(i))return!1;let a=typeof r=="function"?r:r.peek();return vl((l)=>{if(a(l)){let c=l.getIndent()+1;(!s||c<s)&&l.setIndent(c)}})},Si))}var e$=_e({build:(e,n,r)=>Eo(n),config:We({$canIndent:FN,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,n,r){let{disabled:s,maxIndent:i,$canIndent:a}=r.getOutput();return Zt(()=>{if(!s.value)return PN(e,i,a)})}}),t$=_e({build:(e)=>Ml(()=>e.isEditable(),(n)=>e.registerEditableListener((r)=>{n.value=r})),name:"@lexical/extension/WatchEditable"});var Ee=Ip,{$applyFormatToDom:IP,$createHorizontalRuleNode:Gu,$defaultShouldInsertAfter:LP,$getExtensionDependency:FP,$getExtensionOutput:BN,$getPeerDependency:KN,$isDecoratorTextNode:PP,$isHorizontalRuleNode:zN,AutoFocusExtension:BP,ClearEditorExtension:KP,ClickAfterLastBlockExtension:zP,DecoratorTextExtension:UP,DecoratorTextNode:HP,EditorStateExtension:WP,HorizontalRuleExtension:UN,HorizontalRuleNode:ju,IMEExtension:GP,INSERT_HORIZONTAL_RULE_COMMAND:jP,InitialStateExtension:YP,LexicalBuilder:HN,NestedEditorExtension:VP,NodeSelectionDataSelectedExtension:XP,NodeSelectionExtension:qP,NormalizeInlineElementsExtension:WN,NormalizeTripleClickSelectionExtension:GN,PreventSelectAllExtension:JP,RootElementExtension:ZP,SelectBlockExtension:QP,SelectionAlwaysOnDisplayExtension:eB,TabIndentationExtension:tB,WatchEditableExtension:nB,applyFormatFromStyle:oB,applyFormatToDom:rB,batch:Lp,buildEditorFromExtensions:sB,computed:iB,configExtension:jN,declarePeerDependency:aB,defineExtension:lB,effect:Nt,getExtensionDependencyFromEditor:cB,getKnownTypesAndNodes:YN,getPeerDependencyFromEditor:io,getPeerDependencyFromEditorOrThrow:uB,namedSignals:wt,registerClearEditor:dB,registerTabIndentation:Yu,safeCast:fB,shallowMergeConfig:gB,signal:zs,untracked:pB,watchedSignal:VN}=Ee;var Fp={};ke(Fp,{ReactProviderExtension:()=>n$});var n$=_e({name:"@lexical/react/ReactProvider"});var o$=Fp,XN=o$.ReactProviderExtension;var Bp={};ke(Bp,{$canShowPlaceholder:()=>JN,$canShowPlaceholderCurry:()=>s$,$findTextIntersectionFromCharacters:()=>i$,$isRootTextContentEmpty:()=>Pp,$isRootTextContentEmptyCurry:()=>r$,$rootTextContent:()=>qN,registerLexicalTextEntity:()=>l$});function qN(){return Je().getTextContent()}function Pp(e,n=!0){if(e)return!1;let r=qN();return n&&(r=r.trim()),r===""}function r$(e,n){return()=>Pp(e,n)}function JN(e){if(!Pp(e,!1))return!1;let n=Je().getChildren(),r=n.length;if(r>1)return!1;for(let s=0;s<r;s++){let i=n[s];if(kt(i))return!1;if(Q(i)){if(!$n(i))return!1;if(i.__indent!==0)return!1;let a=i.getChildren(),l=a.length;for(let c=0;c<l;c++){let d=a[s];if(!re(d))return!1}}}return!0}function s$(e){return()=>JN(e)}function i$(e,n){let r=e.getFirstChild(),s=0;e:for(;r!==null;){if(Q(r)){let l=r.getFirstChild();if(l!==null){r=l;continue}}else if(re(r)){let l=r.getTextContentSize();if(s+l>n)return{node:r,offset:n-s};s+=l}let i=r.getNextSibling();if(i!==null){r=i;continue}let a=r.getParent();for(;a!==null;){let l=a.getNextSibling();if(l!==null){r=l;continue e}a=a.getParent()}break}return null}function a$(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l$(e,n,r,s){let i=(l)=>l instanceof r,a=(l)=>{let c=yt(l.getTextContent());c.setFormat(l.getFormat()),l.replace(c)};return[e.registerNodeTransform(In,(l)=>{if(!l.isSimpleText())return;let c,d=l.getPreviousSibling(),f=l.getTextContent(),g=l;if(re(d)){let h=d.getTextContent(),x=n(h+f);if(i(d)){if(x===null||((C)=>C.getLatest().__mode)(d)!==0)return void a(d);{let C=x.end-h.length;if(C>0){let y=h+f.slice(0,C);if(d.select(),d.setTextContent(y),C===f.length)l.remove();else{let N=f.slice(C);l.setTextContent(N)}return}}}else if(x===null||x.start<h.length)return}let p=0;for(;;){c=n(f);let h,x=c===null?"":f.slice(c.end);if(f=x,x===""){let y=g.getNextSibling();if(re(y)){x=g.getTextContent()+y.getTextContent();let N=n(x);if(N===null)return void(i(y)?a(y):y.markDirty());if(N.start!==0)return}}if(c===null)return;if(c.start===0&&re(d)&&d.isTextEntity()){p+=c.end;continue}c.start===0?[h,g]=g.splitText(c.end):[,h,g]=g.splitText(c.start+p,c.end+p),h===void 0&&a$(165,"nodeToReplace");let C=s(h);if(C.setFormat(h.getFormat()),h.replace(C),g==null)return;p=0,d=C}}),e.registerNodeTransform(r,(l)=>{let c=l.getTextContent(),d=n(c);if(d===null||d.start!==0)return void a(l);if(c.length>d.end)return void l.splitText(d.end);let f=l.getPreviousSibling();re(f)&&f.isTextEntity()&&(a(f),a(l));let g=l.getNextSibling();re(g)&&g.isTextEntity()&&(a(g),i(l)&&a(l))})]}var Us=Bp,{$canShowPlaceholder:CB,$canShowPlaceholderCurry:Vu,$findTextIntersectionFromCharacters:yB,$isRootTextContentEmpty:SB,$isRootTextContentEmptyCurry:NB,$rootTextContent:EB,registerLexicalTextEntity:TB}=Us;var Kp={};ke(Kp,{DragonExtension:()=>g$,installDragonSupport:()=>u$,registerDragonSupport:()=>eE});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?QN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function QN(e,n,r){let s=function(i){let a=i[Xu];return a===void 0&&(a={dispose:()=>{},editors:new Map,installs:new Set},i[Xu]=a),a}(e);if(s.installs.size===0){let i=f$.bind(e);e.addEventListener("message",i,!0),s.dispose=()=>{e.removeEventListener("message",i,!0)}}if(s.installs.add(n),r){let i=s.editors.get(r)||new Set;i.add(n),s.editors.set(r,i)}return d$.bind(null,e,s,n,r)}function d$(e,n,r,s){if(s){let i=n.editors.get(s);i&&i.delete(r)&&i.size===0&&n.editors.delete(s)}n.installs.delete(r)&&n.installs.size===0&&(n.dispose(),delete e[Xu])}function ZN(e){return e&&e.ownerDocument.defaultView}function eE(e){let n=VN(()=>ZN(e.getRootElement()),(r)=>e.registerRootListener((s)=>{r.value=ZN(s)}));return Nt(()=>{let r=n.value;if(r)return QN(r,Symbol("@lexical/dragon/editorInstall"),e)})}function f$(e){if(e.origin!==this.location.origin)return;let n=function(s){let i=s[Xu];if(i===void 0)return null;let a=bu(hS(s.document));return Ru(a)&&i.editors.has(a)?a:null}(this);if(n===null)return;let r=e.data;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch(i){return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let a=i.args;if(Array.isArray(a)){let[l,c,d,f,g,p]=a;if(![l,c,f,g].every(Number.isFinite)||typeof d!="string"&&d!==-1)return;n.update(()=>{let h=X();if(G(h)){let x=h.anchor,C=x.getNode(),y=0,N=0;if(re(C)&&l>=0&&c>=0&&(y=l,N=l+c,h.setTextNodeRange(C,y,C,N)),typeof d!="string"||y===N&&d===""||(h.insertRawText(d),C=x.getNode()),re(C)){let T=C.getTextContentSize();y=Math.min(Math.max(f,0),T),N=f<0||g<0?y:Math.min(f+g,T),h.setTextNodeRange(C,y,C,N)}if(typeof p=="string"&&g>0&&!h.isCollapsed()){let T=c$[p];T!==void 0&&h.formatText(T)}e.stopImmediatePropagation()}})}}}}}var g$=_e({build:(e,n,r)=>wt(n),config:We({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,n,r)=>Nt(()=>r.getOutput().disabled.value?void 0:eE(e))});var zp=Kp,{DragonExtension:tE,installDragonSupport:AB,registerDragonSupport:nE}=zp;var oh={};ke(oh,{$appendNodeToHTML:()=>pw,$distributeInlineWrapper:()=>LE,$generateDOMFromNodes:()=>VE,$generateDOMFromRoot:()=>fw,$generateHtmlFromNodes:()=>gw,$generateNodesFromDOM:()=>dw,$generateNodesFromDOMViaExtension:()=>aw,$getImportContextValue:()=>IE,$getRenderContextValue:()=>x$,$getSessionDOMRenderConfig:()=>ed,$inlineStylesFromStyleSheets:()=>mE,$isBlockLevel:()=>Wi,$propagateTextAlignToBlockChildren:()=>FE,$setRenderContextValue:()=>C$,$updateRenderContextValue:()=>y$,$withImportContext:()=>Qp,$withRenderContext:()=>Zp,BlockSchema:()=>BE,CoreImportExtension:()=>jE,CoreImportRules:()=>UE,DOMImportExtension:()=>nh,DOMRenderExtension:()=>k$,HorizontalRuleImportExtension:()=>cw,HorizontalRuleImportRules:()=>lw,ImportOverlays:()=>$E,ImportSource:()=>z$,ImportSourceDataTransfer:()=>U$,ImportTextFormat:()=>Ju,ImportTextStyle:()=>AE,ImportWhitespaceConfig:()=>DE,InlineSchema:()=>H$,NestedBlockSchema:()=>W$,RenderContextExport:()=>qp,RenderContextRoot:()=>CE,RootSchema:()=>KE,contextUpdater:()=>m$,contextValue:()=>Dl,createImportState:()=>Ws,createRenderState:()=>Xp,defaultIsInline:()=>ME,defaultPreservesWhitespace:()=>RE,defineImportRule:()=>mr,defineOverlayRules:()=>ow,domOverride:()=>S$,isElementOfTag:()=>B$,parseSelector:()=>OE,sel:()=>uw});function Hs(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hi;function es(e,n){let{key:r}=n;return e&&r in e?e[r]:n.defaultValue}function Yp(e){return Hi&&Hi.editor===e?Hi:void 0}function Zu(e,n){let r=Yp(n);return r&&r[e]}function p$(e,n){if("cfg"in n){let{cfg:r,updater:s}=n;return[r,s(es(e,r))]}return n}function qu(e,n){let r=n;for(let s of e){let[i,a]=p$(r,s),l=i.key;if(r===n&&es(r,i)===a)continue;let c=r===n||r===void 0?h$(n):r;c[l]=a,r=c}return r}function h$(e){return Object.create(e||null)}function Dl(e,n){return[e,n]}function m$(e,n){return{cfg:e,updater:n}}function gE(e,n,r,s=Ge()){let i=Hi,a=Yp(s);try{return Hi={...a,editor:s,[e]:n},r()}finally{Hi=i}}function pE(e,n=()=>{}){return(r,s=Ge())=>(i)=>{let a=Yp(s),l=a&&a[e],c=qu(r,l||n(s));return c&&c!==l?gE(e,c,i,s):i()}}function hE(e,n,r,s){return Object.assign(Yo(Symbol(n),{isEqual:s,parse:r}),{[e]:!0})}var mE=(e,n,r)=>{_E(e),r()};function _E(e){if(!qr(e))return;let n=e;if(n.querySelector("style")===null)return;let r=new Map;function s(i){let a=r.get(i);if(a===void 0){a=new Set;for(let l=0;l<i.style.length;l++)a.add(i.style[l]);r.set(i,a)}return a}try{for(let i of Array.from(n.styleSheets)){let a;try{a=i.cssRules}catch(l){continue}for(let l of Array.from(a)){if(!Fn(l,CSSStyleRule))continue;let c;try{c=n.querySelectorAll(l.selectorText)}catch(d){continue}for(let d of Array.from(c)){if(!ye(d))continue;let f=s(d);for(let g=0;g<l.style.length;g++){let p=l.style[g];f.has(p)||d.style.setProperty(p,l.style.getPropertyValue(p),l.style.getPropertyPriority(p))}}}}}catch(i){}}var Vp="@lexical/html/DOM",Qu=Symbol.for("@lexical/html/DOMExportContext"),xE="@lexical/html/DOMImport",$l=Symbol.for("@lexical/html/DOMImportContext"),_$=()=>!0;function Xp(e,n,r){return hE(Qu,e,n,r)}var CE=Xp("root",Boolean),qp=Xp("isExport",Boolean);function yE(e){let n=io(e,Vp);return n?n.output.defaults:void 0}function x$(e,n=Ge()){return es(function(r){return Zu(Qu,r)||yE(r)}(n),e)}function Jp(e){let n=io(e,Vp);return n?n.output.runtime:void 0}function C$(e,n,r=Ge()){let s=Jp(r);s&&s.setContextValue(e,n)}function y$(e,n,r=Ge()){let s=Jp(r);s&&s.setContextValue(e,n(es(s.editorContext,e)))}function ed(e=Ge()){let n=Jp(e);return n?n.getSessionConfig():Kg(e)}var Zp=pE(Qu,yE);function S$(e,n,r){return{...n,...r,nodes:e}}function N$(e){return(n)=>n instanceof e}function E$(e,{nodes:n}){if(n==="*")return _$;let r={},s=[];for(let i of n)if("getType"in i){let a=i.getType();if(r){let l=e.get(a);l===void 0&&Hs(339,i.name,a);for(let c of l)r[c]=!0}s.push(N$(i))}else r=void 0,s.push(i);return r||(s.length===1?s[0]:(i)=>{for(let a of s)if(a(i))return!0;return!1})}function oE(e){return(n,r,s)=>e(n,s)}function Up(e){return(n,r,s,i)=>e(n,r,i)}function rE(e){return(n,r,s,i,a)=>e(n,r,s,a)}function T$(e){return(n,r,s,i,a,l)=>e(n,r,s,i,l)}function sE(e,n){return(r,s)=>{let i=()=>e(r,s),a=n(r);return a?a(r,i,s):i()}}function Hp(e,n){return(r,s,i)=>{let a=()=>e(r,s,i),l=n(r);return l?l(r,s,a,i):a()}}var b$=Hp,v$=Up;function iE(e,n){return(r,s,i,a)=>{let l=()=>e(r,s,i,a),c=n(r);return c?c(r,s,i,l,a):l()}}function O$(e,n){return(r,s,i,a,l)=>{let c=()=>e(r,s,i,a,l),d=n(r);return d?d(r,s,i,a,c,l):c()}}function A$(e,n){return(r,s,i,a)=>{e(r,s,i,a);let l=n(r);l&&l(r,s,i,a)}}function hr(e,n,r,s,i){let a=r[n];for(let l of e[n])if(typeof l[0]=="function"){let[c,d]=l;a=s(a,(f)=>c(f)&&d||void 0)}else{let c=l[1],d={};for(let f in c){let g=c[f];g&&(d[f]=g.reduce((p,h)=>s(p,()=>h),a))}a=s(a,(f)=>{let g=d[f.getType()];return g&&i(g)})}r[n]=a}function R$(e,n,r,s){if(!s)return;let i=e[n];if(typeof r=="function")i.push([r,s]);else{let a=i[i.length-1],l;a&&a[0]==="types"?l=a[1]:(l={},i.push(["types",l]));for(let c in r){let d=l[c]||[];l[c]=d,d.push(s)}}}function M$(e){return e.nodes==="*"}function D$(e,n){let r=Ou(YN(e).nodes),s={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let i of function(a){let l=[],c=[],d=[];for(let p of a)if(M$(p))l.push(p);else if(Array.isArray(p.nodes))for(let h of p.nodes)Ug(h.prototype)?d.push(p.nodes.length===1?p:{...p,nodes:[h]}):c.push(p.nodes.length===1?p:{...p,nodes:[h]});let f=new Map,g=(p)=>{let h=f.get(p);if(h===void 0){h=-1;for(let x of OS(p))h++;f.set(p,h)}return h};return d.sort((p,h)=>g(p.nodes[0])-g(h.nodes[0])),[...d,...c,...l]}(n)){let a=E$(r,i);for(let l in s)R$(s,l,a,i[l])}return s}function $$(e){return e}function Wp(e,{overrides:n}){let r=D$(e,n),s={...Wg,...e.dom};return hr(r,"$createDOM",s,sE,oE),hr(r,"$exportDOM",s,sE,oE),hr(r,"$extractWithChild",s,O$,T$),hr(r,"$getDOMSlot",s,b$,v$),hr(r,"$shouldExclude",s,Hp,Up),hr(r,"$shouldInclude",s,Hp,Up),hr(r,"$getSlotTargetElement",s,iE,rE),hr(r,"$updateDOM",s,iE,rE),hr(r,"$decorateDOM",s,A$,$$),s}function SE(e){return{get:(n)=>es(e,n)}}function aE(e){let n=Object.create(null);return qu(e,n)||n}function Gp(e,n){let r=SE(n);return e.filter((s)=>!(s.disabledForEditor&&s.disabledForEditor(r)))}function w$(e){if(e.nodes==="*")return()=>!0;let n=e.nodes.map((r)=>{let s=r;return Ug(s.prototype)?(i)=>i instanceof s:r});return(r)=>n.some((s)=>s(r))}class NE{editor;initialEditorConfig;overrides;editorContext;hasSessionGates;installed;sessionCache=new Map;constructor(e,n,r,s){this.editor=e,this.initialEditorConfig=n,this.overrides=r,this.editorContext=s,this.installed=Gp(r,s),this.hasSessionGates=r.some((i)=>i.disabledForSession)}setContextValue(e,n){let r=this.installed;this.editorContext[e.key]=n;let s=Gp(this.overrides,this.editorContext);if(function(d,f){if(d.length!==f.length)return!1;for(let g=0;g<d.length;g++)if(d[g]!==f[g])return!1;return!0}(r,s))return;let i=function(d,f){let g=new Set(d),p=new Set(f),h=[];for(let x of d)p.has(x)||h.push(x);for(let x of f)g.has(x)||h.push(x);return h}(r,s);this.installed=s,this.sessionCache.clear();let a=Wp(this.initialEditorConfig,{overrides:s});this.editor._config.dom=a;let l=function(d){let f=[];for(let g of d)(g.$createDOM||g.$getDOMSlot||g.$decorateDOM)&&f.push(w$(g));return f.length===0?null:(g)=>f.some((p)=>p(g))}(i);if(!l)return;let c=a.$updateDOM;a.$updateDOM=(d,f,g,p)=>!!l(d)||c(d,f,g,p),this.editor.update(xi,{discrete:!0}),a.$updateDOM=c}getSessionConfig(){let e=this.editor._config.dom||Wg;if(!this.hasSessionGates)return e;let n=SE(Zu(Qu,this.editor)||this.editorContext),r=[],s=[];if(this.installed.forEach((l,c)=>{l.disabledForSession&&l.disabledForSession(n)?r.push(String(c)):s.push(l)}),r.length===0)return e;let i=r.join(","),a=this.sessionCache.get(i);return a||(a=Wp(this.initialEditorConfig,{overrides:s}),this.sessionCache.set(i,a)),a}}var k$=_e({build(e,n,r){let{initialEditorConfig:s}=r.getInitResult(),i=aE(n.contextDefaults);return{defaults:i,runtime:new NE(e,s,n.overrides,i)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Cu,()=>{let e=Xe().createElement("div");return e.role="textbox",{element:e}}]])},init(e,n){let r={dom:e.dom,nodes:e.nodes},s=aE(n.contextDefaults),i=Gp(n.overrides,s);return e.dom=Wp(e,{overrides:i}),{initialEditorConfig:r}},mergeConfig(e,n){let r=zt(e,n);for(let s of["overrides","contextDefaults"])n[s]&&(r[s]=[...e[s],...n[s]]);return r},name:Vp}),td=Symbol.for("@lexical/html/SelectorImpl");function wl(e,n){let r={kind:"element",predicate:(s=n,s.length===0?ye:s.length===1?s[0]:(a,l)=>{for(let c of s)if(!c(a,l))return!1;return!0}),tags:e};var s;let i=(a)=>wl(e,[...n,a]);return{[td]:r,attr:(a,l,c)=>i(jp(a,l,c)),classAll:(...a)=>i(TE(a)),classAny:(...a)=>i(function(l){let c=EE(l);if(c.length===0)return()=>!1;return(d)=>{if(!ye(d))return!1;let f=d.classList;for(let g of c)if(f.contains(g))return!0;return!1}}(a)),styleAny:(a,l,c)=>i(function(d,f,g){if(typeof f=="string")return(p)=>ye(p)&&p.style.getPropertyValue(d)===f;if(f instanceof RegExp){let p=g&&g.capture,h=f;return(x,C)=>{if(!ye(x))return!1;let y=x.style.getPropertyValue(d);if(!y)return!1;let N=y.match(h);return N!==null&&(p!==void 0&&(C[p]=N),!0)}}Hs(362,JSON.stringify(d))}(a,l,c))}}function EE(e){let n=[];for(let r of e)r&&n.push(r);return n}function TE(e){let n=EE(e);return n.length===0?()=>!0:(r)=>{if(!ye(r))return!1;let s=r.classList;for(let i of n)if(!s.contains(i))return!1;return!0}}function jp(e,n,r){if(n===!0)return(s)=>ye(s)&&s.hasAttribute(e);if(typeof n=="string")return(s)=>ye(s)&&s.getAttribute(e)===n;if(n instanceof RegExp){let s=r&&r.capture,i=n;return(a,l)=>{if(!ye(a))return!1;let c=a.getAttribute(e);if(c==null)return!1;let d=c.match(i);return d!==null&&(s!==void 0&&(l[s]=d),!0)}}Hs(361,JSON.stringify(e))}var I$={kind:"text",predicate:Fs,tags:new Set},L$={[td]:I$},F$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},P$={[td]:F$},Ui={any:()=>wl(new Set,[]),comment:()=>P$,tag(...e){e.length>0||Hs(363);let n=new Set;for(let r of e)n.add(r.toUpperCase());return wl(n,[])},text:()=>L$};function B$(e,n){return ye(e)&&e.nodeName===n.toUpperCase()}var bE=/[A-Za-z0-9_-]/;class vE{constructor(e,n){this.source=e,this.pos=n}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()&&bE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e==='"'||e==="'","expected quote");let n=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let r=this.source.slice(n,this.pos);return this.pos++,r.replace(/\\(.)/g,"$1")}assert(e,n){e||Hs(364,String(this.pos+1),n,this.source)}}function K$(e){let n=new Set,r=[],s=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(bE.test(e.peek())){let i=e.readIdent();i&&n.add(i.toUpperCase())}for(;!e.eof();){let i=e.peek();if(i==="."){e.consume();let a=e.readIdent();e.assert(a!=="",'expected class name after "."'),s.push(a)}else if(i==="#"){e.consume();let a=e.readIdent();e.assert(a!=="",'expected id after "#"'),r.push(jp("id",a))}else{if(i!=="[")break;{e.consume(),e.skipWhitespace();let a=e.readIdent();e.assert(a!=="",'expected attribute name after "["'),e.skipWhitespace();let l=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let c=e.peek();c==='"'||c==="'"?l=e.readQuoted():(l=e.readIdent(),e.assert(l!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),r.push(jp(a,l))}}}return s.length>0&&r.push(TE(s)),{predicates:r,tags:n}}function OE(e){let n=new vE(e,0),r=[];for(;;){let i=K$(n);if(r.push(i),n.skipWhitespace(),n.eof())break;n.assert(n.peek()===",",'expected "," (selector lists are the only supported combinator)'),n.consume(),n.skipWhitespace()}if(r.length===1)return wl(r[0].tags,r[0].predicates);let s=new Set;if(r.every((i)=>i.tags.size>0))for(let i of r)for(let a of i.tags)s.add(a);return wl(s,[(i,a)=>{for(let l of r){let c=i.nodeName;if(l.tags.size>0&&!l.tags.has(c))continue;let d=!0;for(let f of l.predicates)if(!f(i,a)){d=!1;break}if(d)return!0}return!1}])}function mr(e){return e}function Ws(e,n,r){return hE($l,e,n,r)}var z$=Ws("importSource",()=>"unknown"),U$=Ws("importSourceDataTransfer",()=>null),Ju=Ws("textFormat",()=>0),AE=Ws("textStyle",()=>({}));function RE(e){if(!ye(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function ME(e){if(Fs(e))return!0;if(!ye(e))return!1;let n=e.style.display;return n?n.startsWith("inline"):!Is(e)&&Ii(e)}var DE=Ws("whitespaceConfig",()=>({isInline:ME,preservesWhitespace:RE})),$E=Ws("importOverlays",()=>[]);class wE{constructor(e){this.record=e}get(e){return es(this.record,e)}set(e,n){this.record[e.key]=n}update(e,n){this.record[e.key]=n(es(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function kE(e){let n=io(e,xE);return n?n.output.defaults:void 0}function IE(e,n=Ge()){return es(function(r){return Zu($l,r)||kE(r)}(n),e)}var Qp=pE($l,kE);function Wi(e){return Ur(e)||kt(e)&&!e.isInline()}function LE(e,n){let r=[],s=[],i=()=>{s.length!==0&&(r.push(n().splice(0,0,s)),s=[])};for(let a of e)if(Wi(a)){if(i(),Q(a)){let l=LE(a.getChildren(),n);a.splice(0,a.getChildrenSize(),l)}r.push(a)}else s.push(a);return i(),r}function FE(e,n){if(!ye(n))return e;let r=n.style.textAlign;if(!eh(r))return e;for(let s of e)Ur(s)&&s.getFormatType()===""&&s.setFormat(r);return e}function PE(e,n,r){e.length===1&&He(e[0])&&(e=[]);let s=Se();if(ye(r)){let i=r.style.textAlign;eh(i)&&s.setFormat(i)}return[s.splice(0,0,e)]}var BE={$accepts:Wi,$packageRun:PE,name:"BlockSchema"},H$={$accepts:(e)=>!Wi(e),name:"InlineSchema"},W$={$accepts:Wi,$packageRun:(e)=>e,name:"NestedBlockSchema"},KE={$accepts:Wi,$packageRun:PE,name:"RootSchema"},Gs=Ui,G$=new Set(["center","end","justify","left","right","start"]);function eh(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:rS,MARK:sS},V$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),X$=mr({$import:(e,n)=>{let r=e.get(Ju),s=j$[n.nodeName],i=function(h){return{fontStyle:h.style.fontStyle,fontWeight:h.style.fontWeight,textDecoration:h.style.textDecoration,verticalAlign:h.style.verticalAlign}}(n),a=s?(l=s,{fontStyle:(c=i).fontStyle||l.fontStyle,fontWeight:c.fontWeight||l.fontWeight,textDecoration:c.textDecoration||l.textDecoration,verticalAlign:c.verticalAlign||l.verticalAlign}):i;var l,c;let d=(f=r,g=function(h){let x=0,C=0,{fontWeight:y,fontStyle:N,textDecoration:T,verticalAlign:b}=h;if(y==="700"||y==="bold"?x|=ml:y!=="normal"&&y!=="400"||(C|=ml),N==="italic"?x|=xl:N==="normal"&&(C|=xl),T){let v=T.split(" ");v.includes("underline")&&(x|=yl),v.includes("line-through")&&(x|=Cl),v.includes("none")&&(C|=yl|Cl)}return b==="sub"?(x|=gu,C|=pu):b==="super"?(x|=pu,C|=gu):b==="baseline"&&(C|=gu|pu),{clear:C,set:x}}(a),f&~g.clear|g.set);var f,g;let p=Y$[n.nodeName];return p&&(d|=p),d===r?e.$importChildren(n):e.$importChildren(n,{context:[Dl(Ju,d)]})},match:Gs.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function lE(e,n,r){let s=e;for(;;){let i=null;for(;(i=n?s.nextSibling:s.previousSibling)===null;){let l=s.parentNode;if(l===null)return null;s=l}if(s=i,!r.isInline(s))return null;let a=s;for(;(a=n?s.firstChild:s.lastChild)!==null;)s=a;if(Fs(s))return s;if(s.nodeName==="BR")return null}}function cE(e,n){return n!==0&&re(e)?e.setFormat(n):e}function uE(e,n){if(re(e)){let r=function(s){let i="";for(let a in s)V$.has(a)||(i+=`${a}: ${s[a]}; `);return i.trimEnd()}(n);r!==""&&e.setStyle(r)}return e}var q$=mr({$import:(e,n)=>{let r=e.get(Ju),s=e.get(AE),i=e.get(DE);if(function(c,d){let f=c.parentNode;for(;f!==null;){if(d.preservesWhitespace(f))return!0;f=f.parentNode}return!1}(n,i)){let c=il(n.textContent||"");for(let d of c)cE(d,r),uE(d,s);return c}let a=function(c,d){let f=(c.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(f.length===0)return"";if(f[0]===" "){let g=c,p=!0;for(;g!==null&&(g=lE(g,!1,d))!==null;){let h=g.textContent||"";if(h.length>0){/[ \t\n]$/.test(h)&&(f=f.slice(1)),p=!1;break}}p&&(f=f.slice(1))}if(f.length>0&&f[f.length-1]===" "){let g=c,p=!0;for(;g!==null&&(g=lE(g,!0,d))!==null;)if((g.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){p=!1;break}p&&(f=f.slice(0,-1))}return f}(n,i);if(a==="")return[];let l=yt(a);return cE(l,r),uE(l,s),[l]},match:Gs.text(),name:"@lexical/html/#text"}),J$=mr({$import:()=>[],match:Gs.tag("script","style"),name:"@lexical/html/script-style-ignore"}),Z$=mr({$import:(e,n)=>bS(n)||TS(n)?[]:[fn()],match:Gs.tag("br"),name:"@lexical/html/br"}),Q$=mr({$import:(e,n)=>{let r=Se();if(Qn(r,n),Zr(n,r),r.getFormatType()===""){let s=n.getAttribute("align");s&&eh(s)&&r.setFormat(s)}return Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:Gs.tag("p"),name:"@lexical/html/p"}),zE=mr({$import:(e,n,r)=>Ge().hasNode(ju)?[Gu()]:r(),match:Gs.tag("hr"),name:"@lexical/html/hr"}),UE=[J$,Q$,zE,mr({$import:(e,n,r)=>Is(n)?FE(e.$importChildren(n,{schema:BE}),n):r(),match:Gs.any(),name:"@lexical/html/transparent-block"}),q$,Z$,X$];function ew(e,n){let r=[],s=0,i=0;for(;s<e.length&&i<n.length;)e[s]<=n[i]?r.push(e[s++]):r.push(n[i++]);for(;s<e.length;)r.push(e[s++]);for(;i<n.length;)r.push(n[i++]);return r}function HE(e){let n=[],r=new Map,s=[],i=[],a=[],l=new Set;e.forEach((d,f)=>{let g=function(h){let x=h[td];return x===void 0&&Hs(360),x}(d.match),p=d.name||function(h,x){if(h.kind==="text")return`#text@${x}`;if(h.kind==="comment")return`#comment@${x}`;if(h.tags.size===0)return`*@${x}`;return`${Array.from(h.tags).join(",").toLowerCase()}@${x}`}(g,f);if(d.name&&l.add(d.name),n.push({$import:d.$import,name:p,predicate:g.predicate}),g.kind==="text")i.push(f);else if(g.kind==="comment")a.push(f);else if(g.tags.size===0)s.push(f);else for(let h of g.tags){let x=r.get(h);x||(x=[],r.set(h,x)),x.push(f)}});let c=new Map;if(s.length===0)for(let[d,f]of r)c.set(d,f);else for(let[d,f]of r)c.set(d,ew(f,s));return{byTag:c,commentIndices:a,rules:n,textIndices:i,wildcardIndices:s}}function dE(e,n){return Fs(n)?e.textIndices:n.nodeType===8?e.commentIndices:ye(n)?e.byTag.get(n.nodeName)||e.wildcardIndices:tw}var tw=Object.freeze([]);function WE(e){let n=[];for(let r of e)if(nw(r))for(let s of r.rules)n.push(s);else n.push(r);return n}function nw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function ow(e){let n=WE(e);return{__type:"CompiledOverlayRules",dispatch:HE(n),rules:n}}var rw=Object.freeze({});function sw(e,n){return{$importChildren:(s,i)=>function(a,l,c){let d=c&&c.rules?c.rules.dispatch:void 0;d&&a.overlays.push(d);try{let f=()=>GE(a,l,c);return c&&c.context?Qp(c.context,a.editor)(f):f()}finally{d&&a.overlays.pop()}}(e,s,i),$importOne:(s,i)=>th(e,s,i),captures:n,get:(s)=>IE(s,e.editor),session:e.session}}function GE(e,n,r){let s=r&&r.$onChild,i=[];for(let c of Array.from(n.childNodes)){let d=th(e,c,void 0);for(let f of d){let g=s?s(f):f;g!=null&&i.push(g)}}let a=r&&r.$after?r.$after(i):i,l=r&&r.schema;return l?function(c,d,f,g){let p=[],h=null,x=()=>{if(h===null)return;let C=h;if(h=null,c.$packageRun){let y=c.$packageRun(C,f,g);if(y.length>0){for(let N of y)p.push(N);return}}if(c.onReject==="hoist")for(let y of C)p.push(y)};for(let C of d)c.$accepts(C,f)?(x(),p.push(C)):(h===null&&(h=[]),h.push(C));return x(),c.$finalize?c.$finalize(p,f):p}(l,a,null,n):a}function th(e,n,r){let s=()=>function(i,a){let l=function(g,p){let h=[];for(let C=g.overlays.length-1;C>=0;C--){let y=g.overlays[C],N=dE(y,p);N.length>0&&h.push({dispatch:y,indices:N})}let x=dE(g.dispatch,p);return x.length>0&&h.push({dispatch:g.dispatch,indices:x}),h}(i,a);if(l.length===0)return fE(i,a);let c=0,d=0,f=()=>{for(;c<l.length;){let{dispatch:g,indices:p}=l[c];for(;d<p.length;){let h=p[d++],x=g.rules[h],C={};if(x.predicate(a,C)){let y=sw(i,Object.keys(C).length===0?rw:C);try{return x.$import(y,a,f)}catch(N){throw N}}}c++,d=0}return fE(i,a)};return f()}(e,n);return r&&r.context?Qp(r.context,e.editor)(s):s()}function fE(e,n){if(n.childNodes.length===0)return[];let r=[];for(let s of Array.from(n.childNodes)){let i=th(e,s,void 0);for(let a of i)r.push(a)}return r}var iw=mr({$import:(e,n)=>e.$importChildren(n),match:Ui.any(),name:"@lexical/html/default-hoist"}),nh=_e({build(e,n){let r=HE(WE(n.rules)),s=qu(n.contextDefaults,void 0),i=n.preprocess;return{$generateNodesFromDOM:(a,l)=>{let c=Zu($l,e)||s,d=l&&l.context?qu(l.context,c):c,f=d!==void 0&&d!==c?d:Object.create(c||null),g=new wE(f),p={session:g};return function(h,x,C){let y=h.length-1,N=()=>{for(;y>=0;)return void(0,h[y--])(x,C,N)};N()}(l&&l.preprocess?[...i,...l.preprocess]:i,a,p),gE($l,f,()=>function(h,x,C,y){return GE({dispatch:h,editor:x,overlays:y.get($E).map((N)=>N.dispatch),session:y},qr(C)?C.body:C,{schema:KE})}(r,e,a,g),e)},defaults:s}},config:{contextDefaults:[],preprocess:[mE],rules:[iw]},mergeConfig:(e,n)=>zt(e,{...n,...n.contextDefaults&&{contextDefaults:[...e.contextDefaults,...n.contextDefaults]},...n.preprocess&&{preprocess:[...e.preprocess,...n.preprocess]},...n.rules&&{rules:[...n.rules,...e.rules]}}),name:xE});function aw(e,n){return BN(nh).$generateNodesFromDOM(e,n)}var jE=_e({dependencies:[nn(nh,{rules:UE})],name:"@lexical/html/CoreImport"}),lw=[zE],cw=_e({dependencies:[UN,jE],name:"@lexical/html/HorizontalRuleImport"}),uw={any:Ui.any,comment:Ui.comment,css:OE,tag:Ui.tag,text:Ui.text},YE=new Set(["STYLE","SCRIPT"]);function dw(e,n){_E(n);let r=qr(n)?n.body.childNodes:n.childNodes,s=[],i=[];for(let a of r)if(!YE.has(a.nodeName)){let l=XE(a,e,i,!1);if(l!==null)for(let c of l)s.push(c)}return function(a){for(let l of a)l.getParent()&&l.getNextSibling()instanceof fl&&l.insertAfter(fn());for(let l of a){let c=l.getParent();c&&c.splice(l.getIndexWithinParent(),1,l.getChildren())}}(i),s}function VE(e,n=null,r=Ge()){return Zp([Dl(qp,!0)],r)(()=>{let s=Je(),i=ed(r),a=G(n)?Zn(n.anchor.getNode()):null,l=e.append.bind(e);for(let c of(Q(a)?a:s).getChildren())nd(r,c,l,n,i);return e})}function fw(e,n=Je()){let r=Ge();return Zp([Dl(qp,!0),Dl(CE,!0)],r)(()=>{let s=ed(r),i=e.append.bind(e);return nd(r,n,i,null,s),e})}function gw(e,n=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Hs(338),Ay(e),VE(Xe().createElement("div"),n,e).innerHTML}function nd(e,n,r,s=null,i=Kg(e)){let a=i.$shouldInclude(n,s,e),l=i.$shouldExclude(n,s,e),c=n;s!==null&&re(n)&&(c=Ps(s,n,"clone"));let d=i.$exportDOM(c,e),{element:f,after:g,append:p,$getChildNodes:h}=d;if(!f)return!1;let x=Xe().createDocumentFragment(),C=h?h():Q(c)?c.getChildren():[],y=a&&Ze(s)&&Q(n)?null:s,N=x.append.bind(x);for(let T of C){let b=nd(e,T,N,y,i);!a&&b&&i.$extractWithChild(n,T,s,"html",e)&&(a=!0)}if(a&&!l){if((ye(f)||Yg(f))&&(p?p(x):f.append(x)),r(f),g){let T=g.call(c,f);T&&(Yg(f)?f.replaceChildren(T):f.replaceWith(T))}}else r(x);return a}function pw(e,n,r,s=null){return nd(e,n,r.append.bind(r),s,ed(e))}function XE(e,n,r,s,i=new Map,a){let l=[];if(YE.has(e.nodeName))return l;let c=null,d=function(C,y){let{nodeName:N}=C,T=y._htmlConversions.get(N.toLowerCase()),b=null;if(T!==void 0)for(let v of T){let O=v(C);O!==null&&(b===null||(b.priority||0)<=(O.priority||0))&&(b=O)}return b!==null?b.conversion:null}(e,n),f=d?d(e):null,g=null;if(f!==null){g=f.after;let C=f.node;if(c=Array.isArray(C)?C[C.length-1]:C,c!==null){for(let[,y]of i)if(c=y(c,a),!c)break;c&&l.push(...Array.isArray(C)?C:[c])}f.forChild!=null&&i.set(e.nodeName,f.forChild)}let p=e.childNodes,h=[],x=(c==null||!Dt(c))&&(c!=null&&Ur(c)||s);for(let C=0;C<p.length;C++)h.push(...XE(p[C],n,r,x,new Map(i),c));if(g!=null&&(h=g(h)),Is(e)&&(h=hw(e,h,x?()=>{let C=new fl;return r.push(C),C}:Se)),c==null)if(h.length>0)for(let C of h)l.push(C);else Is(e)&&function(C){if(C.nextSibling==null||C.previousSibling==null)return!1;return Ii(C.nextSibling)&&Ii(C.previousSibling)}(e)&&l.push(fn());else Q(c)&&c.append(...h);return l}function hw(e,n,r){let s=e.style.textAlign,i=[],a=[];for(let l=0;l<n.length;l++){let c=n[l];if(Ur(c))s&&!c.getFormat()&&c.setFormat(s),i.push(c);else if(a.push(c),l===n.length-1||l<n.length-1&&Ur(n[l+1])){let d=r();d.setFormat(s),d.append(...a),i.push(d),a=[]}}return i}var ve=oh,{$appendNodeToHTML:kB,$distributeInlineWrapper:qE,$generateDOMFromNodes:IB,$generateDOMFromRoot:LB,$generateHtmlFromNodes:JE,$generateNodesFromDOM:ZE,$generateNodesFromDOMViaExtension:QE,$getImportContextValue:FB,$getRenderContextValue:PB,$getSessionDOMRenderConfig:BB,$inlineStylesFromStyleSheets:KB,$isBlockLevel:eT,$propagateTextAlignToBlockChildren:od,$setRenderContextValue:zB,$updateRenderContextValue:UB,$withImportContext:HB,$withRenderContext:WB,BlockSchema:tT,CoreImportExtension:lo,CoreImportRules:GB,DOMImportExtension:Xo,DOMRenderExtension:jB,HorizontalRuleImportExtension:YB,HorizontalRuleImportRules:VB,ImportOverlays:nT,ImportSource:oT,ImportSourceDataTransfer:rT,ImportTextFormat:rh,ImportTextStyle:sh,ImportWhitespaceConfig:XB,InlineSchema:qB,NestedBlockSchema:JB,RenderContextExport:ZB,RenderContextRoot:QB,RootSchema:eK,contextUpdater:tK,contextValue:Gi,createImportState:nK,createRenderState:oK,defaultIsInline:rK,defaultPreservesWhitespace:sK,defineImportRule:dt,defineOverlayRules:ih,domOverride:iK,isElementOfTag:ah,parseSelector:aK,sel:ft}=ve;var fh={};ke(fh,{$exportMimeTypeFromSelection:()=>Tw,$generateJSONFromSelectedNodes:()=>pT,$generateNodesFromSerializedNodes:()=>hT,$getClipboardDataFromSelection:()=>mT,$getHtmlContent:()=>uh,$getLexicalContent:()=>dh,$handlePlainTextDrop:()=>Sw,$handleRichTextDrop:()=>yw,$insertDataTransferForPlainText:()=>uT,$insertDataTransferForRichText:()=>dT,$insertGeneratedNodes:()=>id,$writeDragSourceToDataTransfer:()=>Cw,ClipboardDOMImportExtension:()=>xw,ClipboardImportExtension:()=>ch,DEFAULT_IMPORT_MIME_TYPE:()=>sd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>rd,GetClipboardDataExtension:()=>ST,caretFromPoint:()=>aT,copyToClipboard:()=>Nw,setLexicalClipboardDataTransfer:()=>_T});function aT(e,n,r=null){let s=ks(r),i=r?_S(r):[],a=r!==null&&i.length>0;if(a&&typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n,{shadowRoots:i});if(l!==null&&function(c,d){for(let f=c;f!==null;){if(f===d)return!0;f=El(f)}return!1}(l.offsetNode,r))return{node:l.offsetNode,offset:l.offset}}if(a){let l=r.getRootNode();if(Au(l)){let c=l.elementFromPoint(e,n);if(c!==null&&r.contains(c)){let d=function(f,g,p,h){let x=h.createRange(),C=(z)=>g<z.top?z.top-g:g>z.bottom?g-z.bottom:0,y=(z)=>f<z.left?z.left-f:f>z.right?f-z.right:0,N=h.createTreeWalker(p,NodeFilter.SHOW_TEXT),T=null,b=1/0,v=1/0;for(let z=N.nextNode();z;z=N.nextNode()){x.selectNodeContents(z);for(let K of x.getClientRects()){let U=C(K),J=y(K);(U<b||U===b&&J<v)&&(b=U,v=J,T=z)}}if(T===null)return null;let O=0,k=1/0,M=1/0;for(let z=0;z<=T.length;z++){x.setStart(T,z),x.collapse(!0);let K=x.getBoundingClientRect(),U=C(K),J=Math.abs(f-K.left);(U<k||U===k&&J<M)&&(k=U,M=J,O=z)}return{node:T,offset:O}}(e,n,c,s);if(d!==null)return d}}}if(typeof s.caretRangeFromPoint=="function"){let l=s.caretRangeFromPoint(e,n);return l===null?null:{node:l.startContainer,offset:l.startOffset}}if(typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n);return l===null?null:{node:l.offsetNode,offset:l.offset}}return null}function Yi(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.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 lT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(n)=>n}).createHTML(e);return e}var sT=(e,n)=>{if(!G(n))return n.insertRawText(e),!0;let r=(s)=>{let i=X();G(i)&&s(i)};return Fi(e,{linebreak:()=>r((s)=>s.insertParagraph()),tab:()=>r((s)=>s.insertNodes([gn()])),text:(s)=>r((i)=>i.insertText(s))}),!0},sd={"application/x-lexical-editor":[(e,n,r)=>{try{let s=Ge(),i=JSON.parse(e);if(i&&i.namespace===s._config.namespace&&Array.isArray(i.nodes))return id(s,hT(i.nodes),n),!0}catch(s){console.error(s)}return r()}],"text/html":[(e,n,r)=>{try{let s=Ge(),i=new DOMParser().parseFromString(lT(e),"text/html");return id(s,ZE(s,i),n),!0}catch(s){return console.error(s),r()}}],"text/plain":[sT],"text/uri-list":[sT]};function mw(e,n,r,s){if(!e)return!1;let i=(a)=>!!e[a]&&e[a](n,r,i.bind(null,a-1),s);return i(e.length-1)}function cT(e,n,r){let s=n.getData("text/plain");for(let i of function(a){return Object.keys(a.$importMimeType).filter((l)=>a.$importMimeType[l]!==void 0).sort((l,c)=>{let d=a.priority[l],f=a.priority[c];return d===void 0&&f===void 0?l<c?-1:l>c?1:0:d===void 0?1:f===void 0?-1:d-f})}(e)){let a=n.getData(i);if(a&&((i!=="text/html"||a!==s)&&mw(e.$importMimeType[i],a,r,n)))return!0}return!1}var _w={$importMimeType:sd,$insertDataTransfer:(e,n)=>cT({$importMimeType:sd,priority:rd},e,n),priority:rd},ch=_e({build:(e,n)=>({$importMimeType:n.$importMimeType,$insertDataTransfer:(r,s)=>cT(n,r,s),priority:n.priority}),config:We({$importMimeType:sd,priority:rd}),mergeConfig(e,n){let r=zt(e,n);if(n.$importMimeType){let s={...e.$importMimeType};for(let[i,a]of Object.entries(n.$importMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$importMimeType=s}return n.priority&&(r.priority={...e.priority,...n.priority}),r},name:"@lexical/clipboard/Import"}),xw=_e({dependencies:[lo,jN(ch,{$importMimeType:{"text/html":[(e,n,r,s)=>{let i=new DOMParser().parseFromString(lT(e),"text/html"),a=QE(i,{context:[Gi(oT,"paste"),Gi(rT,s)]});return id(Ge(),a,n),!0}]}})],name:"@lexical/clipboard/DOMImport"});function uh(e,n=X()){return n==null&&Yi(166),G(n)&&n.isCollapsed()||n.getNodes().length===0?"":JE(e,n)}function dh(e,n=X()){return n==null&&Yi(166),G(n)&&n.isCollapsed()||n.getNodes().length===0?null:JSON.stringify(pT(e,n))}function uT(e,n){let r=e.getData("text/plain")||e.getData("text/uri-list");r!=null&&n.insertRawText(r)}function dT(e,n,r){(function(){let s=KN(ch.name);return s?s.output:_w})().$insertDataTransfer(e,n)}var fT="application/x-lexical-drag";function Cw(e,n){let r={editorKey:n.getKey()};e.setData(fT,JSON.stringify(r))}function gT(e,n,r){let s=e.dataTransfer;if(s===null)return!1;let i=function(f){let g=f.getData(fT);if(!g)return null;let p;try{p=JSON.parse(g)}catch(x){return null}return(h=p)!==null&&typeof h=="object"&&"editorKey"in h&&typeof h.editorKey=="string"?p:null;var h}(s);if(i===null)return!1;let a=function(f,g){let p=aT(f.clientX,f.clientY,g.getRootElement());if(p===null)return null;let h=vt(p.node);if(h===null)return null;if(re(h))return Xc(h,"next",p.offset);if(Q(h))return Pg(h,p.offset,"next");let x=h.getParent();return x===null?null:Pg(x,h.getIndexWithinParent()+1,"next")}(e,n);if(a===null)return!1;let l=Zc(a);if(l===null)return!1;let c=i.editorKey===n.getKey(),d=X();if(c){if(!G(d)||d.isCollapsed())return!1;if(function(f,g){let{anchor:p,focus:h}=dr(cr(g),"next");return Br(p,f)<0&&Br(f,h)<0}(a,d))return e.preventDefault(),!0;d.removeText()}if(!l.origin.isAttached())return e.preventDefault(),!0;if(r(s,wn(Os(l)),n),!c){let f=n.getRootElement(),g=f?f.ownerDocument:null,p=g?function(h,x){for(let C of gS(x)){let y=bu(C);if(Ru(y)&&y.getKey()===h&&ye(C))return C}return null}(i.editorKey,g):null;p!==null&&p.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function yw(e,n){return gT(e,n,dT)}function Sw(e,n){return gT(e,n,(r,s)=>uT(r,s))}function id(e,n,r){e.dispatchCommand(yu,{nodes:n,selection:r})||(r.insertNodes(n),function(s){if(G(s)&&s.isCollapsed()){let i=s.anchor,a=null,l=dn(i,"previous");if(l)if(Hr(l))a=l.origin;else{let c=Jn(l,bt(Je(),"next").getFlipped());for(let d of c){if(re(d.origin)){a=d.origin;break}if(Q(d.origin)&&!d.origin.isInline())break}}if(a&&re(a)){let c=a.getFormat(),d=a.getStyle();s.format===c&&s.style===d||(s.format=c,s.style=d,s.dirty=!0)}}}(r))}function lh(e,n,r,s=[]){let i=n===null||r.isSelected(n),a=Q(r)&&r.excludeFromCopy("html"),l=r;n!==null&&re(l)&&(l=Ps(n,l,"clone"));let c=Q(l)?l.getChildren():[],d=function(g){let p=g.exportJSON(),h=g.constructor;if(p.type!==h.getType()&&Yi(58,h.name),Q(g)){let x=p.children;Array.isArray(x)||Yi(59,h.name)}return p}(l);re(l)&&l.getTextContentSize()===0&&(i=!1);let f=i&&Ze(n)&&Q(r)?null:n;for(let g=0;g<c.length;g++){let p=c[g],h=lh(e,f,p,d.children);!i&&Q(r)&&h&&r.extractWithChild(p,n,"clone")&&(i=!0)}if(i&&!a){let g=As(l);if(g.length>0){let p={};for(let h of g){let x=Ci(l,h);x===null&&Yi(366,l.constructor.name,h);let C=[];lh(e,null,x,C),C.length===1&&C[0].type===x.getType()||Yi(385,h,l.constructor.name,String(C.length),String(C.length>0?C[0].type:"none")),p[h]=C[0]}d.$slots=p}}if(i&&!a)s.push(d);else if(Array.isArray(d.children))for(let g=0;g<d.children.length;g++){let p=d.children[g];s.push(p)}return i}function pT(e,n){let r=[],s=Je(),i=G(n)?n.anchor.getNode():Ze(n)?n.getNodes()[0]??null:null,a=i!==null?Zn(i):null,l=(Q(a)?a:s).getChildren();for(let c=0;c<l.length;c++)lh(e,n,l[c],r);return{namespace:e._config.namespace,nodes:r}}function hT(e){let n=[];for(let r of e)n.push(Uy(r));return n}var ji=null;async function Nw(e,n,r){if(ji!==null)return!1;if(n!==null)return new Promise((f,g)=>{e.update(()=>{f(iT(e,n,r))})});let s=e.getRootElement(),i=e._window||window,a=i.document,l=Ln(i);if(s===null||l===null)return!1;let c=a.createElement("span");c.style.position="fixed",c.style.top="-1000px",c.append(a.createTextNode("#")),s.append(c);let d=a.createRange();return d.setStart(c,0),d.setEnd(c,1),l.removeAllRanges(),l.addRange(d),new Promise((f,g)=>{let p=e.registerCommand(Ni,(h)=>(Fn(h,ClipboardEvent)&&(p(),ji!==null&&(i.clearTimeout(ji),ji=null),f(iT(e,h,r))),!0),Si);ji=i.setTimeout(()=>{p(),ji=null,f(!1)},50),a.execCommand("copy"),c.remove()})}function iT(e,n,r){if(r===void 0){let i=Ln(e._window),a=X();if(!a||a.isCollapsed())return!1;if(!i)return!1;let l=ws(i,e.getRootElement()),{anchorNode:c,focusNode:d}=l;if(c!==null&&d!==null&&!vS(e,c,d))return!1;r=mT(a)}n.preventDefault();let s=n.clipboardData;return s!==null&&(_T(s,r),!0)}var Ew=[["text/html",uh],["application/x-lexical-editor",dh]];function mT(e=X()){return function(n,r){let s={"text/plain":""};for(let[i,a]of Object.entries(n))if(a){let l=yT(a,r);l!==null&&(s[i]=l)}return s}(xT(),e)}function _T(e,n){for(let[r]of Ew)n[r]===void 0&&e.setData(r,"");for(let r in n){let s=n[r];s!==void 0&&e.setData(r,s)}}function xT(e=Ge()){let n=io(e,ST.name);return n?n.output:CT}var CT={"application/x-lexical-editor":[(e,n)=>e?dh(Ge(),e):n()],"text/html":[(e,n)=>e?uh(Ge(),e):n()],"text/plain":[(e,n)=>e?e.getTextContent():n()]};function yT(e,n){let r=(s)=>e[s]?e[s](n,r.bind(null,s-1)):null;return r(e.length-1)}function Tw(e,n=X()){return yT(xT()[e]||[],n)}var ST=_e({build:(e,n,r)=>n.$exportMimeType,config:We({$exportMimeType:CT}),mergeConfig(e,n){let r=zt(e,n);if(n.$exportMimeType){let s={...e.$exportMimeType};for(let[i,a]of Object.entries(n.$exportMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$exportMimeType=s}return r},name:"@lexical/clipboard/GetClipboardData"});var Lt=fh,{$exportMimeTypeFromSelection:pK,$generateJSONFromSelectedNodes:hK,$generateNodesFromSerializedNodes:mK,$getClipboardDataFromSelection:ad,$getHtmlContent:_K,$getLexicalContent:xK,$handlePlainTextDrop:CK,$handleRichTextDrop:NT,$insertDataTransferForPlainText:yK,$insertDataTransferForRichText:gh,$insertGeneratedNodes:SK,$writeDragSourceToDataTransfer:ET,ClipboardDOMImportExtension:NK,ClipboardImportExtension:EK,DEFAULT_IMPORT_MIME_TYPE:TK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:bK,GetClipboardDataExtension:vK,caretFromPoint:ld,copyToClipboard:kl,setLexicalClipboardDataTransfer:TT}=Lt;var hh={};ke(hh,{$createHeadingNode:()=>qi,$createQuoteNode:()=>Ll,$isHeadingNode:()=>$w,$isQuoteNode:()=>Mw,DRAG_DROP_PASTE:()=>ph,HeadingNode:()=>Fl,QuoteNode:()=>Il,RichTextExtension:()=>wT,RichTextImportExtension:()=>Rw,RichTextImportRules:()=>$T,ShadowRootQuoteRule:()=>Ow,eventFiles:()=>Bs,quoteShadowRootState:()=>fd,registerRichText:()=>kT});var bw=dt({$import:(e,n)=>{let r=qi(n.nodeName.toLowerCase());return Zr(n,r),Qn(r,n),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:ft.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),vw=dt({$import:(e,n)=>{let r=Ll();return Qn(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:ft.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),Ow=dt({$import:(e,n)=>{let r=Ll({shadowRoot:!0});return Qn(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n,{schema:tT}))]},match:ft.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),$T=[bw,vw,dt({$import:(e,n,r)=>{let s=n.firstChild;return s&&(ye(i=s)&&i.nodeName==="SPAN"&&i.style.fontSize==="26pt")?e.$importChildren(n):r();var i},match:ft.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),dt({$import:(e,n,r)=>n.style.fontSize!=="26pt"?r():[qi("h1").splice(0,0,e.$importChildren(n))],match:ft.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Aw(e,n){return e&&n!==null?zt(e,n):n}var wT=_e({build:(e,n)=>wt(n),config:We({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:[tE,WN,GN,lo,nn(Xo,{rules:$T})],mergeConfig:function(e,n){let r=zt(e,n);return n.escapeFormatTriggers&&(r.escapeFormatTriggers=function(s,i){let a=zt(s,i);for(let l of Object.keys(i))a[l]=Aw(s[l],i[l]);return a}(e.escapeFormatTriggers,n.escapeFormatTriggers)),r},name:"@lexical/rich-text",nodes:()=>[Fl,Il],register:(e,n,r)=>Nt(()=>kT(e,r.getOutput().escapeFormatTriggers))}),Rw=_e({dependencies:[wT],name:"@lexical/rich-text/Import"}),ph=bn("DRAG_DROP_PASTE_FILE"),fd=Yo("shadowRoot",{parse:Boolean});class Il extends ct{$config(){return this.config("quote",{extends:ct,importDOM:{blockquote:()=>({conversion:Dw,priority:0})},stateConfigs:[{flat:!0,stateConfig:fd}]})}isShadowRoot(){return Bo(this,fd)}setIsShadowRoot(e){return eo(this,fd,e)}createDOM(e){let n=Xe().createElement("blockquote");return et(n,e.theme.quote),n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){return super.exportJSON()}static importJSON(e){return Ll().updateFromJSON(e)}insertNewAfter(e,n){let r=Se(),s=this.getDirection();return r.setDirection(s),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(let n of this.getChildren())this.insertBefore(n);return this.remove(),!0}let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Ll(e){let n=cn(new Il);return e&&e.shadowRoot?n.setIsShadowRoot(!0):n}function Mw(e){return e instanceof Il}class Fl extends ct{__tag;$config(){return this.config("heading",{extends:ct,importDOM:{h1:()=>({conversion:Vi,priority:0}),h2:()=>({conversion:Vi,priority:0}),h3:()=>({conversion:Vi,priority:0}),h4:()=>({conversion:Vi,priority:0}),h5:()=>({conversion:Vi,priority:0}),h6:()=>({conversion:Vi,priority:0}),p:(e)=>{let n=e.firstChild;return n!==null&&bT(n)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>bT(e)?{conversion:()=>({node:qi("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",n){super(n),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let n=this.getWritable();return n.__tag=e,n}createDOM(e){let n=this.__tag,r=Xe().createElement(n),s=e.theme.heading;if(s!==void 0){let i=s[n];et(r,i)}return r}updateDOM(e,n,r){return e.__tag!==this.__tag}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,n=!0){let r=e?e.anchor.offset:0,s=this.getLastDescendant(),i=!s||e&&e.anchor.key===s.getKey()&&r===s.getTextContentSize()||!e?Se():qi(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let l=Se();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Se();this.getChildren().forEach((n)=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}}function bT(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Vi(e){let n=e.nodeName.toLowerCase(),r=null;return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6"||(r=qi(n),Zr(e,r),Qn(r,e),Tn(r,e)),{node:r}}function Dw(e){let n=Ll();return Qn(n,e),Zr(e,n),Tn(n,e),{node:n}}function qi(e="h1"){return cn(new Fl(e))}function $w(e){return e instanceof Fl}function vT(e){let n=vt(e);return kt(n)}function Xi(e,n,r,s){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type==="text"){let c=e.anchor.getNode();if(re(c)){a=c;let d=e.anchor.offset,f=d===c.getTextContentSize()&&c.getNextSibling()===null,g=d===0&&c.getPreviousSibling()===null;i=r==="end"&&f||r==="start"&&g||r==="both"&&(f||g)}}let l=!1;for(let[c,d]of Object.entries(s)){if(d==null||!d[n])continue;let f=c;if(d.onlyAtBoundary){if(!(i&&a&&re(a)&&a.hasFormat(f)))continue;l=!0}e.hasFormat(f)&&e.toggleFormat(f)}l&&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,n){return function(r,s){if(!r.isCollapsed())return!1;let i=dn(r.focus,s),a=he(i.origin,Jc);if(!a)return!1;let l=r.focus.getNode();if(!a.is(l)&&!ll(l,a))return!1;let c=Jn(i,it(a,s));if(c.getTextSlices().some((p)=>p&&p.getTextContentSize()>0))return!1;let d=Jn(c.anchor.getSiblingCaret(),c.focus),f=d.anchor.origin;for(let p of d){if(!So(p)||!p.origin.is(f.getParent()))return!1;f=p.origin}let g=a;for(let p of bs(it(a,s))){if(!p.origin.is(g.getParent())){if(Ky(p.origin)){let h=it(g,s);return wn(Jn(h,h)),!0}break}if(!Jc(p.origin))break;g=p.origin}return!1}(e,n)||function(r,s){if(!r.isCollapsed()||r.anchor.type!=="element")return!1;let i=dn(r.anchor,s).getNodeAtCaret();return!(!Jc(i)||i.isInline()||(wn(Os(It(bt(i,s)))),0))}(e,n)}function OT(e){return kt(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ud(e){let n=Yc();n.add(e),mt(n)}function AT(e,n){if(!e.isCollapsed())return!1;let r=e.focus,s=r.getNode(),i=n?"previous":"next",a=dn(r,i);if(r.type==="element"&&Q(s)&&Dt(s)){let T=a.getNodeAtCaret();return!(T===null||!OT(T))&&(ud(T.__key),!0)}let l=he(Q(s)?s:s.getParentOrThrow(),(T)=>Q(T)&&!T.isInline()&&Dt(T.getParent()));if(l===null)return!1;let c=it(l,i).getNodeAtCaret();if(c===null||!OT(c))return!1;if(l.getTextContentSize()===0)return ud(c.__key),!0;let d=Ge().getRootElement();if(d===null)return!1;let f=Ln(d.ownerDocument.defaultView);if(f===null||f.rangeCount===0)return!1;let{anchorNode:g,anchorOffset:p,focusNode:h,focusOffset:x}=f;f.modify("move",n?"backward":"forward","line");let{anchorNode:C,anchorOffset:y}=f;if(C===null)return RT(f,g,p,h,x),!1;let N=vt(C);if(RT(f,g,p,h,x),N===null)return!1;if(C===g&&y===p)return ud(c.__key),!0;return!N.is(l)&&!ll(N,l)&&(ud(c.__key),!0)}function RT(e,n,r,s,i){n!==null&&s!==null&&e.setBaseAndExtent(n,r,s,i)}function MT(e,n){if(!e.isCollapsed())return!1;let r=e.focus.getNode(),s=he(Q(r)?r:r.getParentOrThrow(),(N)=>Q(N)&&!N.isInline());if(s===null)return!1;let i=Ge(),a=i.getRootElement();if(a===null)return!1;let l=a.ownerDocument.defaultView;if(l===null)return!1;let c=!1;for(let N of s.getChildren())if(Q(N)&&N.isInline()){let T=i.getElementByKey(N.getKey());if(T!==null){let b=l.getComputedStyle(T).display;if(b==="inline-grid"||b==="inline-flex"){c=!0;break}}}if(!c)return!1;let d=it(s,n?"previous":"next").getNodeAtCaret();if(d===null||!Q(d)){if(n){let N=s.getFirstDescendant();re(N)?N.select(0,0):s.select(0,0)}else{let N=s.getLastDescendant();if(re(N)){let T=N.getTextContentSize();N.select(T,T)}else{let T=s.getChildrenSize();s.select(T,T)}}return!0}let f=i.getElementByKey(d.getKey());if(f===null)return!1;let g=Ln(l);if(g===null||g.rangeCount===0)return!1;let p=g.getRangeAt(0).cloneRange();p.collapse(!0);let h=p.getBoundingClientRect(),x=f.getBoundingClientRect(),C=x.top+x.height/2;if(h.height>0){let N=ld(h.left,C,a);if(N!==null&&f.contains(N.node)){let T=a.ownerDocument.createRange();return T.setStart(N.node,N.offset),T.collapse(!0),e.applyDOMRange(T),e.dirty=!0,!0}}let y=n?d.getLastDescendant():d.getFirstDescendant();if(re(y)){let N=n?y.getTextContentSize():0;y.select(N,N)}else{let N=d.getChildrenSize();d.select(n?N:0,n?N:0)}return!0}function dd(e,n){let r=it(e,n),s=r.getAdjacentCaret();s!==null&&Q(s.origin)&&!s.origin.isInline()&&s.origin.isShadowRoot()?wn(Os(r)):n==="next"?e.selectNext(0,0):e.selectPrevious()}function DT(e,n,r){r.preventDefault(),r.stopPropagation();let s=e.getNodes();if(s.length===0)return!0;let i=s.map((d)=>it(d,"next")).sort(Br),a=(n?i[0]:i[i.length-1]).origin,l=he(a,(d)=>d!==a&&Q(d)&&!d.isInline())??Je(),c=n?0:l.getChildrenSize();return l.select(c,c),!0}function kT(e,n=zs(ww)){return Me(e.registerCommand(yi,()=>{let r=X();return Ze(r)?(r.clear(),!0):(G(r)&&Xi(r,"click","both",n.peek()),!1)},be),e.registerCommand(Ei,(r)=>{let s=X();return G(s)?(s.deleteCharacter(r),!0):!!Ze(s)&&(s.deleteNodes(),!0)},be),e.registerCommand(au,(r)=>{let s=X();return!!G(s)&&(s.deleteWord(r),!0)},be),e.registerCommand(iu,(r)=>{let s=X();return!!G(s)&&(s.deleteLine(r),!0)},be),e.registerCommand(ou,(r)=>{let s=X();if(typeof r=="string")s!==null&&s.insertText(r);else{if(s===null)return!1;let i=r.dataTransfer;if(i!=null)gh(i,s,e);else if(G(s)){let a=r.data;return a&&s.insertText(a),!0}}return!0},be),e.registerCommand(lS,()=>{let r=X();return!!G(r)&&(r.removeText(),!0)},be),e.registerCommand(Wo,(r)=>{let s=X();return!(!G(s)&&!Ze(s))&&(Dy(s,r),!0)},be),e.registerCommand(cS,(r)=>{let s=X();return!(!G(s)&&!Ze(s))&&(Wy(s,r),!0)},be),e.registerCommand(cu,(r)=>{let s=X();if(!G(s)&&!Ze(s))return!1;let i=s.getNodes();for(let a of i){let l=he(a,(c)=>Q(c)&&!c.isInline());l!==null&&l.setFormat(r)}return!0},be),e.registerCommand(Gg,(r)=>{let s=X();return!!G(s)&&(s.insertLineBreak(r),!0)},be),e.registerCommand(jr,()=>{let r=X();return!!G(r)&&(r.insertParagraph(),!0)},be),e.registerCommand(Ds,()=>{let r=gn(),s=X();return G(s)&&(r.setFormat(s.format),r.setStyle(s.style)),qc([r]),!0},be),e.registerCommand(to,()=>vl((r)=>{let s=r.getIndent();r.setIndent(s+1)}),be),e.registerCommand(jo,()=>vl((r)=>{let s=r.getIndent();s>0&&r.setIndent(Math.max(0,s-1))}),be),e.registerCommand(no,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"previous"),!0}else if(G(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===0}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"previous"))return r.preventDefault(),!0;if(!r.shiftKey&&AT(s,!0))return r.preventDefault(),!0;if(!r.shiftKey&&MT(s,!0))return r.preventDefault(),!0}return!1},be),e.registerCommand(Go,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"next"),!0}else if(G(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===Je().getChildrenSize()}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"next"))return r.preventDefault(),!0;if(!r.shiftKey&&AT(s,!1))return r.preventDefault(),!0;if(!r.shiftKey&&MT(s,!1))return r.preventDefault(),!0}return!1},be),e.registerCommand(Yr,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],Tl(i[0])?"next":"previous"),!0}if(!G(s))return!1;if(!r.shiftKey&&cd(s,Tl(s.anchor.getNode())?"next":"previous"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","start",n.peek()),cp(s,!0)){let i=r.shiftKey;return r.preventDefault(),lp(s,i,!0),!0}return!1},be),e.registerCommand(vi,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],Tl(i[0])?"previous":"next"),!0}if(!G(s))return!1;if(!r.shiftKey&&cd(s,Tl(s.anchor.getNode())?"previous":"next"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","end",n.peek()),cp(s,!1)){let i=r.shiftKey;return r.preventDefault(),lp(s,i,!1),!0}return!1},be),e.registerCommand(Oi,(r)=>{let s=X();if(!Ze(s)&&vT(r.target))return!1;if(G(s)){if(function(i){if(!i.isCollapsed())return!1;let{anchor:a}=i;if(a.offset!==0)return!1;let l=a.getNode();if(yo(l))return!1;let c=ku(l);return c.getIndent()>0&&(c.is(l)||l.is(c.getFirstDescendant()))}(s))return r.preventDefault(),e.dispatchCommand(jo);if(_l&&gl)return!1}else if(!Ze(s))return!1;return r.preventDefault(),e.dispatchCommand(Ei,!0)},be),e.registerCommand(hu,(r)=>{let s=X();return!(!Ze(s)&&vT(r.target))&&(!(!G(s)&&!Ze(s))&&(r.preventDefault(),e.dispatchCommand(Ei,!1)))},be),e.registerCommand(Ai,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();i.length===1&&kt(i[0])&&!i[0].isInline()&&(s=i[0].selectNext())}if(!G(s))return!1;if(Xi(s,"enter","both",n.peek()),r!==null){if((_l||fu||du)&&gl)return!1;if(r.preventDefault(),r.shiftKey)return e.dispatchCommand(Gg,!1)}return e.dispatchCommand(jr)},be),e.registerCommand(Ri,()=>{let r=X();return!!G(r)&&(e.blur(),!0)},be),e.registerCommand(Qy,(r)=>{let[,s]=Bs(r);if(s.length>0){let{clientX:i,clientY:a}=r,l=ld(i,a,e.getRootElement());if(l!==null){let{offset:c,node:d}=l,f=vt(d);if(f!==null){let g=Kr();if(re(f))g.anchor.set(f.getKey(),c,"text"),g.focus.set(f.getKey(),c,"text");else{let h=f.getParentOrThrow().getKey(),x=f.getIndexWithinParent()+1;g.anchor.set(h,x,"element"),g.focus.set(h,x,"element")}let p=zo(g);mt(p)}e.dispatchCommand(ph,s)}return r.preventDefault(),!0}return NT(r,e)},be),e.registerCommand(Zy,(r)=>{let[s]=Bs(r),i=X();return!(s&&!G(i))&&(G(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(TT(r.dataTransfer,ad(i)),ET(r.dataTransfer,e)),!0)},be),e.registerCommand(Jy,(r)=>{let[s]=Bs(r),i=X();if(s&&!G(i))return!1;let{clientX:a,clientY:l}=r,c=ld(a,l,e.getRootElement());if(c!==null){let d=vt(c.node);kt(d)&&r.preventDefault()}return!0},be),e.registerCommand($i,()=>{let r=X();return Wr(G(r)&&Zn(r.anchor.getNode())!==null?r:null),!0},be),e.registerCommand(Ni,(r)=>(kl(e,Fn(r,ClipboardEvent)?r:null),!0),be),e.registerCommand(ru,(r)=>(async function(s,i){await kl(i,Fn(s,ClipboardEvent)?s:null),i.update(()=>{let a=X();G(a)?a.removeText():Ze(a)&&a.getNodes().forEach((l)=>l.remove())},{tag:su})}(r,e),!0),be),e.registerCommand(Di,(r)=>{let[,s,i]=Bs(r);if(s.length>0&&!i)return e.dispatchCommand(ph,s),!0;if(ro(r.target)&&By(r.target))return!1;return X()!==null&&(function(a,l){a.preventDefault(),l.update(()=>{let c=X(),d=Fn(a,InputEvent)||Fn(a,KeyboardEvent)?null:a.clipboardData;d!=null&&c!==null&&gh(d,c,l)},{tag:_u})}(r,e),!0)},be),e.registerCommand(mu,()=>{let r=X();return G(r)&&Xi(r,"space","both",n.peek()),!1},be),e.registerCommand(Vr,()=>{let r=X();return G(r)&&Xi(r,"tab","both",n.peek()),!1},be),e.registerCommand(Sl,(r)=>{let s=X();if(Ze(s))return DT(s,!1,r);if(!G(s))return!1;let{anchor:i}=s;if(i.type!=="element"||i.offset!==0)return!1;let a=i.getNode();if(!Q(a))return!1;let l=a.getFirstChild();if(!kt(l)||!l.isInline())return!1;let c=a.getKey(),d=a.selectEnd();return r.shiftKey&&d.anchor.set(c,0,"element"),r.preventDefault(),r.stopPropagation(),!0},be),e.registerCommand(Mi,(r)=>{let s=X();if(Ze(s))return DT(s,!0,r);if(!G(s))return!1;let{anchor:i,focus:a}=s,l=he(a.getNode(),(f)=>Q(f)&&!f.isInline());if(l===null)return!1;let c=l.getFirstChild();if(!kt(c)||!c.isInline())return!1;if(he(i.getNode(),(f)=>Q(f)&&!f.isInline())!==l)return!1;let d=l.getKey();return(a.type!=="element"||a.key!==d||a.offset!==0)&&(s.focus.set(d,0,"element"),r.shiftKey||s.anchor.set(d,0,"element"),r.preventDefault(),r.stopPropagation(),!0)},be))}var vn=hh,{$createHeadingNode:gd,$createQuoteNode:pd,$isHeadingNode:Pl,$isQuoteNode:hd,DRAG_DROP_PASTE:LK,HeadingNode:md,QuoteNode:_d,RichTextExtension:FK,RichTextImportExtension:PK,RichTextImportRules:BK,ShadowRootQuoteRule:KK,eventFiles:zK,quoteShadowRootState:UK,registerRichText:IT}=vn;var _h={};ke(_h,{RichTextPlugin:()=>Fw});S();function kw(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var mh=pn?$e:m;function Iw({editor:e,ErrorBoundary:n}){return function(r,s){let[i,a]=u(()=>r.getDecorators());return mh(()=>r.registerDecoratorListener((l)=>{rn(()=>{a(l)})}),[r]),m(()=>{a(r.getDecorators())},[r]),D(()=>{let l=[],c=Object.keys(i);for(let d=0;d<c.length;d++){let f=c[d],g=t(s,{onError:(h)=>r._onError(h),children:t(pi,{fallback:null,children:i[f]})}),p=r.getElementByKey(f);p!==null&&l.push(Ji(g,p,f))}return l},[s,i,r])}(e,n)}function Lw({editor:e,ErrorBoundary:n}){return function(r){let s=HN.maybeFromEditor(r);if(s&&s.hasExtensionByName(XN.name)){for(let i of["@lexical/plain-text","@lexical/rich-text"])s.hasExtensionByName(i)&&kw(320,i);return!0}return!1}(e)?null:t(Iw,{editor:e,ErrorBoundary:n})}function LT(e){return e.read("latest",Vu(e.isComposing()))}function Fw({contentEditable:e,placeholder:n=null,ErrorBoundary:r}){let[s]=st();return function(i){mh(()=>Me(IT(i),nE(i)),[i])}(s),o(L,{children:[e,t(Pw,{content:n}),t(Lw,{editor:s,ErrorBoundary:r})]})}function Pw({content:e}){let[n]=st(),r=function(i){let[a,l]=u(()=>LT(i));return mh(()=>{function c(){let d=LT(i);l(d)}return c(),Me(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a}(n),s=RS();return r?typeof e=="function"?e(s):e:null}var Bw=_h,FT=Bw.RichTextPlugin;var xh={};ke(xh,{ContentEditable:()=>zw,ContentEditableElement:()=>KT});S();var BT=pn?$e:m;function Kw({editor:e,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:s,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:l,ariaInvalid:c,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:g,ariaOwns:p,ariaRequired:h,autoCapitalize:x,className:C,id:y,role:N="textbox",spellCheck:T=!0,style:b,tabIndex:v,"data-testid":O,...k},M){let[z,K]=u(e.isEditable()),U=P((W)=>{W&&W.ownerDocument&&W.ownerDocument.defaultView?e.setRootElement(W):e.setRootElement(null)},[e]),J=D(()=>function(...W){return(ne)=>{for(let ee of W)typeof ee=="function"?ee(ne):ee!=null&&(ee.current=ne)}}(M,U),[U,M]);return BT(()=>(K(e.isEditable()),e.registerEditableListener((W)=>{K(W)})),[e]),t("div",{"aria-activedescendant":z?n:void 0,"aria-autocomplete":z?r:"none","aria-controls":z?s:void 0,"aria-describedby":i,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":z&&N==="combobox"?!!l:void 0,...c!=null?{"aria-invalid":c}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":g,"aria-owns":z?p:void 0,"aria-readonly":!z||void 0,"aria-required":h,autoCapitalize:x,className:C,contentEditable:z,"data-testid":O,id:y,ref:J,role:N,spellCheck:T,style:b,tabIndex:v??(z?void 0:-1),...k})}var KT=F(Kw);function PT(e){return e.read("latest",Vu(e.isComposing()))}var zw=F(Uw);function Uw(e,n){let{placeholder:r,...s}=e,[i]=st();return o(L,{children:[t(KT,{editor:i,...s,ref:n}),r!=null&&t(Hw,{editor:i,content:r})]})}function Hw({content:e,editor:n}){let r=function(l){let[c,d]=u(()=>PT(l));return BT(()=>{function f(){let g=PT(l);d(g)}return f(),Me(l.registerUpdateListener(()=>{f()}),l.registerEditableListener(()=>{f()}))},[l]),c}(n),[s,i]=u(n.isEditable());if($e(()=>(i(n.isEditable()),n.registerEditableListener((l)=>{i(l)})),[n]),!r)return null;let a=null;return typeof e=="function"?a=e(s):e!==null&&(a=e),a===null?null:t("div",{"aria-hidden":!0,children:a})}var zT=xh,{ContentEditable:UT,ContentEditableElement:az}=zT;var Ch={};ke(Ch,{HistoryExtension:()=>xd,SharedHistoryExtension:()=>jw,createEmptyHistoryState:()=>GT,registerHistory:()=>WT});function Ww(e,n,r,s,i){if(e===null||r.size===0&&s.size===0&&!i)return 0;let a=n._selection,l=e._selection;if(i)return 1;if(!(G(a)&&G(l)&&l.isCollapsed()&&a.isCollapsed()))return 0;let c=function(T,b,v){let O=T._nodeMap,k=[];for(let M of b){let z=O.get(M);z!==void 0&&k.push(z)}for(let[M,z]of v){if(!z)continue;let K=O.get(M);K===void 0||yo(K)||k.push(K)}return k}(n,r,s);if(c.length===0)return 0;if(c.length>1){let T=n._nodeMap,b=T.get(a.anchor.key),v=T.get(l.anchor.key);return b&&v&&!e._nodeMap.has(b.__key)&&re(b)&&b.__text.length===1&&a.anchor.offset===1?2:0}let d=c[0],f=e._nodeMap.get(d.__key);if(!re(f)||!re(d)||f.__mode!==d.__mode)return 0;let g=f.__text,p=d.__text;if(g===p)return 0;let h=a.anchor,x=l.anchor;if(h.key!==x.key||h.type!=="text")return 0;let C=h.offset,y=x.offset,N=p.length-g.length;return N===1&&y===C-1?2:N===-1&&y===C+1?3:N===-1&&y===C?4:0}function Gw(e,n,r){let s=r(),i=0,a=s,l=0,c=null;return(d,f,g,p,h,x)=>{let C=r();if(x.has(nu)&&(a=s,l=i,c=d),x.has(bi))return i=0,s=C,2;x.has(tu)&&c&&(s=a,i=l,d=c);let y=x.has(_u)||x.has(su)?0:Ww(d,f,p,h,e.isComposing()),N=(()=>{let T=g===null||g.editor===e,b=x.has(uu);if(!b&&T&&x.has(Gr))return 0;if(y===1)return 2;if(d===null)return 1;let v=f._selection;if(!(p.size>0||h.size>0))return v!==null?0:2;let O=typeof n=="number"?n:n.peek();if(b===!1&&y!==0&&y===i&&C<s+O&&T)return 0;if(p.size===1){if(function(k,M,z){let K=M._nodeMap.get(k),U=z._nodeMap.get(k),J=M._selection,W=z._selection;return!(G(J)&&G(W)&&J.anchor.type==="element"&&J.focus.type==="element"&&W.anchor.type==="text"&&W.focus.type==="text"||!re(K)||!re(U)||K.__parent!==U.__parent)&&JSON.stringify(M.read(()=>K.exportJSON()))===JSON.stringify(z.read(()=>U.exportJSON()))}(Array.from(p)[0],d,f))return 0}return 1})();return s=C,i=y,N}}function HT(e,n){e.undoStack=[],e.redoStack=[],e.current=null,n&&n(e)}function WT(e,n,r,s=Date.now,i,a=null){let l=Gw(e,r,s),c=()=>{i&&i(n)};return c(),Me(e.registerCommand(Eu,()=>(function(d,f,g){let{redoStack:p,undoStack:h}=f;if(h.length!==0){let x=f.current,C=h.pop();x!==null&&(p.push(x),d.dispatchCommand(Rs,!0)),h.length===0&&d.dispatchCommand(Ms,!1),f.current=C||null,g&&g(f),C&&C.editor.setEditorState(C.editorState,{tag:bi})}}(e,n,i),!0),be),e.registerCommand(xu,()=>(function(d,f,g){let{redoStack:p,undoStack:h}=f;if(p.length!==0){let x=f.current;x!==null&&(h.push(x),d.dispatchCommand(Ms,!0));let C=p.pop();p.length===0&&d.dispatchCommand(Rs,!1),f.current=C||null,g&&g(f),C&&C.editor.setEditorState(C.editorState,{tag:bi})}}(e,n,i),!0),be),e.registerCommand(Qc,()=>(HT(n,i),!1),be),e.registerCommand(Yy,()=>(HT(n,i),e.dispatchCommand(Rs,!1),e.dispatchCommand(Ms,!1),!0),be),e.registerUpdateListener(({editorState:d,prevEditorState:f,dirtyLeaves:g,dirtyElements:p,tags:h})=>{let{current:x,redoStack:C,undoStack:y}=n,N=x===null?null:x.editorState;if(x!==null&&d===N)return;let T=l(f,d,x,g,p,h);if(T===1){if(C.length!==0&&(n.redoStack=[],e.dispatchCommand(Rs,!1)),x!==null){y.push({...x});let b=typeof a=="number"||a===null?a:a.peek();b!==null&&y.length>b&&y.splice(0,y.length-b),e.dispatchCommand(Ms,!0)}}else if(T===2)return;n.current={editor:e,editorState:d},c()}))}function GT(){return{current:null,redoStack:[],undoStack:[]}}var xd=_e({build:(e,{delay:n,createInitialHistoryState:r,disabled:s,maxDepth:i,now:a},l)=>({...wt({delay:n,disabled:s,historyState:r(e),maxDepth:i,now:a}),...l.getInitResult()}),config:We({createInitialHistoryState:GT,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:()=>({canRedo:zs(!1),canUndo:zs(!1)}),name:"@lexical/history/History",register:(e,n,r)=>{let{canUndo:s,canRedo:i}=r.getInitResult(),a=r.getOutput(),l=(c)=>Lp(()=>{s.value=c!=null&&c.undoStack.length>0,i.value=c!=null&&c.redoStack.length>0});return Nt(()=>{if(!a.disabled.value)return WT(e,a.historyState.value,a.delay,()=>a.now.peek()(),l,a.maxDepth);l(null)})}}),jw=_e({build:(e,{disabled:n,parentEditor:r})=>wt({disabled:n,parentEditor:r||e._parentEditor}),config:We({disabled:!1,parentEditor:null}),dependencies:[nn(xd,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,n,r)=>Nt(()=>{let{disabled:s,parentEditor:i}=r.getOutput();if(!s.value){let{output:a}=r.getDependency(xd),l=function(d){return d?io(d,xd.name):null}(i.value);if(!l)return;let c=l.output;Lp(()=>{a.delay.value=c.delay.value,a.historyState.value=c.historyState.value,a.now.value=c.now.value,a.disabled.value=c.disabled.value})}})});var Cd=Ch,{HistoryExtension:dz,SharedHistoryExtension:fz,createEmptyHistoryState:yd,registerHistory:jT}=Cd;var yh={};ke(yh,{HistoryPlugin:()=>Yw,createEmptyHistoryState:()=>yd});S();function Yw({delay:e,externalHistoryState:n}){let[r]=st();return function(s,i,a=1000){let l=D(()=>i||yd(),[i]);m(()=>jT(s,l,a),[a,s,l])}(r,n,e),null}var YT=yh,{HistoryPlugin:VT,createEmptyHistoryState:xz}=YT;var bh={};ke(bh,{$createListItemNode:()=>bo,$createListNode:()=>To,$getListDepth:()=>Sd,$handleListInsertParagraph:()=>a0,$insertList:()=>Nd,$isListItemNode:()=>Le,$isListNode:()=>De,$removeList:()=>s0,CheckListExtension:()=>tk,INSERT_CHECK_LIST_COMMAND:()=>c0,INSERT_ORDERED_LIST_COMMAND:()=>_0,INSERT_UNORDERED_LIST_COMMAND:()=>m0,ListExtension:()=>Th,ListImportExtension:()=>nk,ListImportRules:()=>p0,ListItemNode:()=>Ys,ListNode:()=>Zi,ListSchema:()=>ek,REMOVE_LIST_COMMAND:()=>x0,UPDATE_LIST_START_COMMAND:()=>h0,registerCheckList:()=>u0,registerList:()=>C0,registerListStrictIndentTransform:()=>y0});function ts(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sd(e){let n=1,r=e.getParent();for(;r!=null;){if(Le(r)){let s=r.getParent();if(De(s)){n++,r=s.getParent();continue}ts(40)}return n}return n}function Sh(e){let n=e.getParent();De(n)||ts(40);let r=n,s=n;for(;s!==null;)s=s.getParent(),De(s)&&(r=s);return r}function o0(e){let n=[],r=e.getChildren().filter(Le);for(let s=0;s<r.length;s++){let i=r[s],a=i.getFirstChild();De(a)?n=n.concat(o0(a)):n.push(i)}return n}function co(e){return Le(e)&&De(e.getFirstChild())}function r0(e,n){return Le(e)&&(n.length===0||n.length===1&&e.is(n[0])&&e.getChildrenSize()===0)}function Nd(e){let n=X();if(n!==null){let r=n.getNodes();if(G(n)){let[i]=n.getStartEndPoints(),a=i.getNode(),l=a.getParent();if(Dt(a)){let c=a.getFirstChild();if(c)r=c.selectStart().getNodes();else{let d=Se();a.append(d),r=d.select().getNodes()}}else if(r0(a,r)){let c=To(e);if(Dt(l)){a.replace(c);let d=bo();Q(a)&&(d.setFormat(a.getFormatType()),d.setIndent(a.getIndent())),c.append(d)}else if(Le(a)){let d=a.getParentOrThrow();js(c,d.getChildren()),d.replace(c)}return}}let s=new Set;for(let i=0;i<r.length;i++){let a=r[i];if(Q(a)&&a.isEmpty()&&!Le(a)&&!s.has(a.getKey())){XT(a,e);continue}let l=ul(a)?a.getParent():Le(a)&&a.isEmpty()?a:null;for(;l!=null;){let c=l.getKey();if(De(l)){if(!s.has(c)){let d=To(e);js(d,l.getChildren()),l.replace(d),s.add(c)}break}{let d=l.getParent();if(Dt(d)&&!s.has(c)){s.add(c),XT(l,e);break}l=d}}}}}function js(e,n){e.splice(e.getChildrenSize(),0,n)}function XT(e,n){if(De(e))return e;let r=e.getPreviousSibling(),s=e.getNextSibling(),i=bo(),a;if(js(i,e.getChildren()),De(r)&&n===r.getListType())r.append(i),De(s)&&n===s.getListType()&&(js(r,s.getChildren()),s.remove()),a=r;else if(De(s)&&n===s.getListType())s.getFirstChildOrThrow().insertBefore(i),a=s;else{let c=To(n);c.append(i),e.replace(c),a=c}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let l=X();return G(l)&&(a.getKey()===l.anchor.key&&l.anchor.set(i.getKey(),l.anchor.offset,"element"),a.getKey()===l.focus.key&&l.focus.set(i.getKey(),l.focus.offset,"element")),e.remove(),a}function Eh(e,n){let r=e.getLastChild(),s=n.getFirstChild();r&&s&&co(r)&&co(s)&&(Eh(r.getFirstChild(),s.getFirstChild()),s.remove());let i=n.getChildren();i.length>0&&e.append(...i),n.remove()}function s0(){let e=X();if(G(e)){let n=new Set,r=e.getNodes(),s=e.anchor.getNode();if(r0(s,r))n.add(Sh(s));else for(let i=0;i<r.length;i++){let a=r[i];if(ul(a)){let l=Iu(a,Ys);l!=null&&n.add(Sh(l))}}for(let i of n){let a=i,l=o0(i);for(let c of l){let d=Se().setTextStyle(e.style).setTextFormat(e.format);js(d,c.getChildren()),a.insertAfter(d),a=d,c.__key===e.anchor.key&&Ho(e.anchor,It(bt(d,"next"))),c.__key===e.focus.key&&Ho(e.focus,It(bt(d,"next"))),c.remove()}i.remove()}}}function i0(e){let n=e.getListType()!=="check",r=e.getStart();for(let s of e.getChildren())Le(s)&&(s.getValue()!==r&&s.setValue(r),n&&s.getLatest().__checked!=null&&s.setChecked(void 0),De(s.getFirstChild())||r++)}function Vw(e){let n=new Set;if(co(e)||n.has(e.getKey()))return;let r=e.getParent(),s=e.getNextSibling(),i=e.getPreviousSibling();if(co(s)&&co(i)){let a=i.getFirstChild();if(De(a)){a.append(e);let l=s.getFirstChild();if(De(l))js(a,l.getChildren()),s.remove(),n.add(s.getKey())}}else if(co(s)){let a=s.getFirstChild();if(De(a)){let l=a.getFirstChild();l!==null&&l.insertBefore(e)}}else if(co(i)){let a=i.getFirstChild();De(a)&&a.append(e)}else if(De(r)){let a=jt(e),l=jt(r);a.append(l),l.append(e),i?i.insertAfter(a):s?s.insertBefore(a):r.append(a)}}function qT(e){if(co(e))return;let n=e.getParent(),r=n?n.getParent():void 0;if(De(r?r.getParent():void 0)&&Le(r)&&De(n)){let s=n?n.getFirstChild():void 0,i=n?n.getLastChild():void 0;if(e.is(s))r.insertBefore(e),n.isEmpty()&&r.remove();else if(e.is(i))r.insertAfter(e),n.isEmpty()&&r.remove();else{let a=jt(e),l=jt(n);a.append(l),e.getPreviousSiblings().forEach((f)=>l.append(f));let c=jt(e),d=jt(n);c.append(d),js(d,e.getNextSiblings()),r.insertBefore(a),r.insertAfter(c),r.replace(e)}}}function a0(e=!1){let n=X();if(!G(n)||!n.isCollapsed())return!1;let r=n.anchor.getNode(),s=null;if(Le(r)&&r.getChildrenSize()===0)s=r;else if(re(r)){let f=r.getParent();Le(f)&&f.getChildren().every((g)=>re(g)&&g.getTextContent().trim()==="")&&(s=f)}if(s===null)return!1;let i=Sh(s),a=s.getParent();De(a)||ts(40);let l=a.getParent(),c;if(Dt(l))c=Se(),i.insertAfter(c);else{if(!Le(l))return!1;c=jt(l),l.insertAfter(c)}c.setTextStyle(n.style).setTextFormat(n.format).select();let d=s.getNextSiblings();if(d.length>0){let f=e?function(p,h){return p.getStart()+h.getIndexWithinParent()}(a,s):1,g=jt(a).setStart(f);if(Le(c)){let p=jt(c);p.append(g),c.insertAfter(p)}else c.insertAfter(g);g.append(...d)}return function(f){let g=f;for(;g.getNextSibling()==null&&g.getPreviousSibling()==null;){let p=g.getParent();if(p==null||!Le(p)&&!De(p))break;g=p}g.remove()}(s),!0}class Ys extends ct{__value;__checked;$config(){return this.config("listitem",{$transform:(e)=>{let n=e.getParent();if(De(n))n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(n){let r=e.createParentElementNode();De(r)||ts(340);let s=[e];for(let i of["previous","next"]){s.reverse();for(let{origin:a}of it(e,i)){if(!Le(a))break;s.push(a)}}e.insertBefore(r),r.splice(0,0,s),Dt(n)||(zr(r,Uo(it(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:ct,importDOM:jg({li:()=>({conversion:Xw,priority:0})})})}constructor(e=1,n=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let n=Xe().createElement("li");return this.updateListItemDOM(null,n,e),n}updateListItemDOM(e,n,r){(function(a,l){let c=l.getParent();!De(c)||c.getListType()!=="check"||De(l.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),a.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(n,this),n.value=this.__value,function(a,l,c){let d=l.list;if(!d)return;let f=d.listitem,g=d.nested&&d.nested.listitem,p=c.getParent(),h=De(p)&&p.getListType()==="check",x=c.getChecked(),C=c.getChildren().some((T)=>De(T)),y=[];d.listitemChecked!==void 0&&y.push(d.listitemChecked),d.listitemUnchecked!==void 0&&y.push(d.listitemUnchecked),g!==void 0&&y.push(...Li(g)),y.length>0&&sn(a,...y);let N=[];if(f!==void 0&&N.push(...Li(f)),h){let T=x?d.listitemChecked:d.listitemUnchecked;T!==void 0&&N.push(T)}g!==void 0&&C&&N.push(...Li(g)),N.length>0&&et(a,...N)}(n,r.theme,this);let s=e?e.__style:"",i=this.__style;s!==i&&fr(n.style,i,s),function(a,l,c){let d=l.__textStyle,f=c?c.__textStyle:"";if(c!==null&&f===d)return;let g=Xr(d);for(let p in g)a.style.setProperty(`--listitem-marker-${p}`,g[p]);if(f!=="")for(let p in Xr(f))p in g||a.style.removeProperty(`--listitem-marker-${p}`)}(n,this,e)}updateDOM(e,n,r){let s=n;return this.updateListItemDOM(e,s,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let n=this.createDOM(e._config),r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();return s&&(n.dir=s),co(this)?{after(i){if(ye(i)){let a=i.previousElementSibling;if(ye(a)&&a.nodeName==="LI"){for(;i.firstChild;)a.append(i.firstChild);i.remove()}}return i},element:n}:{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if(Q(r)&&this.canMergeWith(r)){let s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,n){if(Le(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!De(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let a=jt(r),l=this.getNextSibling();for(;l;){let c=l;l=l.getNextSibling(),a.append(c)}r.insertAfter(e),e.insertAfter(a)}let s=this.__key,i=0;if(n&&(Q(e)||ts(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),n&&Q(e)){let a=X();if(G(a))for(let l of a.getStartEndPoints())l.key===s&&l.type==="element"&&l.set(e.getKey(),i+l.offset,"element")}return this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){let r=this.getParentOrThrow();if(De(r)||ts(39),Le(e))return super.insertAfter(e,n);let s=this.getNextSiblings();if(r.insertAfter(e,n),s.length!==0){let i=jt(r);s.forEach((a)=>i.append(a)),e.insertAfter(i,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&co(n)&&co(r)&&(Eh(n.getFirstChild(),r.getFirstChild()),r.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}collapseAtStart(e){if(co(this))return!1;let n=this.getParentOrThrow();if(Le(n.getParentOrThrow()))return qT(this),!0;let r=Se().append(...this.getChildren()),s=this.getNextSiblings();if(s.length>0){let i=jt(n);i.append(...s),n.insertAfter(i)}return n.insertAfter(r),this.remove(),n.getChildrenSize()===0&&n.remove(),r.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let n=this.getWritable();return n.__value=e,n}getChecked(){let e=this.getLatest(),n,r=this.getParent();return De(r)&&(n=r.getListType()),n==="check"?Boolean(e.__checked):void 0}setChecked(e){let n=this.getWritable();return n.__checked=e,n}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 n=e.getParentOrThrow(),r=0;for(;Le(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&ts(117),(e=Math.floor(e))>=0||ts(199);let n=this.getIndent();for(;n!==e;)n<e?(Vw(this),n++):(qT(this),n--);return this}canInsertAfter(e){return Le(e)}canReplaceWith(e){return Le(e)}canMergeWith(e){return Le(e)||$n(e)}extractWithChild(e,n){if(!G(n))return!1;let r=n.anchor.getNode(),s=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return To("bullet")}canMergeWhenEmpty(){return!0}}function Xw(e){if(e.classList.contains("task-list-item")){for(let s of e.children)if(s.tagName==="INPUT")return JT(s)}if(e.classList.contains("joplin-checkbox")){for(let s of e.children)if(s.classList.contains("checkbox-wrapper")&&s.children.length>0&&s.children[0].tagName==="INPUT")return JT(s.children[0])}let n=e.getAttribute("aria-checked"),r=bo(n==="true"||n!=="false"&&void 0);return Qn(r,e),{after:l0.bind(null,r),node:Tn(r,e)}}function JT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let n=bo(e.hasAttribute("checked"));return{after:l0.bind(null,n),node:n}}function l0(e,n){let r=n[0];return n.length===1&&$n(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function bo(e){return cn(new Ys(void 0,e))}function Le(e){return e instanceof Ys}class Zi extends ct{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(n){let r=n.getNextSibling();De(r)&&n.getListType()===r.getListType()&&Eh(n,r)})(e),i0(e)},extends:ct,importDOM:jg({ol:()=>({conversion:QT,priority:0}),ul:()=>({conversion:QT,priority:0})})})}constructor(e="number",n=1,r){super(r);let s=qw[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=n}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 n=this.getWritable();return n.__listType=e,n.__tag=e==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let n=this.getWritable();return n.__start=e,n}createDOM(e,n){let r=this.__tag,s=Xe().createElement(r);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,ZT(s,e.theme,this),s}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(ZT(n,r.theme,this),e.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let n=this.createDOM(e._config,e);return ye(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let s=r;for(let i=0;i<r.length;i++){let a=r[i];Le(a)||(s===r&&(s=[...r]),s[i]=this.createListItemNode().append(!Q(a)||De(a)||a.isInline()?a:yt(a.getTextContent())))}return super.splice(e,n,s)}extractWithChild(e){return Le(e)}createListItemNode(){return bo()}}function ZT(e,n,r){let s=[],i=[],a=n.list;if(a!==void 0){let l=a[`${r.__tag}Depth`]||[],c=Sd(r)-1,d=c%l.length,f=l[d],g=a[r.__tag],p,{nested:h,checklist:x}=a;if(h!==void 0&&h.list&&(p=h.list),g!==void 0&&s.push(g),x!==void 0&&r.__listType==="check"&&s.push(x),f!==void 0){s.push(...Li(f));for(let C=0;C<l.length;C++)C!==d&&i.push(r.__tag+C)}if(p!==void 0){let C=Li(p);c>1?s.push(...C):i.push(...C)}}i.length>0&&sn(e,...i),s.length>0&&et(e,...s)}function QT(e){let n;if(function(r){return ye(r)&&r.nodeName.toLowerCase()==="ol"}(e)){let r=e.start;n=To("number",r)}else n=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(let s of r.childNodes)if(ye(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(e)?To("check"):To("bullet");return Tn(n,e),{after:(r)=>function(s,i){let a=i.createListItemNode.bind(i),l=[];for(let c=0;c<s.length;c++){let d=s[c];if(Le(d)){l.push(d);let f=d.getChildren();f.length>1&&f.forEach((g)=>{De(g)&&l.push(a().append(g))})}else l.push(a().append(d))}return l}(r,n),node:n}}var qw={ol:"number",ul:"bullet"};function To(e="number",n=1){return cn(new Zi(e,n))}function De(e){return e instanceof Zi}var c0=bn("INSERT_CHECK_LIST_COMMAND");function u0(e,n){let r=n&&n.disableTakeFocusOnClick||!1,s=typeof r=="boolean"?()=>r:r.peek.bind(r),i=(f)=>{let g=f.target;if(!ye(g))return!1;let p=g.__lexicalCheckListLastHandled;return p!==void 0&&f.timeStamp-p<500},a=(f)=>{let g=f.target;ye(g)&&(g.__lexicalCheckListLastHandled=f.timeStamp)},l=(f)=>{i(f)||(a(f),e0(f,s()))},c=(f)=>{f.pointerType==="touch"&&(i(f)||(a(f),e0(f,s())))},d=(f)=>{(function(g,p){d0(g,()=>{g.preventDefault(),p&&g.stopPropagation()})})(f,s())};return Me(e.registerCommand(c0,()=>(Nd("check"),!0),Be),e.registerCommand(Go,(f)=>t0(f,e,!1),Be),e.registerCommand(no,(f)=>t0(f,e,!0),Be),e.registerCommand(Ri,()=>{if(Nh(e)!=null){let f=e.getRootElement();return f!=null&&f.focus(),!0}return!1},Be),e.registerCommand(mu,(f)=>{let g=Nh(e);return!(g==null||!e.isEditable())&&(e.update(()=>{let p=vt(g);Le(p)&&(f.preventDefault(),p.toggleChecked())}),!0)},Be),e.registerCommand(Yr,(f)=>e.read("latest",()=>{let g=X();if(G(g)&&g.isCollapsed()){let{anchor:p}=g,h=p.type==="element";if(h||p.offset===0){let x=p.getNode(),C=he(x,(y)=>Q(y)&&!y.isInline());if(Le(C)){let y=C.getParent();if(De(y)&&y.getListType()==="check"&&(h||C.getFirstDescendant()===x)){let N=e.getElementByKey(C.__key);if(N!=null&&No(N)!==N)return N.focus(),f.preventDefault(),!0}}}}return!1}),Be),e.registerRootListener((f)=>{if(f!==null)return Me(Jr(f,{click:l,pointerup:c}),Jr(f,{mousedown:d,pointerdown:d},{capture:!0}),so(f,"touchstart",d,{capture:!0,passive:!1}))}))}function d0(e,n){let r=e.target;if(!ye(r))return;let s=r.firstChild;if(ye(s)&&(s.tagName==="UL"||s.tagName==="OL"))return;let i=r.parentNode;if(!i||i.__lexicalListType!=="check")return;let a=null,l=null;if("clientX"in e)a=e.clientX;else if("touches"in e){let x=e.touches;x.length>0&&(a=x[0].clientX,l="touch")}if(a==null)return;let c=r.getBoundingClientRect(),d=a/aN(r),f=r.ownerDocument.defaultView,g=f?f.getComputedStyle(r,"::before"):{width:"0px"},p=parseFloat(g.width),h=l==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(r.dir==="rtl"?d<c.right+h&&d>c.right-p-h:d>c.left-h&&d<c.left+p+h)&&n()}function e0(e,n){d0(e,()=>{if(ye(e.target)){let r=e.target,s=vu(r);s!=null&&s.isEditable()&&s.update(()=>{let i=vt(r);Le(i)&&(n?(sl(Su),sl(uS)):r.focus(),i.toggleChecked())})}})}function Nh(e){let n=e.getRootElement(),r=n?No(n):null;return ye(r)&&r.tagName==="LI"&&r.parentNode!=null&&r.parentNode.__lexicalListType==="check"?r:null}function t0(e,n,r){let s=Nh(n);return s!=null&&n.update(()=>{let i=vt(s);if(!Le(i))return;let a=function(l,c){let d=c?l.getPreviousSibling():l.getNextSibling(),f=l;for(;d==null&&Le(f);)f=f.getParentOrThrow().getParent(),f!=null&&(d=c?f.getPreviousSibling():f.getNextSibling());for(;Le(d);){let g=c?d.getLastChild():d.getFirstChild();if(!De(g))return d;d=c?g.getLastChild():g.getFirstChild()}return null}(i,r);if(a!=null){a.selectStart();let l=n.getElementByKey(a.__key);l!=null&&(e.preventDefault(),setTimeout(()=>{l.focus()},0))}}),!1}function Jw(e){let n=[];for(let r of e)if(Le(r)){n.push(r);let s=r.getChildren();if(s.length>1)for(let i of s)De(i)&&n.push(bo().append(i))}else n.push(bo().append(r));return n}var Zw=dt({$import:(e,n)=>{let r;var s;return ah(n,"ol")?r=To("number",n.start):r=(s=n).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||s.querySelector(":scope > [aria-checked]")!==null?To("check"):To("bullet"),Tn(r,n),[r.splice(0,0,od(Jw(e.$importChildren(n)),n))]},match:ft.tag("ol","ul"),name:"@lexical/list/list"});function f0(e,n){if(n.length!==1)return n;let r=n[0];return $n(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function g0(e){let n=(l)=>eT(l)&&!De(l);if(!e.some(n))return e;let r=[],s=[],i=()=>{s.length>0&&(r.push(s),s=[])};for(let l of e)n(l)?(i(),r.push(Q(l)?l.getChildren():[l])):s.push(l);i();let a=[];for(let l of r)a.length>0&&a.push(fn()),a.push(...l);return a}var Qw=dt({$import:(e,n)=>{let r=n.getAttribute("aria-checked"),s=bo(r==="true"||r!=="false"&&void 0);return Qn(s,n),Tn(s,n),[s.splice(0,0,g0(f0(s,e.$importChildren(n))))]},match:ft.tag("li"),name:"@lexical/list/li"});function n0(e,n,r){let s=ah(r,"input")?r:r.querySelector('input[type="checkbox"]');if(!s||s.getAttribute("type")!=="checkbox")return[];let i=bo(s.hasAttribute("checked"));return Qn(i,n),Tn(i,n),[i.splice(0,0,g0(f0(i,e.$importChildren(n))))]}var ek={$accepts:(e)=>Le(e)||De(e),$packageRun:(e)=>[bo().splice(0,0,e)],name:"ListSchema"},p0=[dt({$import:(e,n,r)=>{let s=n.querySelector(':scope > input[type="checkbox"]');return s?n0(e,n,s):r()},match:ft.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),dt({$import:(e,n,r)=>{let s=n.querySelector(":scope > .checkbox-wrapper");if(!s)return r();let i=s.querySelector(':scope > input[type="checkbox"]');return i?n0(e,n,i):r()},match:ft.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Zw,Qw],h0=bn("UPDATE_LIST_START_COMMAND"),m0=bn("INSERT_UNORDERED_LIST_COMMAND"),_0=bn("INSERT_ORDERED_LIST_COMMAND"),x0=bn("REMOVE_LIST_COMMAND");function C0(e,n){return Me(e.registerCommand(_0,()=>(Nd("number"),!0),Be),e.registerCommand(h0,(r)=>{let{listNodeKey:s,newStart:i}=r,a=Mt(s);return!!De(a)&&(a.getListType()==="number"&&(a.setStart(i),i0(a)),!0)},Be),e.registerCommand(m0,()=>(Nd("bullet"),!0),Be),e.registerCommand(x0,()=>(s0(),!0),Be),e.registerCommand(jr,()=>a0(!!(n&&n.restoreNumbering)),Be),e.registerCommand(Oi,(r)=>{let s=X();if(!G(s)||!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();for(;!Le(a);){if(a.getPreviousSibling()!==null)return!1;let l=a.getParent();if(l===null)return!1;a=l}return!(!Le(a)||!a.collapseAtStart(s))&&(r.preventDefault(),!0)},eu),e.registerNodeTransform(Ys,(r)=>{let s=r.getFirstChild();if(s){if(re(s)){let i=s.getStyle(),a=s.getFormat();r.getTextStyle()!==i&&r.setTextStyle(i),r.getTextFormat()!==a&&r.setTextFormat(a)}}else{let i=X();G(i)&&(i.style!==r.getTextStyle()||i.format!==r.getTextFormat())&&i.isCollapsed()&&r.is(i.anchor.getNode())&&r.setTextStyle(i.style).setTextFormat(i.format)}}),e.registerNodeTransform(In,(r)=>{let s=r.getParent();if(Le(s)&&r.is(s.getFirstChild())){let i=r.getStyle(),a=r.getFormat();i===s.getTextStyle()&&a===s.getTextFormat()||s.setTextStyle(i).setTextFormat(a)}}))}function y0(e){let n=(r)=>{let s=r.getParent();if(De(r.getFirstChild())||!De(s))return;let i=he(r,(a)=>Le(a)&&De(a.getParent())&&Le(a.getPreviousSibling()));if(i===null&&r.getIndent()>0)r.setIndent(0);else if(Le(i)){let a=i.getPreviousSibling();if(Le(a)){let l=function(d){let f=d,g=f.getFirstChild();for(;De(g);){let p=g.getLastChild();if(!Le(p))break;f=p,g=f.getFirstChild()}return f}(a),c=l.getParent();if(De(c)){let d=Sd(c);d+1<Sd(s)&&r.setIndent(d)}}}};return e.registerNodeTransform(Zi,(r)=>{let s=[r];for(;s.length>0;){let i=s.shift();if(De(i)){for(let a of i.getChildren())if(Le(a)){n(a);let l=a.getFirstChild();De(l)&&s.push(l)}}}})}var Th=_e({build:(e,n,r)=>wt(n),config:We({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[lo,nn(Xo,{rules:p0})],name:"@lexical/list/List",nodes:()=>[Zi,Ys],register(e,n,r){let s=r.getOutput();return Me(Nt(()=>C0(e,{restoreNumbering:s.shouldPreserveNumbering.value})),Nt(()=>s.hasStrictIndent.value?y0(e):void 0))}}),tk=_e({build:(e,n)=>wt(n),config:We({disableTakeFocusOnClick:!1}),dependencies:[Th],name:"@lexical/list/CheckList",register:(e,n,r)=>u0(e,r.getOutput())}),nk=_e({dependencies:[Th],name:"@lexical/list/Import"});var Et=bh,{$createListItemNode:S0,$createListNode:N0,$getListDepth:Tz,$handleListInsertParagraph:bz,$insertList:vz,$isListItemNode:vh,$isListNode:vo,$removeList:Oz,CheckListExtension:Az,INSERT_CHECK_LIST_COMMAND:E0,INSERT_ORDERED_LIST_COMMAND:T0,INSERT_UNORDERED_LIST_COMMAND:b0,ListExtension:Rz,ListImportExtension:Mz,ListImportRules:Dz,ListItemNode:ns,ListNode:qo,ListSchema:$z,REMOVE_LIST_COMMAND:Ed,UPDATE_LIST_START_COMMAND:wz,registerCheckList:v0,registerList:Oh,registerListStrictIndentTransform:O0}=Et;var Ah={};ke(Ah,{ListPlugin:()=>ok});S();function ok({hasStrictIndent:e=!1,shouldPreserveNumbering:n=!1}){let[r]=st();return m(()=>{if(!r.hasNodes([qo,ns]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),m(()=>Me(Oh(r,{restoreNumbering:n}),e?O0(r):()=>{}),[r,e,n]),function(s){m(()=>Oh(s),[s])}(r),null}var rk=Ah,A0=rk.ListPlugin;var Rh={};ke(Rh,{CheckListPlugin:()=>sk});S();function sk({disableTakeFocusOnClick:e=!1}){let[n]=st();return m(()=>v0(n,{disableTakeFocusOnClick:e}),[n,e]),null}var ik=Rh,R0=ik.CheckListPlugin;var Mh={};ke(Mh,{TabIndentationPlugin:()=>ak,registerTabIndentation:()=>Yu});S();function ak({maxIndent:e,$canIndent:n}){let[r]=st();return m(()=>Yu(r,e,n),[r,e,n]),null}var M0=Mh,{TabIndentationPlugin:D0,registerTabIndentation:Vz}=M0;var Ih={};ke(Ih,{$createAutoLinkNode:()=>kh,$createLinkNode:()=>Kl,$isAutoLinkNode:()=>mn,$isLinkNode:()=>Pn,$toggleLink:()=>Td,AutoLinkExtension:()=>Ck,AutoLinkNode:()=>zl,ClickableLinkExtension:()=>fk,LinkExtension:()=>Od,LinkImportExtension:()=>dk,LinkImportRules:()=>P0,LinkNode:()=>os,TOGGLE_LINK_COMMAND:()=>bd,autoLinkEmailMatcher:()=>hk,autoLinkUrlMatcher:()=>pk,createLinkMatcherWithRegExp:()=>z0,formatUrl:()=>Dh,registerAutoLink:()=>X0,registerClickableLink:()=>K0,registerLink:()=>B0});var w0=new Set(["http:","https:","mailto:","sms:","tel:"]);class os extends ct{__url;__target;__rel;__title;$config(){return this.config("link",{extends:ct,importDOM:{a:()=>({conversion:ck,priority:1})}})}constructor(e="",n={},r){super(r);let{target:s=null,rel:i=null,title:a=null}=n;this.__url=e,this.__target=s,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let n=Xe().createElement("a");return this.updateLinkDOM(null,n,e),et(n,e.theme.link),n}updateLinkDOM(e,n,r){if(ki(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(let s of["target","rel","title"]){let i=`__${s}`,a=this[i];e&&e[i]===a||(a?n[s]=a:n.removeAttribute(s))}}}updateDOM(e,n,r){return this.updateLinkDOM(e,n,r),!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 n=e;e=Dh(e);try{let r=new URL(Dh(e));if(!w0.has(r.protocol))return"about:blank"}catch(r){let s=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(s!=null&&!w0.has(`${s[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 n=this.getWritable();return n.__url=e,n}getTarget(){return this.getLatest().__target}setTarget(e){let n=this.getWritable();return n.__target=e,n}getRel(){return this.getLatest().__rel}setRel(e){let n=this.getWritable();return n.__rel=e,n}getTitle(){return this.getLatest().__title}setTitle(e){let n=this.getWritable();return n.__title=e,n}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!G(n))return!1;let s=n.anchor.getNode(),i=n.focus.getNode();return(this.is(s)||this.isParentOf(s))&&(this.is(i)||this.isParentOf(i))&&n.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 k0(e){let n=dn(e,"next");return[n,n.getFlipped()]}function I0(e,n){for(let r of n)if(r.origin.isAttached()){let s=It(r);return void Ho(e,s)}}function lk(e){let n=X(),r=null,s=null;function i(){G(n)&&(I0(n.anchor,r),I0(n.focus,s),zo(n))}G(n)&&(r=k0(n.anchor),s=k0(n.focus));let a=!1;for(let c of bt(e,"next")){let d=c.origin;if(Q(d)&&!d.isInline()){let f=d.getChildren();if(f.length>0){let g=jt(e);g.append(...f),d.append(g),a=!0}zr(d,Uo(c),{$shouldSplit:()=>!1})}}function l(c,d,f){let[g,p]=c,h=(C)=>So(C)&&C.origin.is(d);if(!h(g)&&!h(p))return c;let x=It(bt(f,"next"));return[x,x.getFlipped()]}if(e.isAttached()){let c=e.getPreviousSibling();if(Pn(c)&&c.shouldMergeAdjacentLink(e))return r&&(r=l(r,c,e)),s&&(s=l(s,c,e)),c.append(...e.getChildren()),e.remove(),void i();let d=e.getNextSibling();Pn(d)&&e.shouldMergeAdjacentLink(d)&&(r&&(r=l(r,e,d)),s&&(s=l(s,e,d)),e.append(...d.getChildren()),d.remove(),a=!0)}if(a){if(!e.canBeEmpty()&&e.isEmpty()){let c=e.getParent();e.remove(),c&&c.isEmpty()&&c.remove()}i()}}function ck(e){let n=null;if(ki(e)){let r=e.textContent;(r!==null&&r!==""||e.children.length>0)&&(n=Kl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:n}}function Kl(e="",n){return cn(new os(e,n))}function Pn(e){return e instanceof os}class zl extends os{__isUnlinked;constructor(e="",n={},r){super(e,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:os})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let n=this.getWritable();return n.__isUnlinked=e,n}createDOM(e){return this.__isUnlinked?Xe().createElement("span"):super.createDOM(e)}updateDOM(e,n,r){return super.updateDOM(e,n,r)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,n=!0){let r=kh(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}}function kh(e="",n){return cn(new zl(e,n))}function mn(e){return e instanceof zl}var bd=bn("TOGGLE_LINK_COMMAND");function L0(e,n){if(e.type==="element"){let r=e.getNode();return Q(r)||function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);throw a.search=l.toString(),Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),r.getChildren()[e.offset+n]||null}return null}function Td(e,n={}){let r;if(e&&typeof e=="object"){let{url:g,...p}=e;r=g,n={...p,...n}}else r=e;let{target:s,title:i}=n,a=n.rel===void 0?"noreferrer":n.rel,l=X();if(l===null||!G(l)&&!Ze(l))return;if(Ze(l)){let g=l.getNodes();if(g.length===0)return;return void g.forEach((p)=>{if(r===null){let h=he(p,(x)=>!mn(x)&&Pn(x));h&&(h.insertBefore(p),h.getChildren().length===0&&h.remove())}else{let h=he(p,(x)=>!mn(x)&&Pn(x));if(h)h.setURL(r),s!==void 0&&h.setTarget(s),a!==void 0&&h.setRel(a);else{let x=Kl(r,{rel:a,target:s});p.insertBefore(x),x.append(p)}}})}if(l.isCollapsed()&&r===null)for(let g of l.getNodes()){let p=he(g,(h)=>!mn(h)&&Pn(h));return void(p!==null&&(p.getParentOrThrow().splice(p.getIndexWithinParent(),0,p.getChildren()),p.remove()))}let c=l.extract();if(r===null){let g=new Set;return void c.forEach((p)=>{let h=he(p,(x)=>!mn(x)&&Pn(x));if(h!==null){let x=h.getKey();if(g.has(x))return;(function(C,y){let N=new Set(y.filter((K)=>C.isParentOf(K)).map((K)=>K.getKey())),T=C.getChildren(),b=(K)=>N.has(K.getKey())||Q(K)&&y.some((U)=>C.isParentOf(U)&&K.isParentOf(U)),v=T.filter(b);if(v.length===T.length)return T.forEach((K)=>C.insertBefore(K)),void C.remove();let O=T.findIndex(b),k=T.findLastIndex(b),M=O===0,z=k===T.length-1;if(M)v.forEach((K)=>C.insertBefore(K));else if(z)for(let K=v.length-1;K>=0;K--)C.insertAfter(v[K]);else{for(let U=v.length-1;U>=0;U--)C.insertAfter(v[U]);let K=T.slice(k+1);if(K.length>0){let U=jt(C);v[v.length-1].insertAfter(U),K.forEach((J)=>U.append(J))}}})(h,c),g.add(x)}})}let d=new Set,f=(g)=>{d.has(g.getKey())||(d.add(g.getKey()),g.setURL(r),s!==void 0&&g.setTarget(s),a!==void 0&&g.setRel(a),i!==void 0&&g.setTitle(i))};if(c.length===1){let g=c[0],p=he(g,Pn);if(p!==null)return f(p)}(function(g){let p=X();if(!G(p))return g();let h=zo(p),x=h.isBackward(),C=L0(h.anchor,x?-1:0),y=L0(h.focus,x?0:-1),N=g();if(C||y){let T=X();if(G(T)){let b=T.clone();if(C){let v=C.getParent();v&&b.anchor.set(v.getKey(),C.getIndexWithinParent()+(x?1:0),"element")}if(y){let v=y.getParent();v&&b.focus.set(v.getKey(),y.getIndexWithinParent()+(x?0:1),"element")}mt(zo(b))}}})(()=>{let g=null;for(let p of c){if(!p.isAttached())continue;let h=he(p,Pn);if(h){f(h);continue}if(Q(p)){if(!p.isInline())continue;if(Pn(p)){if(!(mn(p)||g!==null&&g.getParentOrThrow().isParentOf(p))){f(p),g=p;continue}for(let C of p.getChildren())p.insertBefore(C);p.remove();continue}}let x=p.getPreviousSibling();Pn(x)&&x.is(g)?x.append(p):(g=Kl(r,{rel:a,target:s,title:i}),p.insertAfter(g),g.append(p))}})}var uk=/^\+?[0-9\s()-]{5,}$/;function Dh(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 P0=[dt({$import:(e,n)=>{if(!n.textContent&&n.children.length===0)return[];let r=n.getAttribute("href")||"",s={rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")};return qE(e.$importChildren(n),()=>Kl(r,s))},match:ft.tag("a"),name:"@lexical/link/a"})];function B0(e,n){return Me(e.registerNodeTransform(os,lk),e.registerCommand(bd,(r)=>{let s=n.validateUrl.peek(),i=n.attributes.peek();if(r===null)return Td(null),!0;if(typeof r=="string")return!(s!==void 0&&!s(r))&&(Td(r,i),!0);{let{url:a,target:l,rel:c,title:d}=r;return Td(a,{...i,rel:c,target:l,title:d}),!0}},be),Nt(()=>{let r=n.validateUrl.value;if(!r)return;let s=n.attributes.value;return e.registerCommand(Di,(i)=>{let a=X();if(!G(a)||a.isCollapsed()||!Fn(i,ClipboardEvent))return!1;if(i.clipboardData===null)return!1;let l=i.clipboardData.getData("text");if(!r(l))return!1;return!a.getNodes().some((c)=>Q(c)||re(c)&&!c.isSimpleText())&&(e.dispatchCommand(bd,{...s,url:l}),i.preventDefault(),!0)},Be)}))}var Od=_e({build:(e,n,r)=>wt(n),config:{attributes:void 0,validateUrl:void 0},dependencies:[lo,nn(Xo,{rules:P0})],mergeConfig(e,n){let r=zt(e,n);return e.attributes&&(r.attributes=zt(e.attributes,r.attributes)),r},name:"@lexical/link/Link",nodes:()=>[os],register:(e,n,r)=>B0(e,r.getOutput())}),dk=_e({dependencies:[Od],name:"@lexical/link/Import"});function K0(e,n,r={}){let s=(a)=>{let l=a.target;if(!ro(l))return;let c=vu(l);if(c===null)return;let d=null,f=null,g=!1;if(c.update(()=>{let x=vt(l);if(x!==null){let C=he(x,Q);if(!n.disabled.peek())if(Pn(C))g=mn(C)&&C.getIsUnlinked(),d=C.sanitizeUrl(C.getURL()),f=C.getTarget();else{let y=function(N,T){let b=N;for(;b!=null;){if(T(b))return b;b=b.parentNode}return null}(l,ki);y!==null&&(d=y.href,f=y.target)}}}),d===null||d===""||g)return;let p=e.read("latest",X);if(G(p)&&!p.isCollapsed())return void a.preventDefault();let h=a.type==="auxclick"&&a.button===1;window.open(d,n.newTab.peek()||h||a.metaKey||a.ctrlKey||f==="_blank"?"_blank":"_self"),a.preventDefault()},i=(a)=>{a.button===1&&s(a)};return e.registerRootListener((a)=>{if(a)return Jr(a,{click:s,mouseup:i},r)})}var fk=_e({build:(e,n,r)=>wt(n),config:We({disabled:!1,newTab:!1}),dependencies:[Od],name:"@lexical/link/ClickableLink",register:(e,n,r)=>K0(e,r.getOutput())});function z0(e,n=(r)=>r){return(r)=>{let s=e.exec(r);return s===null?null:{index:s.index,length:s[0].length,text:s[0],url:n(s[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 n=gk.exec(e);if(n===null)return null;let r=n[0],s=0;for(let i of r)i==="("?s++:i===")"&&s--;for(;s<0&&r.endsWith(")");)r=r.slice(0,-1),s++;return{index:n.index,length:r.length,text:r,url:r.startsWith("http")?r:`https://${r}`}},hk=z0(/(([^<>()[\]\\.,;:\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 $h(e,n){for(let r=0;r<n.length;r++){let s=n[r](e);if(s)return s}return null}var U0=/[.,;\s]/;function vd(e,n){return n.test(e)}function W0(e,n){return vd(e[e.length-1],n)}function wh(e,n){return vd(e[0],n)}function j0(e,n){let r=e.getPreviousSibling();return Q(r)&&(r=r.getLastDescendant()),r===null||He(r)||re(r)&&W0(r.getTextContent(),n)}function Y0(e,n){let r=e.getNextSibling();return Q(r)&&(r=r.getFirstDescendant()),r===null||He(r)||re(r)&&wh(r.getTextContent(),n)}function mk(e,n,r,s,i){if(!(e>0?vd(s[e-1],r):j0(i[0],r)))return!1;return n<s.length?vd(s[n],r):Y0(i[i.length-1],r)}function _k(e,n,r){let s=[],i=[],a=[],l=0,c=0,d=[...e];for(;d.length>0;){let f=d[0],g=f.getTextContent().length,p=c;c+g<=n?(s.push(f),l+=g):p>=r?a.push(f):i.push(f),c+=g,d.shift()}return[l,s,i,a]}function xk(e,n,r,s){let i=kh(s.url,s.attributes);if(e.length===1){let a,l=e[0];n===0?[a,l]=l.splitText(r):[,a,l]=l.splitText(n,r);let c=yt(s.text);return c.setFormat(a.getFormat()),c.setDetail(a.getDetail()),c.setStyle(a.getStyle()),i.append(c),a.replace(i),l}if(e.length>1){let a=e[0],l,c=a.getTextContent().length;n===0?l=a:[,l]=a.splitText(n);let d=[],f;for(let x=1;x<e.length;x++){let C=e[x],y=C.getTextContent().length,N=c;if(N<r)if(c+y<=r)d.push(C);else{let[T,b]=C.splitText(r-N);d.push(T),f=b}c+=y}let g=X(),p=g?g.getNodes().find(re):void 0,h=yt(l.getTextContent());return h.setFormat(l.getFormat()),h.setDetail(l.getDetail()),h.setStyle(l.getStyle()),i.append(h,...d),p&&p===l&&(G(g)?h.select(g.anchor.offset,g.focus.offset):Ze(g)&&h.select(0,h.getTextContent().length)),l.replace(i),f}}function F0(e,n,r,s){let i=e.getChildren(),a=i.length;for(let f=0;f<a;f++){let g=i[f];if(!re(g)||!g.isSimpleText())return Bl(e),void r(null,e.getURL())}let l=e.getTextContent(),c=$h(l,n);if(c===null||c.text!==l)return Bl(e),void r(null,e.getURL());if(!j0(e,s)||!Y0(e,s))return Bl(e),void r(null,e.getURL());let d=e.getURL();if(d!==c.url&&(e.setURL(c.url),r(c.url,d)),c.attributes){let f=e.getRel();f!==c.attributes.rel&&(e.setRel(c.attributes.rel||null),r(c.attributes.rel||null,f));let g=e.getTarget();g!==c.attributes.target&&(e.setTarget(c.attributes.target||null),r(c.attributes.target||null,g))}}function Bl(e){let n=e.getChildren();for(let r=n.length-1;r>=0;r--)e.insertAfter(n[r]);return e.remove(),n.map((r)=>r.getLatest())}var V0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:U0};function X0(e,n=V0){let{matchers:r,changeHandlers:s,excludeParents:i,separatorRegex:a=U0}=n,l=(c,d)=>{for(let f of s)f(c,d)};return Me(e.registerNodeTransform(In,(c)=>{let d=c.getParentOrThrow(),f=c.getPreviousSibling();if(mn(d))F0(d,r,l,a);else if(!Pn(d)&&!i.some((g)=>g(d))){if(c.isSimpleText()&&(wh(c.getTextContent(),a)||!mn(f))){let g=function(p){let h=[p],x=p.getNextSibling();for(;x!==null&&re(x)&&x.isSimpleText()&&(h.push(x),!/[\s]/.test(x.getTextContent()));)x=x.getNextSibling();return h}(c);(function(p,h,x,C){for(let O of p){let k=O.getParent();if(mn(k)&&!k.getIsUnlinked())return}let y=[...p],N=y.map((O)=>O.getTextContent()).join(""),T,b=N,v=0;for(;(T=$h(b,h))&&T!==null;){let O=T.index,k=O+T.length;if(mk(v+O,v+k,C,N,y)){let[M,,z,K]=_k(y,v+O,v+k),U=!1;for(let W of z){let ne=W.getParent();if(mn(ne)&&!ne.getIsUnlinked()){U=!0;break}}if(U){v+=k,b=b.substring(k);continue}let J=xk(z,v+O-M,v+k-M,T);y=J?[J,...K]:K,x(T.url,null),v=0}else v+=k;b=b.substring(k)}})(g,r,l,a)}(function(g,p,h,x){let C=g.getParent(),y=g.getPreviousSibling(),N=g.getNextSibling(),T=g.getTextContent();if(!mn(C)||C.getIsUnlinked()){if(mn(y)&&!y.getIsUnlinked()&&y.is(g.getPreviousSibling())&&g.getParent()===y.getParent()){if(!wh(T,x))return Bl(y),void h(null,y.getURL());if(b=T,y.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(b):/^\.[a-zA-Z0-9]{1,}/.test(b)){let v=y.getTextContent()+T,O=$h(v,p);O!==null&&O.text===v&&(y.append(g),F0(y,p,h,x),h(null,y.getURL()))}}var b;!mn(N)||N.getIsUnlinked()||W0(T,x)||N.is(g.getNextSibling())&&g.getParent()===N.getParent()&&(Bl(N),h(null,N.getURL()))}})(c,r,l,a)}}),e.registerCommand(bd,(c)=>{let d=X();if(c!==null||!G(d))return!1;return d.extract().forEach((f)=>{let g=f.getParent();mn(g)&&(g.setIsUnlinked(!g.getIsUnlinked()),g.markDirty())}),!1},Be))}var Ck=_e({config:V0,dependencies:[Od],mergeConfig(e,n){let r=zt(e,n);for(let s of["matchers","changeHandlers","excludeParents"]){let i=n[s];Array.isArray(i)&&(r[s]=[...e[s],...i])}return r},name:"@lexical/link/AutoLink",nodes:[zl],register:X0});var Ft=Ih,{$createAutoLinkNode:eU,$createLinkNode:q0,$isAutoLinkNode:J0,$isLinkNode:Qi,$toggleLink:tU,AutoLinkExtension:nU,AutoLinkNode:Z0,ClickableLinkExtension:oU,LinkExtension:rU,LinkImportExtension:sU,LinkImportRules:iU,LinkNode:ea,TOGGLE_LINK_COMMAND:Lh,autoLinkEmailMatcher:aU,autoLinkUrlMatcher:lU,createLinkMatcherWithRegExp:cU,formatUrl:uU,registerAutoLink:dU,registerClickableLink:fU,registerLink:Q0}=Ft;var Fh={};ke(Fh,{LinkPlugin:()=>yk});S();function yk({validateUrl:e,attributes:n}){let[r]=st();return m(()=>{if(!r.hasNodes([ea]))throw Error("LinkPlugin: LinkNode not registered on editor")}),m(()=>Q0(r,wt({attributes:n,validateUrl:e})),[r,e,n]),null}var Sk=Fh,eb=Sk.LinkPlugin;var Ph={};ke(Ph,{AutoFocusPlugin:()=>Nk});S();function Nk({defaultSelection:e}){let[n]=st();return m(()=>{n.focus(()=>{let r=n.getRootElement(),s=r!==null?No(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,n]),null}var Ek=Ph,tb=Ek.AutoFocusPlugin;var Wh={};ke(Wh,{$createCodeHighlightNode:()=>Uh,$createCodeNode:()=>Oo,$getCodeLineDirection:()=>cb,$getEndOfCodeInLine:()=>db,$getFirstCodeNodeOfLine:()=>rs,$getLastCodeNodeOfLine:()=>Xs,$getStartOfCodeInLine:()=>ub,$isCodeHighlightNode:()=>Ut,$isCodeNode:()=>On,$outdentLeadingSpaces:()=>fb,$plainifyCodeContent:()=>Tk,CodeExtension:()=>Hh,CodeHighlightNode:()=>Gl,CodeImportExtension:()=>kk,CodeImportRules:()=>yb,CodeIndentExtension:()=>Ik,CodeNode:()=>Wl,DEFAULT_CODE_LANGUAGE:()=>gb,getDefaultCodeLanguage:()=>bk,registerCodeIndentation:()=>Nb});function Rd(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lb(e,n){let r=e;for(let s=it(e,n);s&&(Ut(s.origin)||Yt(s.origin));s=s.getAdjacentCaret())r=s.origin;return r}function rs(e){return lb(e,"previous")}function Xs(e){return lb(e,"next")}function cb(e){let n=rs(e),r=Xs(e),s=n;for(;s!==null;){if(Ut(s)){let a=yS(s.getTextContent());if(a!==null)return a}if(s===r)break;s=s.getNextSibling()}let i=n.getParent();if(Q(i)){let a=i.getDirection();if(a==="ltr"||a==="rtl")return a}return null}function ub(e,n){let r=null,s=null,i=e,a=n,l=e.getTextContent();for(;;){if(a===0){let f=i.getPreviousSibling();if(f===null){i=null;break}if(Ut(f)||Yt(f)||He(f)||Rd(167),i=f,He(i)){r={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),l=i.getTextContent()}else a--;let d=l[a];Ut(i)&&d!==" "&&(s={node:i,offset:a})}if(s!==null)return s;let c=null;if(n<e.getTextContentSize())Ut(e)&&(c=e.getTextContent()[n]);else{let d=e.getNextSibling();Ut(d)&&(c=d.getTextContent()[0])}if(c!==null&&c!==" ")return r;{let d=function(f,g){let p=f,h=g,x=f.getTextContent(),C=f.getTextContentSize();for(;;){if(!Ut(p)||h===C){if(p=p.getNextSibling(),p===null||He(p))return null;Ut(p)&&(h=0,x=p.getTextContent(),C=p.getTextContentSize())}if(Ut(p)){if(x[h]!==" ")return{node:p,offset:h};h++}}}(e,n);return d!==null?d:r}}function db(e){let n=Xs(e);return He(n)&&Rd(168),n}function Tk(e){let n=[];return Fi(e,{linebreak:()=>n.push(fn()),tab:()=>n.push(gn()),text:(r)=>n.push(Uh(r))}),n}function fb(e,n,r){if(!Number.isInteger(n)||n<=0)return!1;let s=e.getTextContent(),i=/^ +/.exec(s);if(!i)return!1;let a=Math.min(n,i[0].length),l=e.getKey(),c=r.anchor.key===l&&r.anchor.type==="text"?r.anchor.offset:null,d=r.focus.key===l&&r.focus.type==="text"?r.focus.offset:null;return e.spliceText(0,a,""),c!==null&&r.anchor.set(l,Math.max(0,c-a),"text"),d!==null&&r.focus.set(l,Math.max(0,d-a),"text"),!0}var gb="javascript",bk=()=>gb;function pb(e,n){for(let r of e.childNodes){if(ye(r)&&r.tagName===n)return!0;if(pb(r,n))return!0}return!1}var Hl="data-language",Ul="data-highlight-language",Ad="data-theme",vk=()=>{};class Wl extends ct{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:ct,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||pb(e,"BR"))?{conversion:nb,priority:1}:null,div:()=>({conversion:Ok,priority:1}),pre:()=>({conversion:nb,priority:0}),table:(e)=>Bh(e)?{conversion:Ak,priority:3}:null,td:(e)=>{let n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&Bh(r)?{conversion:ob,priority:3}:null},tr:(e)=>{let n=e.closest("table");return n&&Bh(n)?{conversion:ob,priority:3}:null}}})}constructor(e=void 0,n){super(n),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 n=Xe().createElement("code");et(n,e.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Hl,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ul,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),n}updateDOM(e,n,r){let s=this.__language,i=e.__language;s?s!==i&&n.setAttribute(Hl,s):i&&n.removeAttribute(Hl);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&s?s!==i&&n.setAttribute(Ul,s):n.removeAttribute(Ul):a&&s&&n.setAttribute(Ul,s);let l=this.__theme,c=e.__theme;l?l!==c&&n.setAttribute(Ad,l):c&&n.removeAttribute(Ad);let d=this.__style,f=e.__style;return d!==f&&fr(n.style,d,f),!1}exportDOM(e){let n=Xe().createElement("pre");et(n,e._config.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Hl,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ul,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!io(Ge(),"@lexical/code")){vk();let a=hb(e);if(a)return a}let{anchor:r,focus:s}=e,i=(r.isBefore(s)?r:s).getNode();if(re(i)){let a=rs(i),l=[];for(;;)if(Yt(a))l.push(gn()),a=a.getNextSibling();else{if(!Ut(a))break;{let x=0,C=a.getTextContent(),y=a.getTextContentSize();for(;x<y&&C[x]===" ";)x++;if(x!==0&&l.push(Uh(" ".repeat(x))),x!==y)break;a=a.getNextSibling()}}let c=i.splitText(r.offset)[0],d=r.offset===0?0:1,f=c.getIndexWithinParent()+d,g=i.getParentOrThrow(),p=[fn(),...l];g.splice(f,0,p);let h=l[l.length-1];h?h.select():r.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(On(i)){let{offset:a}=e.anchor;i.splice(a,0,[fn()]),i.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}setLanguage(e){let n=this.getWritable();return n.__language=e||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let n=this.getWritable();return n.__isSyntaxHighlightSupported=e,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let n=this.getWritable();return n.__theme=e||void 0,n}getTheme(){return this.getLatest().__theme}}function Oo(e,n){return jc(Wl).setLanguage(e).setTheme(n)}function On(e){return e instanceof Wl}function nb(e){return{node:Oo(e.getAttribute(Hl))}}function Ok(e){let n=e,r=rb(n);return r||function(s){let i=s.parentElement;for(;i!==null;){if(rb(i))return!0;i=i.parentElement}return!1}(n)?{node:r?Oo():null}:{node:null}}function Ak(){return{node:Oo()}}function ob(){return{node:null}}function rb(e){return e.style.fontFamily.match("monospace")!==null}function Bh(e){return e.classList.contains("js-file-line-container")}function hb(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type==="element"){let r=n.getNode();if(On(r)){let s=r.getChildrenSize();if(s>=2&&n.offset===s){let i=r.getLastChild();if(He(i)&&He(i.getPreviousSibling())){let a=Se();return r.splice(s-2,2,[]).insertAfter(a,!1),a.select(),a}}}}return null}class Gl extends In{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}$config(){return this.config("code-highlight",{extends:In})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let n=this.getWritable();return n.__highlightType=e||void 0,n}canHaveFormat(){return!1}createDOM(e){let n=super.createDOM(e),r=Kh(e.theme,this.__highlightType);return et(n,r),n}updateDOM(e,n,r){let s=super.updateDOM(e,n,r),i=Kh(r.theme,e.__highlightType),a=Kh(r.theme,this.__highlightType);return i!==a&&(i&&sn(n,i),a&&et(n,a)),s}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 Oo()}}function Kh(e,n){return n&&e&&e.codeHighlight&&e.codeHighlight[n]}function Uh(e="",n){return cn(new Gl(e,n))}function Ut(e){return e instanceof Gl}var mb="data-language";function _b(e){return e.style.fontFamily.match("monospace")!==null}function zh(e){let n=e.parentElement;for(;n!==null;){if(_b(n))return!0;n=n.parentElement}return!1}var Rk=ih([dt({$import:(e,n)=>e.$importChildren(n),match:ft.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Mk=dt({$import:(e,n)=>[Oo(n.getAttribute(mb)).splice(0,0,e.$importChildren(n))],match:ft.tag("pre"),name:"@lexical/code/pre"}),Dk=dt({$import:(e,n,r)=>{let s=n.textContent||"";return/\r?\n/.test(s)||n.querySelector("br")!==null?[Oo(n.getAttribute(mb)).splice(0,0,e.$importChildren(n))]:r()},match:ft.tag("code"),name:"@lexical/code/code-multiline"});function ta(e){if(!ye(e))return!1;let n=e.style.fontFamily,r=e.style.whiteSpace;return typeof n=="string"&&/monospace/i.test(n)&&typeof r=="string"&&r.startsWith("pre")}function xb(e){let n=!1,r=[],s="",i=!1,a=()=>{i&&(r.push(s),s="",i=!1)};for(let l of Array.from(e.childNodes))if(ye(l))l.tagName==="DIV"?(a(),r.push(l.textContent||""),n=!0):l.tagName==="BR"?(a(),r.push(""),n=!0):(s+=l.textContent||"",i=!0);else if(Fs(l)){let c=l.textContent||"";c.length>0&&(s+=c,i=!0)}return a(),n?r:null}function Cb(e){for(let n of Array.from(e.children)){if(ye(n)&&ta(n)){if(xb(n)!==null)return!0;let r=n.nextElementSibling;if(r&&ta(r))return!0;continue}if(Cb(n))return!0}return!1}var $k=ih([dt({$import:(e,n,r)=>{if(!ta(n)||zh(n))return r();let s=xb(n);return s===null||s.length===0?r():[Oo().splice(0,0,il(s.join(`
|
|
16
|
-
`)))]},match:ft.tag("div"),name:"@lexical/code/vscode-wrapper"}),dt({$import:(e,n,r)=>{if(!ta(n)||
|
|
17
|
-
`)))]},match:ft.tag("div","br"),name:"@lexical/code/vscode-line-run"})]),wk=dt({$import:(e,n,r)=>
|
|
18
|
-
`){let a=gn(),l=fn(),c=r.isBackward()?"previous":"next";return r.insertNodes([a,l]),wn(dr(Jn(Xc(a,"next",0),It(it(l,"next"))),c)),!0}for(let a=0;a<i;a++){let l=s[a];if(l.length>0){let c=l[0];if(a===0&&(c=rs(c)),e===to){let d=gn();if(c.insertBefore(d),a===0){let f=r.isBackward()?"focus":"anchor",g=qn(c.getKey(),0,"text");r[f].is(g)&&r[f].set(d.getKey(),0,"text")}}else Yt(c)?c.remove():n!==void 0&&Ut(c)&&
|
|
19
|
-
`)},
|
|
14
|
+
`);let d=c.length;if(!re(s)||i>=d){let f=s.getParent();s.remove(),f==null||f.getChildrenSize()!==0||yo(f)||f.remove(),i-=d+l,s=a}else{let f=s.getKey(),g=e.read("latest",()=>{let x=Mt(f);return re(x)&&x.isSimpleText()?x.getTextContent():null}),p=d-i,h=c.slice(0,p);if(g!==null&&g!==c){let x=En(),y=s;if(s.isSimpleText())s.setTextContent(g);else{let N=yt(g);s.replace(N),y=N}if(j(x)&&x.isCollapsed()){let N=x.anchor.offset;y.select(N,N)}}else if(s.isSimpleText()){let x=n.key===f,y=n.offset;y<i&&(y=d);let N=x?y-i:0,E=x?y:p;if(x&&N===0){let[T]=s.splitText(N,E);T.remove()}else{let[,T]=s.splitText(N,E);T.remove()}}else{let x=yt(h);s.replace(x)}i=0}}}var RM=()=>{};function $u(e,n){(j(e)?e.isCollapsed():re(e)||Q(e))||ep(280);let r=Xr(j(e)?e.style:re(e)?e.getStyle():e.getTextStyle()),s=$S(Object.entries(n).reduce((i,[a,l])=>(typeof l=="function"?i[a]=l(r[a],e):l===null?delete i[a]:i[a]=l,i),{...r}));j(e)||re(e)?e.setStyle(s):e.setTextStyle(s)}function MM(e,n){if(j(e)&&e.isCollapsed()){$u(e,n);let s=e.anchor.getNode();Q(s)&&s.isEmpty()&&$u(s,n)}kS((s)=>{$u(s,n)});let r=e.getNodes();if(r.length>0){let s=new Set;for(let i of r){if(!Q(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let a=i.getKey();s.has(a)||(s.add(a),$u(i,n))}}}function kS(e){let n=X();if(!n)return;let r=new Map,s=(a)=>r.get(a.getKey())||[0,a.getTextContentSize()];if(j(n))for(let a of cr(n).getTextSlices())a&&r.set(a.caret.origin.getKey(),a.getSliceIndices());let i=n.getNodes();for(let a of i){if(!re(a)||!a.canHaveFormat())continue;let[l,c]=s(a);if(c!==l)if(Hg(a)||l===0&&c===a.getTextContentSize())e(a);else e(a.splitText(l,c)[l===0?0:1])}j(n)&&n.anchor.type==="text"&&n.focus.type==="text"&&n.anchor.key===n.focus.key&&IS(n)}function IS(e){if(e.isBackward()){let{anchor:n,focus:r}=e,{key:s,offset:i,type:a}=n;n.set(r.key,r.offset,r.type),r.set(s,i,a)}}function LS(e,n){let r=e.getFormatType(),s=e.getIndent();r!==n.getFormatType()&&n.setFormat(r),s!==n.getIndent()&&n.setIndent(s)}function FS(e,n,r){let s=dn(e,r);if(cl(s))return!1;for(;s;s=s.getParentCaret()){let i=s.getParentAtCaret();if(!i||s.getNodeAtCaret())return!1;if(n.is(i))return!0}return!1}function DM(e,n,r=LS){if(!e)return;let s=e.getStartEndPoints(),i=!1,a=null,l=new Map;if(s){let[c,d]=s,f=he(c.getNode(),pl);a=he(d.getNode(),pl);let g=e.isBackward()?"previous":"next";i=Q(a)&&!a.is(f)&&function(p,h,x){let y=p.getNode();return(!Q(y)||!y.isEmpty())&&FS(p,h,x)}(d,a,gS(g)),Q(f)&&l.set(f.getKey(),f),Q(a)&&!i&&l.set(a.getKey(),a)}for(let c of e.getNodes())if(Q(c)&&pl(c)){if(i&&c.is(a))continue;l.set(c.getKey(),c)}else if(!s){let d=he(c,pl);Q(d)&&l.set(d.getKey(),d)}for(let c of l.values()){let d=n();r(c,d),c.replace(d,!0)}}function DS(e){return e.getNode().isAttached()}function $M(e){let n=e;for(;n!==null&&!Dt(n);){let r=n.getLatest(),s=n.getParent();r.getChildrenSize()===0&&n.remove(!0),n=s}}function wM(e,n,r=null){let s=e.getStartEndPoints(),i=s?s[0]:null,a=e.getNodes(),l=a.length;if(i!==null&&(l===0||l===1&&i.type==="element"&&i.getNode().getChildrenSize()===0)){let f=i.type==="text"?i.getNode().getParentOrThrow():i.getNode(),g=f.getChildren(),p=n();return p.setFormat(f.getFormatType()),p.setIndent(f.getIndent()),g.forEach((h)=>p.append(h)),r&&(p=r.append(p)),void f.replace(p)}let c=null,d=[];for(let f=0;f<l;f++){let g=a[f];Dt(g)?(Qg(e,d,d.length,n,r),d=[],c=g):c===null||c!==null&&ll(g,c)?d.push(g):(Qg(e,d,d.length,n,r),d=[g])}Qg(e,d,d.length,n,r)}function Qg(e,n,r,s,i=null){if(n.length===0)return;let a=n[0],l=new Map,c=[],d=Q(a)?a:a.getParentOrThrow(),f=d.isInline()?d.getParentOrThrow():d,g=!1;for(;f!==null;){let N=f.getPreviousSibling();if(N!==null){f=N,g=!0;break}if(f=f.getParentOrThrow(),Dt(f))break}let p=new Set;for(let N=0;N<r;N++){let E=n[N];Q(E)&&E.getChildrenSize()===0&&p.add(E.getKey())}let h=new Set;for(let N=0;N<r;N++){let E=n[N],T=E.getParent();if(T!==null&&T.isInline()&&(T=T.getParent()),T!==null&&ul(E)&&!h.has(E.getKey())){let b=T.getKey();if(l.get(b)===void 0){let v=s();v.setFormat(T.getFormatType()),v.setIndent(T.getIndent()),c.push(v),l.set(b,v);let O=T.getChildren();v.splice(v.getChildrenSize(),0,O);for(let k of O)if(h.add(k.getKey()),Q(k))for(let M of k.getChildrenKeys())h.add(M);$M(T)}}else if(p.has(E.getKey())){Q(E)||ep(179);let b=s();b.setFormat(E.getFormatType()),b.setIndent(E.getIndent()),c.push(b),E.remove(!0)}}if(i!==null)for(let N=0;N<c.length;N++){let E=c[N];i.append(E)}let x=null;if(Dt(f))if(g)if(i!==null)f.insertAfter(i);else for(let N=c.length-1;N>=0;N--){let E=c[N];f.insertAfter(E)}else{let N=f,E=N.getFirstChild();if(Q(E)&&(f=E),E===null)if(i)N.append(i);else for(let T=0;T<c.length;T++){let b=c[T];N.append(b),x=b}else if(i!==null)E.insertBefore(i);else for(let T=0;T<c.length;T++){let b=c[T];E.insertBefore(b),x=b}}else if(i)f.insertAfter(i);else for(let N=c.length-1;N>=0;N--){let E=c[N];f.insertAfter(E),x=E}let y=En();j(y)&&DS(y.anchor)&&DS(y.focus)?mt(y.clone()):x!==null?x.selectEnd():e.dirty=!0}function PS(e){let n=BS(e);return n!==null&&n.writingMode==="vertical-rl"}function BS(e){let n=e.anchor.getNode();return Q(n)?tp(n):np(n)}function kM(e,n){let r=PS(e)?!n:n;op(e)&&(r=!r);let s=dn(e.focus,r?"previous":"next");if(cl(s))return!1;if(Hr(s)&&!Yt(s.origin)&&s.origin.isUnmergeable()){let i=s.getNodeAtCaret();if(re(i)&&!Yt(i))return!0}for(let i of bs(s)){if(Ko(i))return!i.origin.isInline();if(!Q(i.origin)){if(kt(i.origin))return!0;break}}return!1}function KS(e,n,r,s){e.modify(n?"extend":"move",r,s)}function op(e){let n=BS(e);return n!==null&&n.direction==="rtl"}function IM(e,n,r){let s=op(e),i;i=PS(e)||s?!r:r,KS(e,n,i,"character")}function LM(e,n,r){let s=e.getStyle(),i=Xr(s);return i!==null&&i[n]||r}function FM(e,n,r=""){let s=null,i=e.getNodes(),a,l;if(j(e)){if(e.isCollapsed()&&e.style!==""){let y=Xr(e.style);if(y!==null&&n in y)return y[n]}let{anchor:c,focus:d}=e,f=e.isBackward(),g=f?d.getNode():c.getNode(),p=f?c.getNode():d.getNode(),h=f?d.offset:c.offset,x=f?c.offset:d.offset;re(g)&&h===g.getTextContentSize()&&(a=g),x===0&&(l=p)}for(let c=0;c<i.length;c++){let d=i[c];if(re(d)&&!d.is(c===0?a:l)){let f=LM(d,n,r);if(s===null)s=f;else if(s!==f){s="";break}}}return s===null?r:s}var PM=Xr,BM=wS;var ut=rp,{$addNodeStyle:gF,$cloneWithProperties:pF,$copyBlockFormatIndent:hF,$ensureForwardRangeSelection:mF,$forEachSelectedTextNode:_F,$getComputedStyleForElement:xF,$getComputedStyleForParent:CF,$getSelectionStyleValueForProperty:yF,$isAtEdgeOfElement:sp,$isAtNodeEnd:ip,$isParentElementRTL:SF,$isParentRTL:Tl,$moveCaretSelection:NF,$moveCharacter:ap,$patchStyleText:EF,$selectAll:TF,$setBlocksType:Pi,$shouldOverrideDefaultCharacterSelection:lp,$sliceSelectedTextNodeContent:Ps,$trimTextContentFromAnchor:bF,$wrapNodes:vF,createDOMRange:OF,createRectsFromDOMRange:zS,getCSSFromStyleObject:AF,getStyleObjectFromCSS:RF,trimTextContentFromAnchor:MF}=ut;var hp={};je(hp,{$descendantsMatching:()=>gD,$dfs:()=>GM,$dfsIterator:()=>VS,$dfsWithSlots:()=>VM,$dfsWithSlotsIterator:()=>XS,$filter:()=>aD,$findMatchingParent:()=>he,$firstToLastIterator:()=>pD,$getAdjacentCaret:()=>jM,$getAdjacentSiblingOrParentSiblingCaret:()=>vs,$getDepth:()=>qS,$getNearestBlockElementAncestorOrThrow:()=>QM,$getNearestNodeOfType:()=>ZM,$getNextRightPreorderNode:()=>qM,$getNextSiblingOrParentSibling:()=>XM,$handleIndentAndOutdent:()=>lD,$insertFirst:()=>cD,$insertNodeIntoLeaf:()=>rD,$insertNodeToNearestRoot:()=>oD,$insertNodeToNearestRootAtCaret:()=>zr,$isAtEndOfNode:()=>oN,$isAtStartOfNode:()=>nN,$isBlockFullySelected:()=>eD,$isEditorIsNestedEditor:()=>dD,$lastToFirstIterator:()=>pp,$onEscapeDown:()=>xD,$onEscapeUp:()=>_D,$restoreEditorState:()=>nD,$reverseDfs:()=>YM,$reverseDfsIterator:()=>JS,$reverseDfsWithSlots:()=>JM,$reverseDfsWithSlotsIterator:()=>ZS,$splitNode:()=>Wy,$unwrapAndFilterDescendants:()=>fD,$unwrapNode:()=>hD,$wrapNodeInElement:()=>sD,CAN_USE_BEFORE_INPUT:()=>gl,CAN_USE_DOM:()=>pn,IS_ANDROID:()=>eS,IS_ANDROID_CHROME:()=>tS,IS_APPLE:()=>hl,IS_APPLE_WEBKIT:()=>du,IS_CHROME:()=>nS,IS_FIREFOX:()=>$s,IS_IOS:()=>_l,IS_SAFARI:()=>fu,addClassNamesToElement:()=>et,calculateZoomLevel:()=>uD,dedupeSelectionRects:()=>WS,eventFiles:()=>iD,getScrollParent:()=>HM,isBlockDomNode:()=>Is,isHTMLAnchorElement:()=>ki,isHTMLElement:()=>ye,isInlineDomNode:()=>Ii,isMimeType:()=>YS,makeStateWrapper:()=>mD,markSelection:()=>jS,mediaFileReader:()=>WM,mergeRegister:()=>Ae,objectKlassEquals:()=>gp,positionNodeOnRange:()=>GS,registerNestedElementResolver:()=>tD,removeClassNamesFromElement:()=>sn,selectionAlwaysOnDisplay:()=>UM});function up(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function WS(e){let n=(s,i)=>i.left>=s.left-1&&i.top>=s.top-1&&i.right<=s.right+1&&i.bottom<=s.bottom+1,r=[];for(let s of Array.from(e))if(!(s.width<0.5||s.height<0.5||r.some((i)=>n(s,i)))){for(let i=r.length-1;i>=0;i--)n(r[i],s)&&r.splice(i,1);r.push(s)}return r}function Vo(e){return`${e}px`}var KM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function GS(e,n,r){let s=null,i=null,a=null,l=[],c=ks(e.getRootElement()).createElement("div");function d(){s===null&&up(182),i===null&&up(183);let{left:p,top:h}=i.getBoundingClientRect(),x=WS(zS(e,n));var y,N;c.isConnected||(N=c,(y=i).insertBefore(N,y.firstChild));let E=!1;for(let T=0;T<x.length;T++){let b=x[T],v=l[T]||ks(s).createElement("div"),O=v.style;O.position!=="absolute"&&(O.position="absolute",E=!0);let k=Vo(b.left-p);O.left!==k&&(O.left=k,E=!0);let M=Vo(b.top-h);O.top!==M&&(v.style.top=M,E=!0);let z=Vo(b.width);O.width!==z&&(v.style.width=z,E=!0);let K=Vo(b.height);O.height!==K&&(v.style.height=K,E=!0),v.parentNode!==c&&(c.append(v),E=!0),l[T]=v}for(;l.length>x.length;){let T=l.pop();T!=null&&T.remove()}E&&r(l)}function f(){i=null,s=null,a!==null&&a.disconnect(),a=null,c.remove();for(let p of l)p.remove();l=[]}c.style.position="relative";let g=e.registerRootListener(function p(){let h=e.getRootElement();if(h===null)return f();let x=h.parentElement;if(!ye(x))return f();f(),s=h,i=x,a=new MutationObserver((y)=>{let N=e.getRootElement(),E=N&&N.parentElement;if(N!==s||E!==i)return p();for(let T of y)if(!c.contains(T.target))return d()}),a.observe(x,KM),d()});return()=>{g(),f()}}function US(e,n,r,s){if(n.type!=="text"&&Q(r)){let i=wy(r,s,e);return[i.element,i.getFirstChildOffset()+n.offset]}return[(re(r)?ky(r,s,e):_S(s))||s,n.offset]}function zM(e){for(let n of e){let r=n.style;r.background!=="Highlight"&&(r.background="Highlight"),r.color!=="HighlightText"&&(r.color="HighlightText"),r.marginTop!==Vo(-1.5)&&(r.marginTop=Vo(-1.5)),r.paddingTop!==Vo(4)&&(r.paddingTop=Vo(4)),r.paddingBottom!==Vo(0)&&(r.paddingBottom=Vo(0))}}function jS(e,n=zM){let r=null,s=null,i=null,a=null,l=null,c=null,d=()=>{};function f(g){g.read(()=>{let p=X();if(!j(p))return r=null,i=null,a=null,c=null,d(),void(d=()=>{});let[h,x]=function(K){let U=K.getStartEndPoints();return K.isBackward()?[U[1],U[0]]:U}(p),y=h.getNode(),N=y.getKey(),E=h.offset,T=x.getNode(),b=T.getKey(),v=x.offset,O=e.getElementByKey(N),k=e.getElementByKey(b),M=r===null||O!==s||E!==i||N!==r.getKey(),z=a===null||k!==l||v!==c||b!==a.getKey();if((M||z)&&O!==null&&k!==null){let K=function(U,J,W,ne,ee,se,V){let fe=(U._window?U._window.document:document).createRange();return fe.setStart(...US(U,J,W,ne)),fe.setEnd(...US(U,ee,se,V)),fe}(e,h,y,O,x,T,k);d(),d=GS(e,K,n)}r=y,s=O,i=E,a=T,l=k,c=v},{editor:e})}return f(e.getEditorState()),Ae(e.registerUpdateListener(({editorState:g})=>f(g)),()=>{d()})}function UM(e,n){let r=null,s=()=>{let i=e.getRootElement(),a=i!==null?i.ownerDocument.defaultView:null,l=a!==null?a.getSelection():null,c=l!==null?ws(l,i).anchorNode:null;c!==null&&i!==null&&i.contains(c)?r!==null&&(r(),r=null):r===null&&(r=jS(e,n))};return e.registerRootListener((i)=>{if(i){let a=i.ownerDocument,l=Ae(so(a,"selectionchange",s),()=>{r!==null&&r()});return s(),l}})}function HM(e,n){let r=e.ownerDocument,s=r.defaultView||window,i=s.getComputedStyle(e),a=i.position==="absolute",l=n?/(auto|scroll|hidden)/:/(auto|scroll)/;if(i.position==="fixed")return r.body;for(let c=e;c=El(c);)if(i=s.getComputedStyle(c),(!a||i.position!=="static")&&l.test(i.overflow+i.overflowY+i.overflowX))return c;return r.body}function YS(e,n){for(let r of n)if(e.type.startsWith(r))return!0;return!1}function WM(e,n){let r=e[Symbol.iterator]();return new Promise((s,i)=>{let a=[],l=()=>{let{done:c,value:d}=r.next();if(c)return s(a);let f=new FileReader;f.addEventListener("error",i),f.addEventListener("load",()=>{let g=f.result;typeof g=="string"&&a.push({file:d,result:g}),l()}),YS(d,n)?f.readAsDataURL(d):l()};l()})}function GM(e,n){return Array.from(VS(e,n))}function jM(e){return e?e.getAdjacentCaret():null}function YM(e,n){return Array.from(JS(e,n))}function VS(e,n){return wu("next",e,n)}function VM(e,n){return Array.from(XS(e,n))}function*XS(e,n){for(let r of wu("next",e,n)){yield r;let{node:s,depth:i}=r;if(dl(s)&&!s.is(n))for(let a of As(s)){let l=Ci(s,a);l!==null&&(yield*dp(l,i+1))}}}function*dp(e,n){yield{depth:n,node:e};let r=n+1;if(dl(e))for(let s of As(e)){let i=Ci(e,s);i!==null&&(yield*dp(i,r))}if(Q(e))for(let s of e.getChildren())yield*dp(s,r)}function HS(e,n){let r=vs(it(e,n));return r&&r[0]}function wu(e,n,r){let s=Je(),i=n||s,a=Q(i)?bt(i,e):it(i,e),l=qS(i),c=r?al(Bg(it(r,e)))||HS(r,e):HS(i,e),d=l;return Vg({hasNext:(f)=>f!==null,initial:a,map:(f)=>({depth:d,node:f.origin}),step:(f)=>{if(f.isSameNodeCaret(c))return null;Ko(f)&&d++;let g=vs(f);return!g||g[0].isSameNodeCaret(c)?null:(d+=g[1],g[0])}})}function XM(e){let n=vs(it(e,"next"));return n&&[n[0].origin,n[1]]}function qS(e){let n=-1;for(let r=e;r!==null;r=r.getParent()??Vc(r))n++;return n}function qM(e){let n=Bg(it(e,"previous")),r=vs(n,"root");return r&&r[0].origin}function JS(e,n){return wu("previous",e,n)}function JM(e,n){return Array.from(ZS(e,n))}function*ZS(e,n){let r=[];for(let s of wu("previous",e,n)){for(;r.length>0&&s.depth<=r[r.length-1].depth;){let l=r.pop();yield*fp(l.node,l.depth+1)}yield s;let{node:i,depth:a}=s;dl(i)&&As(i).length>0&&!i.is(n)&&r.push({depth:a,node:i})}for(;r.length>0;){let s=r.pop();yield*fp(s.node,s.depth+1)}}function*fp(e,n){let r=As(e);for(let s=r.length-1;s>=0;s--){let i=Ci(e,r[s]);i!==null&&(yield*QS(i,n))}}function*QS(e,n){yield{depth:n,node:e};let r=n+1;if(Q(e)){let s=e.getChildren();for(let i=s.length-1;i>=0;i--)yield*QS(s[i],r)}dl(e)&&(yield*fp(e,r))}function ZM(e,n){let r=e;for(;r!=null;){if(r instanceof n)return r;r=r.getParent()}return null}function QM(e){let n=he(e,(r)=>Q(r)&&!r.isInline());return Q(n)||up(4,e.__key),n}function eD(e,n){let r=dr(j(n)?cr(n):n,"next"),s=Zn(r.anchor.origin),i=Zn(e.getLatest());if(s===null?i!==null:!s.is(i))return!1;let a=It(bt(e,"next")),l=Dy(It(bt(e,"previous")),"next");return Br(r.anchor,a)<=0&&Br(r.focus,l)>=0}function tD(e,n,r,s){let i=(a)=>a instanceof n;return e.registerNodeTransform(n,(a)=>{let l=((c)=>{let d=c.getChildren();for(let p=0;p<d.length;p++){let h=d[p];if(i(h))return null}let f=c,g=c;for(;f!==null;)if(g=f,f=f.getParent(),i(f))return{child:g,parent:f};return null})(a);if(l!==null){let{child:c,parent:d}=l;if(c.is(a)){s(d,a);let f=c.getNextSiblings(),g=f.length;if(d.insertAfter(c),g!==0){let p=r(d);c.insertAfter(p);for(let h=0;h<g;h++)p.append(f[h])}d.canBeEmpty()||d.getChildrenSize()!==0||d.remove()}}})}function nD(e,n){let r=new Map,s=e._pendingEditorState;for(let[a,l]of n._nodeMap)r.set(a,Gc(l));s&&(s._nodeMap=r),xi();let i=n._selection;mt(i===null?null:i.clone())}function oD(e){let n=X()||En(),r;if(j(n))r=dn(n.focus,"next");else{if(n!=null){let l=n.getNodes(),c=l[l.length-1];c&&(r=it(c,"next"))}r=r||bt(Je(),"previous").getFlipped().insert(Se())}let s=zr(e,r),i=al(s),a=Ko(i)?It(i):s;return wn(Os(a)),e.getLatest()}function rD(e){let n=X();if(!j(n))return void(n&&n.insertNodes([e]));let r=cr(n),s=dr(Uy(r),"next").anchor;if(Hr(s)){let a=Zc(s);if(!a)return;s=a}let i=s.getFlipped();i.insert(e),wn(Jn(i,i))}function sD(e,n){let r=n();return e.replace(r),r.append(e),r}function gp(e,n){return e!==null&&Object.getPrototypeOf(e).constructor.name===n.name}function iD(e){let n=null;if(gp(e,DragEvent)?n=e.dataTransfer:gp(e,ClipboardEvent)&&(n=e.clipboardData),n===null)return[!1,[],!1];let r=n.types,s=r.includes("Files"),i=r.includes("text/html")||r.includes("text/plain");return[s,Array.from(n.files),i]}function aD(e,n){let r=[];for(let s=0;s<e.length;s++){let i=n(e[s]);i!==null&&r.push(i)}return r}function lD(e){let n=X();if(!j(n))return!1;let r=new Set,s=n.getNodes();for(let i=0;i<s.length;i++){let a=s[i],l=a.getKey();if(r.has(l))continue;let c=he(a,(f)=>Q(f)&&!f.isInline());if(c===null)continue;let d=c.getKey();c.canIndent()&&!r.has(d)&&(r.add(d),e(c))}return r.size>0}function cD(e,n){bt(e,"next").insert(n)}var cp=!($s||!pn)&&void 0;function uD(e,n=!1){let r=1;if(function(){if(cp===void 0){let s=document.createElement("div");s.style.position="absolute",s.style.opacity="0",s.style.width="100px",s.style.left="-1000px",document.body.appendChild(s);let i=s.getBoundingClientRect();s.style.setProperty("zoom","2"),cp=s.getBoundingClientRect().width===i.width,document.body.removeChild(s)}return cp}()||n){let s=e&&e.ownerDocument.defaultView||window;for(;e;)r*=Number(s.getComputedStyle(e).getPropertyValue("zoom")),e=El(e)}return r}function dD(e){return e._parentEditor!==null}function fD(e,n){return eN(e,n,null)}function eN(e,n,r){let s=!1;for(let i of pp(e))n(i)?r!==null&&r(i):(s=!0,Q(i)&&eN(i,n,r||((a)=>i.insertAfter(a))),i.remove());return s}function gD(e,n){let r=[],s=Array.from(e).reverse();for(let i=s.pop();i!==void 0;i=s.pop())if(n(i))r.push(i);else if(Q(i))for(let a of pp(i))s.push(a);return r}function pD(e){return tN(bt(e,"next"))}function pp(e){return tN(bt(e,"previous"))}function tN(e){return Vg({hasNext:So,initial:e.getAdjacentCaret(),map:(n)=>n.origin.getLatest(),step:(n)=>n.getAdjacentCaret()})}function hD(e){Uo(it(e,"next")).splice(1,e.getChildren())}function mD(e){let n=(s)=>Bo(s,e),r=(s,i)=>eo(s,e,i);return{$get:n,$set:r,accessors:[n,r],makeGetterMethod:()=>function(){return n(this)},makeSetterMethod:()=>function(s){return r(this,s)},stateConfig:e}}function _D(e,n){let r=X();if(j(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getFirstChild()===s&&nN(r.anchor,s))return s.insertBefore(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function xD(e,n){let r=X();if(j(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getLastChild()===s&&oN(r.anchor,s))return s.insertAfter(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function nN(e,n){return sp(e,n,"previous")}function oN(e,n){return sp(e,n,"next")}var de=hp,{$descendantsMatching:bl,$dfs:rN,$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:vl,$insertFirst:sN,$insertNodeIntoLeaf:jF,$insertNodeToNearestRoot:Lu,$insertNodeToNearestRootAtCaret:YF,$isAtEndOfNode:VF,$isAtStartOfNode:XF,$isBlockFullySelected:Ol,$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:iN,dedupeSelectionRects:_P,eventFiles:Bs,getScrollParent:xP,isBlockDomNode:CP,isHTMLAnchorElement:yP,isHTMLElement:SP,isInlineDomNode:NP,isMimeType:EP,makeStateWrapper:TP,markSelection:bP,mediaFileReader:vP,mergeRegister:OP,objectKlassEquals:Fn,positionNodeOnRange:AP,registerNestedElementResolver:RP,removeClassNamesFromElement:MP,selectionAlwaysOnDisplay:aN}=de;var kp={};je(kp,{$applyFormatToDom:()=>OD,$createHorizontalRuleNode:()=>wp,$defaultShouldInsertAfter:()=>NN,$getExtensionDependency:()=>wN,$getExtensionOutput:()=>BD,$getPeerDependency:()=>KD,$isDecoratorTextNode:()=>bD,$isHorizontalRuleNode:()=>IN,AutoFocusExtension:()=>ND,ClearEditorExtension:()=>ED,ClickAfterLastBlockExtension:()=>TD,DecoratorTextExtension:()=>MD,DecoratorTextNode:()=>Wu,EditorStateExtension:()=>Uu,HorizontalRuleExtension:()=>HD,HorizontalRuleNode:()=>zi,IMEExtension:()=>WD,INSERT_HORIZONTAL_RULE_COMMAND:()=>kN,InitialStateExtension:()=>DN,LexicalBuilder:()=>pr,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:()=>bN,batch:()=>hN,buildEditorFromExtensions:()=>LD,computed:()=>xN,configExtension:()=>nn,declarePeerDependency:()=>dS,defineExtension:()=>_e,effect:()=>Zt,getExtensionDependencyFromEditor:()=>$N,getKnownTypesAndNodes:()=>EN,getPeerDependencyFromEditor:()=>$p,getPeerDependencyFromEditorOrThrow:()=>PD,namedSignals:()=>Eo,registerClearEditor:()=>SN,registerTabIndentation:()=>FN,safeCast:()=>He,shallowMergeConfig:()=>zt,signal:()=>Qr,untracked:()=>Tp,watchedSignal:()=>Ml});var CD=Symbol.for("preact-signals");function Hu(){if(gr>1)return void gr--;let e,n=!1;for(!function(){let r=Ku;for(Ku=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o}();Rl!==void 0;){let r=Rl;for(Rl=void 0,zu++;r!==void 0;){let s=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&mN(r))try{r.c()}catch(i){n||(e=i,n=!0)}r=s}}if(zu=0,gr--,n)throw e}function hN(e){if(gr>0)return e();bp=++yD,gr++;try{return e()}finally{Hu()}}var nt,Rl;function Tp(e){let n=nt;nt=void 0;try{return e()}finally{nt=n}}var Ku,gr=0,zu=0,yD=0,bp=0,Bu=0;function lN(e){if(nt===void 0)return;let n=e.n;return n===void 0||n.t!==nt?(n={i:0,S:e,p:nt.s,n:void 0,t:nt,e:void 0,x:void 0,r:n},nt.s!==void 0&&(nt.s.n=n),nt.s=n,e.n=n,32&nt.f&&e.S(n),n):n.i===-1?(n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=nt.s,n.n=void 0,nt.s.n=n,nt.s=n),n):void 0}function hn(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function Qr(e,n){return new hn(e,n)}function mN(e){for(let n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function cN(e){for(let n=e.s;n!==void 0;n=n.n){let r=n.S.n;if(r!==void 0&&(n.r=r),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function _N(e){let n,r=e.s;for(;r!==void 0;){let s=r.p;r.i===-1?(r.S.U(r),s!==void 0&&(s.n=r.n),r.n!==void 0&&(r.n.p=s)):n=r,r.S.n=r.r,r.r!==void 0&&(r.r=void 0),r=s}e.s=n}function Ks(e,n){hn.call(this,void 0),this.x=e,this.s=void 0,this.g=Bu-1,this.f=4,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function xN(e,n){return new Ks(e,n)}function CN(e){let n=e.m;if(e.m=void 0,typeof n=="function"){gr++;let r=nt;nt=void 0;try{n()}catch(s){throw e.f&=-2,e.f|=8,Rp(e),s}finally{nt=r,Hu()}}}function Rp(e){for(let n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,CN(e)}function SD(e){if(nt!==this)throw Error("Out-of-order effect");_N(this),nt=e,this.f&=-2,8&this.f&&Rp(this),Hu()}function Ki(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n==null?void 0:n.name}function Zt(e,n){let r=new Ki(e,n);try{r.c()}catch(i){throw r.d(),i}let s=r.d.bind(r);return s[Symbol.dispose]=s,s}function Eo(e,n={}){let r={};for(let s in e){let i=n[s],a=Qr(i===void 0?e[s]:i);r[s]=a}return r}hn.prototype.brand=CD,hn.prototype.h=function(){return!0},hn.prototype.S=function(e){let n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Tp(()=>{var r;(r=this.W)==null||r.call(this)}))},hn.prototype.U=function(e){if(this.t!==void 0){let{e:n,x:r}=e;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Tp(()=>{var s;(s=this.Z)==null||s.call(this)}))}},hn.prototype.subscribe=function(e){return Zt(()=>{let n=this.value,r=nt;nt=void 0;try{e(n)}finally{nt=r}},{name:"sub"})},hn.prototype.valueOf=function(){return this.value},hn.prototype.toString=function(){return this.value+""},hn.prototype.toJSON=function(){return this.value},hn.prototype.peek=function(){let e=nt;nt=void 0;try{return this.value}finally{nt=e}},Object.defineProperty(hn.prototype,"value",{get(){let e=lN(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(n){gr!==0&&zu===0&&n.l!==bp&&(n.l=bp,Ku={S:n,v:n.v,i:n.i,o:Ku})})(this),this.v=e,this.i++,Bu++,gr++;try{for(let n=this.t;n!==void 0;n=n.x)n.t.N()}finally{Hu()}}}}),Ks.prototype=new hn,Ks.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&&!mN(this))return this.f&=-2,!0;let e=nt;try{cN(this),nt=this;let n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return nt=e,_N(this),this.f&=-2,!0},Ks.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let n=this.s;n!==void 0;n=n.n)n.S.S(n)}hn.prototype.S.call(this,e)},Ks.prototype.U=function(e){if(this.t!==void 0&&(hn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let n=this.s;n!==void 0;n=n.n)n.S.U(n)}},Ks.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(Ks.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=lN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ki.prototype.c=function(){let e=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}},Ki.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,CN(this),cN(this),gr++;let e=nt;return nt=this,SD.bind(this,e)},Ki.prototype.N=function(){2&this.f||(this.f|=2,this.u=Rl,Rl=this)},Ki.prototype.d=function(){this.f|=8,1&this.f||Rp(this)},Ki.prototype.dispose=function(){this.d()};var ND=_e({build:(e,n,r)=>Eo(n),config:He({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,n,r){let s=r.getOutput();return Zt(()=>s.disabled.value?void 0:e.registerRootListener((i)=>{e.focus(()=>{let a=i!==null?No(i):null;i===null||a!==null&&i.contains(a)||i.focus({preventScroll:!0})},{defaultSelection:s.defaultSelection.peek()})}))}});function yN(){let e=Je(),n=X(),r=Se();e.clear(),e.append(r),n!==null&&r.select(),j(n)&&(n.format=0)}function SN(e,n=yN){return e.registerCommand(Qc,()=>(n(),!0),Te)}var ED=_e({build:(e,n,r)=>Eo(n),config:He({$onClear:yN}),name:"@lexical/extension/ClearEditor",register(e,n,r){let{$onClear:s}=r.getOutput();return Zt(()=>SN(e,s.value))}});function NN(e){return!!kt(e)||!(!Q(e)||!e.isShadowRoot())}function uN(e,n,r,s){return!!e.isEditable()&&(r.target===n&&e.read("latest",()=>{let i=Je().getLastChild();if(i===null)return!1;let a=e.getElementByKey(i.getKey());return a!==null&&(!(r.clientY<=a.getBoundingClientRect().bottom)&&s(i))}))}var TD=_e({build:(e,n)=>Eo(n),config:He({$shouldInsertAfter:NN,disabled:!1}),name:"@lexical/ClickAfterLastBlock",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(i===null)return;return Jr(i,{click:(a)=>{uN(e,i,a,s.$shouldInsertAfter.peek())&&(a.preventDefault(),Xg(a),e.update(()=>{let l=Je().getLastChild();if(l===null)return;if(!s.$shouldInsertAfter.peek()(l))return;let c=Se();l.insertAfter(c),c.select()}))},mousedown:(a)=>{uN(e,i,a,s.$shouldInsertAfter.peek())&&a.preventDefault()}},!0)})})});function EN(e){let n=new Set,r=new Set;for(let s of TN(e)){let i=typeof s=="function"?s:s.replace;xS(i),n.add(i.getType()),r.add(i)}return{nodes:r,types:n}}function TN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var Cp=Yo("format",{parse:(e)=>typeof e=="number"?e:0});class Wu extends lu{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:lu,stateConfigs:[{flat:!0,stateConfig:Cp}]})}getFormat(e){return Bo(this,Cp,e)}getFormatFlags(e,n){return qg(this.getFormat(),e,n)}hasFormat(e){let n=wi[e];return(this.getFormat()&n)!==0}setFormat(e){return eo(this,Cp,e)}toggleFormat(e){let n=this.getFormat(),r=qg(n,e,null);return this.setFormat(r)}isInline(){return!0}createDOM(e,n){return Xe().createElement("span")}}function bD(e){return e instanceof Wu}function vD(e,n,r){let s=n.fontWeight,i=n.textDecoration.split(" "),a=s==="700"||s==="bold",l=i.includes("line-through"),c=n.fontStyle==="italic",d=i.includes("underline"),f=n.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),c&&!e.hasFormat("italic")&&e.toggleFormat("italic"),d&&!e.hasFormat("underline")&&e.toggleFormat("underline"),f!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),f!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),r&&!e.hasFormat(r)&&e.toggleFormat(r),e}function bN(e,n,r=RD){let s=n;for(let[i,a]of Object.entries(r))e.hasFormat(a)&&(s=AD(s,i));return s}var OD=bN;function AD(e,n){let r=e.ownerDocument.createElement(n);return r.appendChild(e),r}var RD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},MD=_e({name:"@lexical/extension/DecoratorText",nodes:()=>[Wu]});function Ml(e,n){let r;return Qr(e(),{unwatched(){r&&(r(),r=void 0)},watched(){this.value=e(),r=n(this)}})}var Uu=_e({build:(e)=>Ml(()=>e.getEditorState(),(n)=>e.registerUpdateListener((r)=>{n.value=r.editorState})),name:"@lexical/extension/EditorState"});function tt(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var vN;try{vN="0.49.0+prod.esm"}catch(e){}var DD=vN??'"<unknown>+source"',$D=new Set(["__proto__","constructor","prototype"]);function ON(e,n){if(e&&n&&!Array.isArray(n)&&typeof e=="object"&&typeof n=="object"){let r=e,s=n;for(let i in s)!$D.has(i)&&Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=ON(r[i],s[i]));return e}return n}var Mp=0,vp=1,AN=2,yp=3,Fu=4,Bi=5,Sp=6,Al=7;function Np(e){return e.id===Mp}function RN(e){return e.id===AN}function wD(e){return function(n){return n.id===vp}(e)||tt(305,String(e.id),String(vp)),Object.assign(e,{id:AN})}var kD=new Set;class MN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:Mp}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):zt;for(let r of this.configs)e=n(e,r);return e}init(e){let n=this.state;RN(n)||tt(306,String(n.id));let r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},s={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(l,c,d){return Object.assign(l,{config:c,id:yp,registerState:d})}(n,this.mergeConfigs(),r),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,r)),this.state=function(l,c,d){return Object.assign(l,{id:Fu,initResult:c,registerState:d})}(i,a,s)}build(e){let n=this.state,r;n.id!==Fu&&tt(307,String(n.id),String(Bi)),this.extension.build&&(r=this.extension.build(e,n.config,n.registerState));let s={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=function(i,a,l){return Object.assign(i,{id:Bi,output:a,registerState:l})}(n,r,s)}register(e,n){this._signal=n;let r=this.state;r.id!==Bi&&tt(308,String(r.id),String(Bi));let s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=function(i){return Object.assign(i,{id:Sp})}(r),()=>{let i=this.state;i.id!==Al&&tt(309,String(r.id),String(Al)),this.state=function(a){return Object.assign(a,{id:Bi})}(i),s&&s()}}afterRegistration(e){let n=this.state,r;return n.id!==Sp&&tt(310,String(n.id),String(Sp)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=function(s){return Object.assign(s,{id:Al})}(n),r}getSignal(){return this._signal===void 0&&tt(311),this._signal}getInitResult(){this.extension.init===void 0&&tt(312,this.extension.name);let e=this.state;return function(n){return n.id>=Fu}(e)||tt(313,String(e.id),String(Fu)),e.initResult}getInitPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(n){return n.id>=yp}(e)||tt(314,String(e.id),String(yp)),{config:e.config}}getPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}getInitDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionInitDependency()}getDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionDependency()}getState(){let e=this.state;return function(n){return n.id>=Al}(e)||tt(316,String(e.id),String(Al)),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(([n])=>n)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(n){return n.id>=Bi})(e)||tt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var dN={tag:Gr};function ID(){let e=Je();e.isEmpty()&&e.append(Se())}var DN=_e({config:He({setOptions:dN,updateOptions:dN}),init:({$initialEditorState:e=ID})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},s){let i=s.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:a}=i;if(Fy(a))e.setEditorState(a,r);else if(typeof a=="function")e.update(()=>{a(e)},n);else if(a&&(typeof a=="string"||typeof a=="object")){let l=e.parseEditorState(a);e.setEditorState(l,r)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cu,In,sS,Nu,iS]}),fN=Symbol.for("@lexical/extension/LexicalBuilder");function LD(...e){return pr.fromExtensions(e).buildEditor()}function gN(){}function FD(e){throw e}function Pu(e){return Array.isArray(e)?e:[e]}var Ep=DD;class pr{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 n of e)this.addExtension(n)}static fromExtensions(e){let n=[Pu(DN)];for(let r of e)n.push(Pu(r));return new pr(n)}static maybeFromEditor(e){let n=e[fN];return n&&(n.PACKAGE_VERSION!==Ep&&tt(292,n.PACKAGE_VERSION,Ep),n instanceof pr||tt(293)),n}static fromEditor(e){let n=pr.maybeFromEditor(e);return n===void 0&&tt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,onWarn:r,...s}=this.buildCreateEditorArgs(),i=Object.assign(Tu({...s,...n?{onError:(a)=>{n(a,i)}}:{},...r?{onWarn:(a)=>{r(a,i)}}:{}}),{[fN]:this});for(let a of this.sortedExtensionReps())a.build(i);return i}buildEditor(){let e=gN;function n(){try{e()}finally{e=gN}}let r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=Ae(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let n=this.extensionNameMap.get(e.name);if(n)return n.extension!==e&&tt(295,e.name),n}addEdge(e,n,r){let s=this.outgoingConfigEdges.get(e);s?s.set(n,r):this.outgoingConfigEdges.set(e,new Map([[n,r]]));let i=this.incomingEdges.get(n);i?i.add(e):this.incomingEdges.set(n,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&tt(296);let n=Pu(e),[r]=n;typeof r.name!="string"&&tt(297,typeof r.name);let s=this.extensionNameMap.get(r.name);if(s!==void 0&&s.extension!==r&&tt(298,r.name),!s){s=new MN(this,r),this.extensionNameMap.set(r.name,s);let i=this.conflicts.get(r.name);typeof i=="string"&&tt(299,r.name,i);for(let a of r.conflictsWith||[])this.extensionNameMap.has(a)&&tt(299,r.name,a),this.conflicts.set(a,r.name);for(let a of r.dependencies||[]){let l=Pu(a);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(let[a,l]of r.peerDependencies||[])this.addEdge(r.name,a,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],n=(r,s)=>{let i=r.state;if(RN(i))return;let a=r.extension.name;var l;Np(i)||tt(300,a,s||"[unknown]"),Np(l=i)||tt(304,String(l.id),String(Mp)),i=Object.assign(l,{id:vp}),r.state=i;let c=this.outgoingConfigEdges.get(a);if(c)for(let d of c.keys()){let f=this.extensionNameMap.get(d);f&&n(f,a)}i=wD(i),r.state=i,e.push(r)};for(let r of this.extensionNameMap.values())Np(r.state)&&n(r);for(let r of e)for(let[s,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){let a=this.extensionNameMap.get(s);if(a)for(let l of i)a.configs.add(l)}for(let[r,...s]of this.roots)if(s.length>0){let i=this.extensionNameMap.get(r.name);i===void 0&&tt(301,r.name);for(let a of s)i.configs.add(a)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let n=this.sortedExtensionReps(),r=new AbortController,s=[()=>r.abort()],i=r.signal;for(let a of n){let l=a.register(e,i);l&&s.push(l)}for(let a of n){let l=a.afterRegistration(e);l&&s.push(l)}return Ae(...s)}buildCreateEditorArgs(){let e={},n=new Set,r=new Map,s=new Map,i={},a={},l=this.sortedExtensionReps();for(let f of l){let{extension:g}=f;if(g.onError!==void 0&&(e.onError=g.onError),g.onWarn!==void 0&&(e.onWarn=g.onWarn),g.disableEvents!==void 0&&(e.disableEvents=g.disableEvents),g.parentEditor!==void 0&&(e.parentEditor=g.parentEditor),g.editable!==void 0&&(e.editable=g.editable),g.namespace!==void 0&&(e.namespace=g.namespace),g.$initialEditorState!==void 0&&(e.$initialEditorState=g.$initialEditorState),g.nodes)for(let p of TN(g)){if(typeof p!="function"){let h=r.get(p.replace);h&&tt(302,g.name,p.replace.name,h.extension.name),r.set(p.replace,f)}n.add(p)}if(g.html){if(g.html.export)for(let[p,h]of g.html.export.entries())s.set(p,h);g.html.import&&Object.assign(i,g.html.import)}g.theme&&ON(a,g.theme)}Object.keys(a).length>0&&(e.theme=a),n.size&&(e.nodes=[...n]);let c=Object.keys(i).length>0,d=s.size>0;(c||d)&&(e.html={},c&&(e.html.import=i),d&&(e.html.export=s));for(let f of l)f.init(e);return e.onError||(e.onError=FD),e}}function $N(e,n){let r=pr.fromEditor(e).getExtensionRep(n);return r===void 0&&tt(303,n.name),r.getExtensionDependency()}function $p(e,n){let r=pr.maybeFromEditor(e);if(!r)return;let s=r.extensionNameMap.get(n);return s?s.getExtensionDependency():void 0}function PD(e,n){let r=$p(e,n);return r===void 0&&tt(291,n),r}function wN(e){return $N(We(),e)}function BD(e){return wN(e).output}function KD(e){return $p(We(),e)}var zD=new Set,Op=_e({build(e,n,r){let s=r.getDependency(Uu).output,i=Qr({watchedNodeKeys:new Map}),a=Ml(()=>{},()=>Zt(()=>{let l=a.peek(),{watchedNodeKeys:c}=i.value,d,f=!1;s.value.read(()=>{if(X())for(let[g,p]of c.entries()){if(p.size===0){c.delete(g);continue}let h=Mt(g),x=h&&h.isSelected()||!1;f=f||x!==(!!l&&l.has(g)),x&&(d=d||new Set,d.add(g))}}),!f&&d&&l&&d.size===l.size||(a.value=d)}));return{watchNodeKey:function(l){let c=xN(()=>(a.value||zD).has(l)),{watchedNodeKeys:d}=i.peek(),f=d.get(l),g=f!==void 0;return f=f||new Set,f.add(c),g||(d.set(l,f),i.value={watchedNodeKeys:d}),c}}},dependencies:[Uu],name:"@lexical/extension/NodeSelection"}),kN=bn("INSERT_HORIZONTAL_RULE_COMMAND");class zi extends lu{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:UD,priority:0})}})}exportDOM(){return{element:Xe().createElement("hr")}}createDOM(e){let n=Xe().createElement("hr");return et(n,e.theme.hr),n}getTextContent(){return`
|
|
15
|
+
`}isInline(){return!1}updateDOM(){return!1}}function UD(){return{node:wp()}}function wp(){return jc(zi)}function IN(e){return e instanceof zi}var HD=_e({dependencies:[Uu,Op],name:"@lexical/extension/HorizontalRule",nodes:()=>[zi],register(e,n,r){let{watchNodeKey:s}=r.getDependency(Op).output,i=Qr({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return Ae(e.registerCommand(kN,(l)=>{let c=X();if(!j(c))return!1;if(c.focus.getNode()!==null){let d=wp();Lu(d)}return!0},Te),e.registerCommand(yi,(l)=>{if(ro(l.target)){let c=Ly(l.target);if(IN(c))return function(d,f=!1){let g=X(),p=d.isSelected(),h=d.getKey(),x;f&&Ze(g)?x=g:(x=Yc(),mt(x)),p?x.delete(h):x.add(h)}(c,l.shiftKey),!0}return!1},Fe),e.registerMutationListener(zi,(l,c)=>{hN(()=>{let d=!1,{nodeSelections:f}=i.peek();for(let[g,p]of l.entries())if(p==="destroyed")f.delete(g),d=!0;else{let h=f.get(g),x=e.getElementByKey(g);h?h.domNode.value=x:(d=!0,f.set(g,{domNode:Qr(x),selectedSignal:s(g)}))}d&&(i.value={nodeSelections:f})})}),Zt(()=>{let l=[];for(let{domNode:c,selectedSignal:d}of i.value.nodeSelections.values())l.push(Zt(()=>{let f=c.value;if(f)d.value?et(f,a):sn(f,a)}));return Ae(...l)}))}}),WD=_e({build:(e)=>({composingTextNode:Qr(null),compositionKey:Qr(null)}),name:"@lexical/extension/IME",register(e,n,r){let{compositionKey:s,composingTextNode:i}=r.getOutput(),a=e.registerCommand(Xy,()=>{let f=X();return j(f)&&(s.value=f.anchor.key),!1},eu),l=Zt(()=>{let f=s.value;i.value=f!==null?e.read("latest",()=>{let g=Mt(f);return re(g)?g:null}):null}),c=e.registerUpdateListener(({tags:f,editorState:g})=>{f.has(nu)&&g.read(()=>{let p=X();if(!j(p))return;let h=p.anchor.getNode();re(h)&&(i.value=h)})}),d=e.registerRootListener((f)=>{if(f===null)return void(s.value=null);return so(f,"compositionend",()=>{s.value=null})});return Ae(a,l,c,d)}}),GD=_e({build:(e,n)=>Eo({inheritEditableFromParent:n.inheritEditableFromParent}),config:He({$getParentEditor:function(){let e=We();return pr.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,n,r)=>{let s=n.$getParentEditor();e.parentEditor=s,e.theme=e.theme||s._config.theme},name:"@lexical/extension/NestedEditor",register:(e,n,r)=>Zt(()=>{let s=e._parentEditor;if(s&&r.getOutput().inheritEditableFromParent.value)return e.setEditable(s.isEditable()),s.registerEditableListener(e.setEditable.bind(e))})}),jD=_e({config:He({attribute:"data-selected",nodes:[]}),init(e,n){let r=new Set,s=Ou(EN(e).nodes);for(let i of n.nodes){let a=i.getType(),l=s.get(a);l===void 0&&tt(339,i.name,a),r.add(a);for(let c of l)r.add(c)}return{matchTypes:r}},mergeConfig:(e,n)=>zt(e,{...n,...n.nodes&&{nodes:[...e.nodes,...n.nodes]}}),name:"@lexical/extension/NodeSelectionDataSelected",register(e,n,r){let{attribute:s}=n,{matchTypes:i}=r.getInitResult(),a=new Map,l=(d)=>{let f=new Set;d.read(()=>{let g=X();if(Ze(g))for(let p of g.getNodes())i.has(p.getType())&&f.add(p.getKey())});for(let[g,p]of a)f.has(g)||(p.removeAttribute(s),a.delete(g));for(let g of f){let p=e.getElementByKey(g);p!==null&&(p.setAttribute(s,"true"),a.set(g,p))}};l(e.getEditorState());let c=e.registerUpdateListener(({editorState:d})=>l(d));return()=>{c();for(let d of a.values())d.removeAttribute(s);a.clear()}}});function pN(e){Q(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var YD=_e({build:(e,n,r)=>Eo(n),config:He({disabled:!1}),name:"@lexical/NormalizeInlineElements",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value){let i=[];for(let{klass:a,transforms:l}of e._nodes.values())a.prototype instanceof ct&&a.prototype.isInline!==ct.prototype.isInline&&(l.add(pN),i.push(()=>l.delete(pN)));return()=>i.forEach((a)=>a())}})}}),VD=new Set([Su,uS]),XD=_e({build:(e,n,r)=>Eo(n),config:He({$fixFocusOverselection:function(){let e=X();if(j(e)&&!e.isCollapsed()){let n=dr(cr(e),"next"),r=n.focus;for(Hr(r)&&n.anchor.origin!==r.origin&&r.offset===0&&(r=Uo(r.getSiblingCaret())),So(r)&&n.anchor.origin!==r.origin&&Ue(r.origin)&&(r=Uo(r));Ko(r)&&n.anchor.origin!==r.origin;)r=Uo(it(r.origin,"next"));if(So(r)&&Q(r.origin)&&(r=It(bt(r.origin,"previous")).getFlipped()),r=It(r),!r.isSamePointCaret(n.focus)){let s=wn(Jn(n.anchor,r)),i=We().getRootElement(),a=i&&Ln(i.ownerDocument.defaultView);a&&Gy(En(),s,We(),a,VD,i)}}},dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(!i)return;let a=0,l=(c)=>{if(c?c.detail===3:a>0){let d=s.dateNow.peek()();a=c&&c.type==="mousedown"||d-a<=s.thresholdMsec.peek()?d:0}return a};return Ae(e.registerCommand(oo,()=>(l(null)&&(a=0,s.$fixFocusOverselection.peek()()),!1),Vy),Jr(i,{mousedown:l,mouseup:l},!0))})})});function qD(e){let n=e.target;SS(e,"a",{ctrlKey:!hl,metaKey:hl})&&ye(n)&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.addEventListener("keydown",Xg,{once:!0})}var Ap=_e({build:(e,n,r)=>Eo(n),config:He({disabled:!1}),name:"@lexical/extension/PreventSelectAll",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return e.registerRootListener((i)=>{if(i)return so(i,"keydown",qD,!0)})})}}),JD=_e({build:(e)=>Ml(()=>e.getRootElement(),(n)=>e.registerRootListener((r)=>{n.value=r})),name:"@lexical/extension/RootElement"}),ZD=_e({build:(e,n,r)=>Eo(n),config:He({cascadeSelection:!1,disabled:!1}),dependencies:[Ap],name:"@lexical/extension/SelectBlock",register:(e,n,r)=>{let s=r.getOutput(),i=r.getDependency(Ap).output;return Ae(Zt(()=>{i.disabled.value=s.disabled.value}),Zt(()=>{if(!s.disabled.value)return e.registerCommand($i,(a,l)=>{if(l!==e){if(!s.cascadeSelection.peek())return!1;return!!l.read("pending",()=>{let h=X();return j(h)&&Ol(Je(),h)})&&(Wr(),!0)}let c=X();if(Ze(c)){let h=c.getNodes(),x=h[0];if(!x)return!1;let y=x.getTopLevelElement();return!y||yo(y)||y.is(x)||h.length>1&&(d=y,!h.every((N)=>d.is(N.getTopLevelElement())))?Wr():Q(y)&&y.select(0,y.getChildrenSize()),!0}var d;if(!j(c))return!1;let f=c.anchor.getNode(),g=f.getTopLevelElement();if(g&&g.is(c.focus.getNode().getTopLevelElement())&&!Ol(g,c))return g.select(0,g.getChildrenSize()),!0;let p=Zn(f);for(;p!==null;){if(Q(p)&&!Ol(p,c))return p.select(0,p.getChildrenSize()),!0;let h=Vc(p);p=h===null?null:Zn(h)}return Ol(Je(),c)||Wr(),!0},Fe)}))}}),QD=_e({build:(e,n,r)=>Eo(n),config:He({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return aN(e,s.onReposition.value)})}});function LN(e){return e.canIndent()}function FN(e,n,r=LN){return Ae(e.registerCommand(Vr,(s)=>{let i=X();if(!j(i))return!1;s.preventDefault();let a=function(l){if(l.getNodes().filter((h)=>Ur(h)&&h.canIndent()).length>0)return!0;let{anchor:c,focus:d}=l,f=d.isBefore(c)?d:c,g=f.getNode(),p=ku(g);if(p.canIndent()){let h=p.getKey(),x=Kr();if(x.anchor.set(h,0,"element"),x.focus.set(h,0,"element"),x=zo(x),x.anchor.is(f))return!0}return!1}(i)?s.shiftKey?jo:to:Ds;return e.dispatchCommand(a)},Te),e.registerCommand(to,()=>{let s=typeof n=="number"?n:n?n.peek():null,i=X();if(!j(i))return!1;let a=typeof r=="function"?r:r.peek();return vl((l)=>{if(a(l)){let c=l.getIndent()+1;(!s||c<s)&&l.setIndent(c)}})},Si))}var e$=_e({build:(e,n,r)=>Eo(n),config:He({$canIndent:LN,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,n,r){let{disabled:s,maxIndent:i,$canIndent:a}=r.getOutput();return Zt(()=>{if(!s.value)return FN(e,i,a)})}}),t$=_e({build:(e)=>Ml(()=>e.isEditable(),(n)=>e.registerEditableListener((r)=>{n.value=r})),name:"@lexical/extension/WatchEditable"});var Ne=kp,{$applyFormatToDom:IP,$createHorizontalRuleNode:Gu,$defaultShouldInsertAfter:LP,$getExtensionDependency:FP,$getExtensionOutput:PN,$getPeerDependency:BN,$isDecoratorTextNode:PP,$isHorizontalRuleNode:KN,AutoFocusExtension:BP,ClearEditorExtension:KP,ClickAfterLastBlockExtension:zP,DecoratorTextExtension:UP,DecoratorTextNode:HP,EditorStateExtension:WP,HorizontalRuleExtension:zN,HorizontalRuleNode:ju,IMEExtension:GP,INSERT_HORIZONTAL_RULE_COMMAND:jP,InitialStateExtension:YP,LexicalBuilder:UN,NestedEditorExtension:VP,NodeSelectionDataSelectedExtension:XP,NodeSelectionExtension:qP,NormalizeInlineElementsExtension:HN,NormalizeTripleClickSelectionExtension:WN,PreventSelectAllExtension:JP,RootElementExtension:ZP,SelectBlockExtension:QP,SelectionAlwaysOnDisplayExtension:eB,TabIndentationExtension:tB,WatchEditableExtension:nB,applyFormatFromStyle:oB,applyFormatToDom:rB,batch:Ip,buildEditorFromExtensions:sB,computed:iB,configExtension:GN,declarePeerDependency:aB,defineExtension:lB,effect:Nt,getExtensionDependencyFromEditor:cB,getKnownTypesAndNodes:jN,getPeerDependencyFromEditor:io,getPeerDependencyFromEditorOrThrow:uB,namedSignals:wt,registerClearEditor:dB,registerTabIndentation:Yu,safeCast:fB,shallowMergeConfig:gB,signal:zs,untracked:pB,watchedSignal:YN}=Ne;var Lp={};je(Lp,{ReactProviderExtension:()=>n$});var n$=_e({name:"@lexical/react/ReactProvider"});var o$=Lp,VN=o$.ReactProviderExtension;var Pp={};je(Pp,{$canShowPlaceholder:()=>qN,$canShowPlaceholderCurry:()=>s$,$findTextIntersectionFromCharacters:()=>i$,$isRootTextContentEmpty:()=>Fp,$isRootTextContentEmptyCurry:()=>r$,$rootTextContent:()=>XN,registerLexicalTextEntity:()=>l$});function XN(){return Je().getTextContent()}function Fp(e,n=!0){if(e)return!1;let r=XN();return n&&(r=r.trim()),r===""}function r$(e,n){return()=>Fp(e,n)}function qN(e){if(!Fp(e,!1))return!1;let n=Je().getChildren(),r=n.length;if(r>1)return!1;for(let s=0;s<r;s++){let i=n[s];if(kt(i))return!1;if(Q(i)){if(!$n(i))return!1;if(i.__indent!==0)return!1;let a=i.getChildren(),l=a.length;for(let c=0;c<l;c++){let d=a[s];if(!re(d))return!1}}}return!0}function s$(e){return()=>qN(e)}function i$(e,n){let r=e.getFirstChild(),s=0;e:for(;r!==null;){if(Q(r)){let l=r.getFirstChild();if(l!==null){r=l;continue}}else if(re(r)){let l=r.getTextContentSize();if(s+l>n)return{node:r,offset:n-s};s+=l}let i=r.getNextSibling();if(i!==null){r=i;continue}let a=r.getParent();for(;a!==null;){let l=a.getNextSibling();if(l!==null){r=l;continue e}a=a.getParent()}break}return null}function a$(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l$(e,n,r,s){let i=(l)=>l instanceof r,a=(l)=>{let c=yt(l.getTextContent());c.setFormat(l.getFormat()),l.replace(c)};return[e.registerNodeTransform(In,(l)=>{if(!l.isSimpleText())return;let c,d=l.getPreviousSibling(),f=l.getTextContent(),g=l;if(re(d)){let h=d.getTextContent(),x=n(h+f);if(i(d)){if(x===null||((y)=>y.getLatest().__mode)(d)!==0)return void a(d);{let y=x.end-h.length;if(y>0){let N=h+f.slice(0,y);if(d.select(),d.setTextContent(N),y===f.length)l.remove();else{let E=f.slice(y);l.setTextContent(E)}return}}}else if(x===null||x.start<h.length)return}let p=0;for(;;){c=n(f);let h,x=c===null?"":f.slice(c.end);if(f=x,x===""){let N=g.getNextSibling();if(re(N)){x=g.getTextContent()+N.getTextContent();let E=n(x);if(E===null)return void(i(N)?a(N):N.markDirty());if(E.start!==0)return}}if(c===null)return;if(c.start===0&&re(d)&&d.isTextEntity()){p+=c.end;continue}c.start===0?[h,g]=g.splitText(c.end):[,h,g]=g.splitText(c.start+p,c.end+p),h===void 0&&a$(165,"nodeToReplace");let y=s(h);if(y.setFormat(h.getFormat()),h.replace(y),g==null)return;p=0,d=y}}),e.registerNodeTransform(r,(l)=>{let c=l.getTextContent(),d=n(c);if(d===null||d.start!==0)return void a(l);if(c.length>d.end)return void l.splitText(d.end);let f=l.getPreviousSibling();re(f)&&f.isTextEntity()&&(a(f),a(l));let g=l.getNextSibling();re(g)&&g.isTextEntity()&&(a(g),i(l)&&a(l))})]}var Us=Pp,{$canShowPlaceholder:CB,$canShowPlaceholderCurry:Vu,$findTextIntersectionFromCharacters:yB,$isRootTextContentEmpty:SB,$isRootTextContentEmptyCurry:NB,$rootTextContent:EB,registerLexicalTextEntity:TB}=Us;var Bp={};je(Bp,{DragonExtension:()=>g$,installDragonSupport:()=>u$,registerDragonSupport:()=>QN});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?ZN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function ZN(e,n,r){let s=function(i){let a=i[Xu];return a===void 0&&(a={dispose:()=>{},editors:new Map,installs:new Set},i[Xu]=a),a}(e);if(s.installs.size===0){let i=f$.bind(e);e.addEventListener("message",i,!0),s.dispose=()=>{e.removeEventListener("message",i,!0)}}if(s.installs.add(n),r){let i=s.editors.get(r)||new Set;i.add(n),s.editors.set(r,i)}return d$.bind(null,e,s,n,r)}function d$(e,n,r,s){if(s){let i=n.editors.get(s);i&&i.delete(r)&&i.size===0&&n.editors.delete(s)}n.installs.delete(r)&&n.installs.size===0&&(n.dispose(),delete e[Xu])}function JN(e){return e&&e.ownerDocument.defaultView}function QN(e){let n=YN(()=>JN(e.getRootElement()),(r)=>e.registerRootListener((s)=>{r.value=JN(s)}));return Nt(()=>{let r=n.value;if(r)return ZN(r,Symbol("@lexical/dragon/editorInstall"),e)})}function f$(e){if(e.origin!==this.location.origin)return;let n=function(s){let i=s[Xu];if(i===void 0)return null;let a=bu(pS(s.document));return Ru(a)&&i.editors.has(a)?a:null}(this);if(n===null)return;let r=e.data;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch(i){return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let a=i.args;if(Array.isArray(a)){let[l,c,d,f,g,p]=a;if(![l,c,f,g].every(Number.isFinite)||typeof d!="string"&&d!==-1)return;n.update(()=>{let h=X();if(j(h)){let x=h.anchor,y=x.getNode(),N=0,E=0;if(re(y)&&l>=0&&c>=0&&(N=l,E=l+c,h.setTextNodeRange(y,N,y,E)),typeof d!="string"||N===E&&d===""||(h.insertRawText(d),y=x.getNode()),re(y)){let T=y.getTextContentSize();N=Math.min(Math.max(f,0),T),E=f<0||g<0?N:Math.min(f+g,T),h.setTextNodeRange(y,N,y,E)}if(typeof p=="string"&&g>0&&!h.isCollapsed()){let T=c$[p];T!==void 0&&h.formatText(T)}e.stopImmediatePropagation()}})}}}}}var g$=_e({build:(e,n,r)=>wt(n),config:He({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,n,r)=>Nt(()=>r.getOutput().disabled.value?void 0:QN(e))});var Kp=Bp,{DragonExtension:eE,installDragonSupport:AB,registerDragonSupport:tE}=Kp;var nh={};je(nh,{$appendNodeToHTML:()=>pw,$distributeInlineWrapper:()=>IE,$generateDOMFromNodes:()=>YE,$generateDOMFromRoot:()=>fw,$generateHtmlFromNodes:()=>gw,$generateNodesFromDOM:()=>dw,$generateNodesFromDOMViaExtension:()=>aw,$getImportContextValue:()=>kE,$getRenderContextValue:()=>x$,$getSessionDOMRenderConfig:()=>ed,$inlineStylesFromStyleSheets:()=>hE,$isBlockLevel:()=>Wi,$propagateTextAlignToBlockChildren:()=>LE,$setRenderContextValue:()=>C$,$updateRenderContextValue:()=>y$,$withImportContext:()=>Zp,$withRenderContext:()=>Jp,BlockSchema:()=>PE,CoreImportExtension:()=>GE,CoreImportRules:()=>zE,DOMImportExtension:()=>th,DOMRenderExtension:()=>k$,HorizontalRuleImportExtension:()=>cw,HorizontalRuleImportRules:()=>lw,ImportOverlays:()=>DE,ImportSource:()=>z$,ImportSourceDataTransfer:()=>U$,ImportTextFormat:()=>Ju,ImportTextStyle:()=>OE,ImportWhitespaceConfig:()=>ME,InlineSchema:()=>H$,NestedBlockSchema:()=>W$,RenderContextExport:()=>Xp,RenderContextRoot:()=>xE,RootSchema:()=>BE,contextUpdater:()=>m$,contextValue:()=>Dl,createImportState:()=>Ws,createRenderState:()=>Vp,defaultIsInline:()=>RE,defaultPreservesWhitespace:()=>AE,defineImportRule:()=>mr,defineOverlayRules:()=>ow,domOverride:()=>S$,isElementOfTag:()=>B$,parseSelector:()=>vE,sel:()=>uw});function Hs(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hi;function es(e,n){let{key:r}=n;return e&&r in e?e[r]:n.defaultValue}function jp(e){return Hi&&Hi.editor===e?Hi:void 0}function Zu(e,n){let r=jp(n);return r&&r[e]}function p$(e,n){if("cfg"in n){let{cfg:r,updater:s}=n;return[r,s(es(e,r))]}return n}function qu(e,n){let r=n;for(let s of e){let[i,a]=p$(r,s),l=i.key;if(r===n&&es(r,i)===a)continue;let c=r===n||r===void 0?h$(n):r;c[l]=a,r=c}return r}function h$(e){return Object.create(e||null)}function Dl(e,n){return[e,n]}function m$(e,n){return{cfg:e,updater:n}}function fE(e,n,r,s=We()){let i=Hi,a=jp(s);try{return Hi={...a,editor:s,[e]:n},r()}finally{Hi=i}}function gE(e,n=()=>{}){return(r,s=We())=>(i)=>{let a=jp(s),l=a&&a[e],c=qu(r,l||n(s));return c&&c!==l?fE(e,c,i,s):i()}}function pE(e,n,r,s){return Object.assign(Yo(Symbol(n),{isEqual:s,parse:r}),{[e]:!0})}var hE=(e,n,r)=>{mE(e),r()};function mE(e){if(!qr(e))return;let n=e;if(n.querySelector("style")===null)return;let r=new Map;function s(i){let a=r.get(i);if(a===void 0){a=new Set;for(let l=0;l<i.style.length;l++)a.add(i.style[l]);r.set(i,a)}return a}try{for(let i of Array.from(n.styleSheets)){let a;try{a=i.cssRules}catch(l){continue}for(let l of Array.from(a)){if(!Fn(l,CSSStyleRule))continue;let c;try{c=n.querySelectorAll(l.selectorText)}catch(d){continue}for(let d of Array.from(c)){if(!ye(d))continue;let f=s(d);for(let g=0;g<l.style.length;g++){let p=l.style[g];f.has(p)||d.style.setProperty(p,l.style.getPropertyValue(p),l.style.getPropertyPriority(p))}}}}}catch(i){}}var Yp="@lexical/html/DOM",Qu=Symbol.for("@lexical/html/DOMExportContext"),_E="@lexical/html/DOMImport",$l=Symbol.for("@lexical/html/DOMImportContext"),_$=()=>!0;function Vp(e,n,r){return pE(Qu,e,n,r)}var xE=Vp("root",Boolean),Xp=Vp("isExport",Boolean);function CE(e){let n=io(e,Yp);return n?n.output.defaults:void 0}function x$(e,n=We()){return es(function(r){return Zu(Qu,r)||CE(r)}(n),e)}function qp(e){let n=io(e,Yp);return n?n.output.runtime:void 0}function C$(e,n,r=We()){let s=qp(r);s&&s.setContextValue(e,n)}function y$(e,n,r=We()){let s=qp(r);s&&s.setContextValue(e,n(es(s.editorContext,e)))}function ed(e=We()){let n=qp(e);return n?n.getSessionConfig():Kg(e)}var Jp=gE(Qu,CE);function S$(e,n,r){return{...n,...r,nodes:e}}function N$(e){return(n)=>n instanceof e}function E$(e,{nodes:n}){if(n==="*")return _$;let r={},s=[];for(let i of n)if("getType"in i){let a=i.getType();if(r){let l=e.get(a);l===void 0&&Hs(339,i.name,a);for(let c of l)r[c]=!0}s.push(N$(i))}else r=void 0,s.push(i);return r||(s.length===1?s[0]:(i)=>{for(let a of s)if(a(i))return!0;return!1})}function nE(e){return(n,r,s)=>e(n,s)}function zp(e){return(n,r,s,i)=>e(n,r,i)}function oE(e){return(n,r,s,i,a)=>e(n,r,s,a)}function T$(e){return(n,r,s,i,a,l)=>e(n,r,s,i,l)}function rE(e,n){return(r,s)=>{let i=()=>e(r,s),a=n(r);return a?a(r,i,s):i()}}function Up(e,n){return(r,s,i)=>{let a=()=>e(r,s,i),l=n(r);return l?l(r,s,a,i):a()}}var b$=Up,v$=zp;function sE(e,n){return(r,s,i,a)=>{let l=()=>e(r,s,i,a),c=n(r);return c?c(r,s,i,l,a):l()}}function O$(e,n){return(r,s,i,a,l)=>{let c=()=>e(r,s,i,a,l),d=n(r);return d?d(r,s,i,a,c,l):c()}}function A$(e,n){return(r,s,i,a)=>{e(r,s,i,a);let l=n(r);l&&l(r,s,i,a)}}function hr(e,n,r,s,i){let a=r[n];for(let l of e[n])if(typeof l[0]=="function"){let[c,d]=l;a=s(a,(f)=>c(f)&&d||void 0)}else{let c=l[1],d={};for(let f in c){let g=c[f];g&&(d[f]=g.reduce((p,h)=>s(p,()=>h),a))}a=s(a,(f)=>{let g=d[f.getType()];return g&&i(g)})}r[n]=a}function R$(e,n,r,s){if(!s)return;let i=e[n];if(typeof r=="function")i.push([r,s]);else{let a=i[i.length-1],l;a&&a[0]==="types"?l=a[1]:(l={},i.push(["types",l]));for(let c in r){let d=l[c]||[];l[c]=d,d.push(s)}}}function M$(e){return e.nodes==="*"}function D$(e,n){let r=Ou(jN(e).nodes),s={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let i of function(a){let l=[],c=[],d=[];for(let p of a)if(M$(p))l.push(p);else if(Array.isArray(p.nodes))for(let h of p.nodes)Ug(h.prototype)?d.push(p.nodes.length===1?p:{...p,nodes:[h]}):c.push(p.nodes.length===1?p:{...p,nodes:[h]});let f=new Map,g=(p)=>{let h=f.get(p);if(h===void 0){h=-1;for(let x of vS(p))h++;f.set(p,h)}return h};return d.sort((p,h)=>g(p.nodes[0])-g(h.nodes[0])),[...d,...c,...l]}(n)){let a=E$(r,i);for(let l in s)R$(s,l,a,i[l])}return s}function $$(e){return e}function Hp(e,{overrides:n}){let r=D$(e,n),s={...Wg,...e.dom};return hr(r,"$createDOM",s,rE,nE),hr(r,"$exportDOM",s,rE,nE),hr(r,"$extractWithChild",s,O$,T$),hr(r,"$getDOMSlot",s,b$,v$),hr(r,"$shouldExclude",s,Up,zp),hr(r,"$shouldInclude",s,Up,zp),hr(r,"$getSlotTargetElement",s,sE,oE),hr(r,"$updateDOM",s,sE,oE),hr(r,"$decorateDOM",s,A$,$$),s}function yE(e){return{get:(n)=>es(e,n)}}function iE(e){let n=Object.create(null);return qu(e,n)||n}function Wp(e,n){let r=yE(n);return e.filter((s)=>!(s.disabledForEditor&&s.disabledForEditor(r)))}function w$(e){if(e.nodes==="*")return()=>!0;let n=e.nodes.map((r)=>{let s=r;return Ug(s.prototype)?(i)=>i instanceof s:r});return(r)=>n.some((s)=>s(r))}class SE{editor;initialEditorConfig;overrides;editorContext;hasSessionGates;installed;sessionCache=new Map;constructor(e,n,r,s){this.editor=e,this.initialEditorConfig=n,this.overrides=r,this.editorContext=s,this.installed=Wp(r,s),this.hasSessionGates=r.some((i)=>i.disabledForSession)}setContextValue(e,n){let r=this.installed;this.editorContext[e.key]=n;let s=Wp(this.overrides,this.editorContext);if(function(d,f){if(d.length!==f.length)return!1;for(let g=0;g<d.length;g++)if(d[g]!==f[g])return!1;return!0}(r,s))return;let i=function(d,f){let g=new Set(d),p=new Set(f),h=[];for(let x of d)p.has(x)||h.push(x);for(let x of f)g.has(x)||h.push(x);return h}(r,s);this.installed=s,this.sessionCache.clear();let a=Hp(this.initialEditorConfig,{overrides:s});this.editor._config.dom=a;let l=function(d){let f=[];for(let g of d)(g.$createDOM||g.$getDOMSlot||g.$decorateDOM)&&f.push(w$(g));return f.length===0?null:(g)=>f.some((p)=>p(g))}(i);if(!l)return;let c=a.$updateDOM;a.$updateDOM=(d,f,g,p)=>!!l(d)||c(d,f,g,p),this.editor.update(xi,{discrete:!0}),a.$updateDOM=c}getSessionConfig(){let e=this.editor._config.dom||Wg;if(!this.hasSessionGates)return e;let n=yE(Zu(Qu,this.editor)||this.editorContext),r=[],s=[];if(this.installed.forEach((l,c)=>{l.disabledForSession&&l.disabledForSession(n)?r.push(String(c)):s.push(l)}),r.length===0)return e;let i=r.join(","),a=this.sessionCache.get(i);return a||(a=Hp(this.initialEditorConfig,{overrides:s}),this.sessionCache.set(i,a)),a}}var k$=_e({build(e,n,r){let{initialEditorConfig:s}=r.getInitResult(),i=iE(n.contextDefaults);return{defaults:i,runtime:new SE(e,s,n.overrides,i)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Cu,()=>{let e=Xe().createElement("div");return e.role="textbox",{element:e}}]])},init(e,n){let r={dom:e.dom,nodes:e.nodes},s=iE(n.contextDefaults),i=Wp(n.overrides,s);return e.dom=Hp(e,{overrides:i}),{initialEditorConfig:r}},mergeConfig(e,n){let r=zt(e,n);for(let s of["overrides","contextDefaults"])n[s]&&(r[s]=[...e[s],...n[s]]);return r},name:Yp}),td=Symbol.for("@lexical/html/SelectorImpl");function wl(e,n){let r={kind:"element",predicate:(s=n,s.length===0?ye:s.length===1?s[0]:(a,l)=>{for(let c of s)if(!c(a,l))return!1;return!0}),tags:e};var s;let i=(a)=>wl(e,[...n,a]);return{[td]:r,attr:(a,l,c)=>i(Gp(a,l,c)),classAll:(...a)=>i(EE(a)),classAny:(...a)=>i(function(l){let c=NE(l);if(c.length===0)return()=>!1;return(d)=>{if(!ye(d))return!1;let f=d.classList;for(let g of c)if(f.contains(g))return!0;return!1}}(a)),styleAny:(a,l,c)=>i(function(d,f,g){if(typeof f=="string")return(p)=>ye(p)&&p.style.getPropertyValue(d)===f;if(f instanceof RegExp){let p=g&&g.capture,h=f;return(x,y)=>{if(!ye(x))return!1;let N=x.style.getPropertyValue(d);if(!N)return!1;let E=N.match(h);return E!==null&&(p!==void 0&&(y[p]=E),!0)}}Hs(362,JSON.stringify(d))}(a,l,c))}}function NE(e){let n=[];for(let r of e)r&&n.push(r);return n}function EE(e){let n=NE(e);return n.length===0?()=>!0:(r)=>{if(!ye(r))return!1;let s=r.classList;for(let i of n)if(!s.contains(i))return!1;return!0}}function Gp(e,n,r){if(n===!0)return(s)=>ye(s)&&s.hasAttribute(e);if(typeof n=="string")return(s)=>ye(s)&&s.getAttribute(e)===n;if(n instanceof RegExp){let s=r&&r.capture,i=n;return(a,l)=>{if(!ye(a))return!1;let c=a.getAttribute(e);if(c==null)return!1;let d=c.match(i);return d!==null&&(s!==void 0&&(l[s]=d),!0)}}Hs(361,JSON.stringify(e))}var I$={kind:"text",predicate:Fs,tags:new Set},L$={[td]:I$},F$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},P$={[td]:F$},Ui={any:()=>wl(new Set,[]),comment:()=>P$,tag(...e){e.length>0||Hs(363);let n=new Set;for(let r of e)n.add(r.toUpperCase());return wl(n,[])},text:()=>L$};function B$(e,n){return ye(e)&&e.nodeName===n.toUpperCase()}var TE=/[A-Za-z0-9_-]/;class bE{constructor(e,n){this.source=e,this.pos=n}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()&&TE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e==='"'||e==="'","expected quote");let n=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let r=this.source.slice(n,this.pos);return this.pos++,r.replace(/\\(.)/g,"$1")}assert(e,n){e||Hs(364,String(this.pos+1),n,this.source)}}function K$(e){let n=new Set,r=[],s=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(TE.test(e.peek())){let i=e.readIdent();i&&n.add(i.toUpperCase())}for(;!e.eof();){let i=e.peek();if(i==="."){e.consume();let a=e.readIdent();e.assert(a!=="",'expected class name after "."'),s.push(a)}else if(i==="#"){e.consume();let a=e.readIdent();e.assert(a!=="",'expected id after "#"'),r.push(Gp("id",a))}else{if(i!=="[")break;{e.consume(),e.skipWhitespace();let a=e.readIdent();e.assert(a!=="",'expected attribute name after "["'),e.skipWhitespace();let l=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let c=e.peek();c==='"'||c==="'"?l=e.readQuoted():(l=e.readIdent(),e.assert(l!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),r.push(Gp(a,l))}}}return s.length>0&&r.push(EE(s)),{predicates:r,tags:n}}function vE(e){let n=new bE(e,0),r=[];for(;;){let i=K$(n);if(r.push(i),n.skipWhitespace(),n.eof())break;n.assert(n.peek()===",",'expected "," (selector lists are the only supported combinator)'),n.consume(),n.skipWhitespace()}if(r.length===1)return wl(r[0].tags,r[0].predicates);let s=new Set;if(r.every((i)=>i.tags.size>0))for(let i of r)for(let a of i.tags)s.add(a);return wl(s,[(i,a)=>{for(let l of r){let c=i.nodeName;if(l.tags.size>0&&!l.tags.has(c))continue;let d=!0;for(let f of l.predicates)if(!f(i,a)){d=!1;break}if(d)return!0}return!1}])}function mr(e){return e}function Ws(e,n,r){return pE($l,e,n,r)}var z$=Ws("importSource",()=>"unknown"),U$=Ws("importSourceDataTransfer",()=>null),Ju=Ws("textFormat",()=>0),OE=Ws("textStyle",()=>({}));function AE(e){if(!ye(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function RE(e){if(Fs(e))return!0;if(!ye(e))return!1;let n=e.style.display;return n?n.startsWith("inline"):!Is(e)&&Ii(e)}var ME=Ws("whitespaceConfig",()=>({isInline:RE,preservesWhitespace:AE})),DE=Ws("importOverlays",()=>[]);class $E{constructor(e){this.record=e}get(e){return es(this.record,e)}set(e,n){this.record[e.key]=n}update(e,n){this.record[e.key]=n(es(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function wE(e){let n=io(e,_E);return n?n.output.defaults:void 0}function kE(e,n=We()){return es(function(r){return Zu($l,r)||wE(r)}(n),e)}var Zp=gE($l,wE);function Wi(e){return Ur(e)||kt(e)&&!e.isInline()}function IE(e,n){let r=[],s=[],i=()=>{s.length!==0&&(r.push(n().splice(0,0,s)),s=[])};for(let a of e)if(Wi(a)){if(i(),Q(a)){let l=IE(a.getChildren(),n);a.splice(0,a.getChildrenSize(),l)}r.push(a)}else s.push(a);return i(),r}function LE(e,n){if(!ye(n))return e;let r=n.style.textAlign;if(!Qp(r))return e;for(let s of e)Ur(s)&&s.getFormatType()===""&&s.setFormat(r);return e}function FE(e,n,r){e.length===1&&Ue(e[0])&&(e=[]);let s=Se();if(ye(r)){let i=r.style.textAlign;Qp(i)&&s.setFormat(i)}return[s.splice(0,0,e)]}var PE={$accepts:Wi,$packageRun:FE,name:"BlockSchema"},H$={$accepts:(e)=>!Wi(e),name:"InlineSchema"},W$={$accepts:Wi,$packageRun:(e)=>e,name:"NestedBlockSchema"},BE={$accepts:Wi,$packageRun:FE,name:"RootSchema"},Gs=Ui,G$=new Set(["center","end","justify","left","right","start"]);function Qp(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:oS,MARK:rS},V$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),X$=mr({$import:(e,n)=>{let r=e.get(Ju),s=j$[n.nodeName],i=function(h){return{fontStyle:h.style.fontStyle,fontWeight:h.style.fontWeight,textDecoration:h.style.textDecoration,verticalAlign:h.style.verticalAlign}}(n),a=s?(l=s,{fontStyle:(c=i).fontStyle||l.fontStyle,fontWeight:c.fontWeight||l.fontWeight,textDecoration:c.textDecoration||l.textDecoration,verticalAlign:c.verticalAlign||l.verticalAlign}):i;var l,c;let d=(f=r,g=function(h){let x=0,y=0,{fontWeight:N,fontStyle:E,textDecoration:T,verticalAlign:b}=h;if(N==="700"||N==="bold"?x|=ml:N!=="normal"&&N!=="400"||(y|=ml),E==="italic"?x|=xl:E==="normal"&&(y|=xl),T){let v=T.split(" ");v.includes("underline")&&(x|=yl),v.includes("line-through")&&(x|=Cl),v.includes("none")&&(y|=yl|Cl)}return b==="sub"?(x|=gu,y|=pu):b==="super"?(x|=pu,y|=gu):b==="baseline"&&(y|=gu|pu),{clear:y,set:x}}(a),f&~g.clear|g.set);var f,g;let p=Y$[n.nodeName];return p&&(d|=p),d===r?e.$importChildren(n):e.$importChildren(n,{context:[Dl(Ju,d)]})},match:Gs.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function aE(e,n,r){let s=e;for(;;){let i=null;for(;(i=n?s.nextSibling:s.previousSibling)===null;){let l=s.parentNode;if(l===null)return null;s=l}if(s=i,!r.isInline(s))return null;let a=s;for(;(a=n?s.firstChild:s.lastChild)!==null;)s=a;if(Fs(s))return s;if(s.nodeName==="BR")return null}}function lE(e,n){return n!==0&&re(e)?e.setFormat(n):e}function cE(e,n){if(re(e)){let r=function(s){let i="";for(let a in s)V$.has(a)||(i+=`${a}: ${s[a]}; `);return i.trimEnd()}(n);r!==""&&e.setStyle(r)}return e}var q$=mr({$import:(e,n)=>{let r=e.get(Ju),s=e.get(OE),i=e.get(ME);if(function(c,d){let f=c.parentNode;for(;f!==null;){if(d.preservesWhitespace(f))return!0;f=f.parentNode}return!1}(n,i)){let c=il(n.textContent||"");for(let d of c)lE(d,r),cE(d,s);return c}let a=function(c,d){let f=(c.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(f.length===0)return"";if(f[0]===" "){let g=c,p=!0;for(;g!==null&&(g=aE(g,!1,d))!==null;){let h=g.textContent||"";if(h.length>0){/[ \t\n]$/.test(h)&&(f=f.slice(1)),p=!1;break}}p&&(f=f.slice(1))}if(f.length>0&&f[f.length-1]===" "){let g=c,p=!0;for(;g!==null&&(g=aE(g,!0,d))!==null;)if((g.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){p=!1;break}p&&(f=f.slice(0,-1))}return f}(n,i);if(a==="")return[];let l=yt(a);return lE(l,r),cE(l,s),[l]},match:Gs.text(),name:"@lexical/html/#text"}),J$=mr({$import:()=>[],match:Gs.tag("script","style"),name:"@lexical/html/script-style-ignore"}),Z$=mr({$import:(e,n)=>TS(n)||ES(n)?[]:[fn()],match:Gs.tag("br"),name:"@lexical/html/br"}),Q$=mr({$import:(e,n)=>{let r=Se();if(Qn(r,n),Zr(n,r),r.getFormatType()===""){let s=n.getAttribute("align");s&&Qp(s)&&r.setFormat(s)}return Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:Gs.tag("p"),name:"@lexical/html/p"}),KE=mr({$import:(e,n,r)=>We().hasNode(ju)?[Gu()]:r(),match:Gs.tag("hr"),name:"@lexical/html/hr"}),zE=[J$,Q$,KE,mr({$import:(e,n,r)=>Is(n)?LE(e.$importChildren(n,{schema:PE}),n):r(),match:Gs.any(),name:"@lexical/html/transparent-block"}),q$,Z$,X$];function ew(e,n){let r=[],s=0,i=0;for(;s<e.length&&i<n.length;)e[s]<=n[i]?r.push(e[s++]):r.push(n[i++]);for(;s<e.length;)r.push(e[s++]);for(;i<n.length;)r.push(n[i++]);return r}function UE(e){let n=[],r=new Map,s=[],i=[],a=[],l=new Set;e.forEach((d,f)=>{let g=function(h){let x=h[td];return x===void 0&&Hs(360),x}(d.match),p=d.name||function(h,x){if(h.kind==="text")return`#text@${x}`;if(h.kind==="comment")return`#comment@${x}`;if(h.tags.size===0)return`*@${x}`;return`${Array.from(h.tags).join(",").toLowerCase()}@${x}`}(g,f);if(d.name&&l.add(d.name),n.push({$import:d.$import,name:p,predicate:g.predicate}),g.kind==="text")i.push(f);else if(g.kind==="comment")a.push(f);else if(g.tags.size===0)s.push(f);else for(let h of g.tags){let x=r.get(h);x||(x=[],r.set(h,x)),x.push(f)}});let c=new Map;if(s.length===0)for(let[d,f]of r)c.set(d,f);else for(let[d,f]of r)c.set(d,ew(f,s));return{byTag:c,commentIndices:a,rules:n,textIndices:i,wildcardIndices:s}}function uE(e,n){return Fs(n)?e.textIndices:n.nodeType===8?e.commentIndices:ye(n)?e.byTag.get(n.nodeName)||e.wildcardIndices:tw}var tw=Object.freeze([]);function HE(e){let n=[];for(let r of e)if(nw(r))for(let s of r.rules)n.push(s);else n.push(r);return n}function nw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function ow(e){let n=HE(e);return{__type:"CompiledOverlayRules",dispatch:UE(n),rules:n}}var rw=Object.freeze({});function sw(e,n){return{$importChildren:(s,i)=>function(a,l,c){let d=c&&c.rules?c.rules.dispatch:void 0;d&&a.overlays.push(d);try{let f=()=>WE(a,l,c);return c&&c.context?Zp(c.context,a.editor)(f):f()}finally{d&&a.overlays.pop()}}(e,s,i),$importOne:(s,i)=>eh(e,s,i),captures:n,get:(s)=>kE(s,e.editor),session:e.session}}function WE(e,n,r){let s=r&&r.$onChild,i=[];for(let c of Array.from(n.childNodes)){let d=eh(e,c,void 0);for(let f of d){let g=s?s(f):f;g!=null&&i.push(g)}}let a=r&&r.$after?r.$after(i):i,l=r&&r.schema;return l?function(c,d,f,g){let p=[],h=null,x=()=>{if(h===null)return;let y=h;if(h=null,c.$packageRun){let N=c.$packageRun(y,f,g);if(N.length>0){for(let E of N)p.push(E);return}}if(c.onReject==="hoist")for(let N of y)p.push(N)};for(let y of d)c.$accepts(y,f)?(x(),p.push(y)):(h===null&&(h=[]),h.push(y));return x(),c.$finalize?c.$finalize(p,f):p}(l,a,null,n):a}function eh(e,n,r){let s=()=>function(i,a){let l=function(g,p){let h=[];for(let y=g.overlays.length-1;y>=0;y--){let N=g.overlays[y],E=uE(N,p);E.length>0&&h.push({dispatch:N,indices:E})}let x=uE(g.dispatch,p);return x.length>0&&h.push({dispatch:g.dispatch,indices:x}),h}(i,a);if(l.length===0)return dE(i,a);let c=0,d=0,f=()=>{for(;c<l.length;){let{dispatch:g,indices:p}=l[c];for(;d<p.length;){let h=p[d++],x=g.rules[h],y={};if(x.predicate(a,y)){let N=sw(i,Object.keys(y).length===0?rw:y);try{return x.$import(N,a,f)}catch(E){throw E}}}c++,d=0}return dE(i,a)};return f()}(e,n);return r&&r.context?Zp(r.context,e.editor)(s):s()}function dE(e,n){if(n.childNodes.length===0)return[];let r=[];for(let s of Array.from(n.childNodes)){let i=eh(e,s,void 0);for(let a of i)r.push(a)}return r}var iw=mr({$import:(e,n)=>e.$importChildren(n),match:Ui.any(),name:"@lexical/html/default-hoist"}),th=_e({build(e,n){let r=UE(HE(n.rules)),s=qu(n.contextDefaults,void 0),i=n.preprocess;return{$generateNodesFromDOM:(a,l)=>{let c=Zu($l,e)||s,d=l&&l.context?qu(l.context,c):c,f=d!==void 0&&d!==c?d:Object.create(c||null),g=new $E(f),p={session:g};return function(h,x,y){let N=h.length-1,E=()=>{for(;N>=0;)return void(0,h[N--])(x,y,E)};E()}(l&&l.preprocess?[...i,...l.preprocess]:i,a,p),fE($l,f,()=>function(h,x,y,N){return WE({dispatch:h,editor:x,overlays:N.get(DE).map((E)=>E.dispatch),session:N},qr(y)?y.body:y,{schema:BE})}(r,e,a,g),e)},defaults:s}},config:{contextDefaults:[],preprocess:[hE],rules:[iw]},mergeConfig:(e,n)=>zt(e,{...n,...n.contextDefaults&&{contextDefaults:[...e.contextDefaults,...n.contextDefaults]},...n.preprocess&&{preprocess:[...e.preprocess,...n.preprocess]},...n.rules&&{rules:[...n.rules,...e.rules]}}),name:_E});function aw(e,n){return PN(th).$generateNodesFromDOM(e,n)}var GE=_e({dependencies:[nn(th,{rules:zE})],name:"@lexical/html/CoreImport"}),lw=[KE],cw=_e({dependencies:[zN,GE],name:"@lexical/html/HorizontalRuleImport"}),uw={any:Ui.any,comment:Ui.comment,css:vE,tag:Ui.tag,text:Ui.text},jE=new Set(["STYLE","SCRIPT"]);function dw(e,n){mE(n);let r=qr(n)?n.body.childNodes:n.childNodes,s=[],i=[];for(let a of r)if(!jE.has(a.nodeName)){let l=VE(a,e,i,!1);if(l!==null)for(let c of l)s.push(c)}return function(a){for(let l of a)l.getParent()&&l.getNextSibling()instanceof fl&&l.insertAfter(fn());for(let l of a){let c=l.getParent();c&&c.splice(l.getIndexWithinParent(),1,l.getChildren())}}(i),s}function YE(e,n=null,r=We()){return Jp([Dl(Xp,!0)],r)(()=>{let s=Je(),i=ed(r),a=j(n)?Zn(n.anchor.getNode()):null,l=e.append.bind(e);for(let c of(Q(a)?a:s).getChildren())nd(r,c,l,n,i);return e})}function fw(e,n=Je()){let r=We();return Jp([Dl(Xp,!0),Dl(xE,!0)],r)(()=>{let s=ed(r),i=e.append.bind(e);return nd(r,n,i,null,s),e})}function gw(e,n=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Hs(338),Oy(e),YE(Xe().createElement("div"),n,e).innerHTML}function nd(e,n,r,s=null,i=Kg(e)){let a=i.$shouldInclude(n,s,e),l=i.$shouldExclude(n,s,e),c=n;s!==null&&re(n)&&(c=Ps(s,n,"clone"));let d=i.$exportDOM(c,e),{element:f,after:g,append:p,$getChildNodes:h}=d;if(!f)return!1;let x=Xe().createDocumentFragment(),y=h?h():Q(c)?c.getChildren():[],N=a&&Ze(s)&&Q(n)?null:s,E=x.append.bind(x);for(let T of y){let b=nd(e,T,E,N,i);!a&&b&&i.$extractWithChild(n,T,s,"html",e)&&(a=!0)}if(a&&!l){if((ye(f)||Yg(f))&&(p?p(x):f.append(x)),r(f),g){let T=g.call(c,f);T&&(Yg(f)?f.replaceChildren(T):f.replaceWith(T))}}else r(x);return a}function pw(e,n,r,s=null){return nd(e,n,r.append.bind(r),s,ed(e))}function VE(e,n,r,s,i=new Map,a){let l=[];if(jE.has(e.nodeName))return l;let c=null,d=function(y,N){let{nodeName:E}=y,T=N._htmlConversions.get(E.toLowerCase()),b=null;if(T!==void 0)for(let v of T){let O=v(y);O!==null&&(b===null||(b.priority||0)<=(O.priority||0))&&(b=O)}return b!==null?b.conversion:null}(e,n),f=d?d(e):null,g=null;if(f!==null){g=f.after;let y=f.node;if(c=Array.isArray(y)?y[y.length-1]:y,c!==null){for(let[,N]of i)if(c=N(c,a),!c)break;c&&l.push(...Array.isArray(y)?y:[c])}f.forChild!=null&&i.set(e.nodeName,f.forChild)}let p=e.childNodes,h=[],x=(c==null||!Dt(c))&&(c!=null&&Ur(c)||s);for(let y=0;y<p.length;y++)h.push(...VE(p[y],n,r,x,new Map(i),c));if(g!=null&&(h=g(h)),Is(e)&&(h=hw(e,h,x?()=>{let y=new fl;return r.push(y),y}:Se)),c==null)if(h.length>0)for(let y of h)l.push(y);else Is(e)&&function(y){if(y.nextSibling==null||y.previousSibling==null)return!1;return Ii(y.nextSibling)&&Ii(y.previousSibling)}(e)&&l.push(fn());else Q(c)&&c.append(...h);return l}function hw(e,n,r){let s=e.style.textAlign,i=[],a=[];for(let l=0;l<n.length;l++){let c=n[l];if(Ur(c))s&&!c.getFormat()&&c.setFormat(s),i.push(c);else if(a.push(c),l===n.length-1||l<n.length-1&&Ur(n[l+1])){let d=r();d.setFormat(s),d.append(...a),i.push(d),a=[]}}return i}var be=nh,{$appendNodeToHTML:kB,$distributeInlineWrapper:XE,$generateDOMFromNodes:IB,$generateDOMFromRoot:LB,$generateHtmlFromNodes:qE,$generateNodesFromDOM:JE,$generateNodesFromDOMViaExtension:ZE,$getImportContextValue:FB,$getRenderContextValue:PB,$getSessionDOMRenderConfig:BB,$inlineStylesFromStyleSheets:KB,$isBlockLevel:QE,$propagateTextAlignToBlockChildren:od,$setRenderContextValue:zB,$updateRenderContextValue:UB,$withImportContext:HB,$withRenderContext:WB,BlockSchema:eT,CoreImportExtension:lo,CoreImportRules:GB,DOMImportExtension:Xo,DOMRenderExtension:jB,HorizontalRuleImportExtension:YB,HorizontalRuleImportRules:VB,ImportOverlays:tT,ImportSource:nT,ImportSourceDataTransfer:oT,ImportTextFormat:oh,ImportTextStyle:rh,ImportWhitespaceConfig:XB,InlineSchema:qB,NestedBlockSchema:JB,RenderContextExport:ZB,RenderContextRoot:QB,RootSchema:eK,contextUpdater:tK,contextValue:Gi,createImportState:nK,createRenderState:oK,defaultIsInline:rK,defaultPreservesWhitespace:sK,defineImportRule:dt,defineOverlayRules:sh,domOverride:iK,isElementOfTag:ih,parseSelector:aK,sel:ft}=be;var dh={};je(dh,{$exportMimeTypeFromSelection:()=>Tw,$generateJSONFromSelectedNodes:()=>gT,$generateNodesFromSerializedNodes:()=>pT,$getClipboardDataFromSelection:()=>hT,$getHtmlContent:()=>ch,$getLexicalContent:()=>uh,$handlePlainTextDrop:()=>Sw,$handleRichTextDrop:()=>yw,$insertDataTransferForPlainText:()=>cT,$insertDataTransferForRichText:()=>uT,$insertGeneratedNodes:()=>id,$writeDragSourceToDataTransfer:()=>Cw,ClipboardDOMImportExtension:()=>xw,ClipboardImportExtension:()=>lh,DEFAULT_IMPORT_MIME_TYPE:()=>sd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>rd,GetClipboardDataExtension:()=>yT,caretFromPoint:()=>iT,copyToClipboard:()=>Nw,setLexicalClipboardDataTransfer:()=>mT});function iT(e,n,r=null){let s=ks(r),i=r?mS(r):[],a=r!==null&&i.length>0;if(a&&typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n,{shadowRoots:i});if(l!==null&&function(c,d){for(let f=c;f!==null;){if(f===d)return!0;f=El(f)}return!1}(l.offsetNode,r))return{node:l.offsetNode,offset:l.offset}}if(a){let l=r.getRootNode();if(Au(l)){let c=l.elementFromPoint(e,n);if(c!==null&&r.contains(c)){let d=function(f,g,p,h){let x=h.createRange(),y=(z)=>g<z.top?z.top-g:g>z.bottom?g-z.bottom:0,N=(z)=>f<z.left?z.left-f:f>z.right?f-z.right:0,E=h.createTreeWalker(p,NodeFilter.SHOW_TEXT),T=null,b=1/0,v=1/0;for(let z=E.nextNode();z;z=E.nextNode()){x.selectNodeContents(z);for(let K of x.getClientRects()){let U=y(K),J=N(K);(U<b||U===b&&J<v)&&(b=U,v=J,T=z)}}if(T===null)return null;let O=0,k=1/0,M=1/0;for(let z=0;z<=T.length;z++){x.setStart(T,z),x.collapse(!0);let K=x.getBoundingClientRect(),U=y(K),J=Math.abs(f-K.left);(U<k||U===k&&J<M)&&(k=U,M=J,O=z)}return{node:T,offset:O}}(e,n,c,s);if(d!==null)return d}}}if(typeof s.caretRangeFromPoint=="function"){let l=s.caretRangeFromPoint(e,n);return l===null?null:{node:l.startContainer,offset:l.startOffset}}if(typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n);return l===null?null:{node:l.offsetNode,offset:l.offset}}return null}function Yi(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.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 aT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(n)=>n}).createHTML(e);return e}var rT=(e,n)=>{if(!j(n))return n.insertRawText(e),!0;let r=(s)=>{let i=X();j(i)&&s(i)};return Fi(e,{linebreak:()=>r((s)=>s.insertParagraph()),tab:()=>r((s)=>s.insertNodes([gn()])),text:(s)=>r((i)=>i.insertText(s))}),!0},sd={"application/x-lexical-editor":[(e,n,r)=>{try{let s=We(),i=JSON.parse(e);if(i&&i.namespace===s._config.namespace&&Array.isArray(i.nodes))return id(s,pT(i.nodes),n),!0}catch(s){console.error(s)}return r()}],"text/html":[(e,n,r)=>{try{let s=We(),i=new DOMParser().parseFromString(aT(e),"text/html");return id(s,JE(s,i),n),!0}catch(s){return console.error(s),r()}}],"text/plain":[rT],"text/uri-list":[rT]};function mw(e,n,r,s){if(!e)return!1;let i=(a)=>!!e[a]&&e[a](n,r,i.bind(null,a-1),s);return i(e.length-1)}function lT(e,n,r){let s=n.getData("text/plain");for(let i of function(a){return Object.keys(a.$importMimeType).filter((l)=>a.$importMimeType[l]!==void 0).sort((l,c)=>{let d=a.priority[l],f=a.priority[c];return d===void 0&&f===void 0?l<c?-1:l>c?1:0:d===void 0?1:f===void 0?-1:d-f})}(e)){let a=n.getData(i);if(a&&((i!=="text/html"||a!==s)&&mw(e.$importMimeType[i],a,r,n)))return!0}return!1}var _w={$importMimeType:sd,$insertDataTransfer:(e,n)=>lT({$importMimeType:sd,priority:rd},e,n),priority:rd},lh=_e({build:(e,n)=>({$importMimeType:n.$importMimeType,$insertDataTransfer:(r,s)=>lT(n,r,s),priority:n.priority}),config:He({$importMimeType:sd,priority:rd}),mergeConfig(e,n){let r=zt(e,n);if(n.$importMimeType){let s={...e.$importMimeType};for(let[i,a]of Object.entries(n.$importMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$importMimeType=s}return n.priority&&(r.priority={...e.priority,...n.priority}),r},name:"@lexical/clipboard/Import"}),xw=_e({dependencies:[lo,GN(lh,{$importMimeType:{"text/html":[(e,n,r,s)=>{let i=new DOMParser().parseFromString(aT(e),"text/html"),a=ZE(i,{context:[Gi(nT,"paste"),Gi(oT,s)]});return id(We(),a,n),!0}]}})],name:"@lexical/clipboard/DOMImport"});function ch(e,n=X()){return n==null&&Yi(166),j(n)&&n.isCollapsed()||n.getNodes().length===0?"":qE(e,n)}function uh(e,n=X()){return n==null&&Yi(166),j(n)&&n.isCollapsed()||n.getNodes().length===0?null:JSON.stringify(gT(e,n))}function cT(e,n){let r=e.getData("text/plain")||e.getData("text/uri-list");r!=null&&n.insertRawText(r)}function uT(e,n,r){(function(){let s=BN(lh.name);return s?s.output:_w})().$insertDataTransfer(e,n)}var dT="application/x-lexical-drag";function Cw(e,n){let r={editorKey:n.getKey()};e.setData(dT,JSON.stringify(r))}function fT(e,n,r){let s=e.dataTransfer;if(s===null)return!1;let i=function(f){let g=f.getData(dT);if(!g)return null;let p;try{p=JSON.parse(g)}catch(x){return null}return(h=p)!==null&&typeof h=="object"&&"editorKey"in h&&typeof h.editorKey=="string"?p:null;var h}(s);if(i===null)return!1;let a=function(f,g){let p=iT(f.clientX,f.clientY,g.getRootElement());if(p===null)return null;let h=vt(p.node);if(h===null)return null;if(re(h))return Xc(h,"next",p.offset);if(Q(h))return Pg(h,p.offset,"next");let x=h.getParent();return x===null?null:Pg(x,h.getIndexWithinParent()+1,"next")}(e,n);if(a===null)return!1;let l=Zc(a);if(l===null)return!1;let c=i.editorKey===n.getKey(),d=X();if(c){if(!j(d)||d.isCollapsed())return!1;if(function(f,g){let{anchor:p,focus:h}=dr(cr(g),"next");return Br(p,f)<0&&Br(f,h)<0}(a,d))return e.preventDefault(),!0;d.removeText()}if(!l.origin.isAttached())return e.preventDefault(),!0;if(r(s,wn(Os(l)),n),!c){let f=n.getRootElement(),g=f?f.ownerDocument:null,p=g?function(h,x){for(let y of fS(x)){let N=bu(y);if(Ru(N)&&N.getKey()===h&&ye(y))return y}return null}(i.editorKey,g):null;p!==null&&p.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function yw(e,n){return fT(e,n,uT)}function Sw(e,n){return fT(e,n,(r,s)=>cT(r,s))}function id(e,n,r){e.dispatchCommand(yu,{nodes:n,selection:r})||(r.insertNodes(n),function(s){if(j(s)&&s.isCollapsed()){let i=s.anchor,a=null,l=dn(i,"previous");if(l)if(Hr(l))a=l.origin;else{let c=Jn(l,bt(Je(),"next").getFlipped());for(let d of c){if(re(d.origin)){a=d.origin;break}if(Q(d.origin)&&!d.origin.isInline())break}}if(a&&re(a)){let c=a.getFormat(),d=a.getStyle();s.format===c&&s.style===d||(s.format=c,s.style=d,s.dirty=!0)}}}(r))}function ah(e,n,r,s=[]){let i=n===null||r.isSelected(n),a=Q(r)&&r.excludeFromCopy("html"),l=r;n!==null&&re(l)&&(l=Ps(n,l,"clone"));let c=Q(l)?l.getChildren():[],d=function(g){let p=g.exportJSON(),h=g.constructor;if(p.type!==h.getType()&&Yi(58,h.name),Q(g)){let x=p.children;Array.isArray(x)||Yi(59,h.name)}return p}(l);re(l)&&l.getTextContentSize()===0&&(i=!1);let f=i&&Ze(n)&&Q(r)?null:n;for(let g=0;g<c.length;g++){let p=c[g],h=ah(e,f,p,d.children);!i&&Q(r)&&h&&r.extractWithChild(p,n,"clone")&&(i=!0)}if(i&&!a){let g=As(l);if(g.length>0){let p={};for(let h of g){let x=Ci(l,h);x===null&&Yi(366,l.constructor.name,h);let y=[];ah(e,null,x,y),y.length===1&&y[0].type===x.getType()||Yi(385,h,l.constructor.name,String(y.length),String(y.length>0?y[0].type:"none")),p[h]=y[0]}d.$slots=p}}if(i&&!a)s.push(d);else if(Array.isArray(d.children))for(let g=0;g<d.children.length;g++){let p=d.children[g];s.push(p)}return i}function gT(e,n){let r=[],s=Je(),i=j(n)?n.anchor.getNode():Ze(n)?n.getNodes()[0]??null:null,a=i!==null?Zn(i):null,l=(Q(a)?a:s).getChildren();for(let c=0;c<l.length;c++)ah(e,n,l[c],r);return{namespace:e._config.namespace,nodes:r}}function pT(e){let n=[];for(let r of e)n.push(zy(r));return n}var ji=null;async function Nw(e,n,r){if(ji!==null)return!1;if(n!==null)return new Promise((f,g)=>{e.update(()=>{f(sT(e,n,r))})});let s=e.getRootElement(),i=e._window||window,a=i.document,l=Ln(i);if(s===null||l===null)return!1;let c=a.createElement("span");c.style.position="fixed",c.style.top="-1000px",c.append(a.createTextNode("#")),s.append(c);let d=a.createRange();return d.setStart(c,0),d.setEnd(c,1),l.removeAllRanges(),l.addRange(d),new Promise((f,g)=>{let p=e.registerCommand(Ni,(h)=>(Fn(h,ClipboardEvent)&&(p(),ji!==null&&(i.clearTimeout(ji),ji=null),f(sT(e,h,r))),!0),Si);ji=i.setTimeout(()=>{p(),ji=null,f(!1)},50),a.execCommand("copy"),c.remove()})}function sT(e,n,r){if(r===void 0){let i=Ln(e._window),a=X();if(!a||a.isCollapsed())return!1;if(!i)return!1;let l=ws(i,e.getRootElement()),{anchorNode:c,focusNode:d}=l;if(c!==null&&d!==null&&!bS(e,c,d))return!1;r=hT(a)}n.preventDefault();let s=n.clipboardData;return s!==null&&(mT(s,r),!0)}var Ew=[["text/html",ch],["application/x-lexical-editor",uh]];function hT(e=X()){return function(n,r){let s={"text/plain":""};for(let[i,a]of Object.entries(n))if(a){let l=CT(a,r);l!==null&&(s[i]=l)}return s}(_T(),e)}function mT(e,n){for(let[r]of Ew)n[r]===void 0&&e.setData(r,"");for(let r in n){let s=n[r];s!==void 0&&e.setData(r,s)}}function _T(e=We()){let n=io(e,yT.name);return n?n.output:xT}var xT={"application/x-lexical-editor":[(e,n)=>e?uh(We(),e):n()],"text/html":[(e,n)=>e?ch(We(),e):n()],"text/plain":[(e,n)=>e?e.getTextContent():n()]};function CT(e,n){let r=(s)=>e[s]?e[s](n,r.bind(null,s-1)):null;return r(e.length-1)}function Tw(e,n=X()){return CT(_T()[e]||[],n)}var yT=_e({build:(e,n,r)=>n.$exportMimeType,config:He({$exportMimeType:xT}),mergeConfig(e,n){let r=zt(e,n);if(n.$exportMimeType){let s={...e.$exportMimeType};for(let[i,a]of Object.entries(n.$exportMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$exportMimeType=s}return r},name:"@lexical/clipboard/GetClipboardData"});var Lt=dh,{$exportMimeTypeFromSelection:pK,$generateJSONFromSelectedNodes:hK,$generateNodesFromSerializedNodes:mK,$getClipboardDataFromSelection:ad,$getHtmlContent:_K,$getLexicalContent:xK,$handlePlainTextDrop:CK,$handleRichTextDrop:ST,$insertDataTransferForPlainText:yK,$insertDataTransferForRichText:fh,$insertGeneratedNodes:SK,$writeDragSourceToDataTransfer:NT,ClipboardDOMImportExtension:NK,ClipboardImportExtension:EK,DEFAULT_IMPORT_MIME_TYPE:TK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:bK,GetClipboardDataExtension:vK,caretFromPoint:ld,copyToClipboard:kl,setLexicalClipboardDataTransfer:ET}=Lt;var ph={};je(ph,{$createHeadingNode:()=>qi,$createQuoteNode:()=>Ll,$isHeadingNode:()=>$w,$isQuoteNode:()=>Mw,DRAG_DROP_PASTE:()=>gh,HeadingNode:()=>Fl,QuoteNode:()=>Il,RichTextExtension:()=>$T,RichTextImportExtension:()=>Rw,RichTextImportRules:()=>DT,ShadowRootQuoteRule:()=>Ow,eventFiles:()=>Bs,quoteShadowRootState:()=>fd,registerRichText:()=>wT});var bw=dt({$import:(e,n)=>{let r=qi(n.nodeName.toLowerCase());return Zr(n,r),Qn(r,n),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:ft.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),vw=dt({$import:(e,n)=>{let r=Ll();return Qn(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:ft.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),Ow=dt({$import:(e,n)=>{let r=Ll({shadowRoot:!0});return Qn(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n,{schema:eT}))]},match:ft.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),DT=[bw,vw,dt({$import:(e,n,r)=>{let s=n.firstChild;return s&&(ye(i=s)&&i.nodeName==="SPAN"&&i.style.fontSize==="26pt")?e.$importChildren(n):r();var i},match:ft.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),dt({$import:(e,n,r)=>n.style.fontSize!=="26pt"?r():[qi("h1").splice(0,0,e.$importChildren(n))],match:ft.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Aw(e,n){return e&&n!==null?zt(e,n):n}var $T=_e({build:(e,n)=>wt(n),config:He({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:[eE,HN,WN,lo,nn(Xo,{rules:DT})],mergeConfig:function(e,n){let r=zt(e,n);return n.escapeFormatTriggers&&(r.escapeFormatTriggers=function(s,i){let a=zt(s,i);for(let l of Object.keys(i))a[l]=Aw(s[l],i[l]);return a}(e.escapeFormatTriggers,n.escapeFormatTriggers)),r},name:"@lexical/rich-text",nodes:()=>[Fl,Il],register:(e,n,r)=>Nt(()=>wT(e,r.getOutput().escapeFormatTriggers))}),Rw=_e({dependencies:[$T],name:"@lexical/rich-text/Import"}),gh=bn("DRAG_DROP_PASTE_FILE"),fd=Yo("shadowRoot",{parse:Boolean});class Il extends ct{$config(){return this.config("quote",{extends:ct,importDOM:{blockquote:()=>({conversion:Dw,priority:0})},stateConfigs:[{flat:!0,stateConfig:fd}]})}isShadowRoot(){return Bo(this,fd)}setIsShadowRoot(e){return eo(this,fd,e)}createDOM(e){let n=Xe().createElement("blockquote");return et(n,e.theme.quote),n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){return super.exportJSON()}static importJSON(e){return Ll().updateFromJSON(e)}insertNewAfter(e,n){let r=Se(),s=this.getDirection();return r.setDirection(s),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(let n of this.getChildren())this.insertBefore(n);return this.remove(),!0}let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Ll(e){let n=cn(new Il);return e&&e.shadowRoot?n.setIsShadowRoot(!0):n}function Mw(e){return e instanceof Il}class Fl extends ct{__tag;$config(){return this.config("heading",{extends:ct,importDOM:{h1:()=>({conversion:Vi,priority:0}),h2:()=>({conversion:Vi,priority:0}),h3:()=>({conversion:Vi,priority:0}),h4:()=>({conversion:Vi,priority:0}),h5:()=>({conversion:Vi,priority:0}),h6:()=>({conversion:Vi,priority:0}),p:(e)=>{let n=e.firstChild;return n!==null&&TT(n)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>TT(e)?{conversion:()=>({node:qi("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",n){super(n),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let n=this.getWritable();return n.__tag=e,n}createDOM(e){let n=this.__tag,r=Xe().createElement(n),s=e.theme.heading;if(s!==void 0){let i=s[n];et(r,i)}return r}updateDOM(e,n,r){return e.__tag!==this.__tag}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,n=!0){let r=e?e.anchor.offset:0,s=this.getLastDescendant(),i=!s||e&&e.anchor.key===s.getKey()&&r===s.getTextContentSize()||!e?Se():qi(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let l=Se();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Se();this.getChildren().forEach((n)=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}}function TT(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Vi(e){let n=e.nodeName.toLowerCase(),r=null;return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6"||(r=qi(n),Zr(e,r),Qn(r,e),Tn(r,e)),{node:r}}function Dw(e){let n=Ll();return Qn(n,e),Zr(e,n),Tn(n,e),{node:n}}function qi(e="h1"){return cn(new Fl(e))}function $w(e){return e instanceof Fl}function bT(e){let n=vt(e);return kt(n)}function Xi(e,n,r,s){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type==="text"){let c=e.anchor.getNode();if(re(c)){a=c;let d=e.anchor.offset,f=d===c.getTextContentSize()&&c.getNextSibling()===null,g=d===0&&c.getPreviousSibling()===null;i=r==="end"&&f||r==="start"&&g||r==="both"&&(f||g)}}let l=!1;for(let[c,d]of Object.entries(s)){if(d==null||!d[n])continue;let f=c;if(d.onlyAtBoundary){if(!(i&&a&&re(a)&&a.hasFormat(f)))continue;l=!0}e.hasFormat(f)&&e.toggleFormat(f)}l&&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,n){return function(r,s){if(!r.isCollapsed())return!1;let i=dn(r.focus,s),a=he(i.origin,Jc);if(!a)return!1;let l=r.focus.getNode();if(!a.is(l)&&!ll(l,a))return!1;let c=Jn(i,it(a,s));if(c.getTextSlices().some((p)=>p&&p.getTextContentSize()>0))return!1;let d=Jn(c.anchor.getSiblingCaret(),c.focus),f=d.anchor.origin;for(let p of d){if(!So(p)||!p.origin.is(f.getParent()))return!1;f=p.origin}let g=a;for(let p of bs(it(a,s))){if(!p.origin.is(g.getParent())){if(By(p.origin)){let h=it(g,s);return wn(Jn(h,h)),!0}break}if(!Jc(p.origin))break;g=p.origin}return!1}(e,n)||function(r,s){if(!r.isCollapsed()||r.anchor.type!=="element")return!1;let i=dn(r.anchor,s).getNodeAtCaret();return!(!Jc(i)||i.isInline()||(wn(Os(It(bt(i,s)))),0))}(e,n)}function vT(e){return kt(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ud(e){let n=Yc();n.add(e),mt(n)}function OT(e,n){if(!e.isCollapsed())return!1;let r=e.focus,s=r.getNode(),i=n?"previous":"next",a=dn(r,i);if(r.type==="element"&&Q(s)&&Dt(s)){let T=a.getNodeAtCaret();return!(T===null||!vT(T))&&(ud(T.__key),!0)}let l=he(Q(s)?s:s.getParentOrThrow(),(T)=>Q(T)&&!T.isInline()&&Dt(T.getParent()));if(l===null)return!1;let c=it(l,i).getNodeAtCaret();if(c===null||!vT(c))return!1;if(l.getTextContentSize()===0)return ud(c.__key),!0;let d=We().getRootElement();if(d===null)return!1;let f=Ln(d.ownerDocument.defaultView);if(f===null||f.rangeCount===0)return!1;let{anchorNode:g,anchorOffset:p,focusNode:h,focusOffset:x}=f;f.modify("move",n?"backward":"forward","line");let{anchorNode:y,anchorOffset:N}=f;if(y===null)return AT(f,g,p,h,x),!1;let E=vt(y);if(AT(f,g,p,h,x),E===null)return!1;if(y===g&&N===p)return ud(c.__key),!0;return!E.is(l)&&!ll(E,l)&&(ud(c.__key),!0)}function AT(e,n,r,s,i){n!==null&&s!==null&&e.setBaseAndExtent(n,r,s,i)}function RT(e,n){if(!e.isCollapsed())return!1;let r=e.focus.getNode(),s=he(Q(r)?r:r.getParentOrThrow(),(E)=>Q(E)&&!E.isInline());if(s===null)return!1;let i=We(),a=i.getRootElement();if(a===null)return!1;let l=a.ownerDocument.defaultView;if(l===null)return!1;let c=!1;for(let E of s.getChildren())if(Q(E)&&E.isInline()){let T=i.getElementByKey(E.getKey());if(T!==null){let b=l.getComputedStyle(T).display;if(b==="inline-grid"||b==="inline-flex"){c=!0;break}}}if(!c)return!1;let d=it(s,n?"previous":"next").getNodeAtCaret();if(d===null||!Q(d)){if(n){let E=s.getFirstDescendant();re(E)?E.select(0,0):s.select(0,0)}else{let E=s.getLastDescendant();if(re(E)){let T=E.getTextContentSize();E.select(T,T)}else{let T=s.getChildrenSize();s.select(T,T)}}return!0}let f=i.getElementByKey(d.getKey());if(f===null)return!1;let g=Ln(l);if(g===null||g.rangeCount===0)return!1;let p=g.getRangeAt(0).cloneRange();p.collapse(!0);let h=p.getBoundingClientRect(),x=f.getBoundingClientRect(),y=x.top+x.height/2;if(h.height>0){let E=ld(h.left,y,a);if(E!==null&&f.contains(E.node)){let T=a.ownerDocument.createRange();return T.setStart(E.node,E.offset),T.collapse(!0),e.applyDOMRange(T),e.dirty=!0,!0}}let N=n?d.getLastDescendant():d.getFirstDescendant();if(re(N)){let E=n?N.getTextContentSize():0;N.select(E,E)}else{let E=d.getChildrenSize();d.select(n?E:0,n?E:0)}return!0}function dd(e,n){let r=it(e,n),s=r.getAdjacentCaret();s!==null&&Q(s.origin)&&!s.origin.isInline()&&s.origin.isShadowRoot()?wn(Os(r)):n==="next"?e.selectNext(0,0):e.selectPrevious()}function MT(e,n,r){r.preventDefault(),r.stopPropagation();let s=e.getNodes();if(s.length===0)return!0;let i=s.map((d)=>it(d,"next")).sort(Br),a=(n?i[0]:i[i.length-1]).origin,l=he(a,(d)=>d!==a&&Q(d)&&!d.isInline())??Je(),c=n?0:l.getChildrenSize();return l.select(c,c),!0}function wT(e,n=zs(ww)){return Ae(e.registerCommand(yi,()=>{let r=X();return Ze(r)?(r.clear(),!0):(j(r)&&Xi(r,"click","both",n.peek()),!1)},Te),e.registerCommand(Ei,(r)=>{let s=X();return j(s)?(s.deleteCharacter(r),!0):!!Ze(s)&&(s.deleteNodes(),!0)},Te),e.registerCommand(au,(r)=>{let s=X();return!!j(s)&&(s.deleteWord(r),!0)},Te),e.registerCommand(iu,(r)=>{let s=X();return!!j(s)&&(s.deleteLine(r),!0)},Te),e.registerCommand(ou,(r)=>{let s=X();if(typeof r=="string")s!==null&&s.insertText(r);else{if(s===null)return!1;let i=r.dataTransfer;if(i!=null)fh(i,s,e);else if(j(s)){let a=r.data;return a&&s.insertText(a),!0}}return!0},Te),e.registerCommand(aS,()=>{let r=X();return!!j(r)&&(r.removeText(),!0)},Te),e.registerCommand(Wo,(r)=>{let s=X();return!(!j(s)&&!Ze(s))&&(My(s,r),!0)},Te),e.registerCommand(lS,(r)=>{let s=X();return!(!j(s)&&!Ze(s))&&(Hy(s,r),!0)},Te),e.registerCommand(cu,(r)=>{let s=X();if(!j(s)&&!Ze(s))return!1;let i=s.getNodes();for(let a of i){let l=he(a,(c)=>Q(c)&&!c.isInline());l!==null&&l.setFormat(r)}return!0},Te),e.registerCommand(Gg,(r)=>{let s=X();return!!j(s)&&(s.insertLineBreak(r),!0)},Te),e.registerCommand(jr,()=>{let r=X();return!!j(r)&&(r.insertParagraph(),!0)},Te),e.registerCommand(Ds,()=>{let r=gn(),s=X();return j(s)&&(r.setFormat(s.format),r.setStyle(s.style)),qc([r]),!0},Te),e.registerCommand(to,()=>vl((r)=>{let s=r.getIndent();r.setIndent(s+1)}),Te),e.registerCommand(jo,()=>vl((r)=>{let s=r.getIndent();s>0&&r.setIndent(Math.max(0,s-1))}),Te),e.registerCommand(no,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"previous"),!0}else if(j(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===0}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"previous"))return r.preventDefault(),!0;if(!r.shiftKey&&OT(s,!0))return r.preventDefault(),!0;if(!r.shiftKey&&RT(s,!0))return r.preventDefault(),!0}return!1},Te),e.registerCommand(Go,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"next"),!0}else if(j(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===Je().getChildrenSize()}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"next"))return r.preventDefault(),!0;if(!r.shiftKey&&OT(s,!1))return r.preventDefault(),!0;if(!r.shiftKey&&RT(s,!1))return r.preventDefault(),!0}return!1},Te),e.registerCommand(Yr,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],Tl(i[0])?"next":"previous"),!0}if(!j(s))return!1;if(!r.shiftKey&&cd(s,Tl(s.anchor.getNode())?"next":"previous"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","start",n.peek()),lp(s,!0)){let i=r.shiftKey;return r.preventDefault(),ap(s,i,!0),!0}return!1},Te),e.registerCommand(vi,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],Tl(i[0])?"previous":"next"),!0}if(!j(s))return!1;if(!r.shiftKey&&cd(s,Tl(s.anchor.getNode())?"previous":"next"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","end",n.peek()),lp(s,!1)){let i=r.shiftKey;return r.preventDefault(),ap(s,i,!1),!0}return!1},Te),e.registerCommand(Oi,(r)=>{let s=X();if(!Ze(s)&&bT(r.target))return!1;if(j(s)){if(function(i){if(!i.isCollapsed())return!1;let{anchor:a}=i;if(a.offset!==0)return!1;let l=a.getNode();if(yo(l))return!1;let c=ku(l);return c.getIndent()>0&&(c.is(l)||l.is(c.getFirstDescendant()))}(s))return r.preventDefault(),e.dispatchCommand(jo);if(_l&&gl)return!1}else if(!Ze(s))return!1;return r.preventDefault(),e.dispatchCommand(Ei,!0)},Te),e.registerCommand(hu,(r)=>{let s=X();return!(!Ze(s)&&bT(r.target))&&(!(!j(s)&&!Ze(s))&&(r.preventDefault(),e.dispatchCommand(Ei,!1)))},Te),e.registerCommand(Ai,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();i.length===1&&kt(i[0])&&!i[0].isInline()&&(s=i[0].selectNext())}if(!j(s))return!1;if(Xi(s,"enter","both",n.peek()),r!==null){if((_l||fu||du)&&gl)return!1;if(r.preventDefault(),r.shiftKey)return e.dispatchCommand(Gg,!1)}return e.dispatchCommand(jr)},Te),e.registerCommand(Ri,()=>{let r=X();return!!j(r)&&(e.blur(),!0)},Te),e.registerCommand(Zy,(r)=>{let[,s]=Bs(r);if(s.length>0){let{clientX:i,clientY:a}=r,l=ld(i,a,e.getRootElement());if(l!==null){let{offset:c,node:d}=l,f=vt(d);if(f!==null){let g=Kr();if(re(f))g.anchor.set(f.getKey(),c,"text"),g.focus.set(f.getKey(),c,"text");else{let h=f.getParentOrThrow().getKey(),x=f.getIndexWithinParent()+1;g.anchor.set(h,x,"element"),g.focus.set(h,x,"element")}let p=zo(g);mt(p)}e.dispatchCommand(gh,s)}return r.preventDefault(),!0}return ST(r,e)},Te),e.registerCommand(Jy,(r)=>{let[s]=Bs(r),i=X();return!(s&&!j(i))&&(j(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(ET(r.dataTransfer,ad(i)),NT(r.dataTransfer,e)),!0)},Te),e.registerCommand(qy,(r)=>{let[s]=Bs(r),i=X();if(s&&!j(i))return!1;let{clientX:a,clientY:l}=r,c=ld(a,l,e.getRootElement());if(c!==null){let d=vt(c.node);kt(d)&&r.preventDefault()}return!0},Te),e.registerCommand($i,()=>{let r=X();return Wr(j(r)&&Zn(r.anchor.getNode())!==null?r:null),!0},Te),e.registerCommand(Ni,(r)=>(kl(e,Fn(r,ClipboardEvent)?r:null),!0),Te),e.registerCommand(ru,(r)=>(async function(s,i){await kl(i,Fn(s,ClipboardEvent)?s:null),i.update(()=>{let a=X();j(a)?a.removeText():Ze(a)&&a.getNodes().forEach((l)=>l.remove())},{tag:su})}(r,e),!0),Te),e.registerCommand(Di,(r)=>{let[,s,i]=Bs(r);if(s.length>0&&!i)return e.dispatchCommand(gh,s),!0;if(ro(r.target)&&Py(r.target))return!1;return X()!==null&&(function(a,l){a.preventDefault(),l.update(()=>{let c=X(),d=Fn(a,InputEvent)||Fn(a,KeyboardEvent)?null:a.clipboardData;d!=null&&c!==null&&fh(d,c,l)},{tag:_u})}(r,e),!0)},Te),e.registerCommand(mu,()=>{let r=X();return j(r)&&Xi(r,"space","both",n.peek()),!1},Te),e.registerCommand(Vr,()=>{let r=X();return j(r)&&Xi(r,"tab","both",n.peek()),!1},Te),e.registerCommand(Sl,(r)=>{let s=X();if(Ze(s))return MT(s,!1,r);if(!j(s))return!1;let{anchor:i}=s;if(i.type!=="element"||i.offset!==0)return!1;let a=i.getNode();if(!Q(a))return!1;let l=a.getFirstChild();if(!kt(l)||!l.isInline())return!1;let c=a.getKey(),d=a.selectEnd();return r.shiftKey&&d.anchor.set(c,0,"element"),r.preventDefault(),r.stopPropagation(),!0},Te),e.registerCommand(Mi,(r)=>{let s=X();if(Ze(s))return MT(s,!0,r);if(!j(s))return!1;let{anchor:i,focus:a}=s,l=he(a.getNode(),(f)=>Q(f)&&!f.isInline());if(l===null)return!1;let c=l.getFirstChild();if(!kt(c)||!c.isInline())return!1;if(he(i.getNode(),(f)=>Q(f)&&!f.isInline())!==l)return!1;let d=l.getKey();return(a.type!=="element"||a.key!==d||a.offset!==0)&&(s.focus.set(d,0,"element"),r.shiftKey||s.anchor.set(d,0,"element"),r.preventDefault(),r.stopPropagation(),!0)},Te))}var vn=ph,{$createHeadingNode:gd,$createQuoteNode:pd,$isHeadingNode:Pl,$isQuoteNode:hd,DRAG_DROP_PASTE:LK,HeadingNode:md,QuoteNode:_d,RichTextExtension:FK,RichTextImportExtension:PK,RichTextImportRules:BK,ShadowRootQuoteRule:KK,eventFiles:zK,quoteShadowRootState:UK,registerRichText:kT}=vn;var mh={};je(mh,{RichTextPlugin:()=>Fw});S();function kw(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var hh=pn?$e:m;function Iw({editor:e,ErrorBoundary:n}){return function(r,s){let[i,a]=u(()=>r.getDecorators());return hh(()=>r.registerDecoratorListener((l)=>{rn(()=>{a(l)})}),[r]),m(()=>{a(r.getDecorators())},[r]),D(()=>{let l=[],c=Object.keys(i);for(let d=0;d<c.length;d++){let f=c[d],g=t(s,{onError:(h)=>r._onError(h),children:t(pi,{fallback:null,children:i[f]})}),p=r.getElementByKey(f);p!==null&&l.push(Ji(g,p,f))}return l},[s,i,r])}(e,n)}function Lw({editor:e,ErrorBoundary:n}){return function(r){let s=UN.maybeFromEditor(r);if(s&&s.hasExtensionByName(VN.name)){for(let i of["@lexical/plain-text","@lexical/rich-text"])s.hasExtensionByName(i)&&kw(320,i);return!0}return!1}(e)?null:t(Iw,{editor:e,ErrorBoundary:n})}function IT(e){return e.read("latest",Vu(e.isComposing()))}function Fw({contentEditable:e,placeholder:n=null,ErrorBoundary:r}){let[s]=st();return function(i){hh(()=>Ae(kT(i),tE(i)),[i])}(s),o(L,{children:[e,t(Pw,{content:n}),t(Lw,{editor:s,ErrorBoundary:r})]})}function Pw({content:e}){let[n]=st(),r=function(i){let[a,l]=u(()=>IT(i));return hh(()=>{function c(){let d=IT(i);l(d)}return c(),Ae(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a}(n),s=AS();return r?typeof e=="function"?e(s):e:null}var Bw=mh,LT=Bw.RichTextPlugin;var _h={};je(_h,{ContentEditable:()=>zw,ContentEditableElement:()=>BT});S();var PT=pn?$e:m;function Kw({editor:e,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:s,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:l,ariaInvalid:c,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:g,ariaOwns:p,ariaRequired:h,autoCapitalize:x,className:y,id:N,role:E="textbox",spellCheck:T=!0,style:b,tabIndex:v,"data-testid":O,...k},M){let[z,K]=u(e.isEditable()),U=P((W)=>{W&&W.ownerDocument&&W.ownerDocument.defaultView?e.setRootElement(W):e.setRootElement(null)},[e]),J=D(()=>function(...W){return(ne)=>{for(let ee of W)typeof ee=="function"?ee(ne):ee!=null&&(ee.current=ne)}}(M,U),[U,M]);return PT(()=>(K(e.isEditable()),e.registerEditableListener((W)=>{K(W)})),[e]),t("div",{"aria-activedescendant":z?n:void 0,"aria-autocomplete":z?r:"none","aria-controls":z?s:void 0,"aria-describedby":i,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":z&&E==="combobox"?!!l:void 0,...c!=null?{"aria-invalid":c}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":g,"aria-owns":z?p:void 0,"aria-readonly":!z||void 0,"aria-required":h,autoCapitalize:x,className:y,contentEditable:z,"data-testid":O,id:N,ref:J,role:E,spellCheck:T,style:b,tabIndex:v??(z?void 0:-1),...k})}var BT=F(Kw);function FT(e){return e.read("latest",Vu(e.isComposing()))}var zw=F(Uw);function Uw(e,n){let{placeholder:r,...s}=e,[i]=st();return o(L,{children:[t(BT,{editor:i,...s,ref:n}),r!=null&&t(Hw,{editor:i,content:r})]})}function Hw({content:e,editor:n}){let r=function(l){let[c,d]=u(()=>FT(l));return PT(()=>{function f(){let g=FT(l);d(g)}return f(),Ae(l.registerUpdateListener(()=>{f()}),l.registerEditableListener(()=>{f()}))},[l]),c}(n),[s,i]=u(n.isEditable());if($e(()=>(i(n.isEditable()),n.registerEditableListener((l)=>{i(l)})),[n]),!r)return null;let a=null;return typeof e=="function"?a=e(s):e!==null&&(a=e),a===null?null:t("div",{"aria-hidden":!0,children:a})}var KT=_h,{ContentEditable:zT,ContentEditableElement:az}=KT;var xh={};je(xh,{HistoryExtension:()=>xd,SharedHistoryExtension:()=>jw,createEmptyHistoryState:()=>WT,registerHistory:()=>HT});function Ww(e,n,r,s,i){if(e===null||r.size===0&&s.size===0&&!i)return 0;let a=n._selection,l=e._selection;if(i)return 1;if(!(j(a)&&j(l)&&l.isCollapsed()&&a.isCollapsed()))return 0;let c=function(T,b,v){let O=T._nodeMap,k=[];for(let M of b){let z=O.get(M);z!==void 0&&k.push(z)}for(let[M,z]of v){if(!z)continue;let K=O.get(M);K===void 0||yo(K)||k.push(K)}return k}(n,r,s);if(c.length===0)return 0;if(c.length>1){let T=n._nodeMap,b=T.get(a.anchor.key),v=T.get(l.anchor.key);return b&&v&&!e._nodeMap.has(b.__key)&&re(b)&&b.__text.length===1&&a.anchor.offset===1?2:0}let d=c[0],f=e._nodeMap.get(d.__key);if(!re(f)||!re(d)||f.__mode!==d.__mode)return 0;let g=f.__text,p=d.__text;if(g===p)return 0;let h=a.anchor,x=l.anchor;if(h.key!==x.key||h.type!=="text")return 0;let y=h.offset,N=x.offset,E=p.length-g.length;return E===1&&N===y-1?2:E===-1&&N===y+1?3:E===-1&&N===y?4:0}function Gw(e,n,r){let s=r(),i=0,a=s,l=0,c=null;return(d,f,g,p,h,x)=>{let y=r();if(x.has(nu)&&(a=s,l=i,c=d),x.has(bi))return i=0,s=y,2;x.has(tu)&&c&&(s=a,i=l,d=c);let N=x.has(_u)||x.has(su)?0:Ww(d,f,p,h,e.isComposing()),E=(()=>{let T=g===null||g.editor===e,b=x.has(uu);if(!b&&T&&x.has(Gr))return 0;if(N===1)return 2;if(d===null)return 1;let v=f._selection;if(!(p.size>0||h.size>0))return v!==null?0:2;let O=typeof n=="number"?n:n.peek();if(b===!1&&N!==0&&N===i&&y<s+O&&T)return 0;if(p.size===1){if(function(k,M,z){let K=M._nodeMap.get(k),U=z._nodeMap.get(k),J=M._selection,W=z._selection;return!(j(J)&&j(W)&&J.anchor.type==="element"&&J.focus.type==="element"&&W.anchor.type==="text"&&W.focus.type==="text"||!re(K)||!re(U)||K.__parent!==U.__parent)&&JSON.stringify(M.read(()=>K.exportJSON()))===JSON.stringify(z.read(()=>U.exportJSON()))}(Array.from(p)[0],d,f))return 0}return 1})();return s=y,i=N,E}}function UT(e,n){e.undoStack=[],e.redoStack=[],e.current=null,n&&n(e)}function HT(e,n,r,s=Date.now,i,a=null){let l=Gw(e,r,s),c=()=>{i&&i(n)};return c(),Ae(e.registerCommand(Eu,()=>(function(d,f,g){let{redoStack:p,undoStack:h}=f;if(h.length!==0){let x=f.current,y=h.pop();x!==null&&(p.push(x),d.dispatchCommand(Rs,!0)),h.length===0&&d.dispatchCommand(Ms,!1),f.current=y||null,g&&g(f),y&&y.editor.setEditorState(y.editorState,{tag:bi})}}(e,n,i),!0),Te),e.registerCommand(xu,()=>(function(d,f,g){let{redoStack:p,undoStack:h}=f;if(p.length!==0){let x=f.current;x!==null&&(h.push(x),d.dispatchCommand(Ms,!0));let y=p.pop();p.length===0&&d.dispatchCommand(Rs,!1),f.current=y||null,g&&g(f),y&&y.editor.setEditorState(y.editorState,{tag:bi})}}(e,n,i),!0),Te),e.registerCommand(Qc,()=>(UT(n,i),!1),Te),e.registerCommand(jy,()=>(UT(n,i),e.dispatchCommand(Rs,!1),e.dispatchCommand(Ms,!1),!0),Te),e.registerUpdateListener(({editorState:d,prevEditorState:f,dirtyLeaves:g,dirtyElements:p,tags:h})=>{let{current:x,redoStack:y,undoStack:N}=n,E=x===null?null:x.editorState;if(x!==null&&d===E)return;let T=l(f,d,x,g,p,h);if(T===1){if(y.length!==0&&(n.redoStack=[],e.dispatchCommand(Rs,!1)),x!==null){N.push({...x});let b=typeof a=="number"||a===null?a:a.peek();b!==null&&N.length>b&&N.splice(0,N.length-b),e.dispatchCommand(Ms,!0)}}else if(T===2)return;n.current={editor:e,editorState:d},c()}))}function WT(){return{current:null,redoStack:[],undoStack:[]}}var xd=_e({build:(e,{delay:n,createInitialHistoryState:r,disabled:s,maxDepth:i,now:a},l)=>({...wt({delay:n,disabled:s,historyState:r(e),maxDepth:i,now:a}),...l.getInitResult()}),config:He({createInitialHistoryState:WT,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:()=>({canRedo:zs(!1),canUndo:zs(!1)}),name:"@lexical/history/History",register:(e,n,r)=>{let{canUndo:s,canRedo:i}=r.getInitResult(),a=r.getOutput(),l=(c)=>Ip(()=>{s.value=c!=null&&c.undoStack.length>0,i.value=c!=null&&c.redoStack.length>0});return Nt(()=>{if(!a.disabled.value)return HT(e,a.historyState.value,a.delay,()=>a.now.peek()(),l,a.maxDepth);l(null)})}}),jw=_e({build:(e,{disabled:n,parentEditor:r})=>wt({disabled:n,parentEditor:r||e._parentEditor}),config:He({disabled:!1,parentEditor:null}),dependencies:[nn(xd,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,n,r)=>Nt(()=>{let{disabled:s,parentEditor:i}=r.getOutput();if(!s.value){let{output:a}=r.getDependency(xd),l=function(d){return d?io(d,xd.name):null}(i.value);if(!l)return;let c=l.output;Ip(()=>{a.delay.value=c.delay.value,a.historyState.value=c.historyState.value,a.now.value=c.now.value,a.disabled.value=c.disabled.value})}})});var Cd=xh,{HistoryExtension:dz,SharedHistoryExtension:fz,createEmptyHistoryState:yd,registerHistory:GT}=Cd;var Ch={};je(Ch,{HistoryPlugin:()=>Yw,createEmptyHistoryState:()=>yd});S();function Yw({delay:e,externalHistoryState:n}){let[r]=st();return function(s,i,a=1000){let l=D(()=>i||yd(),[i]);m(()=>GT(s,l,a),[a,s,l])}(r,n,e),null}var jT=Ch,{HistoryPlugin:YT,createEmptyHistoryState:xz}=jT;var Th={};je(Th,{$createListItemNode:()=>bo,$createListNode:()=>To,$getListDepth:()=>Sd,$handleListInsertParagraph:()=>i0,$insertList:()=>Nd,$isListItemNode:()=>Ie,$isListNode:()=>Me,$removeList:()=>r0,CheckListExtension:()=>tk,INSERT_CHECK_LIST_COMMAND:()=>l0,INSERT_ORDERED_LIST_COMMAND:()=>m0,INSERT_UNORDERED_LIST_COMMAND:()=>h0,ListExtension:()=>Eh,ListImportExtension:()=>nk,ListImportRules:()=>g0,ListItemNode:()=>Ys,ListNode:()=>Zi,ListSchema:()=>ek,REMOVE_LIST_COMMAND:()=>_0,UPDATE_LIST_START_COMMAND:()=>p0,registerCheckList:()=>c0,registerList:()=>x0,registerListStrictIndentTransform:()=>C0});function ts(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sd(e){let n=1,r=e.getParent();for(;r!=null;){if(Ie(r)){let s=r.getParent();if(Me(s)){n++,r=s.getParent();continue}ts(40)}return n}return n}function yh(e){let n=e.getParent();Me(n)||ts(40);let r=n,s=n;for(;s!==null;)s=s.getParent(),Me(s)&&(r=s);return r}function n0(e){let n=[],r=e.getChildren().filter(Ie);for(let s=0;s<r.length;s++){let i=r[s],a=i.getFirstChild();Me(a)?n=n.concat(n0(a)):n.push(i)}return n}function co(e){return Ie(e)&&Me(e.getFirstChild())}function o0(e,n){return Ie(e)&&(n.length===0||n.length===1&&e.is(n[0])&&e.getChildrenSize()===0)}function Nd(e){let n=X();if(n!==null){let r=n.getNodes();if(j(n)){let[i]=n.getStartEndPoints(),a=i.getNode(),l=a.getParent();if(Dt(a)){let c=a.getFirstChild();if(c)r=c.selectStart().getNodes();else{let d=Se();a.append(d),r=d.select().getNodes()}}else if(o0(a,r)){let c=To(e);if(Dt(l)){a.replace(c);let d=bo();Q(a)&&(d.setFormat(a.getFormatType()),d.setIndent(a.getIndent())),c.append(d)}else if(Ie(a)){let d=a.getParentOrThrow();js(c,d.getChildren()),d.replace(c)}return}}let s=new Set;for(let i=0;i<r.length;i++){let a=r[i];if(Q(a)&&a.isEmpty()&&!Ie(a)&&!s.has(a.getKey())){VT(a,e);continue}let l=ul(a)?a.getParent():Ie(a)&&a.isEmpty()?a:null;for(;l!=null;){let c=l.getKey();if(Me(l)){if(!s.has(c)){let d=To(e);js(d,l.getChildren()),l.replace(d),s.add(c)}break}{let d=l.getParent();if(Dt(d)&&!s.has(c)){s.add(c),VT(l,e);break}l=d}}}}}function js(e,n){e.splice(e.getChildrenSize(),0,n)}function VT(e,n){if(Me(e))return e;let r=e.getPreviousSibling(),s=e.getNextSibling(),i=bo(),a;if(js(i,e.getChildren()),Me(r)&&n===r.getListType())r.append(i),Me(s)&&n===s.getListType()&&(js(r,s.getChildren()),s.remove()),a=r;else if(Me(s)&&n===s.getListType())s.getFirstChildOrThrow().insertBefore(i),a=s;else{let c=To(n);c.append(i),e.replace(c),a=c}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let l=X();return j(l)&&(a.getKey()===l.anchor.key&&l.anchor.set(i.getKey(),l.anchor.offset,"element"),a.getKey()===l.focus.key&&l.focus.set(i.getKey(),l.focus.offset,"element")),e.remove(),a}function Nh(e,n){let r=e.getLastChild(),s=n.getFirstChild();r&&s&&co(r)&&co(s)&&(Nh(r.getFirstChild(),s.getFirstChild()),s.remove());let i=n.getChildren();i.length>0&&e.append(...i),n.remove()}function r0(){let e=X();if(j(e)){let n=new Set,r=e.getNodes(),s=e.anchor.getNode();if(o0(s,r))n.add(yh(s));else for(let i=0;i<r.length;i++){let a=r[i];if(ul(a)){let l=Iu(a,Ys);l!=null&&n.add(yh(l))}}for(let i of n){let a=i,l=n0(i);for(let c of l){let d=Se().setTextStyle(e.style).setTextFormat(e.format);js(d,c.getChildren()),a.insertAfter(d),a=d,c.__key===e.anchor.key&&Ho(e.anchor,It(bt(d,"next"))),c.__key===e.focus.key&&Ho(e.focus,It(bt(d,"next"))),c.remove()}i.remove()}}}function s0(e){let n=e.getListType()!=="check",r=e.getStart();for(let s of e.getChildren())Ie(s)&&(s.getValue()!==r&&s.setValue(r),n&&s.getLatest().__checked!=null&&s.setChecked(void 0),Me(s.getFirstChild())||r++)}function Vw(e){let n=new Set;if(co(e)||n.has(e.getKey()))return;let r=e.getParent(),s=e.getNextSibling(),i=e.getPreviousSibling();if(co(s)&&co(i)){let a=i.getFirstChild();if(Me(a)){a.append(e);let l=s.getFirstChild();if(Me(l))js(a,l.getChildren()),s.remove(),n.add(s.getKey())}}else if(co(s)){let a=s.getFirstChild();if(Me(a)){let l=a.getFirstChild();l!==null&&l.insertBefore(e)}}else if(co(i)){let a=i.getFirstChild();Me(a)&&a.append(e)}else if(Me(r)){let a=jt(e),l=jt(r);a.append(l),l.append(e),i?i.insertAfter(a):s?s.insertBefore(a):r.append(a)}}function XT(e){if(co(e))return;let n=e.getParent(),r=n?n.getParent():void 0;if(Me(r?r.getParent():void 0)&&Ie(r)&&Me(n)){let s=n?n.getFirstChild():void 0,i=n?n.getLastChild():void 0;if(e.is(s))r.insertBefore(e),n.isEmpty()&&r.remove();else if(e.is(i))r.insertAfter(e),n.isEmpty()&&r.remove();else{let a=jt(e),l=jt(n);a.append(l),e.getPreviousSiblings().forEach((f)=>l.append(f));let c=jt(e),d=jt(n);c.append(d),js(d,e.getNextSiblings()),r.insertBefore(a),r.insertAfter(c),r.replace(e)}}}function i0(e=!1){let n=X();if(!j(n)||!n.isCollapsed())return!1;let r=n.anchor.getNode(),s=null;if(Ie(r)&&r.getChildrenSize()===0)s=r;else if(re(r)){let f=r.getParent();Ie(f)&&f.getChildren().every((g)=>re(g)&&g.getTextContent().trim()==="")&&(s=f)}if(s===null)return!1;let i=yh(s),a=s.getParent();Me(a)||ts(40);let l=a.getParent(),c;if(Dt(l))c=Se(),i.insertAfter(c);else{if(!Ie(l))return!1;c=jt(l),l.insertAfter(c)}c.setTextStyle(n.style).setTextFormat(n.format).select();let d=s.getNextSiblings();if(d.length>0){let f=e?function(p,h){return p.getStart()+h.getIndexWithinParent()}(a,s):1,g=jt(a).setStart(f);if(Ie(c)){let p=jt(c);p.append(g),c.insertAfter(p)}else c.insertAfter(g);g.append(...d)}return function(f){let g=f;for(;g.getNextSibling()==null&&g.getPreviousSibling()==null;){let p=g.getParent();if(p==null||!Ie(p)&&!Me(p))break;g=p}g.remove()}(s),!0}class Ys extends ct{__value;__checked;$config(){return this.config("listitem",{$transform:(e)=>{let n=e.getParent();if(Me(n))n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(n){let r=e.createParentElementNode();Me(r)||ts(340);let s=[e];for(let i of["previous","next"]){s.reverse();for(let{origin:a}of it(e,i)){if(!Ie(a))break;s.push(a)}}e.insertBefore(r),r.splice(0,0,s),Dt(n)||(zr(r,Uo(it(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:ct,importDOM:jg({li:()=>({conversion:Xw,priority:0})})})}constructor(e=1,n=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let n=Xe().createElement("li");return this.updateListItemDOM(null,n,e),n}updateListItemDOM(e,n,r){(function(a,l){let c=l.getParent();!Me(c)||c.getListType()!=="check"||Me(l.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),a.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(n,this),n.value=this.__value,function(a,l,c){let d=l.list;if(!d)return;let f=d.listitem,g=d.nested&&d.nested.listitem,p=c.getParent(),h=Me(p)&&p.getListType()==="check",x=c.getChecked(),y=c.getChildren().some((T)=>Me(T)),N=[];d.listitemChecked!==void 0&&N.push(d.listitemChecked),d.listitemUnchecked!==void 0&&N.push(d.listitemUnchecked),g!==void 0&&N.push(...Li(g)),N.length>0&&sn(a,...N);let E=[];if(f!==void 0&&E.push(...Li(f)),h){let T=x?d.listitemChecked:d.listitemUnchecked;T!==void 0&&E.push(T)}g!==void 0&&y&&E.push(...Li(g)),E.length>0&&et(a,...E)}(n,r.theme,this);let s=e?e.__style:"",i=this.__style;s!==i&&fr(n.style,i,s),function(a,l,c){let d=l.__textStyle,f=c?c.__textStyle:"";if(c!==null&&f===d)return;let g=Xr(d);for(let p in g)a.style.setProperty(`--listitem-marker-${p}`,g[p]);if(f!=="")for(let p in Xr(f))p in g||a.style.removeProperty(`--listitem-marker-${p}`)}(n,this,e)}updateDOM(e,n,r){let s=n;return this.updateListItemDOM(e,s,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let n=this.createDOM(e._config),r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();return s&&(n.dir=s),co(this)?{after(i){if(ye(i)){let a=i.previousElementSibling;if(ye(a)&&a.nodeName==="LI"){for(;i.firstChild;)a.append(i.firstChild);i.remove()}}return i},element:n}:{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if(Q(r)&&this.canMergeWith(r)){let s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,n){if(Ie(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!Me(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let a=jt(r),l=this.getNextSibling();for(;l;){let c=l;l=l.getNextSibling(),a.append(c)}r.insertAfter(e),e.insertAfter(a)}let s=this.__key,i=0;if(n&&(Q(e)||ts(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),n&&Q(e)){let a=X();if(j(a))for(let l of a.getStartEndPoints())l.key===s&&l.type==="element"&&l.set(e.getKey(),i+l.offset,"element")}return this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){let r=this.getParentOrThrow();if(Me(r)||ts(39),Ie(e))return super.insertAfter(e,n);let s=this.getNextSiblings();if(r.insertAfter(e,n),s.length!==0){let i=jt(r);s.forEach((a)=>i.append(a)),e.insertAfter(i,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&co(n)&&co(r)&&(Nh(n.getFirstChild(),r.getFirstChild()),r.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}collapseAtStart(e){if(co(this))return!1;let n=this.getParentOrThrow();if(Ie(n.getParentOrThrow()))return XT(this),!0;let r=Se().append(...this.getChildren()),s=this.getNextSiblings();if(s.length>0){let i=jt(n);i.append(...s),n.insertAfter(i)}return n.insertAfter(r),this.remove(),n.getChildrenSize()===0&&n.remove(),r.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let n=this.getWritable();return n.__value=e,n}getChecked(){let e=this.getLatest(),n,r=this.getParent();return Me(r)&&(n=r.getListType()),n==="check"?Boolean(e.__checked):void 0}setChecked(e){let n=this.getWritable();return n.__checked=e,n}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 n=e.getParentOrThrow(),r=0;for(;Ie(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&ts(117),(e=Math.floor(e))>=0||ts(199);let n=this.getIndent();for(;n!==e;)n<e?(Vw(this),n++):(XT(this),n--);return this}canInsertAfter(e){return Ie(e)}canReplaceWith(e){return Ie(e)}canMergeWith(e){return Ie(e)||$n(e)}extractWithChild(e,n){if(!j(n))return!1;let r=n.anchor.getNode(),s=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return To("bullet")}canMergeWhenEmpty(){return!0}}function Xw(e){if(e.classList.contains("task-list-item")){for(let s of e.children)if(s.tagName==="INPUT")return qT(s)}if(e.classList.contains("joplin-checkbox")){for(let s of e.children)if(s.classList.contains("checkbox-wrapper")&&s.children.length>0&&s.children[0].tagName==="INPUT")return qT(s.children[0])}let n=e.getAttribute("aria-checked"),r=bo(n==="true"||n!=="false"&&void 0);return Qn(r,e),{after:a0.bind(null,r),node:Tn(r,e)}}function qT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let n=bo(e.hasAttribute("checked"));return{after:a0.bind(null,n),node:n}}function a0(e,n){let r=n[0];return n.length===1&&$n(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function bo(e){return cn(new Ys(void 0,e))}function Ie(e){return e instanceof Ys}class Zi extends ct{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(n){let r=n.getNextSibling();Me(r)&&n.getListType()===r.getListType()&&Nh(n,r)})(e),s0(e)},extends:ct,importDOM:jg({ol:()=>({conversion:ZT,priority:0}),ul:()=>({conversion:ZT,priority:0})})})}constructor(e="number",n=1,r){super(r);let s=qw[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=n}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 n=this.getWritable();return n.__listType=e,n.__tag=e==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let n=this.getWritable();return n.__start=e,n}createDOM(e,n){let r=this.__tag,s=Xe().createElement(r);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,JT(s,e.theme,this),s}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(JT(n,r.theme,this),e.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let n=this.createDOM(e._config,e);return ye(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let s=r;for(let i=0;i<r.length;i++){let a=r[i];Ie(a)||(s===r&&(s=[...r]),s[i]=this.createListItemNode().append(!Q(a)||Me(a)||a.isInline()?a:yt(a.getTextContent())))}return super.splice(e,n,s)}extractWithChild(e){return Ie(e)}createListItemNode(){return bo()}}function JT(e,n,r){let s=[],i=[],a=n.list;if(a!==void 0){let l=a[`${r.__tag}Depth`]||[],c=Sd(r)-1,d=c%l.length,f=l[d],g=a[r.__tag],p,{nested:h,checklist:x}=a;if(h!==void 0&&h.list&&(p=h.list),g!==void 0&&s.push(g),x!==void 0&&r.__listType==="check"&&s.push(x),f!==void 0){s.push(...Li(f));for(let y=0;y<l.length;y++)y!==d&&i.push(r.__tag+y)}if(p!==void 0){let y=Li(p);c>1?s.push(...y):i.push(...y)}}i.length>0&&sn(e,...i),s.length>0&&et(e,...s)}function ZT(e){let n;if(function(r){return ye(r)&&r.nodeName.toLowerCase()==="ol"}(e)){let r=e.start;n=To("number",r)}else n=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(let s of r.childNodes)if(ye(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(e)?To("check"):To("bullet");return Tn(n,e),{after:(r)=>function(s,i){let a=i.createListItemNode.bind(i),l=[];for(let c=0;c<s.length;c++){let d=s[c];if(Ie(d)){l.push(d);let f=d.getChildren();f.length>1&&f.forEach((g)=>{Me(g)&&l.push(a().append(g))})}else l.push(a().append(d))}return l}(r,n),node:n}}var qw={ol:"number",ul:"bullet"};function To(e="number",n=1){return cn(new Zi(e,n))}function Me(e){return e instanceof Zi}var l0=bn("INSERT_CHECK_LIST_COMMAND");function c0(e,n){let r=n&&n.disableTakeFocusOnClick||!1,s=typeof r=="boolean"?()=>r:r.peek.bind(r),i=(f)=>{let g=f.target;if(!ye(g))return!1;let p=g.__lexicalCheckListLastHandled;return p!==void 0&&f.timeStamp-p<500},a=(f)=>{let g=f.target;ye(g)&&(g.__lexicalCheckListLastHandled=f.timeStamp)},l=(f)=>{i(f)||(a(f),QT(f,s()))},c=(f)=>{f.pointerType==="touch"&&(i(f)||(a(f),QT(f,s())))},d=(f)=>{(function(g,p){u0(g,()=>{g.preventDefault(),p&&g.stopPropagation()})})(f,s())};return Ae(e.registerCommand(l0,()=>(Nd("check"),!0),Fe),e.registerCommand(Go,(f)=>e0(f,e,!1),Fe),e.registerCommand(no,(f)=>e0(f,e,!0),Fe),e.registerCommand(Ri,()=>{if(Sh(e)!=null){let f=e.getRootElement();return f!=null&&f.focus(),!0}return!1},Fe),e.registerCommand(mu,(f)=>{let g=Sh(e);return!(g==null||!e.isEditable())&&(e.update(()=>{let p=vt(g);Ie(p)&&(f.preventDefault(),p.toggleChecked())}),!0)},Fe),e.registerCommand(Yr,(f)=>e.read("latest",()=>{let g=X();if(j(g)&&g.isCollapsed()){let{anchor:p}=g,h=p.type==="element";if(h||p.offset===0){let x=p.getNode(),y=he(x,(N)=>Q(N)&&!N.isInline());if(Ie(y)){let N=y.getParent();if(Me(N)&&N.getListType()==="check"&&(h||y.getFirstDescendant()===x)){let E=e.getElementByKey(y.__key);if(E!=null&&No(E)!==E)return E.focus(),f.preventDefault(),!0}}}}return!1}),Fe),e.registerRootListener((f)=>{if(f!==null)return Ae(Jr(f,{click:l,pointerup:c}),Jr(f,{mousedown:d,pointerdown:d},{capture:!0}),so(f,"touchstart",d,{capture:!0,passive:!1}))}))}function u0(e,n){let r=e.target;if(!ye(r))return;let s=r.firstChild;if(ye(s)&&(s.tagName==="UL"||s.tagName==="OL"))return;let i=r.parentNode;if(!i||i.__lexicalListType!=="check")return;let a=null,l=null;if("clientX"in e)a=e.clientX;else if("touches"in e){let x=e.touches;x.length>0&&(a=x[0].clientX,l="touch")}if(a==null)return;let c=r.getBoundingClientRect(),d=a/iN(r),f=r.ownerDocument.defaultView,g=f?f.getComputedStyle(r,"::before"):{width:"0px"},p=parseFloat(g.width),h=l==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(r.dir==="rtl"?d<c.right+h&&d>c.right-p-h:d>c.left-h&&d<c.left+p+h)&&n()}function QT(e,n){u0(e,()=>{if(ye(e.target)){let r=e.target,s=vu(r);s!=null&&s.isEditable()&&s.update(()=>{let i=vt(r);Ie(i)&&(n?(sl(Su),sl(cS)):r.focus(),i.toggleChecked())})}})}function Sh(e){let n=e.getRootElement(),r=n?No(n):null;return ye(r)&&r.tagName==="LI"&&r.parentNode!=null&&r.parentNode.__lexicalListType==="check"?r:null}function e0(e,n,r){let s=Sh(n);return s!=null&&n.update(()=>{let i=vt(s);if(!Ie(i))return;let a=function(l,c){let d=c?l.getPreviousSibling():l.getNextSibling(),f=l;for(;d==null&&Ie(f);)f=f.getParentOrThrow().getParent(),f!=null&&(d=c?f.getPreviousSibling():f.getNextSibling());for(;Ie(d);){let g=c?d.getLastChild():d.getFirstChild();if(!Me(g))return d;d=c?g.getLastChild():g.getFirstChild()}return null}(i,r);if(a!=null){a.selectStart();let l=n.getElementByKey(a.__key);l!=null&&(e.preventDefault(),setTimeout(()=>{l.focus()},0))}}),!1}function Jw(e){let n=[];for(let r of e)if(Ie(r)){n.push(r);let s=r.getChildren();if(s.length>1)for(let i of s)Me(i)&&n.push(bo().append(i))}else n.push(bo().append(r));return n}var Zw=dt({$import:(e,n)=>{let r;var s;return ih(n,"ol")?r=To("number",n.start):r=(s=n).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||s.querySelector(":scope > [aria-checked]")!==null?To("check"):To("bullet"),Tn(r,n),[r.splice(0,0,od(Jw(e.$importChildren(n)),n))]},match:ft.tag("ol","ul"),name:"@lexical/list/list"});function d0(e,n){if(n.length!==1)return n;let r=n[0];return $n(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function f0(e){let n=(l)=>QE(l)&&!Me(l);if(!e.some(n))return e;let r=[],s=[],i=()=>{s.length>0&&(r.push(s),s=[])};for(let l of e)n(l)?(i(),r.push(Q(l)?l.getChildren():[l])):s.push(l);i();let a=[];for(let l of r)a.length>0&&a.push(fn()),a.push(...l);return a}var Qw=dt({$import:(e,n)=>{let r=n.getAttribute("aria-checked"),s=bo(r==="true"||r!=="false"&&void 0);return Qn(s,n),Tn(s,n),[s.splice(0,0,f0(d0(s,e.$importChildren(n))))]},match:ft.tag("li"),name:"@lexical/list/li"});function t0(e,n,r){let s=ih(r,"input")?r:r.querySelector('input[type="checkbox"]');if(!s||s.getAttribute("type")!=="checkbox")return[];let i=bo(s.hasAttribute("checked"));return Qn(i,n),Tn(i,n),[i.splice(0,0,f0(d0(i,e.$importChildren(n))))]}var ek={$accepts:(e)=>Ie(e)||Me(e),$packageRun:(e)=>[bo().splice(0,0,e)],name:"ListSchema"},g0=[dt({$import:(e,n,r)=>{let s=n.querySelector(':scope > input[type="checkbox"]');return s?t0(e,n,s):r()},match:ft.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),dt({$import:(e,n,r)=>{let s=n.querySelector(":scope > .checkbox-wrapper");if(!s)return r();let i=s.querySelector(':scope > input[type="checkbox"]');return i?t0(e,n,i):r()},match:ft.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Zw,Qw],p0=bn("UPDATE_LIST_START_COMMAND"),h0=bn("INSERT_UNORDERED_LIST_COMMAND"),m0=bn("INSERT_ORDERED_LIST_COMMAND"),_0=bn("REMOVE_LIST_COMMAND");function x0(e,n){return Ae(e.registerCommand(m0,()=>(Nd("number"),!0),Fe),e.registerCommand(p0,(r)=>{let{listNodeKey:s,newStart:i}=r,a=Mt(s);return!!Me(a)&&(a.getListType()==="number"&&(a.setStart(i),s0(a)),!0)},Fe),e.registerCommand(h0,()=>(Nd("bullet"),!0),Fe),e.registerCommand(_0,()=>(r0(),!0),Fe),e.registerCommand(jr,()=>i0(!!(n&&n.restoreNumbering)),Fe),e.registerCommand(Oi,(r)=>{let s=X();if(!j(s)||!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();for(;!Ie(a);){if(a.getPreviousSibling()!==null)return!1;let l=a.getParent();if(l===null)return!1;a=l}return!(!Ie(a)||!a.collapseAtStart(s))&&(r.preventDefault(),!0)},eu),e.registerNodeTransform(Ys,(r)=>{let s=r.getFirstChild();if(s){if(re(s)){let i=s.getStyle(),a=s.getFormat();r.getTextStyle()!==i&&r.setTextStyle(i),r.getTextFormat()!==a&&r.setTextFormat(a)}}else{let i=X();j(i)&&(i.style!==r.getTextStyle()||i.format!==r.getTextFormat())&&i.isCollapsed()&&r.is(i.anchor.getNode())&&r.setTextStyle(i.style).setTextFormat(i.format)}}),e.registerNodeTransform(In,(r)=>{let s=r.getParent();if(Ie(s)&&r.is(s.getFirstChild())){let i=r.getStyle(),a=r.getFormat();i===s.getTextStyle()&&a===s.getTextFormat()||s.setTextStyle(i).setTextFormat(a)}}))}function C0(e){let n=(r)=>{let s=r.getParent();if(Me(r.getFirstChild())||!Me(s))return;let i=he(r,(a)=>Ie(a)&&Me(a.getParent())&&Ie(a.getPreviousSibling()));if(i===null&&r.getIndent()>0)r.setIndent(0);else if(Ie(i)){let a=i.getPreviousSibling();if(Ie(a)){let l=function(d){let f=d,g=f.getFirstChild();for(;Me(g);){let p=g.getLastChild();if(!Ie(p))break;f=p,g=f.getFirstChild()}return f}(a),c=l.getParent();if(Me(c)){let d=Sd(c);d+1<Sd(s)&&r.setIndent(d)}}}};return e.registerNodeTransform(Zi,(r)=>{let s=[r];for(;s.length>0;){let i=s.shift();if(Me(i)){for(let a of i.getChildren())if(Ie(a)){n(a);let l=a.getFirstChild();Me(l)&&s.push(l)}}}})}var Eh=_e({build:(e,n,r)=>wt(n),config:He({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[lo,nn(Xo,{rules:g0})],name:"@lexical/list/List",nodes:()=>[Zi,Ys],register(e,n,r){let s=r.getOutput();return Ae(Nt(()=>x0(e,{restoreNumbering:s.shouldPreserveNumbering.value})),Nt(()=>s.hasStrictIndent.value?C0(e):void 0))}}),tk=_e({build:(e,n)=>wt(n),config:He({disableTakeFocusOnClick:!1}),dependencies:[Eh],name:"@lexical/list/CheckList",register:(e,n,r)=>c0(e,r.getOutput())}),nk=_e({dependencies:[Eh],name:"@lexical/list/Import"});var Et=Th,{$createListItemNode:y0,$createListNode:S0,$getListDepth:Tz,$handleListInsertParagraph:bz,$insertList:vz,$isListItemNode:bh,$isListNode:vo,$removeList:Oz,CheckListExtension:Az,INSERT_CHECK_LIST_COMMAND:N0,INSERT_ORDERED_LIST_COMMAND:E0,INSERT_UNORDERED_LIST_COMMAND:T0,ListExtension:Rz,ListImportExtension:Mz,ListImportRules:Dz,ListItemNode:ns,ListNode:qo,ListSchema:$z,REMOVE_LIST_COMMAND:Ed,UPDATE_LIST_START_COMMAND:wz,registerCheckList:b0,registerList:vh,registerListStrictIndentTransform:v0}=Et;var Oh={};je(Oh,{ListPlugin:()=>ok});S();function ok({hasStrictIndent:e=!1,shouldPreserveNumbering:n=!1}){let[r]=st();return m(()=>{if(!r.hasNodes([qo,ns]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),m(()=>Ae(vh(r,{restoreNumbering:n}),e?v0(r):()=>{}),[r,e,n]),function(s){m(()=>vh(s),[s])}(r),null}var rk=Oh,O0=rk.ListPlugin;var Ah={};je(Ah,{CheckListPlugin:()=>sk});S();function sk({disableTakeFocusOnClick:e=!1}){let[n]=st();return m(()=>b0(n,{disableTakeFocusOnClick:e}),[n,e]),null}var ik=Ah,A0=ik.CheckListPlugin;var Rh={};je(Rh,{TabIndentationPlugin:()=>ak,registerTabIndentation:()=>Yu});S();function ak({maxIndent:e,$canIndent:n}){let[r]=st();return m(()=>Yu(r,e,n),[r,e,n]),null}var R0=Rh,{TabIndentationPlugin:M0,registerTabIndentation:Vz}=R0;var kh={};je(kh,{$createAutoLinkNode:()=>wh,$createLinkNode:()=>Kl,$isAutoLinkNode:()=>mn,$isLinkNode:()=>Pn,$toggleLink:()=>Td,AutoLinkExtension:()=>Ck,AutoLinkNode:()=>zl,ClickableLinkExtension:()=>fk,LinkExtension:()=>Od,LinkImportExtension:()=>dk,LinkImportRules:()=>F0,LinkNode:()=>os,TOGGLE_LINK_COMMAND:()=>bd,autoLinkEmailMatcher:()=>hk,autoLinkUrlMatcher:()=>pk,createLinkMatcherWithRegExp:()=>K0,formatUrl:()=>Mh,registerAutoLink:()=>V0,registerClickableLink:()=>B0,registerLink:()=>P0});var D0=new Set(["http:","https:","mailto:","sms:","tel:"]);class os extends ct{__url;__target;__rel;__title;$config(){return this.config("link",{extends:ct,importDOM:{a:()=>({conversion:ck,priority:1})}})}constructor(e="",n={},r){super(r);let{target:s=null,rel:i=null,title:a=null}=n;this.__url=e,this.__target=s,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let n=Xe().createElement("a");return this.updateLinkDOM(null,n,e),et(n,e.theme.link),n}updateLinkDOM(e,n,r){if(ki(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(let s of["target","rel","title"]){let i=`__${s}`,a=this[i];e&&e[i]===a||(a?n[s]=a:n.removeAttribute(s))}}}updateDOM(e,n,r){return this.updateLinkDOM(e,n,r),!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 n=e;e=Mh(e);try{let r=new URL(Mh(e));if(!D0.has(r.protocol))return"about:blank"}catch(r){let s=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(s!=null&&!D0.has(`${s[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 n=this.getWritable();return n.__url=e,n}getTarget(){return this.getLatest().__target}setTarget(e){let n=this.getWritable();return n.__target=e,n}getRel(){return this.getLatest().__rel}setRel(e){let n=this.getWritable();return n.__rel=e,n}getTitle(){return this.getLatest().__title}setTitle(e){let n=this.getWritable();return n.__title=e,n}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!j(n))return!1;let s=n.anchor.getNode(),i=n.focus.getNode();return(this.is(s)||this.isParentOf(s))&&(this.is(i)||this.isParentOf(i))&&n.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 w0(e){let n=dn(e,"next");return[n,n.getFlipped()]}function k0(e,n){for(let r of n)if(r.origin.isAttached()){let s=It(r);return void Ho(e,s)}}function lk(e){let n=X(),r=null,s=null;function i(){j(n)&&(k0(n.anchor,r),k0(n.focus,s),zo(n))}j(n)&&(r=w0(n.anchor),s=w0(n.focus));let a=!1;for(let c of bt(e,"next")){let d=c.origin;if(Q(d)&&!d.isInline()){let f=d.getChildren();if(f.length>0){let g=jt(e);g.append(...f),d.append(g),a=!0}zr(d,Uo(c),{$shouldSplit:()=>!1})}}function l(c,d,f){let[g,p]=c,h=(y)=>So(y)&&y.origin.is(d);if(!h(g)&&!h(p))return c;let x=It(bt(f,"next"));return[x,x.getFlipped()]}if(e.isAttached()){let c=e.getPreviousSibling();if(Pn(c)&&c.shouldMergeAdjacentLink(e))return r&&(r=l(r,c,e)),s&&(s=l(s,c,e)),c.append(...e.getChildren()),e.remove(),void i();let d=e.getNextSibling();Pn(d)&&e.shouldMergeAdjacentLink(d)&&(r&&(r=l(r,e,d)),s&&(s=l(s,e,d)),e.append(...d.getChildren()),d.remove(),a=!0)}if(a){if(!e.canBeEmpty()&&e.isEmpty()){let c=e.getParent();e.remove(),c&&c.isEmpty()&&c.remove()}i()}}function ck(e){let n=null;if(ki(e)){let r=e.textContent;(r!==null&&r!==""||e.children.length>0)&&(n=Kl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:n}}function Kl(e="",n){return cn(new os(e,n))}function Pn(e){return e instanceof os}class zl extends os{__isUnlinked;constructor(e="",n={},r){super(e,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:os})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let n=this.getWritable();return n.__isUnlinked=e,n}createDOM(e){return this.__isUnlinked?Xe().createElement("span"):super.createDOM(e)}updateDOM(e,n,r){return super.updateDOM(e,n,r)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,n=!0){let r=wh(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}}function wh(e="",n){return cn(new zl(e,n))}function mn(e){return e instanceof zl}var bd=bn("TOGGLE_LINK_COMMAND");function I0(e,n){if(e.type==="element"){let r=e.getNode();return Q(r)||function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);throw a.search=l.toString(),Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),r.getChildren()[e.offset+n]||null}return null}function Td(e,n={}){let r;if(e&&typeof e=="object"){let{url:g,...p}=e;r=g,n={...p,...n}}else r=e;let{target:s,title:i}=n,a=n.rel===void 0?"noreferrer":n.rel,l=X();if(l===null||!j(l)&&!Ze(l))return;if(Ze(l)){let g=l.getNodes();if(g.length===0)return;return void g.forEach((p)=>{if(r===null){let h=he(p,(x)=>!mn(x)&&Pn(x));h&&(h.insertBefore(p),h.getChildren().length===0&&h.remove())}else{let h=he(p,(x)=>!mn(x)&&Pn(x));if(h)h.setURL(r),s!==void 0&&h.setTarget(s),a!==void 0&&h.setRel(a);else{let x=Kl(r,{rel:a,target:s});p.insertBefore(x),x.append(p)}}})}if(l.isCollapsed()&&r===null)for(let g of l.getNodes()){let p=he(g,(h)=>!mn(h)&&Pn(h));return void(p!==null&&(p.getParentOrThrow().splice(p.getIndexWithinParent(),0,p.getChildren()),p.remove()))}let c=l.extract();if(r===null){let g=new Set;return void c.forEach((p)=>{let h=he(p,(x)=>!mn(x)&&Pn(x));if(h!==null){let x=h.getKey();if(g.has(x))return;(function(y,N){let E=new Set(N.filter((K)=>y.isParentOf(K)).map((K)=>K.getKey())),T=y.getChildren(),b=(K)=>E.has(K.getKey())||Q(K)&&N.some((U)=>y.isParentOf(U)&&K.isParentOf(U)),v=T.filter(b);if(v.length===T.length)return T.forEach((K)=>y.insertBefore(K)),void y.remove();let O=T.findIndex(b),k=T.findLastIndex(b),M=O===0,z=k===T.length-1;if(M)v.forEach((K)=>y.insertBefore(K));else if(z)for(let K=v.length-1;K>=0;K--)y.insertAfter(v[K]);else{for(let U=v.length-1;U>=0;U--)y.insertAfter(v[U]);let K=T.slice(k+1);if(K.length>0){let U=jt(y);v[v.length-1].insertAfter(U),K.forEach((J)=>U.append(J))}}})(h,c),g.add(x)}})}let d=new Set,f=(g)=>{d.has(g.getKey())||(d.add(g.getKey()),g.setURL(r),s!==void 0&&g.setTarget(s),a!==void 0&&g.setRel(a),i!==void 0&&g.setTitle(i))};if(c.length===1){let g=c[0],p=he(g,Pn);if(p!==null)return f(p)}(function(g){let p=X();if(!j(p))return g();let h=zo(p),x=h.isBackward(),y=I0(h.anchor,x?-1:0),N=I0(h.focus,x?0:-1),E=g();if(y||N){let T=X();if(j(T)){let b=T.clone();if(y){let v=y.getParent();v&&b.anchor.set(v.getKey(),y.getIndexWithinParent()+(x?1:0),"element")}if(N){let v=N.getParent();v&&b.focus.set(v.getKey(),N.getIndexWithinParent()+(x?0:1),"element")}mt(zo(b))}}})(()=>{let g=null;for(let p of c){if(!p.isAttached())continue;let h=he(p,Pn);if(h){f(h);continue}if(Q(p)){if(!p.isInline())continue;if(Pn(p)){if(!(mn(p)||g!==null&&g.getParentOrThrow().isParentOf(p))){f(p),g=p;continue}for(let y of p.getChildren())p.insertBefore(y);p.remove();continue}}let x=p.getPreviousSibling();Pn(x)&&x.is(g)?x.append(p):(g=Kl(r,{rel:a,target:s,title:i}),p.insertAfter(g),g.append(p))}})}var uk=/^\+?[0-9\s()-]{5,}$/;function Mh(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 F0=[dt({$import:(e,n)=>{if(!n.textContent&&n.children.length===0)return[];let r=n.getAttribute("href")||"",s={rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")};return XE(e.$importChildren(n),()=>Kl(r,s))},match:ft.tag("a"),name:"@lexical/link/a"})];function P0(e,n){return Ae(e.registerNodeTransform(os,lk),e.registerCommand(bd,(r)=>{let s=n.validateUrl.peek(),i=n.attributes.peek();if(r===null)return Td(null),!0;if(typeof r=="string")return!(s!==void 0&&!s(r))&&(Td(r,i),!0);{let{url:a,target:l,rel:c,title:d}=r;return Td(a,{...i,rel:c,target:l,title:d}),!0}},Te),Nt(()=>{let r=n.validateUrl.value;if(!r)return;let s=n.attributes.value;return e.registerCommand(Di,(i)=>{let a=X();if(!j(a)||a.isCollapsed()||!Fn(i,ClipboardEvent))return!1;if(i.clipboardData===null)return!1;let l=i.clipboardData.getData("text");if(!r(l))return!1;return!a.getNodes().some((c)=>Q(c)||re(c)&&!c.isSimpleText())&&(e.dispatchCommand(bd,{...s,url:l}),i.preventDefault(),!0)},Fe)}))}var Od=_e({build:(e,n,r)=>wt(n),config:{attributes:void 0,validateUrl:void 0},dependencies:[lo,nn(Xo,{rules:F0})],mergeConfig(e,n){let r=zt(e,n);return e.attributes&&(r.attributes=zt(e.attributes,r.attributes)),r},name:"@lexical/link/Link",nodes:()=>[os],register:(e,n,r)=>P0(e,r.getOutput())}),dk=_e({dependencies:[Od],name:"@lexical/link/Import"});function B0(e,n,r={}){let s=(a)=>{let l=a.target;if(!ro(l))return;let c=vu(l);if(c===null)return;let d=null,f=null,g=!1;if(c.update(()=>{let x=vt(l);if(x!==null){let y=he(x,Q);if(!n.disabled.peek())if(Pn(y))g=mn(y)&&y.getIsUnlinked(),d=y.sanitizeUrl(y.getURL()),f=y.getTarget();else{let N=function(E,T){let b=E;for(;b!=null;){if(T(b))return b;b=b.parentNode}return null}(l,ki);N!==null&&(d=N.href,f=N.target)}}}),d===null||d===""||g)return;let p=e.read("latest",X);if(j(p)&&!p.isCollapsed())return void a.preventDefault();let h=a.type==="auxclick"&&a.button===1;window.open(d,n.newTab.peek()||h||a.metaKey||a.ctrlKey||f==="_blank"?"_blank":"_self"),a.preventDefault()},i=(a)=>{a.button===1&&s(a)};return e.registerRootListener((a)=>{if(a)return Jr(a,{click:s,mouseup:i},r)})}var fk=_e({build:(e,n,r)=>wt(n),config:He({disabled:!1,newTab:!1}),dependencies:[Od],name:"@lexical/link/ClickableLink",register:(e,n,r)=>B0(e,r.getOutput())});function K0(e,n=(r)=>r){return(r)=>{let s=e.exec(r);return s===null?null:{index:s.index,length:s[0].length,text:s[0],url:n(s[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 n=gk.exec(e);if(n===null)return null;let r=n[0],s=0;for(let i of r)i==="("?s++:i===")"&&s--;for(;s<0&&r.endsWith(")");)r=r.slice(0,-1),s++;return{index:n.index,length:r.length,text:r,url:r.startsWith("http")?r:`https://${r}`}},hk=K0(/(([^<>()[\]\\.,;:\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 Dh(e,n){for(let r=0;r<n.length;r++){let s=n[r](e);if(s)return s}return null}var z0=/[.,;\s]/;function vd(e,n){return n.test(e)}function U0(e,n){return vd(e[e.length-1],n)}function $h(e,n){return vd(e[0],n)}function W0(e,n){let r=e.getPreviousSibling();return Q(r)&&(r=r.getLastDescendant()),r===null||Ue(r)||re(r)&&U0(r.getTextContent(),n)}function j0(e,n){let r=e.getNextSibling();return Q(r)&&(r=r.getFirstDescendant()),r===null||Ue(r)||re(r)&&$h(r.getTextContent(),n)}function mk(e,n,r,s,i){if(!(e>0?vd(s[e-1],r):W0(i[0],r)))return!1;return n<s.length?vd(s[n],r):j0(i[i.length-1],r)}function _k(e,n,r){let s=[],i=[],a=[],l=0,c=0,d=[...e];for(;d.length>0;){let f=d[0],g=f.getTextContent().length,p=c;c+g<=n?(s.push(f),l+=g):p>=r?a.push(f):i.push(f),c+=g,d.shift()}return[l,s,i,a]}function xk(e,n,r,s){let i=wh(s.url,s.attributes);if(e.length===1){let a,l=e[0];n===0?[a,l]=l.splitText(r):[,a,l]=l.splitText(n,r);let c=yt(s.text);return c.setFormat(a.getFormat()),c.setDetail(a.getDetail()),c.setStyle(a.getStyle()),i.append(c),a.replace(i),l}if(e.length>1){let a=e[0],l,c=a.getTextContent().length;n===0?l=a:[,l]=a.splitText(n);let d=[],f;for(let x=1;x<e.length;x++){let y=e[x],N=y.getTextContent().length,E=c;if(E<r)if(c+N<=r)d.push(y);else{let[T,b]=y.splitText(r-E);d.push(T),f=b}c+=N}let g=X(),p=g?g.getNodes().find(re):void 0,h=yt(l.getTextContent());return h.setFormat(l.getFormat()),h.setDetail(l.getDetail()),h.setStyle(l.getStyle()),i.append(h,...d),p&&p===l&&(j(g)?h.select(g.anchor.offset,g.focus.offset):Ze(g)&&h.select(0,h.getTextContent().length)),l.replace(i),f}}function L0(e,n,r,s){let i=e.getChildren(),a=i.length;for(let f=0;f<a;f++){let g=i[f];if(!re(g)||!g.isSimpleText())return Bl(e),void r(null,e.getURL())}let l=e.getTextContent(),c=Dh(l,n);if(c===null||c.text!==l)return Bl(e),void r(null,e.getURL());if(!W0(e,s)||!j0(e,s))return Bl(e),void r(null,e.getURL());let d=e.getURL();if(d!==c.url&&(e.setURL(c.url),r(c.url,d)),c.attributes){let f=e.getRel();f!==c.attributes.rel&&(e.setRel(c.attributes.rel||null),r(c.attributes.rel||null,f));let g=e.getTarget();g!==c.attributes.target&&(e.setTarget(c.attributes.target||null),r(c.attributes.target||null,g))}}function Bl(e){let n=e.getChildren();for(let r=n.length-1;r>=0;r--)e.insertAfter(n[r]);return e.remove(),n.map((r)=>r.getLatest())}var Y0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:z0};function V0(e,n=Y0){let{matchers:r,changeHandlers:s,excludeParents:i,separatorRegex:a=z0}=n,l=(c,d)=>{for(let f of s)f(c,d)};return Ae(e.registerNodeTransform(In,(c)=>{let d=c.getParentOrThrow(),f=c.getPreviousSibling();if(mn(d))L0(d,r,l,a);else if(!Pn(d)&&!i.some((g)=>g(d))){if(c.isSimpleText()&&($h(c.getTextContent(),a)||!mn(f))){let g=function(p){let h=[p],x=p.getNextSibling();for(;x!==null&&re(x)&&x.isSimpleText()&&(h.push(x),!/[\s]/.test(x.getTextContent()));)x=x.getNextSibling();return h}(c);(function(p,h,x,y){for(let O of p){let k=O.getParent();if(mn(k)&&!k.getIsUnlinked())return}let N=[...p],E=N.map((O)=>O.getTextContent()).join(""),T,b=E,v=0;for(;(T=Dh(b,h))&&T!==null;){let O=T.index,k=O+T.length;if(mk(v+O,v+k,y,E,N)){let[M,,z,K]=_k(N,v+O,v+k),U=!1;for(let W of z){let ne=W.getParent();if(mn(ne)&&!ne.getIsUnlinked()){U=!0;break}}if(U){v+=k,b=b.substring(k);continue}let J=xk(z,v+O-M,v+k-M,T);N=J?[J,...K]:K,x(T.url,null),v=0}else v+=k;b=b.substring(k)}})(g,r,l,a)}(function(g,p,h,x){let y=g.getParent(),N=g.getPreviousSibling(),E=g.getNextSibling(),T=g.getTextContent();if(!mn(y)||y.getIsUnlinked()){if(mn(N)&&!N.getIsUnlinked()&&N.is(g.getPreviousSibling())&&g.getParent()===N.getParent()){if(!$h(T,x))return Bl(N),void h(null,N.getURL());if(b=T,N.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(b):/^\.[a-zA-Z0-9]{1,}/.test(b)){let v=N.getTextContent()+T,O=Dh(v,p);O!==null&&O.text===v&&(N.append(g),L0(N,p,h,x),h(null,N.getURL()))}}var b;!mn(E)||E.getIsUnlinked()||U0(T,x)||E.is(g.getNextSibling())&&g.getParent()===E.getParent()&&(Bl(E),h(null,E.getURL()))}})(c,r,l,a)}}),e.registerCommand(bd,(c)=>{let d=X();if(c!==null||!j(d))return!1;return d.extract().forEach((f)=>{let g=f.getParent();mn(g)&&(g.setIsUnlinked(!g.getIsUnlinked()),g.markDirty())}),!1},Fe))}var Ck=_e({config:Y0,dependencies:[Od],mergeConfig(e,n){let r=zt(e,n);for(let s of["matchers","changeHandlers","excludeParents"]){let i=n[s];Array.isArray(i)&&(r[s]=[...e[s],...i])}return r},name:"@lexical/link/AutoLink",nodes:[zl],register:V0});var Ft=kh,{$createAutoLinkNode:eU,$createLinkNode:X0,$isAutoLinkNode:q0,$isLinkNode:Qi,$toggleLink:tU,AutoLinkExtension:nU,AutoLinkNode:J0,ClickableLinkExtension:oU,LinkExtension:rU,LinkImportExtension:sU,LinkImportRules:iU,LinkNode:ea,TOGGLE_LINK_COMMAND:Ih,autoLinkEmailMatcher:aU,autoLinkUrlMatcher:lU,createLinkMatcherWithRegExp:cU,formatUrl:uU,registerAutoLink:dU,registerClickableLink:fU,registerLink:Z0}=Ft;var Lh={};je(Lh,{LinkPlugin:()=>yk});S();function yk({validateUrl:e,attributes:n}){let[r]=st();return m(()=>{if(!r.hasNodes([ea]))throw Error("LinkPlugin: LinkNode not registered on editor")}),m(()=>Z0(r,wt({attributes:n,validateUrl:e})),[r,e,n]),null}var Sk=Lh,Q0=Sk.LinkPlugin;var Fh={};je(Fh,{AutoFocusPlugin:()=>Nk});S();function Nk({defaultSelection:e}){let[n]=st();return m(()=>{n.focus(()=>{let r=n.getRootElement(),s=r!==null?No(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,n]),null}var Ek=Fh,eb=Ek.AutoFocusPlugin;var Hh={};je(Hh,{$createCodeHighlightNode:()=>zh,$createCodeNode:()=>Oo,$getCodeLineDirection:()=>lb,$getEndOfCodeInLine:()=>ub,$getFirstCodeNodeOfLine:()=>rs,$getLastCodeNodeOfLine:()=>Xs,$getStartOfCodeInLine:()=>cb,$isCodeHighlightNode:()=>Ut,$isCodeNode:()=>On,$outdentLeadingSpaces:()=>db,$plainifyCodeContent:()=>Tk,CodeExtension:()=>Uh,CodeHighlightNode:()=>Gl,CodeImportExtension:()=>kk,CodeImportRules:()=>Cb,CodeIndentExtension:()=>Ik,CodeNode:()=>Wl,DEFAULT_CODE_LANGUAGE:()=>fb,getDefaultCodeLanguage:()=>bk,registerCodeIndentation:()=>Sb});function Rd(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ab(e,n){let r=e;for(let s=it(e,n);s&&(Ut(s.origin)||Yt(s.origin));s=s.getAdjacentCaret())r=s.origin;return r}function rs(e){return ab(e,"previous")}function Xs(e){return ab(e,"next")}function lb(e){let n=rs(e),r=Xs(e),s=n;for(;s!==null;){if(Ut(s)){let a=CS(s.getTextContent());if(a!==null)return a}if(s===r)break;s=s.getNextSibling()}let i=n.getParent();if(Q(i)){let a=i.getDirection();if(a==="ltr"||a==="rtl")return a}return null}function cb(e,n){let r=null,s=null,i=e,a=n,l=e.getTextContent();for(;;){if(a===0){let f=i.getPreviousSibling();if(f===null){i=null;break}if(Ut(f)||Yt(f)||Ue(f)||Rd(167),i=f,Ue(i)){r={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),l=i.getTextContent()}else a--;let d=l[a];Ut(i)&&d!==" "&&(s={node:i,offset:a})}if(s!==null)return s;let c=null;if(n<e.getTextContentSize())Ut(e)&&(c=e.getTextContent()[n]);else{let d=e.getNextSibling();Ut(d)&&(c=d.getTextContent()[0])}if(c!==null&&c!==" ")return r;{let d=function(f,g){let p=f,h=g,x=f.getTextContent(),y=f.getTextContentSize();for(;;){if(!Ut(p)||h===y){if(p=p.getNextSibling(),p===null||Ue(p))return null;Ut(p)&&(h=0,x=p.getTextContent(),y=p.getTextContentSize())}if(Ut(p)){if(x[h]!==" ")return{node:p,offset:h};h++}}}(e,n);return d!==null?d:r}}function ub(e){let n=Xs(e);return Ue(n)&&Rd(168),n}function Tk(e){let n=[];return Fi(e,{linebreak:()=>n.push(fn()),tab:()=>n.push(gn()),text:(r)=>n.push(zh(r))}),n}function db(e,n,r){if(!Number.isInteger(n)||n<=0)return!1;let s=e.getTextContent(),i=/^ +/.exec(s);if(!i)return!1;let a=Math.min(n,i[0].length),l=e.getKey(),c=r.anchor.key===l&&r.anchor.type==="text"?r.anchor.offset:null,d=r.focus.key===l&&r.focus.type==="text"?r.focus.offset:null;return e.spliceText(0,a,""),c!==null&&r.anchor.set(l,Math.max(0,c-a),"text"),d!==null&&r.focus.set(l,Math.max(0,d-a),"text"),!0}var fb="javascript",bk=()=>fb;function gb(e,n){for(let r of e.childNodes){if(ye(r)&&r.tagName===n)return!0;if(gb(r,n))return!0}return!1}var Hl="data-language",Ul="data-highlight-language",Ad="data-theme",vk=()=>{};class Wl extends ct{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:ct,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||gb(e,"BR"))?{conversion:tb,priority:1}:null,div:()=>({conversion:Ok,priority:1}),pre:()=>({conversion:tb,priority:0}),table:(e)=>Ph(e)?{conversion:Ak,priority:3}:null,td:(e)=>{let n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&Ph(r)?{conversion:nb,priority:3}:null},tr:(e)=>{let n=e.closest("table");return n&&Ph(n)?{conversion:nb,priority:3}:null}}})}constructor(e=void 0,n){super(n),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 n=Xe().createElement("code");et(n,e.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Hl,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ul,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),n}updateDOM(e,n,r){let s=this.__language,i=e.__language;s?s!==i&&n.setAttribute(Hl,s):i&&n.removeAttribute(Hl);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&s?s!==i&&n.setAttribute(Ul,s):n.removeAttribute(Ul):a&&s&&n.setAttribute(Ul,s);let l=this.__theme,c=e.__theme;l?l!==c&&n.setAttribute(Ad,l):c&&n.removeAttribute(Ad);let d=this.__style,f=e.__style;return d!==f&&fr(n.style,d,f),!1}exportDOM(e){let n=Xe().createElement("pre");et(n,e._config.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Hl,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ul,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!io(We(),"@lexical/code")){vk();let a=pb(e);if(a)return a}let{anchor:r,focus:s}=e,i=(r.isBefore(s)?r:s).getNode();if(re(i)){let a=rs(i),l=[];for(;;)if(Yt(a))l.push(gn()),a=a.getNextSibling();else{if(!Ut(a))break;{let x=0,y=a.getTextContent(),N=a.getTextContentSize();for(;x<N&&y[x]===" ";)x++;if(x!==0&&l.push(zh(" ".repeat(x))),x!==N)break;a=a.getNextSibling()}}let c=i.splitText(r.offset)[0],d=r.offset===0?0:1,f=c.getIndexWithinParent()+d,g=i.getParentOrThrow(),p=[fn(),...l];g.splice(f,0,p);let h=l[l.length-1];h?h.select():r.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(On(i)){let{offset:a}=e.anchor;i.splice(a,0,[fn()]),i.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}setLanguage(e){let n=this.getWritable();return n.__language=e||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let n=this.getWritable();return n.__isSyntaxHighlightSupported=e,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let n=this.getWritable();return n.__theme=e||void 0,n}getTheme(){return this.getLatest().__theme}}function Oo(e,n){return jc(Wl).setLanguage(e).setTheme(n)}function On(e){return e instanceof Wl}function tb(e){return{node:Oo(e.getAttribute(Hl))}}function Ok(e){let n=e,r=ob(n);return r||function(s){let i=s.parentElement;for(;i!==null;){if(ob(i))return!0;i=i.parentElement}return!1}(n)?{node:r?Oo():null}:{node:null}}function Ak(){return{node:Oo()}}function nb(){return{node:null}}function ob(e){return e.style.fontFamily.match("monospace")!==null}function Ph(e){return e.classList.contains("js-file-line-container")}function pb(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type==="element"){let r=n.getNode();if(On(r)){let s=r.getChildrenSize();if(s>=2&&n.offset===s){let i=r.getLastChild();if(Ue(i)&&Ue(i.getPreviousSibling())){let a=Se();return r.splice(s-2,2,[]).insertAfter(a,!1),a.select(),a}}}}return null}class Gl extends In{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}$config(){return this.config("code-highlight",{extends:In})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let n=this.getWritable();return n.__highlightType=e||void 0,n}canHaveFormat(){return!1}createDOM(e){let n=super.createDOM(e),r=Bh(e.theme,this.__highlightType);return et(n,r),n}updateDOM(e,n,r){let s=super.updateDOM(e,n,r),i=Bh(r.theme,e.__highlightType),a=Bh(r.theme,this.__highlightType);return i!==a&&(i&&sn(n,i),a&&et(n,a)),s}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 Oo()}}function Bh(e,n){return n&&e&&e.codeHighlight&&e.codeHighlight[n]}function zh(e="",n){return cn(new Gl(e,n))}function Ut(e){return e instanceof Gl}var hb="data-language";function mb(e){return e.style.fontFamily.match("monospace")!==null}function Kh(e){let n=e.parentElement;for(;n!==null;){if(mb(n))return!0;n=n.parentElement}return!1}var Rk=sh([dt({$import:(e,n)=>e.$importChildren(n),match:ft.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Mk=dt({$import:(e,n)=>[Oo(n.getAttribute(hb)).splice(0,0,e.$importChildren(n))],match:ft.tag("pre"),name:"@lexical/code/pre"}),Dk=dt({$import:(e,n,r)=>{let s=n.textContent||"";return/\r?\n/.test(s)||n.querySelector("br")!==null?[Oo(n.getAttribute(hb)).splice(0,0,e.$importChildren(n))]:r()},match:ft.tag("code"),name:"@lexical/code/code-multiline"});function ta(e){if(!ye(e))return!1;let n=e.style.fontFamily,r=e.style.whiteSpace;return typeof n=="string"&&/monospace/i.test(n)&&typeof r=="string"&&r.startsWith("pre")}function _b(e){let n=!1,r=[],s="",i=!1,a=()=>{i&&(r.push(s),s="",i=!1)};for(let l of Array.from(e.childNodes))if(ye(l))l.tagName==="DIV"?(a(),r.push(l.textContent||""),n=!0):l.tagName==="BR"?(a(),r.push(""),n=!0):(s+=l.textContent||"",i=!0);else if(Fs(l)){let c=l.textContent||"";c.length>0&&(s+=c,i=!0)}return a(),n?r:null}function xb(e){for(let n of Array.from(e.children)){if(ye(n)&&ta(n)){if(_b(n)!==null)return!0;let r=n.nextElementSibling;if(r&&ta(r))return!0;continue}if(xb(n))return!0}return!1}var $k=sh([dt({$import:(e,n,r)=>{if(!ta(n)||Kh(n))return r();let s=_b(n);return s===null||s.length===0?r():[Oo().splice(0,0,il(s.join(`
|
|
16
|
+
`)))]},match:ft.tag("div"),name:"@lexical/code/vscode-wrapper"}),dt({$import:(e,n,r)=>{if(!ta(n)||Kh(n))return r();let s=n.previousElementSibling;if(s&&ta(s))return[];let i=[],a=n;for(;a&&ta(a);)i.push(a.tagName==="BR"?"":a.textContent||""),a=a.nextElementSibling;return i.length<2?r():[Oo().splice(0,0,il(i.join(`
|
|
17
|
+
`)))]},match:ft.tag("div","br"),name:"@lexical/code/vscode-line-run"})]),wk=dt({$import:(e,n,r)=>mb(n)?[Oo().splice(0,0,e.$importChildren(n))]:Kh(n)?e.$importChildren(n):r(),match:ft.tag("div"),name:"@lexical/code/div"}),Cb=[dt({$import:(e,n)=>[Oo().splice(0,0,e.$importChildren(n,{rules:Rk}))],match:ft.tag("table").classAll("js-file-line-container"),name:"@lexical/code/github-code-table"}),dt({$import:(e,n)=>e.$importChildren(n),match:ft.tag("td").classAll("js-file-line"),name:"@lexical/code/github-code-cell-by-class"}),Dk,Mk,wk],Uh=_e({dependencies:[lo,nn(Xo,{preprocess:[(e,n,r)=>{xb(qr(e)?e.body:e)&&n.session.update(tT,(s)=>[...s,$k]),r()}],rules:Cb})],name:"@lexical/code",nodes:()=>[Wl,Gl],register:(e)=>Ae(e.registerCommand(Ai,(n)=>{let r=X();return!(!j(r)||!pb(r))&&(n!==null&&n.preventDefault(),!0)},Fe),e.registerNodeTransform(Nu,(n)=>{n.getFormat()!==0&&On(n.getParent())&&n.setFormat(0)}))}),kk=_e({dependencies:[Uh],name:"@lexical/code/Import"});function Vs(e){if(!j(e))return!1;let n=e.anchor.getNode(),r=On(n)?n:n.getParent(),s=e.focus.getNode(),i=On(s)?s:s.getParent();return On(r)&&r.is(i)}function yb(e){let n=e.getNodes(),r=[];if(n.length===1&&On(n[0]))return r;let s=[];for(let i=0;i<n.length;i++){let a=n[i];Ut(a)||Yt(a)||Ue(a)||Rd(169),Ue(a)?s.length>0&&(r.push(s),s=[]):s.push(a)}if(s.length>0){let i=e.isBackward()?e.anchor:e.focus,a=qn(s[0].getKey(),0,"text");i.is(a)||r.push(s)}return r}function rb(e,n){let r=X();if(!j(r)||!Vs(r))return!1;let s=yb(r),i=s.length;if(i===0&&r.isCollapsed())return e===to&&r.insertNodes([gn()]),!0;if(i===0&&e===to&&r.getTextContent()===`
|
|
18
|
+
`){let a=gn(),l=fn(),c=r.isBackward()?"previous":"next";return r.insertNodes([a,l]),wn(dr(Jn(Xc(a,"next",0),It(it(l,"next"))),c)),!0}for(let a=0;a<i;a++){let l=s[a];if(l.length>0){let c=l[0];if(a===0&&(c=rs(c)),e===to){let d=gn();if(c.insertBefore(d),a===0){let f=r.isBackward()?"focus":"anchor",g=qn(c.getKey(),0,"text");r[f].is(g)&&r[f].set(d.getKey(),0,"text")}}else Yt(c)?c.remove():n!==void 0&&Ut(c)&&db(c,n,r)}}return!0}function sb(e,n){let r=X();if(!j(r))return!1;let{anchor:s,focus:i}=r,a=s.offset,l=i.offset,c=s.getNode(),d=i.getNode(),f=e===no;if(!Vs(r)||!Ut(c)&&!Yt(c)||!Ut(d)&&!Yt(d))return!1;if(!n.altKey){if(r.isCollapsed()){let T=c.getParentOrThrow();if(f&&a===0&&c.getPreviousSibling()===null){if(T.getPreviousSibling()===null)return T.selectPrevious(),n.preventDefault(),!1}else if(!f&&a===c.getTextContentSize()&&c.getNextSibling()===null){if(T.getNextSibling()===null)return T.selectNext(),n.preventDefault(),!1}}return!1}let g,p;if(c.isBefore(d)?(g=rs(c),p=Xs(d)):(g=rs(d),p=Xs(c)),g==null||p==null)return!1;let h=g.getNodesBetween(p);for(let T=0;T<h.length;T++){let b=h[T];if(!Ut(b)&&!Yt(b)&&!Ue(b))return!1}n.preventDefault(),n.stopPropagation();let x=f?g.getPreviousSibling():p.getNextSibling();if(!Ue(x))return!0;let y=f?x.getPreviousSibling():x.getNextSibling();if(y==null)return!0;let N=Ut(y)||Yt(y)||Ue(y)?f?rs(y):Xs(y):null,E=N!=null?N:y;return x.remove(),h.forEach((T)=>T.remove()),e===no?(h.forEach((T)=>E.insertBefore(T)),E.insertBefore(x)):(E.insertAfter(x),E=x,h.forEach((T)=>{E.insertAfter(T),E=T})),r.setTextNodeRange(c,a,d,l),!0}function ib(e,n){let r=X();if(!j(r))return!1;let{anchor:s,focus:i}=r,a=s.getNode(),l=i.getNode(),c=e===Mi;if(!Vs(r)||!Ut(a)&&!Yt(a)||!Ut(l)&&!Yt(l))return!1;let d=l,f=lb(d)==="rtl"?!c:c,{key:g,offset:p,type:h}=s;if(f){let x=cb(d,i.offset);if(x!==null){let{node:y,offset:N}=x;Ue(y)?y.selectNext(0,0):r.setTextNodeRange(y,N,y,N)}else d.getParentOrThrow().selectStart()}else ub(d).select();return n.shiftKey&&r.anchor.set(g,p,h),n.preventDefault(),n.stopPropagation(),!0}function Sb(e,n,r){return Ae(...r?[e.registerCommand(Go,(s)=>!s.altKey&&mp(On,s),Fe),e.registerCommand(vi,(s)=>mp(On,s),Fe),e.registerCommand(no,(s)=>!s.altKey&&_p(On,s),Fe),e.registerCommand(Yr,(s)=>_p(On,s),Fe)]:[],e.registerCommand(Vr,(s)=>{let i=function(a){let l=X();if(!j(l)||!Vs(l))return null;let c=a?jo:to,d=a?jo:Ds,{anchor:f,focus:g}=l;if(f.is(g))return d;let p=yb(l);if(p.length!==1)return c;let h=p[0],x,y;h.length===0&&Rd(285),l.isBackward()?(x=g,y=f):(x=f,y=g);let N=rs(h[0]),E=Xs(h[0]),T=qn(N.getKey(),0,"text"),b=qn(E.getKey(),E.getTextContentSize(),"text");return x.isBefore(T)||b.isBefore(y)?c:T.isBefore(x)||y.isBefore(b)?d:c}(s.shiftKey);return i!==null&&(s.preventDefault(),e.dispatchCommand(i),!0)},Fe),e.registerCommand(Ds,()=>!!Vs(X())&&(qc([gn()]),!0),Fe),e.registerCommand(to,()=>rb(to),Fe),e.registerCommand(jo,()=>rb(jo,n),Fe),e.registerCommand(no,(s)=>{let i=X();if(!j(i))return!1;let{anchor:a}=i,l=a.getNode();if(!Vs(i))return!1;let c=l.getParent();return i.isCollapsed()&&a.offset===0&&l.getPreviousSibling()===null&&On(c)&&c.getPreviousSibling()===null?(s.preventDefault(),!0):sb(no,s)},Fe),e.registerCommand(Go,(s)=>{let i=X();if(!j(i))return!1;let{anchor:a}=i,l=a.getNode();return!!Vs(i)&&(i.isCollapsed()&&a.offset===l.getTextContentSize()&&l.getNextSibling()===null&&On(l.getParentOrThrow())&&l.getParentOrThrow().getNextSibling()===null?(s.preventDefault(),!0):sb(Go,s))},Fe),e.registerCommand(Mi,(s)=>ib(Mi,s),Fe),e.registerCommand(Sl,(s)=>ib(Sl,s),Fe))}var Ik=_e({build:(e,n)=>wt(n),config:He({disabled:!1,escapeWithArrows:!1,tabSize:void 0}),dependencies:[Uh],name:"@lexical/code-indent",register:(e,n,r)=>{let s=r.getOutput();return Nt(()=>{if(!s.disabled.value)return Sb(e,s.tabSize.value,s.escapeWithArrows.value)})}});var Pt=Hh,{$createCodeHighlightNode:Md,$createCodeNode:qs,$getCodeLineDirection:Nb,$getEndOfCodeInLine:Eb,$getFirstCodeNodeOfLine:Tb,$getLastCodeNodeOfLine:bb,$getStartOfCodeInLine:vb,$isCodeHighlightNode:na,$isCodeNode:Jo,$outdentLeadingSpaces:Ob,$plainifyCodeContent:Ab,CodeExtension:Dd,CodeHighlightNode:jl,CodeImportExtension:OU,CodeImportRules:AU,CodeIndentExtension:$d,CodeNode:ss,DEFAULT_CODE_LANGUAGE:wd,getDefaultCodeLanguage:Rb,registerCodeIndentation:Mb}=Pt;var Zh={};je(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:()=>Vl,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:()=>oa,UNORDERED_LIST:()=>tv,isTableRowDivider:()=>Xb,registerMarkdownShortcuts:()=>Xk});function Wh(e,n){let r={};for(let s of e){let i=n(s);i&&(r[i]?r[i].push(s):r[i]=[s])}return r}function Ld(e){let n=Wh(e,(r)=>r.type);return{element:n.element||[],multilineElement:n["multiline-element"]||[],textFormat:n["text-format"]||[],textMatch:n["text-match"]||[]}}var Db=/[!-/:-@[-`{-~\s]/,$b=/\s/,Gh=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Lk=/^\s{0,3}$/;function ql(e){if(!$n(e))return!1;let n=e.getFirstChild();return n==null||e.getChildrenSize()===1&&re(n)&&Lk.test(n.getTextContent())}function jh(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(n,r)=>String.fromCodePoint(Number(r)))}var Wb=/^(\s*)(\d{1,})\.\s/,Gb=/^(\s*)[-*+]\s/,jb=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Yh=/^(#{1,6})\s/,Yb=/^>\s/,Vb=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Vh=/^[ \t]*`{3,}$/,Fk=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Pk=/^(?:\|)(.+)(?:\|)\s?$/;function Xb(e){if(e[0]!=="|")return!1;let{length:n}=e,r=1,s=0;for(;r<n;){let i=r;for(e[i]===" "&&i++,e[i]===":"&&i++;e[i]==="-";)i++;if(e[i]===":"&&i++,e[i]===" "&&i++,e[i]!=="|")break;s++,r=i+1}return s>0&&(r===n||r===n-1&&/\s/.test(e[r]))}var wb=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,kb=/^<\/[a-z_][\w-]*\s*>/i,Ib=(e)=>new RegExp(`(?:${e.source})$`,e.flags),Yl=Yo("mdListMarker",{parse:(e)=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),Lb=Yo("mdCodeFence",{parse:(e)=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),qb=Yo("mdHardLineBreak",{parse:(e)=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function Xh(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];let n=e.match(/^(.*?\S)( {2,})$/);return n?[n[1],n[2]]:null}function Bk(e){let n=e.getChildren(),r=n.length-1,s=n[r];if(!re(s))return null;let i=s.getTextContent(),a=Xh(i);if(a!==null){let[l,c]=a;return s.setTextContent(l),c}return/^ {2,}$/.test(i)&&function(l,c){for(let d=c-1;d>=0;d--){if(Ue(l[d]))return!1;if(/\S/.test(l[d].getTextContent()))return!0}return!1}(n,r)?(s.setTextContent(""),i):null}function Jb(e){let n=fn(),r=Bk(e);return r!==null&&eo(n,qb,r),n}var Zb=(e)=>(n,r,s,i)=>{let a=e(s);a.append(...r),n.replace(a),i||a.select(0,0)},Jh=(e)=>(n,r,s,i)=>{if(Pl(n))return!1;let a=n.getPreviousSibling(),l=n.getNextSibling(),c=y0(e==="check"?s[3]==="x":void 0),d=s[0].trim()[0],f=e!=="bullet"&&e!=="check"||d!==Yl.parse(d)?void 0:d;if(vo(l)&&l.getListType()===e){f&&eo(l,Yl,f);let p=l.getFirstChild();p!==null?p.insertBefore(c):l.append(c),e==="number"&&l.setStart(Number(s[2])),n.remove()}else if(vo(a)&&a.getListType()===e)f&&eo(a,Yl,f),a.append(c),n.remove();else{let p=S0(e,e==="number"?Number(s[2]):void 0);f&&eo(p,Yl,f),p.append(c),n.replace(p)}c.append(...r),i||c.select(0,0);let g=function(p){let h=p.match(/\t/g),x=p.match(/ /g),y=0;return h&&(y+=h.length),x&&(y+=Math.floor(x.length/4)),y}(s[1]);g&&c.setIndent(g)},Fd=(e,n,r,s)=>{let i=[],a=e.getChildren(),l=0;for(let c of a)if(bh(c)){if(c.getChildrenSize()===1){let x=c.getFirstChild();if(vo(x)){let y=Fd(x,n,r+1,s);y&&i.push(y);continue}}if(s&&!c.getChildren().some((x)=>x.isSelected(s)))continue;let d=" ".repeat(4*r),f=e.getListType(),g=Bo(e,Yl),p=f==="number"?`${e.getStart()+l}. `:f==="check"?`${g} [${c.getChecked()?"x":" "}] `:g+" ",h=n(c);f!=="number"&&(h=h.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(d+p+h),l++}return i.join(`
|
|
19
|
+
`)},Qb={dependencies:[md],export:(e,n)=>{if(!Pl(e))return null;let r=Number(e.getTag().slice(1));return"#".repeat(r)+" "+n(e)},regExp:Yh,replace:Zb((e)=>{let n="h"+e[1].length;return gd(n)}),triggerOnEnter:!0,type:"element"},ev={dependencies:[_d],export:(e,n)=>{if(!hd(e))return null;let r=n(e).split(`
|
|
20
20
|
`),s=[];for(let i of r)s.push("> "+i);return s.join(`
|
|
21
|
-
`)},regExp:
|
|
21
|
+
`)},regExp:Yb,replace:(e,n,r,s)=>{if(s){let a=e.getPreviousSibling();if(hd(a))return a.splice(a.getChildrenSize(),0,[Jb(a),...n]),void e.remove()}let i=pd();i.append(...n),e.replace(i),s||i.select(0,0)},triggerOnEnter:!0,type:"element"},Vl={dependencies:[ss],export:(e)=>{if(!Jo(e))return null;let n=e.getTextContent(),r=Bo(e,Lb);if(n.indexOf(r)>-1){let s=n.match(/`{3,}/g);if(s){let i=Math.max(...s.map((a)=>a.length));r="`".repeat(i+1)}}return r+(e.getLanguage()||"")+(n?`
|
|
22
22
|
`+n:"")+`
|
|
23
|
-
`+r},handleImportAfterStartMatch:({lines:e,rootNode:n,startLineIndex:r,startMatch:s})=>{let i=s[1],a=i.trim().length,l=e[r],c=s.index+i.length,d=l.slice(c),f=new RegExp(`\`{${a},}$`);if(f.test(d)){let x=d.match(f),
|
|
24
|
-
`)}eo(l,
|
|
25
|
-
`),s=0,i=[];for(let a=0;a<r.length;a++){let l=r[a],c=l.trimEnd(),d=i[i.length-1],f=a<r.length-1?
|
|
26
|
-
`)}function zk(e,n,r,s,i,a){let l=e.isSelected(n);for(let c of r){if(!c.export)continue;let d=c.export(e,(f)=>Xl(f,n,s,i,a).markdown,n);if(d!=null){if(!l&&Q(e))Xl(e,n,s,i,a).shouldInclude&&(l=!0);return{markdown:d,shouldInclude:l}}}if(Q(e)){let c=Xl(e,n,s,i,a);return{markdown:c.markdown,shouldInclude:l||c.shouldInclude}}return kt(e)?{markdown:e.getTextContent(),shouldInclude:l}:{markdown:null,shouldInclude:l}}function Xl(e,n,r,s,i,a,l){let c=[],d=e.getChildren(),f=!1;a||(a=[]),l||(l=[]);e:for(let g of d){let p=g.isSelected(n);for(let h of s){if(!h.export)continue;let x=h.export(g,(
|
|
27
|
-
`}function Id(e,n,r,s,i,a=!1){let l=e.hasFormat("code"),c,d,f,g,p=n;if(l||(p=a?p.replace(/([*_`~])/g,"\\$1"):p.replace(/([*_`~\\])/g,"\\$1")),l){let{fence:b,padded:v}=function(O){let k=O.match(/`+/g),M=k?Math.max(...k.map((z)=>z.length)):0;return{fence:"`".repeat(M+1),padded:O.length===0||O.includes("`")||/^\s/.test(O)&&/\s$/.test(O)?` ${O} `:O}}(n);c="",f="",d=b+v+b,g=!1}else{let b=p.match(/^(\s*)(.*?)(\s*)$/s)||["","",p,""];c=b[1],d=b[2],f=b[3],g=d===""}let h="",x="",
|
|
28
|
-
`),c=l.length;for(let f=0;f<c;f++){let g=l[f],[p,h]=Wk(l,f,i.multilineElement,n);p?f=h:Gk(g,n,i.element,a,i.textMatch,s)}let d=n.getChildren();for(let f of d)if(!s&&ql(f)&&n.getChildrenSize()>1)f.remove();else if(Q(f))for(let g of f.getAllTextNodes())jk(g)}function Wk(e,n,r,s){for(let i of r){let{handleImportAfterStartMatch:a,regExpEnd:l,regExpStart:c,replace:d}=i,f=e[n].match(c);if(!f)continue;if(a){let
|
|
29
|
-
`.concat(y):y)}return p.join(`
|
|
30
|
-
`)}}(e,r)(n)}function Qk(e=oa,n,r=!1){if(!n||G(n)&&n.isCollapsed())return"";return function(i,a=!1){let l=Ld(i),c=[...l.multilineElement,...l.element],d=!a,f=l.textFormat.filter((g)=>g.format.length===1).sort((g,p)=>Number(g.format.includes("code"))-Number(p.format.includes("code")));return(g)=>{let p=[],h=Je().getChildren();for(let x=0;x<h.length;x++){let C=h[x],{shouldInclude:y,markdown:N}=zk(C,g,c,f,l.textMatch,a);y&&N!=null&&p.push(d&&x>0&&!ql(C)&&!ql(h[x-1])?`
|
|
23
|
+
`+r},handleImportAfterStartMatch:({lines:e,rootNode:n,startLineIndex:r,startMatch:s})=>{let i=s[1],a=i.trim().length,l=e[r],c=s.index+i.length,d=l.slice(c),f=new RegExp(`\`{${a},}$`);if(f.test(d)){let x=d.match(f),y=d.slice(0,d.lastIndexOf(x[0])),N=[...s];return N[2]="",Vl.replace(n,null,N,x,[y],!0),[!0,r]}let g=new RegExp(`^[ \\t]*\`{${a},}$`);for(let x=r+1;x<e.length;x++){let y=e[x];if(g.test(y)){let N=y.match(g),E=e.slice(r+1,x),T=l.slice(s[0].length);return T.length>0&&E.unshift(T),Vl.replace(n,null,s,N,E,!0),[!0,x]}}let p=e.slice(r+1),h=l.slice(s[0].length);return h.length>0&&p.unshift(h),Vl.replace(n,null,s,null,p,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:Vh},regExpStart:Vb,replace:(e,n,r,s,i,a)=>{let l,c,d=r[1]?r[1].trim():"```",f=r[2]||void 0;if(!n&&i){if(i.length===1)s?(l=qs(f),c=i[0]):(l=qs(f),c=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(l=qs(f),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();c=i.join(`
|
|
24
|
+
`)}eo(l,Lb,d);let g=yt(c);l.append(g),e.append(l)}else n&&Zb((g)=>qs(g?g[2]:void 0))(e,n,r,a)},type:"multiline-element"},tv={dependencies:[qo,ns],export:(e,n,r)=>vo(e)?Fd(e,n,0,r):null,regExp:Gb,replace:Jh("bullet"),triggerOnEnter:!0,type:"element"},Kk={dependencies:[qo,ns],export:(e,n,r)=>vo(e)?Fd(e,n,0,r):null,regExp:jb,replace:Jh("check"),triggerOnEnter:!0,type:"element"},nv={dependencies:[qo,ns],export:(e,n,r)=>vo(e)?Fd(e,n,0,r):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:[ea],export:(e,n,r)=>{if(!Qi(e)||q0(e))return null;let s=n(e),i=e.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${s}](${e.getURL()} "${i}")`:`[${s}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,n)=>{if(he(e,Qi))return;let[,r,s,i]=n,a=s!=null?jh(s):void 0,l=i!=null?jh(i):void 0,c=X0(a,{title:l}),d=r.split("[").length-1,f=r.split("]").length-1,g=r,p="";if(d<f)return;if(d>f){let x=r.split("[");p="["+x[0],g=x.slice(1).join("[")}let h=yt(g);return h.setFormat(e.getFormat()),c.append(h),e.replace(c),p&&c.insertBefore(yt(p)),h},trigger:")",type:"text-match"},gv=[Qb,ev,tv,nv],pv=[Vl],hv=[ov,sv,iv,av,lv,rv,uv,dv,cv],mv=[fv],oa=[...gv,...pv,...hv,...mv];function _v(e,n=!1){let r=e.split(`
|
|
25
|
+
`),s=0,i=[];for(let a=0;a<r.length;a++){let l=r[a],c=l.trimEnd(),d=i[i.length-1],f=a<r.length-1?Xh(l):null,g=d!==void 0&&Xh(d)!==null;if(Fk.test(c))i.push(c);else if(s===0){{let p=c.match(Vb);if(p){s=p[1].trim().length,i.push(c);continue}}c===""||d===""||!d||Yh.test(d)||Yh.test(c)||Yb.test(c)||Wb.test(c)||Gb.test(c)||jb.test(c)||Pk.test(c)||Xb(c)||g||!n||wb.test(c)||kb.test(c)||Ib(kb).test(d)||Ib(wb).test(d)||Vh.test(d)?i.push(!n&&c!==""||f!==null?l:c):i[i.length-1]=d+" "+(f===null?c:l).trimStart()}else{if(Vh.test(c)&&c.trim().length>=s){s=0,i.push(c);continue}i.push(l)}}return i.join(`
|
|
26
|
+
`)}function zk(e,n,r,s,i,a){let l=e.isSelected(n);for(let c of r){if(!c.export)continue;let d=c.export(e,(f)=>Xl(f,n,s,i,a).markdown,n);if(d!=null){if(!l&&Q(e))Xl(e,n,s,i,a).shouldInclude&&(l=!0);return{markdown:d,shouldInclude:l}}}if(Q(e)){let c=Xl(e,n,s,i,a);return{markdown:c.markdown,shouldInclude:l||c.shouldInclude}}return kt(e)?{markdown:e.getTextContent(),shouldInclude:l}:{markdown:null,shouldInclude:l}}function Xl(e,n,r,s,i,a,l){let c=[],d=e.getChildren(),f=!1;a||(a=[]),l||(l=[]);e:for(let g of d){let p=g.isSelected(n);for(let h of s){if(!h.export)continue;let x=h.export(g,(y)=>Xl(y,n,r,s,i,a,[...l,...a]).markdown,(y,N)=>Id(y,Ps(n,y,"clone").getTextContent(),r,a,l,i));if(x!=null){!p&&Q(g)&&g.getChildren().some((y)=>y.isSelected(n))&&g.extractWithChild(g,n,"html")&&(p=!0),p&&(c.push(x),f=!0);continue e}}if(Ue(g))p&&(c.push(xv(g)),f=!0);else if(re(g)){if(p){let h=Ps(n,g,"clone");c.push(Id(g,h.getTextContent(),r,a,l,i)),f=!0}}else if(Q(g)){let h=Xl(g,n,r,s,i,a,l);!p&&h.shouldInclude&&g.extractWithChild(g,n,"html")&&(p=!0),(p||h.shouldInclude)&&(c.push(h.markdown),f=!0)}else kt(g)&&p&&(c.push(g.getTextContent()),f=!0)}return{markdown:c.join(""),shouldInclude:f}}function Uk(e,n,r,s,i){for(let a of n){if(!a.export)continue;let l=a.export(e,(c)=>kd(c,r,s,void 0,void 0,i));if(l!=null)return l}return Q(e)?kd(e,r,s,void 0,void 0,i):kt(e)?e.getTextContent():null}function kd(e,n,r,s,i,a=!1){let l=[],c=e.getChildren();s||(s=[]),i||(i=[]);e:for(let d of c){for(let f of r){if(!f.export)continue;let g=f.export(d,(p)=>kd(p,n,r,s,[...i,...s],a),(p,h)=>Id(p,h,n,s,i,a));if(g!=null){l.push(g);continue e}}Ue(d)?l.push(xv(d)):re(d)?l.push(Id(d,d.getTextContent(),n,s,i,a)):Q(d)?l.push(kd(d,n,r,s,i,a)):kt(d)&&l.push(d.getTextContent())}return l.join("")}function xv(e){return Bo(e,qb)+`
|
|
27
|
+
`}function Id(e,n,r,s,i,a=!1){let l=e.hasFormat("code"),c,d,f,g,p=n;if(l||(p=a?p.replace(/([*_`~])/g,"\\$1"):p.replace(/([*_`~\\])/g,"\\$1")),l){let{fence:b,padded:v}=function(O){let k=O.match(/`+/g),M=k?Math.max(...k.map((z)=>z.length)):0;return{fence:"`".repeat(M+1),padded:O.length===0||O.includes("`")||/^\s/.test(O)&&/\s$/.test(O)?` ${O} `:O}}(n);c="",f="",d=b+v+b,g=!1}else{let b=p.match(/^(\s*)(.*?)(\s*)$/s)||["","",p,""];c=b[1],d=b[2],f=b[3],g=d===""}let h="",x="",y="",N=Fb(e,!0),E=Fb(e,!1),T=new Set;for(let b of r){let v=b.format[0],O=b.tag;v!=="code"&&(Pb(e,v)&&!T.has(v)&&(T.add(v),Pb(N,v)&&s.find((k)=>k.tag===O)||(s.push({format:v,tag:O}),h+=O)))}for(let b=0;b<s.length;b++){let v=qh(e,s[b].format),O=qh(E,s[b].format);if(v&&O)continue;let k=[...s];for(;k.length>b;){let M=k.pop();i&&M&&i.find((z)=>z.tag===M.tag)||(M&&typeof M.tag=="string"&&(v?O||(y+=M.tag):x+=M.tag),s.pop())}break}return g&&!e.hasFormat("code")?x+p:x+c+h+d+y+f}function Fb(e,n){let r=n?e.getPreviousSibling():e.getNextSibling();return re(r)?r:null}function qh(e,n){return re(e)&&e.hasFormat(n)}function Pb(e,n){return!!qh(e,n)&&(n==="code"||(!e||!/^\s*$/.test(e.getTextContent())))}function Hk(e,n){let r=e.getTextContent(),s=n.transformersByTag["`"],i=[],a=null;if(s){let p=function(h){let x=(b)=>{let v=0;for(let O=b-1;O>=0&&h[O]==="\\";O--)v++;return v%2==1},y=[],N=0;for(;N<h.length;)if(h[N]==="`"){let b=1;for(;N+b<h.length&&h[N+b]==="`";)b++;y.push({index:N,length:b}),N+=b}else N++;let E=[],T=0;for(;T<y.length;){let b=y[T];if(x(b.index)){T++;continue}let v=-1;for(let M=T+1;M<y.length;M++)if(y[M].length===b.length){v=M;break}if(v===-1){T++;continue}let O=y[v],k=h.slice(b.index+b.length,O.index);k.length>=2&&k.startsWith(" ")&&k.endsWith(" ")&&/[^ ]/.test(k)&&(k=k.slice(1,-1)),E.push({content:k,endIndex:O.index+O.length,startIndex:b.index}),T=v+1}return E}(r);for(let h of p)a||(a={content:h.content,endIndex:h.endIndex,startIndex:h.startIndex,tag:"`"}),i.push({end:h.endIndex,start:h.startIndex})}let l=function(p,h,x=[]){let y=[],N=new Set(Object.keys(h.transformersByTag).filter((v)=>v[0]!=="`").map((v)=>v[0])),E=(v)=>{let O=0;for(let k=v-1;k>=0&&p[k]==="\\";k--)O++;return O%2==1},T=(v)=>x.some((O)=>v>=O.start&&v<O.end),b=0;for(;b<p.length;){let v=p[b];if(!N.has(v)||E(b)||T(b)){b++;continue}let O=1;for(;b+O<p.length&&p[b+O]===v;)O++;let k=Bb(v,p,b,O,!0),M=Bb(v,p,b,O,!1);(k||M)&&y.push({active:!0,canClose:M,canOpen:k,char:v,index:b,length:O}),b+=O}return y}(r,n,i),c=l.length>0?function(p,h,x){let y={},N=0,E=null;for(;N<h.length;){let T=h[N];if(!T.active||!T.canClose||T.length===0){N++;continue}let b=`${T.char}${T.canOpen}${T.length%3}`,v=y[b]??-1,O=!1;for(let k=N-1;k>v;k--){let M=h[k];if(!M.active||!M.canOpen||M.length===0||M.char!==T.char)continue;if(M.canClose||T.canOpen){if((M.length+T.length)%3==0&&M.length%3!=0&&T.length%3!=0)continue}let z=Math.min(M.length,T.length),K=Object.keys(x.transformersByTag).filter((W)=>W[0]===M.char&&W.length<=z).sort((W,ne)=>ne.length-W.length)[0];if(!K)continue;O=!0;let U=K.length,J={content:p.slice(M.index+M.length,T.index),endIndex:T.index+U,startIndex:M.index+(M.length-U),tag:K};(!E||J.startIndex<E.startIndex||J.startIndex===E.startIndex&&J.endIndex>E.endIndex)&&(E=J);for(let W=k+1;W<N;W++)h[W].active=!1;M.length-=U,T.length-=U,M.active=M.length>0,T.length>0?T.index+=U:(T.active=!1,N++);break}O||(y[b]=N-1,T.canOpen||(T.active=!1),N++)}return E}(r,l,n):null,d=null,f=null;if(a&&c?c.startIndex<=a.startIndex&&c.endIndex>=a.endIndex?(d=c,f=n.transformersByTag[c.tag]):(d=a,f=s):a?(d=a,f=s):c&&(d=c,f=n.transformersByTag[c.tag]),!d||!f)return null;let g=[r.slice(d.startIndex,d.endIndex),d.tag,d.content];return g.index=d.startIndex,g.input=r,{endIndex:d.endIndex,isCodeSpan:f===s,match:g,startIndex:d.startIndex,transformer:f}}function Bb(e,n,r,s,i){if(!Kb(n,r,s,i))return!1;if(e==="*")return!0;if(e==="_"){if(!Kb(n,r,s,!i))return!0;let a=i?n[r-1]:n[r+s];return a!==void 0&&Gh.test(a)}return!0}function Kb(e,n,r,s){let i=e[n-1],a=e[n+r],[l,c]=s?[a,i]:[i,a];return l!==void 0&&!$b.test(l)&&(!Gh.test(l)||(c===void 0||$b.test(c)||Gh.test(c)))}function is(e){return re(e)&&!e.hasFormat("code")}function Js(e,n,r){let s=Hk(e,n),i=function(l,c){let d=l,f,g,p,h;for(let x of c){if(!x.replace||!x.importRegExp)continue;let y=d.getTextContent().match(x.importRegExp);if(!y)continue;let N=y.index||0,E=x.getEndIndex?x.getEndIndex(d,y):N+y[0].length;E!==!1&&(f===void 0||g===void 0||N<f&&(E>g||E<=f))&&(f=N,g=E,p=x,h=y)}return f===void 0||g===void 0||p===void 0||h===void 0?null:{endIndex:g,match:h,startIndex:f,transformer:p}}(e,r);if(s&&i&&(s.isCodeSpan?i.startIndex<=s.startIndex&&i.endIndex>=s.endIndex?s=null:i=null:s.startIndex<=i.startIndex&&s.endIndex>=i.endIndex||i.startIndex>s.endIndex?i=null:s=null),s){let l=function(c,d,f,g,p){let h=c.getTextContent(),x,y,N;if(p[0]===h?x=c:d===0?[x,y]=c.splitText(f):[N,x,y]=c.splitText(d,f),x.setTextContent(p[2]),g)for(let E of g.format)x.hasFormat(E)||x.toggleFormat(E);return{nodeAfter:y,nodeBefore:N,transformedNode:x}}(e,s.startIndex,s.endIndex,s.transformer,s.match);is(l.nodeAfter)&&Js(l.nodeAfter,n,r),is(l.nodeBefore)&&Js(l.nodeBefore,n,r),is(l.transformedNode)&&Js(l.transformedNode,n,r)}else if(i){let l=function(c,d,f,g,p){let h,x,y;return d===0?[h,x]=c.splitText(f):[y,h,x]=c.splitText(d,f),g.replace?{nodeAfter:x,nodeBefore:y,transformedNode:g.replace(h,p)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!l)return;is(l.nodeAfter)&&Js(l.nodeAfter,n,r),is(l.nodeBefore)&&Js(l.nodeBefore,n,r),is(l.transformedNode)&&Js(l.transformedNode,n,r)}let a=jh(e.getTextContent());e.setTextContent(a)}function Cv(e,n,r,s=!1){let i=Ld(r),a=function(f){let g={},p={},h=[];for(let x of f){let{tag:y}=x;g[y]=x;let N=y.replace(/(\*|\^|\+)/g,"\\$1");h.push(N),y.length===1?p[y]=y==="`"?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${N}])(${N})((\\\\${N})?.*?[^${N}\\s](\\\\${N})?)(${N})(?![\\\\${N}])`):p[y]=new RegExp(`(^|[^\\\\])(${N})((\\\\${N})?.*?[^\\s](\\\\${N})?)(${N})(?!\\\\)`)}return{fullMatchRegExpByTag:p,openTagsRegExp:new RegExp(`(${h.join("|")})`,"g"),transformersByTag:g}}(i.textFormat),l=e.split(`
|
|
28
|
+
`),c=l.length;for(let f=0;f<c;f++){let g=l[f],[p,h]=Wk(l,f,i.multilineElement,n);p?f=h:Gk(g,n,i.element,a,i.textMatch,s)}let d=n.getChildren();for(let f of d)if(!s&&ql(f)&&n.getChildrenSize()>1)f.remove();else if(Q(f))for(let g of f.getAllTextNodes())jk(g)}function Wk(e,n,r,s){for(let i of r){let{handleImportAfterStartMatch:a,regExpEnd:l,regExpStart:c,replace:d}=i,f=e[n].match(c);if(!f)continue;if(a){let y=a({lines:e,rootNode:s,startLineIndex:n,startMatch:f,transformer:i});if(y===null)continue;if(y)return y}let g=typeof l=="object"&&"regExp"in l?l.regExp:l,p=l&&typeof l=="object"&&"optional"in l?l.optional:!l,h=n,x=e.length;for(;h<x;){let y=g?e[h].match(g):null;if(!y&&(!p||p&&h<x-1)){h++;continue}if(y&&n===h&&y.index===f.index){h++;continue}let N=[];if(y&&n===h)N.push(e[n].slice(f[0].length,-y[0].length));else for(let E=n;E<=h;E++)if(E===n){let T=e[E].slice(f[0].length);N.push(T)}else if(E===h&&y){let T=e[E].slice(0,-y[0].length);N.push(T)}else N.push(e[E]);if(d(s,null,f,y,N,!0)!==!1)return[!0,h];break}}return[!1,n]}function Gk(e,n,r,s,i,a){let l=yt(e),c=Se();c.append(l),n.append(c);for(let{regExp:d,replace:f}of r){let g=e.match(d);if(g&&(l.setTextContent(e.slice(g[0].length)),f(c,[l],g,!0)!==!1))break}if(Js(l,s,i),c.getParent()!==null&&e.length>0){let d=c.getPreviousSibling();if(!a&&($n(d)||hd(d)||vo(d))){let f=d;if(vo(d)){let g=d.getLastDescendant();f=g==null?null:he(g,bh)}f!=null&&f.getTextContentSize()>0&&(f.splice(f.getChildrenSize(),0,[Jb(f),...c.getChildren()]),c.remove())}}}function jk(e){let n=new Set,r=e.getTextContent(),s=r.indexOf("\t");for(;s!==-1;)n.add(s),n.add(s+1),s=r.indexOf("\t",s+1);e.splitText(...n).forEach((i)=>{i.getTextContent()==="\t"&&i.replace(gn())})}function Yk(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function zb(e,n,r,s,i){let a=e.getParent();if(!Dt(a)||e.getFirstChild()!==n)return!1;let l=n.getTextContent();if(!i&&l[r-1]!==" ")return!1;for(let{regExp:c,replace:d}of s){let f=l.match(c),g=i||f&&f[0].endsWith(" ")?r:r-1;if(f&&f[0].length===g){let p=n.getNextSiblings(),[h,x]=n.splitText(r);if(d(e,x?[x,...p]:p,f,!1)!==!1)return h.remove(),!0}}return!1}function Ub(e,n,r,s,i){let a=e.getParent();if(!Dt(a)||e.getFirstChild()!==n)return!1;let l=n.getTextContent();if(!i&&l[r-1]!==" ")return!1;for(let{regExpStart:c,replace:d,regExpEnd:f}of s){if(f&&!("optional"in f)||f&&"optional"in f&&!f.optional)continue;let g=l.match(c);if(g){let p=i||g[0].endsWith(" ")?r:r-1;if(g[0].length!==p)continue;let h=n.getNextSiblings(),[x,y]=n.splitText(r);if(d(e,y?[y,...h]:h,g,null,null,!1)!==!1)return x.remove(),!0}}return!1}function Vk(e,n){let r=0,s=e.getTextContent();for(let i=0;i<n;i++)s[i]==="`"&&r++;return r%2!=0}function Hb(e,n,r){let s=r.length;for(let i=n;i>=s;i--){let a=i-s;if(yv(e,a,r,0,s)&&e[a+s]!==" ")return a}return-1}function yv(e,n,r,s,i){for(let a=0;a<i;a++)if(e[n+a]!==r[s+a])return!1;return!0}function Xk(e,n=oa){let r=Ld(n),s=r.element.filter((d)=>d.triggerOnEnter),i=Wh(r.textFormat,({tag:d})=>d[d.length-1]),a=Wh(r.textMatch,({trigger:d})=>d),l=new Set([" "]);for(let d of r.textFormat)l.add(d.tag.slice(-1));for(let d of r.textMatch)d.trigger!==void 0&&l.add(d.trigger);for(let d of n){let f=d.type;if(f==="element"||f==="text-match"||f==="multiline-element"){let g=d.dependencies;for(let p of g)e.hasNode(p)||Yk(173,p.getType())}}let c=(d,f,g)=>!!zb(d,f,g,r.element)||(!!Ub(d,f,g,r.multilineElement)||(!!function(p,h,x){let y=p.getTextContent(),N=x[y[h-1]];if(N==null)return!1;h<y.length&&(y=y.slice(0,h));for(let E of N){if(!E.replace||!E.regExp)continue;let T=y.match(E.regExp);if(T===null)continue;let b=T.index||0,v=b+T[0].length,O;return b===0?[O]=p.splitText(v):[,O]=p.splitText(b,v),O.selectNext(0,0),E.replace(O,T),!0}return!1}(f,g,a)||!!function(p,h,x){let y=p.getTextContent(),N=h-1,E=y[N],T=x[E];if(!T)return!1;for(let b of T){let{tag:v}=b,O=v.length,k=N-O+1;if(O>1&&!yv(y,k,v,0,O))continue;if(y[k-1]===" ")continue;let M=y[N+1];if(b.intraword===!1&&M&&!Db.test(M))continue;let z=p,K=z,U=Hb(y,k,v),J=K;for(;U<0&&(J=J.getPreviousSibling())&&!Ue(J);)if(re(J)){if(J.hasFormat("code"))continue;let oe=J.getTextContent();K=J,U=Hb(oe,oe.length,v)}if(U<0)continue;if(K===z&&U+O===k)continue;let W=K.getTextContent();if(U>0&&W[U-1]===E)continue;let ne=W[U-1];if(b.intraword===!1&&ne&&!Db.test(ne))continue;if(!b.format.includes("code")&&Vk(K,U))continue;let ee=z.getTextContent(),se=ee.slice(0,k)+ee.slice(N+1);z.setTextContent(se);let V=K===z?se:W;K.setTextContent(V.slice(0,U)+V.slice(U+O));let fe=X(),Ce=Kr();mt(Ce);let Oe=N-O*(K===z?2:1)+1;Ce.anchor.set(K.__key,U,"text"),Ce.focus.set(z.__key,Oe,"text");for(let oe of b.format)Ce.formatText(oe,wi[oe]);Ce.anchor.set(Ce.focus.key,Ce.focus.offset,Ce.focus.type);for(let oe of b.format)Ce.hasFormat(oe)&&Ce.toggleFormat(oe);return j(fe)&&(Ce.format=fe.format),!0}return!1}(f,g,i)));return Ae(e.registerUpdateListener(({tags:d,dirtyLeaves:f,editorState:g,prevEditorState:p})=>{if(d.has(Yy)||d.has(bi))return;if(e.isComposing())return;let h=d.has(tu),x=g.read(X),y=p.read(X);if(!j(y)||!j(x)||!x.isCollapsed()||x.is(y)&&!h)return;let N=x.anchor.key,E=x.anchor.offset,T=g._nodeMap.get(N);if(re(T)&&f.has(N)&&(h||E===1||!(E>y.anchor.offset+1))){if(h){let b=g.read(()=>T.getTextContent())[E-1];if(!l.has(b))return}e.update(()=>{if(!is(T))return;let b=T.getParent();b===null||Jo(b)||c(b,T,x.anchor.offset)&&sl(uu)})}}),e.registerCommand(Ai,(d)=>{if(d!==null&&d.shiftKey)return!1;let f=X();if(!j(f)||!f.isCollapsed())return!1;let g=f.anchor.offset,p=f.anchor.getNode();if(!re(p)||!is(p))return!1;let h=p.getParent();if(h===null||Jo(h))return!1;return g===p.getTextContent().length&&(!(!Ub(h,p,g,r.multilineElement,!0)&&!zb(h,p,g,s,!0))&&(d!==null&&d.preventDefault(),!0))},Fe))}function qk(e,n=oa,r,s=!1,i=!1){let a=s?e:_v(e,i),l=r||Je();l.clear(),Cv(a,l,n,s),X()!==null&&l.selectStart()}function Jk(e,n=oa,r=!1,s=!1){let i=r?e:_v(e,s),a=new fl;return Cv(i,a,n,r),a.getChildren()}function Zk(e=oa,n,r=!1){return function(i,a=!1){let l=Ld(i),c=[...l.multilineElement,...l.element],d=!a,f=l.textFormat.filter((g)=>g.format.length===1).sort((g,p)=>Number(g.format.includes("code"))-Number(p.format.includes("code")));return(g)=>{let p=[],h=(g||Je()).getChildren();for(let x=0;x<h.length;x++){let y=h[x],N=Uk(y,c,f,l.textMatch,a);N!=null&&p.push(d&&x>0&&!ql(y)&&!ql(h[x-1])?`
|
|
31
29
|
`.concat(N):N)}return p.join(`
|
|
32
|
-
`)}}(e,r)(n)}var at=Qh,{$convertFromMarkdownString:em,$convertSelectionToMarkdownString:LU,$convertToMarkdownString:Nv,$generateNodesFromMarkdownString:FU,BOLD_ITALIC_STAR:PU,BOLD_ITALIC_UNDERSCORE:BU,BOLD_STAR:KU,BOLD_UNDERSCORE:zU,CHECK_LIST:Ev,CODE:UU,ELEMENT_TRANSFORMERS:Tv,HEADING:HU,HIGHLIGHT:WU,INLINE_CODE:GU,ITALIC_STAR:jU,ITALIC_UNDERSCORE:YU,LINK:VU,MULTILINE_ELEMENT_TRANSFORMERS:bv,ORDERED_LIST:XU,QUOTE:qU,STRIKETHROUGH:JU,TEXT_FORMAT_TRANSFORMERS:vv,TEXT_MATCH_TRANSFORMERS:Ov,TRANSFORMERS:Av,UNORDERED_LIST:ZU,isTableRowDivider:QU,registerMarkdownShortcuts:Rv}=at;var tm={};ke(tm,{DEFAULT_TRANSFORMERS:()=>Mv,MarkdownShortcutPlugin:()=>eI});S();var Mv=[{dependencies:[ju],export:(e)=>zN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,n,r,s)=>{let i=Gu();s||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:"element"},...Av];function eI({transformers:e=Mv}){let[n]=st();return m(()=>Rv(n,e),[n,e]),null}var Dv=tm,{DEFAULT_TRANSFORMERS:sH,MarkdownShortcutPlugin:$v}=Dv;var nm={};ke(nm,{OnChangePlugin:()=>nI});S();var tI=pn?$e:m;function nI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:n=!1,onChange:r}){let[s]=st();return tI(()=>{if(r)return s.registerUpdateListener(({editorState:i,dirtyElements:a,dirtyLeaves:l,prevEditorState:c,tags:d})=>{n&&a.size===0&&l.size===0||e&&d.has(Gr)||c.isEmpty()||r(i,s,d)})},[s,e,n,r]),null}var oI=nm,wv=oI.OnChangePlugin;S();var om={};ke(om,{LexicalErrorBoundary:()=>rI});class kv extends Ls{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),n)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function rI({children:e,fallback:n,onError:r}){return t(kv,{fallback:n===void 0?t("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):n,onError:r,children:e})}var sI=om,Iv=sI.LexicalErrorBoundary;var hH=H(rm(),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(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:Prism.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,n){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:[n,"language-"+n],inside:Prism.languages[n]},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 n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(g){return g=g.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+g+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),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:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<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:r(/!?\[(?:(?!\])<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(g){["url","bold","italic","strike","code-snippet"].forEach(function(p){if(g!==p)e.languages.markdown[g].inside.content.inside[p]=e.languages.markdown[p]})}),e.hooks.add("after-tokenize",function(g){if(g.language!=="markdown"&&g.language!=="md")return;function p(h){if(!h||typeof h==="string")return;for(var x=0,C=h.length;x<C;x++){var y=h[x];if(y.type!=="code"){p(y.content);continue}var N=y.content[1],T=y.content[3];if(N&&T&&N.type==="code-language"&&T.type==="code-block"&&typeof N.content==="string"){var b=N.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase();var v="language-"+b;if(!T.alias)T.alias=[v];else if(typeof T.alias==="string")T.alias=[T.alias,v];else T.alias.push(v)}}}p(g.tokens)}),e.hooks.add("wrap",function(g){if(g.type!=="code-block")return;var p="";for(var h=0,x=g.classes.length;h<x;h++){var C=g.classes[h],y=/language-(.+)/.exec(C);if(y){p=y[1];break}}var N=e.languages[p];if(!N){if(p&&p!=="none"&&e.plugins.autoloader){var T="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);g.attributes.id=T,e.plugins.autoloader.loadLanguages(p,function(){var b=document.getElementById(T);if(b)b.innerHTML=e.highlight(b.textContent,e.languages[p],p)})}}else g.content=e.highlight(f(g.content),N,p)});var l=RegExp(e.languages.markup.tag.pattern.source,"gi"),c={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;function f(g){var p=g.replace(l,"");return p=p.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(h,x){if(x=x.toLowerCase(),x[0]==="#"){var C;if(x[1]==="x")C=parseInt(x.slice(2),16);else C=Number(x.slice(1));return d(C)}else{var y=c[x];if(y)return y;return h}}),p}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 n=/(?:"(?:\\(?:\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+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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 r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.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 n=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:/[|{}[\];(),.]/};n.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:n},boolean:n.boolean,variable:n.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 n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),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 n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,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:n}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var n=/\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/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[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":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:n,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":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(e){var n=/\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/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.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 n.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:n,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 r})+")"),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 n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];if(!/^\w+$/.test(r))i.push(/\w+/.exec(r)[0]);if(r==="diff")i.push("bold");e.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
|
|
30
|
+
`)}}(e,r)(n)}function Qk(e=oa,n,r=!1){if(!n||j(n)&&n.isCollapsed())return"";return function(i,a=!1){let l=Ld(i),c=[...l.multilineElement,...l.element],d=!a,f=l.textFormat.filter((g)=>g.format.length===1).sort((g,p)=>Number(g.format.includes("code"))-Number(p.format.includes("code")));return(g)=>{let p=[],h=Je().getChildren();for(let x=0;x<h.length;x++){let y=h[x],{shouldInclude:N,markdown:E}=zk(y,g,c,f,l.textMatch,a);N&&E!=null&&p.push(d&&x>0&&!ql(y)&&!ql(h[x-1])?`
|
|
31
|
+
`.concat(E):E)}return p.join(`
|
|
32
|
+
`)}}(e,r)(n)}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;var em={};je(em,{DEFAULT_TRANSFORMERS:()=>Rv,MarkdownShortcutPlugin:()=>eI});S();var Rv=[{dependencies:[ju],export:(e)=>KN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,n,r,s)=>{let i=Gu();s||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:"element"},...Ov];function eI({transformers:e=Rv}){let[n]=st();return m(()=>Av(n,e),[n,e]),null}var Mv=em,{DEFAULT_TRANSFORMERS:sH,MarkdownShortcutPlugin:Dv}=Mv;var tm={};je(tm,{OnChangePlugin:()=>nI});S();var tI=pn?$e:m;function nI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:n=!1,onChange:r}){let[s]=st();return tI(()=>{if(r)return s.registerUpdateListener(({editorState:i,dirtyElements:a,dirtyLeaves:l,prevEditorState:c,tags:d})=>{n&&a.size===0&&l.size===0||e&&d.has(Gr)||c.isEmpty()||r(i,s,d)})},[s,e,n,r]),null}var oI=tm,$v=oI.OnChangePlugin;S();var nm={};je(nm,{LexicalErrorBoundary:()=>rI});class wv extends Ls{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),n)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function rI({children:e,fallback:n,onError:r}){return t(wv,{fallback:n===void 0?t("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):n,onError:r,children:e})}var sI=nm,kv=sI.LexicalErrorBoundary;var hH=H(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(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:Prism.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,n){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:[n,"language-"+n],inside:Prism.languages[n]},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 n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(g){return g=g.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+g+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),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:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<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:r(/!?\[(?:(?!\])<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(g){["url","bold","italic","strike","code-snippet"].forEach(function(p){if(g!==p)e.languages.markdown[g].inside.content.inside[p]=e.languages.markdown[p]})}),e.hooks.add("after-tokenize",function(g){if(g.language!=="markdown"&&g.language!=="md")return;function p(h){if(!h||typeof h==="string")return;for(var x=0,y=h.length;x<y;x++){var N=h[x];if(N.type!=="code"){p(N.content);continue}var E=N.content[1],T=N.content[3];if(E&&T&&E.type==="code-language"&&T.type==="code-block"&&typeof E.content==="string"){var b=E.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase();var v="language-"+b;if(!T.alias)T.alias=[v];else if(typeof T.alias==="string")T.alias=[T.alias,v];else T.alias.push(v)}}}p(g.tokens)}),e.hooks.add("wrap",function(g){if(g.type!=="code-block")return;var p="";for(var h=0,x=g.classes.length;h<x;h++){var y=g.classes[h],N=/language-(.+)/.exec(y);if(N){p=N[1];break}}var E=e.languages[p];if(!E){if(p&&p!=="none"&&e.plugins.autoloader){var T="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);g.attributes.id=T,e.plugins.autoloader.loadLanguages(p,function(){var b=document.getElementById(T);if(b)b.innerHTML=e.highlight(b.textContent,e.languages[p],p)})}}else g.content=e.highlight(f(g.content),E,p)});var l=RegExp(e.languages.markup.tag.pattern.source,"gi"),c={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;function f(g){var p=g.replace(l,"");return p=p.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(h,x){if(x=x.toLowerCase(),x[0]==="#"){var y;if(x[1]==="x")y=parseInt(x.slice(2),16);else y=Number(x.slice(1));return d(y)}else{var N=c[x];if(N)return N;return h}}),p}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 n=/(?:"(?:\\(?:\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+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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 r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.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 n=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:/[|{}[\];(),.]/};n.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:n},boolean:n.boolean,variable:n.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 n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),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 n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,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:n}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var n=/\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/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[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":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:n,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":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(e){var n=/\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/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.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 n.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:n,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 r})+")"),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 n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];if(!/^\w+$/.test(r))i.push(/\w+/.exec(r)[0]);if(r==="diff")i.push("bold");e.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
|
|
33
33
|
?|
|
|
34
|
-
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:n})})(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
|
|
34
|
+
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:n})})(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 lm={};je(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 IH=H(om(),1);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),e.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
|
|
35
35
|
?|
|
|
36
|
-
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:n})})(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 uo=globalThis.Prism||window.Prism,
|
|
37
|
-
`+ ++l);r.setAttribute("data-gutter",a)}function Uv(e,n,r,s){let{nodesCurrentlyHighlighting:i}=r,a=s.getKey();s.getLanguage()===void 0&&n.defaultLanguage!==null&&s.setLanguage(n.defaultLanguage);let l=s.getLanguage()||n.defaultLanguage;if(l){if(!Kv(l))return s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1),void zv();s.getIsSyntaxHighlightSupported()||s.setIsSyntaxHighlightSupported(!0)}else s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1);i.has(a)||(i.add(a),r.didTransform||(r.didTransform=!0,zy(()=>{r.didTransform=!1,i.clear()})),function(c,d){let f=Mt(c);if(!Jo(f)||!f.isAttached())return;let g=X();if(!G(g))return void d();let p=g.anchor,h=p.offset,x=p.type==="element"&&He(f.getChildAtIndex(p.offset-1)),C=0;if(!x){let y=p.getNode();C=h+y.getPreviousSiblings().reduce((N,T)=>N+T.getTextContentSize(),0)}if(!d())return;if(x)return void p.getNode().select(h,h);f.getChildren().some((y)=>{let N=re(y);if(N||He(y)){let T=y.getTextContentSize();if(N&&T>=C)return y.select(C,C),!0;C-=T}return!1})}(a,()=>{let c=Mt(a);if(!Jo(c)||!c.isAttached())return!1;let d=c.getLanguage()||n.defaultLanguage,f=n.$tokenize(c,d??void 0),g=function(C,y){let N=0;for(;N<C.length&&Fv(C[N],y[N]);)N++;let T=C.length,b=y.length,v=Math.min(T,b)-N,O=0;for(;O<v;)if(O++,!Fv(C[T-O],y[b-O])){O--;break}let k=N,M=T-O,z=y.slice(N,b-O);return{from:k,nodesForReplacement:z,to:M}}(c.getChildren(),f),{from:p,to:h,nodesForReplacement:x}=g;return!(p===h&&!x.length)&&(s.splice(p,h-p,x),!0)}))}function Fv(e,n){return na(e)&&na(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||Yt(e)&&Yt(n)||He(e)&&He(n)}function Hv(e,n){let r=[];e._headless!==!0&&r.push(e.registerMutationListener(ss,(i)=>{e.read("latest",()=>{for(let[a,l]of i)if(l!=="destroyed"){let c=Mt(a);c!==null&&gI(c,e)}})},{skipInitialization:!1}));let s={didTransform:!1,nodesCurrentlyHighlighting:new Set};return r.push(e.registerNodeTransform(ss,Uv.bind(null,e,n,s)),e.registerNodeTransform(In,Lv.bind(null,e,n,s)),e.registerNodeTransform(jl,Lv.bind(null,e,n,s))),Me(...r)}function pI(e,n=lm){if(!e.hasNodes([ss,jl]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return Me(Hv(e,n),Db(e))}var hI=_e({build:(e,n)=>wt(n),config:We({disabled:!1,tokenizer:lm}),dependencies:[Dd,$d],name:"@lexical/code-prism",register:(e,n,r)=>{let s=r.getOutput();return Nt(()=>{if(!s.disabled.value)return Hv(e,s.tokenizer.value)})}});var fo=cm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:um,CODE_LANGUAGE_MAP:dm,CodePrismExtension:JH,PrismTokenizer:fm,getCodeLanguageOptions:gm,getCodeLanguages:pm,getCodeThemeOptions:hm,getLanguageFriendlyName:mm,isCodeLanguageLoaded:ZH,loadCodeLanguage:QH,normalizeCodeLanguage:Bd,registerCodeHighlighting:_m}=fo;var xm={};ke(xm,{$createCodeHighlightNode:()=>Md,$createCodeNode:()=>qs,$getCodeLineDirection:()=>Eb,$getEndOfCodeInLine:()=>Tb,$getFirstCodeNodeOfLine:()=>bb,$getLastCodeNodeOfLine:()=>vb,$getStartOfCodeInLine:()=>Ob,$isCodeHighlightNode:()=>na,$isCodeNode:()=>Jo,$outdentLeadingSpaces:()=>Ab,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>_I,CODE_LANGUAGE_MAP:()=>xI,CodeExtension:()=>Dd,CodeHighlightNode:()=>jl,CodeIndentExtension:()=>$d,CodeNode:()=>ss,DEFAULT_CODE_LANGUAGE:()=>wd,PrismTokenizer:()=>bI,getCodeLanguageOptions:()=>CI,getCodeLanguages:()=>yI,getCodeThemeOptions:()=>SI,getDefaultCodeLanguage:()=>Mb,getLanguageFriendlyName:()=>NI,normalizeCodeLang:()=>EI,normalizeCodeLanguage:()=>TI,registerCodeHighlighting:()=>vI});var _I=um,xI=dm,CI=gm,yI=pm,SI=hm,NI=mm,EI=Bd,TI=Bd,bI=fm,vI=_m;var gt=xm,{$createCodeHighlightNode:tW,$createCodeNode:Gv,$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:jv,DEFAULT_CODE_LANGUAGE:hW,PrismTokenizer:mW,getCodeLanguageOptions:_W,getCodeLanguages:xW,getCodeThemeOptions:CW,getDefaultCodeLanguage:yW,getLanguageFriendlyName:SW,normalizeCodeLang:NW,normalizeCodeLanguage:EW,registerCodeHighlighting:TW}=gt;var Fm={};ke(Fm,{$computeTableCellRectBoundary:()=>Zl,$computeTableMap:()=>an,$computeTableMapSkipCellCheck:()=>go,$createTableCellNode:()=>_n,$createTableNode:()=>oc,$createTableNodeWithDimensions:()=>eO,$createTableRowNode:()=>yr,$createTableSelection:()=>GI,$createTableSelectionFrom:()=>Gd,$deleteTableColumn:()=>LI,$deleteTableColumnAtSelection:()=>sO,$deleteTableColumn__EXPERIMENTAL:()=>PI,$deleteTableRowAtSelection:()=>rO,$deleteTableRow__EXPERIMENTAL:()=>FI,$findCellNode:()=>ia,$findTableNode:()=>Qs,$getElementForTableNode:()=>mO,$getNodeTriplet:()=>Ht,$getTableAndElementByKey:()=>Im,$getTableCellNodeFromLexicalNode:()=>AI,$getTableCellNodeRect:()=>Tm,$getTableColumnIndexFromTableCellNode:()=>MI,$getTableNodeFromLexicalNodeOrThrow:()=>Yd,$getTableRowIndexFromTableCellNode:()=>RI,$getTableRowNodeFromTableCellNodeOrThrow:()=>Dm,$insertTableColumn:()=>kI,$insertTableColumnAtNode:()=>Wd,$insertTableColumnAtSelection:()=>oO,$insertTableColumn__EXPERIMENTAL:()=>II,$insertTableRow:()=>$I,$insertTableRowAtNode:()=>Hd,$insertTableRowAtSelection:()=>nO,$insertTableRow__EXPERIMENTAL:()=>wI,$isScrollableTablesActive:()=>ec,$isSimpleTable:()=>km,$isStickyScrollbarActive:()=>Mm,$isTableCellNode:()=>xe,$isTableNode:()=>rt,$isTableRowNode:()=>ze,$isTableSelection:()=>je,$mergeCells:()=>iO,$moveTableColumn:()=>zI,$moveTableRow:()=>UI,$removeTableRowAtIndex:()=>DI,$setTableColumnIsHeader:()=>WI,$setTableRowIsHeader:()=>HI,$unmergeCell:()=>KI,$unmergeCellNode:()=>wm,INSERT_TABLE_COMMAND:()=>Qv,TableCellHeaderStates:()=>Oe,TableCellNode:()=>Cr,TableExtension:()=>SO,TableImportExtension:()=>f1,TableImportRules:()=>yO,TableNode:()=>Sr,TableObserver:()=>Lm,TableRowNode:()=>da,TableRowSchema:()=>d1,TableSchema:()=>u1,applyTableHandlers:()=>uO,getDOMCellFromTarget:()=>Ql,getTableElement:()=>Zo,getTableObserverFromTableElement:()=>bm,registerTableCellUnmergeTransform:()=>_O,registerTablePlugin:()=>CO,registerTableSelectionObserver:()=>xO,setScrollableTablesActive:()=>hO});var aa=/^(\d+(?:\.\d+)?)px$/,Oe={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Cr extends ct{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config("tablecell",{extends:ct,importDOM:{td:()=>({conversion:Yv,priority:0}),th:()=>({conversion:Yv,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=Oe.NO_STATUS,n=1,r,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let n=Xe().createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),Nm(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),et(n,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),n}exportDOM(e){let n=super.exportDOM(e);if(ye(n.element)){let r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...Nm(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 n=this.getWritable();return n.__colSpan=e,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let n=this.getWritable();return n.__rowSpan=e,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,n=Oe.BOTH){let r=this.getWritable();return r.__headerState=e&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let n=this.getWritable();return n.__width=e,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let n=this.getWritable();return n.__backgroundColor=e,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let n=this.getWritable();return n.__verticalAlign=e||void 0,n}toggleHeaderStyle(e){let n=this.getWritable();return(n.__headerState&e)===e?n.__headerState-=e:n.__headerState+=e,n}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==Oe.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 Nm(e){return e==="middle"||e==="bottom"}function Yv(e){let n=e,r=e.nodeName.toLowerCase(),s;aa.test(n.style.width)&&(s=parseFloat(n.style.width));let i=Oe.NO_STATUS;if(r==="th"){let y=n.getAttribute("scope");if(y==="col")i=Oe.COLUMN;else if(y==="row")i=Oe.ROW;else{let N=n.parentElement,T=ye(N)&&N.nodeName.toLowerCase()==="tr"&&ye(N.parentElement)&&(N.parentElement.nodeName.toLowerCase()==="thead"||N.rowIndex===0),b=n.cellIndex===0;T&&(i|=Oe.ROW),b&&(i|=Oe.COLUMN),i===Oe.NO_STATUS&&(i=Oe.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;Nm(c)&&(a.__verticalAlign=c);let d=n.style,f=(d&&d.textDecoration||"").split(" "),g=d.fontWeight==="700"||d.fontWeight==="bold",p=f.includes("line-through"),h=d.fontStyle==="italic",x=f.includes("underline"),C=d.color;return{after:(y)=>{let N=[],T=null,b=()=>{if(T){let v=T.getFirstChild();He(v)&&T.getChildrenSize()===1&&v.remove()}};for(let v of y)if(zg(v)||re(v)||He(v)){if(re(v)&&(g&&v.toggleFormat("bold"),p&&v.toggleFormat("strikethrough"),h&&v.toggleFormat("italic"),x&&v.toggleFormat("underline"),C)){let O=v.getStyle();O.includes("color:")||v.setStyle(O+`color: ${C};`)}T?T.append(v):(T=Se().append(v),N.push(T))}else N.push(v),b(),T=null;return b(),N.length===0&&N.push(Se()),N},node:a}}function _n(e=Oe.NO_STATUS,n=1,r){return cn(new Cr(e,n,r))}function xe(e){return e instanceof Cr}var Qv=bn("INSERT_TABLE_COMMAND");function pe(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class da extends ct{__height;$config(){return this.config("tablerow",{extends:ct,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,n){super(n),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){let n=Xe().createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),et(n,e.theme.tableRow),n}extractWithChild(e,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){let n=this.getWritable();return n.__height=e,n}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function OI(e){let n=e,r;return aa.test(n.style.height)&&(r=parseFloat(n.style.height)),{after:(s)=>bl(s,xe),node:yr(r)}}function yr(e){return cn(new da(e))}function ze(e){return e instanceof da}function eO(e,n,r=!0){let s=oc();for(let i=0;i<e;i++){let a=yr();for(let l=0;l<n;l++){let c=Oe.NO_STATUS;typeof r=="object"?(i===0&&r.rows&&(c|=Oe.ROW),l===0&&r.columns&&(c|=Oe.COLUMN)):r&&(i===0&&(c|=Oe.ROW),l===0&&(c|=Oe.COLUMN));let d=_n(c),f=Se();f.append(yt()),d.append(f),a.append(d)}s.append(a)}return s}function AI(e){let n=he(e,(r)=>xe(r));return xe(n)?n:null}function Dm(e){let n=he(e,(r)=>ze(r));if(ze(n))return n;throw Error("Expected table cell to be inside of table row.")}function Yd(e){let n=he(e,(r)=>rt(r));if(rt(n))return n;throw Error("Expected table cell to be inside of table.")}function RI(e){let n=Dm(e);return Yd(n).getChildren().findIndex((r)=>r.is(n))}function MI(e){return Dm(e).getChildren().findIndex((n)=>n.is(e))}function tO(e,n){let r=Yd(e),{x:s,y:i}=r.getCordsFromCellNode(e,n);return{above:r.getCellNodeFromCords(s,i-1,n),below:r.getCellNodeFromCords(s,i+1,n),left:r.getCellNodeFromCords(s-1,i,n),right:r.getCellNodeFromCords(s+1,i,n)}}function DI(e,n){let r=e.getChildren();if(n>=r.length||n<0)throw Error("Expected table cell to be inside of table row.");return r[n].remove(),e}function $I(e,n,r=!0,s,i){let a=e.getChildren();if(n>=a.length||n<0)throw Error("Table row target index out of range");let l=a[n];if(!ze(l))throw Error("Row before insertion index does not exist.");for(let c=0;c<s;c++){let d=l.getChildren(),f=d.length,g=yr();for(let p=0;p<f;p++){let h=d[p];xe(h)||pe(12);let{above:x,below:C}=tO(h,i),y=Oe.NO_STATUS,N=x&&x.getWidth()||C&&C.getWidth()||void 0;(x&&x.hasHeaderState(Oe.COLUMN)||C&&C.hasHeaderState(Oe.COLUMN))&&(y|=Oe.COLUMN);let T=_n(y,1,N);T.append(Se()),g.append(T)}r?l.insertAfter(g):l.insertBefore(g)}return e}var Em=(e,n)=>e===Oe.BOTH||e===n?n:Oe.NO_STATUS;function nO(e=!0){let n=X();G(n)||je(n)||pe(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ht(r),[a,,l]=Ht(s),[,c,d]=an(l,a,i),{startRow:f}=d,{startRow:g}=c;return e?Hd(f+i.__rowSpan>g+a.__rowSpan?i:a,!0):Hd(g<f?a:i,!1)}var wI=nO;function Hd(e,n=!0){let[,,r]=Ht(e),[s,i]=an(r,e,e),a=s[0].length,{startRow:l}=i,c=null;if(n){let d=l+e.__rowSpan-1,f=s[d],g=yr();for(let h=0;h<a;h++){let{cell:x,startRow:C}=f[h];if(C+x.__rowSpan-1<=d){let y=f[h].cell.__headerState,N=Em(y,Oe.COLUMN);g.append(_n(N).append(Se()))}else x.setRowSpan(x.__rowSpan+1)}let p=r.getChildAtIndex(d);ze(p)||pe(256),p.insertAfter(g),c=g}else{let d=l,f=s[d],g=yr();for(let h=0;h<a;h++){let{cell:x,startRow:C}=f[h];if(C===d){let y=f[h].cell.__headerState,N=Em(y,Oe.COLUMN);g.append(_n(N).append(Se()))}else x.setRowSpan(x.__rowSpan+1)}let p=r.getChildAtIndex(d);ze(p)||pe(257),p.insertBefore(g),c=g}return c}function kI(e,n,r=!0,s,i){let a=e.getChildren(),l=[];for(let c=0;c<a.length;c++){let d=a[c];if(ze(d))for(let f=0;f<s;f++){let g=d.getChildren();if(n>=g.length||n<0)throw Error("Table column target index out of range");let p=g[n];xe(p)||pe(12);let{left:h,right:x}=tO(p,i),C=Oe.NO_STATUS;(h&&h.hasHeaderState(Oe.ROW)||x&&x.hasHeaderState(Oe.ROW))&&(C|=Oe.ROW);let y=_n(C);y.append(Se()),l.push({newTableCell:y,targetCell:p})}}return l.forEach(({newTableCell:c,targetCell:d})=>{r?d.insertAfter(c):d.insertBefore(c)}),e}function oO(e=!0){let n=X();G(n)||je(n)||pe(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ht(r),[a,,l]=Ht(s),[,c,d]=an(l,a,i),{startColumn:f}=d,{startColumn:g}=c;return e?Wd(f+i.__colSpan>g+a.__colSpan?i:a,!0):Wd(g<f?a:i,!1)}var II=oO;function Wd(e,n=!0,r=!0){let[,,s]=Ht(e),[i,a]=an(s,e,e),l=i.length,{startColumn:c}=a,d=n?c+e.__colSpan-1:c-1,f=s.getFirstChild();ze(f)||pe(120);let g=null;function p(C=Oe.NO_STATUS){let y=_n(C).append(Se());return g===null&&(g=y),y}let h=f;e:for(let C=0;C<l;C++){if(C!==0){let k=h.getNextSibling();ze(k)||pe(121),h=k}let y=i[C],N=y[d<0?0:d].cell.__headerState,T=Em(N,Oe.ROW);if(d<0){$m(h,p(T));continue}let{cell:b,startColumn:v,startRow:O}=y[d];if(v+b.__colSpan-1<=d){let k=b,M=O,z=d;for(;M!==C&&k.__rowSpan>1;){if(z-=b.__colSpan,!(z>=0)){h.append(p(T));continue e}{let{cell:K,startRow:U}=y[z];k=K,M=U}}k.insertAfter(p(T))}else b.setColSpan(b.__colSpan+1)}g!==null&&r&&Jl(g);let x=s.getColWidths();if(x){let C=[...x],y=d<0?0:d,N=C[y];C.splice(y,0,N),s.setColWidths(C)}return g}function LI(e,n){let r=e.getChildren();for(let s=0;s<r.length;s++){let i=r[s];if(ze(i)){let a=i.getChildren();if(n>=a.length||n<0)throw Error("Table column target index out of range");a[n].remove()}}return e}function rO(){let e=X();G(e)||je(e)||pe(188);let[n,r]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[s,,i]=Ht(n),[a]=Ht(r),[l,c,d]=an(i,s,a),{startRow:f}=c,{startRow:g}=d,p=g+a.__rowSpan-1;if(l.length===p-f+1)return void i.remove();let h=l[0].length,x=l[p+1],C=i.getChildAtIndex(p+1);for(let y=p;y>=f;y--){for(let T=h-1;T>=0;T--){let{cell:b,startRow:v,startColumn:O}=l[y][T];if(O===T){if(v<f||v+b.__rowSpan-1>p){let k=Math.max(v,f),M=Math.min(b.__rowSpan+v-1,p),z=k<=M?M-k+1:0;b.setRowSpan(b.__rowSpan-z)}if(v>=f&&v+b.__rowSpan-1>p&&y===p){ze(C)||pe(387);let k=null;for(let M=0;M<T;M++){let z=x[M],K=z.cell;z.startRow===y+1&&(k=K),K.__colSpan>1&&(M+=K.__colSpan-1)}k===null?$m(C,b):k.insertAfter(b)}}}let N=i.getChildAtIndex(y);ze(N)||pe(206,String(y)),N.remove()}if(x!==void 0){let{cell:y}=x[0];Jl(y)}else{let y=l[f-1],{cell:N}=y[0];Jl(N)}}var FI=rO;function sO(){let e=X();G(e)||je(e)||pe(188);let n=e.anchor.getNode(),r=e.focus.getNode(),[s,,i]=Ht(n),[a]=Ht(r),[l,c,d]=an(i,s,a),{startColumn:f}=c,{startRow:g,startColumn:p}=d,h=Math.min(f,p),x=Math.max(f+s.__colSpan-1,p+a.__colSpan-1),C=x-h+1;if(l[0].length===x-h+1)return i.selectPrevious(),void i.remove();let y=l.length;for(let v=0;v<y;v++)for(let O=h;O<=x;O++){let{cell:k,startColumn:M}=l[v][O];if(M<h){if(O===h){let z=h-M;k.setColSpan(k.__colSpan-Math.min(C,k.__colSpan-z))}}else if(M+k.__colSpan-1>x){if(O===x){let z=x-M+1;k.setColSpan(k.__colSpan-z)}}else k.remove()}let N=l[g],T=f>p?N[f+s.__colSpan]:N[p+a.__colSpan];if(T!==void 0){let{cell:v}=T;Jl(v)}else{let v=p<f?N[p-1]:N[f-1],{cell:O}=v;Jl(O)}let b=i.getColWidths();if(b){let v=[...b];v.splice(h,C),i.setColWidths(v)}}var PI=sO;function Jl(e){let n=e.getFirstDescendant();n==null?e.selectStart():n.getParentOrThrow().selectStart()}function $m(e,n){let r=e.getFirstChild();r!==null?r.insertBefore(n):e.append(n)}function iO(e){if(e.length===0)return null;let n=Yd(e[0]),[r]=go(n,null,null),s=1/0,i=-1/0,a=1/0,l=-1/0,c=new Set;for(let x of r)for(let C of x){if(!C||!C.cell)continue;let y=C.cell.getKey();if(!c.has(y)&&e.some((N)=>N.is(C.cell))){c.add(y);let{startRow:N,startColumn:T}=C,b=C.cell.__rowSpan||1,v=C.cell.__colSpan||1;s=Math.min(s,N),i=Math.max(i,N+b-1),a=Math.min(a,T),l=Math.max(l,T+v-1)}}if(s===1/0||a===1/0)return null;let d=i-s+1,f=l-a+1,g=r[s][a];if(!g.cell)return null;let p=g.cell;p.setColSpan(f),p.setRowSpan(d);let h=new Set([p.getKey()]);for(let x=s;x<=i;x++)for(let C=a;C<=l;C++){let y=r[x][C];if(!y.cell)continue;let N=y.cell,T=N.getKey();if(!h.has(T))h.add(T),BI(N)||p.append(...N.getChildren()),N.remove()}return p.getChildrenSize()===0&&p.append(Se()),p}function BI(e){if(e.getChildrenSize()!==1)return!1;let n=e.getFirstChildOrThrow();return!(!$n(n)||!n.isEmpty())}function KI(){let e=X();G(e)||je(e)||pe(188);let n=e.anchor.getNode(),r=he(n,xe);return xe(r)||pe(148),wm(r)}function wm(e){let[n,r,s]=Ht(e),{__colSpan:i,__rowSpan:a}=n;if(i===1&&a===1)return;let[l,c]=an(s,n,n),{startColumn:d,startRow:f}=c,g=n.__headerState&Oe.COLUMN,p=Array.from({length:i},(C,y)=>{let N=g;for(let T=0;N!==0&&T<l.length;T++)N&=l[T][y+d].cell.__headerState;return N}),h=n.__headerState&Oe.ROW,x=Array.from({length:a},(C,y)=>{let N=h;for(let T=0;N!==0&&T<l[0].length;T++)N&=l[y+f][T].cell.__headerState;return N});if(i>1){for(let C=1;C<i;C++)n.insertAfter(_n(p[C]|x[0]).append(Se()));n.setColSpan(1)}if(a>1){let C;for(let y=1;y<a;y++){let N=f+y,T=l[N];C=(C||r).getNextSibling(),ze(C)||pe(125);let b=null;for(let v=0;v<d;v++){let O=T[v],k=O.cell;O.startRow===N&&(b=k),k.__colSpan>1&&(v+=k.__colSpan-1)}if(b===null)for(let v=i-1;v>=0;v--)$m(C,_n(p[v]|x[y]).append(Se()));else for(let v=i-1;v>=0;v--)b.insertAfter(_n(p[v]|x[y]).append(Se()))}n.setRowSpan(1)}}function an(e,n,r){let[s,i,a]=go(e,n,r);return i===null&&pe(207),a===null&&pe(208),[s,i,a]}function go(e,n,r){let s=[],i=null,a=null;function l(d){let f=s[d];return f===void 0&&(s[d]=f=[]),f}let c=e.getChildren();for(let d=0;d<c.length;d++){let f=c[d];ze(f)||pe(209);let g=l(d);for(let p=f.getFirstChild(),h=0;p!=null;p=p.getNextSibling()){for(xe(p)||pe(147);g[h]!==void 0;)h++;let x={cell:p,startColumn:h,startRow:d},{__rowSpan:C,__colSpan:y}=p;for(let N=0;N<C&&!(d+N>=c.length);N++){let T=l(d+N);for(let b=0;b<y;b++)T[h+b]=x}n!==null&&i===null&&n.is(p)&&(i=x),r!==null&&a===null&&r.is(p)&&(a=x)}}return[s,i,a]}function Ht(e){let n;if(e instanceof Cr)n=e;else if("__type"in e){let i=he(e,xe);xe(i)||pe(148),n=i}else{let i=he(e.getNode(),xe);xe(i)||pe(148),n=i}let r=n.getParent();ze(r)||pe(149);let s=r.getParent();return rt(s)||pe(210),[n,r,s]}function Zl(e,n,r){let s,i=Math.min(n.startColumn,r.startColumn),a=Math.min(n.startRow,r.startRow),l=Math.max(n.startColumn+n.cell.__colSpan-1,r.startColumn+r.cell.__colSpan-1),c=Math.max(n.startRow+n.cell.__rowSpan-1,r.startRow+r.cell.__rowSpan-1);do{s=!1;for(let d=0;d<e.length;d++)for(let f=0;f<e[0].length;f++){let g=e[d][f];if(!g)continue;let p=g.startColumn+g.cell.__colSpan-1,h=g.startRow+g.cell.__rowSpan-1,x=g.startColumn<=l&&p>=i,C=g.startRow<=c&&h>=a;if(x&&C){let y=Math.min(i,g.startColumn),N=Math.max(l,p),T=Math.min(a,g.startRow),b=Math.max(c,h);y===i&&N===l&&T===a&&b===c||(i=y,l=N,a=T,c=b,s=!0)}}}while(s);return{maxColumn:l,maxRow:c,minColumn:i,minRow:a}}function km(e){let n=e.getChildren(),r=null;for(let s of n){if(!ze(s))return!1;if(r===null&&(r=s.getChildrenSize()),s.getChildrenSize()!==r)return!1;let i=s.getChildren();for(let a of i)if(!xe(a)||a.getRowSpan()!==1||a.getColSpan()!==1)return!1}return(r||0)>0}function zI(e,n,r){if(n===r)return;let s=e.getColumnCount();if(n<0||n>=s||r<0||r>=s)return;if(!km(e))return;e.getChildren().filter(ze).forEach((a)=>{let l=a.getChildren(),[c]=l.splice(n,1);l.splice(r,0,c),a.splice(0,l.length,l)});let i=e.getColWidths();if(i&&i.length===s){let a=[...i],[l]=a.splice(n,1);a.splice(r,0,l),e.setColWidths(a)}}function UI(e,n,r){if(n===r)return;let s=e.getChildren().filter(ze),i=s.length;if(n<0||n>=i||r<0||r>=i)return;if(!km(e))return;let a=s[n],l=s[r];r>n?l.insertAfter(a):l.insertBefore(a)}function Tm(e){let[n,,r]=Ht(e),s=r.getChildren().filter(ze),i=s.length,a=s[0].getChildren().length,l=Array(i);for(let c=0;c<i;c++)l[c]=Array(a);for(let c=0;c<i;c++){let d=s[c].getChildren().filter(xe),f=0;for(let g=0;g<d.length;g++){for(;l[c][f];)f++;let p=d[g],h=p.__rowSpan||1,x=p.__colSpan||1;for(let C=0;C<h;C++)for(let y=0;y<x;y++)l[c+C][f+y]=p;if(n===p)return{colSpan:x,columnIndex:f,rowIndex:c,rowSpan:h};f+=x}}return null}function aO(e,n){let r=n.getStartEndPoints(),s=je(n);if(r===null)return!1;let[i,a]=r,[l,c,d]=Ht(i),f=he(a.getNode(),(W)=>xe(W));if(!(xe(l)&&xe(f)&&ze(c)&&rt(d)))return!1;let[g,p,h]=an(d,l,f),[x]=go(e,null,null),C=g.length,y=C>0?g[0].length:0,{startRow:N,startColumn:T}=p,b=x.length,v=b>0?x[0].length:0;if(s){let W=Zl(g,p,h),ne=W.maxRow-W.minRow+1,ee=W.maxColumn-W.minColumn+1;N=W.minRow,T=W.minColumn,b=Math.min(b,ne),v=Math.min(v,ee)}let O=!1,k=Math.min(C,N+b)-1,M=Math.min(y,T+v)-1,z=new Set;for(let W=N;W<=k;W++)for(let ne=T;ne<=M;ne++){let ee=g[W][ne];z.has(ee.cell.getKey())||(ee.cell.__rowSpan===1&&ee.cell.__colSpan===1||(wm(ee.cell),z.add(ee.cell.getKey()),O=!0))}let[K]=go(d.getWritable(),null,null),U=b-C+N;for(let W=0;W<U;W++)Hd(K[C-1][0].cell);let J=v-y+T;for(let W=0;W<J;W++)Wd(K[0][y-1].cell,!0,!1);[K]=go(d.getWritable(),null,null);for(let W=N;W<N+b;W++)for(let ne=T;ne<T+v;ne++){let ee=W-N,se=ne-T,Y=x[ee][se];if(Y.startRow!==ee||Y.startColumn!==se)continue;let fe=Y.cell;if(fe.__rowSpan!==1||fe.__colSpan!==1){let ae=[],ue=Math.min(W+fe.__rowSpan,N+b)-1,we=Math.min(ne+fe.__colSpan,T+v)-1;for(let Ie=W;Ie<=ue;Ie++)for(let ht=ne;ht<=we;ht++){let Qt=K[Ie][ht];ae.push(Qt.cell)}iO(ae),O=!0}let{cell:Ce}=K[W][ne],Ae=fe.getBackgroundColor();Ae!=null&&Ce.setBackgroundColor(Ae);let oe=Ce.getChildren();fe.getChildren().forEach((ae)=>{if(re(ae))Se().append(ae),Ce.append(ae);else Ce.append(ae)}),oe.forEach((ae)=>ae.remove())}if(s&&O){let[W]=go(d.getWritable(),null,null);W[p.startRow][p.startColumn].cell.selectEnd()}return!0}function HI(e,n,r){let[s]=go(e,null,null);n>=0&&n<s.length||pe(396,String(n));let i=s[n],a=r?Oe.ROW:Oe.NO_STATUS,l=new Set;for(let c=0;c<i.length;c++){let d=i[c];d!=null&&(l.has(d.cell)||(l.add(d.cell),d.cell.setHeaderStyles(a,Oe.ROW)))}}function WI(e,n,r){let[s]=go(e,null,null);s.length>0&&n>=0&&n<s[0].length||pe(397,String(n));let i=r?Oe.COLUMN:Oe.NO_STATUS,a=new Set;for(let l=0;l<s.length;l++){let c=s[l][n];c!=null&&(a.has(c.cell)||(a.add(c.cell),c.cell.setHeaderStyles(i,Oe.COLUMN)))}}function Cm(e){let[[n,r,s,i],[a,l,c,d]]=["anchor","focus"].map((f)=>{let g=e[f].getNode(),p=he(g,xe);xe(p)||pe(238,f,g.getKey(),g.getType());let h=p.getParent();ze(h)||pe(239,f);let x=h.getParent();return rt(x)||pe(240,f),[g,p,h,x]});return i.is(d)||pe(241),{anchorCell:r,anchorNode:n,anchorRow:s,anchorTable:i,focusCell:l,focusNode:a,focusRow:c,focusTable:d}}class tc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;let e=Mt(this.tableKey),n=Mt(this.anchor.key),r=Mt(this.focus.key);return e!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return je(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,n,r){this.dirty=this.dirty||e!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new tc(this.tableKey,qn(this.anchor.key,this.anchor.offset,this.anchor.type),qn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e==="")return;let n=(e.endsWith(`
|
|
36
|
+
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:n})})(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 uo=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 n=Pv(e);return im[n]||n}var cI=()=>Object.keys(uo.languages).filter((e)=>typeof uo.languages[e]!="function").sort();function uI(){let e=[];for(let[n,r]of Object.entries(im))e.push([n,r]);return e}function dI(){return[]}function Bv(e){let n=function(s){let i=/^diff-([\w-]+)/i.exec(s);return i?i[1]:null}(e),r=n||e;try{return!!r&&uo.languages.hasOwnProperty(r)}catch(s){return!1}}async function Kv(e,n,r){}function rm(e){return typeof e=="string"?e:Array.isArray(e)?e.map(rm).join(""):rm(e.content)}function fI(e,n){let r=/^diff-([\w-]+)/i.exec(n),s=e.getTextContent(),i=uo.tokenize(s,uo.languages[r?"diff":n]);return r&&(i=function(a,l){let c=l,d=uo.languages[c],f={tokens:a},g=uo.languages.diff.PREFIXES;for(let p of f.tokens){if(typeof p=="string"||!(p.type in g)||!Array.isArray(p.content))continue;let h=p.type,x=0,y=()=>(x++,new uo.Token("prefix",g[h],h.replace(/^(\w+).*/,"$1"))),N=p.content.filter((k)=>typeof k=="string"||k.type!=="prefix"),E=p.content.length-N.length,T=uo.tokenize(rm(N),d);T.unshift(y());let b=/\r\n|\n/g,v=(k)=>{let M=[];b.lastIndex=0;let z,K=0;for(;x<E&&(z=b.exec(k));){let U=z.index+z[0].length;M.push(k.slice(K,U)),K=U,M.push(y())}if(M.length!==0)return K<k.length&&M.push(k.slice(K)),M},O=(k)=>{for(let M=0;M<k.length&&x<E;M++){let z=k[M];if(typeof z=="string"){let K=v(z);K&&(k.splice(M,1,...K),M+=K.length-1)}else if(typeof z.content=="string"){let K=v(z.content);K&&(z.content=K)}else Array.isArray(z.content)?O(z.content):O([z.content])}};O(T),x<E&&T.push(y()),p.content=T}return f.tokens}(i,r[1])),sm(i)}function sm(e,n){let r=[];for(let s of e)if(typeof s=="string")Fi(s,{linebreak:()=>r.push(fn()),tab:()=>r.push(gn()),text:(i)=>r.push(Md(i,n))});else{let{content:i,alias:a}=s;typeof i=="string"?r.push(...sm([i],s.type==="prefix"&&typeof a=="string"?a:s.type)):Array.isArray(i)&&r.push(...sm(i,s.type==="unchanged"?void 0:s.type))}return r}var am={$tokenize(e,n){let r=n||this.defaultLanguage;return r===null?Ab(e.getTextContent()):fI(e,r)},defaultLanguage:wd,tokenize(e,n){let r=this.defaultLanguage;return uo.tokenize(e,uo.languages[n||""]||(r===null?void 0:uo.languages[r]))}};function Iv(e,n,r,s){let i=s.getParent();Jo(i)?zv(e,n,r,i):na(s)&&s.replace(yt(s.__text))}function gI(e,n){let r=n.getElementByKey(e.getKey());if(r===null)return;let s=e.getChildren(),i=s.length;if(i===r.__cachedChildrenLength)return;r.__cachedChildrenLength=i;let a="1",l=1;for(let c=0;c<i;c++)Ue(s[c])&&(a+=`
|
|
37
|
+
`+ ++l);r.setAttribute("data-gutter",a)}function zv(e,n,r,s){let{nodesCurrentlyHighlighting:i}=r,a=s.getKey();s.getLanguage()===void 0&&n.defaultLanguage!==null&&s.setLanguage(n.defaultLanguage);let l=s.getLanguage()||n.defaultLanguage;if(l){if(!Bv(l))return s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1),void Kv();s.getIsSyntaxHighlightSupported()||s.setIsSyntaxHighlightSupported(!0)}else s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1);i.has(a)||(i.add(a),r.didTransform||(r.didTransform=!0,Ky(()=>{r.didTransform=!1,i.clear()})),function(c,d){let f=Mt(c);if(!Jo(f)||!f.isAttached())return;let g=X();if(!j(g))return void d();let p=g.anchor,h=p.offset,x=p.type==="element"&&Ue(f.getChildAtIndex(p.offset-1)),y=0;if(!x){let N=p.getNode();y=h+N.getPreviousSiblings().reduce((E,T)=>E+T.getTextContentSize(),0)}if(!d())return;if(x)return void p.getNode().select(h,h);f.getChildren().some((N)=>{let E=re(N);if(E||Ue(N)){let T=N.getTextContentSize();if(E&&T>=y)return N.select(y,y),!0;y-=T}return!1})}(a,()=>{let c=Mt(a);if(!Jo(c)||!c.isAttached())return!1;let d=c.getLanguage()||n.defaultLanguage,f=n.$tokenize(c,d??void 0),g=function(y,N){let E=0;for(;E<y.length&&Lv(y[E],N[E]);)E++;let T=y.length,b=N.length,v=Math.min(T,b)-E,O=0;for(;O<v;)if(O++,!Lv(y[T-O],N[b-O])){O--;break}let k=E,M=T-O,z=N.slice(E,b-O);return{from:k,nodesForReplacement:z,to:M}}(c.getChildren(),f),{from:p,to:h,nodesForReplacement:x}=g;return!(p===h&&!x.length)&&(s.splice(p,h-p,x),!0)}))}function Lv(e,n){return na(e)&&na(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||Yt(e)&&Yt(n)||Ue(e)&&Ue(n)}function Uv(e,n){let r=[];e._headless!==!0&&r.push(e.registerMutationListener(ss,(i)=>{e.read("latest",()=>{for(let[a,l]of i)if(l!=="destroyed"){let c=Mt(a);c!==null&&gI(c,e)}})},{skipInitialization:!1}));let s={didTransform:!1,nodesCurrentlyHighlighting:new Set};return r.push(e.registerNodeTransform(ss,zv.bind(null,e,n,s)),e.registerNodeTransform(In,Iv.bind(null,e,n,s)),e.registerNodeTransform(jl,Iv.bind(null,e,n,s))),Ae(...r)}function pI(e,n=am){if(!e.hasNodes([ss,jl]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return Ae(Uv(e,n),Mb(e))}var hI=_e({build:(e,n)=>wt(n),config:He({disabled:!1,tokenizer:am}),dependencies:[Dd,$d],name:"@lexical/code-prism",register:(e,n,r)=>{let s=r.getOutput();return Nt(()=>{if(!s.disabled.value)return Uv(e,s.tokenizer.value)})}});var fo=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}=fo;var _m={};je(_m,{$createCodeHighlightNode:()=>Md,$createCodeNode:()=>qs,$getCodeLineDirection:()=>Nb,$getEndOfCodeInLine:()=>Eb,$getFirstCodeNodeOfLine:()=>Tb,$getLastCodeNodeOfLine:()=>bb,$getStartOfCodeInLine:()=>vb,$isCodeHighlightNode:()=>na,$isCodeNode:()=>Jo,$outdentLeadingSpaces:()=>Ob,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>_I,CODE_LANGUAGE_MAP:()=>xI,CodeExtension:()=>Dd,CodeHighlightNode:()=>jl,CodeIndentExtension:()=>$d,CodeNode:()=>ss,DEFAULT_CODE_LANGUAGE:()=>wd,PrismTokenizer:()=>bI,getCodeLanguageOptions:()=>CI,getCodeLanguages:()=>yI,getCodeThemeOptions:()=>SI,getDefaultCodeLanguage:()=>Rb,getLanguageFriendlyName:()=>NI,normalizeCodeLang:()=>EI,normalizeCodeLanguage:()=>TI,registerCodeHighlighting:()=>vI});var _I=cm,xI=um,CI=fm,yI=gm,SI=pm,NI=hm,EI=Bd,TI=Bd,bI=dm,vI=mm;var gt=_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}=gt;var Lm={};je(Lm,{$computeTableCellRectBoundary:()=>Zl,$computeTableMap:()=>an,$computeTableMapSkipCellCheck:()=>go,$createTableCellNode:()=>_n,$createTableNode:()=>oc,$createTableNodeWithDimensions:()=>Qv,$createTableRowNode:()=>yr,$createTableSelection:()=>GI,$createTableSelectionFrom:()=>Gd,$deleteTableColumn:()=>LI,$deleteTableColumnAtSelection:()=>rO,$deleteTableColumn__EXPERIMENTAL:()=>PI,$deleteTableRowAtSelection:()=>oO,$deleteTableRow__EXPERIMENTAL:()=>FI,$findCellNode:()=>ia,$findTableNode:()=>Qs,$getElementForTableNode:()=>hO,$getNodeTriplet:()=>Ht,$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:()=>ec,$isSimpleTable:()=>wm,$isStickyScrollbarActive:()=>Rm,$isTableCellNode:()=>xe,$isTableNode:()=>rt,$isTableRowNode:()=>Ke,$isTableSelection:()=>Ge,$mergeCells:()=>sO,$moveTableColumn:()=>zI,$moveTableRow:()=>UI,$removeTableRowAtIndex:()=>DI,$setTableColumnIsHeader:()=>WI,$setTableRowIsHeader:()=>HI,$unmergeCell:()=>KI,$unmergeCellNode:()=>$m,INSERT_TABLE_COMMAND:()=>Zv,TableCellHeaderStates:()=>ve,TableCellNode:()=>Cr,TableExtension:()=>yO,TableImportExtension:()=>f1,TableImportRules:()=>CO,TableNode:()=>Sr,TableObserver:()=>Im,TableRowNode:()=>da,TableRowSchema:()=>d1,TableSchema:()=>u1,applyTableHandlers:()=>cO,getDOMCellFromTarget:()=>Ql,getTableElement:()=>Zo,getTableObserverFromTableElement:()=>Tm,registerTableCellUnmergeTransform:()=>mO,registerTablePlugin:()=>xO,registerTableSelectionObserver:()=>_O,setScrollableTablesActive:()=>pO});var aa=/^(\d+(?:\.\d+)?)px$/,ve={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Cr extends ct{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config("tablecell",{extends:ct,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=ve.NO_STATUS,n=1,r,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let n=Xe().createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),Sm(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),et(n,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),n}exportDOM(e){let n=super.exportDOM(e);if(ye(n.element)){let r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}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 n=this.getWritable();return n.__colSpan=e,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let n=this.getWritable();return n.__rowSpan=e,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,n=ve.BOTH){let r=this.getWritable();return r.__headerState=e&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let n=this.getWritable();return n.__width=e,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let n=this.getWritable();return n.__backgroundColor=e,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let n=this.getWritable();return n.__verticalAlign=e||void 0,n}toggleHeaderStyle(e){let n=this.getWritable();return(n.__headerState&e)===e?n.__headerState-=e:n.__headerState+=e,n}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==ve.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 n=e,r=e.nodeName.toLowerCase(),s;aa.test(n.style.width)&&(s=parseFloat(n.style.width));let i=ve.NO_STATUS;if(r==="th"){let N=n.getAttribute("scope");if(N==="col")i=ve.COLUMN;else if(N==="row")i=ve.ROW;else{let E=n.parentElement,T=ye(E)&&E.nodeName.toLowerCase()==="tr"&&ye(E.parentElement)&&(E.parentElement.nodeName.toLowerCase()==="thead"||E.rowIndex===0),b=n.cellIndex===0;T&&(i|=ve.ROW),b&&(i|=ve.COLUMN),i===ve.NO_STATUS&&(i=ve.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;Sm(c)&&(a.__verticalAlign=c);let d=n.style,f=(d&&d.textDecoration||"").split(" "),g=d.fontWeight==="700"||d.fontWeight==="bold",p=f.includes("line-through"),h=d.fontStyle==="italic",x=f.includes("underline"),y=d.color;return{after:(N)=>{let E=[],T=null,b=()=>{if(T){let v=T.getFirstChild();Ue(v)&&T.getChildrenSize()===1&&v.remove()}};for(let v of N)if(zg(v)||re(v)||Ue(v)){if(re(v)&&(g&&v.toggleFormat("bold"),p&&v.toggleFormat("strikethrough"),h&&v.toggleFormat("italic"),x&&v.toggleFormat("underline"),y)){let O=v.getStyle();O.includes("color:")||v.setStyle(O+`color: ${y};`)}T?T.append(v):(T=Se().append(v),E.push(T))}else E.push(v),b(),T=null;return b(),E.length===0&&E.push(Se()),E},node:a}}function _n(e=ve.NO_STATUS,n=1,r){return cn(new Cr(e,n,r))}function xe(e){return e instanceof Cr}var Zv=bn("INSERT_TABLE_COMMAND");function pe(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class da extends ct{__height;$config(){return this.config("tablerow",{extends:ct,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,n){super(n),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){let n=Xe().createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),et(n,e.theme.tableRow),n}extractWithChild(e,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){let n=this.getWritable();return n.__height=e,n}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function OI(e){let n=e,r;return aa.test(n.style.height)&&(r=parseFloat(n.style.height)),{after:(s)=>bl(s,xe),node:yr(r)}}function yr(e){return cn(new da(e))}function Ke(e){return e instanceof da}function Qv(e,n,r=!0){let s=oc();for(let i=0;i<e;i++){let a=yr();for(let l=0;l<n;l++){let c=ve.NO_STATUS;typeof r=="object"?(i===0&&r.rows&&(c|=ve.ROW),l===0&&r.columns&&(c|=ve.COLUMN)):r&&(i===0&&(c|=ve.ROW),l===0&&(c|=ve.COLUMN));let d=_n(c),f=Se();f.append(yt()),d.append(f),a.append(d)}s.append(a)}return s}function AI(e){let n=he(e,(r)=>xe(r));return xe(n)?n:null}function Mm(e){let n=he(e,(r)=>Ke(r));if(Ke(n))return n;throw Error("Expected table cell to be inside of table row.")}function Yd(e){let n=he(e,(r)=>rt(r));if(rt(n))return n;throw Error("Expected table cell to be inside of table.")}function RI(e){let n=Mm(e);return Yd(n).getChildren().findIndex((r)=>r.is(n))}function MI(e){return Mm(e).getChildren().findIndex((n)=>n.is(e))}function eO(e,n){let r=Yd(e),{x:s,y:i}=r.getCordsFromCellNode(e,n);return{above:r.getCellNodeFromCords(s,i-1,n),below:r.getCellNodeFromCords(s,i+1,n),left:r.getCellNodeFromCords(s-1,i,n),right:r.getCellNodeFromCords(s+1,i,n)}}function DI(e,n){let r=e.getChildren();if(n>=r.length||n<0)throw Error("Expected table cell to be inside of table row.");return r[n].remove(),e}function $I(e,n,r=!0,s,i){let a=e.getChildren();if(n>=a.length||n<0)throw Error("Table row target index out of range");let l=a[n];if(!Ke(l))throw Error("Row before insertion index does not exist.");for(let c=0;c<s;c++){let d=l.getChildren(),f=d.length,g=yr();for(let p=0;p<f;p++){let h=d[p];xe(h)||pe(12);let{above:x,below:y}=eO(h,i),N=ve.NO_STATUS,E=x&&x.getWidth()||y&&y.getWidth()||void 0;(x&&x.hasHeaderState(ve.COLUMN)||y&&y.hasHeaderState(ve.COLUMN))&&(N|=ve.COLUMN);let T=_n(N,1,E);T.append(Se()),g.append(T)}r?l.insertAfter(g):l.insertBefore(g)}return e}var Nm=(e,n)=>e===ve.BOTH||e===n?n:ve.NO_STATUS;function tO(e=!0){let n=X();j(n)||Ge(n)||pe(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ht(r),[a,,l]=Ht(s),[,c,d]=an(l,a,i),{startRow:f}=d,{startRow:g}=c;return e?Hd(f+i.__rowSpan>g+a.__rowSpan?i:a,!0):Hd(g<f?a:i,!1)}var wI=tO;function Hd(e,n=!0){let[,,r]=Ht(e),[s,i]=an(r,e,e),a=s[0].length,{startRow:l}=i,c=null;if(n){let d=l+e.__rowSpan-1,f=s[d],g=yr();for(let h=0;h<a;h++){let{cell:x,startRow:y}=f[h];if(y+x.__rowSpan-1<=d){let N=f[h].cell.__headerState,E=Nm(N,ve.COLUMN);g.append(_n(E).append(Se()))}else x.setRowSpan(x.__rowSpan+1)}let p=r.getChildAtIndex(d);Ke(p)||pe(256),p.insertAfter(g),c=g}else{let d=l,f=s[d],g=yr();for(let h=0;h<a;h++){let{cell:x,startRow:y}=f[h];if(y===d){let N=f[h].cell.__headerState,E=Nm(N,ve.COLUMN);g.append(_n(E).append(Se()))}else x.setRowSpan(x.__rowSpan+1)}let p=r.getChildAtIndex(d);Ke(p)||pe(257),p.insertBefore(g),c=g}return c}function kI(e,n,r=!0,s,i){let a=e.getChildren(),l=[];for(let c=0;c<a.length;c++){let d=a[c];if(Ke(d))for(let f=0;f<s;f++){let g=d.getChildren();if(n>=g.length||n<0)throw Error("Table column target index out of range");let p=g[n];xe(p)||pe(12);let{left:h,right:x}=eO(p,i),y=ve.NO_STATUS;(h&&h.hasHeaderState(ve.ROW)||x&&x.hasHeaderState(ve.ROW))&&(y|=ve.ROW);let N=_n(y);N.append(Se()),l.push({newTableCell:N,targetCell:p})}}return l.forEach(({newTableCell:c,targetCell:d})=>{r?d.insertAfter(c):d.insertBefore(c)}),e}function nO(e=!0){let n=X();j(n)||Ge(n)||pe(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ht(r),[a,,l]=Ht(s),[,c,d]=an(l,a,i),{startColumn:f}=d,{startColumn:g}=c;return e?Wd(f+i.__colSpan>g+a.__colSpan?i:a,!0):Wd(g<f?a:i,!1)}var II=nO;function Wd(e,n=!0,r=!0){let[,,s]=Ht(e),[i,a]=an(s,e,e),l=i.length,{startColumn:c}=a,d=n?c+e.__colSpan-1:c-1,f=s.getFirstChild();Ke(f)||pe(120);let g=null;function p(y=ve.NO_STATUS){let N=_n(y).append(Se());return g===null&&(g=N),N}let h=f;e:for(let y=0;y<l;y++){if(y!==0){let k=h.getNextSibling();Ke(k)||pe(121),h=k}let N=i[y],E=N[d<0?0:d].cell.__headerState,T=Nm(E,ve.ROW);if(d<0){Dm(h,p(T));continue}let{cell:b,startColumn:v,startRow:O}=N[d];if(v+b.__colSpan-1<=d){let k=b,M=O,z=d;for(;M!==y&&k.__rowSpan>1;){if(z-=b.__colSpan,!(z>=0)){h.append(p(T));continue e}{let{cell:K,startRow:U}=N[z];k=K,M=U}}k.insertAfter(p(T))}else b.setColSpan(b.__colSpan+1)}g!==null&&r&&Jl(g);let x=s.getColWidths();if(x){let y=[...x],N=d<0?0:d,E=y[N];y.splice(N,0,E),s.setColWidths(y)}return g}function LI(e,n){let r=e.getChildren();for(let s=0;s<r.length;s++){let i=r[s];if(Ke(i)){let a=i.getChildren();if(n>=a.length||n<0)throw Error("Table column target index out of range");a[n].remove()}}return e}function oO(){let e=X();j(e)||Ge(e)||pe(188);let[n,r]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[s,,i]=Ht(n),[a]=Ht(r),[l,c,d]=an(i,s,a),{startRow:f}=c,{startRow:g}=d,p=g+a.__rowSpan-1;if(l.length===p-f+1)return void i.remove();let h=l[0].length,x=l[p+1],y=i.getChildAtIndex(p+1);for(let N=p;N>=f;N--){for(let T=h-1;T>=0;T--){let{cell:b,startRow:v,startColumn:O}=l[N][T];if(O===T){if(v<f||v+b.__rowSpan-1>p){let k=Math.max(v,f),M=Math.min(b.__rowSpan+v-1,p),z=k<=M?M-k+1:0;b.setRowSpan(b.__rowSpan-z)}if(v>=f&&v+b.__rowSpan-1>p&&N===p){Ke(y)||pe(387);let k=null;for(let M=0;M<T;M++){let z=x[M],K=z.cell;z.startRow===N+1&&(k=K),K.__colSpan>1&&(M+=K.__colSpan-1)}k===null?Dm(y,b):k.insertAfter(b)}}}let E=i.getChildAtIndex(N);Ke(E)||pe(206,String(N)),E.remove()}if(x!==void 0){let{cell:N}=x[0];Jl(N)}else{let N=l[f-1],{cell:E}=N[0];Jl(E)}}var FI=oO;function rO(){let e=X();j(e)||Ge(e)||pe(188);let n=e.anchor.getNode(),r=e.focus.getNode(),[s,,i]=Ht(n),[a]=Ht(r),[l,c,d]=an(i,s,a),{startColumn:f}=c,{startRow:g,startColumn:p}=d,h=Math.min(f,p),x=Math.max(f+s.__colSpan-1,p+a.__colSpan-1),y=x-h+1;if(l[0].length===x-h+1)return i.selectPrevious(),void i.remove();let N=l.length;for(let v=0;v<N;v++)for(let O=h;O<=x;O++){let{cell:k,startColumn:M}=l[v][O];if(M<h){if(O===h){let z=h-M;k.setColSpan(k.__colSpan-Math.min(y,k.__colSpan-z))}}else if(M+k.__colSpan-1>x){if(O===x){let z=x-M+1;k.setColSpan(k.__colSpan-z)}}else k.remove()}let E=l[g],T=f>p?E[f+s.__colSpan]:E[p+a.__colSpan];if(T!==void 0){let{cell:v}=T;Jl(v)}else{let v=p<f?E[p-1]:E[f-1],{cell:O}=v;Jl(O)}let b=i.getColWidths();if(b){let v=[...b];v.splice(h,y),i.setColWidths(v)}}var PI=rO;function Jl(e){let n=e.getFirstDescendant();n==null?e.selectStart():n.getParentOrThrow().selectStart()}function Dm(e,n){let r=e.getFirstChild();r!==null?r.insertBefore(n):e.append(n)}function sO(e){if(e.length===0)return null;let n=Yd(e[0]),[r]=go(n,null,null),s=1/0,i=-1/0,a=1/0,l=-1/0,c=new Set;for(let x of r)for(let y of x){if(!y||!y.cell)continue;let N=y.cell.getKey();if(!c.has(N)&&e.some((E)=>E.is(y.cell))){c.add(N);let{startRow:E,startColumn:T}=y,b=y.cell.__rowSpan||1,v=y.cell.__colSpan||1;s=Math.min(s,E),i=Math.max(i,E+b-1),a=Math.min(a,T),l=Math.max(l,T+v-1)}}if(s===1/0||a===1/0)return null;let d=i-s+1,f=l-a+1,g=r[s][a];if(!g.cell)return null;let p=g.cell;p.setColSpan(f),p.setRowSpan(d);let h=new Set([p.getKey()]);for(let x=s;x<=i;x++)for(let y=a;y<=l;y++){let N=r[x][y];if(!N.cell)continue;let E=N.cell,T=E.getKey();if(!h.has(T))h.add(T),BI(E)||p.append(...E.getChildren()),E.remove()}return p.getChildrenSize()===0&&p.append(Se()),p}function BI(e){if(e.getChildrenSize()!==1)return!1;let n=e.getFirstChildOrThrow();return!(!$n(n)||!n.isEmpty())}function KI(){let e=X();j(e)||Ge(e)||pe(188);let n=e.anchor.getNode(),r=he(n,xe);return xe(r)||pe(148),$m(r)}function $m(e){let[n,r,s]=Ht(e),{__colSpan:i,__rowSpan:a}=n;if(i===1&&a===1)return;let[l,c]=an(s,n,n),{startColumn:d,startRow:f}=c,g=n.__headerState&ve.COLUMN,p=Array.from({length:i},(y,N)=>{let E=g;for(let T=0;E!==0&&T<l.length;T++)E&=l[T][N+d].cell.__headerState;return E}),h=n.__headerState&ve.ROW,x=Array.from({length:a},(y,N)=>{let E=h;for(let T=0;E!==0&&T<l[0].length;T++)E&=l[N+f][T].cell.__headerState;return E});if(i>1){for(let y=1;y<i;y++)n.insertAfter(_n(p[y]|x[0]).append(Se()));n.setColSpan(1)}if(a>1){let y;for(let N=1;N<a;N++){let E=f+N,T=l[E];y=(y||r).getNextSibling(),Ke(y)||pe(125);let b=null;for(let v=0;v<d;v++){let O=T[v],k=O.cell;O.startRow===E&&(b=k),k.__colSpan>1&&(v+=k.__colSpan-1)}if(b===null)for(let v=i-1;v>=0;v--)Dm(y,_n(p[v]|x[N]).append(Se()));else for(let v=i-1;v>=0;v--)b.insertAfter(_n(p[v]|x[N]).append(Se()))}n.setRowSpan(1)}}function an(e,n,r){let[s,i,a]=go(e,n,r);return i===null&&pe(207),a===null&&pe(208),[s,i,a]}function go(e,n,r){let s=[],i=null,a=null;function l(d){let f=s[d];return f===void 0&&(s[d]=f=[]),f}let c=e.getChildren();for(let d=0;d<c.length;d++){let f=c[d];Ke(f)||pe(209);let g=l(d);for(let p=f.getFirstChild(),h=0;p!=null;p=p.getNextSibling()){for(xe(p)||pe(147);g[h]!==void 0;)h++;let x={cell:p,startColumn:h,startRow:d},{__rowSpan:y,__colSpan:N}=p;for(let E=0;E<y&&!(d+E>=c.length);E++){let T=l(d+E);for(let b=0;b<N;b++)T[h+b]=x}n!==null&&i===null&&n.is(p)&&(i=x),r!==null&&a===null&&r.is(p)&&(a=x)}}return[s,i,a]}function Ht(e){let n;if(e instanceof Cr)n=e;else if("__type"in e){let i=he(e,xe);xe(i)||pe(148),n=i}else{let i=he(e.getNode(),xe);xe(i)||pe(148),n=i}let r=n.getParent();Ke(r)||pe(149);let s=r.getParent();return rt(s)||pe(210),[n,r,s]}function Zl(e,n,r){let s,i=Math.min(n.startColumn,r.startColumn),a=Math.min(n.startRow,r.startRow),l=Math.max(n.startColumn+n.cell.__colSpan-1,r.startColumn+r.cell.__colSpan-1),c=Math.max(n.startRow+n.cell.__rowSpan-1,r.startRow+r.cell.__rowSpan-1);do{s=!1;for(let d=0;d<e.length;d++)for(let f=0;f<e[0].length;f++){let g=e[d][f];if(!g)continue;let p=g.startColumn+g.cell.__colSpan-1,h=g.startRow+g.cell.__rowSpan-1,x=g.startColumn<=l&&p>=i,y=g.startRow<=c&&h>=a;if(x&&y){let N=Math.min(i,g.startColumn),E=Math.max(l,p),T=Math.min(a,g.startRow),b=Math.max(c,h);N===i&&E===l&&T===a&&b===c||(i=N,l=E,a=T,c=b,s=!0)}}}while(s);return{maxColumn:l,maxRow:c,minColumn:i,minRow:a}}function wm(e){let n=e.getChildren(),r=null;for(let s of n){if(!Ke(s))return!1;if(r===null&&(r=s.getChildrenSize()),s.getChildrenSize()!==r)return!1;let i=s.getChildren();for(let a of i)if(!xe(a)||a.getRowSpan()!==1||a.getColSpan()!==1)return!1}return(r||0)>0}function zI(e,n,r){if(n===r)return;let s=e.getColumnCount();if(n<0||n>=s||r<0||r>=s)return;if(!wm(e))return;e.getChildren().filter(Ke).forEach((a)=>{let l=a.getChildren(),[c]=l.splice(n,1);l.splice(r,0,c),a.splice(0,l.length,l)});let i=e.getColWidths();if(i&&i.length===s){let a=[...i],[l]=a.splice(n,1);a.splice(r,0,l),e.setColWidths(a)}}function UI(e,n,r){if(n===r)return;let s=e.getChildren().filter(Ke),i=s.length;if(n<0||n>=i||r<0||r>=i)return;if(!wm(e))return;let a=s[n],l=s[r];r>n?l.insertAfter(a):l.insertBefore(a)}function Em(e){let[n,,r]=Ht(e),s=r.getChildren().filter(Ke),i=s.length,a=s[0].getChildren().length,l=Array(i);for(let c=0;c<i;c++)l[c]=Array(a);for(let c=0;c<i;c++){let d=s[c].getChildren().filter(xe),f=0;for(let g=0;g<d.length;g++){for(;l[c][f];)f++;let p=d[g],h=p.__rowSpan||1,x=p.__colSpan||1;for(let y=0;y<h;y++)for(let N=0;N<x;N++)l[c+y][f+N]=p;if(n===p)return{colSpan:x,columnIndex:f,rowIndex:c,rowSpan:h};f+=x}}return null}function iO(e,n){let r=n.getStartEndPoints(),s=Ge(n);if(r===null)return!1;let[i,a]=r,[l,c,d]=Ht(i),f=he(a.getNode(),(W)=>xe(W));if(!(xe(l)&&xe(f)&&Ke(c)&&rt(d)))return!1;let[g,p,h]=an(d,l,f),[x]=go(e,null,null),y=g.length,N=y>0?g[0].length:0,{startRow:E,startColumn:T}=p,b=x.length,v=b>0?x[0].length:0;if(s){let W=Zl(g,p,h),ne=W.maxRow-W.minRow+1,ee=W.maxColumn-W.minColumn+1;E=W.minRow,T=W.minColumn,b=Math.min(b,ne),v=Math.min(v,ee)}let O=!1,k=Math.min(y,E+b)-1,M=Math.min(N,T+v)-1,z=new Set;for(let W=E;W<=k;W++)for(let ne=T;ne<=M;ne++){let ee=g[W][ne];z.has(ee.cell.getKey())||(ee.cell.__rowSpan===1&&ee.cell.__colSpan===1||($m(ee.cell),z.add(ee.cell.getKey()),O=!0))}let[K]=go(d.getWritable(),null,null),U=b-y+E;for(let W=0;W<U;W++)Hd(K[y-1][0].cell);let J=v-N+T;for(let W=0;W<J;W++)Wd(K[0][N-1].cell,!0,!1);[K]=go(d.getWritable(),null,null);for(let W=E;W<E+b;W++)for(let ne=T;ne<T+v;ne++){let ee=W-E,se=ne-T,V=x[ee][se];if(V.startRow!==ee||V.startColumn!==se)continue;let fe=V.cell;if(fe.__rowSpan!==1||fe.__colSpan!==1){let ae=[],ce=Math.min(W+fe.__rowSpan,E+b)-1,De=Math.min(ne+fe.__colSpan,T+v)-1;for(let we=W;we<=ce;we++)for(let ht=ne;ht<=De;ht++){let Qt=K[we][ht];ae.push(Qt.cell)}sO(ae),O=!0}let{cell:Ce}=K[W][ne],Oe=fe.getBackgroundColor();Oe!=null&&Ce.setBackgroundColor(Oe);let oe=Ce.getChildren();fe.getChildren().forEach((ae)=>{if(re(ae))Se().append(ae),Ce.append(ae);else Ce.append(ae)}),oe.forEach((ae)=>ae.remove())}if(s&&O){let[W]=go(d.getWritable(),null,null);W[p.startRow][p.startColumn].cell.selectEnd()}return!0}function HI(e,n,r){let[s]=go(e,null,null);n>=0&&n<s.length||pe(396,String(n));let i=s[n],a=r?ve.ROW:ve.NO_STATUS,l=new Set;for(let c=0;c<i.length;c++){let d=i[c];d!=null&&(l.has(d.cell)||(l.add(d.cell),d.cell.setHeaderStyles(a,ve.ROW)))}}function WI(e,n,r){let[s]=go(e,null,null);s.length>0&&n>=0&&n<s[0].length||pe(397,String(n));let i=r?ve.COLUMN:ve.NO_STATUS,a=new Set;for(let l=0;l<s.length;l++){let c=s[l][n];c!=null&&(a.has(c.cell)||(a.add(c.cell),c.cell.setHeaderStyles(i,ve.COLUMN)))}}function xm(e){let[[n,r,s,i],[a,l,c,d]]=["anchor","focus"].map((f)=>{let g=e[f].getNode(),p=he(g,xe);xe(p)||pe(238,f,g.getKey(),g.getType());let h=p.getParent();Ke(h)||pe(239,f);let x=h.getParent();return rt(x)||pe(240,f),[g,p,h,x]});return i.is(d)||pe(241),{anchorCell:r,anchorNode:n,anchorRow:s,anchorTable:i,focusCell:l,focusNode:a,focusRow:c,focusTable:d}}class tc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;let e=Mt(this.tableKey),n=Mt(this.anchor.key),r=Mt(this.focus.key);return e!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return Ge(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,n,r){this.dirty=this.dirty||e!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new tc(this.tableKey,qn(this.anchor.key,this.anchor.offset,this.anchor.type),qn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e==="")return;let n=(e.endsWith(`
|
|
38
38
|
`)?e.slice(0,-1):e).split(`
|
|
39
|
-
`).map((i)=>i.split("\t")),r=oc();for(let i of n){let a=yr();for(let l of i){let c=_n(
|
|
40
|
-
`:"\t")}return n}}function je(e){return e instanceof tc}function GI(){let e=qn("root",0,"element"),n=qn("root",0,"element");return new tc("root",e,n)}function Gd(e,n,r){e.getKey(),n.getKey(),r.getKey();let s=X(),i=je(s)?s.clone():new tc("root",qn("root",0,"element"),qn("root",0,"element"));return i.set(e.getKey(),n.getKey(),r.getKey()),i}function jI(e,n){let r=[[e]];for(let s=r.at(-1);s!==void 0&&r.length>0;s=r.at(-1)){let i=s.pop();i===void 0?r.pop():n(i)!==!1&&Q(i)&&r.push(i.getChildren())}}function Im(e,n=Ge()){let r=Mt(e);rt(r)||pe(231,e);let s=Zo(r,n.getElementByKey(e));return s===null&&pe(232,e),{tableElement:s,tableNode:r}}class lO{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 n=this.observers.get(e);return n!==void 0&&(n[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[n,[r]]of Array.from(this.observers.entries())){let s=Mt(n);rt(s)?e.push([s,r]):this.removeObserver(n)}return e}}class Lm{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(e,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,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 Im(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver((n)=>{this.editor.read("latest",()=>{let r=!1;for(let a=0;a<n.length;a++){let l=n[a].target.nodeName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TR"){r=!0;break}}if(!r)return;let{tableNode:s,tableElement:i}=this.$lookup();this.table=ca(s,i)})});this.editor.read("latest",()=>{let{tableNode:n,tableElement:r}=this.$lookup();this.table=ca(n,r),e.observe(r,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let n=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:r,tableElement:s}=this.$lookup();Kd(n,ca(r,s),null),e&&X()!==null&&(mt(null),n.dispatchCommand(oo))}$enableHighlightStyle(){let e=this.editor,{tableElement:n}=this.$lookup();sn(n,e._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();et(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&pe(233,e.tableKey,this.tableNodeKey);let n=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Kd(n,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=Ln(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,n=!1){let r=this.editor,{tableNode:s}=this.$lookup(),{x:i,y:a}=e;if(this.focusCell=e,!this.isHighlightingCells)(n||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let l=Om(s,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let c=l;if(c===null&&n&&(c=s.getCellNodeFromCords(i,a,this.table)),c!==null){let d=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=c.getKey(),this.tableSelection=Gd(s,d,c),mt(this.tableSelection),r.dispatchCommand(oo),Kd(r,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?Mt(this.anchorCellNodeKey):null;return xe(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&pe(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?Mt(this.focusCellNodeKey):null;return xe(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&pe(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:n}=this.$lookup(),r=Om(n,e.elem);if(r!==null){let s=r.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(n.getKey(),s,s)):this.tableSelection=Gd(n,r,r),this.anchorCellNodeKey=s}}$formatCells(e){let n=X();je(n)||pe(236);let r=Kr(),{anchor:s,focus:i}=r,a=n.getNodes().filter(xe);a.length>0||pe(237);let l=a[0].getFirstChild(),c=$n(l)?l.getFormatFlags(e,null):null;a.forEach((d)=>{s.set(d.getKey(),0,"element"),i.set(d.getKey(),d.getChildrenSize(),"element"),r.formatText(e,c)}),mt(n),this.editor.dispatchCommand(oo)}$clearText(){let{editor:e}=this,n=Mt(this.tableNodeKey);if(!rt(n))throw Error("Expected TableNode.");let r=X();je(r)||pe(253);let s=r.getNodes().filter(xe),i=n.getFirstChild(),a=n.getLastChild();if(s.length>0&&i!==null&&a!==null&&ze(i)&&ze(a)&&s[0]===i.getFirstChild()&&s[s.length-1]===a.getLastChild()){n.selectPrevious();let l=n.getParent();return n.remove(),void(yo(l)&&l.isEmpty()&&e.dispatchCommand(jr))}s.forEach((l)=>{if(Q(l)){let c=Se(),d=yt();c.append(d),l.append(c),l.getChildren().forEach((f)=>{f!==c&&f.remove()})}}),Kd(e,this.table,null),mt(null),e.dispatchCommand(oo)}}var la="__lexicalTableSelection";function cO(e){let n=Ly(e);return rt(n)||pe(386,e),n}var ra=40;function ym(e,n,r){let s=(i)=>Math.max(1,Math.ceil(Math.min(ra,i)/ra*18));return e<=n+ra?-s(n+ra-e):e>=r-ra?s(e-(r-ra)):0}function as(e){return ye(e)&&e.nodeName==="TABLE"}function Zo(e,n){if(!n)return n;let r=as(n)?n:n.querySelector("table");return as(r)||pe(341,e.constructor.name,e.getType(),e.getKey(),n.nodeName),r}function Vd(e){return e._window}function Xd(e,n){for(let r=n,s=null;r!==null;r=r.getParent()){if(e.is(r))return s;xe(r)&&(s=r)}return null}var YI=[[Go,"down"],[no,"up"],[Yr,"backward"],[vi,"forward"]],VI=[au,iu,Ei],XI=[Oi,hu];function qI(e,n){return e.registerRootListener((r)=>{if(r===null)return;let s=e._window;if(s===null)return;return so(s,"pointerdown",(i)=>{let a=Nl(i);if(i.button!==0||!ro(a)||!r.contains(a))return;let l=function(c){let d=Ql(c);if(d===null)return null;let f=d.elem;for(;f!=null;){if(f.nodeName==="TABLE"&&la in f&&f[la])return{cellElement:d,tableElement:f,tableObserver:f[la]};f=f.parentNode}return null}(a);e.update(()=>{if(je(X())){for(let[g]of n.observers.values())g.$clearHighlight(!1);mt(null),e.dispatchCommand(oo)}if(!l)return;let{tableObserver:c,tableElement:d,cellElement:f}=l;(function(g,p,h,x,C,y){let N=g._window;if(!N)return;let T=(O)=>{if(C.isSelecting)return;C.isSelecting=!0,O!==null&&C.anchorCell===null&&g.update(()=>{C.$setAnchorCellForSelection(O)});let{clientX:k,clientY:M}=p,z=null,K=()=>{C.isSelecting=!1,z!==null&&(N.cancelAnimationFrame(z),z=null),N.removeEventListener("pointerup",Ce),N.removeEventListener("pointermove",Ae)},U=(oe,ae)=>{let ue=x.getRootNode();if(!qr(ue)&&!Au(ue))return null;for(let we of ue.elementsFromPoint(oe,ae)){let Ie=Vv(x,we);if(Ie)return Ie}return null},J=(oe,ae)=>{C.anchorCell===null&&g.update(()=>{C.$setAnchorCellForSelection(oe)}),C.focusCell!==null&&oe.elem===C.focusCell.elem||(y.setNextFocus({focusCell:oe,override:ae,tableKey:C.tableNodeKey}),g.dispatchCommand(oo))},W=(oe)=>{for(let ae=x.parentElement;ae;ae=ae.parentElement)if(oe==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ue=N.getComputedStyle(ae),we=oe==="x"?ue.overflowX:ue.overflowY;if(we==="auto"||we==="scroll")return ae}return null},ne=(oe,ae,ue)=>{let we,Ie;if(oe===null)we=0,Ie=ue==="x"?N.innerWidth:N.innerHeight;else{let Ke=oe.getBoundingClientRect();we=ue==="x"?Ke.left:Ke.top,Ie=ue==="x"?Ke.right:Ke.bottom}let ht=ym(ae,we,Ie);if(ht===0)return!1;if(oe===null){let Ke=ue==="x"?N.scrollX:N.scrollY;return N.scrollBy(ue==="x"?ht:0,ue==="x"?0:ht),(ue==="x"?N.scrollX:N.scrollY)!==Ke}if(ue==="x"){let Ke=oe.scrollLeft;return oe.scrollLeft+=ht,oe.scrollLeft!==Ke}let Qt=oe.scrollTop;return oe.scrollTop+=ht,oe.scrollTop!==Qt},ee=(oe,ae)=>{let ue=k,we=M;if(oe===null)ue=Math.min(Math.max(ue,1),N.innerWidth-1);else{let Ie=oe.getBoundingClientRect();ue=Math.min(Math.max(ue,Ie.left+1),Ie.right-1)}if(ae===null)we=Math.min(Math.max(we,1),N.innerHeight-1);else{let Ie=ae.getBoundingClientRect();we=Math.min(Math.max(we,Ie.top+1),Ie.bottom-1)}return[ue,we]},se=()=>{let oe=W("x");if(oe!==null){let Ie=oe.getBoundingClientRect();if(ym(k,Ie.left,Ie.right)!==0)return!0}let ae=W("y"),ue=ae===null?0:ae.getBoundingClientRect().top,we=ae===null?N.innerHeight:ae.getBoundingClientRect().bottom;return ym(M,ue,we)!==0},Y=()=>{if(z=null,!C.isSelecting)return;let oe=W("x"),ae=W("y"),ue=oe!==null&&ne(oe,k,"x"),we=ne(ae,M,"y");if(ue||we){let[Ie,ht]=ee(oe,ae),Qt=U(Ie,ht);Qt&&J(Qt,!1),z=N.requestAnimationFrame(Y)}},fe=()=>{z===null&&C.pointerType!=="touch"&&se()&&(z=N.requestAnimationFrame(Y))},Ce=()=>{K()},Ae=(oe)=>{if(!((Ie)=>!(1&~Ie.buttons))(oe)&&C.isSelecting)return void K();let ae=Nl(oe);if(!ro(ae))return;k=oe.clientX,M=oe.clientY;let ue=null,we=!($s||x.contains(ae));ue=we?Vv(x,ae):U(oe.clientX,oe.clientY),ue&&J(ue,we),fe()};N.addEventListener("pointerup",Ce,C.listenerOptions),N.addEventListener("pointermove",Ae,C.listenerOptions)};C.pointerType=p.pointerType;let b=cO(C.tableNodeKey),v=En();if($s&&p.shiftKey&&Ao(v,b)&&(G(v)||je(v))){let O=v.anchor.getNode(),k=Xd(b,v.anchor.getNode());if(k)C.$setAnchorCellForSelection(Zs(C,k)),C.$setFocusCellForSelection(h),xr(p);else(b.isBefore(O)?b.selectStart():b.selectEnd()).anchor.set(v.anchor.key,v.anchor.offset,v.anchor.type)}else p.pointerType!=="touch"&&C.$setAnchorCellForSelection(h);T(h)})(e,i,f,d,c,n)})})})}function uO(e,n,r,s,i){let a=r.getRootElement(),l=Vd(r);a!==null&&l!==null||pe(246);let c=new Lm(r,e.getKey()),d=Zo(e,n);(function(h,x){bm(h)!==null&&pe(205),h[la]=x})(d,c),c.listenersToRemove.add(()=>function(h,x){bm(h)===x&&delete h[la]}(d,c)),c.listenersToRemove.add(so(d,"mousedown",(h)=>{let x=Nl(h);if(h.detail>=3&&ro(x))Ql(x)!==null&&h.preventDefault()},c.listenerOptions));for(let[h,x]of YI)c.listenersToRemove.add(r.registerCommand(h,(C)=>gO(r,C,x,e,c,i),kn));c.listenersToRemove.add(r.registerCommand(Ri,(h)=>{let x=X();if(je(x)){let C=Xd(e,x.focus.getNode());if(C!==null)return xr(h),C.selectEnd(),!0}return!1},kn));let f=()=>{let h=X();return!!Ao(h,e)&&(!!je(h)&&(c.$clearText(),!0))};for(let h of VI)c.listenersToRemove.add(r.registerCommand(h,f,kn));let g=(h)=>{let x=X();if(!je(x)&&!G(x))return!1;let C=e.isParentOf(x.anchor.getNode());if(C!==e.isParentOf(x.focus.getNode())){let y=C?"anchor":"focus",N=C?"focus":"anchor",{key:T,offset:b,type:v}=x[N];return e[x[y].isBefore(x[N])?"selectPrevious":"selectNext"]()[N].set(T,b,v),!1}return!!Ao(x,e)&&(!!je(x)&&(h&&(h.preventDefault(),h.stopPropagation()),c.$clearText(),!0))};for(let h of XI)c.listenersToRemove.add(r.registerCommand(h,g,kn));c.listenersToRemove.add(r.registerCommand(ru,(h)=>{let x=X();if(x){if(!je(x)&&!G(x))return!1;kl(r,Fn(h,ClipboardEvent)?h:null,ad(x));let C=g(h);return G(x)?(x.removeText(),!0):C}return!1},kn));let p=a.ownerDocument;return c.listenersToRemove.add(so(p,"paste",(h)=>{if(h.defaultPrevented)return;r.read("latest",()=>{let x=X();return a.contains(p.activeElement)&&je(x)&&Ao(x,e)})&&(h.preventDefault(),r.dispatchCommand(Di,h))})),c.listenersToRemove.add(so(p,"copy",(h)=>{if(h.defaultPrevented)return;let x=Nl(h);if(x===a||ro(x)&&a.contains(x))return;r.read("latest",()=>{let C=X();return a.contains(No(a))&&je(C)&&Ao(C,e)})&&(h.preventDefault(),r.dispatchCommand(Ni,h))})),c.listenersToRemove.add(r.registerCommand(Wo,(h)=>{let x=X();return!!Ao(x,e)&&(!!je(x)&&(c.$formatCells(h),!0))},kn)),c.listenersToRemove.add(r.registerCommand(cu,(h)=>{let x=X();if(!je(x)||!Ao(x,e))return!1;let C=x.anchor.getNode(),y=x.focus.getNode();if(!xe(C)||!xe(y))return!1;let[N,T,b]=an(e,C,y),v=Math.max(T.startRow+T.cell.__rowSpan-1,b.startRow+b.cell.__rowSpan-1),O=Math.max(T.startColumn+T.cell.__colSpan-1,b.startColumn+b.cell.__colSpan-1),k=Math.min(T.startRow,b.startRow),M=Math.min(T.startColumn,b.startColumn);if(k===0&&M===0&&v===N.length-1&&O===N[0].length-1)return e.setFormat(h),!0;let z=new Set;for(let K=k;K<=v;K++)for(let U=M;U<=O;U++){let J=N[K][U].cell;if(z.has(J))continue;z.add(J),J.setFormat(h);let W=J.getChildren();for(let ne=0;ne<W.length;ne++){let ee=W[ne];Q(ee)&&!ee.isInline()&&ee.setFormat(h)}}return!0},kn)),c.listenersToRemove.add(r.registerCommand(ou,(h)=>{let x=X();if(!Ao(x,e))return!1;if(je(x))return c.$clearHighlight(),!1;if(G(x)){let C=he(x.anchor.getNode(),(y)=>xe(y));if(!xe(C))return!1;if(typeof h=="string"){let y=qv(r,x,e);if(y)return Xv(y,e,[yt(h)]),!0}}return!1},kn)),s&&c.listenersToRemove.add(r.registerCommand(Vr,(h)=>{let x=X();if(!G(x)||!x.isCollapsed()||!Ao(x,e))return!1;let C=ia(x.anchor.getNode());return!(C===null||!e.is(Qs(C)))&&(xr(h),function(y,N){let T=N==="next"?"getNextSibling":"getPreviousSibling",b=N==="next"?"getFirstChild":"getLastChild",v=y[T]();if(Q(v))return v.selectEnd();let O=he(y,ze);O===null&&pe(247);for(let M=O[T]();ze(M);M=M[T]()){let z=M[b]();if(Q(z))return z.selectEnd()}let k=he(O,rt);k===null&&pe(248),N==="next"?k.selectNext():k.selectPrevious()}(C,h.shiftKey?"previous":"next"),!0)},kn)),c.listenersToRemove.add(r.registerCommand(eS,(h)=>e.isSelected(),kn)),c.listenersToRemove.add(r.registerCommand(jr,()=>{let h=X();if(!G(h)||!h.isCollapsed()||!Ao(h,e))return!1;let x=qv(r,h,e);return!!x&&(Xv(x,e),!0)},kn)),c}function JI(e,n){let r=X(),s=En(),i=e.getAndClearNextFocus();if(i!==null){let{tableKey:l,focusCell:c}=i,d=e.observers.get(l);d||pe(335,l);let[f]=d;if(je(r)&&r.tableKey===f.tableNodeKey)return(c.x!==f.focusX||c.y!==f.focusY)&&(f.$setFocusCellForSelection(c),!0);if(f.anchorCell!==null&&f.anchorCellNodeKey!==null&&c.elem!==f.anchorCell.elem&&f.tableSelection!==null)return f.$setFocusCellForSelection(c,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&G(s)&&G(r)&&r.isCollapsed()){let l=Mt(a);if(rt(l)){let c=r.anchor.getNode(),d=l.getFirstChild(),f=ia(c);if(f!==null&&ze(d)){let g=d.getFirstChild();if(xe(g)&&l.is(he(f,(p)=>p.is(l)||p.is(g))))return g.selectStart(),!0}}}je(r)&&function(l,c){let d=Vd(l),f=En();if(!c.is(f))return;let g=cO(c.tableKey),p=Ln(d),h=p&&ws(p,l.getRootElement());if(p&&h&&h.anchorNode&&h.focusNode){let x=vt(h.focusNode),C=x&&!g.isParentOf(x),y=vt(h.anchorNode),N=y&&g.isParentOf(y);if(C&&N&&p.rangeCount>0){let T=My(p,l);T&&(T.anchor.set(g.getKey(),c.isBackward()?g.getChildrenSize():0,"element"),p.removeAllRanges(),mt(T))}}}(n,r),G(r)&&function(l,c){let d=En(),{anchor:f,focus:g}=l,p=f.getNode(),h=g.getNode(),x=ia(p),C=ia(h),y=x?Qs(x):null,N=C?Qs(C):null,T=l.isBackward(),b=x&&C&&y&&N&&y.is(N),v=N&&(!y||y.isParentOf(N)),O=y&&(!N||N.isParentOf(y));if(v){let k=l.clone(),[M]=an(N,C,C),z=M[0][0].cell,K=M[M.length-1].at(-1).cell;k.focus.set(T?z.getKey():K.getKey(),T?0:K.getChildrenSize(),"element"),mt(k)}else if(O){let k=l.clone(),[M]=an(y,x,x),z=M[0][0].cell,K=M[M.length-1].at(-1).cell;k.anchor.set(T?K.getKey():z.getKey(),T?K.getChildrenSize():0,"element"),mt(k)}else if(b){let k=c.observers.get(y.getKey());k||pe(335,y.getKey());let[M]=k;if(x.is(C)||(M.$setAnchorCellForSelection(Zs(M,x)),M.$setFocusCellForSelection(Zs(M,C),!0)),M.pointerType==="touch"&&M.isSelecting&&l.isCollapsed()&&G(d)&&d.isCollapsed()){let z=ia(d.anchor.getNode());z&&!z.is(C)&&(M.$setAnchorCellForSelection(Zs(M,z)),M.$setFocusCellForSelection(Zs(M,C),!0),M.pointerType=null)}}}(r,e);for(let[l,c]of e.$getTableNodesAndObservers())ZI(n,l,c);return!1}function ZI(e,n,r){let s=X(),i=En();s&&!s.is(i)&&(je(s)||je(i))&&r.tableSelection&&!r.tableSelection.is(i)&&(je(s)&&s.tableKey===r.tableNodeKey?r.$updateTableTableSelection(s):!je(s)&&je(i)&&i.tableKey===r.tableNodeKey&&r.$updateTableTableSelection(null)),r.hasHijackedSelectionStyles&&!n.isSelected()?function(a,l){l.$enableHighlightStyle(),vm(l.table,(c)=>{let d=c.elem;c.highlighted=!1,fO(a,c),d.getAttribute("style")||d.removeAttribute("style")})}(e,r):!r.hasHijackedSelectionStyles&&n.isSelected()&&function(a,l){l.$disableHighlightStyle(),vm(l.table,(c)=>{c.highlighted=!0,dO(a,c)})}(e,r)}function bm(e){return e[la]||null}function Ql(e){let n=e;for(;n!=null;){let r=n.nodeName;if(r==="TD"||r==="TH"){let s=n._cell;return s===void 0?null:s}n=n.parentNode}return null}function Vv(e,n){if(!e.contains(n))return null;let r=null;for(let s=n;s!=null;s=s.parentNode){if(s===e)return r;let i=s.nodeName;i!=="TD"&&i!=="TH"||(r=s._cell||null)}return null}function ca(e,n){let r=[],s={columns:0,domRows:r,rows:0},i=Zo(e,n).querySelector("tr"),a=0,l=0;for(r.length=0;i!=null;){let c=i.nodeName;if(c==="TD"||c==="TH"){let g={elem:i,hasBackgroundColor:i.style.backgroundColor!=="",highlighted:!1,x:a,y:l};i._cell=g;let p=r[l];p===void 0&&(p=r[l]=[]),p[a]=g}else{let g=i.firstChild;if(g!=null){i=g;continue}}let d=i.nextSibling;if(d!=null){a++,i=d;continue}let f=i.parentNode;if(f!=null){let g=f.nextSibling;if(g==null)break;l++,a=0,i=g}}return s.columns=a+1,s.rows=l+1,s}function Kd(e,n,r){let s=new Set(r?r.getNodes():[]);vm(n,(i,a)=>{let l=i.elem;s.has(a)?(i.highlighted=!0,dO(e,i)):(i.highlighted=!1,fO(e,i),l.getAttribute("style")||l.removeAttribute("style"))})}function vm(e,n){let{domRows:r}=e;for(let s=0;s<r.length;s++){let i=r[s];if(i)for(let a=0;a<i.length;a++){let l=i[a];if(!l)continue;let c=vt(l.elem);c!==null&&n(l,c,{x:a,y:s})}}}var QI=(e,n,r,s,i)=>{let a=i==="forward";switch(i){case"backward":case"forward":return r!==(a?e.table.columns-1:0)?Ud(n.getCellNodeFromCordsOrThrow(r+(a?1:-1),s,e.table),a):s!==(a?e.table.rows-1:0)?Ud(n.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,s+(a?1:-1),e.table),a):a?n.selectNext():n.selectPrevious(),!0;case"up":return s!==0?Ud(n.getCellNodeFromCordsOrThrow(r,s-1,e.table),!1):n.selectPrevious(),!0;case"down":return s!==e.table.rows-1?Ud(n.getCellNodeFromCordsOrThrow(r,s+1,e.table),!0):n.selectNext(),!0;default:return!1}};function Sm(e,n){let r,s;if(n.startColumn===e.minColumn)r="minColumn";else{if(n.startColumn+n.cell.__colSpan-1!==e.maxColumn)return null;r="maxColumn"}if(n.startRow===e.minRow)s="minRow";else{if(n.startRow+n.cell.__rowSpan-1!==e.maxRow)return null;s="maxRow"}return[r,s]}function zd([e,n]){return[e==="minColumn"?"maxColumn":"minColumn",n==="minRow"?"maxRow":"minRow"]}function sa(e,n,[r,s]){let i=n[s],a=e[i];a===void 0&&pe(250,s,String(i));let l=n[r],c=a[l];return c===void 0&&pe(250,r,String(l)),c}function e1(e,n,r,s,i){let a=Zl(n,r,s),l=function(M,z){let{minColumn:K,maxColumn:U,minRow:J,maxRow:W}=z,ne=1,ee=1,se=1,Y=1,fe=M[J],Ce=M[W];for(let Ae=K;Ae<=U;Ae++)ne=Math.max(ne,fe[Ae].cell.__rowSpan),Y=Math.max(Y,Ce[Ae].cell.__rowSpan);for(let Ae=J;Ae<=W;Ae++)ee=Math.max(ee,M[Ae][K].cell.__colSpan),se=Math.max(se,M[Ae][U].cell.__colSpan);return{bottomSpan:Y,leftSpan:ee,rightSpan:se,topSpan:ne}}(n,a),{topSpan:c,leftSpan:d,bottomSpan:f,rightSpan:g}=l,p=function(M,z){let K=Sm(M,z);return K===null&&pe(249,z.cell.getKey()),K}(a,r),[h,x]=zd(p),C=a[h],y=a[x];i==="forward"?C+=h==="maxColumn"?1:d:i==="backward"?C-=h==="minColumn"?1:g:i==="down"?y+=x==="maxRow"?1:c:i==="up"&&(y-=x==="minRow"?1:f);let N=n[y];if(N===void 0)return!1;let T=N[C];if(T===void 0)return!1;let[b,v]=function(M,z,K){let U=Zl(M,z,K),J=Sm(U,z);if(J)return[sa(M,U,J),sa(M,U,zd(J))];let W=Sm(U,K);if(W)return[sa(M,U,zd(W)),sa(M,U,W)];let ne=["minColumn","minRow"];return[sa(M,U,ne),sa(M,U,zd(ne))]}(n,r,T),O=Zs(e,b.cell),k=Zs(e,v.cell);return e.$setAnchorCellForSelection(O),e.$setFocusCellForSelection(k,!0),!0}function Ao(e,n){if(G(e)||je(e)){let r=n.isParentOf(e.anchor.getNode()),s=n.isParentOf(e.focus.getNode());return r&&s}return!1}function Ud(e,n){n?e.selectStart():e.selectEnd()}function dO(e,n){let r=n.elem,s=e._config.theme;xe(vt(r))||pe(131),et(r,s.tableCellSelected)}function fO(e,n){let r=n.elem;xe(vt(r))||pe(131);let s=e._config.theme;sn(r,s.tableCellSelected)}function ia(e){let n=he(e,xe);return xe(n)?n:null}function Qs(e){let n=he(e,rt);return rt(n)?n:null}function t1(e,n,r,s,i,a,l){let c=dn(r.focus,i?"previous":"next");if(cl(c))return!1;let d=c;for(let N of bs(c).iterNodeCarets("shadowRoot")){if(!So(N)||!Q(N.origin))return!1;d=N}let f=d.getParentAtCaret();if(!xe(f))return!1;let g=f,p=function(N){for(let T of bs(N).iterNodeCarets("root")){let{origin:b}=T;if(xe(b)){if(Ko(T))return bt(b,N.direction)}else if(!ze(b))break}return null}(it(g,d.direction)),h=he(g,rt);if(!h||!h.is(a))return!1;let x=e.getElementByKey(g.getKey()),C=Ql(x);if(!x||!C)return!1;let y=mO(e,h);if(l.table=y,p)if(s==="extend"){let N=Ql(e.getElementByKey(p.origin.getKey()));if(!N)return!1;l.$setAnchorCellForSelection(C),l.$setFocusCellForSelection(N,!0)}else{let N=It(p);Ho(r.anchor,N),Ho(r.focus,N)}else if(s==="extend")l.$setAnchorCellForSelection(C),l.$setFocusCellForSelection(C,!0);else{let N=function(T){let b=al(T);return Ko(b)?It(b):T}(it(h,c.direction));Ho(r.anchor,N),Ho(r.focus,N)}return xr(n),!0}function gO(e,n,r,s,i,a){if((r==="up"||r==="down")&&function(c){let d=c.getRootElement();if(!d)return!1;return d.hasAttribute("aria-controls")&&d.getAttribute("aria-controls")==="typeahead-menu"}(e))return!1;let l=X();if(!Ao(l,s)){if(G(l)){if(r==="backward"){if(l.focus.offset>0)return!1;let c=function(f){for(let g=f,p=f;p!==null;g=p,p=p.getParent())if(Q(p)){if(p!==g&&p.getFirstChild()!==g)return null;if(!p.isInline())return p}return null}(l.focus.getNode());if(!c)return!1;let d=c.getPreviousSibling();return!!rt(d)&&(xr(n),n.shiftKey?l.focus.set(d.getParentOrThrow().getKey(),d.getIndexWithinParent(),"element"):d.selectEnd(),!0)}if(n.shiftKey&&(r==="up"||r==="down")){let c=l.focus.getNode();if(!l.isCollapsed()&&(r==="up"&&!l.isBackward()||r==="down"&&l.isBackward())){let d=he(c,(x)=>rt(x));if(xe(d)&&(d=he(d,rt)),d!==s)return!1;if(!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(!f)return!1;let g=0;r==="up"&&Q(f)&&(g=f.getChildrenSize());let p=f;if(r==="up"&&Q(f))p=f.getLastChild()||f,g=re(p)?p.getTextContentSize():0;let h=l.clone();return h.focus.set(p.getKey(),g,re(p)?"text":"element"),mt(h),xr(n),!0}if(Dt(c)){let d=r==="up"?l.getNodes()[l.getNodes().length-1]:l.getNodes()[0];if(d){if(Xd(s,d)!==null){let f=s.getFirstDescendant(),g=s.getLastDescendant();if(!f||!g)return!1;let[p]=Ht(f),[h]=Ht(g),x=s.getCordsFromCellNode(p,i.table),C=s.getCordsFromCellNode(h,i.table),y=s.getDOMCellFromCordsOrThrow(x.x,x.y,i.table),N=s.getDOMCellFromCordsOrThrow(C.x,C.y,i.table);return i.$setAnchorCellForSelection(y),i.$setFocusCellForSelection(N,!0),!0}}return!1}{let d=he(c,(g)=>Q(g)&&!g.isInline());if(xe(d)&&(d=he(d,rt)),!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(rt(f)&&i.tableNodeKey===f.getKey()){let g=f.getFirstDescendant(),p=f.getLastDescendant();if(!g||!p)return!1;let[h]=Ht(g),[x]=Ht(p),C=l.clone();return C.focus.set((r==="up"?h:x).getKey(),r==="up"?0:x.getChildrenSize(),"element"),xr(n),mt(C),!0}}}}return r==="down"&&ec(e)&&a.setShouldCheckSelectionForTable(s.getKey()),!1}if(G(l)){if(r==="backward"||r==="forward")return t1(e,n,l,n.shiftKey?"extend":"move",r==="backward",s,i);if(l.isCollapsed()){let{anchor:c,focus:d}=l,f=he(c.getNode(),xe),g=he(d.getNode(),xe);if(!xe(f)||!f.is(g))return!1;let p=Qs(f);if(p!==s&&p!=null){let b=Zo(p,e.getElementByKey(p.getKey()));if(b!=null)return i.table=ca(p,b),gO(e,n,r,p,i,a)}let h=e.getElementByKey(f.__key),x=e.getElementByKey(c.key);if(x==null||h==null)return!1;let C;if(c.type==="element")C=x.getBoundingClientRect();else{let b=Ln(Vd(e));if(b===null||b.rangeCount===0)return!1;let v=mS(b,e.getRootElement());if(v===null)return!1;C=v.getBoundingClientRect()}let y=r==="up"?f.getFirstChild():f.getLastChild();if(y==null)return!1;let N=e.getElementByKey(y.__key);if(N==null)return!1;let T=N.getBoundingClientRect();if(r==="up"?T.top>C.top-C.height:C.bottom+C.height>T.bottom){xr(n);let b=s.getCordsFromCellNode(f,i.table);if(!n.shiftKey)return QI(i,s,b.x,b.y,r);{let v=s.getDOMCellFromCordsOrThrow(b.x,b.y,i.table);i.$setAnchorCellForSelection(v),i.$setFocusCellForSelection(v,!0)}return!0}}}else if(je(l)){let{anchor:c,focus:d,tableKey:f}=l;if(f!==s.getKey())return!1;let g=he(c.getNode(),xe),p=he(d.getNode(),xe),[h]=l.getNodes();rt(h)||pe(251);let x=Zo(h,e.getElementByKey(h.getKey()));if(!xe(g)||!xe(p)||!rt(h)||x==null)return!1;i.$updateTableTableSelection(l);let C=ca(h,x),y=s.getCordsFromCellNode(g,C),N=s.getDOMCellFromCordsOrThrow(y.x,y.y,C);if(i.$setAnchorCellForSelection(N),xr(n),n.shiftKey){let[T,b,v]=an(s,g,p);return e1(i,T,b,v,r)}return p.selectEnd(),!0}return!1}function xr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Xv(e,n,r){let s=Se();e==="first"?n.insertBefore(s):n.insertAfter(s),s.append(...r||[]),s.selectEnd()}function qv(e,n,r){let s=r.getParent();if(!s)return;let i=Ln(Vd(e));if(!i)return;let a=ws(i,e.getRootElement()).anchorNode,l=e.getElementByKey(s.getKey()),c=Zo(r,e.getElementByKey(r.getKey()));if(!a||!l||!c||!l.contains(a)||c.contains(a))return;let d=he(n.anchor.getNode(),(b)=>xe(b));if(!d)return;let f=he(d,(b)=>rt(b));if(!rt(f)||!f.is(r))return;let[g,p]=an(r,d,d),h=g[0][0],x=g[g.length-1][g[0].length-1],{startRow:C,startColumn:y}=p,N=C===h.startRow&&y===h.startColumn,T=C===x.startRow&&y===x.startColumn;return N?"first":T?"last":void 0}function Zs(e,n){let{tableNode:r}=e.$lookup(),s=r.getCordsFromCellNode(n,e.table);return r.getDOMCellFromCordsOrThrow(s.x,s.y,e.table)}function Om(e,n,r){return Xd(e,vt(n,r))}function jd(e){return ye(e)&&e.nodeName==="DIV"}function Jv(e,n,r){let s=e.querySelector(":scope > colgroup");if(!r)return void(s&&s.remove());s||(s=Xe().createElement("colgroup"),Mu(s),e.insertBefore(s,e.firstChild));let i=[];for(let a=0;a<n;a++){let l=Xe().createElement("col"),c=r[a];c&&(l.style.width=`${c}px`),i.push(l)}s.replaceChildren(...i)}function Zv(e,n,r){if(!n.theme.tableAlignment)return;let s=[],i=[];for(let a of["center","right"]){let l=n.theme.tableAlignment[a];l&&(a===r?i:s).push(l)}sn(e,...s),et(e,...i)}var pO=new WeakSet;function n1(e){let{scrollable:n,scrollbar:r,tableElement:s}=e;if(r.classList.length===0&&function(c){let d=c.style.display;c.style.display="";let f=c.offsetHeight-c.clientHeight;return c.style.display=d,f}(r)===0)return pO.add(r),r.style.display="none",n.style.scrollbarWidth="auto",()=>{};let i=()=>{r.scrollLeft!==n.scrollLeft&&(r.scrollLeft=n.scrollLeft)},a=()=>{n.scrollLeft!==r.scrollLeft&&(n.scrollLeft=r.scrollLeft)};n.addEventListener("scroll",i,{passive:!0}),r.addEventListener("scroll",a,{passive:!0});let l=null;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(()=>{Am(n,r)}),l.observe(n),l.observe(s)),Am(n,r),()=>{n.removeEventListener("scroll",i),r.removeEventListener("scroll",a),l&&l.disconnect()}}function Am(e,n){if(pO.has(n))return;let r=n.firstElementChild;if(!r||!ye(r)||!e.isConnected)return;let s=e.ownerDocument.defaultView;if(!s)return void(n.style.display="none");let i=s.getComputedStyle(e).overflowX,a=i==="auto"||i==="scroll",{scrollWidth:l,clientWidth:c}=e,d=l+"px";r.style.width!==d&&(r.style.width=d);let f=a&&l>c;n.style.display=f?"":"none"}function o1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let n=e.firstElementChild;if(!jd(n))return null;let r=n.querySelector(":scope > table");if(!as(r))return null;let s=n.nextElementSibling;return jd(s)?{scrollable:n,scrollbar:s,tableElement:r}:null}var Rm=new WeakSet;function ec(e=Ge()){return Rm.has(e)}function Mm(e=Ge()){let n=io(e,"@lexical/table/Table");return!!n&&(n.output.hasStickyScrollbar.peek()&&n.output.hasHorizontalScroll.peek())}function hO(e,n){n?Rm.add(e):Rm.delete(e)}class Sr extends ct{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:ct,importDOM:{table:()=>({conversion:r1,priority:1})}})}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let n=this.getWritable();return n.__colWidths=e,n}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,n,r){return r==="html"}getDOMSlot(e){let n=as(e)?e:e.querySelector("table");return as(n)||pe(229),super.getDOMSlot(e).withElement(n).withAfter(n.querySelector(":scope > colgroup"))}createDOM(e,n){let r=Xe().createElement("table");if(this.__style&&fr(r.style,this.__style),this.getColWidths()){let s=Xe().createElement("colgroup");r.appendChild(s),Mu(s)}if(et(r,e.theme.table),this.updateTableElement(null,r,e),ec(n)){let s=Mm(n),i=function(a,l,c){let d=Xe().createElement("div"),f=l.theme.tableScrollableWrapper;return f?et(d,f):d.style.overflowX="auto",c&&(d.style.scrollbarWidth="none"),d.appendChild(a),d}(r,e,s);if(this.updateTableWrapper(null,i,r,e),s){let a=function(c){let d=Xe(),f=d.createElement("div"),g=c.theme.tableStickyScrollbar;g?et(f,g):(f.style.position="sticky",f.style.bottom="0",f.style.overflowX="scroll",f.style.overflowY="hidden"),f.style.display="none",f.setAttribute("aria-hidden","true"),f.tabIndex=-1;let p=d.createElement("div");return p.style.height="1px",p.style.width="0px",f.appendChild(p),f}(e),l=Xe().createElement("div");return l.setAttribute("data-lexical-sticky-scrollbar","true"),l.appendChild(i),l.appendChild(a),Mu(a),l}return i}return r}updateTableWrapper(e,n,r,s){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenColumn),a.setAttribute("data-lexical-frozen-column","true")):(sn(i,l.theme.tableFrozenColumn),a.removeAttribute("data-lexical-frozen-column"))}(n,r,s,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenRow),a.setAttribute("data-lexical-frozen-row","true")):(sn(i,l.theme.tableFrozenRow),a.removeAttribute("data-lexical-frozen-row"))}(n,r,s,this.__frozenRowCount)}updateTableElement(e,n,r){this.__style!==(e?e.__style:"")&&fr(n.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(a,l,c){c?(et(a,l.theme.tableRowStriping),a.setAttribute("data-lexical-row-striping","true")):(sn(a,l.theme.tableRowStriping),a.removeAttribute("data-lexical-row-striping"))}(n,r,this.__rowStriping);let s=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===s&&this.getColWidths()===i||Jv(n,this.getColumnCount(),this.getColWidths()),Zv(n,r,this.getFormatType())}updateDOM(e,n,r){let s=Zo(this,n);if(n===s===ec())return!0;if(jd(n)){if(n.hasAttribute("data-lexical-sticky-scrollbar")!==Mm())return!0;let i=s.parentElement;jd(i)&&this.updateTableWrapper(e,i,s,r)}return this.updateTableElement(e,s,r),!1}scaleDOMColWidths(e,n){let r=this.getColWidths();if(!r)return;Jv(Zo(this,e),this.getColumnCount(),r.map((s)=>s*n))}exportDOM(e){let n=super.exportDOM(e),{element:r}=n;return{after:(s)=>{if(n.after&&(s=n.after(s)),!as(s)&&ye(s)&&(s=s.querySelector("table")),!as(s))return null;Zv(s,e._config,this.getFormatType());let[i]=go(this,null,null),a=new Map;for(let f of i)for(let g of f){let p=g.cell.getKey();a.has(p)||a.set(p,{colSpan:g.cell.getColSpan(),startColumn:g.startColumn})}let l=new Set;for(let f of s.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let g=f.getAttribute("data-temporary-table-cell-lexical-key");if(g){let p=a.get(g);if(f.removeAttribute("data-temporary-table-cell-lexical-key"),p){a.delete(g);for(let h=0;h<p.colSpan;h++)l.add(h+p.startColumn)}}}let c=s.querySelector(":scope > colgroup");if(c){let f=Array.from(s.querySelectorAll(":scope > colgroup > col")).filter((g,p)=>l.has(p));c.replaceChildren(...f)}let d=s.querySelectorAll(":scope > tr");if(d.length>0){let f=Xe().createElement("tbody");for(let g of d)f.appendChild(g);s.append(f)}return s},element:!as(r)&&ye(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,n){let{rows:r,domRows:s}=n;for(let i=0;i<r;i++){let a=s[i];if(a!=null)for(let l=0;l<a.length;l++){let c=a[l];if(c==null)continue;let{elem:d}=c,f=Om(this,d);if(f!==null&&e.is(f))return{x:l,y:i}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,n,r){let{domRows:s}=r,i=s[n];if(i==null)return null;let a=i[e<i.length?e:i.length-1];return a==null?null:a}getDOMCellFromCordsOrThrow(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(!s)throw Error("Cell not found at cords.");return s}getCellNodeFromCords(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(s==null)return null;let i=vt(s.elem);return xe(i)?i:null}getCellNodeFromCordsOrThrow(e,n,r){let s=this.getCellNodeFromCords(e,n,r);if(!s)throw Error("Node at cords not TableCellNode.");return s}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let n=this.getWritable();return n.__rowStriping=e,n}setFrozenColumns(e){let n=this.getWritable();return n.__frozenColumnCount=e,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let n=this.getWritable();return n.__frozenRowCount=e,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!ze(e))return 0;let n=0;return e.getChildren().forEach((r)=>{xe(r)&&(n+=r.getColSpan())}),n}}function mO(e,n){let r=e.getElementByKey(n.getKey());return r===null&&pe(230),ca(n,r)}function r1(e){let n=oc();e.hasAttribute("data-lexical-row-striping")&&n.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&n.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&n.setFrozenRows(1);let r=e.querySelector(":scope > colgroup");if(r){let s=[];for(let i of r.querySelectorAll(":scope > col")){let a=i.style.width||"";if(!aa.test(a)&&(a=i.getAttribute("width")||"",!/^\d+$/.test(a))){s=void 0;break}s.push(parseFloat(a))}s&&n.setColWidths(s)}return{after:(s)=>bl(s,ze),node:n}}function oc(){return cn(new Sr)}function rt(e){return e instanceof Sr}function s1(e){ze(e.getParent())?e.isEmpty()&&e.append(Se()):e.remove()}function i1(e){rt(e.getParent())?Cp(e,xe):e.remove()}function a1(e){Cp(e,ze);let[n]=go(e,null,null),r=n.reduce((l,c)=>Math.max(l,c.length),0),s=e.getChildren();for(let l=0;l<n.length;++l){let c=s[l];if(!c)continue;ze(c)||pe(254,c.constructor.name,c.getType());let d=n[l].reduce((f,g)=>g?1+f:f,0);if(d!==r)for(let f=d;f<r;++f){let g=_n();g.append(Se()),c.append(g)}}let i=e.getColWidths(),a=e.getColumnCount();if(i&&i.length!==a){let l;if(a<i.length)l=i.slice(0,a);else if(i.length>0){let c=i[i.length-1];l=[...i,...Array(a-i.length).fill(c)]}e.setColWidths(l)}}function l1(e){if(e.detail<3||!ro(e.target))return!1;let n=vt(e.target);if(n===null)return!1;let r=he(n,(s)=>Q(s)&&!s.isInline());if(r===null)return!1;return!!xe(r.getParent())&&(r.select(0),!0)}function c1(){let e=X();if(!G(e))return!1;let n=Qs(e.anchor.getNode());if(n===null)return!1;let r=Je();if(!r.is(n.getParent())||r.getChildrenSize()!==1)return!1;let[s]=go(n,null,null);if(s.length===0||s[0].length===0)return!1;let i=s[0][0];if(!i||!i.cell)return!1;let a=s[s.length-1],l=a[a.length-1];if(!l||!l.cell)return!1;let c=Gd(n,i.cell,l.cell);return mt(c),!0}function _O(e){return e.registerNodeTransform(Cr,(n)=>{if(n.getColSpan()>1||n.getRowSpan()>1){let[,,r]=Ht(n),[s]=an(r,n,n),i=s.length,a=s[0].length,l=r.getFirstChild();ze(l)||pe(175);let c=[];for(let d=0;d<i;d++){d!==0&&(l=l.getNextSibling(),ze(l)||pe(175));let f=null;for(let g=0;g<a;g++){let p=s[d][g],h=p.cell;if(p.startRow===d&&p.startColumn===g)f=h,c.push(h);else if(h.getColSpan()>1||h.getRowSpan()>1){xe(h)||pe(176);let x=_n(h.__headerState);f!==null?f.insertAfter(x):iN(l,x)}}}for(let d of c)d.setColSpan(1),d.setRowSpan(1)}})}function xO(e,n=!0){let r=new lO,s=(i,a,l)=>{let c=Zo(i,l),d=uO(i,c,e,n,r);r.observers.set(a,[d,c])};return Me(qI(e,r),e.registerCommand(oo,()=>JI(r,e),kn),e.registerMutationListener(Sr,(i)=>{e.read("latest",()=>{for(let[a,l]of i){let c=r.observers.get(a);if(l==="created"||l==="updated"){let{tableNode:d,tableElement:f}=Im(a);c===void 0?s(d,a,f):f!==c[1]&&(r.removeObserver(a),s(d,a,f))}else l==="destroyed"&&r.removeObserver(a)}})},{skipInitialization:!1}),()=>{r.removeAllObservers()})}function CO(e,n){e.hasNodes([Sr])||pe(255);let{hasNestedTables:r=zs(!1)}=n??{};return Me(e.registerCommand(Qv,(s)=>function({rows:i,columns:a,includeHeaders:l},c){let d=X()||En();if(!d||!G(d))return!1;if(!c&&Qs(d.anchor.getNode()))return!1;let f=eO(Number(i),Number(a),l);Lu(f);let g=f.getFirstDescendant();return re(g)&&g.select(),!0}(s,r.peek()),be),e.registerCommand(yu,(s,i)=>e===i&&function(a,l){let{nodes:c,selection:d}=a;if(!c.some((p)=>rt(p)||sN(p).some((h)=>rt(h.node)))){if(je(d)){let p="",h=!1;for(let x of c){let C=Q(x)&&!x.isInline();p.length>0&&(C||h)&&(p+=`
|
|
41
|
-
`),p+=x.getTextContent(),h=C}return d.insertRawText(p),!0}return!1}let f=je(d),g=G(d);if(!(g&&he(d.anchor.getNode(),(p)=>xe(p))!==null&&he(d.focus.getNode(),(p)=>xe(p))!==null||f))return!1;if(c.length===1&&rt(c[0]))return aO(c[0],d);if(g&&l.peek()&&!function(p){if(je(p)&&!p.focus.getNode().is(p.anchor.getNode()))return!0;if(G(p)&&xe(p.anchor.getNode())&&!p.anchor.getNode().is(p.focus.getNode()))return!0;return!1}(d))return!1;return!0}(s,r),be),e.registerCommand($i,c1,Be),e.registerCommand(yi,l1,be),e.registerNodeTransform(Sr,a1),e.registerNodeTransform(da,i1),e.registerNodeTransform(Cr,s1))}var u1={$accepts:ze,$packageRun:(e)=>e.every(xe)?[yr().splice(0,0,e)]:[],name:"TableSchema"},d1={$accepts:xe,name:"TableRowSchema"},yO=[dt({$import:(e,n)=>{let r=oc();n.hasAttribute("data-lexical-row-striping")&&r.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&r.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&r.setFrozenRows(1);let s=n.querySelector(":scope > colgroup");if(s){let i=[];for(let a of s.querySelectorAll(":scope > col")){let l=a.style.width||"";if(!aa.test(l)&&(l=a.getAttribute("width")||"",!/^\d+$/.test(l))){i=void 0;break}i.push(parseFloat(l))}i&&r.setColWidths(i)}return[r.splice(0,0,bl(e.$importChildren(n),ze))]},match:ft.tag("table"),name:"@lexical/table/table"}),dt({$import:(e,n)=>[yr(aa.test(n.style.height)?parseFloat(n.style.height):void 0).splice(0,0,bl(e.$importChildren(n),xe))],match:ft.tag("tr"),name:"@lexical/table/tr"}),dt({$import:(e,n)=>{let r=n.nodeName==="TH",s=aa.test(n.style.width)?parseFloat(n.style.width):void 0,i=Oe.NO_STATUS;if(r){let N=n.getAttribute("scope");if(N==="col")i=Oe.COLUMN;else if(N==="row")i=Oe.ROW;else{let T=n.parentElement,b=ES(T)&&(T.parentElement&&T.parentElement.nodeName==="THEAD"||T.rowIndex===0),v=n.cellIndex===0;b&&(i|=Oe.ROW),v&&(i|=Oe.COLUMN),i===Oe.NO_STATUS&&(i=Oe.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;(function(N){return N==="middle"||N==="bottom"})(c)&&(a.__verticalAlign=c);let d=e.get(rh),f=d|function(N){let T=0,b=N.fontWeight;b!=="700"&&b!=="bold"||(T|=ml),N.fontStyle==="italic"&&(T|=xl);let v=(N.textDecoration||"").split(" ");return v.includes("underline")&&(T|=yl),v.includes("line-through")&&(T|=Cl),T}(n.style),g=e.get(sh),p=n.style.color,h=p?{...g,color:p}:g,x=[];f!==d&&x.push(Gi(rh,f)),h!==g&&x.push(Gi(sh,h));let C=function(N){let T=[],b=null,v=()=>{if(b!==null){let O=b.getFirstChild();He(O)&&b.getChildrenSize()===1&&O.remove()}};for(let O of N)zg(O)||re(O)||He(O)?b!==null?b.append(O):(b=Se().append(O),T.push(b)):(v(),b=null,T.push(O));return v(),T.length===0&&T.push(Se()),T}(e.$importChildren(n,{context:x})),y=r?C:od(C,n);return[a.splice(0,0,y)]},match:ft.tag("td","th"),name:"@lexical/table/cell"})],SO=_e({build:(e,n,r)=>wt(n),config:We({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[lo,nn(Xo,{rules:yO})],name:"@lexical/table/Table",nodes:()=>[Sr,da,Cr],register(e,n,r){let s=r.getOutput(),i=!1;return Me(Nt(()=>{let a=s.hasHorizontalScroll.value,l=s.hasStickyScrollbar.value&&a,c=ec(e);c!==a&&hO(e,a),c===a&&i===l||e.update(xi),i=l}),CO(e,s),Nt(()=>xO(e,s.hasTabHandler.value)),Nt(()=>{if(s.hasStickyScrollbar.value&&s.hasHorizontalScroll.value)return e.registerRootListener((a)=>{if(a)return function(l){let c=new Map;return Me(()=>{for(let{cleanup:d}of c.values())d();c.clear()},l.registerMutationListener(Sr,(d)=>{for(let[f,g]of d){let p=c.get(f);if(g==="destroyed"){p&&(p.cleanup(),c.delete(f));continue}let h=l.getElementByKey(f),x=h&&ye(h)?o1(h):null;p&&x&&p.parts.scrollable===x.scrollable&&p.parts.scrollbar===x.scrollbar&&p.parts.tableElement===x.tableElement?Am(x.scrollable,x.scrollbar):(p&&(p.cleanup(),c.delete(f)),x&&c.set(f,{cleanup:n1(x),parts:x}))}},{skipInitialization:!1}))}(e)})}),Nt(()=>s.hasCellMerge.value?void 0:_O(e)),Nt(()=>s.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(Cr,(a)=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})))}}),f1=_e({dependencies:[SO],name:"@lexical/table/Import"});var le=Fm,{$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:NO,TableExtension:O2,TableImportExtension:A2,TableImportRules:R2,TableNode:EO,TableObserver:M2,TableRowNode:TO,TableRowSchema:D2,TableSchema:$2,applyTableHandlers:w2,getDOMCellFromTarget:k2,getTableElement:I2,getTableObserverFromTableElement:L2,registerTableCellUnmergeTransform:F2,registerTablePlugin:P2,registerTableSelectionObserver:B2,setScrollableTablesActive:K2}=le;S();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:n,focus:r}=e,s=e.anchor.getNode(),i=e.focus.getNode();if(s===i)return s;if(e.isBackward())return ap(r)?s:i;else return ap(n)?i:s}function bO({rightContent:e}={}){let[n]=st(),[r,s]=u(!1),[i,a]=u(!1),[l,c]=u("paragraph"),[d,f]=u(!1),[g,p]=u(!1),[h,x]=u(!1),[C,y]=u(!1),[N,T]=u(!1),[b,v]=u(!1),O=P(()=>{let Y=X();if(G(Y)){f(Y.hasFormat("bold")),p(Y.hasFormat("italic")),x(Y.hasFormat("underline")),y(Y.hasFormat("strikethrough")),T(Y.hasFormat("code"));let fe=p1(Y),Ce=fe.getParent();v(Qi(Ce)||Qi(fe));let Ae=Y.anchor.getNode(),oe=Ae.getKey()==="root"?Ae:Ae.getTopLevelElementOrThrow(),ae=oe.getKey();if(n.getElementByKey(ae)!==null)if(vo(oe)){let we=Iu(Ae,qo),Ie=we?we.getListType():oe.getListType();c(Ie)}else if(Pl(oe))c(oe.getTag());else{let we=oe.getType();if(we in g1)c(we);else c("paragraph")}}},[n]);m(()=>n.registerCommand(oo,()=>(O(),!1),Si),[n,O]),m(()=>n.registerUpdateListener(({editorState:Y})=>{Y.read(()=>{O()})}),[n,O]),m(()=>{let Y=n.registerCommand(Ms,(Ce)=>(s(Ce),!1),Be),fe=n.registerCommand(Rs,(Ce)=>(a(Ce),!1),Be);return()=>{Y(),fe()}},[n]);let k=()=>{n.update(()=>{let Y=X();if(G(Y))Pi(Y,()=>Se())})},M=(Y)=>{n.update(()=>{let fe=X();if(G(fe))Pi(fe,()=>gd(Y))})},z=()=>{if(l!=="bullet")n.dispatchCommand(b0,void 0);else n.dispatchCommand(Ed,void 0)},K=()=>{if(l!=="number")n.dispatchCommand(T0,void 0);else n.dispatchCommand(Ed,void 0)},U=()=>{if(l!=="check")n.dispatchCommand(E0,void 0);else n.dispatchCommand(Ed,void 0)},J=()=>{if(l!=="quote")n.update(()=>{let Y=X();if(G(Y))Pi(Y,()=>pd())});else k()},W=()=>{if(l!=="code")n.update(()=>{let Y=X();if(G(Y))Pi(Y,()=>Gv())});else k()},ne=P(()=>{if(!b){let Y=prompt("Enter link URL (e.g., https://example.com):");if(Y)n.dispatchCommand(Lh,Y)}else n.dispatchCommand(Lh,null)},[n,b]),ee=P(()=>{n.update(()=>{let Y=X();if(G(Y))Y.setFormat(0),Pi(Y,()=>Se())})},[n]);return o("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[o("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[t("button",{type:"button",disabled:!r,onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Eu,void 0),title:"Undo","aria-label":"Undo",children:t(qm,{className:"h-4 w-4"})}),t("button",{type:"button",disabled:!i,onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(xu,void 0),title:"Redo","aria-label":"Redo",children:t(jm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),o("select",{value:l,onChange:(Y)=>{let fe=Y.target.value;switch(fe){case"paragraph":k();break;case"h1":case"h2":case"h3":M(fe);break;case"bullet":z();break;case"number":K();break;case"check":U();break;case"quote":J();break;case"code":W();break}},"aria-label":"Block formatting",children:[t("option",{value:"paragraph",children:"Normal"}),t("option",{value:"h1",children:"Heading 1"}),t("option",{value:"h2",children:"Heading 2"}),t("option",{value:"h3",children:"Heading 3"}),t("option",{value:"bullet",children:"Bullet List"}),t("option",{value:"number",children:"Numbered List"}),t("option",{value:"check",children:"Check List"}),t("option",{value:"quote",children:"Quote"}),t("option",{value:"code",children:"Code Block"})]}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:d?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:t(Pm,{className:"h-4 w-4"})}),t("button",{type:"button",className:g?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:t(Um,{className:"h-4 w-4"})}),t("button",{type:"button",className:h?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:t(Xm,{className:"h-4 w-4"})}),t("button",{type:"button",className:C?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:t(Vm,{className:"h-4 w-4"})}),t("button",{type:"button",className:N?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"code"),title:"Inline Code","aria-label":"Inline Code",children:t(nc,{className:"h-4 w-4"})}),t("button",{type:"button",className:b?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:ne,title:"Insert Link","aria-label":"Link",children:t(Ja,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:l==="h1"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>M("h1"),title:"H1","aria-label":"Heading 1",children:t(Bm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h2"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>M("h2"),title:"H2","aria-label":"Heading 2",children:t(Km,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h3"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>M("h3"),title:"H3","aria-label":"Heading 3",children:t(zm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="bullet"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:z,title:"Bullet List","aria-label":"Bullet List",children:t(Lo,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="number"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:K,title:"Numbered List","aria-label":"Numbered List",children:t(Hm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="check"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:U,title:"Check List","aria-label":"Check List",children:t(Ga,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="quote"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:J,title:"Quote","aria-label":"Quote",children:t(Gm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",onMouseDown:(Y)=>Y.preventDefault(),onClick:ee,title:"Clear Formatting","aria-label":"Clear Formatting",children:t(Ym,{className:"h-4 w-4"})})]}),e&&t("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})]})}var vO={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 rc=[Ev,...Tv,...bv,...vv,...Ov];function h1({value:e,initialContent:n="",onChange:r}){let[s]=st(),i=_(!1),a=_("");return m(()=>{if(!i.current){i.current=!0;let l=e!==void 0?e:n;if(l)s.update(()=>{em(l,rc)}),a.current=l}},[s,n,e]),m(()=>{if(i.current&&e!==void 0&&e!==a.current)s.update(()=>{em(e,rc)}),a.current=e},[s,e]),t(wv,{ignoreSelectionChange:!0,onChange:(l)=>{l.read(()=>{let c=Nv(rc);if(c!==a.current)a.current=c,r?.(c)})}})}function OO({initialContent:e="",value:n,onChange:r,placeholder:s="Write your markdown content here...",readOnly:i=!1,autoFocus:a=!1,className:l="",hideToolbar:c=!1,rightToolbarContent:d}){let f={namespace:"ShumaiWysiwygMarkdownEditor",theme:vO,editable:!i,onError:(g)=>{console.error("[MarkdownEditor] Error:",g)},nodes:[md,_d,qo,ns,jv,EO,NO,TO,Z0,ea]};return t("div",{className:`shumai-editor-wrapper ${i?"read-only":""} ${l}`,children:o(AS,{initialConfig:f,children:[!i&&!c?t(bO,{rightContent:d}):d?t("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:d}):null,o(ce,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[t("div",{className:"relative min-h-full",children:t(FT,{contentEditable:t(UT,{className:"editor-input"}),placeholder:t("div",{className:"editor-placeholder",children:s}),ErrorBoundary:Iv})}),t(VT,{}),t(A0,{}),t(R0,{}),t(D0,{}),t(eb,{}),t($v,{transformers:rc}),t(h1,{value:n,initialContent:e,onChange:r}),a&&t(tb,{})]})]})})}function AO({projectId:e,assetId:n,rootFolderId:r,isRoot:s}){let i=Re(),a=V(),{canAdmin:l}=Ot(e),{data:c,isLoading:d}=Z({queryKey:["folders",n,"agentsmd"],queryFn:async()=>{let ee=await A.api.folders[":folderId"].agentsmd.$get({param:{folderId:n}});if(!ee.ok)throw Error("Failed to fetch agents.md");return await ee.json()}}),[f,g]=u(""),[p,h]=u(!1),[x,C]=u("idle"),y=_(null),N=_(null),T=_(""),b=_(null),v=_(Promise.resolve());m(()=>{if(!p&&c!==void 0){let ee=c.content??"";g(ee),T.current=ee,b.current=ee,h(!0)}},[c,p]);let[O,k]=u(!1),M=B({mutationFn:async(ee)=>{let se=await A.api.folders[":folderId"].agentsmd.$patch({param:{folderId:n},json:{content:ee}});if(!se.ok)throw Error("Failed to save agents.md");return await se.json()},onSuccess:(ee,se)=>{if(C("saved"),b.current=se,a.setQueryData(["folders",n,"agentsmd"],{content:se}),a.invalidateQueries({queryKey:["folders",n]}),N.current)clearTimeout(N.current);N.current=setTimeout(()=>{C("idle")},2500)},onError:()=>{C("error")}}),z=_(M.mutateAsync);z.current=M.mutateAsync;let K=P((ee)=>{if(!l)return Promise.resolve();if(b.current===ee)return C("saved"),Promise.resolve();C("saving");let se=v.current.then(async()=>{await z.current(ee)}).catch(()=>{});return v.current=se,se},[l]),U=P((ee)=>{if(!l)return;if(g(ee),T.current=ee,y.current)clearTimeout(y.current);C("saving"),y.current=setTimeout(()=>{y.current=null,K(ee)},1000)},[l,K]),J=P(()=>{if(y.current)return clearTimeout(y.current),y.current=null,K(T.current);return v.current},[K]);m(()=>()=>{if(J(),N.current)clearTimeout(N.current)},[J]);let W=async()=>{k(!0);try{J(),await v.current}catch{}finally{if(s||n===r)i({to:"/projects/$projectId",params:{projectId:e}});else i({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:n}})}},ne=o("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[l?o("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(x==="saving"||O)&&o("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[t(ua,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Np()})]}),x==="saved"&&!O&&o("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[t(Pe,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Jg()})]}),x==="error"&&!O&&o("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[t(nr,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:G0()})]})]}):o("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:Wm(),children:[t(on,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Wm()})]}),o("div",{className:"flex items-center gap-2 shrink-0",children:[l&&t(ao,{orientation:"vertical",className:"h-4 shrink-0"}),o(E,{variant:"ghost",size:"sm",onClick:W,disabled:O,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Da(),children:[t(Ne,{className:"h-4 w-4 mr-1 shrink-0"}),t("span",{children:Da()})]})]})]});if(d||!p)return o("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[t(ua,{className:"h-4 w-4 animate-pulse mr-2"}),t("span",{children:H0()})]});return t("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:t(OO,{value:f,onChange:U,placeholder:$0(),readOnly:!l,rightToolbarContent:ne,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function $a({teamId:e,projectId:n,projectName:r,assetId:s,rootFolderId:i,isRoot:a}){let l=Re(),[c,d]=u(240),[f,g]=u(360),{fileListLeftSidebarCollapsed:p,setFileListLeftSidebarCollapsed:h}=$t(),{isChatbotOpen:x,setIsChatbotOpen:C}=ur(),y=_r((v)=>Boolean(v.metadata["appearance.hideAgent"])),{data:N}=Z({queryKey:["folders",s],queryFn:async()=>{let v=await A.api.folders[":folderId"].$get({param:{folderId:s}});if(!v.ok)throw Error("failed to fetch folder");return await v.json()},enabled:!!s}),{setProjectState:T,clearProjectState:b}=un();return m(()=>{let O=a||s===i?[]:N?.name?[{id:s,name:N.name},...N?.ancestorFolders??[]]:N?.ancestorFolders??[];return T({teamId:e,projectId:n,projectName:r,ancestorFolders:O,currentAsset:{name:N?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(k)=>{l({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:k}})}}),()=>b()},[e,n,r,N?.ancestorFolders,N?.name,a,s,i,T,b,l]),t("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:o("div",{className:"flex-1 flex overflow-hidden relative",children:[!p&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>h(!0)}),x&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>C(!1)}),!p&&o(L,{children:[t("div",{className:"bg-background flex-shrink-0",style:{width:c},children:t(vr,{teamId:e,projectId:n,projectName:r,rootFolderId:i,selectedFolderId:s,ancestorFolders:N?.ancestorFolders??[]})}),t(Ir,{onResize:(v)=>{d((O)=>Math.max(180,Math.min(400,O+v)))},className:"hidden md:block"})]}),t("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:t(AO,{projectId:n,assetId:s,rootFolderId:i,isRoot:a})}),x&&!y&&o(L,{children:[t(Ir,{onResize:(v)=>{g((O)=>Math.max(240,Math.min(600,O-v)))},className:"hidden md:block"}),t("div",{style:{width:f},className:"bg-background flex flex-col flex-shrink-0",children:t(Ti,{projectId:n,contextAssetId:s})})]})]})})}
|
|
39
|
+
`).map((i)=>i.split("\t")),r=oc();for(let i of n){let a=yr();for(let l of i){let c=_n(ve.NO_STATUS),d=Se();l&&d.append(yt(l)),c.append(d),a.append(c)}r.append(a)}let{anchorCell:s}=xm(this);iO(r,s.select(0,s.getChildrenSize()))}insertText(){}hasFormat(e){let n=0;this.getNodes().filter(xe).forEach((s)=>{let i=s.getFirstChild();$n(i)&&(n|=i.getTextFormat())});let r=wi[e];return(n&r)!==0}insertNodes(e){let n=this.focus.getNode();Q(n)||pe(151),zo(n.select(0,n.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:n}=xm(this),r=Em(e);r===null&&pe(153);let s=Em(n);s===null&&pe(155);let i=Math.min(r.columnIndex,s.columnIndex),a=Math.max(r.columnIndex+r.colSpan-1,s.columnIndex+s.colSpan-1),l=Math.min(r.rowIndex,s.rowIndex),c=Math.max(r.rowIndex+r.rowSpan-1,s.rowIndex+s.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(l,c),toX:Math.max(i,a),toY:Math.max(l,c)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:n,anchorCell:r,focusCell:s}=xm(this),i=s.getParents()[1];if(i!==n){if(n.isParentOf(s)){let N=i.getParent();N==null&&pe(159),this.set(this.tableKey,s.getKey(),N.getKey())}else{let N=n.getParent();N==null&&pe(158),this.set(this.tableKey,N.getKey(),s.getKey())}return this.getNodes()}let[a,l,c]=an(n,r,s),{minColumn:d,maxColumn:f,minRow:g,maxRow:p}=Zl(a,l,c),h=new Map([[n.getKey(),n]]),x=null;for(let N=g;N<=p;N++)for(let E=d;E<=f;E++){let{cell:T}=a[N][E],b=T.getParent();Ke(b)||pe(160),b!==x&&(h.set(b.getKey(),b),x=b),h.has(T.getKey())||jI(T,(v)=>{h.set(v.getKey(),v)})}let y=Array.from(h.values());return yS()||(this._cachedNodes=y),y}getTextContent(){let e=this.getNodes().filter((r)=>xe(r)),n="";for(let r=0;r<e.length;r++){let s=e[r],i=s.__parent,a=(e[r+1]||{}).__parent;n+=s.getTextContent()+(a!==i?`
|
|
40
|
+
`:"\t")}return n}}function Ge(e){return e instanceof tc}function GI(){let e=qn("root",0,"element"),n=qn("root",0,"element");return new tc("root",e,n)}function Gd(e,n,r){e.getKey(),n.getKey(),r.getKey();let s=X(),i=Ge(s)?s.clone():new tc("root",qn("root",0,"element"),qn("root",0,"element"));return i.set(e.getKey(),n.getKey(),r.getKey()),i}function jI(e,n){let r=[[e]];for(let s=r.at(-1);s!==void 0&&r.length>0;s=r.at(-1)){let i=s.pop();i===void 0?r.pop():n(i)!==!1&&Q(i)&&r.push(i.getChildren())}}function km(e,n=We()){let r=Mt(e);rt(r)||pe(231,e);let s=Zo(r,n.getElementByKey(e));return s===null&&pe(232,e),{tableElement:s,tableNode:r}}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 n=this.observers.get(e);return n!==void 0&&(n[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[n,[r]]of Array.from(this.observers.entries())){let s=Mt(n);rt(s)?e.push([s,r]):this.removeObserver(n)}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,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,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((n)=>{this.editor.read("latest",()=>{let r=!1;for(let a=0;a<n.length;a++){let l=n[a].target.nodeName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TR"){r=!0;break}}if(!r)return;let{tableNode:s,tableElement:i}=this.$lookup();this.table=ca(s,i)})});this.editor.read("latest",()=>{let{tableNode:n,tableElement:r}=this.$lookup();this.table=ca(n,r),e.observe(r,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let n=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:r,tableElement:s}=this.$lookup();Kd(n,ca(r,s),null),e&&X()!==null&&(mt(null),n.dispatchCommand(oo))}$enableHighlightStyle(){let e=this.editor,{tableElement:n}=this.$lookup();sn(n,e._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();et(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&pe(233,e.tableKey,this.tableNodeKey);let n=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Kd(n,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=Ln(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,n=!1){let r=this.editor,{tableNode:s}=this.$lookup(),{x:i,y:a}=e;if(this.focusCell=e,!this.isHighlightingCells)(n||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let l=vm(s,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let c=l;if(c===null&&n&&(c=s.getCellNodeFromCords(i,a,this.table)),c!==null){let d=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=c.getKey(),this.tableSelection=Gd(s,d,c),mt(this.tableSelection),r.dispatchCommand(oo),Kd(r,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?Mt(this.anchorCellNodeKey):null;return xe(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&pe(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?Mt(this.focusCellNodeKey):null;return xe(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&pe(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:n}=this.$lookup(),r=vm(n,e.elem);if(r!==null){let s=r.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(n.getKey(),s,s)):this.tableSelection=Gd(n,r,r),this.anchorCellNodeKey=s}}$formatCells(e){let n=X();Ge(n)||pe(236);let r=Kr(),{anchor:s,focus:i}=r,a=n.getNodes().filter(xe);a.length>0||pe(237);let l=a[0].getFirstChild(),c=$n(l)?l.getFormatFlags(e,null):null;a.forEach((d)=>{s.set(d.getKey(),0,"element"),i.set(d.getKey(),d.getChildrenSize(),"element"),r.formatText(e,c)}),mt(n),this.editor.dispatchCommand(oo)}$clearText(){let{editor:e}=this,n=Mt(this.tableNodeKey);if(!rt(n))throw Error("Expected TableNode.");let r=X();Ge(r)||pe(253);let s=r.getNodes().filter(xe),i=n.getFirstChild(),a=n.getLastChild();if(s.length>0&&i!==null&&a!==null&&Ke(i)&&Ke(a)&&s[0]===i.getFirstChild()&&s[s.length-1]===a.getLastChild()){n.selectPrevious();let l=n.getParent();return n.remove(),void(yo(l)&&l.isEmpty()&&e.dispatchCommand(jr))}s.forEach((l)=>{if(Q(l)){let c=Se(),d=yt();c.append(d),l.append(c),l.getChildren().forEach((f)=>{f!==c&&f.remove()})}}),Kd(e,this.table,null),mt(null),e.dispatchCommand(oo)}}var la="__lexicalTableSelection";function lO(e){let n=Iy(e);return rt(n)||pe(386,e),n}var ra=40;function Cm(e,n,r){let s=(i)=>Math.max(1,Math.ceil(Math.min(ra,i)/ra*18));return e<=n+ra?-s(n+ra-e):e>=r-ra?s(e-(r-ra)):0}function as(e){return ye(e)&&e.nodeName==="TABLE"}function Zo(e,n){if(!n)return n;let r=as(n)?n:n.querySelector("table");return as(r)||pe(341,e.constructor.name,e.getType(),e.getKey(),n.nodeName),r}function Vd(e){return e._window}function Xd(e,n){for(let r=n,s=null;r!==null;r=r.getParent()){if(e.is(r))return s;xe(r)&&(s=r)}return null}var YI=[[Go,"down"],[no,"up"],[Yr,"backward"],[vi,"forward"]],VI=[au,iu,Ei],XI=[Oi,hu];function qI(e,n){return e.registerRootListener((r)=>{if(r===null)return;let s=e._window;if(s===null)return;return so(s,"pointerdown",(i)=>{let a=Nl(i);if(i.button!==0||!ro(a)||!r.contains(a))return;let l=function(c){let d=Ql(c);if(d===null)return null;let f=d.elem;for(;f!=null;){if(f.nodeName==="TABLE"&&la in f&&f[la])return{cellElement:d,tableElement:f,tableObserver:f[la]};f=f.parentNode}return null}(a);e.update(()=>{if(Ge(X())){for(let[g]of n.observers.values())g.$clearHighlight(!1);mt(null),e.dispatchCommand(oo)}if(!l)return;let{tableObserver:c,tableElement:d,cellElement:f}=l;(function(g,p,h,x,y,N){let E=g._window;if(!E)return;let T=(O)=>{if(y.isSelecting)return;y.isSelecting=!0,O!==null&&y.anchorCell===null&&g.update(()=>{y.$setAnchorCellForSelection(O)});let{clientX:k,clientY:M}=p,z=null,K=()=>{y.isSelecting=!1,z!==null&&(E.cancelAnimationFrame(z),z=null),E.removeEventListener("pointerup",Ce),E.removeEventListener("pointermove",Oe)},U=(oe,ae)=>{let ce=x.getRootNode();if(!qr(ce)&&!Au(ce))return null;for(let De of ce.elementsFromPoint(oe,ae)){let we=Yv(x,De);if(we)return we}return null},J=(oe,ae)=>{y.anchorCell===null&&g.update(()=>{y.$setAnchorCellForSelection(oe)}),y.focusCell!==null&&oe.elem===y.focusCell.elem||(N.setNextFocus({focusCell:oe,override:ae,tableKey:y.tableNodeKey}),g.dispatchCommand(oo))},W=(oe)=>{for(let ae=x.parentElement;ae;ae=ae.parentElement)if(oe==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ce=E.getComputedStyle(ae),De=oe==="x"?ce.overflowX:ce.overflowY;if(De==="auto"||De==="scroll")return ae}return null},ne=(oe,ae,ce)=>{let De,we;if(oe===null)De=0,we=ce==="x"?E.innerWidth:E.innerHeight;else{let Be=oe.getBoundingClientRect();De=ce==="x"?Be.left:Be.top,we=ce==="x"?Be.right:Be.bottom}let ht=Cm(ae,De,we);if(ht===0)return!1;if(oe===null){let Be=ce==="x"?E.scrollX:E.scrollY;return E.scrollBy(ce==="x"?ht:0,ce==="x"?0:ht),(ce==="x"?E.scrollX:E.scrollY)!==Be}if(ce==="x"){let Be=oe.scrollLeft;return oe.scrollLeft+=ht,oe.scrollLeft!==Be}let Qt=oe.scrollTop;return oe.scrollTop+=ht,oe.scrollTop!==Qt},ee=(oe,ae)=>{let ce=k,De=M;if(oe===null)ce=Math.min(Math.max(ce,1),E.innerWidth-1);else{let we=oe.getBoundingClientRect();ce=Math.min(Math.max(ce,we.left+1),we.right-1)}if(ae===null)De=Math.min(Math.max(De,1),E.innerHeight-1);else{let we=ae.getBoundingClientRect();De=Math.min(Math.max(De,we.top+1),we.bottom-1)}return[ce,De]},se=()=>{let oe=W("x");if(oe!==null){let we=oe.getBoundingClientRect();if(Cm(k,we.left,we.right)!==0)return!0}let ae=W("y"),ce=ae===null?0:ae.getBoundingClientRect().top,De=ae===null?E.innerHeight:ae.getBoundingClientRect().bottom;return Cm(M,ce,De)!==0},V=()=>{if(z=null,!y.isSelecting)return;let oe=W("x"),ae=W("y"),ce=oe!==null&&ne(oe,k,"x"),De=ne(ae,M,"y");if(ce||De){let[we,ht]=ee(oe,ae),Qt=U(we,ht);Qt&&J(Qt,!1),z=E.requestAnimationFrame(V)}},fe=()=>{z===null&&y.pointerType!=="touch"&&se()&&(z=E.requestAnimationFrame(V))},Ce=()=>{K()},Oe=(oe)=>{if(!((we)=>!(1&~we.buttons))(oe)&&y.isSelecting)return void K();let ae=Nl(oe);if(!ro(ae))return;k=oe.clientX,M=oe.clientY;let ce=null,De=!($s||x.contains(ae));ce=De?Yv(x,ae):U(oe.clientX,oe.clientY),ce&&J(ce,De),fe()};E.addEventListener("pointerup",Ce,y.listenerOptions),E.addEventListener("pointermove",Oe,y.listenerOptions)};y.pointerType=p.pointerType;let b=lO(y.tableNodeKey),v=En();if($s&&p.shiftKey&&Ao(v,b)&&(j(v)||Ge(v))){let O=v.anchor.getNode(),k=Xd(b,v.anchor.getNode());if(k)y.$setAnchorCellForSelection(Zs(y,k)),y.$setFocusCellForSelection(h),xr(p);else(b.isBefore(O)?b.selectStart():b.selectEnd()).anchor.set(v.anchor.key,v.anchor.offset,v.anchor.type)}else p.pointerType!=="touch"&&y.$setAnchorCellForSelection(h);T(h)})(e,i,f,d,c,n)})})})}function cO(e,n,r,s,i){let a=r.getRootElement(),l=Vd(r);a!==null&&l!==null||pe(246);let c=new Im(r,e.getKey()),d=Zo(e,n);(function(h,x){Tm(h)!==null&&pe(205),h[la]=x})(d,c),c.listenersToRemove.add(()=>function(h,x){Tm(h)===x&&delete h[la]}(d,c)),c.listenersToRemove.add(so(d,"mousedown",(h)=>{let x=Nl(h);if(h.detail>=3&&ro(x))Ql(x)!==null&&h.preventDefault()},c.listenerOptions));for(let[h,x]of YI)c.listenersToRemove.add(r.registerCommand(h,(y)=>fO(r,y,x,e,c,i),kn));c.listenersToRemove.add(r.registerCommand(Ri,(h)=>{let x=X();if(Ge(x)){let y=Xd(e,x.focus.getNode());if(y!==null)return xr(h),y.selectEnd(),!0}return!1},kn));let f=()=>{let h=X();return!!Ao(h,e)&&(!!Ge(h)&&(c.$clearText(),!0))};for(let h of VI)c.listenersToRemove.add(r.registerCommand(h,f,kn));let g=(h)=>{let x=X();if(!Ge(x)&&!j(x))return!1;let y=e.isParentOf(x.anchor.getNode());if(y!==e.isParentOf(x.focus.getNode())){let N=y?"anchor":"focus",E=y?"focus":"anchor",{key:T,offset:b,type:v}=x[E];return e[x[N].isBefore(x[E])?"selectPrevious":"selectNext"]()[E].set(T,b,v),!1}return!!Ao(x,e)&&(!!Ge(x)&&(h&&(h.preventDefault(),h.stopPropagation()),c.$clearText(),!0))};for(let h of XI)c.listenersToRemove.add(r.registerCommand(h,g,kn));c.listenersToRemove.add(r.registerCommand(ru,(h)=>{let x=X();if(x){if(!Ge(x)&&!j(x))return!1;kl(r,Fn(h,ClipboardEvent)?h:null,ad(x));let y=g(h);return j(x)?(x.removeText(),!0):y}return!1},kn));let p=a.ownerDocument;return c.listenersToRemove.add(so(p,"paste",(h)=>{if(h.defaultPrevented)return;r.read("latest",()=>{let x=X();return a.contains(p.activeElement)&&Ge(x)&&Ao(x,e)})&&(h.preventDefault(),r.dispatchCommand(Di,h))})),c.listenersToRemove.add(so(p,"copy",(h)=>{if(h.defaultPrevented)return;let x=Nl(h);if(x===a||ro(x)&&a.contains(x))return;r.read("latest",()=>{let y=X();return a.contains(No(a))&&Ge(y)&&Ao(y,e)})&&(h.preventDefault(),r.dispatchCommand(Ni,h))})),c.listenersToRemove.add(r.registerCommand(Wo,(h)=>{let x=X();return!!Ao(x,e)&&(!!Ge(x)&&(c.$formatCells(h),!0))},kn)),c.listenersToRemove.add(r.registerCommand(cu,(h)=>{let x=X();if(!Ge(x)||!Ao(x,e))return!1;let y=x.anchor.getNode(),N=x.focus.getNode();if(!xe(y)||!xe(N))return!1;let[E,T,b]=an(e,y,N),v=Math.max(T.startRow+T.cell.__rowSpan-1,b.startRow+b.cell.__rowSpan-1),O=Math.max(T.startColumn+T.cell.__colSpan-1,b.startColumn+b.cell.__colSpan-1),k=Math.min(T.startRow,b.startRow),M=Math.min(T.startColumn,b.startColumn);if(k===0&&M===0&&v===E.length-1&&O===E[0].length-1)return e.setFormat(h),!0;let z=new Set;for(let K=k;K<=v;K++)for(let U=M;U<=O;U++){let J=E[K][U].cell;if(z.has(J))continue;z.add(J),J.setFormat(h);let W=J.getChildren();for(let ne=0;ne<W.length;ne++){let ee=W[ne];Q(ee)&&!ee.isInline()&&ee.setFormat(h)}}return!0},kn)),c.listenersToRemove.add(r.registerCommand(ou,(h)=>{let x=X();if(!Ao(x,e))return!1;if(Ge(x))return c.$clearHighlight(),!1;if(j(x)){let y=he(x.anchor.getNode(),(N)=>xe(N));if(!xe(y))return!1;if(typeof h=="string"){let N=Xv(r,x,e);if(N)return Vv(N,e,[yt(h)]),!0}}return!1},kn)),s&&c.listenersToRemove.add(r.registerCommand(Vr,(h)=>{let x=X();if(!j(x)||!x.isCollapsed()||!Ao(x,e))return!1;let y=ia(x.anchor.getNode());return!(y===null||!e.is(Qs(y)))&&(xr(h),function(N,E){let T=E==="next"?"getNextSibling":"getPreviousSibling",b=E==="next"?"getFirstChild":"getLastChild",v=N[T]();if(Q(v))return v.selectEnd();let O=he(N,Ke);O===null&&pe(247);for(let M=O[T]();Ke(M);M=M[T]()){let z=M[b]();if(Q(z))return z.selectEnd()}let k=he(O,rt);k===null&&pe(248),E==="next"?k.selectNext():k.selectPrevious()}(y,h.shiftKey?"previous":"next"),!0)},kn)),c.listenersToRemove.add(r.registerCommand(Qy,(h)=>e.isSelected(),kn)),c.listenersToRemove.add(r.registerCommand(jr,()=>{let h=X();if(!j(h)||!h.isCollapsed()||!Ao(h,e))return!1;let x=Xv(r,h,e);return!!x&&(Vv(x,e),!0)},kn)),c}function JI(e,n){let r=X(),s=En(),i=e.getAndClearNextFocus();if(i!==null){let{tableKey:l,focusCell:c}=i,d=e.observers.get(l);d||pe(335,l);let[f]=d;if(Ge(r)&&r.tableKey===f.tableNodeKey)return(c.x!==f.focusX||c.y!==f.focusY)&&(f.$setFocusCellForSelection(c),!0);if(f.anchorCell!==null&&f.anchorCellNodeKey!==null&&c.elem!==f.anchorCell.elem&&f.tableSelection!==null)return f.$setFocusCellForSelection(c,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&j(s)&&j(r)&&r.isCollapsed()){let l=Mt(a);if(rt(l)){let c=r.anchor.getNode(),d=l.getFirstChild(),f=ia(c);if(f!==null&&Ke(d)){let g=d.getFirstChild();if(xe(g)&&l.is(he(f,(p)=>p.is(l)||p.is(g))))return g.selectStart(),!0}}}Ge(r)&&function(l,c){let d=Vd(l),f=En();if(!c.is(f))return;let g=lO(c.tableKey),p=Ln(d),h=p&&ws(p,l.getRootElement());if(p&&h&&h.anchorNode&&h.focusNode){let x=vt(h.focusNode),y=x&&!g.isParentOf(x),N=vt(h.anchorNode),E=N&&g.isParentOf(N);if(y&&E&&p.rangeCount>0){let T=Ry(p,l);T&&(T.anchor.set(g.getKey(),c.isBackward()?g.getChildrenSize():0,"element"),p.removeAllRanges(),mt(T))}}}(n,r),j(r)&&function(l,c){let d=En(),{anchor:f,focus:g}=l,p=f.getNode(),h=g.getNode(),x=ia(p),y=ia(h),N=x?Qs(x):null,E=y?Qs(y):null,T=l.isBackward(),b=x&&y&&N&&E&&N.is(E),v=E&&(!N||N.isParentOf(E)),O=N&&(!E||E.isParentOf(N));if(v){let k=l.clone(),[M]=an(E,y,y),z=M[0][0].cell,K=M[M.length-1].at(-1).cell;k.focus.set(T?z.getKey():K.getKey(),T?0:K.getChildrenSize(),"element"),mt(k)}else if(O){let k=l.clone(),[M]=an(N,x,x),z=M[0][0].cell,K=M[M.length-1].at(-1).cell;k.anchor.set(T?K.getKey():z.getKey(),T?K.getChildrenSize():0,"element"),mt(k)}else if(b){let k=c.observers.get(N.getKey());k||pe(335,N.getKey());let[M]=k;if(x.is(y)||(M.$setAnchorCellForSelection(Zs(M,x)),M.$setFocusCellForSelection(Zs(M,y),!0)),M.pointerType==="touch"&&M.isSelecting&&l.isCollapsed()&&j(d)&&d.isCollapsed()){let z=ia(d.anchor.getNode());z&&!z.is(y)&&(M.$setAnchorCellForSelection(Zs(M,z)),M.$setFocusCellForSelection(Zs(M,y),!0),M.pointerType=null)}}}(r,e);for(let[l,c]of e.$getTableNodesAndObservers())ZI(n,l,c);return!1}function ZI(e,n,r){let s=X(),i=En();s&&!s.is(i)&&(Ge(s)||Ge(i))&&r.tableSelection&&!r.tableSelection.is(i)&&(Ge(s)&&s.tableKey===r.tableNodeKey?r.$updateTableTableSelection(s):!Ge(s)&&Ge(i)&&i.tableKey===r.tableNodeKey&&r.$updateTableTableSelection(null)),r.hasHijackedSelectionStyles&&!n.isSelected()?function(a,l){l.$enableHighlightStyle(),bm(l.table,(c)=>{let d=c.elem;c.highlighted=!1,dO(a,c),d.getAttribute("style")||d.removeAttribute("style")})}(e,r):!r.hasHijackedSelectionStyles&&n.isSelected()&&function(a,l){l.$disableHighlightStyle(),bm(l.table,(c)=>{c.highlighted=!0,uO(a,c)})}(e,r)}function Tm(e){return e[la]||null}function Ql(e){let n=e;for(;n!=null;){let r=n.nodeName;if(r==="TD"||r==="TH"){let s=n._cell;return s===void 0?null:s}n=n.parentNode}return null}function Yv(e,n){if(!e.contains(n))return null;let r=null;for(let s=n;s!=null;s=s.parentNode){if(s===e)return r;let i=s.nodeName;i!=="TD"&&i!=="TH"||(r=s._cell||null)}return null}function ca(e,n){let r=[],s={columns:0,domRows:r,rows:0},i=Zo(e,n).querySelector("tr"),a=0,l=0;for(r.length=0;i!=null;){let c=i.nodeName;if(c==="TD"||c==="TH"){let g={elem:i,hasBackgroundColor:i.style.backgroundColor!=="",highlighted:!1,x:a,y:l};i._cell=g;let p=r[l];p===void 0&&(p=r[l]=[]),p[a]=g}else{let g=i.firstChild;if(g!=null){i=g;continue}}let d=i.nextSibling;if(d!=null){a++,i=d;continue}let f=i.parentNode;if(f!=null){let g=f.nextSibling;if(g==null)break;l++,a=0,i=g}}return s.columns=a+1,s.rows=l+1,s}function Kd(e,n,r){let s=new Set(r?r.getNodes():[]);bm(n,(i,a)=>{let l=i.elem;s.has(a)?(i.highlighted=!0,uO(e,i)):(i.highlighted=!1,dO(e,i),l.getAttribute("style")||l.removeAttribute("style"))})}function bm(e,n){let{domRows:r}=e;for(let s=0;s<r.length;s++){let i=r[s];if(i)for(let a=0;a<i.length;a++){let l=i[a];if(!l)continue;let c=vt(l.elem);c!==null&&n(l,c,{x:a,y:s})}}}var QI=(e,n,r,s,i)=>{let a=i==="forward";switch(i){case"backward":case"forward":return r!==(a?e.table.columns-1:0)?Ud(n.getCellNodeFromCordsOrThrow(r+(a?1:-1),s,e.table),a):s!==(a?e.table.rows-1:0)?Ud(n.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,s+(a?1:-1),e.table),a):a?n.selectNext():n.selectPrevious(),!0;case"up":return s!==0?Ud(n.getCellNodeFromCordsOrThrow(r,s-1,e.table),!1):n.selectPrevious(),!0;case"down":return s!==e.table.rows-1?Ud(n.getCellNodeFromCordsOrThrow(r,s+1,e.table),!0):n.selectNext(),!0;default:return!1}};function ym(e,n){let r,s;if(n.startColumn===e.minColumn)r="minColumn";else{if(n.startColumn+n.cell.__colSpan-1!==e.maxColumn)return null;r="maxColumn"}if(n.startRow===e.minRow)s="minRow";else{if(n.startRow+n.cell.__rowSpan-1!==e.maxRow)return null;s="maxRow"}return[r,s]}function zd([e,n]){return[e==="minColumn"?"maxColumn":"minColumn",n==="minRow"?"maxRow":"minRow"]}function sa(e,n,[r,s]){let i=n[s],a=e[i];a===void 0&&pe(250,s,String(i));let l=n[r],c=a[l];return c===void 0&&pe(250,r,String(l)),c}function e1(e,n,r,s,i){let a=Zl(n,r,s),l=function(M,z){let{minColumn:K,maxColumn:U,minRow:J,maxRow:W}=z,ne=1,ee=1,se=1,V=1,fe=M[J],Ce=M[W];for(let Oe=K;Oe<=U;Oe++)ne=Math.max(ne,fe[Oe].cell.__rowSpan),V=Math.max(V,Ce[Oe].cell.__rowSpan);for(let Oe=J;Oe<=W;Oe++)ee=Math.max(ee,M[Oe][K].cell.__colSpan),se=Math.max(se,M[Oe][U].cell.__colSpan);return{bottomSpan:V,leftSpan:ee,rightSpan:se,topSpan:ne}}(n,a),{topSpan:c,leftSpan:d,bottomSpan:f,rightSpan:g}=l,p=function(M,z){let K=ym(M,z);return K===null&&pe(249,z.cell.getKey()),K}(a,r),[h,x]=zd(p),y=a[h],N=a[x];i==="forward"?y+=h==="maxColumn"?1:d:i==="backward"?y-=h==="minColumn"?1:g:i==="down"?N+=x==="maxRow"?1:c:i==="up"&&(N-=x==="minRow"?1:f);let E=n[N];if(E===void 0)return!1;let T=E[y];if(T===void 0)return!1;let[b,v]=function(M,z,K){let U=Zl(M,z,K),J=ym(U,z);if(J)return[sa(M,U,J),sa(M,U,zd(J))];let W=ym(U,K);if(W)return[sa(M,U,zd(W)),sa(M,U,W)];let ne=["minColumn","minRow"];return[sa(M,U,ne),sa(M,U,zd(ne))]}(n,r,T),O=Zs(e,b.cell),k=Zs(e,v.cell);return e.$setAnchorCellForSelection(O),e.$setFocusCellForSelection(k,!0),!0}function Ao(e,n){if(j(e)||Ge(e)){let r=n.isParentOf(e.anchor.getNode()),s=n.isParentOf(e.focus.getNode());return r&&s}return!1}function Ud(e,n){n?e.selectStart():e.selectEnd()}function uO(e,n){let r=n.elem,s=e._config.theme;xe(vt(r))||pe(131),et(r,s.tableCellSelected)}function dO(e,n){let r=n.elem;xe(vt(r))||pe(131);let s=e._config.theme;sn(r,s.tableCellSelected)}function ia(e){let n=he(e,xe);return xe(n)?n:null}function Qs(e){let n=he(e,rt);return rt(n)?n:null}function t1(e,n,r,s,i,a,l){let c=dn(r.focus,i?"previous":"next");if(cl(c))return!1;let d=c;for(let E of bs(c).iterNodeCarets("shadowRoot")){if(!So(E)||!Q(E.origin))return!1;d=E}let f=d.getParentAtCaret();if(!xe(f))return!1;let g=f,p=function(E){for(let T of bs(E).iterNodeCarets("root")){let{origin:b}=T;if(xe(b)){if(Ko(T))return bt(b,E.direction)}else if(!Ke(b))break}return null}(it(g,d.direction)),h=he(g,rt);if(!h||!h.is(a))return!1;let x=e.getElementByKey(g.getKey()),y=Ql(x);if(!x||!y)return!1;let N=hO(e,h);if(l.table=N,p)if(s==="extend"){let E=Ql(e.getElementByKey(p.origin.getKey()));if(!E)return!1;l.$setAnchorCellForSelection(y),l.$setFocusCellForSelection(E,!0)}else{let E=It(p);Ho(r.anchor,E),Ho(r.focus,E)}else if(s==="extend")l.$setAnchorCellForSelection(y),l.$setFocusCellForSelection(y,!0);else{let E=function(T){let b=al(T);return Ko(b)?It(b):T}(it(h,c.direction));Ho(r.anchor,E),Ho(r.focus,E)}return xr(n),!0}function fO(e,n,r,s,i,a){if((r==="up"||r==="down")&&function(c){let d=c.getRootElement();if(!d)return!1;return d.hasAttribute("aria-controls")&&d.getAttribute("aria-controls")==="typeahead-menu"}(e))return!1;let l=X();if(!Ao(l,s)){if(j(l)){if(r==="backward"){if(l.focus.offset>0)return!1;let c=function(f){for(let g=f,p=f;p!==null;g=p,p=p.getParent())if(Q(p)){if(p!==g&&p.getFirstChild()!==g)return null;if(!p.isInline())return p}return null}(l.focus.getNode());if(!c)return!1;let d=c.getPreviousSibling();return!!rt(d)&&(xr(n),n.shiftKey?l.focus.set(d.getParentOrThrow().getKey(),d.getIndexWithinParent(),"element"):d.selectEnd(),!0)}if(n.shiftKey&&(r==="up"||r==="down")){let c=l.focus.getNode();if(!l.isCollapsed()&&(r==="up"&&!l.isBackward()||r==="down"&&l.isBackward())){let d=he(c,(x)=>rt(x));if(xe(d)&&(d=he(d,rt)),d!==s)return!1;if(!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(!f)return!1;let g=0;r==="up"&&Q(f)&&(g=f.getChildrenSize());let p=f;if(r==="up"&&Q(f))p=f.getLastChild()||f,g=re(p)?p.getTextContentSize():0;let h=l.clone();return h.focus.set(p.getKey(),g,re(p)?"text":"element"),mt(h),xr(n),!0}if(Dt(c)){let d=r==="up"?l.getNodes()[l.getNodes().length-1]:l.getNodes()[0];if(d){if(Xd(s,d)!==null){let f=s.getFirstDescendant(),g=s.getLastDescendant();if(!f||!g)return!1;let[p]=Ht(f),[h]=Ht(g),x=s.getCordsFromCellNode(p,i.table),y=s.getCordsFromCellNode(h,i.table),N=s.getDOMCellFromCordsOrThrow(x.x,x.y,i.table),E=s.getDOMCellFromCordsOrThrow(y.x,y.y,i.table);return i.$setAnchorCellForSelection(N),i.$setFocusCellForSelection(E,!0),!0}}return!1}{let d=he(c,(g)=>Q(g)&&!g.isInline());if(xe(d)&&(d=he(d,rt)),!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(rt(f)&&i.tableNodeKey===f.getKey()){let g=f.getFirstDescendant(),p=f.getLastDescendant();if(!g||!p)return!1;let[h]=Ht(g),[x]=Ht(p),y=l.clone();return y.focus.set((r==="up"?h:x).getKey(),r==="up"?0:x.getChildrenSize(),"element"),xr(n),mt(y),!0}}}}return r==="down"&&ec(e)&&a.setShouldCheckSelectionForTable(s.getKey()),!1}if(j(l)){if(r==="backward"||r==="forward")return t1(e,n,l,n.shiftKey?"extend":"move",r==="backward",s,i);if(l.isCollapsed()){let{anchor:c,focus:d}=l,f=he(c.getNode(),xe),g=he(d.getNode(),xe);if(!xe(f)||!f.is(g))return!1;let p=Qs(f);if(p!==s&&p!=null){let b=Zo(p,e.getElementByKey(p.getKey()));if(b!=null)return i.table=ca(p,b),fO(e,n,r,p,i,a)}let h=e.getElementByKey(f.__key),x=e.getElementByKey(c.key);if(x==null||h==null)return!1;let y;if(c.type==="element")y=x.getBoundingClientRect();else{let b=Ln(Vd(e));if(b===null||b.rangeCount===0)return!1;let v=hS(b,e.getRootElement());if(v===null)return!1;y=v.getBoundingClientRect()}let N=r==="up"?f.getFirstChild():f.getLastChild();if(N==null)return!1;let E=e.getElementByKey(N.__key);if(E==null)return!1;let T=E.getBoundingClientRect();if(r==="up"?T.top>y.top-y.height:y.bottom+y.height>T.bottom){xr(n);let b=s.getCordsFromCellNode(f,i.table);if(!n.shiftKey)return QI(i,s,b.x,b.y,r);{let v=s.getDOMCellFromCordsOrThrow(b.x,b.y,i.table);i.$setAnchorCellForSelection(v),i.$setFocusCellForSelection(v,!0)}return!0}}}else if(Ge(l)){let{anchor:c,focus:d,tableKey:f}=l;if(f!==s.getKey())return!1;let g=he(c.getNode(),xe),p=he(d.getNode(),xe),[h]=l.getNodes();rt(h)||pe(251);let x=Zo(h,e.getElementByKey(h.getKey()));if(!xe(g)||!xe(p)||!rt(h)||x==null)return!1;i.$updateTableTableSelection(l);let y=ca(h,x),N=s.getCordsFromCellNode(g,y),E=s.getDOMCellFromCordsOrThrow(N.x,N.y,y);if(i.$setAnchorCellForSelection(E),xr(n),n.shiftKey){let[T,b,v]=an(s,g,p);return e1(i,T,b,v,r)}return p.selectEnd(),!0}return!1}function xr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Vv(e,n,r){let s=Se();e==="first"?n.insertBefore(s):n.insertAfter(s),s.append(...r||[]),s.selectEnd()}function Xv(e,n,r){let s=r.getParent();if(!s)return;let i=Ln(Vd(e));if(!i)return;let a=ws(i,e.getRootElement()).anchorNode,l=e.getElementByKey(s.getKey()),c=Zo(r,e.getElementByKey(r.getKey()));if(!a||!l||!c||!l.contains(a)||c.contains(a))return;let d=he(n.anchor.getNode(),(b)=>xe(b));if(!d)return;let f=he(d,(b)=>rt(b));if(!rt(f)||!f.is(r))return;let[g,p]=an(r,d,d),h=g[0][0],x=g[g.length-1][g[0].length-1],{startRow:y,startColumn:N}=p,E=y===h.startRow&&N===h.startColumn,T=y===x.startRow&&N===x.startColumn;return E?"first":T?"last":void 0}function Zs(e,n){let{tableNode:r}=e.$lookup(),s=r.getCordsFromCellNode(n,e.table);return r.getDOMCellFromCordsOrThrow(s.x,s.y,e.table)}function vm(e,n,r){return Xd(e,vt(n,r))}function jd(e){return ye(e)&&e.nodeName==="DIV"}function qv(e,n,r){let s=e.querySelector(":scope > colgroup");if(!r)return void(s&&s.remove());s||(s=Xe().createElement("colgroup"),Mu(s),e.insertBefore(s,e.firstChild));let i=[];for(let a=0;a<n;a++){let l=Xe().createElement("col"),c=r[a];c&&(l.style.width=`${c}px`),i.push(l)}s.replaceChildren(...i)}function Jv(e,n,r){if(!n.theme.tableAlignment)return;let s=[],i=[];for(let a of["center","right"]){let l=n.theme.tableAlignment[a];l&&(a===r?i:s).push(l)}sn(e,...s),et(e,...i)}var gO=new WeakSet;function n1(e){let{scrollable:n,scrollbar:r,tableElement:s}=e;if(r.classList.length===0&&function(c){let d=c.style.display;c.style.display="";let f=c.offsetHeight-c.clientHeight;return c.style.display=d,f}(r)===0)return gO.add(r),r.style.display="none",n.style.scrollbarWidth="auto",()=>{};let i=()=>{r.scrollLeft!==n.scrollLeft&&(r.scrollLeft=n.scrollLeft)},a=()=>{n.scrollLeft!==r.scrollLeft&&(n.scrollLeft=r.scrollLeft)};n.addEventListener("scroll",i,{passive:!0}),r.addEventListener("scroll",a,{passive:!0});let l=null;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(()=>{Om(n,r)}),l.observe(n),l.observe(s)),Om(n,r),()=>{n.removeEventListener("scroll",i),r.removeEventListener("scroll",a),l&&l.disconnect()}}function Om(e,n){if(gO.has(n))return;let r=n.firstElementChild;if(!r||!ye(r)||!e.isConnected)return;let s=e.ownerDocument.defaultView;if(!s)return void(n.style.display="none");let i=s.getComputedStyle(e).overflowX,a=i==="auto"||i==="scroll",{scrollWidth:l,clientWidth:c}=e,d=l+"px";r.style.width!==d&&(r.style.width=d);let f=a&&l>c;n.style.display=f?"":"none"}function o1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let n=e.firstElementChild;if(!jd(n))return null;let r=n.querySelector(":scope > table");if(!as(r))return null;let s=n.nextElementSibling;return jd(s)?{scrollable:n,scrollbar:s,tableElement:r}:null}var Am=new WeakSet;function ec(e=We()){return Am.has(e)}function Rm(e=We()){let n=io(e,"@lexical/table/Table");return!!n&&(n.output.hasStickyScrollbar.peek()&&n.output.hasHorizontalScroll.peek())}function pO(e,n){n?Am.add(e):Am.delete(e)}class Sr extends ct{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:ct,importDOM:{table:()=>({conversion:r1,priority:1})}})}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let n=this.getWritable();return n.__colWidths=e,n}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,n,r){return r==="html"}getDOMSlot(e){let n=as(e)?e:e.querySelector("table");return as(n)||pe(229),super.getDOMSlot(e).withElement(n).withAfter(n.querySelector(":scope > colgroup"))}createDOM(e,n){let r=Xe().createElement("table");if(this.__style&&fr(r.style,this.__style),this.getColWidths()){let s=Xe().createElement("colgroup");r.appendChild(s),Mu(s)}if(et(r,e.theme.table),this.updateTableElement(null,r,e),ec(n)){let s=Rm(n),i=function(a,l,c){let d=Xe().createElement("div"),f=l.theme.tableScrollableWrapper;return f?et(d,f):d.style.overflowX="auto",c&&(d.style.scrollbarWidth="none"),d.appendChild(a),d}(r,e,s);if(this.updateTableWrapper(null,i,r,e),s){let a=function(c){let d=Xe(),f=d.createElement("div"),g=c.theme.tableStickyScrollbar;g?et(f,g):(f.style.position="sticky",f.style.bottom="0",f.style.overflowX="scroll",f.style.overflowY="hidden"),f.style.display="none",f.setAttribute("aria-hidden","true"),f.tabIndex=-1;let p=d.createElement("div");return p.style.height="1px",p.style.width="0px",f.appendChild(p),f}(e),l=Xe().createElement("div");return l.setAttribute("data-lexical-sticky-scrollbar","true"),l.appendChild(i),l.appendChild(a),Mu(a),l}return i}return r}updateTableWrapper(e,n,r,s){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenColumn),a.setAttribute("data-lexical-frozen-column","true")):(sn(i,l.theme.tableFrozenColumn),a.removeAttribute("data-lexical-frozen-column"))}(n,r,s,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenRow),a.setAttribute("data-lexical-frozen-row","true")):(sn(i,l.theme.tableFrozenRow),a.removeAttribute("data-lexical-frozen-row"))}(n,r,s,this.__frozenRowCount)}updateTableElement(e,n,r){this.__style!==(e?e.__style:"")&&fr(n.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(a,l,c){c?(et(a,l.theme.tableRowStriping),a.setAttribute("data-lexical-row-striping","true")):(sn(a,l.theme.tableRowStriping),a.removeAttribute("data-lexical-row-striping"))}(n,r,this.__rowStriping);let s=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===s&&this.getColWidths()===i||qv(n,this.getColumnCount(),this.getColWidths()),Jv(n,r,this.getFormatType())}updateDOM(e,n,r){let s=Zo(this,n);if(n===s===ec())return!0;if(jd(n)){if(n.hasAttribute("data-lexical-sticky-scrollbar")!==Rm())return!0;let i=s.parentElement;jd(i)&&this.updateTableWrapper(e,i,s,r)}return this.updateTableElement(e,s,r),!1}scaleDOMColWidths(e,n){let r=this.getColWidths();if(!r)return;qv(Zo(this,e),this.getColumnCount(),r.map((s)=>s*n))}exportDOM(e){let n=super.exportDOM(e),{element:r}=n;return{after:(s)=>{if(n.after&&(s=n.after(s)),!as(s)&&ye(s)&&(s=s.querySelector("table")),!as(s))return null;Jv(s,e._config,this.getFormatType());let[i]=go(this,null,null),a=new Map;for(let f of i)for(let g of f){let p=g.cell.getKey();a.has(p)||a.set(p,{colSpan:g.cell.getColSpan(),startColumn:g.startColumn})}let l=new Set;for(let f of s.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let g=f.getAttribute("data-temporary-table-cell-lexical-key");if(g){let p=a.get(g);if(f.removeAttribute("data-temporary-table-cell-lexical-key"),p){a.delete(g);for(let h=0;h<p.colSpan;h++)l.add(h+p.startColumn)}}}let c=s.querySelector(":scope > colgroup");if(c){let f=Array.from(s.querySelectorAll(":scope > colgroup > col")).filter((g,p)=>l.has(p));c.replaceChildren(...f)}let d=s.querySelectorAll(":scope > tr");if(d.length>0){let f=Xe().createElement("tbody");for(let g of d)f.appendChild(g);s.append(f)}return s},element:!as(r)&&ye(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,n){let{rows:r,domRows:s}=n;for(let i=0;i<r;i++){let a=s[i];if(a!=null)for(let l=0;l<a.length;l++){let c=a[l];if(c==null)continue;let{elem:d}=c,f=vm(this,d);if(f!==null&&e.is(f))return{x:l,y:i}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,n,r){let{domRows:s}=r,i=s[n];if(i==null)return null;let a=i[e<i.length?e:i.length-1];return a==null?null:a}getDOMCellFromCordsOrThrow(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(!s)throw Error("Cell not found at cords.");return s}getCellNodeFromCords(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(s==null)return null;let i=vt(s.elem);return xe(i)?i:null}getCellNodeFromCordsOrThrow(e,n,r){let s=this.getCellNodeFromCords(e,n,r);if(!s)throw Error("Node at cords not TableCellNode.");return s}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let n=this.getWritable();return n.__rowStriping=e,n}setFrozenColumns(e){let n=this.getWritable();return n.__frozenColumnCount=e,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let n=this.getWritable();return n.__frozenRowCount=e,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!Ke(e))return 0;let n=0;return e.getChildren().forEach((r)=>{xe(r)&&(n+=r.getColSpan())}),n}}function hO(e,n){let r=e.getElementByKey(n.getKey());return r===null&&pe(230),ca(n,r)}function r1(e){let n=oc();e.hasAttribute("data-lexical-row-striping")&&n.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&n.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&n.setFrozenRows(1);let r=e.querySelector(":scope > colgroup");if(r){let s=[];for(let i of r.querySelectorAll(":scope > col")){let a=i.style.width||"";if(!aa.test(a)&&(a=i.getAttribute("width")||"",!/^\d+$/.test(a))){s=void 0;break}s.push(parseFloat(a))}s&&n.setColWidths(s)}return{after:(s)=>bl(s,Ke),node:n}}function oc(){return cn(new Sr)}function rt(e){return e instanceof Sr}function s1(e){Ke(e.getParent())?e.isEmpty()&&e.append(Se()):e.remove()}function i1(e){rt(e.getParent())?xp(e,xe):e.remove()}function a1(e){xp(e,Ke);let[n]=go(e,null,null),r=n.reduce((l,c)=>Math.max(l,c.length),0),s=e.getChildren();for(let l=0;l<n.length;++l){let c=s[l];if(!c)continue;Ke(c)||pe(254,c.constructor.name,c.getType());let d=n[l].reduce((f,g)=>g?1+f:f,0);if(d!==r)for(let f=d;f<r;++f){let g=_n();g.append(Se()),c.append(g)}}let i=e.getColWidths(),a=e.getColumnCount();if(i&&i.length!==a){let l;if(a<i.length)l=i.slice(0,a);else if(i.length>0){let c=i[i.length-1];l=[...i,...Array(a-i.length).fill(c)]}e.setColWidths(l)}}function l1(e){if(e.detail<3||!ro(e.target))return!1;let n=vt(e.target);if(n===null)return!1;let r=he(n,(s)=>Q(s)&&!s.isInline());if(r===null)return!1;return!!xe(r.getParent())&&(r.select(0),!0)}function c1(){let e=X();if(!j(e))return!1;let n=Qs(e.anchor.getNode());if(n===null)return!1;let r=Je();if(!r.is(n.getParent())||r.getChildrenSize()!==1)return!1;let[s]=go(n,null,null);if(s.length===0||s[0].length===0)return!1;let i=s[0][0];if(!i||!i.cell)return!1;let a=s[s.length-1],l=a[a.length-1];if(!l||!l.cell)return!1;let c=Gd(n,i.cell,l.cell);return mt(c),!0}function mO(e){return e.registerNodeTransform(Cr,(n)=>{if(n.getColSpan()>1||n.getRowSpan()>1){let[,,r]=Ht(n),[s]=an(r,n,n),i=s.length,a=s[0].length,l=r.getFirstChild();Ke(l)||pe(175);let c=[];for(let d=0;d<i;d++){d!==0&&(l=l.getNextSibling(),Ke(l)||pe(175));let f=null;for(let g=0;g<a;g++){let p=s[d][g],h=p.cell;if(p.startRow===d&&p.startColumn===g)f=h,c.push(h);else if(h.getColSpan()>1||h.getRowSpan()>1){xe(h)||pe(176);let x=_n(h.__headerState);f!==null?f.insertAfter(x):sN(l,x)}}}for(let d of c)d.setColSpan(1),d.setRowSpan(1)}})}function _O(e,n=!0){let r=new aO,s=(i,a,l)=>{let c=Zo(i,l),d=cO(i,c,e,n,r);r.observers.set(a,[d,c])};return Ae(qI(e,r),e.registerCommand(oo,()=>JI(r,e),kn),e.registerMutationListener(Sr,(i)=>{e.read("latest",()=>{for(let[a,l]of i){let c=r.observers.get(a);if(l==="created"||l==="updated"){let{tableNode:d,tableElement:f}=km(a);c===void 0?s(d,a,f):f!==c[1]&&(r.removeObserver(a),s(d,a,f))}else l==="destroyed"&&r.removeObserver(a)}})},{skipInitialization:!1}),()=>{r.removeAllObservers()})}function xO(e,n){e.hasNodes([Sr])||pe(255);let{hasNestedTables:r=zs(!1)}=n??{};return Ae(e.registerCommand(Zv,(s)=>function({rows:i,columns:a,includeHeaders:l},c){let d=X()||En();if(!d||!j(d))return!1;if(!c&&Qs(d.anchor.getNode()))return!1;let f=Qv(Number(i),Number(a),l);Lu(f);let g=f.getFirstDescendant();return re(g)&&g.select(),!0}(s,r.peek()),Te),e.registerCommand(yu,(s,i)=>e===i&&function(a,l){let{nodes:c,selection:d}=a;if(!c.some((p)=>rt(p)||rN(p).some((h)=>rt(h.node)))){if(Ge(d)){let p="",h=!1;for(let x of c){let y=Q(x)&&!x.isInline();p.length>0&&(y||h)&&(p+=`
|
|
41
|
+
`),p+=x.getTextContent(),h=y}return d.insertRawText(p),!0}return!1}let f=Ge(d),g=j(d);if(!(g&&he(d.anchor.getNode(),(p)=>xe(p))!==null&&he(d.focus.getNode(),(p)=>xe(p))!==null||f))return!1;if(c.length===1&&rt(c[0]))return iO(c[0],d);if(g&&l.peek()&&!function(p){if(Ge(p)&&!p.focus.getNode().is(p.anchor.getNode()))return!0;if(j(p)&&xe(p.anchor.getNode())&&!p.anchor.getNode().is(p.focus.getNode()))return!0;return!1}(d))return!1;return!0}(s,r),Te),e.registerCommand($i,c1,Fe),e.registerCommand(yi,l1,Te),e.registerNodeTransform(Sr,a1),e.registerNodeTransform(da,i1),e.registerNodeTransform(Cr,s1))}var u1={$accepts:Ke,$packageRun:(e)=>e.every(xe)?[yr().splice(0,0,e)]:[],name:"TableSchema"},d1={$accepts:xe,name:"TableRowSchema"},CO=[dt({$import:(e,n)=>{let r=oc();n.hasAttribute("data-lexical-row-striping")&&r.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&r.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&r.setFrozenRows(1);let s=n.querySelector(":scope > colgroup");if(s){let i=[];for(let a of s.querySelectorAll(":scope > col")){let l=a.style.width||"";if(!aa.test(l)&&(l=a.getAttribute("width")||"",!/^\d+$/.test(l))){i=void 0;break}i.push(parseFloat(l))}i&&r.setColWidths(i)}return[r.splice(0,0,bl(e.$importChildren(n),Ke))]},match:ft.tag("table"),name:"@lexical/table/table"}),dt({$import:(e,n)=>[yr(aa.test(n.style.height)?parseFloat(n.style.height):void 0).splice(0,0,bl(e.$importChildren(n),xe))],match:ft.tag("tr"),name:"@lexical/table/tr"}),dt({$import:(e,n)=>{let r=n.nodeName==="TH",s=aa.test(n.style.width)?parseFloat(n.style.width):void 0,i=ve.NO_STATUS;if(r){let E=n.getAttribute("scope");if(E==="col")i=ve.COLUMN;else if(E==="row")i=ve.ROW;else{let T=n.parentElement,b=NS(T)&&(T.parentElement&&T.parentElement.nodeName==="THEAD"||T.rowIndex===0),v=n.cellIndex===0;b&&(i|=ve.ROW),v&&(i|=ve.COLUMN),i===ve.NO_STATUS&&(i=ve.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;(function(E){return E==="middle"||E==="bottom"})(c)&&(a.__verticalAlign=c);let d=e.get(oh),f=d|function(E){let T=0,b=E.fontWeight;b!=="700"&&b!=="bold"||(T|=ml),E.fontStyle==="italic"&&(T|=xl);let v=(E.textDecoration||"").split(" ");return v.includes("underline")&&(T|=yl),v.includes("line-through")&&(T|=Cl),T}(n.style),g=e.get(rh),p=n.style.color,h=p?{...g,color:p}:g,x=[];f!==d&&x.push(Gi(oh,f)),h!==g&&x.push(Gi(rh,h));let y=function(E){let T=[],b=null,v=()=>{if(b!==null){let O=b.getFirstChild();Ue(O)&&b.getChildrenSize()===1&&O.remove()}};for(let O of E)zg(O)||re(O)||Ue(O)?b!==null?b.append(O):(b=Se().append(O),T.push(b)):(v(),b=null,T.push(O));return v(),T.length===0&&T.push(Se()),T}(e.$importChildren(n,{context:x})),N=r?y:od(y,n);return[a.splice(0,0,N)]},match:ft.tag("td","th"),name:"@lexical/table/cell"})],yO=_e({build:(e,n,r)=>wt(n),config:He({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[lo,nn(Xo,{rules:CO})],name:"@lexical/table/Table",nodes:()=>[Sr,da,Cr],register(e,n,r){let s=r.getOutput(),i=!1;return Ae(Nt(()=>{let a=s.hasHorizontalScroll.value,l=s.hasStickyScrollbar.value&&a,c=ec(e);c!==a&&pO(e,a),c===a&&i===l||e.update(xi),i=l}),xO(e,s),Nt(()=>_O(e,s.hasTabHandler.value)),Nt(()=>{if(s.hasStickyScrollbar.value&&s.hasHorizontalScroll.value)return e.registerRootListener((a)=>{if(a)return function(l){let c=new Map;return Ae(()=>{for(let{cleanup:d}of c.values())d();c.clear()},l.registerMutationListener(Sr,(d)=>{for(let[f,g]of d){let p=c.get(f);if(g==="destroyed"){p&&(p.cleanup(),c.delete(f));continue}let h=l.getElementByKey(f),x=h&&ye(h)?o1(h):null;p&&x&&p.parts.scrollable===x.scrollable&&p.parts.scrollbar===x.scrollbar&&p.parts.tableElement===x.tableElement?Om(x.scrollable,x.scrollbar):(p&&(p.cleanup(),c.delete(f)),x&&c.set(f,{cleanup:n1(x),parts:x}))}},{skipInitialization:!1}))}(e)})}),Nt(()=>s.hasCellMerge.value?void 0:mO(e)),Nt(()=>s.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(Cr,(a)=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})))}}),f1=_e({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;S();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:n,focus:r}=e,s=e.anchor.getNode(),i=e.focus.getNode();if(s===i)return s;if(e.isBackward())return ip(r)?s:i;else return ip(n)?i:s}function TO({rightContent:e}={}){let[n]=st(),[r,s]=u(!1),[i,a]=u(!1),[l,c]=u("paragraph"),[d,f]=u(!1),[g,p]=u(!1),[h,x]=u(!1),[y,N]=u(!1),[E,T]=u(!1),[b,v]=u(!1),O=P(()=>{let V=X();if(j(V)){f(V.hasFormat("bold")),p(V.hasFormat("italic")),x(V.hasFormat("underline")),N(V.hasFormat("strikethrough")),T(V.hasFormat("code"));let fe=p1(V),Ce=fe.getParent();v(Qi(Ce)||Qi(fe));let Oe=V.anchor.getNode(),oe=Oe.getKey()==="root"?Oe:Oe.getTopLevelElementOrThrow(),ae=oe.getKey();if(n.getElementByKey(ae)!==null)if(vo(oe)){let De=Iu(Oe,qo),we=De?De.getListType():oe.getListType();c(we)}else if(Pl(oe))c(oe.getTag());else{let De=oe.getType();if(De in g1)c(De);else c("paragraph")}}},[n]);m(()=>n.registerCommand(oo,()=>(O(),!1),Si),[n,O]),m(()=>n.registerUpdateListener(({editorState:V})=>{V.read(()=>{O()})}),[n,O]),m(()=>{let V=n.registerCommand(Ms,(Ce)=>(s(Ce),!1),Fe),fe=n.registerCommand(Rs,(Ce)=>(a(Ce),!1),Fe);return()=>{V(),fe()}},[n]);let k=()=>{n.update(()=>{let V=X();if(j(V))Pi(V,()=>Se())})},M=(V)=>{n.update(()=>{let fe=X();if(j(fe))Pi(fe,()=>gd(V))})},z=()=>{if(l!=="bullet")n.dispatchCommand(T0,void 0);else n.dispatchCommand(Ed,void 0)},K=()=>{if(l!=="number")n.dispatchCommand(E0,void 0);else n.dispatchCommand(Ed,void 0)},U=()=>{if(l!=="check")n.dispatchCommand(N0,void 0);else n.dispatchCommand(Ed,void 0)},J=()=>{if(l!=="quote")n.update(()=>{let V=X();if(j(V))Pi(V,()=>pd())});else k()},W=()=>{if(l!=="code")n.update(()=>{let V=X();if(j(V))Pi(V,()=>Wv())});else k()},ne=P(()=>{if(!b){let V=prompt("Enter link URL (e.g., https://example.com):");if(V)n.dispatchCommand(Ih,V)}else n.dispatchCommand(Ih,null)},[n,b]),ee=P(()=>{n.update(()=>{let V=X();if(j(V))V.setFormat(0),Pi(V,()=>Se())})},[n]);return o("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[o("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[t("button",{type:"button",disabled:!r,onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Eu,void 0),title:"Undo","aria-label":"Undo",children:t(Vm,{className:"h-4 w-4"})}),t("button",{type:"button",disabled:!i,onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(xu,void 0),title:"Redo","aria-label":"Redo",children:t(Wm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),o("select",{value:l,onChange:(V)=>{let fe=V.target.value;switch(fe){case"paragraph":k();break;case"h1":case"h2":case"h3":M(fe);break;case"bullet":z();break;case"number":K();break;case"check":U();break;case"quote":J();break;case"code":W();break}},"aria-label":"Block formatting",children:[t("option",{value:"paragraph",children:"Normal"}),t("option",{value:"h1",children:"Heading 1"}),t("option",{value:"h2",children:"Heading 2"}),t("option",{value:"h3",children:"Heading 3"}),t("option",{value:"bullet",children:"Bullet List"}),t("option",{value:"number",children:"Numbered List"}),t("option",{value:"check",children:"Check List"}),t("option",{value:"quote",children:"Quote"}),t("option",{value:"code",children:"Code Block"})]}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:d?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:t(Fm,{className:"h-4 w-4"})}),t("button",{type:"button",className:g?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:t(zm,{className:"h-4 w-4"})}),t("button",{type:"button",className:h?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:t(Ym,{className:"h-4 w-4"})}),t("button",{type:"button",className:y?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:t(jm,{className:"h-4 w-4"})}),t("button",{type:"button",className:E?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Wo,"code"),title:"Inline Code","aria-label":"Inline Code",children:t(nc,{className:"h-4 w-4"})}),t("button",{type:"button",className:b?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:ne,title:"Insert Link","aria-label":"Link",children:t(Ja,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:l==="h1"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>M("h1"),title:"H1","aria-label":"Heading 1",children:t(Pm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h2"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>M("h2"),title:"H2","aria-label":"Heading 2",children:t(Bm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h3"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>M("h3"),title:"H3","aria-label":"Heading 3",children:t(Km,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="bullet"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:z,title:"Bullet List","aria-label":"Bullet List",children:t(Lo,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="number"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:K,title:"Numbered List","aria-label":"Numbered List",children:t(Um,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="check"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:U,title:"Check List","aria-label":"Check List",children:t(Ga,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="quote"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:J,title:"Quote","aria-label":"Quote",children:t(Hm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",onMouseDown:(V)=>V.preventDefault(),onClick:ee,title:"Clear Formatting","aria-label":"Clear Formatting",children:t(Gm,{className:"h-4 w-4"})})]}),e&&t("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 rc=[Nv,...Ev,...Tv,...bv,...vv];function h1({value:e,initialContent:n="",onChange:r}){let[s]=st(),i=_(!1),a=_("");return m(()=>{if(!i.current){i.current=!0;let l=e!==void 0?e:n;if(l)s.update(()=>{Qh(l,rc)}),a.current=l}},[s,n,e]),m(()=>{if(i.current&&e!==void 0&&e!==a.current)s.update(()=>{Qh(e,rc)}),a.current=e},[s,e]),t($v,{ignoreSelectionChange:!0,onChange:(l)=>{l.read(()=>{let c=Sv(rc);if(c!==a.current)a.current=c,r?.(c)})}})}function vO({initialContent:e="",value:n,onChange:r,placeholder:s="Write your markdown content here...",readOnly:i=!1,autoFocus:a=!1,className:l="",hideToolbar:c=!1,rightToolbarContent:d}){let f={namespace:"ShumaiWysiwygMarkdownEditor",theme:bO,editable:!i,onError:(g)=>{console.error("[MarkdownEditor] Error:",g)},nodes:[md,_d,qo,ns,Gv,NO,SO,EO,J0,ea]};return t("div",{className:`shumai-editor-wrapper ${i?"read-only":""} ${l}`,children:o(OS,{initialConfig:f,children:[!i&&!c?t(TO,{rightContent:d}):d?t("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:d}):null,o(ue,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[t("div",{className:"relative min-h-full",children:t(LT,{contentEditable:t(zT,{className:"editor-input"}),placeholder:t("div",{className:"editor-placeholder",children:s}),ErrorBoundary:kv})}),t(YT,{}),t(O0,{}),t(A0,{}),t(M0,{}),t(Q0,{}),t(Dv,{transformers:rc}),t(h1,{value:n,initialContent:e,onChange:r}),a&&t(eb,{})]})]})})}function OO({projectId:e,assetId:n,rootFolderId:r,isRoot:s}){let i=ke(),a=G(),{canAdmin:l}=Ot(e),{data:c,isLoading:d}=Z({queryKey:["folders",n,"agentsmd"],queryFn:async()=>{let ee=await A.api.folders[":folderId"].agentsmd.$get({param:{folderId:n}});if(!ee.ok)throw Error("Failed to fetch agents.md");return await ee.json()}}),[f,g]=u(""),[p,h]=u(!1),[x,y]=u("idle"),N=_(null),E=_(null),T=_(""),b=_(null),v=_(Promise.resolve());m(()=>{if(!p&&c!==void 0){let ee=c.content??"";g(ee),T.current=ee,b.current=ee,h(!0)}},[c,p]);let[O,k]=u(!1),M=B({mutationFn:async(ee)=>{let se=await A.api.folders[":folderId"].agentsmd.$patch({param:{folderId:n},json:{content:ee}});if(!se.ok)throw Error("Failed to save agents.md");return await se.json()},onSuccess:(ee,se)=>{if(y("saved"),b.current=se,a.setQueryData(["folders",n,"agentsmd"],{content:se}),a.invalidateQueries({queryKey:["folders",n]}),E.current)clearTimeout(E.current);E.current=setTimeout(()=>{y("idle")},2500)},onError:()=>{y("error")}}),z=_(M.mutateAsync);z.current=M.mutateAsync;let K=P((ee)=>{if(!l)return Promise.resolve();if(b.current===ee)return y("saved"),Promise.resolve();y("saving");let se=v.current.then(async()=>{await z.current(ee)}).catch(()=>{});return v.current=se,se},[l]),U=P((ee)=>{if(!l)return;if(g(ee),T.current=ee,N.current)clearTimeout(N.current);y("saving"),N.current=setTimeout(()=>{N.current=null,K(ee)},1000)},[l,K]),J=P(()=>{if(N.current)return clearTimeout(N.current),N.current=null,K(T.current);return v.current},[K]);m(()=>()=>{if(J(),E.current)clearTimeout(E.current)},[J]);let W=async()=>{k(!0);try{J(),await v.current}catch{}finally{if(s||n===r)i({to:"/projects/$projectId",params:{projectId:e}});else i({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:n}})}},ne=o("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[l?o("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(x==="saving"||O)&&o("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[t(ua,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Dp()})]}),x==="saved"&&!O&&o("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[t(Re,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:tA()})]}),x==="error"&&!O&&o("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[t(nr,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:G0()})]})]}):o("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:Xm(),children:[t(on,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Xm()})]}),o("div",{className:"flex items-center gap-2 shrink-0",children:[l&&t(ao,{orientation:"vertical",className:"h-4 shrink-0"}),o(C,{variant:"ghost",size:"sm",onClick:W,disabled:O,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Da(),children:[t(Pe,{className:"h-4 w-4 mr-1 shrink-0"}),t("span",{children:Da()})]})]})]});if(d||!p)return o("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[t(ua,{className:"h-4 w-4 animate-pulse mr-2"}),t("span",{children:H0()})]});return t("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:t(vO,{value:f,onChange:U,placeholder:$0(),readOnly:!l,rightToolbarContent:ne,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function $a({teamId:e,projectId:n,projectName:r,assetId:s,rootFolderId:i,isRoot:a}){let l=ke(),[c,d]=u(240),[f,g]=u(360),{fileListLeftSidebarCollapsed:p,setFileListLeftSidebarCollapsed:h}=$t(),{isChatbotOpen:x,setIsChatbotOpen:y}=ur(),N=_r((v)=>Boolean(v.metadata["appearance.hideAgent"])),{data:E}=Z({queryKey:["folders",s],queryFn:async()=>{let v=await A.api.folders[":folderId"].$get({param:{folderId:s}});if(!v.ok)throw Error("failed to fetch folder");return await v.json()},enabled:!!s}),{setProjectState:T,clearProjectState:b}=un();return m(()=>{let O=a||s===i?[]:E?.name?[{id:s,name:E.name},...E?.ancestorFolders??[]]:E?.ancestorFolders??[];return T({teamId:e,projectId:n,projectName:r,ancestorFolders:O,currentAsset:{name:E?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(k)=>{l({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:k}})}}),()=>b()},[e,n,r,E?.ancestorFolders,E?.name,a,s,i,T,b,l]),t("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:o("div",{className:"flex-1 flex overflow-hidden relative",children:[!p&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>h(!0)}),x&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>y(!1)}),!p&&o(L,{children:[t("div",{className:"bg-background flex-shrink-0",style:{width:c},children:t(vr,{teamId:e,projectId:n,projectName:r,rootFolderId:i,selectedFolderId:s,ancestorFolders:E?.ancestorFolders??[]})}),t(Ir,{onResize:(v)=>{d((O)=>Math.max(180,Math.min(400,O+v)))},className:"hidden md:block"})]}),t("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:t(OO,{projectId:n,assetId:s,rootFolderId:i,isRoot:a})}),x&&!N&&o(L,{children:[t(Ir,{onResize:(v)=>{g((O)=>Math.max(240,Math.min(600,O-v)))},className:"hidden md:block"}),t("div",{style:{width:f},className:"bg-background flex flex-col flex-shrink-0",children:t(Ti,{projectId:n,contextAssetId:s})})]})]})})}
|
|
42
42
|
export{$a};
|