lexical 0.2.1 → 0.2.4

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/Lexical.prod.js CHANGED
@@ -5,162 +5,164 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  function q(a){throw Error(`Minified Lexical error #${a}; see codes.json for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
8
- const aa=RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]"),da=RegExp("^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]"),ea={bold:1,code:16,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},fa={center:2,justify:4,left:1,right:3},ha={inert:3,normal:0,
9
- segmented:2,token:1},ia="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,ja=ia&&"documentMode"in document?document.documentMode:null,r=ia&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ka=ia&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),la=ia&&"InputEvent"in window&&!ja?"getTargetRanges"in new window.InputEvent("input"):!1,na=ia&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),oa=ia&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&
10
- !window.MSStream;let pa=0;const qa="function"===typeof queueMicrotask?queueMicrotask:a=>{Promise.resolve().then(a)};function ra(a,b,c){const d=a.getRootElement();try{var f;if(f=null!==d&&d.contains(b)&&d.contains(c)&&null!==b){const e=document.activeElement,g=null!==e?e.nodeName:null;f=!u(sa(b))||"INPUT"!==g&&"TEXTAREA"!==g}return f&&ta(b)===a}catch(e){return!1}}function ta(a){for(;null!=a;){const b=a.__lexicalEditor;if(null!=b&&!b.isReadOnly())return b;a=a.parentNode}return null}
11
- function v(a){return a.isToken()||a.isInert()}function ua(a){for(;null!=a;){if(3===a.nodeType)return a;a=a.firstChild}return null}function va(a,b,c){b=ea[b];return a&b&&(null===c||0===(c&b))?a^b:null===c||c&b?a|b:a}function wa(a){return w(a)||ya(a)||u(a)}function za(a){var b=a.getParent();if(null!==b){b=b.getWritable().__children;const c=b.indexOf(a.__key);-1===c&&q(16);Aa(a);b.splice(c,1)}}
12
- function Ba(a){99<Ca&&q(26);var b=a.getLatest(),c=b.__parent,d=z();const f=B(),e=d._nodeMap;d=f._dirtyElements;if(null!==c)a:for(;null!==c;){if(d.has(c))break a;const g=e.get(c);if(void 0===g)break;d.set(c,!1);c=g.__parent}b=b.__key;f._dirtyType=1;C(a)?d.set(b,!0):f._dirtyLeaves.add(b)}function Aa(a){const b=a.getPreviousSibling();a=a.getNextSibling();null!==b&&Ba(b);null!==a&&Ba(a)}
13
- function D(a){F();var b=B();const c=b._compositionKey;b._compositionKey=a;null!==c&&(b=H(c),null!==b&&b.getWritable());null!==a&&(a=H(a),null!==a&&a.getWritable())}function H(a,b){a=(b||z())._nodeMap.get(a);return void 0===a?null:a}function Da(a,b){const c=B();a=a["__lexicalKey_"+c._key];return void 0!==a?H(a,b):null}function sa(a,b){for(;null!=a;){const c=Da(a,b);if(null!==c)return c;a=a.parentNode}return null}function Ea(a){const b=Object.assign({},a._decorators);return a._pendingDecorators=b}
8
+ const aa=RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]"),ba=RegExp("^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]"),ca={bold:1,code:16,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},fa={center:2,justify:4,left:1,right:3},ha={inert:3,normal:0,
9
+ segmented:2,token:1},ia="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,ja=ia&&"documentMode"in document?document.documentMode:null,r=ia&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ka=ia&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),la=ia&&"InputEvent"in window&&!ja?"getTargetRanges"in new window.InputEvent("input"):!1,ma=ia&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),oa=ia&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&
10
+ !window.MSStream;let pa=0;const qa="function"===typeof queueMicrotask?queueMicrotask:a=>{Promise.resolve().then(a)};function ra(a,b,c){const d=a.getRootElement();try{var f;if(f=null!==d&&d.contains(b)&&d.contains(c)&&null!==b){const e=document.activeElement,g=null!==e?e.nodeName:null;f=!t(sa(b))||"INPUT"!==g&&"TEXTAREA"!==g}return f&&ta(b)===a}catch(e){return!1}}function ta(a){for(;null!=a;){const b=a.__lexicalEditor;if(null!=b&&!b.isReadOnly())return b;a=a.parentNode}return null}
11
+ function v(a){return a.isToken()||a.isInert()}function ua(a){for(;null!=a;){if(3===a.nodeType)return a;a=a.firstChild}return null}function va(a,b,c){b=ca[b];return a&b&&(null===c||0===(c&b))?a^b:null===c||c&b?a|b:a}function wa(a){return w(a)||xa(a)||t(a)}function ya(a){var b=a.getParent();if(null!==b){b=b.getWritable().__children;const c=b.indexOf(a.__key);-1===c&&q(16);za(a);b.splice(c,1)}}
12
+ function Aa(a){99<Ba&&q(26);var b=a.getLatest(),c=b.__parent,d=z();const f=B(),e=d._nodeMap;d=f._dirtyElements;if(null!==c)a:for(;null!==c;){if(d.has(c))break a;const g=e.get(c);if(void 0===g)break;d.set(c,!1);c=g.__parent}b=b.__key;f._dirtyType=1;C(a)?d.set(b,!0):f._dirtyLeaves.add(b)}function za(a){const b=a.getPreviousSibling();a=a.getNextSibling();null!==b&&Aa(b);null!==a&&Aa(a)}
13
+ function D(a){F();var b=B();const c=b._compositionKey;b._compositionKey=a;null!==c&&(b=G(c),null!==b&&b.getWritable());null!==a&&(a=G(a),null!==a&&a.getWritable())}function G(a,b){a=(b||z())._nodeMap.get(a);return void 0===a?null:a}function Da(a,b){const c=B();a=a["__lexicalKey_"+c._key];return void 0!==a?G(a,b):null}function sa(a,b){for(;null!=a;){const c=Da(a,b);if(null!==c)return c;a=a.parentNode}return null}function Ea(a){const b=Object.assign({},a._decorators);return a._pendingDecorators=b}
14
14
  function Fa(a){return a.read(()=>Ga().getTextContent())}function Ha(a,b){I(a,()=>{var c=z();if(!c.isEmpty())if("root"===b)Ga().markDirty();else{c=c._nodeMap;for(const [,d]of c)d.markDirty()}},null===a._pendingEditorState?{tag:"history-merge"}:void 0)}function Ga(){return z()._nodeMap.get("root")}function Ia(a){z()._selection=a}
15
- function Ja(a){var b=B(),c;a:{for(c=a;null!=c;){const d=c["__lexicalKey_"+b._key];if(void 0!==d){c=d;break a}c=c.parentNode}c=null}return null===c?(b=b.getRootElement(),a===b?H("root"):null):H(c)}function Ka(a){const b=[];for(;null!==a;)b.push(a),a=a._parentEditor;return b}
15
+ function Ja(a){var b=B(),c;a:{for(c=a;null!=c;){const d=c["__lexicalKey_"+b._key];if(void 0!==d){c=d;break a}c=c.parentNode}c=null}return null===c?(b=b.getRootElement(),a===b?G("root"):null):G(c)}function Ka(a){const b=[];for(;null!==a;)b.push(a),a=a._parentEditor;return b}
16
16
  function La(a,b){a=window.getSelection();if(null!==a){var c=a.anchorNode,{anchorOffset:d,focusOffset:f}=a;if(null!==c&&3===c.nodeType&&(a=sa(c),w(a))){c=c.nodeValue;const e=null!==b&&b.data;if("\u200b"===c&&e){const g=e.length;c=e;f=d=g}Ma(a,c,d,f,null!==b)}}}
17
- function Ma(a,b,c,d,f){let e=a;if(e.isAttached()&&(f||!e.isDirty())){var g=e.isComposing();a=b;(g||f)&&"\u200b"===b[b.length-1]&&(a=b.slice(0,-1));b=e.getTextContent();if(f||a!==b)if(""===a)if(D(null),na||oa)e.remove();else{const h=B();setTimeout(()=>{h.update(()=>{e.remove()})},20)}else f=e.getParent(),b=Na(),v(e)||null!==B()._compositionKey&&!g||null!==f&&J(b)&&!f.canInsertTextBefore()&&0===b.anchor.offset?e.markDirty():(g=K(),J(g)&&null!==c&&null!==d&&(g.setTextNodeRange(e,c,e,d),e.isSegmented()&&
17
+ function Ma(a,b,c,d,f){let e=a;if(e.isAttached()&&(f||!e.isDirty())){var g=e.isComposing();a=b;(g||f)&&"\u200b"===b[b.length-1]&&(a=b.slice(0,-1));b=e.getTextContent();if(f||a!==b)if(""===a)if(D(null),ma||oa)e.remove();else{const h=B();setTimeout(()=>{h.update(()=>{e.remove()})},20)}else f=e.getParent(),b=Na(),v(e)||null!==B()._compositionKey&&!g||null!==f&&J(b)&&!f.canInsertTextBefore()&&0===b.anchor.offset?e.markDirty():(g=K(),J(g)&&null!==c&&null!==d&&(g.setTextNodeRange(e,c,e,d),e.isSegmented()&&
18
18
  (c=e.getTextContent(),c=L(c),e.replace(c),e=c)),e.setTextContent(a))}}
19
19
  function Oa(a,b,c){var d=a.anchor;const f=a.focus;var e=d.getNode(),g=window.getSelection();g=null!==g?g.anchorNode:null;const h=d.key,l=B().getElementByKey(h);(b=h!==f.key||!w(e)||d.offset!==f.offset&&!e.isComposing()||(c||e.isDirty())&&1<b.length||null!==l&&!e.isComposing()&&g!==ua(l)||e.getFormat()!==a.format)||(e.isSegmented()?b=!0:a.isCollapsed()?(b=a.anchor.offset,c=e.getParentOrThrow(),d=e.isToken(),a=0===b&&(!e.canInsertTextBefore()||!c.canInsertTextBefore()||d),e=e.getTextContentSize()===
20
20
  b&&(!e.canInsertTextBefore()||!c.canInsertTextBefore()||d),b=a||e):b=!1);return b}function Pa(a,b){var c=a[b];return"string"===typeof c?(c=c.split(" "),a[b]=c):c}function Qa(a,b,c,d,f){0!==c.size&&(c=d.__type,d=d.__key,b=b.get(c),void 0===b&&q(66,c),b=b.klass,c=a.get(b),void 0===c&&(c=new Map,a.set(b,c)),c.has(d)||c.set(d,f))}
21
21
  function Ra(a,b,c){const d=a.getParent();let f=c;null!==d&&(b&&0===c?(f=a.getIndexWithinParent(),a=d):b||c!==a.getChildrenSize()||(f=a.getIndexWithinParent()+1,a=d));return a.getChildAtIndex(b?f-1:f)}function Sa(a,b){var c=a.offset;if("element"===a.type)return a=a.getNode(),Ra(a,b,c);a=a.getNode();return b&&0===c||!b&&c===a.getTextContentSize()?(c=b?a.getPreviousSibling():a.getNextSibling(),null===c?Ra(a.getParentOrThrow(),b,a.getIndexWithinParent()+(b?0:1)):c):null}
22
- function Wa(){var a=window.event;a=a&&a.inputType;return"insertFromPaste"===a||"insertFromPasteAsQuotation"===a}function Xa(a,b,c,d,f){a=a.__children;const e=a.length;for(let g=0;g<e;g++){const h=a[g],l=d.get(h);void 0!==l&&l.__parent===b&&(C(l)&&Xa(l,h,c,d,f),c.has(h)||f.delete(h),d.delete(h))}}
23
- function Ya(a,b,c,d){a=a._nodeMap;b=b._nodeMap;for(const f of c){const e=b.get(f);void 0===e||e.isAttached()||(a.has(f)||c.delete(f),b.delete(f))}for(const [f]of d)c=b.get(f),void 0===c||c.isAttached()||(C(c)&&Xa(c,f,a,b,d),a.has(f)||d.delete(f),b.delete(f))}function Za(a,b){const c=a.__mode,d=a.__format;a=a.__style;const f=b.__mode,e=b.__format;b=b.__style;return(null===c||c===f)&&(null===d||d===e)&&(null===a||a===b)}
24
- function $a(a,b){const c=a.mergeWithSibling(b),d=B()._normalizedNodes;d.add(a.__key);d.add(b.__key);return c}function ab(a){if(""===a.__text&&a.isSimpleText()&&!a.isUnmergeable())a.remove();else{for(var b;null!==(b=a.getPreviousSibling())&&w(b)&&b.isSimpleText()&&!b.isUnmergeable();)if(""===b.__text)b.remove();else{Za(b,a)&&(a=$a(b,a));break}for(var c;null!==(c=a.getNextSibling())&&w(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(""===c.__text)c.remove();else{Za(a,c)&&$a(a,c);break}}}
22
+ function Ta(){var a=window.event;a=a&&a.inputType;return"insertFromPaste"===a||"insertFromPasteAsQuotation"===a}function Ua(a,b,c,d,f){a=a.__children;const e=a.length;for(let g=0;g<e;g++){const h=a[g],l=d.get(h);void 0!==l&&l.__parent===b&&(C(l)&&Ua(l,h,c,d,f),c.has(h)||f.delete(h),d.delete(h))}}
23
+ function Va(a,b,c,d){a=a._nodeMap;b=b._nodeMap;for(const f of c){const e=b.get(f);void 0===e||e.isAttached()||(a.has(f)||c.delete(f),b.delete(f))}for(const [f]of d)c=b.get(f),void 0===c||c.isAttached()||(C(c)&&Ua(c,f,a,b,d),a.has(f)||d.delete(f),b.delete(f))}function Wa(a,b){const c=a.__mode,d=a.__format;a=a.__style;const f=b.__mode,e=b.__format;b=b.__style;return(null===c||c===f)&&(null===d||d===e)&&(null===a||a===b)}
24
+ function $a(a,b){const c=a.mergeWithSibling(b),d=B()._normalizedNodes;d.add(a.__key);d.add(b.__key);return c}function ab(a){if(""===a.__text&&a.isSimpleText()&&!a.isUnmergeable())a.remove();else{for(var b;null!==(b=a.getPreviousSibling())&&w(b)&&b.isSimpleText()&&!b.isUnmergeable();)if(""===b.__text)b.remove();else{Wa(b,a)&&(a=$a(b,a));break}for(var c;null!==(c=a.getNextSibling())&&w(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(""===c.__text)c.remove();else{Wa(a,c)&&$a(a,c);break}}}
25
25
  function bb(a,b,c,d,f={originalSelection:null}){var e=a.__type,g=c._nodes.get(e);void 0===g&&q(24,e);for(var h in a)if(e=a[h],null!=e&&"object"===typeof e&&(e=e.editorState,null!=e)){var l=cb();l._nodes=c._nodes;l._parentEditor=c._parentEditor;l._pendingEditorState=db(e,l);a[h]=l}h=g.klass;g=a.__key;a.__key=void 0;h=h.clone(a);a.__key=g;e=h.__key;M(h)&&z()._nodeMap.set("root",h);h.__parent=d;if(C(h)){d=a.__children;for(l=0;l<d.length;l++){var k=b.get(d[l]);void 0!==k&&(k=bb(k,b,c,e,f).__key,h.__children.push(k))}h.__indent=
26
26
  a.__indent;h.__format=a.__format;h.__dir=a.__dir}else w(h)&&(h.__format=a.__format,h.__style=a.__style,h.__mode=a.__mode,h.__detail=a.__detail);b=null!=f?f.originalSelection:void 0;null!=b&&(a=f.remappedSelection,"range"===b.type?(c=b.anchor,b=b.focus,null!=a||g!==c.key&&g!==b.key||(f.remappedSelection=a={anchor:{...c},focus:{...b},type:"range"}),null!=a&&"range"===a.type&&(g===c.key&&(a.anchor.key=e),g===b.key&&(a.focus.key=e))):"node"===b.type?(b=b.nodes,g=b.indexOf(g),-1!==g&&(null==a&&(f.remappedSelection=
27
- a={nodes:[...b],type:"node"}),"node"===a.type&&a.nodes.splice(g,1,e))):"grid"===b.type&&(c=b.gridKey,d=b.anchorCellKey,l=b.focusCellKey,null!=a||c!==g&&c!==d&&c!==l||(f.remappedSelection=a={...b,type:"grid"}),null!=a&&"grid"===a.type&&(c===g&&(a.gridKey=e),d===g&&(a.anchorCellKey=e),l===g&&(a.focusCellKey=e))));return h}let N="",O="",P="",eb,Q,fb,gb=!1,hb=!1,ib,jb=null,kb,lb,mb,nb,ob,pb;
28
- function qb(a,b){const c=mb.get(a);if(null!==b){const d=rb(a);b.removeChild(d)}nb.has(a)||Q._keyToDOMMap.delete(a);C(c)&&(a=c.__children,sb(a,0,a.length-1,null));void 0!==c&&Qa(pb,fb,ib,c,"destroyed")}function sb(a,b,c,d){for(;b<=c;++b){const f=a[b];void 0!==f&&qb(f,d)}}function tb(a,b){a.setProperty("text-align",b)}function ub(a,b){a.style.setProperty("padding-inline-start",0===b?"":40*b+"px")}
29
- function vb(a,b){a=a.style;0===b?tb(a,""):1===b?tb(a,"left"):2===b?tb(a,"center"):3===b?tb(a,"right"):4===b&&tb(a,"justify")}
30
- function wb(a,b,c){const d=nb.get(a);void 0===d&&q(42);const f=d.createDOM(eb,Q);var e=Q._keyToDOMMap;f["__lexicalKey_"+Q._key]=a;e.set(a,f);w(d)?f.setAttribute("data-lexical-text","true"):u(d)&&f.setAttribute("data-lexical-decorator","true");if(C(d)){a=d.__indent;0!==a&&ub(f,a);a=d.__children;var g=a.length;if(0!==g){e=a;--g;const h=O;O="";xb(e,0,g,f,null);yb(d,f);O=h}e=d.__format;0!==e&&vb(f,e);zb(null,a,f)}else e=d.getTextContent(),u(d)?(g=d.decorate(Q),null!==g&&Ab(a,g),f.contentEditable="false"):
31
- w(d)&&(d.isDirectionless()||(O+=e),d.isInert()&&(a=f.style,a.pointerEvents="none",a.userSelect="none",f.contentEditable="false",a.setProperty("-webkit-user-select","none"))),N+=e,P+=e;null!==b&&(null!=c?b.insertBefore(f,c):(c=b.__lexicalLineBreak,null!=c?b.insertBefore(f,c):b.appendChild(f)));Qa(pb,fb,ib,d,"created");return f}function xb(a,b,c,d,f){const e=N;for(N="";b<=c;++b)wb(a[b],d,f);d.__lexicalTextContent=N;N=e+N}function Bb(a,b){a=b.get(a[a.length-1]);return ya(a)||u(a)}
32
- function zb(a,b,c){a=null!==a&&(0===a.length||Bb(a,mb));b=null!==b&&(0===b.length||Bb(b,nb));a?b||(b=c.__lexicalLineBreak,null!=b&&c.removeChild(b),c.__lexicalLineBreak=null):b&&(b=document.createElement("br"),c.__lexicalLineBreak=b,c.appendChild(b))}
33
- function yb(a,b){var c=b.__lexicalDir;if(b.__lexicalDirTextContent!==O||c!==jb){const e=""===O;if(e)var d=jb;else d=O,d=aa.test(d)?"rtl":da.test(d)?"ltr":null;if(d!==c){const g=b.classList,h=eb.theme;var f=null!==c?h[c]:void 0;let l=null!==d?h[d]:void 0;void 0!==f&&("string"===typeof f&&(f=f.split(" "),f=h[c]=f),g.remove(...f));null===d||e&&"ltr"===d?b.removeAttribute("dir"):(void 0!==l&&("string"===typeof l&&(c=l.split(" "),l=h[d]=c),g.add(...l)),b.dir=d);hb||(a.getWritable().__dir=d)}jb=d;b.__lexicalDirTextContent=
34
- O;b.__lexicalDir=d}}
35
- function Cb(a,b){var c=mb.get(a),d=nb.get(a);void 0!==c&&void 0!==d||q(43);var f=gb||lb.has(a)||kb.has(a);const e=Db(Q,a);if(c===d&&!f)return C(c)?(d=e.__lexicalTextContent,void 0!==d&&(N+=d,P+=d),d=e.__lexicalDirTextContent,void 0!==d&&(O+=d)):(d=c.getTextContent(),w(c)&&!c.isDirectionless()&&(O+=d),P+=d,N+=d),e;c!==d&&f&&Qa(pb,fb,ib,d,"updated");if(d.updateDOM(c,e,eb))return d=wb(a,null,null),null===b&&q(44),b.replaceChild(d,e),qb(a,null),d;if(C(c)&&C(d)){if(a=d.__indent,a!==c.__indent&&ub(e,a),
36
- a=d.__format,a!==c.__format&&vb(e,a),a=c.__children,c=d.__children,a!==c||f){var g=a,h=c;f=d;b=O;O="";const p=N;N="";var l=g.length,k=h.length;if(1===l&&1===k){var m=g[0];h=h[0];if(m===h)Cb(m,e);else{var n=rb(m);h=wb(h,null,null);e.replaceChild(h,n);qb(m,null)}}else if(0===l)0!==k&&xb(h,0,k-1,e,null);else if(0===k)0!==l&&(m=null==e.__lexicalLineBreak,sb(g,0,l-1,m?null:e),m&&(e.textContent=""));else{const A=l-1;l=k-1;let y=e.firstChild,E=0;for(k=0;E<=A&&k<=l;){var t=g[E];const x=h[k];if(t===x)y=Cb(x,
37
- e).nextSibling,E++,k++;else{void 0===m&&(m=new Set(g));void 0===n&&(n=new Set(h));const G=n.has(t),W=m.has(x);G?(W?(t=Db(Q,x),t===y?y=Cb(x,e).nextSibling:(null!=y?e.insertBefore(t,y):e.appendChild(t),Cb(x,e)),E++):wb(x,e,y),k++):(y=rb(t).nextSibling,qb(t,e),E++)}}m=E>A;n=k>l;m&&!n?(m=h[l+1],m=void 0===m?null:Q.getElementByKey(m),xb(h,k,l,e,m)):n&&!m&&sb(g,E,A,e)}e.__lexicalTextContent=N;N=p+N;yb(f,e);O=b;M(d)||zb(a,c,e)}}else c=d.getTextContent(),u(d)?(f=d.decorate(Q),null!==f&&Ab(a,f)):w(d)&&!d.isDirectionless()&&
38
- (O+=c),N+=c,P+=c;!hb&&M(d)&&d.__cachedText!==P&&(d=d.getWritable(),d.__cachedText=P);return e}function Ab(a,b){let c=Q._pendingDecorators;const d=Q._decorators;if(null===c){if(d[a]===b)return;c=Ea(Q)}c[a]=b}function rb(a){a=ob.get(a);void 0===a&&q(45);return a}function Db(a,b){a=a._keyToDOMMap.get(b);void 0===a&&q(45);return a}let R=null,T=null,U=!1,Eb=!1,Ca=0;function F(){U&&q(25)}function z(){null===R&&q(27);return R}function B(){null===T&&q(28);return T}
39
- function Fb(a,b,c){var d=b.__type;const f=a._nodes.get(d);void 0===f&&q(23,d);a=c.get(d);void 0===a&&(a=Array.from(f.transforms),c.set(d,a));c=a.length;for(d=0;d<c&&(a[d](b),b.isAttached());d++);}function Gb(a,b){b=b._dirtyLeaves;a=a._nodeMap;for(const c of b)b=a.get(c),w(b)&&b.isSimpleText()&&!b.isUnmergeable()&&ab(b)}
40
- function Hb(a,b){const c=b._dirtyLeaves,d=b._dirtyElements;a=a._nodeMap;const f=B()._compositionKey,e=new Map;var g=c;let h=g.size;for(var l=d,k=l.size;0<h||0<k;){if(0<h){b._dirtyLeaves=new Set;for(const m of g)g=a.get(m),w(g)&&g.isSimpleText()&&!g.isUnmergeable()&&ab(g),void 0!==g&&void 0!==g&&g.__key!==f&&g.isAttached()&&Fb(b,g,e),c.add(m);g=b._dirtyLeaves;h=g.size;if(0<h){Ca++;continue}}b._dirtyLeaves=new Set;b._dirtyElements=new Map;for(const m of l)l=m[0],k=m[1],"root"!==l&&k&&(g=a.get(l),void 0!==
41
- g&&void 0!==g&&g.__key!==f&&g.isAttached()&&Fb(b,g,e),d.set(l,k));g=b._dirtyLeaves;h=g.size;l=b._dirtyElements;k=l.size;Ca++}b._dirtyLeaves=c;b._dirtyElements=d}function db(a,b){var c=new Map;c=new Ib(c);const d={originalSelection:a._selection},f=R,e=U,g=T;R=c;U=!1;T=b;try{const h=new Map(a._nodeMap),l=h.get("root");bb(l,h,b,null,d)}finally{R=f,U=e,T=g}c._selection=Jb(d.remappedSelection||d.originalSelection);return c}
42
- function Kb(a){var b=a._pendingEditorState,c=a._rootElement;if(null!==c&&null!==b){var d=a._editorState,f=d._selection,e=b._selection,g=0!==a._dirtyType;a._pendingEditorState=null;a._editorState=b;var h=R,l=U,k=T,m=a._updating;T=a;R=b;U=!1;a._updating=!0;try{var n=a._observer;let ma=null;if(g&&null!==n){var t=a._dirtyType,p=a._dirtyElements,A=a._dirtyLeaves;n.disconnect();try{O=P=N="";gb=2===t;jb=null;Q=a;eb=a._config;fb=a._nodes;ib=Q._listeners.mutation;kb=p;lb=A;mb=d._nodeMap;nb=b._nodeMap;hb=b._readOnly;
43
- ob=new Map(a._keyToDOMMap);const xa=new Map;pb=xa;Cb("root",null);pb=ob=eb=nb=mb=lb=kb=fb=Q=void 0;ma=xa}finally{n.observe(c,{characterData:!0,childList:!0,subtree:!0})}}const Ta=window.getSelection();if(null!==Ta&&(g||null===e||e.dirty)){n=Ta;const xa=n.anchorNode,mc=n.focusNode,td=n.anchorOffset,ud=n.focusOffset,Ua=document.activeElement,ba=a._rootElement;if(!a._updateTags.has("collaboration")||Ua===ba)if(J(e)){var y=e.anchor,E=e.focus,x=E.key,G=Db(a,y.key),W=Db(a,x),nc=y.offset,oc=E.offset;f=G;
44
- x=W;"text"===y.type&&(f=ua(G));"text"===E.type&&(x=ua(W));if(null!==f&&null!==x)if(td!==nc||ud!==oc||xa!==f||mc!==x||"Range"===n.type&&e.isCollapsed())try{if(n.setBaseAndExtent(f,nc,x,oc),e.isCollapsed()&&ba===Ua){const ca=3===f.nodeType?f.parentNode:f;if(null!==ca){const Va=ca.getBoundingClientRect();if(Va.bottom>window.innerHeight)ca.scrollIntoView(!1);else if(0>Va.top)ca.scrollIntoView();else if(ba){const pc=ba.getBoundingClientRect();Va.bottom>pc.bottom?ca.scrollIntoView(!1):Va.top<pc.top&&ca.scrollIntoView()}a._updateTags.add("scroll-into-view")}}}catch(ca){}else null===
45
- ba||null!==Ua&&ba.contains(Ua)||ba.focus({preventScroll:!0})}else null!==f&&ra(a,xa,mc)&&n.removeAllRanges()}var qc=ma;null!==qc&&Lb(a,d,b,qc)}catch(ma){a._onError(ma);Eb||(Mb(a,null,c,b),Nb(a),a._dirtyType=2,Eb=!0,Kb(a),Eb=!1);return}finally{a._updating=m,R=h,U=l,T=k}b._readOnly=!0;c=a._dirtyLeaves;e=a._dirtyElements;h=a._normalizedNodes;l=a._updateTags;g&&(a._dirtyType=0,a._cloneNotNeeded.clear(),a._dirtyLeaves=new Set,a._dirtyElements=new Map,a._normalizedNodes=new Set,a._updateTags=new Set);g=
46
- a._decorators;k=a._pendingDecorators||g;m=b._nodeMap;for(var S in k)m.has(S)||(k===g&&(k=Ea(a)),delete k[S]);S=a._pendingDecorators;null!==S&&(a._decorators=S,a._pendingDecorators=null,Ob("decorator",a,!0,S));S=Fa(d);g=Fa(b);S!==g&&Ob("textcontent",a,!0,g);Ob("update",a,!0,{dirtyElements:e,dirtyLeaves:c,editorState:b,normalizedNodes:h,prevEditorState:d,tags:l});b=a._deferred;a._deferred=[];if(0!==b.length){d=a._updating;a._updating=!0;try{for(S=0;S<b.length;S++)b[S]()}finally{a._updating=d}}b=a._updates;
47
- if(0!==b.length){const [ma,Ta]=b.shift();Pb(a,ma,Ta)}}}function Lb(a,b,c,d){a._listeners.mutation.forEach((f,e)=>{f=d.get(f);void 0!==f&&e(f)})}function Ob(a,b,c,...d){const f=b._updating;b._updating=c;try{const e=Array.from(b._listeners[a]);for(a=0;a<e.length;a++)e[a](...d)}finally{b._updating=f}}
48
- function V(a,b,c){if(!1===a._updating||T!==a){let e=!1;a.update(()=>{e=V(a,b,c)});return e}const d=Ka(a);for(let e=4;0<=e;e--)for(let g=0;g<d.length;g++){var f=d[g]._commands.get(b);if(void 0!==f&&(f=f[e],void 0!==f))for(const h of f)if(!0===h(c,a))return!0}return!1}function Qb(a){const b=a._updates;let c=!1;for(;0!==b.length;){const [d,f]=b.shift();let e,g;void 0!==f&&(e=f.onUpdate,g=f.tag,f.skipTransforms&&(c=!0),e&&a._deferred.push(e),g&&a._updateTags.add(g));d()}return c}
49
- function Pb(a,b,c){const d=a._updateTags;var f=!1;if(void 0!==c){var e=c.onUpdate;f=c.tag;null!=f&&d.add(f);f=c.skipTransforms}e&&a._deferred.push(e);c=a._editorState;e=a._pendingEditorState;let g=!1;null===e&&(e=a._pendingEditorState=new Ib(new Map(c._nodeMap)),g=!0);const h=R,l=U,k=T,m=a._updating;R=e;U=!1;a._updating=!0;T=a;try{g&&(e._selection=Rb(a));const n=a._compositionKey;b();f=Qb(a);Sb(e,a);0!==a._dirtyType&&(f?Gb(e,a):Hb(e,a),Qb(a),Ya(c,e,a._dirtyLeaves,a._dirtyElements));n!==a._compositionKey&&
50
- (e._flushSync=!0);const t=e._selection;if(J(t)){const p=e._nodeMap,A=t.focus.key;void 0!==p.get(t.anchor.key)&&void 0!==p.get(A)||q(30)}else Tb(t)&&0===t._nodes.size&&(e._selection=null)}catch(n){a._onError(n);a._pendingEditorState=c;a._dirtyType=2;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();Kb(a);return}finally{R=h,U=l,T=k,a._updating=m,Ca=0}0!==a._dirtyType||Ub(e,a)?e._flushSync?(e._flushSync=!1,Kb(a)):g&&qa(()=>{Kb(a)}):(e._flushSync=!1,g&&(d.clear(),a._deferred=[],
51
- a._pendingEditorState=null))}function I(a,b,c){a._updating?a._updates.push([b,c]):Pb(a,b,c)}let Vb=!1,Wb=0;function Xb(a){Wb=a.timeStamp}function Yb(a,b,c){return b.__lexicalLineBreak===a||void 0!==a["__lexicalKey_"+c._key]}function Zb(a){return a.getEditorState().read(()=>{const b=K();return null!==b?b.clone():null})}
52
- function $b(a,b,c){Vb=!0;const d=100<performance.now()-Wb;try{I(a,()=>{var f=new Map,e=a.getRootElement(),g=a._editorState;let h=!1,l="";for(var k=0;k<b.length;k++){var m=b[k],n=m.type,t=m.target,p=sa(t,g);if(!u(p))if("characterData"===n){if(d&&3===t.nodeType&&w(p)&&p.isAttached()){m=window.getSelection();var A=n=null;null!==m&&m.anchorNode===t&&(n=m.anchorOffset,A=m.focusOffset);Ma(p,t.nodeValue,n,A,!1)}}else if("childList"===n){h=!0;n=m.addedNodes;for(A=0;A<n.length;A++){var y=n[A],E=Da(y),x=y.parentNode;
53
- null==x||null!==E||"BR"===y.nodeName&&Yb(y,x,a)||(ka&&(E=y.innerText||y.nodeValue)&&(l+=E),x.removeChild(y))}m=m.removedNodes;n=m.length;if(0<n){A=0;for(y=0;y<n;y++)x=m[y],"BR"===x.nodeName&&Yb(x,t,a)&&(t.appendChild(x),A++);n!==A&&(t===e&&(p=g._nodeMap.get("root")),f.set(t,p))}}}if(0<f.size)for(const [G,W]of f)if(C(W))for(f=W.__children,e=G.firstChild,g=0;g<f.length;g++)k=a.getElementByKey(f[g]),null!==k&&(null==e?(G.appendChild(k),e=k):e!==k&&G.replaceChild(k,e),e=e.nextSibling);else w(W)&&W.markDirty();
54
- f=c.takeRecords();if(0<f.length){for(e=0;e<f.length;e++)for(k=f[e],g=k.addedNodes,k=k.target,p=0;p<g.length;p++)t=g[p],m=t.parentNode,null==m||"BR"!==t.nodeName||Yb(t,k,a)||m.removeChild(t);c.takeRecords()}f=K()||Zb(a);null!==f&&(h&&(f.dirty=!0,Ia(f)),ka&&Wa()&&f.insertRawText(l))})}finally{Vb=!1}}function ac(a){const b=a._observer;if(null!==b){const c=b.takeRecords();$b(a,c,b)}}
55
- function Nb(a){0===Wb&&window.addEventListener("textInput",Xb,!0);a._observer=new MutationObserver((b,c)=>{$b(a,b,c)})}
56
- class bc{constructor(a,b,c){this.key=a;this.offset=b;this.type=c}is(a){return this.key===a.key&&this.offset===a.offset&&this.type===a.type}isBefore(a){let b=this.getNode(),c=a.getNode();const d=this.offset;a=a.offset;C(b)&&(b=b.getDescendantByIndex(d));C(c)&&(c=c.getDescendantByIndex(a));return b===c?d<a:b.isBefore(c)}getCharacterOffset(){return"text"===this.type?this.offset:0}getNode(){const a=H(this.key);null===a&&q(5);return a}set(a,b,c){const d=K(),f=this.key;this.key=a;this.offset=b;this.type=
57
- c;U||(B()._compositionKey===f&&D(a),null===d||d.anchor!==this&&d.focus!==this||(d.dirty=!0))}}function X(a,b,c){return new bc(a,b,c)}function cc(a,b){const c=b.__key;let d=a.offset,f="element";w(b)&&(f="text",b=b.getTextContentSize(),d>b&&(d=b));a.set(c,d,f)}function dc(a,b){if(C(b)){const c=b.getLastDescendant();C(c)||w(c)?cc(a,c):cc(a,b)}else w(b)&&cc(a,b)}
58
- function ec(a,b,c){const d=a.getNode(),f=d.getChildAtIndex(a.offset),e=L(),g=M(d)?fc().append(e):e;e.setFormat(c);null===f?d.append(g):f.insertBefore(g);a.is(b)&&b.set(e.__key,0,"text");a.set(e.__key,0,"text")}function Y(a,b,c,d){a.key=b;a.offset=c;a.type=d}
59
- class gc{constructor(a){this.dirty=!1;this._nodes=a}is(a){if(!Tb(a))return!1;const b=this._nodes,c=a._nodes;return b.size===c.size&&Array.from(b).every(d=>c.has(d))}add(a){this.dirty=!0;this._nodes.add(a)}delete(a){this.dirty=!0;this._nodes.delete(a)}clear(){this.dirty=!0;this._nodes.clear()}has(a){return this._nodes.has(a)}clone(){return new gc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}getNodes(){var a=this._nodes;const b=[];for(const c of a)a=H(c),null!==
60
- a&&b.push(a);return b}getTextContent(){const a=this.getNodes();let b="";for(let c=0;c<a.length;c++)b+=a[c].getTextContent();return b}}function J(a){return a instanceof hc}
61
- class ic{constructor(a,b,c){this.gridKey=a;this.anchorCellKey=b;this.anchor=X(b,0,"element");this.focusCellKey=c;this.focus=X(c,0,"element");this.dirty=!1}is(a){return jc(a)?this.gridKey===a.gridKey&&this.anchorCellKey===a.anchorCellKey&&this.focusCellKey===a.focusCellKey:!1}set(a,b,c){this.dirty=!0;this.gridKey=a;this.anchorCellKey=b;this.focusCellKey=c}clone(){return new ic(this.gridKey,this.anchorCellKey,this.focusCellKey)}isCollapsed(){return!1}isBackward(){return this.focus.isBefore(this.anchor)}extract(){return this.getNodes()}insertRawText(){}insertText(){}getShape(){var a=
62
- H(this.anchorCellKey);a||q(74);var b=a.getIndexWithinParent();a=a.getParentOrThrow().getIndexWithinParent();var c=H(this.focusCellKey);c||q(75);var d=c.getIndexWithinParent();const f=c.getParentOrThrow().getIndexWithinParent();c=Math.min(b,d);b=Math.max(b,d);d=Math.min(a,f);a=Math.max(a,f);return{fromX:Math.min(c,b),fromY:Math.min(d,a),toX:Math.max(c,b),toY:Math.max(d,a)}}getNodes(){const a=new Set,{fromX:b,fromY:c,toX:d,toY:f}=this.getShape();var e=H(this.gridKey);kc(e)||q(76);a.add(e);e=e.getChildren();
63
- for(let l=c;l<=f;l++){var g=e[l];a.add(g);lc(g)||q(77);g=g.getChildren();for(let k=b;k<=d;k++){var h=g[k];rc(h)||q(78);a.add(h);for(h=h.getChildren();0<h.length;){const m=h.shift();a.add(m);C(m)&&h.unshift(...m.getChildren())}}}return Array.from(a)}getTextContent(){const a=this.getNodes();let b="";for(let c=0;c<a.length;c++)b+=a[c].getTextContent();return b}}function jc(a){return a instanceof ic}
64
- class hc{constructor(a,b,c){this.anchor=a;this.focus=b;this.dirty=!1;this.format=c}is(a){return J(a)?this.anchor.is(a.anchor)&&this.focus.is(a.focus)&&this.format===a.format:!1}isBackward(){return this.focus.isBefore(this.anchor)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const a=this.anchor,b=this.focus;let c=a.getNode(),d=b.getNode();C(c)&&(c=c.getDescendantByIndex(a.offset));C(d)&&(d=d.getDescendantByIndex(b.offset));return c.is(d)?C(c)?[]:[c]:c.getNodesBetween(d)}setTextNodeRange(a,
65
- b,c,d){Y(this.anchor,a.__key,b,"text");Y(this.focus,c.__key,d,"text");this.dirty=!0}getTextContent(){const a=this.getNodes();if(0===a.length)return"";const b=a[0],c=a[a.length-1];var d=this.anchor,f=this.focus;const e=d.isBefore(f);d=d.getCharacterOffset();f=f.getCharacterOffset();let g="",h=!0;for(let l=0;l<a.length;l++){const k=a[l];if(C(k)&&!k.isInline())h||(g+="\n"),h=k.isEmpty()?!1:!0;else if(h=!1,w(k)){let m=k.getTextContent();k===b?m=k===c?d<f?m.slice(d,f):m.slice(f,d):e?m.slice(d):m.slice(f):
66
- k===c&&(m=e?m.slice(0,f):m.slice(0,d));g+=m}else!u(k)&&!ya(k)||k===c&&this.isCollapsed()||(g+=k.getTextContent())}return g}applyDOMRange(a){const b=B(),c=b.getEditorState()._selection;a=sc(a.startContainer,a.startOffset,a.endContainer,a.endOffset,b,c);if(null!==a){var [d,f]=a;Y(this.anchor,d.key,d.offset,d.type);Y(this.focus,f.key,f.offset,f.type)}}clone(){const a=this.anchor,b=this.focus;return new hc(X(a.key,a.offset,a.type),X(b.key,b.offset,b.type),this.format)}toggleFormat(a){this.format=va(this.format,
67
- a,null);this.dirty=!0}hasFormat(a){return 0!==(this.format&ea[a])}insertRawText(a){const b=a.split(/\r?\n/);if(1===b.length)this.insertText(a);else{a=[];const c=b.length;for(let d=0;d<c;d++){const f=b[d];""!==f&&a.push(L(f));d!==c-1&&a.push(tc())}this.insertNodes(a)}}insertText(a){var b=this.anchor,c=this.focus,d=this.isCollapsed()||b.isBefore(c),f=this.format;d&&"element"===b.type?ec(b,c,f):d||"element"!==c.type||ec(c,b,f);var e=this.getNodes(),g=e.length,h=d?c:b;c=(d?b:c).offset;var l=h.offset;
27
+ a={nodes:[...b],type:"node"}),"node"===a.type&&a.nodes.splice(g,1,e))):"grid"===b.type&&(c=b.gridKey,d=b.anchorCellKey,l=b.focusCellKey,null!=a||c!==g&&c!==d&&c!==l||(f.remappedSelection=a={...b,type:"grid"}),null!=a&&"grid"===a.type&&(c===g&&(a.gridKey=e),d===g&&(a.anchorCellKey=e),l===g&&(a.focusCellKey=e))));return h}
28
+ const eb={},fb={},gb={},hb={},ib={},N={},jb={},kb={},lb={},mb={},O={},nb={},ob={},pb={},qb={},rb={},sb={},tb={},ub={},vb={},wb={},xb={},yb={},zb={},Ab={},Bb={},Cb={},Db={},Eb={},Fb=Object.freeze({}),Lb=[["keydown",Gb],["compositionstart",Hb],["compositionend",Ib],["input",Jb],["click",Kb],["cut",Fb],["copy",Fb],["dragstart",Fb],["paste",Fb],["focus",Fb],["blur",Fb]];la?Lb.push(["beforeinput",Mb]):Lb.push(["drop",Fb]);let Nb=0,Ob=0,Pb=!1;
29
+ function Qb(a,b,c){if(Pb){Pb=!1;const {anchorNode:d,focusNode:f}=a;if(null!==d&&null!==f&&3===d.nodeType&&3===f.nodeType)return}I(b,()=>{if(c){var d=K();if(J(d)&&d.isCollapsed()){"Range"===a.type&&(d.dirty=!0);var f=d.anchor;"text"===f.type?(f=f.getNode(),d.format=f.getFormat()):"element"===f.type&&(d.format=0)}P(b,eb,void 0)}else Ia(null)})}
30
+ function Kb(a,b){I(b,()=>{const c=K();if(J(c)){var d=c.anchor;"element"===d.type&&0===d.offset&&c.isCollapsed()&&1===Ga().getChildrenSize()&&d.getNode().getTopLevelElementOrThrow().isEmpty()&&(d=b.getEditorState()._selection,null!==d&&c.is(d)&&(window.getSelection().removeAllRanges(),c.dirty=!0))}P(b,fb,a)})}function Rb(a,b){b.getTargetRanges&&(b=b.getTargetRanges()[0])&&a.applyDOMRange(b)}function Sb(a,b){return a!==b||C(a)||C(b)||!v(a)||!v(b)}
31
+ function Mb(a,b){const c=a.inputType;if(!("deleteCompositionText"===c||ka&&Ta()))if("insertCompositionText"===c){const d=a.data;d&&I(b,()=>{var f=K();if(J(f)){const e=f.anchor,g=e.getNode(),h=g.getPreviousSibling();0===e.offset&&w(g)&&w(h)&&" "===g.getTextContent()&&h.getFormat()!==f.format&&(f=h.getTextContent(),0===d.indexOf(f)&&(f=d.slice(f.length),P(b,N,f),setTimeout(()=>{I(b,()=>{g.select()})},30)))}})}else I(b,()=>{const d=K();if(J(d))if("deleteContentBackward"===c)D(null),a.preventDefault(),
32
+ Nb=0,P(b,gb,!0),setTimeout(()=>{b.update(()=>{D(null)})},30);else{var f=a.data;d.dirty||!d.isCollapsed()||M(d.anchor.getNode())||Rb(d,a);var e=d.focus,g=d.anchor.getNode();e=e.getNode();if("insertText"===c)"\n"===f?(a.preventDefault(),P(b,hb,void 0)):"\n\n"===f?(a.preventDefault(),P(b,ib,void 0)):null==f&&a.dataTransfer?(f=a.dataTransfer.getData("text/plain"),a.preventDefault(),d.insertRawText(f)):null!=f&&Oa(d,f,!0)&&(a.preventDefault(),P(b,N,f));else switch(a.preventDefault(),c){case "insertFromYank":case "insertFromDrop":case "insertReplacementText":P(b,
33
+ N,a);break;case "insertFromComposition":D(null);P(b,N,a);break;case "insertLineBreak":D(null);P(b,hb,void 0);break;case "insertParagraph":D(null);P(b,ib,void 0);break;case "insertFromPaste":case "insertFromPasteAsQuotation":P(b,jb,a);break;case "deleteByComposition":Sb(g,e)&&P(b,kb,void 0);break;case "deleteByDrag":case "deleteByCut":P(b,kb,void 0);break;case "deleteContent":P(b,gb,!1);break;case "deleteWordBackward":P(b,lb,!0);break;case "deleteWordForward":P(b,lb,!1);break;case "deleteHardLineBackward":case "deleteSoftLineBackward":P(b,
34
+ mb,!0);break;case "deleteContentForward":case "deleteHardLineForward":case "deleteSoftLineForward":P(b,mb,!1);break;case "formatStrikeThrough":P(b,O,"strikethrough");break;case "formatBold":P(b,O,"bold");break;case "formatItalic":P(b,O,"italic");break;case "formatUnderline":P(b,O,"underline");break;case "historyUndo":P(b,nb,void 0);break;case "historyRedo":P(b,ob,void 0)}}})}
35
+ function Jb(a,b){a.stopPropagation();I(b,()=>{var c=K();const d=a.data;null!=d&&J(c)&&Oa(c,d,!1)?(P(b,N,d),null!==b._compositionKey&&(Nb=0,D(null))):La(b,null);F();c=B();Tb(c)})}function Hb(a,b){I(b,()=>{const c=K();if(J(c)&&!b.isComposing()){const d=c.anchor;D(d.key);(a.timeStamp<Nb+30||"element"===d.type||!c.isCollapsed()||c.anchor.getNode().getFormat()!==c.format)&&P(b,N," ")}})}
36
+ function Ib(a,b){I(b,()=>{var c=b._compositionKey;D(null);var d=a.data;if(null!==c&&null!=d){if(""===d){d=G(c);c=ua(b.getElementByKey(c));null!==c&&w(d)&&Ma(d,c.nodeValue,null,null,!0);return}if("\n"===d[d.length-1]&&(c=K(),J(c))){d=c.focus;c.anchor.set(d.key,d.offset,d.type);P(b,tb,null);return}}La(b,a)})}
37
+ function Gb(a,b){Nb=a.timeStamp;if(!b.isComposing()){var {keyCode:c,shiftKey:d,ctrlKey:f,metaKey:e,altKey:g}=a;if(39!==c||f||e||g)if(37!==c||f||e||g)if(38!==c||f||e)if(40!==c||f||e)if(13===c&&d)P(b,tb,a);else if(r&&f&&79===c)a.preventDefault(),P(b,hb,!0);else if(13!==c||d){var h=r?g||e?!1:8===c||72===c&&f:f||g||e?!1:8===c;h?8===c?P(b,ub,a):(a.preventDefault(),P(b,gb,!0)):27===c?P(b,vb,a):(h=r?d||g||e?!1:46===c||68===c&&f:f||g||e?!1:46===c,h?46===c?P(b,wb,a):(a.preventDefault(),P(b,gb,!1)):8===c&&
38
+ (r?g:f)?(a.preventDefault(),P(b,lb,!0)):46===c&&(r?g:f)?(a.preventDefault(),P(b,lb,!1)):r&&e&&8===c?(a.preventDefault(),P(b,mb,!0)):r&&e&&46===c?(a.preventDefault(),P(b,mb,!1)):66===c&&!g&&(r?e:f)?(a.preventDefault(),P(b,O,"bold")):85===c&&!g&&(r?e:f)?(a.preventDefault(),P(b,O,"underline")):73===c&&!g&&(r?e:f)?(a.preventDefault(),P(b,O,"italic")):9!==c||g||f||e?90===c&&!d&&(r?e:f)?(a.preventDefault(),P(b,nb,void 0)):(h=r?90===c&&e&&d:89===c&&f||90===c&&f&&d,h&&(a.preventDefault(),P(b,ob,void 0))):
39
+ P(b,xb,a))}else P(b,tb,a);else P(b,sb,a);else P(b,rb,a);else P(b,qb,a);else P(b,pb,a);(f||d||g||e)&&P(b,Eb,a)}}function Ub(a){let b=a.__lexicalEventHandles;void 0===b&&(b=[],a.__lexicalEventHandles=b);return b}const Vb=new Map;function Wb(){const a=window.getSelection(),b=ta(a.anchorNode);if(null!==b){var c=Ka(b);c=c[c.length-1];var d=c._key,f=Vb.get(d),e=f||c;e!==b&&Qb(a,e,!1);Qb(a,b,!0);b!==c?Vb.set(d,b):f&&Vb.delete(d)}}
40
+ function Xb(a,b){0===Ob&&a.ownerDocument.addEventListener("selectionchange",Wb);Ob++;a.__lexicalEditor=b;const c=Ub(a);for(let d=0;d<Lb.length;d++){const [f,e]=Lb[d],g="function"===typeof e?h=>{b.isReadOnly()||e(h,b)}:h=>{if(!b.isReadOnly())switch(f){case "cut":return P(b,Bb,h);case "copy":return P(b,Ab,h);case "paste":return P(b,jb,h);case "dragstart":return P(b,zb,h);case "focus":return P(b,Cb,h);case "blur":return P(b,Db,h);case "drop":return P(b,yb,h)}};a.addEventListener(f,g);c.push(()=>{a.removeEventListener(f,
41
+ g)})}}let Q="",R="",Yb="",Zb,T,$b,ac=!1,bc=!1,cc,dc=null,ec,fc,gc,hc,ic,jc;function kc(a,b){const c=gc.get(a);if(null!==b){const d=lc(a);b.removeChild(d)}hc.has(a)||T._keyToDOMMap.delete(a);C(c)&&(a=c.__children,mc(a,0,a.length-1,null));void 0!==c&&Qa(jc,$b,cc,c,"destroyed")}function mc(a,b,c,d){for(;b<=c;++b){const f=a[b];void 0!==f&&kc(f,d)}}function nc(a,b){a.setProperty("text-align",b)}function oc(a,b){a.style.setProperty("padding-inline-start",0===b?"":40*b+"px")}
42
+ function pc(a,b){a=a.style;0===b?nc(a,""):1===b?nc(a,"left"):2===b?nc(a,"center"):3===b?nc(a,"right"):4===b&&nc(a,"justify")}
43
+ function qc(a,b,c){const d=hc.get(a);void 0===d&&q(42);const f=d.createDOM(Zb,T);var e=T._keyToDOMMap;f["__lexicalKey_"+T._key]=a;e.set(a,f);w(d)?f.setAttribute("data-lexical-text","true"):t(d)&&f.setAttribute("data-lexical-decorator","true");if(C(d)){a=d.__indent;0!==a&&oc(f,a);a=d.__children;var g=a.length;if(0!==g){e=a;--g;const h=R;R="";rc(e,0,g,f,null);sc(d,f);R=h}e=d.__format;0!==e&&pc(f,e);tc(null,a,f)}else e=d.getTextContent(),t(d)?(g=d.decorate(T),null!==g&&uc(a,g),f.contentEditable="false"):
44
+ w(d)&&(d.isDirectionless()||(R+=e),d.isInert()&&(a=f.style,a.pointerEvents="none",a.userSelect="none",f.contentEditable="false",a.setProperty("-webkit-user-select","none"))),Q+=e,Yb+=e;null!==b&&(null!=c?b.insertBefore(f,c):(c=b.__lexicalLineBreak,null!=c?b.insertBefore(f,c):b.appendChild(f)));Qa(jc,$b,cc,d,"created");return f}function rc(a,b,c,d,f){const e=Q;for(Q="";b<=c;++b)qc(a[b],d,f);d.__lexicalTextContent=Q;Q=e+Q}function vc(a,b){a=b.get(a[a.length-1]);return xa(a)||t(a)}
45
+ function tc(a,b,c){a=null!==a&&(0===a.length||vc(a,gc));b=null!==b&&(0===b.length||vc(b,hc));a?b||(b=c.__lexicalLineBreak,null!=b&&c.removeChild(b),c.__lexicalLineBreak=null):b&&(b=document.createElement("br"),c.__lexicalLineBreak=b,c.appendChild(b))}
46
+ function sc(a,b){var c=b.__lexicalDir;if(b.__lexicalDirTextContent!==R||c!==dc){const e=""===R;if(e)var d=dc;else d=R,d=aa.test(d)?"rtl":ba.test(d)?"ltr":null;if(d!==c){const g=b.classList,h=Zb.theme;var f=null!==c?h[c]:void 0;let l=null!==d?h[d]:void 0;void 0!==f&&("string"===typeof f&&(f=f.split(" "),f=h[c]=f),g.remove(...f));null===d||e&&"ltr"===d?b.removeAttribute("dir"):(void 0!==l&&("string"===typeof l&&(c=l.split(" "),l=h[d]=c),g.add(...l)),b.dir=d);bc||(a.getWritable().__dir=d)}dc=d;b.__lexicalDirTextContent=
47
+ R;b.__lexicalDir=d}}
48
+ function wc(a,b){var c=gc.get(a),d=hc.get(a);void 0!==c&&void 0!==d||q(43);var f=ac||fc.has(a)||ec.has(a);const e=xc(T,a);if(c===d&&!f)return C(c)?(d=e.__lexicalTextContent,void 0!==d&&(Q+=d,Yb+=d),d=e.__lexicalDirTextContent,void 0!==d&&(R+=d)):(d=c.getTextContent(),w(c)&&!c.isDirectionless()&&(R+=d),Yb+=d,Q+=d),e;c!==d&&f&&Qa(jc,$b,cc,d,"updated");if(d.updateDOM(c,e,Zb))return d=qc(a,null,null),null===b&&q(44),b.replaceChild(d,e),kc(a,null),d;if(C(c)&&C(d)){if(a=d.__indent,a!==c.__indent&&oc(e,
49
+ a),a=d.__format,a!==c.__format&&pc(e,a),a=c.__children,c=d.__children,a!==c||f){var g=a,h=c;f=d;b=R;R="";const p=Q;Q="";var l=g.length,k=h.length;if(1===l&&1===k){var m=g[0];h=h[0];if(m===h)wc(m,e);else{var n=lc(m);h=qc(h,null,null);e.replaceChild(h,n);kc(m,null)}}else if(0===l)0!==k&&rc(h,0,k-1,e,null);else if(0===k)0!==l&&(m=null==e.__lexicalLineBreak,mc(g,0,l-1,m?null:e),m&&(e.textContent=""));else{const A=l-1;l=k-1;let y=e.firstChild,E=0;for(k=0;E<=A&&k<=l;){var u=g[E];const x=h[k];if(u===x)y=
50
+ wc(x,e).nextSibling,E++,k++;else{void 0===m&&(m=new Set(g));void 0===n&&(n=new Set(h));const H=n.has(u),W=m.has(x);H?(W?(u=xc(T,x),u===y?y=wc(x,e).nextSibling:(null!=y?e.insertBefore(u,y):e.appendChild(u),wc(x,e)),E++):qc(x,e,y),k++):(y=lc(u).nextSibling,kc(u,e),E++)}}m=E>A;n=k>l;m&&!n?(m=h[l+1],m=void 0===m?null:T.getElementByKey(m),rc(h,k,l,e,m)):n&&!m&&mc(g,E,A,e)}e.__lexicalTextContent=Q;Q=p+Q;sc(f,e);R=b;M(d)||tc(a,c,e)}}else c=d.getTextContent(),t(d)?(f=d.decorate(T),null!==f&&uc(a,f)):w(d)&&
51
+ !d.isDirectionless()&&(R+=c),Q+=c,Yb+=c;!bc&&M(d)&&d.__cachedText!==Yb&&(d=d.getWritable(),d.__cachedText=Yb);return e}function uc(a,b){let c=T._pendingDecorators;const d=T._decorators;if(null===c){if(d[a]===b)return;c=Ea(T)}c[a]=b}function lc(a){a=ic.get(a);void 0===a&&q(45);return a}function xc(a,b){a=a._keyToDOMMap.get(b);void 0===a&&q(45);return a}let U=null,V=null,X=!1,yc=!1,Ba=0;function F(){X&&q(25)}function z(){null===U&&q(27);return U}function B(){null===V&&q(28);return V}
52
+ function zc(a,b,c){var d=b.__type;const f=a._nodes.get(d);void 0===f&&q(23,d);a=c.get(d);void 0===a&&(a=Array.from(f.transforms),c.set(d,a));c=a.length;for(d=0;d<c&&(a[d](b),b.isAttached());d++);}function Ac(a,b){b=b._dirtyLeaves;a=a._nodeMap;for(const c of b)b=a.get(c),w(b)&&b.isSimpleText()&&!b.isUnmergeable()&&ab(b)}
53
+ function Bc(a,b){const c=b._dirtyLeaves,d=b._dirtyElements;a=a._nodeMap;const f=B()._compositionKey,e=new Map;var g=c;let h=g.size;for(var l=d,k=l.size;0<h||0<k;){if(0<h){b._dirtyLeaves=new Set;for(const m of g)g=a.get(m),w(g)&&g.isSimpleText()&&!g.isUnmergeable()&&ab(g),void 0!==g&&void 0!==g&&g.__key!==f&&g.isAttached()&&zc(b,g,e),c.add(m);g=b._dirtyLeaves;h=g.size;if(0<h){Ba++;continue}}b._dirtyLeaves=new Set;b._dirtyElements=new Map;for(const m of l)l=m[0],k=m[1],"root"!==l&&k&&(g=a.get(l),void 0!==
54
+ g&&void 0!==g&&g.__key!==f&&g.isAttached()&&zc(b,g,e),d.set(l,k));g=b._dirtyLeaves;h=g.size;l=b._dirtyElements;k=l.size;Ba++}b._dirtyLeaves=c;b._dirtyElements=d}function db(a,b){var c=new Map;c=new Cc(c);const d={originalSelection:a._selection},f=U,e=X,g=V;U=c;X=!1;V=b;try{const h=new Map(a._nodeMap),l=h.get("root");bb(l,h,b,null,d)}finally{U=f,X=e,V=g}c._selection=Dc(d.remappedSelection||d.originalSelection);return c}
55
+ function Ec(a){var b=a._pendingEditorState,c=a._rootElement;if(null!==c&&null!==b){var d=a._editorState,f=d._selection,e=b._selection,g=0!==a._dirtyType;a._pendingEditorState=null;a._editorState=b;var h=U,l=X,k=V,m=a._updating;V=a;U=b;X=!1;a._updating=!0;try{var n=a._observer;let na=null;if(g&&null!==n){var u=a._dirtyType,p=a._dirtyElements,A=a._dirtyLeaves;n.disconnect();try{R=Yb=Q="";ac=2===u;dc=null;T=a;Zb=a._config;$b=a._nodes;cc=T._listeners.mutation;ec=p;fc=A;gc=d._nodeMap;hc=b._nodeMap;bc=
56
+ b._readOnly;ic=new Map(a._keyToDOMMap);const Ca=new Map;jc=Ca;wc("root",null);jc=ic=Zb=hc=gc=fc=ec=$b=T=void 0;na=Ca}finally{n.observe(c,{characterData:!0,childList:!0,subtree:!0})}}const Xa=window.getSelection();if(!a._readOnly&&null!==Xa&&(g||null===e||e.dirty)){n=Xa;const Ca=n.anchorNode,Jc=n.focusNode,Fd=n.anchorOffset,Gd=n.focusOffset,Ya=document.activeElement,da=a._rootElement;if(!a._updateTags.has("collaboration")||Ya===da)if(J(e)){var y=e.anchor,E=e.focus,x=E.key,H=xc(a,y.key),W=xc(a,x),Kc=
57
+ y.offset,Lc=E.offset;f=H;x=W;"text"===y.type&&(f=ua(H));"text"===E.type&&(x=ua(W));if(null!==f&&null!==x)if(Fd!==Kc||Gd!==Lc||Ca!==f||Jc!==x||"Range"===n.type&&e.isCollapsed())try{n.setBaseAndExtent(f,Kc,x,Lc);if(e.isCollapsed()&&da===Ya){const ea=3===f.nodeType?f.parentNode:f;if(null!==ea){const Za=ea.getBoundingClientRect();if(Za.bottom>window.innerHeight)ea.scrollIntoView(!1);else if(0>Za.top)ea.scrollIntoView();else if(da){const Mc=da.getBoundingClientRect();Za.bottom>Mc.bottom?ea.scrollIntoView(!1):
58
+ Za.top<Mc.top&&ea.scrollIntoView()}a._updateTags.add("scroll-into-view")}}Pb=!0}catch(ea){}else null===da||null!==Ya&&da.contains(Ya)||da.focus({preventScroll:!0})}else null!==f&&ra(a,Ca,Jc)&&n.removeAllRanges()}var Nc=na;null!==Nc&&Fc(a,d,b,Nc)}catch(na){a._onError(na);yc||(Gc(a,null,c,b),Hc(a),a._dirtyType=2,yc=!0,Ec(a),yc=!1);return}finally{a._updating=m,U=h,X=l,V=k}b._readOnly=!0;c=a._dirtyLeaves;e=a._dirtyElements;h=a._normalizedNodes;l=a._updateTags;g&&(a._dirtyType=0,a._cloneNotNeeded.clear(),
59
+ a._dirtyLeaves=new Set,a._dirtyElements=new Map,a._normalizedNodes=new Set,a._updateTags=new Set);g=a._decorators;k=a._pendingDecorators||g;m=b._nodeMap;for(var S in k)m.has(S)||(k===g&&(k=Ea(a)),delete k[S]);S=a._pendingDecorators;null!==S&&(a._decorators=S,a._pendingDecorators=null,Ic("decorator",a,!0,S));S=Fa(d);g=Fa(b);S!==g&&Ic("textcontent",a,!0,g);Ic("update",a,!0,{dirtyElements:e,dirtyLeaves:c,editorState:b,normalizedNodes:h,prevEditorState:d,tags:l});b=a._deferred;a._deferred=[];if(0!==b.length){d=
60
+ a._updating;a._updating=!0;try{for(S=0;S<b.length;S++)b[S]()}finally{a._updating=d}}b=a._updates;if(0!==b.length){const [na,Xa]=b.shift();Oc(a,na,Xa)}}}function Fc(a,b,c,d){a._listeners.mutation.forEach((f,e)=>{f=d.get(f);void 0!==f&&e(f)})}function Ic(a,b,c,...d){const f=b._updating;b._updating=c;try{const e=Array.from(b._listeners[a]);for(a=0;a<e.length;a++)e[a](...d)}finally{b._updating=f}}
61
+ function P(a,b,c){if(!1===a._updating||V!==a){let e=!1;a.update(()=>{e=P(a,b,c)});return e}const d=Ka(a);for(let e=4;0<=e;e--)for(let g=0;g<d.length;g++){var f=d[g]._commands.get(b);if(void 0!==f&&(f=f[e],void 0!==f))for(const h of f)if(!0===h(c,a))return!0}return!1}function Pc(a){const b=a._updates;let c=!1;for(;0!==b.length;){const [d,f]=b.shift();let e,g;void 0!==f&&(e=f.onUpdate,g=f.tag,f.skipTransforms&&(c=!0),e&&a._deferred.push(e),g&&a._updateTags.add(g));d()}return c}
62
+ function Oc(a,b,c){const d=a._updateTags;var f=!1;if(void 0!==c){var e=c.onUpdate;f=c.tag;null!=f&&d.add(f);f=c.skipTransforms}e&&a._deferred.push(e);c=a._editorState;e=a._pendingEditorState;let g=!1;null===e&&(e=a._pendingEditorState=new Cc(new Map(c._nodeMap)),g=!0);const h=U,l=X,k=V,m=a._updating;U=e;X=!1;a._updating=!0;V=a;try{g&&(e._selection=Qc(a));const n=a._compositionKey;b();f=Pc(a);Rc(e,a);0!==a._dirtyType&&(f?Ac(e,a):Bc(e,a),Pc(a),Va(c,e,a._dirtyLeaves,a._dirtyElements));n!==a._compositionKey&&
63
+ (e._flushSync=!0);const u=e._selection;if(J(u)){const p=e._nodeMap,A=u.focus.key;void 0!==p.get(u.anchor.key)&&void 0!==p.get(A)||q(30)}else Sc(u)&&0===u._nodes.size&&(e._selection=null)}catch(n){a._onError(n);a._pendingEditorState=c;a._dirtyType=2;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();Ec(a);return}finally{U=h,X=l,V=k,a._updating=m,Ba=0}0!==a._dirtyType||Tc(e,a)?e._flushSync?(e._flushSync=!1,Ec(a)):g&&qa(()=>{Ec(a)}):(e._flushSync=!1,g&&(d.clear(),a._deferred=[],
64
+ a._pendingEditorState=null))}function I(a,b,c){a._updating?a._updates.push([b,c]):Oc(a,b,c)}let Uc=!1,Vc=0;function Wc(a){Vc=a.timeStamp}function Xc(a,b,c){return b.__lexicalLineBreak===a||void 0!==a["__lexicalKey_"+c._key]}function Yc(a){return a.getEditorState().read(()=>{const b=K();return null!==b?b.clone():null})}
65
+ function Zc(a,b,c){Uc=!0;const d=100<performance.now()-Vc;try{I(a,()=>{var f=new Map,e=a.getRootElement(),g=a._editorState;let h=!1,l="";for(var k=0;k<b.length;k++){var m=b[k],n=m.type,u=m.target,p=sa(u,g);if(!t(p))if("characterData"===n){if(d&&3===u.nodeType&&w(p)&&p.isAttached()){m=window.getSelection();var A=n=null;null!==m&&m.anchorNode===u&&(n=m.anchorOffset,A=m.focusOffset);Ma(p,u.nodeValue,n,A,!1)}}else if("childList"===n){h=!0;n=m.addedNodes;for(A=0;A<n.length;A++){var y=n[A],E=Da(y),x=y.parentNode;
66
+ null==x||null!==E||"BR"===y.nodeName&&Xc(y,x,a)||(ka&&(E=y.innerText||y.nodeValue)&&(l+=E),x.removeChild(y))}m=m.removedNodes;n=m.length;if(0<n){A=0;for(y=0;y<n;y++)x=m[y],"BR"===x.nodeName&&Xc(x,u,a)&&(u.appendChild(x),A++);n!==A&&(u===e&&(p=g._nodeMap.get("root")),f.set(u,p))}}}if(0<f.size)for(const [H,W]of f)if(C(W))for(f=W.__children,e=H.firstChild,g=0;g<f.length;g++)k=a.getElementByKey(f[g]),null!==k&&(null==e?(H.appendChild(k),e=k):e!==k&&H.replaceChild(k,e),e=e.nextSibling);else w(W)&&W.markDirty();
67
+ f=c.takeRecords();if(0<f.length){for(e=0;e<f.length;e++)for(k=f[e],g=k.addedNodes,k=k.target,p=0;p<g.length;p++)u=g[p],m=u.parentNode,null==m||"BR"!==u.nodeName||Xc(u,k,a)||m.removeChild(u);c.takeRecords()}f=K()||Yc(a);null!==f&&(h&&(f.dirty=!0,Ia(f)),ka&&Ta()&&f.insertRawText(l))})}finally{Uc=!1}}function Tb(a){const b=a._observer;if(null!==b){const c=b.takeRecords();Zc(a,c,b)}}
68
+ function Hc(a){0===Vc&&window.addEventListener("textInput",Wc,!0);a._observer=new MutationObserver((b,c)=>{Zc(a,b,c)})}
69
+ class $c{constructor(a,b,c){this.key=a;this.offset=b;this.type=c}is(a){return this.key===a.key&&this.offset===a.offset&&this.type===a.type}isBefore(a){let b=this.getNode(),c=a.getNode();const d=this.offset;a=a.offset;C(b)&&(b=b.getDescendantByIndex(d));C(c)&&(c=c.getDescendantByIndex(a));return b===c?d<a:b.isBefore(c)}getCharacterOffset(){return"text"===this.type?this.offset:0}getNode(){const a=G(this.key);null===a&&q(5);return a}set(a,b,c){const d=K(),f=this.key;this.key=a;this.offset=b;this.type=
70
+ c;X||(B()._compositionKey===f&&D(a),null===d||d.anchor!==this&&d.focus!==this||(d.dirty=!0))}}function Y(a,b,c){return new $c(a,b,c)}function ad(a,b){const c=b.__key;let d=a.offset,f="element";w(b)&&(f="text",b=b.getTextContentSize(),d>b&&(d=b));a.set(c,d,f)}function bd(a,b){if(C(b)){const c=b.getLastDescendant();C(c)||w(c)?ad(a,c):ad(a,b)}else w(b)&&ad(a,b)}
71
+ function cd(a,b,c){const d=a.getNode(),f=d.getChildAtIndex(a.offset),e=L(),g=M(d)?dd().append(e):e;e.setFormat(c);null===f?d.append(g):f.insertBefore(g);a.is(b)&&b.set(e.__key,0,"text");a.set(e.__key,0,"text")}function Z(a,b,c,d){a.key=b;a.offset=c;a.type=d}
72
+ class ed{constructor(a){this.dirty=!1;this._nodes=a}is(a){if(!Sc(a))return!1;const b=this._nodes,c=a._nodes;return b.size===c.size&&Array.from(b).every(d=>c.has(d))}add(a){this.dirty=!0;this._nodes.add(a)}delete(a){this.dirty=!0;this._nodes.delete(a)}clear(){this.dirty=!0;this._nodes.clear()}has(a){return this._nodes.has(a)}clone(){return new ed(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}getNodes(){var a=this._nodes;const b=[];for(const c of a)a=G(c),null!==
73
+ a&&b.push(a);return b}getTextContent(){const a=this.getNodes();let b="";for(let c=0;c<a.length;c++)b+=a[c].getTextContent();return b}}function J(a){return a instanceof fd}
74
+ class gd{constructor(a,b,c){this.gridKey=a;this.anchorCellKey=b;this.anchor=Y(b,0,"element");this.focusCellKey=c;this.focus=Y(c,0,"element");this.dirty=!1}is(a){return hd(a)?this.gridKey===a.gridKey&&this.anchorCellKey===a.anchorCellKey&&this.focusCellKey===a.focusCellKey:!1}set(a,b,c){this.dirty=!0;this.gridKey=a;this.anchorCellKey=b;this.focusCellKey=c}clone(){return new gd(this.gridKey,this.anchorCellKey,this.focusCellKey)}isCollapsed(){return!1}isBackward(){return this.focus.isBefore(this.anchor)}extract(){return this.getNodes()}insertRawText(){}insertText(){}getShape(){var a=
75
+ G(this.anchorCellKey);a||q(74);var b=a.getIndexWithinParent();a=a.getParentOrThrow().getIndexWithinParent();var c=G(this.focusCellKey);c||q(75);var d=c.getIndexWithinParent();const f=c.getParentOrThrow().getIndexWithinParent();c=Math.min(b,d);b=Math.max(b,d);d=Math.min(a,f);a=Math.max(a,f);return{fromX:Math.min(c,b),fromY:Math.min(d,a),toX:Math.max(c,b),toY:Math.max(d,a)}}getNodes(){const a=new Set,{fromX:b,fromY:c,toX:d,toY:f}=this.getShape();var e=G(this.gridKey);id(e)||q(76);a.add(e);e=e.getChildren();
76
+ for(let l=c;l<=f;l++){var g=e[l];a.add(g);jd(g)||q(77);g=g.getChildren();for(let k=b;k<=d;k++){var h=g[k];kd(h)||q(78);a.add(h);for(h=h.getChildren();0<h.length;){const m=h.shift();a.add(m);C(m)&&h.unshift(...m.getChildren())}}}return Array.from(a)}getTextContent(){const a=this.getNodes();let b="";for(let c=0;c<a.length;c++)b+=a[c].getTextContent();return b}}function hd(a){return a instanceof gd}
77
+ class fd{constructor(a,b,c){this.anchor=a;this.focus=b;this.dirty=!1;this.format=c}is(a){return J(a)?this.anchor.is(a.anchor)&&this.focus.is(a.focus)&&this.format===a.format:!1}isBackward(){return this.focus.isBefore(this.anchor)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const a=this.anchor,b=this.focus;let c=a.getNode(),d=b.getNode();C(c)&&(c=c.getDescendantByIndex(a.offset));C(d)&&(d=d.getDescendantByIndex(b.offset));return c.is(d)?C(c)?[]:[c]:c.getNodesBetween(d)}setTextNodeRange(a,
78
+ b,c,d){Z(this.anchor,a.__key,b,"text");Z(this.focus,c.__key,d,"text");this.dirty=!0}getTextContent(){const a=this.getNodes();if(0===a.length)return"";const b=a[0],c=a[a.length-1];var d=this.anchor,f=this.focus;const e=d.isBefore(f);d=d.getCharacterOffset();f=f.getCharacterOffset();let g="",h=!0;for(let l=0;l<a.length;l++){const k=a[l];if(C(k)&&!k.isInline())h||(g+="\n"),h=k.isEmpty()?!1:!0;else if(h=!1,w(k)){let m=k.getTextContent();k===b?m=k===c?d<f?m.slice(d,f):m.slice(f,d):e?m.slice(d):m.slice(f):
79
+ k===c&&(m=e?m.slice(0,f):m.slice(0,d));g+=m}else!t(k)&&!xa(k)||k===c&&this.isCollapsed()||(g+=k.getTextContent())}return g}applyDOMRange(a){const b=B(),c=b.getEditorState()._selection;a=ld(a.startContainer,a.startOffset,a.endContainer,a.endOffset,b,c);if(null!==a){var [d,f]=a;Z(this.anchor,d.key,d.offset,d.type);Z(this.focus,f.key,f.offset,f.type)}}clone(){const a=this.anchor,b=this.focus;return new fd(Y(a.key,a.offset,a.type),Y(b.key,b.offset,b.type),this.format)}toggleFormat(a){this.format=va(this.format,
80
+ a,null);this.dirty=!0}hasFormat(a){return 0!==(this.format&ca[a])}insertRawText(a){const b=a.split(/\r?\n/);if(1===b.length)this.insertText(a);else{a=[];const c=b.length;for(let d=0;d<c;d++){const f=b[d];""!==f&&a.push(L(f));d!==c-1&&a.push(md())}this.insertNodes(a)}}insertText(a){var b=this.anchor,c=this.focus,d=this.isCollapsed()||b.isBefore(c),f=this.format;d&&"element"===b.type?cd(b,c,f):d||"element"!==c.type||cd(c,b,f);var e=this.getNodes(),g=e.length,h=d?c:b;c=(d?b:c).offset;var l=h.offset;
68
81
  b=e[0];w(b)||q(6);d=b.getTextContent().length;var k=b.getParentOrThrow();if(!this.isCollapsed()||c!==d||!b.isSegmented()&&!b.isToken()&&b.canInsertTextAfter()&&k.canInsertTextAfter())if(!this.isCollapsed()||0!==c||!b.isSegmented()&&!b.isToken()&&b.canInsertTextBefore()&&k.canInsertTextBefore())b.isSegmented()&&c!==d&&(k=L(b.getTextContent()),b.replace(k),b=k);else{m=b.getPreviousSibling();if(!w(m)||v(m)||m.isSegmented())m=L(),k.canInsertTextBefore()?b.insertBefore(m):k.insertBefore(m);m.select();
69
82
  b=m;if(""!==a){this.insertText(a);return}}else{var m=b.getNextSibling();if(!w(m)||v(m)||m.isSegmented())m=L(),k.canInsertTextAfter()?b.insertAfter(m):k.insertAfter(m);m.select(0,0);b=m;if(""!==a){this.insertText(a);return}}if(1===g)if(v(b))a=L(a),a.select(),b.replace(a);else{e=b.getFormat();if(c===l&&e!==f)if(""===b.getTextContent())b.setFormat(f);else{e=L(a);e.setFormat(f);e.select();0===c?b.insertBefore(e):([g]=b.splitText(c),g.insertAfter(e));e.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=
70
83
  a.length);return}b=b.spliceText(c,l-c,a,!0);""===b.getTextContent()?b.remove():b.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=a.length)}else{k=e[g-1];f=new Set([...b.getParentKeys(),...k.getParentKeys()]);var n=C(b)?b:b.getParentOrThrow();m=C(k)?k:k.getParentOrThrow();"text"===h.type&&(0!==l||""===k.getTextContent())||"element"===h.type&&k.getIndexWithinParent()<l?w(k)&&!v(k)&&l!==k.getTextContentSize()?(k.isSegmented()&&(h=L(k.getTextContent()),k.replace(h),k=h),k=k.spliceText(0,
71
- l,""),f.add(k.__key)):k.remove():f.add(k.__key);h=m.getChildren();l=new Set(e);const t=n.is(m);if(m.canBeEmpty()||n===m){for(n=h.length-1;0<=n;n--){const p=h[n];if(p.is(b)||C(p)&&p.isParentOf(b))break;p.isAttached()&&(!l.has(p)||p.is(k)?t||b.insertAfter(p):p.remove())}if(!t)for(h=m,l=null;null!==h;){k=h.getChildren();m=k.length;if(0===m||k[m-1].is(l))f.delete(h.__key),l=h;h=h.getParent()}}else n.append(m);v(b)?c===d?b.select():(a=L(a),a.select(),b.replace(a)):(b=b.spliceText(c,d-c,a,!0),""===b.getTextContent()?
72
- b.remove():b.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=a.length));for(a=1;a<g;a++)b=e[a],f.has(b.__key)||b.remove()}}removeText(){this.insertText("")}formatText(a){const b=this.getNodes(),c=b.length-1;let d=b[0],f=b[c];if(this.isCollapsed())this.toggleFormat(a),D(null);else{var e=this.anchor,g=this.focus,h=d.getTextContent().length,l=g.offset,k=0;for(var m=0;m<b.length;m++){var n=b[m];if(w(n)){k=n.getFormatFlags(a,null);break}}var t=e.offset;n=(m=e.isBefore(g))?t:l;m=m?l:t;if(n===
73
- d.getTextContentSize()){const p=d.getNextSibling();w(p)&&(n=t=0,d=p,k=d.getFormatFlags(a,null))}if(d.is(f))w(d)&&("element"===e.type&&"element"===g.type?(d.setFormat(k),d.select(n,m),this.format=k):(n=t>l?l:t,m=t>l?t:l,n!==m&&(0===n&&m===h?(d.setFormat(k),d.select(n,m)):(a=d.splitText(n,m),a=0===n?a[0]:a[1],a.setFormat(k),a.select(0,m-n)),this.format=k)));else for(w(d)&&(0!==n&&([,d]=d.splitText(n)),d.setFormat(k)),e=k,w(f)&&(e=f.getFormatFlags(a,k),k=f.getTextContent().length,0!==m&&(m!==k&&([f]=
84
+ l,""),f.add(k.__key)):k.remove():f.add(k.__key);h=m.getChildren();l=new Set(e);const u=n.is(m);if(m.canBeEmpty()||n===m){for(n=h.length-1;0<=n;n--){const p=h[n];if(p.is(b)||C(p)&&p.isParentOf(b))break;p.isAttached()&&(!l.has(p)||p.is(k)?u||b.insertAfter(p):p.remove())}if(!u)for(h=m,l=null;null!==h;){k=h.getChildren();m=k.length;if(0===m||k[m-1].is(l))f.delete(h.__key),l=h;h=h.getParent()}}else n.append(m);v(b)?c===d?b.select():(a=L(a),a.select(),b.replace(a)):(b=b.spliceText(c,d-c,a,!0),""===b.getTextContent()?
85
+ b.remove():b.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=a.length));for(a=1;a<g;a++)b=e[a],f.has(b.__key)||b.remove()}}removeText(){this.insertText("")}formatText(a){const b=this.getNodes(),c=b.length-1;let d=b[0],f=b[c];if(this.isCollapsed())this.toggleFormat(a),D(null);else{var e=this.anchor,g=this.focus,h=d.getTextContent().length,l=g.offset,k=0;for(var m=0;m<b.length;m++){var n=b[m];if(w(n)){k=n.getFormatFlags(a,null);break}}var u=e.offset;n=(m=e.isBefore(g))?u:l;m=m?l:u;if(n===
86
+ d.getTextContentSize()){const p=d.getNextSibling();w(p)&&(n=u=0,d=p,k=d.getFormatFlags(a,null))}if(d.is(f))w(d)&&("element"===e.type&&"element"===g.type?(d.setFormat(k),d.select(n,m),this.format=k):(n=u>l?l:u,m=u>l?u:l,n!==m&&(0===n&&m===h?(d.setFormat(k),d.select(n,m)):(a=d.splitText(n,m),a=0===n?a[0]:a[1],a.setFormat(k),a.select(0,m-n)),this.format=k)));else for(w(d)&&(0!==n&&([,d]=d.splitText(n)),d.setFormat(k)),e=k,w(f)&&(e=f.getFormatFlags(a,k),k=f.getTextContent().length,0!==m&&(m!==k&&([f]=
74
87
  f.splitText(m)),f.setFormat(e))),k=1;k<c;k++)m=b[k],g=m.__key,w(m)&&g!==d.__key&&g!==f.__key&&!m.isToken()&&(g=m.getFormatFlags(a,e),m.setFormat(g))}}insertNodes(a,b){this.isCollapsed()||this.removeText();var c=this.anchor,d=c.offset,f=c.getNode(),e=f;"element"===c.type&&(e=c.getNode(),c=e.getChildAtIndex(d-1),e=null===c?e:c);c=[];var g=f.getNextSiblings(),h=M(f)?null:f.getTopLevelElementOrThrow();if(w(f))if(e=f.getTextContent().length,0===d&&0!==e)e=f.getPreviousSibling(),e=null!==e?e:f.getParentOrThrow(),
75
- c.push(f);else if(d===e)e=f;else{if(v(f))return!1;[e,f]=f.splitText(d);c.push(f)}const l=e;c.push(...g);g=a[0];var k=!1;f=null;for(let t=0;t<a.length;t++){const p=a[t];if(C(p)){if(p.is(g)){if(C(e)&&e.isEmpty()&&e.canReplaceWith(p)){e.replace(p);e=p;k=!0;continue}var m=p.getFirstDescendant();if(wa(m)){for(m=m.getParentOrThrow();m.isInline();)m=m.getParentOrThrow();k=m.getChildren();var n=k.length;if(C(e))for(let A=0;A<n;A++)f=k[A],e.append(f);else{for(--n;0<=n;n--)f=k[n],e.insertAfter(f);e=e.getParentOrThrow()}m.remove();
76
- k=!0;if(m.is(p))continue}}w(e)&&(null===h&&q(69),e=h)}else k&&!u(p)&&M(e.getParent())&&q(7);k=!1;if(C(e))if(f=p,u(p)&&p.isTopLevel())e=e.insertAfter(p);else if(C(p)){if(p.canBeEmpty()||!p.isEmpty())M(e)?(m=e.getChildAtIndex(d),null!==m?m.insertBefore(p):e.append(p),e=p):e=e.insertAfter(p)}else m=e.getFirstChild(),null!==m?m.insertBefore(p):e.append(p),e=p;else!C(p)||u(e)&&e.isTopLevel()?(f=p,e=e.insertAfter(p)):(e=p.getParentOrThrow(),t--)}b&&(w(l)?l.select():(a=e.getPreviousSibling(),w(a)?a.select():
88
+ c.push(f);else if(d===e)e=f;else{if(v(f))return!1;[e,f]=f.splitText(d);c.push(f)}const l=e;c.push(...g);g=a[0];var k=!1;f=null;for(let u=0;u<a.length;u++){const p=a[u];if(C(p)){if(p.is(g)){if(C(e)&&e.isEmpty()&&e.canReplaceWith(p)){e.replace(p);e=p;k=!0;continue}var m=p.getFirstDescendant();if(wa(m)){for(m=m.getParentOrThrow();m.isInline();)m=m.getParentOrThrow();k=m.getChildren();var n=k.length;if(C(e))for(let A=0;A<n;A++)f=k[A],e.append(f);else{for(--n;0<=n;n--)f=k[n],e.insertAfter(f);e=e.getParentOrThrow()}m.remove();
89
+ k=!0;if(m.is(p))continue}}w(e)&&(null===h&&q(69),e=h)}else k&&!t(p)&&M(e.getParent())&&q(7);k=!1;if(C(e))if(f=p,t(p)&&p.isTopLevel())e=e.insertAfter(p);else if(C(p)){if(p.canBeEmpty()||!p.isEmpty())M(e)?(m=e.getChildAtIndex(d),null!==m?m.insertBefore(p):e.append(p),e=p):e=e.insertAfter(p)}else m=e.getFirstChild(),null!==m?m.insertBefore(p):e.append(p),e=p;else!C(p)||t(e)&&e.isTopLevel()?(f=p,e=e.insertAfter(p)):(e=p.getParentOrThrow(),u--)}b&&(w(l)?l.select():(a=e.getPreviousSibling(),w(a)?a.select():
77
90
  (a=e.getIndexWithinParent(),e.getParentOrThrow().select(a,a))));if(C(e)){if(a=w(f)?f:e.getLastDescendant(),b||(null===a?e.select():w(a)?a.select():a.selectNext()),0!==c.length)for(b=c.length-1;0<=b;b--)a=c[b],d=a.getParentOrThrow(),C(e)&&!C(a)?(e.append(a),e=a):C(e)||C(a)?C(a)&&!a.canInsertAfter(e)?(h=d.constructor.clone(d),C(h)||q(8),h.append(a),e.insertAfter(h)):e.insertAfter(a):(e.insertBefore(a),e=a),d.isEmpty()&&!d.canBeEmpty()&&d.remove()}else b||(w(e)?e.select():(c=e.getParentOrThrow(),e=e.getIndexWithinParent()+
78
- 1,c.select(e,e)));return!0}insertParagraph(){this.isCollapsed()||this.removeText();var a=this.anchor,b=a.offset;if("text"===a.type){var c=a.getNode(),d=c.getTextContent().length;a=c.getNextSiblings().reverse();var f=c.getParentOrThrow();0===b?a.push(c):b!==d&&([,c]=c.splitText(b),a.push(c))}else{f=a.getNode();if(M(f)){a=fc();b=f.getChildAtIndex(b);a.select();null!==b?b.insertBefore(a):f.append(a);return}a=f.getChildren().slice(b).reverse()}c=f.insertNewAfter(this);if(null===c)this.insertLineBreak();
79
- else if(C(c))if(d=a.length,0===b&&0<d)f.insertBefore(c);else{b=null;if(0!==d)for(f=0;f<d;f++){const e=a[f];null===b?c.append(e):b.insertBefore(e);b=e}c.canBeEmpty()||0!==c.getChildrenSize()?c.selectStart():(c.selectPrevious(),c.remove())}}insertLineBreak(a){const b=tc();var c=this.anchor;"element"===c.type&&(c=c.getNode(),M(c)&&this.insertParagraph());a?this.insertNodes([b],!0):this.insertNodes([b])&&b.selectNext(0,0)}extract(){var a=this.getNodes(),b=a.length,c=b-1,d=this.anchor;const f=this.focus;
80
- var e=a[0];let g=a[c];var h=d.getCharacterOffset();const l=f.getCharacterOffset();if(0===b)return[];if(1===b)return w(e)?(a=h>l?l:h,c=e.splitText(a,h>l?h:l),a=0===a?c[0]:c[1],null!=a?[a]:[]):[e];b=d.isBefore(f);w(e)&&(d=b?h:l,d===e.getTextContentSize()?a.shift():0!==d&&([,e]=e.splitText(d),a[0]=e));w(g)&&(e=g.getTextContent().length,h=b?l:h,0===h?a.pop():h!==e&&([g]=g.splitText(h),a[c]=g));return a}modify(a,b,c){var d=this.focus,f=this.anchor,e="move"===a;const g=Sa(d,b);if(u(g)&&!g.isIsolated()){var h=
81
- b?g.getPreviousSibling():g.getNextSibling();if(!w(h)){a=g.getParentOrThrow();C(h)?(a=h.__key,h=b?h.getChildrenSize():0):(h=g.getIndexWithinParent(),a=a.__key,b||h++);d.set(a,h,"element");e&&f.set(a,h,"element");return}}d=window.getSelection();d.modify(a,b?"backward":"forward",c);0<d.rangeCount&&(b=d.getRangeAt(0),this.applyDOMRange(b),e||d.anchorNode===b.startContainer&&d.anchorOffset===b.startOffset||(e=this.focus,b=this.anchor,d=b.key,f=b.offset,h=b.type,Y(b,e.key,e.offset,e.type),Y(e,d,f,h)))}deleteCharacter(a){if(this.isCollapsed()){var b=
82
- this.anchor,c=this.focus,d=b.getNode();if(!a&&("element"===b.type&&b.offset===d.getChildrenSize()||"text"===b.type&&b.offset===d.getTextContentSize())&&(d=d.getNextSibling()||d.getParentOrThrow().getNextSibling(),C(d)&&!d.canExtractContents()))return;this.modify("extend",a,"character");if(!this.isCollapsed()){var f="text"===c.type?c.getNode():null;d="text"===b.type?b.getNode():null;if(null!==f&&f.isSegmented()){if(b=c.offset,c=f.getTextContentSize(),f.is(d)||a&&b!==c||!a&&0!==b){uc(f,a,b);return}}else if(null!==
83
- d&&d.isSegmented()&&(b=b.offset,c=d.getTextContentSize(),d.is(f)||a&&0!==b||!a&&b!==c)){uc(d,a,b);return}d=this.anchor;f=this.focus;b=d.getNode();c=f.getNode();if(b===c&&"text"===d.type&&"text"===f.type){var e=d.offset,g=f.offset;const h=e<g;c=h?e:g;g=h?g:e;e=g-1;c!==e&&(b=b.getTextContent().slice(c,g),/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(b)||(a?f.offset=e:d.offset=e))}}else if(a&&0===b.offset&&("element"===b.type?b.getNode():b.getNode().getParentOrThrow()).collapseAtStart(this))return}this.removeText()}deleteLine(a){this.isCollapsed()&&
84
- this.modify("extend",a,"lineboundary");this.removeText()}deleteWord(a){this.isCollapsed()&&this.modify("extend",a,"word");this.removeText()}}function Tb(a){return a instanceof gc}function uc(a,b,c){const d=a.getTextContent().split(/\s/g),f=d.length;let e=0,g=0;for(let h=0;h<f;h++){const l=d[h],k=h===f-1;g=e;e+=l.length;if(b&&e===c||e>c||k){d.splice(h,1);k&&(g=void 0);break}}b=d.join(" ");""===b?a.remove():(a.setTextContent(b),a.select(g,g))}
85
- function vc(a,b,c){var d=b;if(1===a.nodeType){let g=!1;var f=a.childNodes;var e=f.length;d===e&&(g=!0,d=e-1);f=Ja(f[d]);if(w(f))d=g?f.getTextContentSize():0;else{e=Ja(a);if(null===e)return null;if(C(e)){a=e.getChildAtIndex(d);if(b=C(a))b=a.getParent(),b=null===c||null===b||!b.canBeEmpty()||b!==c.getNode();b&&(c=g?a.getLastDescendant():a.getFirstDescendant(),null===c?(e=a,d=0):(a=c,e=a.getParentOrThrow()));w(a)?(f=a,e=null,d=g?f.getTextContentSize():0):a!==e&&g&&d++}else d=e.getIndexWithinParent(),
86
- d=0===b&&u(e)&&Ja(a)===e?d:d+1,e=e.getParentOrThrow();if(C(e))return X(e.__key,d,"element")}}else f=Ja(a);return w(f)?X(f.__key,d,"text"):null}
87
- function sc(a,b,c,d,f,e){if(null===a||null===c||!ra(f,a,c))return null;a=vc(a,b,J(e)?e.anchor:null);if(null===a)return null;c=vc(c,d,J(e)?e.focus:null);if(null===c)return null;if("text"===a.type&&"text"===c.type){d=a.getNode();const g=c.getNode(),h=d.getTextContentSize(),l=a.offset,k=c.offset;d===g&&l===k?0===b&&(d=d.getPreviousSibling(),w(d)&&!d.isInert()&&(b=d.getTextContentSize(),d=d.__key,a.key=d,c.key=d,a.offset=b,c.offset=b)):l===h&&(b=d.getNextSibling(),w(b)&&!b.isInert()&&(a.key=b.__key,a.offset=
88
- 0));f.isComposing()&&f._compositionKey!==a.key&&J(e)&&(f=e.anchor,e=e.focus,Y(a,f.key,f.offset,f.type),Y(c,e.key,e.offset,e.type))}return[a,c]}function wc(a,b,c,d,f,e){const g=z();a=new hc(X(a,b,f),X(c,d,e),0);a.dirty=!0;return g._selection=a}
89
- function Rb(a){var b=a.getEditorState()._selection,c=window.getSelection();if(Tb(b)||jc(b))return b.clone();{var d=(d=window.event)&&d.type;d=!Vb&&("selectionchange"===d||"beforeinput"===d||"compositionstart"===d||"compositionend"===d||"click"===d&&3===window.event.detail||void 0===d);let g,h;if(!J(b)||d)if(null===c)b=null;else if(d=c.anchorNode,g=c.focusNode,h=c.anchorOffset,c=c.focusOffset,a=sc(d,h,g,c,a,b),null===a)b=null;else{var [f,e]=a;b=new hc(f,e,J(b)?b.format:0)}else b=b.clone()}return b}
90
- function K(){return z()._selection}function Na(){return B()._editorState._selection}function Jb(a){if(null!==a){if("range"===a.type)return new hc(X(a.anchor.key,a.anchor.offset,a.anchor.type),X(a.focus.key,a.focus.offset,a.focus.type),0);if("node"===a.type)return new gc(new Set(a.nodes));if("grid"===a.type)return new ic(a.gridKey,a.anchorCellKey,a.focusCellKey)}return null}
91
- function xc(a,b,c,d=1){var f=a.anchor,e=a.focus,g=f.getNode(),h=e.getNode();if(b.is(g)||b.is(h))if(g=b.__key,a.isCollapsed())b=f.offset,c<=b&&(c=Math.max(0,b+d),f.set(g,c,"element"),e.set(g,c,"element"),yc(a));else{var l=a.isBackward();h=l?e:f;var k=h.getNode();f=l?f:e;e=f.getNode();b.is(k)&&(k=h.offset,c<=k&&h.set(g,Math.max(0,k+d),"element"));b.is(e)&&(b=f.offset,c<=b&&f.set(g,Math.max(0,b+d),"element"));yc(a)}}
92
- function yc(a){var b=a.anchor,c=b.offset;const d=a.focus;var f=d.offset,e=b.getNode(),g=d.getNode();if(a.isCollapsed())C(e)&&(g=e.getChildrenSize(),g=(f=c>=g)?e.getChildAtIndex(g-1):e.getChildAtIndex(c),w(g)&&(c=0,f&&(c=g.getTextContentSize()),b.set(g.__key,c,"text"),d.set(g.__key,c,"text")));else{if(C(e)){const h=e.getChildrenSize();c=(a=c>=h)?e.getChildAtIndex(h-1):e.getChildAtIndex(c);w(c)&&(e=0,a&&(e=c.getTextContentSize()),b.set(c.__key,e,"text"))}C(g)&&(c=g.getChildrenSize(),f=(b=f>=c)?g.getChildAtIndex(c-
93
- 1):g.getChildAtIndex(f),w(f)&&(g=0,b&&(g=f.getTextContentSize()),d.set(f.__key,g,"text")))}}function Sb(a,b){b=b.getEditorState()._selection;a=a._selection;if(J(a)){var c=a.anchor;const d=a.focus;let f;"text"===c.type&&(f=c.getNode(),f.selectionTransform(b,a));"text"===d.type&&(c=d.getNode(),f!==c&&c.selectionTransform(b,a))}}
94
- function zc(a,b,c,d,f){let e=null,g=0,h=null;null!==d?(e=d.__key,w(d)?(g=d.getTextContentSize(),h="text"):C(d)&&(g=d.getChildrenSize(),h="element")):null!==f&&(e=f.__key,w(f)?h="text":C(f)&&(h="element"));null!==e&&null!==h?a.set(e,g,h):(g=b.getIndexWithinParent(),-1===g&&(g=c.getChildrenSize()),a.set(c.__key,g,"element"))}function Ac(a,b,c,d,f){"text"===a.type?(a.key=c,b||(a.offset+=f)):a.offset>d.getIndexWithinParent()&&--a.offset}
95
- function Bc(a,b){F();var c=a.__key;const d=a.getParent();if(null!==d){var f=K(),e=!1;if(J(f)&&b){var g=f.anchor;const h=f.focus;g.key===c&&(zc(g,a,d,a.getPreviousSibling(),a.getNextSibling()),e=!0);h.key===c&&(zc(h,a,d,a.getPreviousSibling(),a.getNextSibling()),e=!0)}g=d.getWritable().__children;c=g.indexOf(c);-1===c&&q(16);Aa(a);g.splice(c,1);a.getWritable().__parent=null;J(f)&&b&&!e&&xc(f,d,c,-1);null===d||M(d)||d.canBeEmpty()||!d.isEmpty()||Bc(d,b);null!==d&&M(d)&&d.isEmpty()&&d.selectEnd()}}
96
- function Cc(a){const b=H(a);null===b&&q(39,a);return b}
97
- class Dc{static getType(){q(31,this.name)}static clone(){q(32,this.name)}constructor(a){this.__type=this.constructor.getType();this.__parent=null;if(null!=a)this.__key=a;else{F();99<Ca&&q(26);a=B();var b=z(),c=""+pa++;b._nodeMap.set(c,this);C(this)?a._dirtyElements.set(c,!0):a._dirtyLeaves.add(c);a._cloneNotNeeded.add(c);a._dirtyType=1;this.__key=c}}getType(){return this.__type}isAttached(){for(var a=this.__key;null!==a;){if("root"===a)return!0;a=H(a);if(null===a)break;a=a.__parent}return!1}isSelected(){const a=
98
- K();if(null==a)return!1;const b=(new Set(a.getNodes().map(c=>c.__key))).has(this.__key);return w(this)?b:J(a)&&"element"===a.anchor.type&&"element"===a.focus.type&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:b}getKey(){return this.__key}getIndexWithinParent(){const a=this.getParent();return null===a?-1:a.__children.indexOf(this.__key)}getParent(){const a=this.getLatest().__parent;return null===a?null:H(a)}getParentOrThrow(){const a=this.getParent();null===a&&q(33,this.__key);return a}getTopLevelElement(){let a=
91
+ 1,c.select(e,e)));return!0}insertParagraph(){this.isCollapsed()||this.removeText();var a=this.anchor,b=a.offset,c=[];if("text"===a.type){var d=a.getNode();var f=d.getNextSiblings().reverse();var e=d.getParentOrThrow();var g=e.isInline(),h=g?e.getTextContentSize():d.getTextContentSize();0===b?f.push(d):(g&&(c=e.getNextSiblings()),b===h||g&&b===d.getTextContentSize()||([,d]=d.splitText(b),f.push(d)))}else{e=a.getNode();if(M(e)){f=dd();c=e.getChildAtIndex(b);f.select();null!==c?c.insertBefore(f):e.append(f);
92
+ return}f=e.getChildren().slice(b).reverse()}d=f.length;if(0===b&&0<d&&e.isInline())e.getParentOrThrow().insertBefore(dd());else if(g=e.insertNewAfter(this),null===g)this.insertLineBreak();else if(C(g))if(h=e.getFirstChild(),0===b&&(e.is(a.getNode())||h&&h.is(a.getNode()))&&0<d)e.insertBefore(g);else{e=null;b=c.length;a=g.getParentOrThrow();if(0<b)for(h=0;h<b;h++)a.append(c[h]);if(0!==d)for(c=0;c<d;c++)b=f[c],null===e?g.append(b):e.insertBefore(b),e=b;g.canBeEmpty()||0!==g.getChildrenSize()?g.selectStart():
93
+ (g.selectPrevious(),g.remove())}}insertLineBreak(a){const b=md();var c=this.anchor;"element"===c.type&&(c=c.getNode(),M(c)&&this.insertParagraph());a?this.insertNodes([b],!0):this.insertNodes([b])&&b.selectNext(0,0)}extract(){var a=this.getNodes(),b=a.length,c=b-1,d=this.anchor;const f=this.focus;var e=a[0];let g=a[c];var h=d.getCharacterOffset();const l=f.getCharacterOffset();if(0===b)return[];if(1===b)return w(e)?(a=h>l?l:h,c=e.splitText(a,h>l?h:l),a=0===a?c[0]:c[1],null!=a?[a]:[]):[e];b=d.isBefore(f);
94
+ w(e)&&(d=b?h:l,d===e.getTextContentSize()?a.shift():0!==d&&([,e]=e.splitText(d),a[0]=e));w(g)&&(e=g.getTextContent().length,h=b?l:h,0===h?a.pop():h!==e&&([g]=g.splitText(h),a[c]=g));return a}modify(a,b,c){var d=this.focus,f=this.anchor,e="move"===a;const g=Sa(d,b);if(t(g)&&!g.isIsolated()){var h=b?g.getPreviousSibling():g.getNextSibling();if(!w(h)){a=g.getParentOrThrow();C(h)?(a=h.__key,h=b?h.getChildrenSize():0):(h=g.getIndexWithinParent(),a=a.__key,b||h++);d.set(a,h,"element");e&&f.set(a,h,"element");
95
+ return}}d=window.getSelection();d.modify(a,b?"backward":"forward",c);0<d.rangeCount&&(b=d.getRangeAt(0),this.applyDOMRange(b),e||d.anchorNode===b.startContainer&&d.anchorOffset===b.startOffset||(e=this.focus,b=this.anchor,d=b.key,f=b.offset,h=b.type,Z(b,e.key,e.offset,e.type),Z(e,d,f,h)))}deleteCharacter(a){if(this.isCollapsed()){var b=this.anchor,c=this.focus,d=b.getNode();if(!a&&("element"===b.type&&b.offset===d.getChildrenSize()||"text"===b.type&&b.offset===d.getTextContentSize())&&(d=d.getNextSibling()||
96
+ d.getParentOrThrow().getNextSibling(),C(d)&&!d.canExtractContents()))return;this.modify("extend",a,"character");if(!this.isCollapsed()){var f="text"===c.type?c.getNode():null;d="text"===b.type?b.getNode():null;if(null!==f&&f.isSegmented()){if(b=c.offset,c=f.getTextContentSize(),f.is(d)||a&&b!==c||!a&&0!==b){nd(f,a,b);return}}else if(null!==d&&d.isSegmented()&&(b=b.offset,c=d.getTextContentSize(),d.is(f)||a&&0!==b||!a&&b!==c)){nd(d,a,b);return}d=this.anchor;f=this.focus;b=d.getNode();c=f.getNode();
97
+ if(b===c&&"text"===d.type&&"text"===f.type){var e=d.offset,g=f.offset;const h=e<g;c=h?e:g;g=h?g:e;e=g-1;c!==e&&(b=b.getTextContent().slice(c,g),/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(b)||(a?f.offset=e:d.offset=e))}}else if(a&&0===b.offset&&("element"===b.type?b.getNode():b.getNode().getParentOrThrow()).collapseAtStart(this))return}this.removeText()}deleteLine(a){this.isCollapsed()&&this.modify("extend",a,"lineboundary");this.removeText()}deleteWord(a){this.isCollapsed()&&this.modify("extend",a,"word");
98
+ this.removeText()}}function Sc(a){return a instanceof ed}function nd(a,b,c){const d=a.getTextContent().split(/\s/g),f=d.length;let e=0,g=0;for(let h=0;h<f;h++){const l=d[h],k=h===f-1;g=e;e+=l.length;if(b&&e===c||e>c||k){d.splice(h,1);k&&(g=void 0);break}}b=d.join(" ");""===b?a.remove():(a.setTextContent(b),a.select(g,g))}
99
+ function od(a,b,c){var d=b;if(1===a.nodeType){let g=!1;var f=a.childNodes;var e=f.length;d===e&&(g=!0,d=e-1);f=Ja(f[d]);if(w(f))d=g?f.getTextContentSize():0;else{e=Ja(a);if(null===e)return null;if(C(e)){a=e.getChildAtIndex(d);if(b=C(a))b=a.getParent(),b=null===c||null===b||!b.canBeEmpty()||b!==c.getNode();b&&(c=g?a.getLastDescendant():a.getFirstDescendant(),null===c?(e=a,d=0):(a=c,e=a.getParentOrThrow()));w(a)?(f=a,e=null,d=g?f.getTextContentSize():0):a!==e&&g&&d++}else d=e.getIndexWithinParent(),
100
+ d=0===b&&t(e)&&Ja(a)===e?d:d+1,e=e.getParentOrThrow();if(C(e))return Y(e.__key,d,"element")}}else f=Ja(a);return w(f)?Y(f.__key,d,"text"):null}
101
+ function ld(a,b,c,d,f,e){if(null===a||null===c||!ra(f,a,c))return null;a=od(a,b,J(e)?e.anchor:null);if(null===a)return null;c=od(c,d,J(e)?e.focus:null);if(null===c)return null;if("text"===a.type&&"text"===c.type){d=a.getNode();const g=c.getNode(),h=d.getTextContentSize(),l=a.offset,k=c.offset;d===g&&l===k?0===b&&(d=d.getPreviousSibling(),w(d)&&!d.isInert()&&(b=d.getTextContentSize(),d=d.__key,a.key=d,c.key=d,a.offset=b,c.offset=b)):l===h&&(b=d.getNextSibling(),w(b)&&!b.isInert()&&(a.key=b.__key,a.offset=
102
+ 0));f.isComposing()&&f._compositionKey!==a.key&&J(e)&&(f=e.anchor,e=e.focus,Z(a,f.key,f.offset,f.type),Z(c,e.key,e.offset,e.type))}return[a,c]}function pd(a,b,c,d,f,e){const g=z();a=new fd(Y(a,b,f),Y(c,d,e),0);a.dirty=!0;return g._selection=a}
103
+ function Qc(a){var b=a.getEditorState()._selection,c=window.getSelection();if(Sc(b)||hd(b))return b.clone();{var d=(d=window.event)&&d.type;d=!Uc&&("selectionchange"===d||"beforeinput"===d||"compositionstart"===d||"compositionend"===d||"click"===d&&3===window.event.detail||void 0===d);let g,h;if(!J(b)||d)if(null===c)b=null;else if(d=c.anchorNode,g=c.focusNode,h=c.anchorOffset,c=c.focusOffset,a=ld(d,h,g,c,a,b),null===a)b=null;else{var [f,e]=a;b=new fd(f,e,J(b)?b.format:0)}else b=b.clone()}return b}
104
+ function K(){return z()._selection}function Na(){return B()._editorState._selection}function Dc(a){if(null!==a){if("range"===a.type)return new fd(Y(a.anchor.key,a.anchor.offset,a.anchor.type),Y(a.focus.key,a.focus.offset,a.focus.type),0);if("node"===a.type)return new ed(new Set(a.nodes));if("grid"===a.type)return new gd(a.gridKey,a.anchorCellKey,a.focusCellKey)}return null}
105
+ function qd(a,b,c,d=1){var f=a.anchor,e=a.focus,g=f.getNode(),h=e.getNode();if(b.is(g)||b.is(h))if(g=b.__key,a.isCollapsed())b=f.offset,c<=b&&(c=Math.max(0,b+d),f.set(g,c,"element"),e.set(g,c,"element"),rd(a));else{var l=a.isBackward();h=l?e:f;var k=h.getNode();f=l?f:e;e=f.getNode();b.is(k)&&(k=h.offset,c<=k&&h.set(g,Math.max(0,k+d),"element"));b.is(e)&&(b=f.offset,c<=b&&f.set(g,Math.max(0,b+d),"element"));rd(a)}}
106
+ function rd(a){var b=a.anchor,c=b.offset;const d=a.focus;var f=d.offset,e=b.getNode(),g=d.getNode();if(a.isCollapsed())C(e)&&(g=e.getChildrenSize(),g=(f=c>=g)?e.getChildAtIndex(g-1):e.getChildAtIndex(c),w(g)&&(c=0,f&&(c=g.getTextContentSize()),b.set(g.__key,c,"text"),d.set(g.__key,c,"text")));else{if(C(e)){const h=e.getChildrenSize();c=(a=c>=h)?e.getChildAtIndex(h-1):e.getChildAtIndex(c);w(c)&&(e=0,a&&(e=c.getTextContentSize()),b.set(c.__key,e,"text"))}C(g)&&(c=g.getChildrenSize(),f=(b=f>=c)?g.getChildAtIndex(c-
107
+ 1):g.getChildAtIndex(f),w(f)&&(g=0,b&&(g=f.getTextContentSize()),d.set(f.__key,g,"text")))}}function Rc(a,b){b=b.getEditorState()._selection;a=a._selection;if(J(a)){var c=a.anchor;const d=a.focus;let f;"text"===c.type&&(f=c.getNode(),f.selectionTransform(b,a));"text"===d.type&&(c=d.getNode(),f!==c&&c.selectionTransform(b,a))}}
108
+ function sd(a,b,c,d,f){let e=null,g=0,h=null;null!==d?(e=d.__key,w(d)?(g=d.getTextContentSize(),h="text"):C(d)&&(g=d.getChildrenSize(),h="element")):null!==f&&(e=f.__key,w(f)?h="text":C(f)&&(h="element"));null!==e&&null!==h?a.set(e,g,h):(g=b.getIndexWithinParent(),-1===g&&(g=c.getChildrenSize()),a.set(c.__key,g,"element"))}function td(a,b,c,d,f){"text"===a.type?(a.key=c,b||(a.offset+=f)):a.offset>d.getIndexWithinParent()&&--a.offset}
109
+ function ud(a,b,c){F();var d=a.__key;const f=a.getParent();if(null!==f){var e=K(),g=!1;if(J(e)&&b){var h=e.anchor;const l=e.focus;h.key===d&&(sd(h,a,f,a.getPreviousSibling(),a.getNextSibling()),g=!0);l.key===d&&(sd(l,a,f,a.getPreviousSibling(),a.getNextSibling()),g=!0)}h=f.getWritable().__children;d=h.indexOf(d);-1===d&&q(16);za(a);h.splice(d,1);a.getWritable().__parent=null;J(e)&&b&&!g&&qd(e,f,d,-1);c||null===f||M(f)||f.canBeEmpty()||!f.isEmpty()||ud(f,b);null!==f&&M(f)&&f.isEmpty()&&f.selectEnd()}}
110
+ function vd(a){const b=G(a);null===b&&q(39,a);return b}
111
+ class wd{static getType(){q(31,this.name)}static clone(){q(32,this.name)}constructor(a){this.__type=this.constructor.getType();this.__parent=null;if(null!=a)this.__key=a;else{F();99<Ba&&q(26);a=B();var b=z(),c=""+pa++;b._nodeMap.set(c,this);C(this)?a._dirtyElements.set(c,!0):a._dirtyLeaves.add(c);a._cloneNotNeeded.add(c);a._dirtyType=1;this.__key=c}}getType(){return this.__type}isAttached(){for(var a=this.__key;null!==a;){if("root"===a)return!0;a=G(a);if(null===a)break;a=a.__parent}return!1}isSelected(){const a=
112
+ K();if(null==a)return!1;const b=(new Set(a.getNodes().map(c=>c.__key))).has(this.__key);return w(this)?b:J(a)&&"element"===a.anchor.type&&"element"===a.focus.type&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:b}getKey(){return this.__key}getIndexWithinParent(){const a=this.getParent();return null===a?-1:a.__children.indexOf(this.__key)}getParent(){const a=this.getLatest().__parent;return null===a?null:G(a)}getParentOrThrow(){const a=this.getParent();null===a&&q(33,this.__key);return a}getTopLevelElement(){let a=
99
113
  this;for(;null!==a;){const b=a.getParent();if(M(b)&&C(a))return a;a=b}return null}getTopLevelElementOrThrow(){const a=this.getTopLevelElement();null===a&&q(34,this.__key);return a}getParents(){const a=[];let b=this.getParent();for(;null!==b;)a.push(b),b=b.getParent();return a}getParentKeys(){const a=[];let b=this.getParent();for(;null!==b;)a.push(b.__key),b=b.getParent();return a}getPreviousSibling(){var a=this.getParent();if(null===a)return null;a=a.__children;const b=a.indexOf(this.__key);return 0>=
100
- b?null:H(a[b-1])}getPreviousSiblings(){var a=this.getParent();if(null===a)return[];a=a.__children;const b=a.indexOf(this.__key);return a.slice(0,b).map(c=>Cc(c))}getNextSibling(){var a=this.getParent();if(null===a)return null;a=a.__children;const b=a.length,c=a.indexOf(this.__key);return c>=b-1?null:H(a[c+1])}getNextSiblings(){var a=this.getParent();if(null===a)return[];a=a.__children;const b=a.indexOf(this.__key);return a.slice(b+1).map(c=>Cc(c))}getCommonAncestor(a){const b=this.getParents();var c=
114
+ b?null:G(a[b-1])}getPreviousSiblings(){var a=this.getParent();if(null===a)return[];a=a.__children;const b=a.indexOf(this.__key);return a.slice(0,b).map(c=>vd(c))}getNextSibling(){var a=this.getParent();if(null===a)return null;a=a.__children;const b=a.length,c=a.indexOf(this.__key);return c>=b-1?null:G(a[c+1])}getNextSiblings(){var a=this.getParent();if(null===a)return[];a=a.__children;const b=a.indexOf(this.__key);return a.slice(b+1).map(c=>vd(c))}getCommonAncestor(a){const b=this.getParents();var c=
101
115
  a.getParents();C(this)&&b.unshift(this);C(a)&&c.unshift(a);a=b.length;var d=c.length;if(0===a||0===d||b[a-1]!==c[d-1])return null;c=new Set(c);for(d=0;d<a;d++){const f=b[d];if(c.has(f))return f}return null}is(a){return null==a?!1:this.__key===a.__key}isBefore(a){if(a.isParentOf(this))return!0;if(this.isParentOf(a))return!1;var b=this.getCommonAncestor(a);let c=this;for(;;){var d=c.getParentOrThrow();if(d===b){d=d.__children.indexOf(c.__key);break}c=d}for(c=a;;){a=c.getParentOrThrow();if(a===b){b=
102
116
  a.__children.indexOf(c.__key);break}c=a}return d<b}isParentOf(a){const b=this.__key;if(b===a.__key)return!1;for(;null!==a;){if(a.__key===b)return!0;a=a.getParent()}return!1}getNodesBetween(a){const b=this.isBefore(a),c=[],d=new Set;var f=this;let e=null;for(;;){var g=f.__key;d.has(g)||(d.add(g),c.push(f));if(f===a)break;g=C(f)?b?f.getFirstChild():f.getLastChild():null;if(null!==g)null===e&&(e=f),f=g;else if(g=b?f.getNextSibling():f.getPreviousSibling(),null!==g)f=g;else{g=f.getParentOrThrow();d.has(g.__key)||
103
- c.push(g);if(g===a)break;f=g;g.is(e)&&(e=null);do null===f&&q(35),g=b?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),null!==f&&(f.is(e)&&(e=null),null!==g||d.has(f.__key)||c.push(f));while(null===g);f=g}}b||c.reverse();return c}isDirty(){const a=B()._dirtyLeaves;return null!==a&&a.has(this.__key)}isComposing(){return this.__key===B()._compositionKey}getLatest(){const a=H(this.__key);null===a&&q(36);return a}getWritable(){F();var a=z(),b=B();a=a._nodeMap;const c=this.__key,d=this.getLatest(),
104
- f=d.__parent;b=b._cloneNotNeeded;if(b.has(c))return Ba(d),d;const e=d.constructor.clone(d);e.__parent=f;C(d)&&C(e)?(e.__children=Array.from(d.__children),e.__indent=d.__indent,e.__format=d.__format,e.__dir=d.__dir):w(d)&&w(e)&&(e.__format=d.__format,e.__style=d.__style,e.__mode=d.__mode,e.__detail=d.__detail);b.add(c);e.__key=c;Ba(e);a.set(c,e);return e}getTextContent(){return""}getTextContentSize(a,b){return this.getTextContent(a,b).length}createDOM(){q(37)}updateDOM(){q(38)}exportDOM(a){return u(this)?
105
- (a=a.getElementByKey(this.getKey()),{element:a?a.cloneNode():null}):{element:this.createDOM(a._config,a)}}static importDOM(){return null}remove(){F();Bc(this,!0)}replace(a){F();const b=this.__key;a=a.getWritable();za(a);var c=this.getParentOrThrow(),d=c.getWritable().__children;const f=d.indexOf(this.__key),e=a.__key;-1===f&&q(16);d.splice(f,0,e);a.__parent=c.__key;Bc(this,!1);Aa(a);d=K();J(d)&&(c=d.anchor,d=d.focus,c.key===b&&dc(c,a),d.key===b&&dc(d,a));B()._compositionKey===b&&D(e);return a}insertAfter(a){F();
106
- var b=this.getWritable(),c=a.getWritable(),d=c.getParent();const f=K();var e=a.getIndexWithinParent(),g=!1,h=!1;null!==d&&(za(c),J(f)&&(h=d.__key,g=f.anchor,d=f.focus,g="element"===g.type&&g.key===h&&g.offset===e+1,h="element"===d.type&&d.key===h&&d.offset===e+1));e=this.getParentOrThrow().getWritable();d=c.__key;c.__parent=b.__parent;const l=e.__children;b=l.indexOf(b.__key);-1===b&&q(16);l.splice(b+1,0,d);Aa(c);J(f)&&(xc(f,e,b+1),c=e.__key,g&&f.anchor.set(c,b+2,"element"),h&&f.focus.set(c,b+2,"element"));
107
- return a}insertBefore(a){F();var b=this.getWritable(),c=a.getWritable();za(c);const d=this.getParentOrThrow().getWritable(),f=c.__key;c.__parent=b.__parent;const e=d.__children;b=e.indexOf(b.__key);-1===b&&q(16);e.splice(b,0,f);Aa(c);c=K();J(c)&&xc(c,d,b);return a}selectPrevious(a,b){F();const c=this.getPreviousSibling(),d=this.getParentOrThrow();return null===c?d.select(0,0):C(c)?c.select():w(c)?c.select(a,b):(a=c.getIndexWithinParent()+1,d.select(a,a))}selectNext(a,b){F();const c=this.getNextSibling(),
108
- d=this.getParentOrThrow();return null===c?d.select():C(c)?c.select(0,0):w(c)?c.select(a,b):(a=c.getIndexWithinParent(),d.select(a,a))}markDirty(){this.getWritable()}}class Ec extends Dc{constructor(a){super(a)}decorate(){q(4)}isIsolated(){return!1}isTopLevel(){return!1}}function u(a){return a instanceof Ec}
109
- class Fc extends Dc{constructor(a){super(a);this.__children=[];this.__indent=this.__format=0;this.__dir=null}getFormat(){return this.getLatest().__format}getIndent(){return this.getLatest().__indent}getChildren(){const a=this.getLatest().__children,b=[];for(let c=0;c<a.length;c++){const d=H(a[c]);null!==d&&b.push(d)}return b}getChildrenKeys(){return this.getLatest().__children}getChildrenSize(){return this.getLatest().__children.length}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const a=
110
- B()._dirtyElements;return null!==a&&a.has(this.__key)}getAllTextNodes(a){const b=[],c=this.getLatest().__children;for(let f=0;f<c.length;f++){var d=H(c[f]);!w(d)||!a&&d.isInert()?C(d)&&(d=d.getAllTextNodes(a),b.push(...d)):b.push(d)}return b}getFirstDescendant(){let a=this.getFirstChild();for(;null!==a;){if(C(a)){const b=a.getFirstChild();if(null!==b){a=b;continue}}break}return a}getLastDescendant(){let a=this.getLastChild();for(;null!==a;){if(C(a)){const b=a.getLastChild();if(null!==b){a=b;continue}}break}return a}getDescendantByIndex(a){const b=
111
- this.getChildren(),c=b.length;if(0===c)return this;if(a>=c)return a=b[c-1],C(a)&&a.getLastDescendant()||a;a=b[a];return C(a)&&a.getFirstDescendant()||a}getFirstChild(){const a=this.getLatest().__children;return 0===a.length?null:H(a[0])}getFirstChildOrThrow(){const a=this.getFirstChild();null===a&&q(15,this.__key);return a}getLastChild(){const a=this.getLatest().__children,b=a.length;return 0===b?null:H(a[b-1])}getChildAtIndex(a){a=this.getLatest().__children[a];return void 0===a?null:H(a)}getTextContent(a,
112
- b){let c="";const d=this.getChildren(),f=d.length;for(let e=0;e<f;e++){const g=d[e];c+=g.getTextContent(a,b);C(g)&&e!==f-1&&!g.isInline()&&(c+="\n\n")}return c}getDirection(){return this.getLatest().__dir}hasFormat(a){a=fa[a];return 0!==(this.getFormat()&a)}select(a,b){F();const c=K();var d=this.getChildrenSize();void 0===a&&(a=d);void 0===b&&(b=d);d=this.__key;if(J(c))c.anchor.set(d,a,"element"),c.focus.set(d,b,"element"),c.dirty=!0;else return wc(d,a,d,b,"element","element");return c}selectStart(){const a=
117
+ c.push(g);if(g===a)break;f=g;g.is(e)&&(e=null);do null===f&&q(35),g=b?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),null!==f&&(f.is(e)&&(e=null),null!==g||d.has(f.__key)||c.push(f));while(null===g);f=g}}b||c.reverse();return c}isDirty(){const a=B()._dirtyLeaves;return null!==a&&a.has(this.__key)}isComposing(){return this.__key===B()._compositionKey}getLatest(){const a=G(this.__key);null===a&&q(36);return a}getWritable(){F();var a=z(),b=B();a=a._nodeMap;const c=this.__key,d=this.getLatest(),
118
+ f=d.__parent;b=b._cloneNotNeeded;if(b.has(c))return Aa(d),d;const e=d.constructor.clone(d);e.__parent=f;C(d)&&C(e)?(e.__children=Array.from(d.__children),e.__indent=d.__indent,e.__format=d.__format,e.__dir=d.__dir):w(d)&&w(e)&&(e.__format=d.__format,e.__style=d.__style,e.__mode=d.__mode,e.__detail=d.__detail);b.add(c);e.__key=c;Aa(e);a.set(c,e);return e}getTextContent(){return""}getTextContentSize(a,b){return this.getTextContent(a,b).length}createDOM(){q(37)}updateDOM(){q(38)}exportDOM(a){return t(this)?
119
+ (a=a.getElementByKey(this.getKey()),{element:a?a.cloneNode():null}):{element:this.createDOM(a._config,a)}}static importDOM(){return null}remove(a){F();ud(this,!0,a)}replace(a){F();const b=this.__key;a=a.getWritable();ya(a);var c=this.getParentOrThrow(),d=c.getWritable().__children;const f=d.indexOf(this.__key),e=a.__key;-1===f&&q(16);d.splice(f,0,e);a.__parent=c.__key;ud(this,!1);za(a);d=K();J(d)&&(c=d.anchor,d=d.focus,c.key===b&&bd(c,a),d.key===b&&bd(d,a));B()._compositionKey===b&&D(e);return a}insertAfter(a){F();
120
+ var b=this.getWritable(),c=a.getWritable(),d=c.getParent();const f=K();var e=a.getIndexWithinParent(),g=!1,h=!1;null!==d&&(ya(c),J(f)&&(h=d.__key,g=f.anchor,d=f.focus,g="element"===g.type&&g.key===h&&g.offset===e+1,h="element"===d.type&&d.key===h&&d.offset===e+1));e=this.getParentOrThrow().getWritable();d=c.__key;c.__parent=b.__parent;const l=e.__children;b=l.indexOf(b.__key);-1===b&&q(16);l.splice(b+1,0,d);za(c);J(f)&&(qd(f,e,b+1),c=e.__key,g&&f.anchor.set(c,b+2,"element"),h&&f.focus.set(c,b+2,"element"));
121
+ return a}insertBefore(a){F();var b=this.getWritable(),c=a.getWritable();ya(c);const d=this.getParentOrThrow().getWritable(),f=c.__key;c.__parent=b.__parent;const e=d.__children;b=e.indexOf(b.__key);-1===b&&q(16);e.splice(b,0,f);za(c);c=K();J(c)&&qd(c,d,b);return a}selectPrevious(a,b){F();const c=this.getPreviousSibling(),d=this.getParentOrThrow();return null===c?d.select(0,0):C(c)?c.select():w(c)?c.select(a,b):(a=c.getIndexWithinParent()+1,d.select(a,a))}selectNext(a,b){F();const c=this.getNextSibling(),
122
+ d=this.getParentOrThrow();return null===c?d.select():C(c)?c.select(0,0):w(c)?c.select(a,b):(a=c.getIndexWithinParent(),d.select(a,a))}markDirty(){this.getWritable()}}class xd extends wd{constructor(a){super(a)}decorate(){q(4)}isIsolated(){return!1}isTopLevel(){return!1}}function t(a){return a instanceof xd}
123
+ class yd extends wd{constructor(a){super(a);this.__children=[];this.__indent=this.__format=0;this.__dir=null}getFormat(){return this.getLatest().__format}getIndent(){return this.getLatest().__indent}getChildren(){const a=this.getLatest().__children,b=[];for(let c=0;c<a.length;c++){const d=G(a[c]);null!==d&&b.push(d)}return b}getChildrenKeys(){return this.getLatest().__children}getChildrenSize(){return this.getLatest().__children.length}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const a=
124
+ B()._dirtyElements;return null!==a&&a.has(this.__key)}getAllTextNodes(a){const b=[],c=this.getLatest().__children;for(let f=0;f<c.length;f++){var d=G(c[f]);!w(d)||!a&&d.isInert()?C(d)&&(d=d.getAllTextNodes(a),b.push(...d)):b.push(d)}return b}getFirstDescendant(){let a=this.getFirstChild();for(;null!==a;){if(C(a)){const b=a.getFirstChild();if(null!==b){a=b;continue}}break}return a}getLastDescendant(){let a=this.getLastChild();for(;null!==a;){if(C(a)){const b=a.getLastChild();if(null!==b){a=b;continue}}break}return a}getDescendantByIndex(a){const b=
125
+ this.getChildren(),c=b.length;if(0===c)return this;if(a>=c)return a=b[c-1],C(a)&&a.getLastDescendant()||a;a=b[a];return C(a)&&a.getFirstDescendant()||a}getFirstChild(){const a=this.getLatest().__children;return 0===a.length?null:G(a[0])}getFirstChildOrThrow(){const a=this.getFirstChild();null===a&&q(15,this.__key);return a}getLastChild(){const a=this.getLatest().__children,b=a.length;return 0===b?null:G(a[b-1])}getChildAtIndex(a){a=this.getLatest().__children[a];return void 0===a?null:G(a)}getTextContent(a,
126
+ b){let c="";const d=this.getChildren(),f=d.length;for(let e=0;e<f;e++){const g=d[e];c+=g.getTextContent(a,b);C(g)&&e!==f-1&&!g.isInline()&&(c+="\n\n")}return c}getDirection(){return this.getLatest().__dir}hasFormat(a){a=fa[a];return 0!==(this.getFormat()&a)}select(a,b){F();const c=K();var d=this.getChildrenSize();void 0===a&&(a=d);void 0===b&&(b=d);d=this.__key;if(J(c))c.anchor.set(d,a,"element"),c.focus.set(d,b,"element"),c.dirty=!0;else return pd(d,a,d,b,"element","element");return c}selectStart(){const a=
113
127
  this.getFirstDescendant();return C(a)||w(a)?a.select(0,0):null!==a?a.selectPrevious():this.select(0,0)}selectEnd(){const a=this.getLastDescendant();return C(a)||w(a)?a.select():null!==a?a.selectNext():this.select()}clear(){F();const a=this.getWritable();this.getChildren().forEach(b=>b.remove());return a}append(...a){F();return this.splice(this.getChildrenSize(),0,a)}setDirection(a){F();const b=this.getWritable();b.__dir=a;return b}setFormat(a){F();this.getWritable().__format=fa[a];return this}setIndent(a){F();
114
- this.getWritable().__indent=a;return this}splice(a,b,c){F();const d=this.getWritable();var f=d.__key;const e=d.__children,g=c.length;var h=[];for(let l=0;l<g;l++){const k=c[l],m=k.getWritable();k.__key===f&&q(49);za(m);m.__parent=f;h.push(m.__key)}(c=this.getChildAtIndex(a-1))&&Ba(c);(f=this.getChildAtIndex(a+b))&&Ba(f);a===e.length?(e.push(...h),a=[]):a=e.splice(a,b,...h);if(a.length&&(b=K(),J(b))){const l=new Set(a),k=new Set(h);h=t=>{for(t=t.getNode();t;){const p=t.__key;if(l.has(p)&&!k.has(p))return!0;
115
- t=t.getParent()}return!1};const {anchor:m,focus:n}=b;h(m)&&zc(m,m.getNode(),this,c,f);h(n)&&zc(n,n.getNode(),this,c,f);h=a.length;for(b=0;b<h;b++)c=H(a[b]),null!=c&&(c.getWritable().__parent=null);0!==e.length||this.canBeEmpty()||M(this)||this.remove()}return d}insertNewAfter(){return null}canInsertTab(){return!1}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}canMergeWith(){return!1}}
116
- function C(a){return a instanceof Fc}
117
- class Gc extends Fc{static getType(){return"root"}static clone(){return new Gc}constructor(){super("root");this.__cachedText=null}getTopLevelElementOrThrow(){q(70)}getTextContent(a,b){const c=this.__cachedText;return!U&&0!==B()._dirtyType||null===c||a&&!1===b?super.getTextContent(a,b):c}remove(){q(10)}replace(){q(11)}insertBefore(){q(12)}insertAfter(){q(13)}updateDOM(){return!1}append(...a){for(let b=0;b<a.length;b++){const c=a[b];C(c)||u(c)||q(46)}return super.append(...a)}toJSON(){return{__children:this.__children,__dir:this.__dir,
118
- __format:this.__format,__indent:this.__indent,__key:"root",__parent:null,__type:"root"}}}function M(a){return a instanceof Gc}function Ub(a,b){b=b.getEditorState()._selection;a=a._selection;if(null!==a){if(a.dirty||!a.is(b))return!0}else if(null!==b)return!0;return!1}function Hc(){return new Ib(new Map([["root",new Gc]]))}
119
- class Ib{constructor(a,b){this._nodeMap=a;this._selection=b||null;this._readOnly=this._flushSync=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(a){a:{const c=R,d=U,f=T;R=this;U=!0;T=null;try{var b=a();break a}finally{R=c,U=d,T=f}b=void 0}return b}clone(a){a=new Ib(this._nodeMap,void 0===a?this._selection:a);a._readOnly=!0;return a}toJSON(){const a=this._selection;return{_nodeMap:Array.from(this._nodeMap.entries()),_selection:J(a)?{anchor:{key:a.anchor.key,offset:a.anchor.offset,
120
- type:a.anchor.type},focus:{key:a.focus.key,offset:a.focus.offset,type:a.focus.type},type:"range"}:Tb(a)?{nodes:Array.from(a._nodes),type:"node"}:jc(a)?{anchorCellKey:a.anchorCellKey,focusCellKey:a.focusCellKey,gridKey:a.gridKey,type:"grid"}:null}}}const Ic=Object.freeze({}),Oc=[["keydown",Jc],["compositionstart",Kc],["compositionend",Lc],["input",Mc],["click",Nc],["cut",Ic],["copy",Ic],["dragstart",Ic],["paste",Ic],["focus",Ic],["blur",Ic]];la?Oc.push(["beforeinput",Pc]):Oc.push(["drop",Ic]);
121
- let Qc=0,Rc=0;function Sc(a,b,c){I(b,()=>{if(c){var d=K();if(J(d)&&d.isCollapsed()){"Range"===a.type&&(d.dirty=!0);var f=d.anchor;"text"===f.type?(f=f.getNode(),d.format=f.getFormat()):"element"===f.type&&(d.format=0)}V(b,Tc,void 0)}else Ia(null)})}
122
- function Nc(a,b){I(b,()=>{const c=K();if(J(c)){var d=c.anchor;"element"===d.type&&0===d.offset&&c.isCollapsed()&&1===Ga().getChildrenSize()&&d.getNode().getTopLevelElementOrThrow().isEmpty()&&(d=b.getEditorState()._selection,null!==d&&c.is(d)&&(window.getSelection().removeAllRanges(),c.dirty=!0))}V(b,Uc,a)})}function Vc(a,b){b.getTargetRanges&&(b=b.getTargetRanges()[0])&&a.applyDOMRange(b)}function Wc(a,b){return a!==b||C(a)||C(b)||!v(a)||!v(b)}
123
- function Pc(a,b){const c=a.inputType;if(!("deleteCompositionText"===c||ka&&Wa()))if("insertCompositionText"===c){const d=a.data;d&&I(b,()=>{var f=K();if(J(f)){const e=f.anchor,g=e.getNode(),h=g.getPreviousSibling();0===e.offset&&w(g)&&w(h)&&" "===g.getTextContent()&&h.getFormat()!==f.format&&(f=h.getTextContent(),0===d.indexOf(f)&&(f=d.slice(f.length),V(b,Xc,f),setTimeout(()=>{I(b,()=>{g.select()})},30)))}})}else I(b,()=>{const d=K();if(J(d))if("deleteContentBackward"===c)D(null),a.preventDefault(),
124
- Qc=0,V(b,Yc,!0),setTimeout(()=>{b.update(()=>{D(null)})},30);else{var f=a.data;d.dirty||!d.isCollapsed()||M(d.anchor.getNode())||Vc(d,a);var e=d.focus,g=d.anchor.getNode();e=e.getNode();if("insertText"===c)"\n"===f?(a.preventDefault(),V(b,Zc,void 0)):"\n\n"===f?(a.preventDefault(),V(b,$c,void 0)):null==f&&a.dataTransfer?(f=a.dataTransfer.getData("text/plain"),a.preventDefault(),d.insertRawText(f)):null!=f&&Oa(d,f,!0)&&(a.preventDefault(),V(b,Xc,f));else switch(a.preventDefault(),c){case "insertFromYank":case "insertFromDrop":case "insertReplacementText":V(b,
125
- Xc,a);break;case "insertFromComposition":D(null);V(b,Xc,a);break;case "insertLineBreak":D(null);V(b,Zc,void 0);break;case "insertParagraph":D(null);V(b,$c,void 0);break;case "insertFromPaste":case "insertFromPasteAsQuotation":V(b,ad,a);break;case "deleteByComposition":Wc(g,e)&&V(b,bd,void 0);break;case "deleteByDrag":case "deleteByCut":V(b,bd,void 0);break;case "deleteContent":V(b,Yc,!1);break;case "deleteWordBackward":V(b,cd,!0);break;case "deleteWordForward":V(b,cd,!1);break;case "deleteHardLineBackward":case "deleteSoftLineBackward":V(b,
126
- dd,!0);break;case "deleteContentForward":case "deleteHardLineForward":case "deleteSoftLineForward":V(b,dd,!1);break;case "formatStrikeThrough":V(b,Z,"strikethrough");break;case "formatBold":V(b,Z,"bold");break;case "formatItalic":V(b,Z,"italic");break;case "formatUnderline":V(b,Z,"underline");break;case "historyUndo":V(b,ed,void 0);break;case "historyRedo":V(b,fd,void 0)}}})}
127
- function Mc(a,b){a.stopPropagation();I(b,()=>{var c=K();const d=a.data;null!=d&&J(c)&&Oa(c,d,!1)?V(b,Xc,d):La(b,null);F();c=B();ac(c)})}function Kc(a,b){I(b,()=>{const c=K();if(J(c)&&!b.isComposing()){const d=c.anchor;D(d.key);(a.timeStamp<Qc+30||"element"===d.type||!c.isCollapsed()||c.anchor.getNode().getFormat()!==c.format)&&V(b,Xc," ")}})}
128
- function Lc(a,b){I(b,()=>{var c=b._compositionKey;D(null);var d=a.data;if(null!==c&&null!=d){if(""===d){d=H(c);c=ua(b.getElementByKey(c));null!==c&&w(d)&&Ma(d,c.nodeValue,null,null,!0);return}if("\n"===d[d.length-1]&&(c=K(),J(c))){d=c.focus;c.anchor.set(d.key,d.offset,d.type);V(b,gd,null);return}}La(b,a)})}
129
- function Jc(a,b){Qc=a.timeStamp;if(!b.isComposing()){var {keyCode:c,shiftKey:d,ctrlKey:f,metaKey:e,altKey:g}=a;if(39!==c||f||e||g)if(37!==c||f||e||g)if(38!==c||f||e)if(40!==c||f||e)if(13===c&&d)V(b,gd,a);else if(r&&f&&79===c)a.preventDefault(),V(b,Zc,!0);else if(13!==c||d){var h=r?g||e?!1:8===c||72===c&&f:f||g||e?!1:8===c;h?8===c?V(b,hd,a):(a.preventDefault(),V(b,Yc,!0)):27===c?V(b,id,a):(h=r?d||g||e?!1:46===c||68===c&&f:f||g||e?!1:46===c,h?46===c?V(b,jd,a):(a.preventDefault(),V(b,Yc,!1)):8===c&&
130
- (r?g:f)?(a.preventDefault(),V(b,cd,!0)):46===c&&(r?g:f)?(a.preventDefault(),V(b,cd,!1)):r&&e&&8===c?(a.preventDefault(),V(b,dd,!0)):r&&e&&46===c?(a.preventDefault(),V(b,dd,!1)):66===c&&(r?e:f)?(a.preventDefault(),V(b,Z,"bold")):85===c&&(r?e:f)?(a.preventDefault(),V(b,Z,"underline")):73===c&&(r?e:f)?(a.preventDefault(),V(b,Z,"italic")):9!==c||g||f||e?90===c&&!d&&(r?e:f)?(a.preventDefault(),V(b,ed,void 0)):(h=r?90===c&&e&&d:89===c&&f||90===c&&f&&d,h&&(a.preventDefault(),V(b,fd,void 0))):V(b,kd,a))}else V(b,
131
- gd,a);else V(b,ld,a);else V(b,md,a);else V(b,nd,a);else V(b,od,a)}}function pd(a){let b=a.__lexicalEventHandles;void 0===b&&(b=[],a.__lexicalEventHandles=b);return b}const qd=new Map;function rd(){const a=window.getSelection(),b=ta(a.anchorNode);if(null!==b){var c=Ka(b);c=c[c.length-1];var d=c._key,f=qd.get(d),e=f||c;e!==b&&Sc(a,e,!1);Sc(a,b,!0);b!==c?qd.set(d,b):f&&qd.delete(d)}}
132
- function sd(a,b){0===Rc&&a.ownerDocument.addEventListener("selectionchange",rd);Rc++;a.__lexicalEditor=b;const c=pd(a);for(let d=0;d<Oc.length;d++){const [f,e]=Oc[d],g="function"===typeof e?h=>{b.isReadOnly()||e(h,b)}:h=>{if(!b.isReadOnly())switch(f){case "cut":return V(b,vd,h);case "copy":return V(b,wd,h);case "paste":return V(b,ad,h);case "dragstart":return V(b,xd,h);case "focus":return V(b,yd,h);case "blur":return V(b,zd,h);case "drop":return V(b,Ad,h)}};a.addEventListener(f,g);c.push(()=>{a.removeEventListener(f,
133
- g)})}}class Bd extends Dc{static getType(){return"linebreak"}static clone(a){return new Bd(a.__key)}constructor(a){super(a)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:()=>({conversion:Cd,priority:0})}}}function Cd(){return{node:tc()}}function tc(){return new Bd}function ya(a){return a instanceof Bd}function Dd(a,b){return b&1?"strong":b&2?"em":"span"}
134
- function Ed(a,b,c,d,f){a=d.classList;d=Pa(f,"base");void 0!==d&&a.add(...d);d=Pa(f,"underlineStrikethrough");let e=!1;const g=b&8&&b&4;var h=c&8&&c&4;void 0!==d&&(h?(e=!0,g||a.add(...d)):g&&a.remove(...d));for(const l in ea)h=ea[l],d=Pa(f,l),void 0!==d&&(c&h?!e||"underline"!==l&&"strikethrough"!==l?(0===(b&h)||g&&"underline"===l||"strikethrough"===l)&&a.add(...d):b&h&&a.remove(...d):b&h&&a.remove(...d))}
135
- function Fd(a,b,c){const d=b.firstChild;c=c.isComposing();a+=c?"\u200b":"";if(null==d)b.textContent=a;else if(b=d.nodeValue,b!==a)if(c){c=b.length;const f=a.length;let e=0,g=0;for(;e<c&&e<f&&b[e]===a[e];)e++;for(;g+e<c&&g+e<f&&b[c-g-1]===a[f-g-1];)g++;a=[e,c-e-g,a.slice(e,f-g)];const [h,l,k]=a;0!==l&&d.deleteData(h,l);d.insertData(h,k)}else d.nodeValue=a}
136
- class Gd extends Dc{static getType(){return"text"}static clone(a){return new Gd(a.__text,a.__key)}constructor(a,b){super(b);this.__text=a;this.__format=0;this.__style="";this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isSegmented(){return 2===this.getLatest().__mode}isInert(){return 3===this.getLatest().__mode}isDirectionless(){return 0!==(this.getLatest().__detail&1)}isUnmergeable(){return 0!==
137
- (this.getLatest().__detail&2)}hasFormat(a){a=ea[a];return 0!==(this.getFormat()&a)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(a,b){return!a&&this.isInert()||!1===b&&this.isDirectionless()?"":this.getLatest().__text}getFormatFlags(a,b){const c=this.getLatest().__format;return va(c,a,b)}createDOM(a){var b=this.__format,c=b&16?"code":null;const d=Dd(this,b),f=document.createElement(null===c?d:c);let e=f;null!==c&&(e=document.createElement(d),f.appendChild(e));c=e;Fd(this.__text,
138
- c,this);a=a.theme.text;void 0!==a&&Ed(d,0,b,c,a);b=this.__style;""!==b&&(f.style.cssText=b);return f}updateDOM(a,b,c){const d=this.__text;var f=a.__format,e=this.__format,g=f&16?"code":null;const h=e&16?"code":null;var l=Dd(this,f);const k=Dd(this,e);if((null===g?l:g)!==(null===h?k:h))return!0;if(g===h&&l!==k)return f=b.firstChild,null==f&&q(20),a=g=document.createElement(k),Fd(d,a,this),c=c.theme.text,void 0!==c&&Ed(k,0,e,a,c),b.replaceChild(g,f),!1;l=b;null!==h&&null!==g&&(l=b.firstChild,null==
139
- l&&q(21));Fd(d,l,this);c=c.theme.text;void 0!==c&&f!==e&&Ed(k,f,e,l,c);e=this.__style;a.__style!==e&&(b.style.cssText=e);return!1}static importDOM(){return{"#text":()=>({conversion:Hd,priority:0}),b:()=>({conversion:Id,priority:0}),em:()=>({conversion:Jd,priority:0}),i:()=>({conversion:Jd,priority:0}),span:()=>({conversion:Kd,priority:0}),strong:()=>({conversion:Jd,priority:0}),u:()=>({conversion:Jd,priority:0})}}selectionTransform(){}setFormat(a){F();const b=this.getWritable();b.__format=a;return b}setStyle(a){F();
140
- const b=this.getWritable();b.__style=a;return b}toggleFormat(a){a=ea[a];return this.setFormat(this.getFormat()^a)}toggleDirectionless(){F();const a=this.getWritable();a.__detail^=1;return a}toggleUnmergeable(){F();const a=this.getWritable();a.__detail^=2;return a}setMode(a){F();a=ha[a];const b=this.getWritable();b.__mode=a;return b}setTextContent(a){F();const b=this.getWritable();b.__text=a;return b}select(a,b){F();const c=K();var d=this.getTextContent();const f=this.__key;"string"===typeof d?(d=
141
- d.length,void 0===a&&(a=d),void 0===b&&(b=d)):b=a=0;if(J(c))d=B()._compositionKey,d!==c.anchor.key&&d!==c.focus.key||D(f),c.setTextNodeRange(this,a,this,b);else return wc(f,a,f,b,"text","text");return c}spliceText(a,b,c,d){F();const f=this.getWritable(),e=f.__text,g=c.length;let h=a;0>h&&(h=g+h,0>h&&(h=0));const l=K();d&&J(l)&&(a+=g,l.setTextNodeRange(f,a,f,a));b=e.slice(0,h)+c+e.slice(h+b);return f.setTextContent(b)}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...a){F();
142
- var b=this.getLatest(),c=b.getTextContent(),d=b.__key,f=B()._compositionKey,e=new Set(a);a=[];var g=c.length,h="";for(var l=0;l<g;l++)""!==h&&e.has(l)&&(a.push(h),h=""),h+=c[l];""!==h&&a.push(h);e=a.length;if(0===e)return[];if(a[0]===c)return[b];var k=a[0];c=b.getParentOrThrow();l=c.__key;const m=b.getFormat(),n=b.getStyle(),t=b.__detail;g=!1;b.isSegmented()?(h=L(k),h.__parent=l,h.__format=m,h.__style=n,h.__detail=t,g=!0):(h=b.getWritable(),h.__text=k);b=K();h=[h];k=k.length;for(let y=1;y<e;y++){var p=
143
- a[y],A=p.length;p=L(p).getWritable();p.__format=m;p.__style=n;p.__detail=t;const E=p.__key;A=k+A;if(J(b)){const x=b.anchor,G=b.focus;x.key===d&&"text"===x.type&&x.offset>k&&x.offset<=A&&(x.key=E,x.offset-=k,b.dirty=!0);G.key===d&&"text"===G.type&&G.offset>k&&G.offset<=A&&(G.key=E,G.offset-=k,b.dirty=!0)}f===d&&D(E);k=A;p.__parent=l;h.push(p)}Aa(this);f=c.getWritable().__children;d=f.indexOf(d);a=h.map(y=>y.__key);g?(f.splice(d,0,...a),this.remove()):f.splice(d,1,...a);J(b)&&xc(b,c,d,e-1);return h}mergeWithSibling(a){const b=
144
- a===this.getPreviousSibling();b||a===this.getNextSibling()||q(22);const c=this.__key,d=a.__key,f=this.__text,e=f.length;B()._compositionKey===d&&D(c);const g=K();if(J(g)){const h=g.anchor,l=g.focus;null!==h&&h.key===d&&(Ac(h,b,c,a,e),g.dirty=!0);null!==l&&l.key===d&&(Ac(l,b,c,a,e),g.dirty=!0)}this.setTextContent(b?a.__text+f:f+a.__text);a.remove();return this.getLatest()}isTextEntity(){return!1}}
145
- function Kd(a){const b="700"===a.style.fontWeight;return{forChild:c=>{w(c)&&b&&c.toggleFormat("bold");return c},node:null}}function Id(a){const b="normal"===a.style.fontWeight;return{forChild:c=>{w(c)&&!b&&c.toggleFormat("bold");return c},node:null}}function Hd(a){return{node:L(a.textContent)}}const Ld={em:"italic",i:"italic",strong:"bold",u:"underline"};function Jd(a){const b=Ld[a.nodeName.toLowerCase()];return void 0===b?{node:null}:{forChild:c=>{w(c)&&c.toggleFormat(b);return c},node:null}}
146
- function L(a=""){return new Gd(a)}function w(a){return a instanceof Gd}
147
- class Md extends Fc{static getType(){return"paragraph"}static clone(a){return new Md(a.__key)}constructor(a){super(a)}createDOM(a){const b=document.createElement("p");a=Pa(a.theme,"paragraph");void 0!==a&&b.classList.add(...a);return b}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Nd,priority:0})}}exportDOM(a){({element:a}=super.exportDOM(a));a&&0===this.getTextContentSize()&&a.append(document.createElement("br"));return{element:a}}insertNewAfter(){const a=fc(),b=this.getDirection();
148
- a.setDirection(b);this.insertAfter(a);return a}collapseAtStart(){const a=this.getChildren();if(0===a.length||w(a[0])&&""===a[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Nd(){return{node:fc()}}function fc(){return new Md}
149
- function Mb(a,b,c,d){const f=a._keyToDOMMap;f.clear();a._editorState=Hc();a._pendingEditorState=d;a._compositionKey=null;a._dirtyType=0;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();a._normalizedNodes=new Set;a._updateTags=new Set;a._updates=[];d=a._observer;null!==d&&(d.disconnect(),a._observer=null);null!==b&&(b.textContent="");null!==c&&(c.textContent="",f.set("root",c))}
150
- function Od(a){const b=new Map,c=new Set;a.forEach(d=>{d=d.klass.importDOM;if(!c.has(d)){c.add(d);var f=d();null!==f&&Object.keys(f).forEach(e=>{let g=b.get(e);void 0===g&&(g=[],b.set(e,g));g.push(f[e])})}});return b}
151
- function cb(a){var b=a||{},c=b.namespace||Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5);const d=b.theme||{},f=b.context||{},e=b.parentEditor||null,g=b.disableEvents||!1,h=Hc();a=b.editorState;const l=[Gc,Gd,Bd,Md,...(b.nodes||[])],k=b.onError;b=b.readOnly||!1;const m=new Map;for(let n=0;n<l.length;n++){const t=l[n],p=t.getType();m.set(p,{klass:t,transforms:new Set})}c=new Pd(h,e,m,{context:f,disableEvents:g,namespace:c,theme:d},k,Od(m),b);void 0!==a&&(c._pendingEditorState=a,c._dirtyType=
128
+ this.getWritable().__indent=a;return this}splice(a,b,c){F();const d=this.getWritable();var f=d.__key;const e=d.__children,g=c.length;var h=[];for(let l=0;l<g;l++){const k=c[l],m=k.getWritable();k.__key===f&&q(49);ya(m);m.__parent=f;h.push(m.__key)}(c=this.getChildAtIndex(a-1))&&Aa(c);(f=this.getChildAtIndex(a+b))&&Aa(f);a===e.length?(e.push(...h),a=[]):a=e.splice(a,b,...h);if(a.length&&(b=K(),J(b))){const l=new Set(a),k=new Set(h);h=u=>{for(u=u.getNode();u;){const p=u.__key;if(l.has(p)&&!k.has(p))return!0;
129
+ u=u.getParent()}return!1};const {anchor:m,focus:n}=b;h(m)&&sd(m,m.getNode(),this,c,f);h(n)&&sd(n,n.getNode(),this,c,f);h=a.length;for(b=0;b<h;b++)c=G(a[b]),null!=c&&(c.getWritable().__parent=null);0!==e.length||this.canBeEmpty()||M(this)||this.remove()}return d}insertNewAfter(){return null}canInsertTab(){return!1}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}canMergeWith(){return!1}}
130
+ function C(a){return a instanceof yd}
131
+ class zd extends yd{static getType(){return"root"}static clone(){return new zd}constructor(){super("root");this.__cachedText=null}getTopLevelElementOrThrow(){q(70)}getTextContent(a,b){const c=this.__cachedText;return!X&&0!==B()._dirtyType||null===c||a&&!1===b?super.getTextContent(a,b):c}remove(){q(10)}replace(){q(11)}insertBefore(){q(12)}insertAfter(){q(13)}updateDOM(){return!1}append(...a){for(let b=0;b<a.length;b++){const c=a[b];C(c)||t(c)||q(46)}return super.append(...a)}toJSON(){return{__children:this.__children,__dir:this.__dir,
132
+ __format:this.__format,__indent:this.__indent,__key:"root",__parent:null,__type:"root"}}}function M(a){return a instanceof zd}function Tc(a,b){b=b.getEditorState()._selection;a=a._selection;if(null!==a){if(a.dirty||!a.is(b))return!0}else if(null!==b)return!0;return!1}function Ad(){return new Cc(new Map([["root",new zd]]))}
133
+ class Cc{constructor(a,b){this._nodeMap=a;this._selection=b||null;this._readOnly=this._flushSync=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(a){a:{const c=U,d=X,f=V;U=this;X=!0;V=null;try{var b=a();break a}finally{U=c,X=d,V=f}b=void 0}return b}clone(a){a=new Cc(this._nodeMap,void 0===a?this._selection:a);a._readOnly=!0;return a}toJSON(){const a=this._selection;return{_nodeMap:Array.from(this._nodeMap.entries()),_selection:J(a)?{anchor:{key:a.anchor.key,offset:a.anchor.offset,
134
+ type:a.anchor.type},focus:{key:a.focus.key,offset:a.focus.offset,type:a.focus.type},type:"range"}:Sc(a)?{nodes:Array.from(a._nodes),type:"node"}:hd(a)?{anchorCellKey:a.anchorCellKey,focusCellKey:a.focusCellKey,gridKey:a.gridKey,type:"grid"}:null}}}
135
+ class Bd extends wd{static getType(){return"linebreak"}static clone(a){return new Bd(a.__key)}constructor(a){super(a)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:()=>({conversion:Cd,priority:0})}}}function Cd(){return{node:md()}}function md(){return new Bd}function xa(a){return a instanceof Bd}function Dd(a,b){return b&16?"code":b&32?"sub":b&64?"sup":null}function Ed(a,b){return b&1?"strong":b&2?"em":"span"}
136
+ function Hd(a,b,c,d,f){a=d.classList;d=Pa(f,"base");void 0!==d&&a.add(...d);d=Pa(f,"underlineStrikethrough");let e=!1;const g=b&8&&b&4;var h=c&8&&c&4;void 0!==d&&(h?(e=!0,g||a.add(...d)):g&&a.remove(...d));for(const l in ca)h=ca[l],d=Pa(f,l),void 0!==d&&(c&h?!e||"underline"!==l&&"strikethrough"!==l?(0===(b&h)||g&&"underline"===l||"strikethrough"===l)&&a.add(...d):b&h&&a.remove(...d):b&h&&a.remove(...d))}
137
+ function Id(a,b,c){const d=b.firstChild;c=c.isComposing();a+=c?"\u200b":"";if(null==d)b.textContent=a;else if(b=d.nodeValue,b!==a)if(c){c=b.length;const f=a.length;let e=0,g=0;for(;e<c&&e<f&&b[e]===a[e];)e++;for(;g+e<c&&g+e<f&&b[c-g-1]===a[f-g-1];)g++;a=[e,c-e-g,a.slice(e,f-g)];const [h,l,k]=a;0!==l&&d.deleteData(h,l);d.insertData(h,k)}else d.nodeValue=a}
138
+ class Jd extends wd{static getType(){return"text"}static clone(a){return new Jd(a.__text,a.__key)}constructor(a,b){super(b);this.__text=a;this.__format=0;this.__style="";this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isSegmented(){return 2===this.getLatest().__mode}isInert(){return 3===this.getLatest().__mode}isDirectionless(){return 0!==(this.getLatest().__detail&1)}isUnmergeable(){return 0!==
139
+ (this.getLatest().__detail&2)}hasFormat(a){a=ca[a];return 0!==(this.getFormat()&a)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(a,b){return!a&&this.isInert()||!1===b&&this.isDirectionless()?"":this.getLatest().__text}getFormatFlags(a,b){const c=this.getLatest().__format;return va(c,a,b)}createDOM(a){var b=this.__format,c=Dd(this,b);const d=Ed(this,b),f=document.createElement(null===c?d:c);let e=f;null!==c&&(e=document.createElement(d),f.appendChild(e));c=e;Id(this.__text,
140
+ c,this);a=a.theme.text;void 0!==a&&Hd(d,0,b,c,a);b=this.__style;""!==b&&(f.style.cssText=b);return f}updateDOM(a,b,c){const d=this.__text;var f=a.__format,e=this.__format,g=Dd(this,f);const h=Dd(this,e);var l=Ed(this,f);const k=Ed(this,e);if((null===g?l:g)!==(null===h?k:h))return!0;if(g===h&&l!==k)return f=b.firstChild,null==f&&q(20),a=g=document.createElement(k),Id(d,a,this),c=c.theme.text,void 0!==c&&Hd(k,0,e,a,c),b.replaceChild(g,f),!1;l=b;null!==h&&null!==g&&(l=b.firstChild,null==l&&q(21));Id(d,
141
+ l,this);c=c.theme.text;void 0!==c&&f!==e&&Hd(k,f,e,l,c);e=this.__style;a.__style!==e&&(b.style.cssText=e);return!1}static importDOM(){return{"#text":()=>({conversion:Kd,priority:0}),b:()=>({conversion:Ld,priority:0}),em:()=>({conversion:Md,priority:0}),i:()=>({conversion:Md,priority:0}),span:()=>({conversion:Nd,priority:0}),strong:()=>({conversion:Md,priority:0}),u:()=>({conversion:Md,priority:0})}}selectionTransform(){}setFormat(a){F();const b=this.getWritable();b.__format=a;return b}setStyle(a){F();
142
+ const b=this.getWritable();b.__style=a;return b}toggleFormat(a){a=ca[a];return this.setFormat(this.getFormat()^a)}toggleDirectionless(){F();const a=this.getWritable();a.__detail^=1;return a}toggleUnmergeable(){F();const a=this.getWritable();a.__detail^=2;return a}setMode(a){F();a=ha[a];const b=this.getWritable();b.__mode=a;return b}setTextContent(a){F();const b=this.getWritable();b.__text=a;return b}select(a,b){F();const c=K();var d=this.getTextContent();const f=this.__key;"string"===typeof d?(d=
143
+ d.length,void 0===a&&(a=d),void 0===b&&(b=d)):b=a=0;if(J(c))d=B()._compositionKey,d!==c.anchor.key&&d!==c.focus.key||D(f),c.setTextNodeRange(this,a,this,b);else return pd(f,a,f,b,"text","text");return c}spliceText(a,b,c,d){F();const f=this.getWritable(),e=f.__text,g=c.length;let h=a;0>h&&(h=g+h,0>h&&(h=0));const l=K();d&&J(l)&&(a+=g,l.setTextNodeRange(f,a,f,a));b=e.slice(0,h)+c+e.slice(h+b);return f.setTextContent(b)}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...a){F();
144
+ var b=this.getLatest(),c=b.getTextContent(),d=b.__key,f=B()._compositionKey,e=new Set(a);a=[];var g=c.length,h="";for(var l=0;l<g;l++)""!==h&&e.has(l)&&(a.push(h),h=""),h+=c[l];""!==h&&a.push(h);e=a.length;if(0===e)return[];if(a[0]===c)return[b];var k=a[0];c=b.getParentOrThrow();l=c.__key;const m=b.getFormat(),n=b.getStyle(),u=b.__detail;g=!1;b.isSegmented()?(h=L(k),h.__parent=l,h.__format=m,h.__style=n,h.__detail=u,g=!0):(h=b.getWritable(),h.__text=k);b=K();h=[h];k=k.length;for(let y=1;y<e;y++){var p=
145
+ a[y],A=p.length;p=L(p).getWritable();p.__format=m;p.__style=n;p.__detail=u;const E=p.__key;A=k+A;if(J(b)){const x=b.anchor,H=b.focus;x.key===d&&"text"===x.type&&x.offset>k&&x.offset<=A&&(x.key=E,x.offset-=k,b.dirty=!0);H.key===d&&"text"===H.type&&H.offset>k&&H.offset<=A&&(H.key=E,H.offset-=k,b.dirty=!0)}f===d&&D(E);k=A;p.__parent=l;h.push(p)}za(this);f=c.getWritable().__children;d=f.indexOf(d);a=h.map(y=>y.__key);g?(f.splice(d,0,...a),this.remove()):f.splice(d,1,...a);J(b)&&qd(b,c,d,e-1);return h}mergeWithSibling(a){const b=
146
+ a===this.getPreviousSibling();b||a===this.getNextSibling()||q(22);const c=this.__key,d=a.__key,f=this.__text,e=f.length;B()._compositionKey===d&&D(c);const g=K();if(J(g)){const h=g.anchor,l=g.focus;null!==h&&h.key===d&&(td(h,b,c,a,e),g.dirty=!0);null!==l&&l.key===d&&(td(l,b,c,a,e),g.dirty=!0)}this.setTextContent(b?a.__text+f:f+a.__text);a.remove();return this.getLatest()}isTextEntity(){return!1}}
147
+ function Nd(a){const b="700"===a.style.fontWeight;return{forChild:c=>{w(c)&&b&&c.toggleFormat("bold");return c},node:null}}function Ld(a){const b="normal"===a.style.fontWeight;return{forChild:c=>{w(c)&&!b&&c.toggleFormat("bold");return c},node:null}}function Kd(a){return{node:L(a.textContent)}}const Od={em:"italic",i:"italic",strong:"bold",u:"underline"};function Md(a){const b=Od[a.nodeName.toLowerCase()];return void 0===b?{node:null}:{forChild:c=>{w(c)&&c.toggleFormat(b);return c},node:null}}
148
+ function L(a=""){return new Jd(a)}function w(a){return a instanceof Jd}
149
+ class Pd extends yd{static getType(){return"paragraph"}static clone(a){return new Pd(a.__key)}createDOM(a){const b=document.createElement("p");a=Pa(a.theme,"paragraph");void 0!==a&&b.classList.add(...a);return b}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Qd,priority:0})}}exportDOM(a){({element:a}=super.exportDOM(a));a&&0===this.getTextContentSize()&&a.append(document.createElement("br"));return{element:a}}insertNewAfter(){const a=dd(),b=this.getDirection();a.setDirection(b);
150
+ this.insertAfter(a);return a}collapseAtStart(){const a=this.getChildren();if(0===a.length||w(a[0])&&""===a[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Qd(){return{node:dd()}}function dd(){return new Pd}
151
+ function Gc(a,b,c,d){const f=a._keyToDOMMap;f.clear();a._editorState=Ad();a._pendingEditorState=d;a._compositionKey=null;a._dirtyType=0;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();a._normalizedNodes=new Set;a._updateTags=new Set;a._updates=[];d=a._observer;null!==d&&(d.disconnect(),a._observer=null);null!==b&&(b.textContent="");null!==c&&(c.textContent="",f.set("root",c))}
152
+ function Rd(a){const b=new Map,c=new Set;a.forEach(d=>{d=d.klass.importDOM;if(!c.has(d)){c.add(d);var f=d();null!==f&&Object.keys(f).forEach(e=>{let g=b.get(e);void 0===g&&(g=[],b.set(e,g));g.push(f[e])})}});return b}
153
+ function cb(a){var b=a||{},c=b.namespace||Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5);const d=b.theme||{},f=b.context||{},e=b.parentEditor||null,g=b.disableEvents||!1,h=Ad();a=b.editorState;const l=[zd,Jd,Bd,Pd,...(b.nodes||[])],k=b.onError;b=b.readOnly||!1;const m=new Map;for(let n=0;n<l.length;n++){const u=l[n],p=u.getType();m.set(p,{klass:u,transforms:new Set})}c=new Sd(h,e,m,{context:f,disableEvents:g,namespace:c,theme:d},k,Rd(m),b);void 0!==a&&(c._pendingEditorState=a,c._dirtyType=
152
154
  2);return c}
153
- class Pd{constructor(a,b,c,d,f,e){this._parentEditor=b;this._rootElement=null;this._editorState=a;this._compositionKey=this._pendingEditorState=null;this._deferred=[];this._keyToDOMMap=new Map;this._updates=[];this._updating=!1;this._listeners={decorator:new Set,mutation:new Map,readonly:new Set,root:new Set,textcontent:new Set,update:new Set};this._commands=new Map;this._config=d;this._nodes=c;this._decorators={};this._pendingDecorators=null;this._dirtyType=0;this._cloneNotNeeded=new Set;this._dirtyLeaves=
155
+ class Sd{constructor(a,b,c,d,f,e){this._parentEditor=b;this._rootElement=null;this._editorState=a;this._compositionKey=this._pendingEditorState=null;this._deferred=[];this._keyToDOMMap=new Map;this._updates=[];this._updating=!1;this._listeners={decorator:new Set,mutation:new Map,readonly:new Set,root:new Set,textcontent:new Set,update:new Set};this._commands=new Map;this._config=d;this._nodes=c;this._decorators={};this._pendingDecorators=null;this._dirtyType=0;this._cloneNotNeeded=new Set;this._dirtyLeaves=
154
156
  new Set;this._dirtyElements=new Map;this._normalizedNodes=new Set;this._updateTags=new Set;this._observer=null;this._key=""+pa++;this._onError=f;this._htmlConversions=e;this._readOnly=!1}isComposing(){return null!=this._compositionKey}registerUpdateListener(a){const b=this._listeners.update;b.add(a);return()=>{b.delete(a)}}registerReadOnlyListener(a){const b=this._listeners.readonly;b.add(a);return()=>{b.delete(a)}}registerDecoratorListener(a){const b=this._listeners.decorator;b.add(a);return()=>
155
157
  {b.delete(a)}}registerTextContentListener(a){const b=this._listeners.textcontent;b.add(a);return()=>{b.delete(a)}}registerRootListener(a){const b=this._listeners.root;a(this._rootElement,null);b.add(a);return()=>{a(null,this._rootElement);b.delete(a)}}registerCommand(a,b,c){void 0===c&&q(56);const d=this._commands;d.has(a)||d.set(a,[new Set,new Set,new Set,new Set,new Set]);const f=d.get(a);void 0===f&&q(81,a);const e=f[c];e.add(b);return()=>{e.delete(b);f.every(g=>0===g.size)&&d.delete(a)}}registerMutationListener(a,
156
- b){void 0===this._nodes.get(a.getType())&&q(57,a.name);const c=this._listeners.mutation;c.set(b,a);return()=>{c.delete(b)}}registerNodeTransform(a,b){const c=a.getType(),d=this._nodes.get(c);void 0===d&&q(57,a.name);const f=d.transforms;f.add(b);Ha(this,c);return()=>{f.delete(b)}}hasNodes(a){for(let b=0;b<a.length;b++){const c=a[b].getType();if(!this._nodes.has(c))return!1}return!0}dispatchCommand(a,b){return V(this,a,b)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(a){const b=
157
- this._rootElement;if(a!==b){var c=this._pendingEditorState||this._editorState;this._rootElement=a;Mb(this,b,a,c);if(null!==b&&!this._config.disableEvents){0!==Rc&&(Rc--,0===Rc&&b.ownerDocument.removeEventListener("selectionchange",rd));c=b.__lexicalEditor;if(null!=c){if(null!==c._parentEditor){var d=Ka(c);d=d[d.length-1]._key;qd.get(d)===c&&qd.delete(d)}else qd.delete(c._key);b.__lexicalEditor=null}c=pd(b);for(d=0;d<c.length;d++)c[d]();b.__lexicalEventHandles=[]}null!==a&&(c=a.style,c.userSelect=
158
- "text",c.whiteSpace="pre-wrap",c.wordBreak="break-word",a.setAttribute("data-lexical-editor","true"),this._dirtyType=2,Nb(this),this._updateTags.add("history-merge"),Kb(this),this._config.disableEvents||sd(a,this));Ob("root",this,!1,a,b)}}getElementByKey(a){return this._keyToDOMMap.get(a)||null}getEditorState(){return this._editorState}setEditorState(a,b){a.isEmpty()&&q(19);ac(this);const c=this._pendingEditorState,d=this._updateTags;b=void 0!==b?b.tag:null;null===c||c.isEmpty()||(null!=b&&d.add(b),
159
- Kb(this));this._pendingEditorState=a;this._dirtyType=2;this._compositionKey=null;null!=b&&d.add(b);Kb(this)}parseEditorState(a){a=JSON.parse(a);return db(a,this)}update(a,b){I(this,a,b)}focus(a){const b=this._rootElement;null!==b&&(b.setAttribute("autocapitalize","off"),I(this,()=>{const c=K(),d=Ga();null!==c?c.dirty=!0:0!==d.getChildrenSize()&&d.selectEnd()},{onUpdate:()=>{b.removeAttribute("autocapitalize");a&&a()}}))}blur(){var a=this._rootElement;null!==a&&a.blur();a=window.getSelection();null!==
160
- a&&a.removeAllRanges()}isReadOnly(){return this._readOnly}setReadOnly(a){this._readOnly=a;Ob("readonly",this,!0,a)}toJSON(){return{editorState:this._editorState}}}class Qd extends Fc{constructor(a,b){super(b)}}function rc(a){return a instanceof Qd}class Rd extends Fc{}function kc(a){return a instanceof Rd}class Sd extends Fc{}function lc(a){return a instanceof Sd}
161
- const Tc={},Uc={},Yc={},Zc={},$c={},Xc={},ad={},bd={},cd={},dd={},Z={},ed={},fd={},od={},nd={},md={},ld={},gd={},hd={},id={},jd={},kd={},Ad={},xd={},wd={},vd={},yd={},zd={};exports.$createGridSelection=function(){return new ic("root","root","root")};exports.$createLineBreakNode=tc;exports.$createNodeFromParse=function(a,b){F();const c=B();return bb(a,b,c,null)};exports.$createNodeSelection=function(){return new gc(new Set)};exports.$createParagraphNode=fc;
162
- exports.$createRangeSelection=function(){const a=X("root",0,"element"),b=X("root",0,"element");return new hc(a,b,0)};exports.$createTextNode=L;exports.$getDecoratorNode=Sa;exports.$getNearestNodeFromDOMNode=sa;exports.$getNodeByKey=H;exports.$getPreviousSelection=Na;exports.$getRoot=Ga;exports.$getSelection=K;exports.$isDecoratorNode=u;exports.$isElementNode=C;exports.$isGridCellNode=rc;exports.$isGridNode=kc;exports.$isGridRowNode=lc;exports.$isGridSelection=jc;exports.$isLeafNode=wa;
163
- exports.$isLineBreakNode=ya;exports.$isNodeSelection=Tb;exports.$isParagraphNode=function(a){return a instanceof Md};exports.$isRangeSelection=J;exports.$isRootNode=M;exports.$isTextNode=w;exports.$nodesOfType=function(a){var b=z();const c=b._readOnly,d=a.getType();b=b._nodeMap;const f=[];for(const [,e]of b)e instanceof a&&e.__type===d&&(c||e.isAttached())&&f.push(e);return f};exports.$setCompositionKey=D;exports.$setSelection=Ia;exports.BLUR_COMMAND=zd;exports.CAN_REDO_COMMAND={};
164
- exports.CAN_UNDO_COMMAND={};exports.CLEAR_EDITOR_COMMAND={};exports.CLEAR_HISTORY_COMMAND={};exports.CLICK_COMMAND=Uc;exports.COPY_COMMAND=wd;exports.CUT_COMMAND=vd;exports.DELETE_CHARACTER_COMMAND=Yc;exports.DELETE_LINE_COMMAND=dd;exports.DELETE_WORD_COMMAND=cd;exports.DRAGSTART_COMMAND=xd;exports.DROP_COMMAND=Ad;exports.DecoratorNode=Ec;exports.ElementNode=Fc;exports.FOCUS_COMMAND=yd;exports.FORMAT_ELEMENT_COMMAND={};exports.FORMAT_TEXT_COMMAND=Z;exports.GridCellNode=Qd;exports.GridNode=Rd;
165
- exports.GridRowNode=Sd;exports.INDENT_CONTENT_COMMAND={};exports.INSERT_LINE_BREAK_COMMAND=Zc;exports.INSERT_PARAGRAPH_COMMAND=$c;exports.INSERT_TEXT_COMMAND=Xc;exports.KEY_ARROW_DOWN_COMMAND=ld;exports.KEY_ARROW_LEFT_COMMAND=nd;exports.KEY_ARROW_RIGHT_COMMAND=od;exports.KEY_ARROW_UP_COMMAND=md;exports.KEY_BACKSPACE_COMMAND=hd;exports.KEY_DELETE_COMMAND=jd;exports.KEY_ENTER_COMMAND=gd;exports.KEY_ESCAPE_COMMAND=id;exports.KEY_TAB_COMMAND=kd;exports.OUTDENT_CONTENT_COMMAND={};
166
- exports.PASTE_COMMAND=ad;exports.ParagraphNode=Md;exports.READ_ONLY_COMMAND={};exports.REDO_COMMAND=fd;exports.REMOVE_TEXT_COMMAND=bd;exports.SELECTION_CHANGE_COMMAND=Tc;exports.TextNode=Gd;exports.UNDO_COMMAND=ed;exports.VERSION="0.2.1";exports.createCommand=function(){return{}};exports.createEditor=cb;
158
+ b){void 0===this._nodes.get(a.getType())&&q(57,a.name);const c=this._listeners.mutation;c.set(b,a);return()=>{c.delete(b)}}registerNodeTransform(a,b){const c=a.getType(),d=this._nodes.get(c);void 0===d&&q(57,a.name);const f=d.transforms;f.add(b);Ha(this,c);return()=>{f.delete(b)}}hasNodes(a){for(let b=0;b<a.length;b++){const c=a[b].getType();if(!this._nodes.has(c))return!1}return!0}dispatchCommand(a,b){return P(this,a,b)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(a){const b=
159
+ this._rootElement;if(a!==b){var c=this._pendingEditorState||this._editorState;this._rootElement=a;Gc(this,b,a,c);if(null!==b&&!this._config.disableEvents){0!==Ob&&(Ob--,0===Ob&&b.ownerDocument.removeEventListener("selectionchange",Wb));c=b.__lexicalEditor;if(null!=c){if(null!==c._parentEditor){var d=Ka(c);d=d[d.length-1]._key;Vb.get(d)===c&&Vb.delete(d)}else Vb.delete(c._key);b.__lexicalEditor=null}c=Ub(b);for(d=0;d<c.length;d++)c[d]();b.__lexicalEventHandles=[]}null!==a&&(c=a.style,c.userSelect=
160
+ "text",c.whiteSpace="pre-wrap",c.wordBreak="break-word",a.setAttribute("data-lexical-editor","true"),this._dirtyType=2,Hc(this),this._updateTags.add("history-merge"),Ec(this),this._config.disableEvents||Xb(a,this));Ic("root",this,!1,a,b)}}getElementByKey(a){return this._keyToDOMMap.get(a)||null}getEditorState(){return this._editorState}setEditorState(a,b){a.isEmpty()&&q(19);Tb(this);const c=this._pendingEditorState,d=this._updateTags;b=void 0!==b?b.tag:null;null===c||c.isEmpty()||(null!=b&&d.add(b),
161
+ Ec(this));this._pendingEditorState=a;this._dirtyType=2;this._compositionKey=null;null!=b&&d.add(b);Ec(this)}parseEditorState(a){a=JSON.parse(a);return db(a,this)}update(a,b){I(this,a,b)}focus(a){const b=this._rootElement;null!==b&&(b.setAttribute("autocapitalize","off"),I(this,()=>{const c=K(),d=Ga();null!==c?c.dirty=!0:0!==d.getChildrenSize()&&d.selectEnd()},{onUpdate:()=>{b.removeAttribute("autocapitalize");a&&a()}}))}blur(){var a=this._rootElement;null!==a&&a.blur();a=window.getSelection();null!==
162
+ a&&a.removeAllRanges()}isReadOnly(){return this._readOnly}setReadOnly(a){this._readOnly=a;Ic("readonly",this,!0,a)}toJSON(){return{editorState:this._editorState}}}class Td extends yd{constructor(a,b){super(b)}}function kd(a){return a instanceof Td}class Ud extends yd{}function id(a){return a instanceof Ud}class Vd extends yd{}function jd(a){return a instanceof Vd}exports.$createGridSelection=function(){return new gd("root","root","root")};exports.$createLineBreakNode=md;
163
+ exports.$createNodeFromParse=function(a,b){F();const c=B();return bb(a,b,c,null)};exports.$createNodeSelection=function(){return new ed(new Set)};exports.$createParagraphNode=dd;exports.$createRangeSelection=function(){const a=Y("root",0,"element"),b=Y("root",0,"element");return new fd(a,b,0)};exports.$createTextNode=L;exports.$getDecoratorNode=Sa;exports.$getNearestNodeFromDOMNode=sa;exports.$getNodeByKey=G;exports.$getPreviousSelection=Na;exports.$getRoot=Ga;exports.$getSelection=K;
164
+ exports.$isDecoratorNode=t;exports.$isElementNode=C;exports.$isGridCellNode=kd;exports.$isGridNode=id;exports.$isGridRowNode=jd;exports.$isGridSelection=hd;exports.$isLeafNode=wa;exports.$isLineBreakNode=xa;exports.$isNodeSelection=Sc;exports.$isParagraphNode=function(a){return a instanceof Pd};exports.$isRangeSelection=J;exports.$isRootNode=M;exports.$isTextNode=w;
165
+ exports.$nodesOfType=function(a){var b=z();const c=b._readOnly,d=a.getType();b=b._nodeMap;const f=[];for(const [,e]of b)e instanceof a&&e.__type===d&&(c||e.isAttached())&&f.push(e);return f};exports.$setCompositionKey=D;exports.$setSelection=Ia;exports.BLUR_COMMAND=Db;exports.CAN_REDO_COMMAND={};exports.CAN_UNDO_COMMAND={};exports.CLEAR_EDITOR_COMMAND={};exports.CLEAR_HISTORY_COMMAND={};exports.CLICK_COMMAND=fb;exports.COMMAND_PRIORITY_CRITICAL=4;exports.COMMAND_PRIORITY_EDITOR=0;
166
+ exports.COMMAND_PRIORITY_HIGH=3;exports.COMMAND_PRIORITY_LOW=1;exports.COMMAND_PRIORITY_NORMAL=2;exports.COPY_COMMAND=Ab;exports.CUT_COMMAND=Bb;exports.DELETE_CHARACTER_COMMAND=gb;exports.DELETE_LINE_COMMAND=mb;exports.DELETE_WORD_COMMAND=lb;exports.DRAGSTART_COMMAND=zb;exports.DROP_COMMAND=yb;exports.DecoratorNode=xd;exports.ElementNode=yd;exports.FOCUS_COMMAND=Cb;exports.FORMAT_ELEMENT_COMMAND={};exports.FORMAT_TEXT_COMMAND=O;exports.GridCellNode=Td;exports.GridNode=Ud;exports.GridRowNode=Vd;
167
+ exports.INDENT_CONTENT_COMMAND={};exports.INSERT_LINE_BREAK_COMMAND=hb;exports.INSERT_PARAGRAPH_COMMAND=ib;exports.INSERT_TEXT_COMMAND=N;exports.KEY_ARROW_DOWN_COMMAND=sb;exports.KEY_ARROW_LEFT_COMMAND=qb;exports.KEY_ARROW_RIGHT_COMMAND=pb;exports.KEY_ARROW_UP_COMMAND=rb;exports.KEY_BACKSPACE_COMMAND=ub;exports.KEY_DELETE_COMMAND=wb;exports.KEY_ENTER_COMMAND=tb;exports.KEY_ESCAPE_COMMAND=vb;exports.KEY_MODIFIER_COMMAND=Eb;exports.KEY_TAB_COMMAND=xb;exports.OUTDENT_CONTENT_COMMAND={};
168
+ exports.PASTE_COMMAND=jb;exports.ParagraphNode=Pd;exports.REDO_COMMAND=ob;exports.REMOVE_TEXT_COMMAND=kb;exports.SELECTION_CHANGE_COMMAND=eb;exports.TextNode=Jd;exports.UNDO_COMMAND=nb;exports.VERSION="0.2.4";exports.createCommand=function(){return{}};exports.createEditor=cb;