(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,703057,974725,410911,e=>{"use strict";function t(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;itypeof window&&void 0!==window.document&&void 0!==window.document.createElement,r=i&&"documentMode"in document?document.documentMode:null,l=i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),o=i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),s=!(!i||!("InputEvent"in window)||r)&&"getTargetRanges"in new window.InputEvent("input"),a=i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),u=i&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,d=i&&/Android/.test(navigator.userAgent),c=i&&/^(?=.*Chrome).*/i.test(navigator.userAgent),f=i&&d&&c,g=i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&l&&!c,h=a||u||g?" ":"​",p=o?" ":h,_="֑-߿יִ-﷽ﹰ-ﻼ",m="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",y=RegExp("^[^"+m+"]*["+_+"]"),C=RegExp("^[^"+_+"]*["+m+"]"),S={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},N={directionless:1,unmergeable:2},x={center:2,end:6,justify:4,left:1,right:3,start:5},v={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},E={normal:0,segmented:2,token:1},T={0:"normal",2:"segmented",1:"token"},O="$config",M=!1,A=0;function b(e){A=e.timeStamp}function D(e,t,n){let i="BR"===e.nodeName,r=t.__lexicalLineBreak;return r&&(e===r||i&&e.previousSibling===r)||i&&void 0!==i6(e,n)}function w(e,t,n){M=!0;let i=performance.now()-A>100;try{id(e,()=>{let r=nB()||e.getEditorState().read(()=>{let e=nB();return null!==e?e.clone():null}),l=new Map,s=e.getRootElement(),a=e._editorState,u=e._blockCursorElement,d=!1,c="";for(let n=0;n0){let t=0;for(let r=0;r0)for(let[t,n]of l)n.reconcileObservedMutation(t,e);let f=n.takeRecords();if(f.length>0){for(let t=0;t{w(e,t,n)})}class I{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||W).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}}function P(e,t){return new I(e,t)}function $(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"latest",i=("latest"===n?e.getLatest():e).__state;return i?i.getValue(t):t.defaultValue}function L(e,t,n){let i;if(n6(),"function"==typeof n){let r=e.getLatest(),l=$(r,t);if(i=n(l),t.isEqual(l,i))return r}else i=n;let r=e.getWritable();return K(r).updateFromKnown(t,i),r}class F{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n,i=new Map,r){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=i;const{sharedConfigMap:l}=this.sharedNodeState,o=void 0!==r?r:function(e,t,n){let i=n.size;if(t)for(let r in t){let t=e.get(r);t&&n.has(t)||i++}return i}(l,n,i);this.size=o}getValue(e){let t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return z(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:n}=this,i=new Map(this.knownState);return new F(e,t,function(e,t,n){let i;if(n)for(let[r,l]of Object.entries(n)){let n=e.get(r);n?t.has(n)||t.set(n,n.parse(l)):(i=i||{})[r]=l}return i}(t.sharedConfigMap,i,n),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:i,unknownState:r}=this;i.has(e)||r&&n in r||(r&&(delete r[n],this.unknownState=z(r)),this.size++),i.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}}function K(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new F(t,B(t));return t.__state=n,n}function B(e){return e.__state?e.__state.sharedNodeState:iP(rY(),e.getType()).sharedNodeState}function z(e){if(e)for(let t in e)return e}function W(e){return e}function Y(e,t,n){for(let[i,r]of t.knownState){if(e.has(i.key))continue;e.add(i.key);let t=n?n.getValue(i):i.defaultValue;if(t!==r&&!i.isEqual(t,r))return!0}return!1}function j(e,t,n){let{unknownState:i}=t,r=n?n.unknownState:void 0;if(i){for(let[t,n]of Object.entries(i))if(!e.has(t)&&(e.add(t),n!==(r?r[t]:void 0)))return!0}return!1}function U(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function H(e,t){let n=e.__mode,i=e.__format,r=e.__style,l=t.__mode,o=t.__format,s=t.__style,a=e.__state,u=t.__state;return(null===n||n===l)&&(null===i||i===o)&&(null===r||r===s)&&(null===e.__state||a===u||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&Y(n,e,t)||t&&Y(n,t,e)||e&&j(n,e,t)||t&&j(n,t,e))}(a,u))}function J(e,t){let n=e.mergeWithSibling(t),i=n7()._normalizedNodes;return i.add(e.__key),i.add(t.__key),n}function G(e){let t,n,i=e;if(""!==i.__text||!i.isSimpleText()||i.isUnmergeable()){for(;null!==(t=i.getPreviousSibling())&&ng(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){H(t,i)&&(i=J(t,i));break}t.remove()}for(;null!==(n=i.getNextSibling())&&ng(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){H(i,n)&&(i=J(i,n));break}n.remove()}}else i.remove()}function V(e){return q(e.anchor),q(e.focus),e}function q(e){for(;"element"===e.type;){let t,n,i=e.getNode(),r=e.offset;if(r===i.getChildrenSize()?(t=i.getChildAtIndex(r-1),n=!0):(t=i.getChildAtIndex(r),n=!1),ng(t)){e.set(t.__key,n?t.getTextContentSize():0,"text",!0);break}if(!ip(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element",!0)}}let X,Z,Q,ee,et,en,ei,er,el,eo,es="",ea=null,eu=null,ed=!1,ec=!1;function ef(e,t){let n=ei.get(e);if(null!==t){let n=eO(e);n.parentNode===t&&t.removeChild(n)}if(er.has(e)||Z._keyToDOMMap.delete(e),ip(n)){let e=ex(n,ei);eg(e,0,e.length-1,null)}void 0!==n&&r_(eo,Q,ee,n,"destroyed")}function eg(e,t,n,i){for(let r=t;r<=n;++r){let t=e[r];void 0!==t&&ef(t,i)}}function eh(e,t){e.setProperty("text-align",t)}function ep(e,t){let n=X.theme.indent;if("string"==typeof n){let i=e.classList.contains(n);t>0&&!i?e.classList.add(n):t<1&&i&&e.classList.remove(n)}if(0===t)return void e.style.setProperty("padding-inline-start","");let i=getComputedStyle(Z._rootElement||e).getPropertyValue("--lexical-indent-base-value")||"40px";e.style.setProperty("padding-inline-start",`calc(${t} * ${i})`)}function e_(e,t){let n=e.style;0===t?eh(n,""):1===t?eh(n,"left"):2===t?eh(n,"center"):3===t?eh(n,"right"):4===t?eh(n,"justify"):5===t?eh(n,"start"):6===t&&eh(n,"end")}function em(e,t){let n=function(e){let t=e.__dir;if(null!==t)return t;if(iS(e))return null;let n=e.getParentOrThrow();return iS(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function ey(e,n){var i;let r,l=er.get(e);void 0===l&&t(60);let o=l.createDOM(X,Z);if(r=(i=Z)._keyToDOMMap,o[`__lexicalKey_${i._key}`]=e,r.set(e,o),ng(l)?o.setAttribute("data-lexical-text","true"):iy(l)&&o.setAttribute("data-lexical-decorator","true"),ip(l)){let e=l.__indent,t=l.__size;em(o,l),0!==e&&ep(o,e),0!==t&&eC(ex(l,er),l,0,t-1,l.getDOMSlot(o));let n=l.__format;0!==n&&e_(o,n),l.isInline()||eN(null,l,o)}else{let t=l.getTextContent();if(iy(l)){let t=l.decorate(Z,X);null!==t&&ev(e,t),o.contentEditable="false"}es+=t}return null!==n&&n.insertChild(o),r_(eo,Q,ee,l,"created"),o}function eC(e,t,n,i,r){let l=es;es="";let o=n;for(;o<=i;++o){ey(e[o],r);let t=er.get(e[o]);null!==t&&ng(t)?null===ea&&(ea=t.getFormat(),eu=t.getStyle()):ip(t)&&o{iy(i5(n))||(tx=!0)})}],["compositionstart",function(e,t){rS(t,ek,e)}],["compositionend",function(e,t){o?tE=!0:!u&&(a||g)?(tT=!0,tO=e.data):rS(t,eI,e)}],["input",function(e,t){e.stopPropagation(),id(t,()=>{t.dispatchCommand(eR,e)},{event:e}),ty=null}],["click",function(e,t){id(t,()=>{let n=nB(),i=rP(rA(t)),r=nz();if(i){if(nv(n)){let t=n.anchor,l=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!iS(l)&&1===i9().getChildrenSize()&&l.getTopLevelElementOrThrow().isEmpty()&&null!==r&&n.is(r))i.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&l!==n.focus.getNode()){let e=rQ(l,e=>ip(e)&&!e.isInline());ip(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){let n=i.anchorNode;(rL(n)||iH(n))&&re(nK(r,i,t,e))}}rS(t,eD,e)})}],["cut",tg],["copy",tg],["dragstart",tg],["dragover",tg],["dragend",tg],["paste",tg],["focus",tg],["blur",tg],["drop",tg]];s&&th.push(["beforeinput",(e,t)=>{let n;"deleteCompositionText"===(n=e.inputType)||o&&rC(t)||"insertCompositionText"!==n&&rS(t,ew,e)}]);let tp=0,t_=null,tm=0,ty=null,tC=new WeakMap,tS=new WeakMap,tN=!1,tx=!1,tv=!1,tE=!1,tT=!1,tO="",tM=null,tA=[0,"",0,"root",0];function tb(e,t,n,i,r){let l=e.anchor,o=e.focus,a=l.getNode(),u=n7(),d=rP(rA(u)),c=null!==d?d.anchorNode:null,f=l.key,g=u.getElementByKey(f),h=n.length;return f!==o.key||!ng(a)||(!r&&(!s||tm1||(r||!s)&&null!==g&&!a.isComposing()&&c!==iG(g)||null!==d&&null!==t&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||!a.isComposing()&&(a.getFormat()!==e.format||a.getStyle()!==e.style)||function(e,t){let n;if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let i=e.anchor.offset,r=t.getParentOrThrow(),l=ij(t);return 0===i?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||l||(ng(n=t.getPreviousSibling())||ip(n)&&n.isInline())&&!n.canInsertTextAfter():i===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||l)}(e,a)}function tD(e,t){return iH(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function tw(e,n,i){let{anchorNode:r,anchorOffset:l,focusNode:o,focusOffset:s}=e;tN&&(tN=!1,tD(r,l)&&tD(o,s)&&!tM)||id(n,()=>{if(!i)return void re(null);if(!iK(n,r,o))return;let a=nB();if(tM&&nv(a)&&a.isCollapsed()){let e=a.anchor,t=tM.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&re(a=tM.clone())}if(tM=null,nv(a)){let i=a.anchor,r=i.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);let l=rA(n).event,o=l?l.timeStamp:performance.now(),[s,u,d,c,f]=tA,g=i9(),h=!1===n.isComposing()&&""===g.getTextContent();if(o{id(l,()=>{i0(null)})},30),nv(o)){let e=o.anchor.getNode();e.markDirty(),ng(e)||t(142),tk(o,e)}}else{i0(null),e.preventDefault();let t=o.anchor.getNode(),n=t.getTextContent(),r=t.canInsertTextAfter(),s=0===o.anchor.offset&&o.focus.offset===n.length,a=f&&i&&!s&&r;if(a&&o.isCollapsed()&&(a=!iy(ry(o.anchor,!0))),!a){rS(l,eP,!0);let e=nB();f&&nv(e)&&e.isCollapsed()&&(tM=e,setTimeout(()=>tM=null))}}return!0}}if(!nv(o))return!0;let s=e.data;null!==ty&&ro(!1,l,ty),o.dirty&&null===ty||!o.isCollapsed()||iS(o.anchor.getNode())||null===r||o.applyDOMRange(r),ty=null;let a=o.anchor,d=o.focus,c=a.getNode(),g=d.getNode();if("insertText"===i||"insertTranspose"===i){if("\n"===s)e.preventDefault(),rS(l,e$,!1);else if("\n\n"===s)e.preventDefault(),rS(l,eL,void 0);else if(null==s&&e.dataTransfer){let t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&tb(o,r,s,e.timeStamp,!0)?(e.preventDefault(),rS(l,eF,s)):ty=s;return tm=e.timeStamp,!0}switch(e.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":rS(l,eF,e);break;case"insertFromComposition":i0(null),rS(l,eF,e);break;case"insertLineBreak":i0(null),rS(l,e$,!1);break;case"insertParagraph":i0(null),tv&&!u?(tv=!1,rS(l,e$,!1)):rS(l,eL,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":rS(l,eK,e);break;case"deleteByComposition":(c!==g||ip(c)||ip(g)||!ij(c)||!ij(g))&&rS(l,eB,e);break;case"deleteByDrag":case"deleteByCut":rS(l,eB,e);break;case"deleteContent":rS(l,eP,!1);break;case"deleteWordBackward":rS(l,ez,!0);break;case"deleteWordForward":rS(l,ez,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":rS(l,eW,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":rS(l,eW,!1);break;case"formatStrikeThrough":rS(l,eY,"strikethrough");break;case"formatBold":rS(l,eY,"bold");break;case"formatItalic":rS(l,eY,"italic");break;case"formatUnderline":rS(l,eY,"underline");break;case"historyUndo":rS(l,ej,void 0);break;case"historyRedo":rS(l,eU,void 0)}return!0}function t$(e){if(rL(e.target)&&iy(i5(e.target)))return!0;let t=n7(),n=nB(),i=e.data,r=tI(e);if(null!=i&&nv(n)&&tb(n,r,i,e.timeStamp,!1)){tE&&(tK(t,i),tE=!1);let r=n.anchor.getNode(),l=rP(rA(t));if(null===l)return!0;let a=n.isBackward(),u=a?n.anchor.offset:n.focus.offset,d=a?n.focus.offset:n.anchor.offset;s&&!n.isCollapsed()&&ng(r)&&null!==l.anchorNode&&r.getTextContent().slice(0,u)+i+r.getTextContent().slice(u+d)===rl(l.anchorNode)||rS(t,eF,i);let c=i.length;o&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),f&&t.isComposing()&&(tp=0,i0(null))}else ro(!1,t,null!==i?i:void 0),tE&&(tK(t,i||void 0),tE=!1);return n6(),R(n7()),!0}function tL(e){let t=n7(),n=nB();if(nv(n)&&!t.isComposing()){let i=n.anchor,r=n.anchor.getNode();i0(i.key),rE(t1),(e.timeStamp{tK(t,tO)}),tT=!1,tO="",!0;tT=!1,tO=""}if(rd(e,"ArrowRight",{shiftKey:"any"}))rS(t,eJ,e);else if(rd(e,"ArrowRight",rc))rS(t,eG,e);else if(rd(e,"ArrowLeft",{shiftKey:"any"}))rS(t,eV,e);else if(rd(e,"ArrowLeft",rc))rS(t,eq,e);else if(rd(e,"ArrowUp",{altKey:"any",shiftKey:"any"}))rS(t,eX,e);else if(rd(e,"ArrowDown",{altKey:"any",shiftKey:"any"}))rS(t,eZ,e);else if(rd(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0}))tv=!0,rS(t,eQ,e);else if(" "===e.key)rS(t,e0,e);else if(l&&rd(e,"o",{ctrlKey:!0}))e.preventDefault(),tv=!0,rS(t,e$,!0);else if(rd(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"}))tv=!1,rS(t,eQ,e);else if(rd(e,"Backspace",{shiftKey:"any"})||l&&rd(e,"h",{ctrlKey:!0}))rg(e)?rS(t,e1,e):(e.preventDefault(),rS(t,eP,!0));else if("Escape"===e.key)rS(t,e2,e);else if(rd(e,"Delete",{})||l&&rd(e,"d",{ctrlKey:!0}))"Delete"!==e.key?(e.preventDefault(),rS(t,eP,!1)):rS(t,e3,e);else if(rd(e,"Backspace",rf))e.preventDefault(),rS(t,ez,!0);else if(rd(e,"Delete",rf))e.preventDefault(),rS(t,ez,!1);else if(l&&rd(e,"Backspace",{metaKey:!0}))e.preventDefault(),rS(t,eW,!0);else if(l&&(rd(e,"Delete",{metaKey:!0})||rd(e,"k",{ctrlKey:!0})))e.preventDefault(),rS(t,eW,!1);else if(rd(e,"b",rc))e.preventDefault(),rS(t,eY,"bold");else if(rd(e,"u",rc))e.preventDefault(),rS(t,eY,"underline");else if(rd(e,"i",rc))e.preventDefault(),rS(t,eY,"italic");else if(rd(e,"Tab",{shiftKey:"any"}))rS(t,e6,e);else if(rd(e,"z",rc))e.preventDefault(),rS(t,ej,void 0);else if(l?rd(e,"z",{metaKey:!0,shiftKey:!0}):rd(e,"y",{ctrlKey:!0})||rd(e,"z",{ctrlKey:!0,shiftKey:!0}))e.preventDefault(),rS(t,eU,void 0);else{let n=t._editorState._selection;null===n||nv(n)?rd(e,"a",rc)&&(e.preventDefault(),rS(t,tl,e)):rd(e,"c",rc)?(e.preventDefault(),rS(t,ti,e)):rd(e,"x",rc)?(e.preventDefault(),rS(t,tr,e)):rd(e,"a",rc)&&(e.preventDefault(),rS(t,tl,e))}return(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)&&t.dispatchCommand(tf,e),!0}function tz(e){let t=e.__lexicalEventHandles;return void 0===t&&(e.__lexicalEventHandles=t=[]),t}let tW=new Map;function tY(e){let t,n=(t=rM(e.target))?t.getSelection():null;if(null===n)return;let i=iz(n.anchorNode);if(null===i)return;tx&&(tx=!1,id(i,()=>{let t=nz(),r=n.anchorNode;(rL(r)||iH(r))&&re(nK(t,n,i,e))}));let r=ri(i),l=r[r.length-1],o=l._key,s=tW.get(o),a=s||l;a!==i&&tw(n,a,!1),tw(n,i,!0),i!==l?tW.set(o,i):s&&tW.delete(o)}function tj(e){e._lexicalHandled=!0}function tU(e){return!0===e._lexicalHandled}let tH=()=>{};function tJ(e,t,n){n6();let i=e.__key,r=e.getParent();if(null===r)return;let l=function(e){let t=nB();if(!nv(t)||!ip(e))return t;let{anchor:n,focus:i}=t,r=n.getNode(),l=i.getNode();return rO(r,e)&&n.set(e.__key,0,"element"),rO(l,e)&&i.set(e.__key,0,"element"),t}(e),o=!1;if(nv(l)&&t){let t=l.anchor,n=l.focus;t.key===i&&(nj(t,e,r,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===i&&(nj(n,e,r,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else nT(l)&&t&&e.isSelected()&&e.selectPrevious();if(nv(l)&&t&&!o){let t=e.getIndexWithinParent();iZ(e),nW(l,r,t,-1)}else iZ(e);n||rb(r)||r.canBeEmpty()||!r.isEmpty()||tJ(r,t),t&&l&&iS(r)&&r.isEmpty()&&r.selectEnd()}function tG(e){return e}let tV=Symbol.for("ephemeral");function tq(e){return e[tV]||!1}class tX{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=rX(this);return void 0===e&&t(64,this.name),e}static clone(e){t(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),iX(this,e)}getType(){return this.__type}isInline(){t(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;let t=i2(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){let t=e||nB();if(null==t)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(ng(this))return n;if(nv(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;let e=this.getParent();if(iy(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(null===e)return -1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return -1}getParent(){let e=this.getLatest().__parent;return null===e?null:i2(e)}getParentOrThrow(){let e=this.getParent();return null===e&&t(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let n=e.getParent();if(rb(n))return ip(e)||e===this&&iy(e)||t(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&t(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return null===e?null:i2(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return null===e?null:i2(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=ip(this)?this:this.getParent(),n=ip(e)?e:e.getParent(),i=t&&n?ly(t,n):null;return i?i.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){let n=ly(this,e);return null!==n&&("descendant"===n.type||("branch"===n.type?-1===l_(n):("same"!==n.type&&"ancestor"!==n.type&&t(279),!1)))}isParentOf(e){let t=ly(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){let n=this.isBefore(e),i=[],r=new Set,l=this;for(;null!==l;){let o=l.__key;if(r.has(o)||(r.add(o),i.push(l)),l===e)break;let s=ip(l)?n?l.getFirstChild():l.getLastChild():null;if(null!==s){l=s;continue}let a=n?l.getNextSibling():l.getPreviousSibling();if(null!==a){l=a;continue}let u=l.getParentOrThrow();if(r.has(u.__key)||i.push(u),u===e)break;let d=null,c=u;do{if(null===c&&t(68),d=n?c.getNextSibling():c.getPreviousSibling(),null===(c=c.getParent()))break;null!==d||r.has(c.__key)||i.push(c)}while(null===d)l=d}return n||i.reverse(),i}isDirty(){let e=n7()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(tq(this))return this;let e=i2(this.__key);return null===e&&t(113),e}getWritable(){if(tq(this))return this;n6();let e=n4(),t=n7(),n=e._nodeMap,i=this.__key,r=this.getLatest(),l=t._cloneNotNeeded,o=nB();if(null!==o&&o.setCachedNodes(null),l.has(i))return iQ(r),r;let s=rJ(r);return l.add(i),iQ(s),n.set(i,s),s}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){t(70)}updateDOM(e,n,i){t(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){t(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),i=t.$,r=i;for(let e of B(n).flatKeys)e in t&&(void 0!==r&&r!==i||(r={...i}),r[e]=t[e]);return(n.__state||r)&&K(e).updateFromJSON(r),n}(this,e)}static transform(){return null}remove(e){tJ(this,!0,e)}replace(e,n){n6();let i=nB();null!==i&&(i=i.clone()),rR(this,e);let r=this.getLatest(),l=this.__key,o=e.__key,s=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;iZ(s);let d=r.getPreviousSibling(),c=r.getNextSibling(),f=r.__prev,g=r.__next,h=r.__parent;if((tJ(r,!1,!0),null===d)?a.__first=o:d.getWritable().__next=o,(s.__prev=f,null===c)?a.__last=o:c.getWritable().__prev=o,s.__next=g,s.__parent=h,a.__size=u,n&&(ip(this)&&ip(s)||t(139),this.getChildren().forEach(e=>{s.append(e)})),nv(i)){re(i);let e=i.anchor,t=i.focus;e.key===l&&nN(e,s),t.key===l&&nN(t,s)}return i1()===l&&i0(o),s}insertAfter(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n6(),rR(this,e);let n=this.getWritable(),i=e.getWritable(),r=i.getParent(),l=nB(),o=!1,s=!1;if(null!==r){let t=e.getIndexWithinParent();if(iZ(i),nv(l)){let e=r.__key,n=l.anchor,i=l.focus;o="element"===n.type&&n.key===e&&n.offset===t+1,s="element"===i.type&&i.key===e&&i.offset===t+1}}let a=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,c=n.__next;if(null===a?u.__last=d:a.getWritable().__prev=d,u.__size++,n.__next=d,i.__next=c,i.__prev=n.__key,i.__parent=n.__parent,t&&nv(l)){let e=this.getIndexWithinParent();nW(l,u,e+1);let t=u.__key;o&&l.anchor.set(t,e+2,"element"),s&&l.focus.set(t,e+2,"element")}return e}insertBefore(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n6(),rR(this,e);let n=this.getWritable(),i=e.getWritable(),r=i.__key;iZ(i);let l=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,a=this.getIndexWithinParent();null===l?o.__first=r:l.getWritable().__next=r,o.__size++,n.__prev=r,i.__prev=s,i.__next=n.__key,i.__parent=n.__parent;let u=nB();return t&&nv(u)&&nW(u,this.getParentOrThrow(),a),e}isParentRequired(){return!1}createParentElementNode(){return iA()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){n6();let n=this.getPreviousSibling(),i=this.getParentOrThrow();if(null===n)return i.select(0,0);if(ip(n))return n.select();if(!ng(n)){let e=n.getIndexWithinParent()+1;return i.select(e,e)}return n.select(e,t)}selectNext(e,t){n6();let n=this.getNextSibling(),i=this.getParentOrThrow();if(null===n)return i.select();if(ip(n))return n.select(0,0);if(!ng(n)){let e=n.getIndexWithinParent();return i.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}let tZ="history-merge",tQ="skip-dom-selection",t0="skip-selection-focus",t1="composition-start",t2="composition-end";class t3 extends tX{static getType(){return"linebreak"}static clone(e){return new t3(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(e){let t=e.parentElement;if(null!==t&&rz(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&t7(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&t7(n))return!0}}return!1})(e)||function(e){let t=e.parentElement;if(null!==t&&rz(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&t7(n))return!1;let i=t.lastChild;if(i===e||i.previousSibling===e&&t7(i))return!0}return!1}(e)?null:{conversion:t6,priority:0}}}static importJSON(e){return t5().updateFromJSON(e)}}function t6(e){return{node:t5()}}function t5(){return rw(new t3)}function t4(e){return e instanceof t3}function t7(e){return iH(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function t9(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function t8(e,t){return 1&t?"strong":2&t?"em":"span"}function ne(e,t,n,i,r){let l=i.classList,o=rp(r,"base");void 0!==o&&l.add(...o);let s=!1,a=8&t&&4&t;for(let e in void 0!==(o=rp(r,"underlineStrikethrough"))&&(8&n&&4&n?(s=!0,a||l.add(...o)):a&&l.remove(...o)),S){let i=S[e];if(void 0!==(o=rp(r,e)))if(n&i){if(s&&("underline"===e||"strikethrough"===e)){t&i&&l.remove(...o);continue}(0==(t&i)||a&&"underline"===e||"strikethrough"===e)&&l.add(...o)}else t&i&&l.remove(...o)}}function nt(e,t,n){let i=t.firstChild,r=n.isComposing(),l=e+(r?h:"");if(null==i)t.textContent=l;else{let e=i.nodeValue;if(e!==l)if(r||o){let[t,n,r]=function(e,t){let n=e.length,i=t.length,r=0,l=0;for(;r({conversion:na,priority:0}),b:()=>({conversion:no,priority:0}),code:()=>({conversion:nc,priority:0}),em:()=>({conversion:nc,priority:0}),i:()=>({conversion:nc,priority:0}),mark:()=>({conversion:nc,priority:0}),s:()=>({conversion:nc,priority:0}),span:()=>({conversion:nl,priority:0}),strong:()=>({conversion:nc,priority:0}),sub:()=>({conversion:nc,priority:0}),sup:()=>({conversion:nc,priority:0}),u:()=>({conversion:nc,priority:0})}}static importJSON(e){return nf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return rL(n)||t(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=ni(n,"b")),this.hasFormat("italic")&&(n=ni(n,"i")),this.hasFormat("strikethrough")&&(n=ni(n,"s")),this.hasFormat("underline")&&(n=ni(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format="string"==typeof e?S[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?N[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=iV(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=E[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){n6();let n=e,i=t,r=nB(),l=this.getTextContent(),o=this.__key;if("string"==typeof l){let e=l.length;void 0===n&&(n=e),void 0===i&&(i=e)}else n=0,i=0;if(!nv(r))return n$(o,n,o,i,"text","text");{let e=i1();e!==r.anchor.key&&e!==r.focus.key||i0(o),r.setTextNodeRange(this,n,this,i)}return r}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,i){let r=this.getWritable(),l=r.__text,o=n.length,s=e;s<0&&(s=o+s)<0&&(s=0);let a=nB();if(i&&nv(a)){let t=e+o;a.setTextNodeRange(r,t,r,t)}return r.__text=l.slice(0,s)+n+l.slice(s+t),r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(){let e;for(var t=arguments.length,n=Array(t),i=0;ie-t),n.push(a);let u=[],d=n.length;for(let e=0,t=0;ee&&(u.push(l.slice(e,i)),e=i)}let c=u.length;if(1===c)return[r];let f=u[0],g=r.getParent(),h=r.getFormat(),p=r.getStyle(),_=r.__detail,m=!1,y=null,C=null,S=nB();if(nv(S)){let[e,t]=S.isBackward()?[S.focus,S.anchor]:[S.anchor,S.focus];"text"===e.type&&e.key===o&&(y=e),"text"===t.type&&t.key===o&&(C=t)}r.isSegmented()?((e=nf(f)).__format=h,e.__style=p,e.__detail=_,e.__state=U(r,e),m=!0):e=r.setTextContent(f);let N=[e];for(let e=1;e=E&&(y.set(e.getKey(),x-E,"text"),x=E){C.set(e.getKey(),v-E,"text");break}E=t}if(null!==g){let e,t;e=this.getPreviousSibling(),t=this.getNextSibling(),null!==e&&iQ(e),null!==t&&iQ(t);let n=g.getWritable(),i=this.getIndexWithinParent();m?(n.splice(i,0,N),this.remove()):n.splice(i,1,N),nv(S)&&nW(S,g,i,c-1)}return N}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||t(50);let i=this.__key,r=e.__key,l=this.__text,o=l.length;i1()===r&&i0(i);let s=nB();if(nv(s)){let t=s.anchor,l=s.focus;null!==t&&t.key===r&&nU(t,n,i,e,o),null!==l&&l.key===r&&nU(l,n,i,e,o)}let a=e.__text,u=n?a+l:l+a;this.setTextContent(u);let d=this.getWritable();return e.remove(),d}isTextEntity(){return!1}}function nl(e){return{forChild:nh(e.style),node:null}}function no(e){let t="normal"===e.style.fontWeight;return{forChild:nh(e.style,t?void 0:"bold"),node:null}}let ns=new WeakMap;function na(e){null===e.parentElement&&t(129);let n=e.textContent||"";if(null!==function(e){let t,n=e.parentNode,i=[e];for(;null!==n&&void 0===(t=ns.get(n))&&!function(e){if(!rL(e))return!1;if("PRE"===e.nodeName)return!0;let t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}(n);)i.push(n),n=n.parentNode;let r=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(" "===n[n.length-1]){let t=e,i=!0;for(;null!==t&&null!==(t=nu(t,!0));)if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:nf(n)}}function nu(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){let e=n.parentElement;if(null===e)return null;n=e}if(rL(n=e)){let e=n.style.display;if(""===e&&!rB(n)||""!==e&&!e.startsWith("inline"))return null}let i=n;for(;null!==(i=t?n.firstChild:n.lastChild);)n=i;if(iH(n))return n;if("BR"===n.nodeName)return null}}let nd={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nc(e){let t=nd[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:nh(e.style,t),node:null}}function nf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return rw(new nr(e))}function ng(e){return e instanceof nr}function nh(e,t){let n=e.fontWeight,i=e.textDecoration.split(" "),r="700"===n||"bold"===n,l=i.includes("line-through"),o="italic"===e.fontStyle,s=i.includes("underline"),a=e.verticalAlign;return e=>(ng(e)&&(r&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),o&&!e.hasFormat("italic")&&e.toggleFormat("italic"),s&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==a||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==a||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}class np extends nr{static getType(){return"tab"}static clone(e){return new np(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=rp(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return n_().updateFromJSON(e)}setTextContent(e){return" "!==e&&""!==e&&n(126),super.setTextContent(" ")}spliceText(e,n,i,r){return""===i&&0===n||" "===i&&1===n||t(286),this}setDetail(e){return 2!==e&&t(127),this}setMode(e){return"normal"!==e&&t(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function n_(){return rw(new np)}function nm(e){return e instanceof np}class ny{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offsetlp(lM(lC(this,"next")),lM(lC(e,"next")))}getNode(){let e=i2(this.key);return null===e&&t(20),e}set(e,t,n,i){let r=this._selection,l=this.key;i&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,n3()||(i1()===l&&i0(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0)))}}function nC(e,t,n){return new ny(e,t,n)}function nS(e,t){let n=t.__key,i=e.offset,r="element";if(ng(t)){r="text";let e=t.getTextContentSize();i>e&&(i=e)}else if(!ip(t)){let e=t.getNextSibling();if(ng(e))n=e.__key,i=0,r="text";else{let e=t.getParent();e&&(n=e.__key,i=t.getIndexWithinParent()+1)}}e.set(n,i,r)}function nN(e,t){if(ip(t)){let n=t.getLastDescendant();ip(n)||ng(n)?nS(e,n):nS(e,t)}else nS(e,t)}class nx{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!nT(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new nx(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t,n=this.getNodes(),i=n.length,r=n[i-1];if(ng(r))t=r.select();else{let e=r.getIndexWithinParent()+1;t=r.getParentOrThrow().select(e,e)}t.insertNodes(e);for(let e=0;e1;){let e=t[t.length-1];if(!ip(e)||l.has(e)||e.isEmpty()||r.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){let n=lM(e.anchor),i=lM(e.anchor.getFlipped()),r=e=>r7(e)?e.origin:e.getNodeAtCaret(),l=r(n)||r(i)||(e.anchor.getNodeAtCaret()?n.origin:i.origin);t.push(l)}return t}(lD(lv(this),"next"));return n3()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,i){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,i,"text")}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],i=this.anchor,r=this.focus,l=i.isBefore(r),[o,s]=nM(this),a="",u=!0;for(let d=0;d=0;e--){let t=l[e];if(t.is(f)||ip(t)&&t.isParentOf(f))break;t.isAttached()&&(!o.has(t)||t.is(r)?h||_.insertAfter(t,!1):t.remove())}if(!h){let e=i,n=null;for(;null!==e;){let i=e.getChildren(),r=i.length;(0===r||i[r-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(ij(f))if(a===g)f.select();else{let t=nf(e);t.select(),f.replace(t)}else""===(f=f.spliceText(a,g-a,e,!0)).getTextContent()?f.remove():"text"===this.anchor.type&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e1&&void 0!==arguments[1]?arguments[1]:"removeEmptySlices";if(e.isCollapsed())return e;let l="root",o="next",s=r,a=lD(e,o),u=lT(a.anchor,l),d=lT(a.focus.getFlipped(),l),c=new Set,f=[];for(let e of a.iterNodeCarets(l))if(r8(e))c.add(e.origin.getKey());else if(r9(e)){let{origin:t}=e;ip(t)&&!c.has(t.getKey())||f.push(t)}for(let e of f)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),i=lE(li(t,o)),r=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===s||"token"===r&&0!==e.distance)i.remove();else if(0!==e.distance){s="removeEmptySlices";let t=e.removeTextSlice(),n=e.caret.origin;if("segmented"===r){let e=t.origin,n=nf(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());i.replaceOrInsert(n),t=lr(n,o,t.offset)}n.is(u[0].origin)&&(u[0]=t),n.is(d[0].origin)&&(d[0]=t.getFlipped())}}for(let e of u)if(lO(e)){n=lM(e);break}for(let e of d)if(lO(e)){i=lM(e);break}let g=function(e,t,n){let i;if(!e||!t)return null;let r=e.getParentAtCaret(),l=t.getParentAtCaret();if(!r||!l)return null;let o=r.getParents().reverse();o.push(r);let s=l.getParents().reverse();s.push(l);let a=Math.min(o.length,s.length);for(i=0;i{let n;for(let r=i;rn.has(e.getKey())&&rW(e));return d&&c?[d,c]:null}(n,i,c);if(g){let[e,t]=g;lo(e,"previous").splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let h=[n,i,...u,...d].find(lO);if(h)return lf(lb(lM(h),e.direction));t(269,JSON.stringify(u.map(e=>e.origin.__key)))}(lv(this))),e&&nB()!==this&&re(this)}formatText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isCollapsed())return this.toggleFormat(e),void i0(null);let n=this.getNodes(),i=[];for(let e of n)ng(e)&&i.push(e);let r=t=>{n.forEach(n=>{if(ip(n)){let i=n.getFormatFlags(e,t);n.setTextFormat(i)}})},l=i.length;if(0===l)return this.toggleFormat(e),i0(null),void r(t);let o=this.anchor,s=this.focus,a=this.isBackward(),u=a?s:o,d=a?o:s,c=0,f=i[0],g="element"===u.type?0:u.offset;if("text"===u.type&&g===f.getTextContentSize()&&(c=1,f=i[1],g=0),null==f)return;let h=f.getFormatFlags(e,t);r(h);let p=l-1,_=i[p],m="text"===d.type?d.offset:_.getTextContentSize();if(f.is(_)){if(g===m)return;if(iU(f)||0===g&&m===f.getTextContentSize())f.setFormat(h);else{let e=f.splitText(g,m),t=0===g?e[0]:e[1];t.setFormat(h),"text"===u.type&&u.set(t.__key,0,"text"),"text"===d.type&&d.set(t.__key,m-g,"text")}return void(this.format=h)}0===g||iU(f)||([,f]=f.splitText(g),g=0),f.setFormat(h);let y=_.getFormatFlags(e,h);m>0&&(m===_.getTextContentSize()||iU(_)||([_]=_.splitText(m)),_.setFormat(y));for(let t=c+1;t(ip(e)||iy(e))&&!e.isInline())){ip(r)||t(211,i.constructor.name,i.getType());let n=nV(this);return r.splice(n,0,e),void l.selectEnd()}let o=function(e){let t=iA(),n=null;for(let i=0;i0){let e=o.getRangeAt(0),n=this.anchor.getNode(),i=iS(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t&&!rb(t);)t=t.getParentOrThrow();return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n,r,l,s,a,u=this.getNodes(),d=[],c=!1;for(let e=0;e0)if(t){let e=d[0];ip(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=d[d.length-1];ip(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}o.anchorNode===e.startContainer&&o.anchorOffset===e.startOffset||(n=this.focus,l=(r=this.anchor).key,s=r.offset,a=r.type,r.set(n.key,n.offset,n.type,!0),n.set(l,s,a,!0))}}"lineboundary"===n&&nq(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ip(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ip(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let i=lc(lC(t,e?"previous":"next"));if(i.getTextSlices().every(e=>null===e||0===e.distance)){let e={type:"initial"};for(let t of i.iterNodeCarets("shadowRoot"))if(r8(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(ip(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=lM(t);lx(this,lg(e,e)),i.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(r9(t)){if(ip(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(iy(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&ip(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=nF();e.add(t.origin.getKey()),re(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){let{caret:t,block:n}=e;return lx(this,lg(!t.origin.isEmpty()&&n.isEmpty()?lE(li(n,t.direction)):i.anchor,t)),this.removeText()}}let r=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&nA(this,t.getNode()))return}else{let i="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==i&&i.isSegmented()){let t=r.offset,l=i.getTextContentSize();if(i.is(n)||e&&t!==l||!e&&0!==t)return void nD(i,e,t)}else if(null!==n&&n.isSegmented()){let r=t.offset,l=n.getTextContentSize();if(n.is(i)||e&&0!==r||!e&&r!==l)return void nD(n,e,r)}!function(e,t){let n=e.anchor,i=e.focus,r=n.getNode();if(r===i.getNode()&&"text"===n.type&&"text"===i.type){var l;let e=n.offset,o=i.offset,s=e{try{let e=RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function nD(e,t,n){let i=e.getTextContent().split(/(?=\s)/g),r=i.length,l=0,o=0;for(let e=0;en||s){i.splice(e,1),s&&(o=void 0);break}}let s=i.join("").trim();""===s?e.remove():(e.setTextContent(s),e.select(o,o))}function nw(e,n,i,r){let l,o=n;if(rL(e)){let s=!1,a=e.childNodes,u=a.length,d=r._blockCursorElement;o===u&&(s=!0,o=u-1);let c=a[o],f=!1;if(c===d)c=a[o+1],f=!0;else if(null!==d){let t=d.parentNode;e===t&&n>Array.prototype.indexOf.call(t.children,d)&&o--}if(ng(l=rt(c)))o=ll(l,s?"next":"previous");else{let a=rt(e);if(null===a)return null;if(ip(a)){let u,d=r.getElementByKey(a.getKey());null===d&&t(214);let c=a.getDOMSlot(d);[a,o]=c.resolveChildIndex(a,d,e,n),ip(a)||t(215),s&&o>=a.getChildrenSize()&&(o=Math.max(0,a.getChildrenSize()-1));let g=a.getChildAtIndex(o);if(ip(g)&&(u=g.getParent(),null===i||null===u||!u.canBeEmpty()||u!==i.getNode())){let e=s?g.getLastDescendant():g.getFirstDescendant();a=null===e||ip(g=e)?g:g.getParentOrThrow(),o=0}ng(g)?(l=g,a=null,o=ll(g,s?"next":"previous")):g!==a&&s&&!f&&(ip(a)||t(216),o=Math.min(a.getChildrenSize(),o+1))}else{let t=a.getIndexWithinParent();o=0===n&&iy(a)&&rt(e)===a?t:t+1,a=a.getParentOrThrow()}if(ip(a))return nC(a.__key,o,"element")}}else l=rt(e);return ng(l)?nC(l.__key,ll(l,o,"clamp"),"text"):null}function nR(e,t,n){let i=e.offset,r=e.getNode();if(0===i){let i=r.getPreviousSibling(),l=r.getParent();if(t){if((n||!t)&&null===i&&ip(l)&&l.isInline()){let t=l.getPreviousSibling();ng(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else ip(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):ng(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(i===r.getTextContent().length){let i=r.getNextSibling(),l=r.getParent();if(t&&ip(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&null===i&&ip(l)&&l.isInline()&&!l.canInsertTextAfter()){let t=l.getNextSibling();ng(t)&&e.set(t.__key,0,"text")}}}function nk(e,t,n){if("text"===e.type&&"text"===t.type){let n=e.isBefore(t),i=e.is(t);nR(e,n,i),nR(t,!n,i),i&&t.set(e.key,e.offset,e.type)}}function nI(e,t,n,i,r,l){if(null===e||null===n||!iK(r,e,n))return null;let o=nw(e,t,nv(l)?l.anchor:null,r);if(null===o)return null;let s=nw(n,i,nv(l)?l.focus:null,r);if(null===s)return null;if("element"===o.type&&"element"===s.type){let t=rt(e),i=rt(n);if(iy(t)&&iy(i))return null}return nk(o,s),[o,s]}function nP(e){return ip(e)&&!e.isInline()}function n$(e,t,n,i,r,l){let o=n4(),s=new nE(nC(e,t,r),nC(n,i,l),0,"");return s.dirty=!0,o._selection=s,s}function nL(){return new nE(nC("root",0,"element"),nC("root",0,"element"),0,"")}function nF(){return new nx(new Set)}function nK(e,t,n,i){let r,l,o,s,a=n._window;if(null===a)return null;let u=i||a.event,d=u?u.type:void 0,c="selectionchange"===d,f=!M&&(c||"beforeinput"===d||"compositionstart"===d||"compositionend"===d||"click"===d&&u&&3===u.detail||"drop"===d||void 0===d);if(nv(e)&&!f)return e.clone();if(null===t)return null;if(r=t.anchorNode,l=t.focusNode,o=t.anchorOffset,s=t.focusOffset,(c||void 0===d)&&nv(e)&&!iK(n,r,l))return e.clone();let g=nI(r,o,l,s,n,e);if(null===g)return null;let[h,p]=g,_=0,m="";if(nv(e)){let t=e.anchor;if(h.key===t.key)_=e.format,m=e.style;else{let e=h.getNode();ng(e)?(_=e.getFormat(),m=e.getStyle()):ip(e)&&(_=e.getTextFormat(),m=e.getTextStyle())}}return new nE(h,p,_,m)}function nB(){return n4()._selection}function nz(){return n7()._editorState._selection}function nW(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=e.anchor,l=e.focus,o=r.getNode(),s=l.getNode();if(!t.is(o)&&!t.is(s))return;let a=t.__key;if(e.isCollapsed()){let t=r.offset;if(n<=t&&i>0||n0||n0||n=e,o=r?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(ng(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),i.set(o.__key,e,"text")}return}if(ip(l)){let e=l.getChildrenSize(),i=n>=e,r=i?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(ng(r)){let e=0;i&&(e=r.getTextContentSize()),t.set(r.__key,e,"text")}}if(ip(o)){let e=o.getChildrenSize(),t=r>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(r);if(ng(n)){let e=0;t&&(e=n.getTextContentSize()),i.set(n.__key,e,"text")}}}function nj(e,t,n,i,r){let l=null,o=0,s=null;null!==i?(l=i.__key,ng(i)?(o=i.getTextContentSize(),s="text"):ip(i)&&(o=i.getChildrenSize(),s="element")):null!==r&&(l=r.__key,ng(r)?s="text":ip(r)&&(s="element")),null!==l&&null!==s?e.set(l,o,s):(-1===(o=t.getIndexWithinParent())&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function nU(e,t,n,i,r){"text"===e.type?e.set(n,e.offset+(t?0:r),"text"):e.offset>i.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function nH(e,t,n,i,r){try{e.setBaseAndExtent(t,n,i,r)}catch(e){}}function nJ(e,t,n){let i=rN(e,t.getKey());if(ip(t)){let e=t.getDOMSlot(i);return[e.element,n+e.getFirstChildOffset()]}return[i,n]}function nG(e){let t=nB()||nz();null===t&&(t=i9().selectEnd()),t.insertNodes(e)}function nV(e){let n=e;e.isCollapsed()||n.removeText();let i=nB();nv(i)&&(n=i),nv(n)||t(161);let r=n.anchor,l=r.getNode(),o=r.offset;for(;!rW(l);){let e=l;if([l,o]=function(e,t){let n=e.getParent();if(!n){let e=iA();return i9().append(e),e.select(),[i9(),0]}if(ng(e)){let i=e.splitText(t);if(0===i.length)return[n,e.getIndexWithinParent()];let r=+(0!==t);return[n,i[0].getIndexWithinParent()+r]}if(!ip(e)||0===t)return[n,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let n=new nE(nC(e.__key,t,"element"),nC(e.__key,t,"element"),0,""),r=e.insertNewAfter(n);r&&r.append(i,...i.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}(l,o),e.is(l))break}return o}function nq(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"decorators-and-blocks";if("move"===t&&"character"===i&&!e.isCollapsed()){let[t,i]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return i.set(t.key,t.offset,t.type),!0}let l=lC(e.focus,n?"previous":"next"),o="lineboundary"===i,s="move"===t,a=l,u="decorators-and-blocks"===r;if(!lA(a)){for(let e of a){u=!1;let{origin:t}=e;if(!iy(t)||t.isIsolated()||(a=e,!o||!t.isInline()))break}if(u)for(let e of lc(l).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(r8(e))e.origin.isInline()||(a=e);else{if(ip(e.origin))continue;iy(e.origin)&&!e.origin.isInline()&&(a=e)}break}}if(a===l)return!1;if(s&&!o&&iy(a.origin)&&a.origin.isKeyboardSelectable()){let e=nF();return e.add(a.origin.getKey()),re(e),!0}return a=lM(a),s&&lS(e.anchor,a),lS(e.focus,a),u||!o}let nX=null,nZ=null,nQ=!1,n0=!1,n1=0,n2={characterData:!0,childList:!0,subtree:!0};function n3(){return nQ||null!==nX&&nX._readOnly}function n6(){nQ&&t(13)}function n5(){n1>99&&t(14)}function n4(){return null===nX&&t(195,n9()),nX}function n7(){return null===nZ&&t(196,n9()),nZ}function n9(){let e=0,t=new Set,n=iR.version;if("u">typeof window)for(let i of document.querySelectorAll("[contenteditable]")){let r=iW(i);if(iB(r))e++;else if(r){let e=String(r.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let i=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(i+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),i}function n8(e,t,n){let i=t.__type,r=iP(e,i),l=n.get(i);void 0===l&&(l=Array.from(r.transforms),n.set(i,l));let o=l.length;for(let e=0;es,p=g>a;if(h&&!p){let e=i[a+1],t=void 0===e?null:Z.getElementByKey(e);eC(i,0,g,a,o.withBefore(t))}else p&&!h&&eg(n,f,s,o.element)}(0,l,u,o,s,r)}a.__lexicalTextContent=es,es=l+es}(n,i,i.getDOMSlot(r)),null==ea||ea===i.__textFormat||ec||i.setTextFormat(ea),null==eu||eu===i.__textStyle||ec||i.setTextStyle(eu)})(r,l,s),iS(l)||l.isInline()||eN(r,l,s);else{let e,t=s.__lexicalTextContent;"string"==typeof t?e=t:s.__lexicalTextContent=e=r.getTextContent(),es+=e}if((ed||l.__dir!==r.__dir)&&(em(s,l),iS(l)&&!ed))for(let e of l.getChildren())ip(e)&&em(rN(Z,e.getKey()),e)}else{let e=l.getTextContent();if(iy(l)){let e=l.decorate(Z,X);null!==e&&ev(n,e)}es+=e}if(!ec&&iS(l)&&l.__cachedText!==es){let e=l.getWritable();e.__cachedText=es,l=e}return s}("root",null),Z=void 0,Q=void 0,et=void 0,en=void 0,ei=void 0,er=void 0,X=void 0,el=void 0,eo=void 0,y=n}catch(t){if(t instanceof Error&&e._onError(t),n0)throw t;return iD(e,null,s,l),k(e),e._dirtyType=2,n0=!0,io(e,u),void(n0=!1)}finally{m.observe(s,n2),e._updating=_,nX=g,nQ=h,nZ=p}}l._readOnly||(l._readOnly=!0);let C=e._dirtyLeaves,S=e._dirtyElements,N=e._normalizedNodes,x=e._updateTags,v=e._deferred;f&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n,i=e._decorators,r=e._pendingDecorators||i,l=t._nodeMap;for(n in r)l.has(n)||(r===i&&(r=i4(e)),delete r[n])}(e,l);let E=a?null:rP(rA(e));if(e._editable&&null!==E&&(f||null===c||c.dirty||!c.is(d))&&null!==s&&!x.has(tQ)){nZ=e,nX=l;try{if(null!==m&&m.disconnect(),f||null===c||c.dirty){let t=e._blockCursorElement;null!==t&&rI(t,e,s),function(e,t,n,i,r,l,s){var a;let u=i.anchorNode,d=i.focusNode,c=i.anchorOffset,f=i.focusOffset,g=document.activeElement;if(r.has("collaboration")&&g!==l||null!==g&&iF(g))return;if(!nv(t))return null!==e&&iK(n,u,d)&&i.removeAllRanges();let h=t.anchor,p=t.focus,_=h.getNode(),m=p.getNode(),[y,C]=nJ(n,_,h.offset),[S,N]=nJ(n,m,p.offset),x=t.format,v=t.style,E=t.isCollapsed(),T=y,O=S,M=!1;if("text"===h.type?(T=iG(y),M=_.getFormat()!==x||_.getStyle()!==v):nv(e)&&"text"===e.anchor.type&&(M=!0),"text"===p.type&&(O=iG(S)),null!==T&&null!==O&&(E&&(null===e||M||nv(e)&&(e.format!==x||e.style!==v))&&(a=h.key,tA=[x,v,C,a,performance.now()]),c!==C||f!==N||u!==T||d!==O||"Range"===i.type&&E||(null!==g&&l.contains(g)||r.has(t0)||l.focus({preventScroll:!0}),"element"===h.type))){if(nH(i,T,C,O,N),!o||!t.isCollapsed()||null===l||r.has(t0)||null!==document.activeElement&&l.contains(document.activeElement)||l.focus({preventScroll:!0}),!r.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==l&&l===document.activeElement){let e=nv(t)&&"element"===t.anchor.type?T.childNodes[C]||null:i.rangeCount>0?i.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){let i=rv(n),r=rM(i);if(null===i||null===r)return;let{top:l,bottom:o}=t,s=0,a=0,u=n;for(;null!==u;){let t=u===i.body;if(t)s=0,a=rA(e).innerHeight;else{let e=u.getBoundingClientRect();s=e.top,a=e.bottom}let n=0;if(la&&(n=o-a),0!==n)if(t)r.scrollBy(0,n);else{let e=u.scrollTop;u.scrollTop+=n;let t=u.scrollTop-e;l-=t,o-=t}if(t)break;u=rx(u)}}(n,t,l)}}tN=!0}}(d,c,e,E,x,s)}!function(e,t,n){let i=e._blockCursorElement;if(nv(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){let r=n.anchor,l=r.getNode(),o=r.offset,s=!1,a=null;if(o===l.getChildrenSize())rk(l.getChildAtIndex(o-1))&&(s=!0);else{let t=l.getChildAtIndex(o);if(null!==t&&rk(t)){let n=t.getPreviousSibling();(null===n||rk(n))&&(s=!0,a=e.getElementByKey(t.__key))}}if(s){let n,r,o,s=e.getElementByKey(l.__key);return null===i&&(n=e._config.theme,(r=document.createElement("div")).contentEditable="false",r.setAttribute("data-lexical-cursor","true"),o=n.blockCursor,void 0!==o&&("string"==typeof o&&(o=n.blockCursor=lK(o)),void 0!==o&&r.classList.add(...o)),e._blockCursorElement=i=r),t.style.caretColor="transparent",null===a?s.appendChild(i):s.insertBefore(i,a)}}null!==i&&rI(i,e,t)}(e,s,c)}finally{null!==m&&m.observe(s,n2),nZ=p,nX=g}}null!==y&&function(e,t,n,i,r){let l=Array.from(e._listeners.mutation),o=l.length;for(let e=0;e3?i-3:0),l=3;l0||d>0;){if(a>0){for(let e of(t._dirtyLeaves=new Set,s)){let i=r.get(e);ng(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&G(i),void 0!==i&&ie(i,l)&&n8(t,i,o),n.add(e)}if((a=(s=t._dirtyLeaves).size)>0){n1++;continue}}for(let e of(t._dirtyLeaves=new Set,t._dirtyElements=new Map,u.delete("root")&&u.set("root",!0),u)){let n=e[0],s=e[1];if(i.set(n,s),!s)continue;let a=r.get(n);void 0!==a&&ie(a,l)&&n8(t,a,o)}a=(s=t._dirtyLeaves).size,d=(u=t._dirtyElements).size,n1++}t._dirtyLeaves=n,t._dirtyElements=i}(u,e),ia(e),function(e,t,n,i){let r=e._nodeMap,l=t._nodeMap,o=[];for(let[e]of i){let t=l.get(e);void 0!==t&&(t.isAttached()||(ip(t)&&function e(t,n,i,r,l,o){let s=t.getFirstChild();for(;null!==s;){let t=s.__key;s.__parent===n&&(ip(s)&&e(s,t,i,r,l,o),i.has(t)||o.delete(t),l.push(t)),s=s.getNextSibling()}}(t,e,r,l,o,i),r.has(e)||i.delete(e),o.push(e)))}for(let e of o)l.delete(e);for(let e of n){let t=l.get(e);void 0===t||t.isAttached()||(r.has(e)||n.delete(e),l.delete(e))}}(a,u,e._dirtyLeaves,e._dirtyElements)),s!==e._compositionKey&&(u._flushSync=!0);let c=u._selection;if(nv(c)){let e=u._nodeMap,n=c.anchor.key,i=c.focus.key;void 0!==e.get(n)&&void 0!==e.get(i)||t(19)}else nT(c)&&0===c._nodes.size&&(u._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void io(e)}finally{nX=c,nQ=f,nZ=g,e._updating=h,n1=0}0!==e._dirtyType||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,i=e._selection;if(null!==i){if(i.dirty||!i.is(n))return!0}else if(null!==n)return!0;return!1}(u,e)?u._flushSync?(u._flushSync=!1,io(e)):d&&iL(()=>{io(e)}):(u._flushSync=!1,d&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function id(e,t,n){nZ===e&&void 0===n?t():iu(e,t,n)}class ic{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new ic(this.element,e,this.after)}withAfter(e){return new ic(this.element,this.before,e)}withElement(e){return this.element===e?this:new ic(e,this.before,this.after)}insertChild(e){let n=this.before||this.getManagedLineBreak();return null!==n&&n.parentElement!==this.element&&t(222),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&t(223),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&t(224),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){null===e?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===e&&(g||u||a))}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}let n=this.element,i=this.before,r=document.createElement("br");if(n.insertBefore(r,i),e){let e=document.createElement("img");e.setAttribute("data-lexical-linebreak","true"),e.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",e.alt="",n.insertBefore(e,r),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=r}getFirstChildOffset(){let e=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,i){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,i))]}let r=ig(t,n);r.push(i);let l=ig(t,this.element),o=e.getIndexWithinParent();for(let e=0;en){o+=1;break}}return[e.getParentOrThrow(),o]}}function ig(e,n){let i=[],r=n;for(;r!==e&&null!==r;r=r.parentNode){let e=0;for(let t=r.previousSibling;null!==t;t=t.previousSibling)e++;i.push(e)}return r!==e&&t(225),i.reverse()}class ih extends tX{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return v[this.getFormat()]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){let e=n7()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;null!==t;){if(ng(t)&&e.push(t),ip(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ip(e);){let t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ip(e);){let t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return ip(e)&&e.getLastDescendant()||e||null}let i=t[e];return ip(i)&&i.getFirstDescendant()||i||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:i2(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&t(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:i2(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&t(96,this.__key),e}getChildAtIndex(e){let t,n,i=this.getChildrenSize();if(e=e;){if(n===e)return t;t=t.getPreviousSibling(),n--}return null}getTextContent(){let e="",t=this.getChildren(),n=t.length;for(let i=0;ie.remove()),e}append(){for(var e=arguments.length,t=Array(e),n=0;n0){let e=null===d?this.getFirstChild():d.getNextSibling();for(let i=0;i0&&(t.style.paddingInlineStart=40*e+"px");let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||rb(this)||this.getChildren().some(ng)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),i=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let r=t.getElementByKey(e.getKey());null!==r&&(null==i?(n.insertChild(r),i=r):i!==r&&n.replaceChild(r,i),i=i.nextSibling)}}}function ip(e){return e instanceof ih}function i_(e,t,n){let i=e.getNode();for(;i;){let e=i.__key;if(t.has(e)&&!n.has(e))return!0;i=i.getParent()}return!1}class im extends tX{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function iy(e){return e instanceof im}class iC extends ih{__cachedText;static getType(){return"root"}static clone(){return new iC}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){t(51)}getTextContent(){let e=this.__cachedText;return(n3()||0===n7()._dirtyType)&&null!==e?e:super.getTextContent()}remove(){t(52)}replace(e){t(53)}insertBefore(e){t(54)}insertAfter(e){t(55)}updateDOM(e,t){return!1}splice(e,n,i){for(let e of i)ip(e)||iy(e)||t(282);return super.splice(e,n,i)}static importJSON(e){return i9().updateFromJSON(e)}collapseAtStart(){return!0}}function iS(e){return e instanceof iC}function iN(e){return new iE(new Map(e._nodeMap))}function ix(){return new iE(new Map([["root",new iC]]))}function iv(e){return e instanceof iE}class iE{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return il(t&&t.editor||null,this,e)}clone(e){let t=new iE(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return il(null,this,()=>({root:function e(n){let i=n.exportJSON(),r=n.constructor;if(i.type!==r.getType()&&t(130,r.name),ip(n)){let l=i.children;Array.isArray(l)||t(59,r.name);let o=n.getChildren();for(let t=0;t({conversion:iM,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(rL(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return iA().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){let t=this.getChildren().find(ng);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=iA();n.setTextFormat(e.format),n.setTextStyle(e.style);let i=this.getDirection();return n.setDirection(i),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(0===e.length||ng(e[0])&&""===e[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 iM(e){let t=iA();if(e.style&&(t.setFormat(e.style.textAlign),rV(e,t)),""===t.getFormatType()){let n=e.getAttribute("align");n&&n&&n in x&&t.setFormat(n)}return{node:t}}function iA(){return rw(new iO)}function ib(e){return e instanceof iO}function iD(e,t,n,i){let r=e._keyToDOMMap;r.clear(),e._editorState=ix(),e._pendingEditorState=i,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let l=e._observer;null!==l&&(l.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",r.set("root",n))}function iw(e){var t,n;let i,r,l,o,s=e||{},a=nZ,u=s.theme||{},d=void 0===e?a:s.parentEditor||null,c=s.disableEvents||!1,f=ix(),g=s.namespace||(null!==d?d._config.namespace:rr()),h=s.editorState,p=[iC,nr,t3,np,iO,iT,...s.nodes||[]],{onError:_,html:m}=s,y=void 0===s.editable||s.editable;if(void 0===e&&null!==a)i=a._nodes;else{i=new Map;for(let e=0;e{Object.keys(e).forEach(t=>{let n=r.get(t);void 0===n&&(n=[],r.set(t,n)),n.push(e[t])})},t.forEach(e=>{let t=e.klass.importDOM;if(null==t||l.has(t))return;l.add(t);let n=t.call(e.klass);null!==n&&o(n)}),n&&o(n),r),y,e);return void 0!==h&&(C._pendingEditorState=h,C._dirtyType=2),C.registerCommand(ew,tP,0),C.registerCommand(eR,t$,0),C.registerCommand(ek,tL,0),C.registerCommand(eI,tF,0),C.registerCommand(eH,tB,0),C}class iR{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,i,r,l,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=rr(),this._onError=r,this._htmlConversions=l,this._editable=o,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,n,i){void 0===i&&t(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let l=r.get(e);void 0===l&&t(36,String(e));let o=l[i];return o.add(n),()=>{o.delete(n),l.every(e=>0===e.size)&&r.delete(e)}}registerMutationListener(e,t,n){let i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,r=this._listeners.mutation,l=r.get(t);void 0===l&&(l=new Set,r.set(t,l)),l.add(i);let o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(t,i),()=>{l.delete(i),0===l.size&&r.delete(t)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return void 0===n&&t(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,i=rH(n).get(t.getType());if(!i)return;let r=new Map;for(let e of i.keys())r.set(e,"created");r.size>0&&e(r,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),i=[n],r=n.replaceWithKlass;if(null!=r){let e=this.registerNodeTransformToKlass(r,t);i.push(e)}return function(e,t){let n=rH(e.getEditorState()),i=[];for(let e of t){let t=n.get(e);t&&i.push(t)}0!==i.length&&e.update(()=>{for(let e of i)for(let t of e.keys()){let e=i2(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:tZ}:void 0)}(this,i.map(e=>e.klass.getType())),()=>{i.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return rS(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let i=rp(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,iD(this,n,e,r),null!==n&&(this._config.disableEvents||function(e){let n=tC.get(e);if(void 0===n)return tH();let i=tS.get(n);if(void 0===i)return tH();let r=i-1;r>=0||t(164),tC.delete(e),tS.set(n,r),0===r&&n.removeEventListener("selectionchange",tY);let l=iW(e);iB(l)?(!function(e){if(null!==e._parentEditor){let t=ri(e),n=t[t.length-1]._key;tW.get(n)===e&&tW.delete(n)}else tW.delete(e._key)}(l),e.__lexicalEditor=null):l&&t(198);let o=tz(e);for(let e=0;e{tU(e)||(tj(e),(t.isEditable()||"click"===i)&&l(e,t))}:e=>{if(tU(e))return;tj(e);let n=t.isEditable();switch(i){case"cut":return n&&rS(t,tr,e);case"copy":return rS(t,ti,e);case"paste":return n&&rS(t,eK,e);case"dragstart":return n&&rS(t,te,e);case"dragover":return n&&rS(t,tt,e);case"dragend":return n&&rS(t,tn,e);case"focus":return n&&rS(t,td,e);case"blur":return n&&rS(t,tc,e);case"drop":return n&&rS(t,e9,e)}};e.addEventListener(i,o),r.push(()=>{e.removeEventListener(i,o)})}}(e,this),null!=i&&e.classList.add(...i)}else this._window=null,this._updateTags.add(tZ),io(this);is("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&t(38);let i=e;i._readOnly&&((i=iN(e))._selection=e._selection?e._selection.clone():null),R(this);let r=this._pendingEditorState,l=this._updateTags,o=void 0!==n?n.tag:null;null===r||r.isEmpty()||(null!=o&&l.add(o),io(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&l.add(o),this._updating||io(this)}parseEditorState(e,t){return function(e,t,n){let i=ix(),r=nX,l=nQ,o=nZ,s=t._dirtyElements,a=t._dirtyLeaves,u=t._cloneNotNeeded,d=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,nX=i,nQ=!1,nZ=t,ik=null;try{let r=t._nodes;ir(e.root,r),n&&n(),i._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=a,t._cloneNotNeeded=u,t._dirtyType=d,nX=r,nQ=l,nZ=o}return i}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return io(this),this.getEditorState().read(e,{editor:this})}update(e,t){this._updating?this._updates.push([e,t]):iu(this,e,t)}focus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),id(this,()=>{let i=nB(),r=i9();null!==i?i.dirty||re(i.clone()):0!==r.getChildrenSize()&&("rootStart"===t.defaultSelection?r.selectStart():r.selectEnd()),rE("focus"),rT(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;null!==e&&e.blur();let t=rP(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,is("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}iR.version="0.41.0+prod.esm";let ik=null,iI=1;function iP(e,n){let i=i$(e,n);return void 0===i&&t(30,n),i}function i$(e,t){return e._nodes.get(t)}let iL="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function iF(e){let t=document.activeElement;if(!rL(t))return!1;let n=t.nodeName;return iy(i5(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==iW(t))}function iK(e,t,n){let i=e.getRootElement();try{return null!==i&&i.contains(t)&&i.contains(n)&&null!==t&&!iF(t)&&iz(t)===e}catch(e){return!1}}function iB(e){return e instanceof iR}function iz(e){let t=e;for(;null!=t;){let e=iW(t);if(iB(e))return e;t=rx(t)}return null}function iW(e){return e?e.__lexicalEditor:null}function iY(e){return y.test(e)?"rtl":C.test(e)?"ltr":null}function ij(e){return nm(e)||e.isToken()}function iU(e){return ij(e)||e.isSegmented()}function iH(e){return rF(e)&&3===e.nodeType}function iJ(e){return rF(e)&&9===e.nodeType}function iG(e){let t=e;for(;null!=t;){if(iH(t))return t;t=t.firstChild}return null}function iV(e,t,n){let i=S[t];if(null!==n&&(e&i)==(n&i))return e;let r=e^i;return"subscript"===t?r&=~S.superscript:"superscript"===t?r&=~S.subscript:"lowercase"===t?(r&=~S.uppercase,r&=~S.capitalize):"uppercase"===t?(r&=~S.lowercase,r&=~S.capitalize):"capitalize"===t&&(r&=~S.lowercase,r&=~S.uppercase),r}function iq(e){return ng(e)||t4(e)||iy(e)}function iX(e,t){let n,i=(n=ik,ik=null,n);if(null!=(t=t||i&&i.__key))return void(e.__key=t);n6(),n5();let r=n7(),l=n4(),o=""+iI++;l._nodeMap.set(o,e),ip(e)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType=1,e.__key=o}function iZ(e){let t=e.getParent();if(null!==t){let n=e.getWritable(),i=t.getWritable(),r=e.getPreviousSibling(),l=e.getNextSibling(),o=null!==l?l.__key:null,s=null!==r?r.__key:null,a=null!==r?r.getWritable():null,u=null!==l?l.getWritable():null;null===r&&(i.__first=o),null===l&&(i.__last=s),null!==a&&(a.__next=o),null!==u&&(u.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,i.__size--}}function iQ(e){n5(),tq(e)&&t(323,e.__key,e.__type);let n=e.getLatest(),i=n.__parent,r=n4(),l=n7(),o=r._nodeMap,s=l._dirtyElements;null!==i&&function(e,t,n){let i=e;for(;null!==i;){if(n.has(i))return;let e=t.get(i);if(void 0===e)break;n.set(i,!1),i=e.__parent}}(i,o,s);let a=n.__key;l._dirtyType=1,ip(e)?s.set(a,!0):l._dirtyLeaves.add(a)}function i0(e){n6();let t=n7(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){let e=i2(n);null!==e&&e.getWritable()}if(null!==e){let t=i2(e);null!==t&&t.getWritable()}}}function i1(){return n3()?null:n7()._compositionKey}function i2(e,t){let n=(t||n4())._nodeMap.get(e);return void 0===n?null:n}function i3(e,t){let n=i6(e,n7());return void 0!==n?i2(n,t):null}function i6(e,t){return e[`__lexicalKey_${t._key}`]}function i5(e,t){let n=e;for(;null!=n;){let e=i3(n,t);if(null!==e)return e;n=rx(n)}return null}function i4(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t,t}function i7(e){return e.read(()=>i9().getTextContent())}function i9(){return i8(n4())}function i8(e){return e._nodeMap.get("root")}function re(e){n6();let t=n4();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function rt(e){let t=n7(),n=function(e,t){let n=e;for(;null!=n;){let e=i6(n,t);if(void 0!==e)return e;n=rx(n)}return null}(e,t);return null===n?e===t.getRootElement()?i2("root"):null:i2(n)}function rn(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ri(e){let t=[],n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function rr(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function rl(e){return iH(e)?e.nodeValue:null}function ro(e,t,n){let i=rP(rA(t));if(null===i)return;let r=i.anchorNode,{anchorOffset:l,focusOffset:o}=i;if(null!==r){let t=rl(r),i=i5(r);if(null!==t&&ng(i)){if((t===h||t===p)&&n){let e=n.length;t=n,l=e,o=e}null!==t&&rs(i,t,l,o,e)}}}function rs(e,t,n,i,r){let l=e;if(l.isAttached()&&(r||!l.isDirty())){let o=l.isComposing(),s=t;if((o||r)&&(t.endsWith(h)&&(s=t.slice(0,-h.length)),r)){let e;for(;-1!==(e=s.indexOf(p));)s=s.slice(0,e)+s.slice(e+p.length),null!==n&&n>e&&(n=Math.max(e,n-p.length)),null!==i&&i>e&&(i=Math.max(e,i-p.length))}let d=l.getTextContent();if(r||s!==d){if(""===s){if(i0(null),a||u||g)l.remove();else{let e=n7();setTimeout(()=>{e.update(()=>{l.isAttached()&&l.remove()})},20)}return}let t=l.getParent(),r=nz(),d=l.getTextContentSize(),c=i1(),f=l.getKey();if(l.isToken()||null!==c&&f===c&&!o||nv(r)&&(null!==t&&!t.canInsertTextBefore()&&0===r.anchor.offset||r.anchor.key===e.__key&&0===r.anchor.offset&&!l.canInsertTextBefore()&&!o||r.focus.key===e.__key&&r.focus.offset===d&&!l.canInsertTextAfter()&&!o))return void l.markDirty();let h=nB();if(!nv(h)||null===n||null===i)return void ra(l,s,h);if(h.setTextNodeRange(l,n,l,i),l.isSegmented()){let e=nf(l.getTextContent());l.replace(e),l=e}ra(l,s,h)}}}function ra(e,t,n){if(e.setTextContent(t),nv(n)){let t=e.getKey();for(let i of["anchor","focus"]){let r=n[i];"text"===r.type&&r.key===t&&(r.offset=ll(e,r.offset,"clamp"))}}}function ru(e,t,n){let i=t[n]||!1;return"any"===i||i===e[n]}function rd(e,t,n){if(!(ru(e,n,"altKey")&&ru(e,n,"ctrlKey")&&ru(e,n,"shiftKey")&&ru(e,n,"metaKey")))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||1===e.key.length&&127>=e.key.charCodeAt(0))return!1;let i="Key"+t.toUpperCase();return e.code===i}let rc={ctrlKey:!l,metaKey:l},rf={altKey:l,ctrlKey:!l};function rg(e){return"Backspace"===e.key}function rh(e){let t=i9();if(nv(e)){let t=e.anchor,n=e.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),V(e),e}{let e=t.select(0,t.getChildrenSize());return re(V(e)),e}}function rp(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,i=n[t];if(void 0!==i)return i;let r=e[t];if("string"==typeof r){let e=lK(r);return n[t]=e,e}return r}function r_(e,n,i,r,l){if(0===i.size)return;let o=r.__type,s=r.__key,a=n.get(o);void 0===a&&t(33,o);let u=a.klass,d=e.get(u);void 0===d&&(d=new Map,e.set(u,d));let c=d.get(s),f="destroyed"===c&&"created"===l;(void 0===c||f)&&d.set(s,f?"updated":l)}function rm(e,t,n){let i=e.getParent(),r=n,l=e;return null!==i&&(t&&0===n?(r=l.getIndexWithinParent(),l=i):t||n!==l.getChildrenSize()||(r=l.getIndexWithinParent()+1,l=i)),l.getChildAtIndex(t?r-1:r)}function ry(e,t){let n=e.offset;if("element"===e.type)return rm(e.getNode(),t,n);{let i=e.getNode();if(t&&0===n||!t&&n===i.getTextContentSize()){let e=t?i.getPreviousSibling():i.getNextSibling();return null===e?rm(i.getParentOrThrow(),t,i.getIndexWithinParent()+ +!t):e}}return null}function rC(e){let t=rA(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function rS(e,t,n){return function(e,t,n){let i=ri(e);for(let r=4;r>=0;r--)for(let l=0;l{for(let t=0;to),rq(e,"clone")||(e.clone=t=>(ik=t,new e)),rq(e,"importJSON")||(e.importJSON=l&&l.$importJSON||(t=>(new e).updateFromJSON(t))),!rq(e,"importDOM")&&l)){let{importDOM:t}=l;t&&(e.importDOM=()=>t)}return{ownNodeConfig:l,ownNodeType:o}}function rZ(e){let t=rY();return n6(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}let rQ=(e,t)=>{let n=e;for(;null!=n&&!iS(n);){if(t(n))return n;n=n.getParent()}return null},r0={next:"previous",previous:"next"};class r1{origin;constructor(e){this.origin=e}[Symbol.iterator](){return lh({hasNext:r9,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return li(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return li(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"next",r=i===this.direction?n:Array.from(n).reverse(),l=this,o=this.getParentAtCaret(),s=new Map;for(let t=l.getAdjacentCaret();null!==t&&s.size0){let n=l.getNodeAtCaret();if(n)if(s.delete(n.getKey()),s.delete(e.getKey()),n.is(e)||l.origin.is(e));else{let t=e.getParent();t&&t.is(o)&&e.remove(),n.replace(e)}else null===n&&t(263,Array.from(s).join(" "))}else l.insert(e);l=li(e,this.direction)}for(let e of s.values())e.remove();return this}}class r2 extends r1{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lo(e,this.direction)}getParentCaret(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root";return li(r6(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=r0[this.direction];return li(this.getNodeAtCaret(),e)||lo(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof r2&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}let r3={root:iS,shadowRoot:rb};function r6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root";return r3[t](e)?null:e}class r5 extends r1{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:li(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return ip(this.origin)?lo(this.origin,this.direction):null}getParentCaret(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root";return li(r6(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=r0[this.direction];return li(this.getNodeAtCaret(),e)||lo(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof r5&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof r5||e instanceof r4)&&this.direction===e.direction&&this.origin.is(e.origin)}}class r4 extends r1{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lr(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root";return li(r6(this.getParentAtCaret(),e),this.direction)}getFlipped(){return lr(this.origin,r0[this.direction],this.offset)}isSamePointCaret(e){return e instanceof r4&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof r5||e instanceof r4)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return li(this.origin,this.direction)}}function r7(e){return e instanceof r4}function r9(e){return e instanceof r5}function r8(e){return e instanceof r2}let le={next:class extends r4{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends r4{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},lt={next:class extends r5{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends r5{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ln={next:class extends r2{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends r2{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function li(e,t){return e?new lt[t](e):null}function lr(e,t,n){return e?new le[t](e,ll(e,n)):null}function ll(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error",r=e.getTextContentSize(),l="next"===t?r:"previous"===t?0:t;return(l<0||l>r)&&("clamp"!==i&&n(284,String(t),String(r),e.getKey()),l=l<0?0:r),l}function lo(e,t){return ip(e)?new ln[t](e):null}function ls(e){return e&&e.getChildCaret()||e}function la(e){return e&&ls(e.getAdjacentCaret())}class lu{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new lu(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return r7(t)?function(e,t){let{direction:n,origin:i}=e;return new ld(e,ll(i,"focus"===t?r0[n]:n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:e}=t,{caret:i}=n;if(e.isSameNodeCaret(i))return[new ld(e,i.offset-e.offset),null]}return[t,n]}iterNodeCarets(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root",t=r7(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),i=r7(n),r=t=>t.isSameNodeCaret(n)?null:la(t)||t.getParentCaret(e);return lh({hasNext:e=>null!==e&&!(i&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:r(t),map:e=>e,step:r})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class ld{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n=lp(i,r)?"next":"previous";return lg(lb(i,l),lb(r,l))}function lE(e){let{direction:t,origin:n}=e,i=li(n,r0[t]).getNodeAtCaret();return i?li(i,t):lo(n.getParentOrThrow(),t)}function lT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root",n=[e];for(let i=r8(e)?e.getParentCaret(t):e.getSiblingCaret();null!==i;i=i.getParentCaret(t))n.push(lE(i));return n}function lO(e){return!!e&&e.origin.isAttached()}function lM(e){let t=function(e){let t=e;for(;r8(t);){let e=la(t);if(!r8(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(ng(t.origin))return r7(t)?t:lr(t.origin,n,n);let i=t.getAdjacentCaret();return r9(i)&&ng(i.origin)?lr(i.origin,n,r0[n]):t}function lA(e){return r7(e)&&e.offset!==ll(e.origin,e.direction)}function lb(e,t){return e.direction===t?e:e.getFlipped()}function lD(e,t){return e.direction===t?e:lg(lb(e.focus,t),lb(e.anchor,t))}function lw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root",n=0,i=e,r=la(i);for(;null===r;){if(n--,!(r=i.getParentCaret(t)))return null;r=la(i=r)}return r&&[r,n]}function lR(e){let{origin:n,offset:i,direction:r}=e;if(i===ll(n,r))return e.getSiblingCaret();if(i===ll(n,r0[r]))return lE(e.getSiblingCaret());let[l]=n.splitText(i);return ng(l)||t(281),lb(li(l,"next"),r)}function lk(e,t){return!0}function lI(e){let{$copyElementNode:t=rD,$splitTextPointCaretNext:n=lR,rootMode:i="shadowRoot",$shouldSplit:r=lk}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r7(e))return n(e);let l=e.getParentCaret(i);if(l){let{origin:n}=l;if(r8(e)&&(!n.canBeEmpty()||!r(n,"first")))return lE(l);let i=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(i.length>0||n.canBeEmpty()&&r(n,"last"))&&l.insert(t(n).splice(0,0,i))}return l}function lP(e){return e}function l$(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),i=1;i0&&e.classList.add(...r)}function lz(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i0&&e.classList.remove(...r)}function lW(){for(var e=arguments.length,t=Array(e),n=0;n{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}function lY(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;irE,"$applyNodeReplacement",()=>rw,"$caretFromPoint",()=>lC,"$caretRangeFromSelection",()=>lv,"$cloneWithProperties",()=>rJ,"$cloneWithPropertiesEphemeral",()=>rG,"$copyNode",()=>rD,"$create",()=>rZ,"$createLineBreakNode",()=>t5,"$createNodeSelection",()=>nF,"$createParagraphNode",()=>iA,"$createPoint",()=>nC,"$createRangeSelection",()=>nL,"$createTabNode",()=>n_,"$createTextNode",()=>nf,"$extendCaretToRange",()=>lc,"$findMatchingParent",()=>rQ,"$getAdjacentChildCaret",()=>la,"$getAdjacentNode",()=>ry,"$getAdjacentSiblingOrParentSiblingCaret",()=>lw,"$getCaretInDirection",()=>lb,"$getCaretRange",()=>lg,"$getCaretRangeInDirection",()=>lD,"$getCharacterOffsets",()=>nM,"$getChildCaret",()=>lo,"$getChildCaretOrSelf",()=>ls,"$getCollapsedCaretRange",()=>lf,"$getEditor",()=>rY,"$getNearestNodeFromDOMNode",()=>i5,"$getNodeByKey",()=>i2,"$getNodeFromDOMNode",()=>i3,"$getPreviousSelection",()=>nz,"$getRoot",()=>i9,"$getSelection",()=>nB,"$getSiblingCaret",()=>li,"$getState",()=>$,"$getTextPointCaret",()=>lr,"$hasAncestor",()=>rO,"$insertNodes",()=>nG,"$isBlockElementNode",()=>nP,"$isChildCaret",()=>r8,"$isDecoratorNode",()=>iy,"$isEditorState",()=>iv,"$isElementNode",()=>ip,"$isExtendableTextPointCaret",()=>lA,"$isLeafNode",()=>iq,"$isLineBreakNode",()=>t4,"$isNodeSelection",()=>nT,"$isParagraphNode",()=>ib,"$isRangeSelection",()=>nv,"$isRootNode",()=>iS,"$isRootOrShadowRoot",()=>rb,"$isSiblingCaret",()=>r9,"$isTabNode",()=>nm,"$isTextNode",()=>ng,"$isTextPointCaret",()=>r7,"$isTokenOrSegmented",()=>iU,"$normalizeCaret",()=>lM,"$normalizeSelection__EXPERIMENTAL",()=>V,"$onUpdate",()=>rT,"$parseSerializedNode",()=>ii,"$rewindSiblingCaret",()=>lE,"$selectAll",()=>rh,"$setPointFromCaret",()=>lS,"$setSelection",()=>re,"$setSelectionFromCaretRange",()=>lN,"$setState",()=>L,"$splitAtPointCaretNext",()=>lI,"ArtificialNode__DO_NOT_USE",()=>iT,"BLUR_COMMAND",()=>tc,"CAN_REDO_COMMAND",()=>ta,"CAN_UNDO_COMMAND",()=>tu,"CLEAR_EDITOR_COMMAND",()=>to,"CLEAR_HISTORY_COMMAND",()=>ts,"CLICK_COMMAND",()=>eD,"COMMAND_PRIORITY_CRITICAL",()=>4,"COMMAND_PRIORITY_EDITOR",()=>0,"COMMAND_PRIORITY_HIGH",()=>3,"COMMAND_PRIORITY_LOW",()=>1,"COMPOSITION_END_TAG",()=>t2,"COMPOSITION_START_TAG",()=>t1,"CONTROLLED_TEXT_INSERTION_COMMAND",()=>eF,"COPY_COMMAND",()=>ti,"CUT_COMMAND",()=>tr,"DELETE_CHARACTER_COMMAND",()=>eP,"DELETE_LINE_COMMAND",()=>eW,"DELETE_WORD_COMMAND",()=>ez,"DRAGOVER_COMMAND",()=>tt,"DRAGSTART_COMMAND",()=>te,"DROP_COMMAND",()=>e9,"DecoratorNode",()=>im,"ElementNode",()=>ih,"FOCUS_COMMAND",()=>td,"FORMAT_ELEMENT_COMMAND",()=>e8,"FORMAT_TEXT_COMMAND",()=>eY,"HISTORIC_TAG",()=>"historic","HISTORY_MERGE_TAG",()=>tZ,"HISTORY_PUSH_TAG",()=>"history-push","INDENT_CONTENT_COMMAND",()=>e4,"INSERT_LINE_BREAK_COMMAND",()=>e$,"INSERT_PARAGRAPH_COMMAND",()=>eL,"INSERT_TAB_COMMAND",()=>e5,"INTERNAL_$isBlock",()=>rW,"KEY_ARROW_DOWN_COMMAND",()=>eZ,"KEY_ARROW_LEFT_COMMAND",()=>eV,"KEY_ARROW_RIGHT_COMMAND",()=>eJ,"KEY_ARROW_UP_COMMAND",()=>eX,"KEY_BACKSPACE_COMMAND",()=>e1,"KEY_DELETE_COMMAND",()=>e3,"KEY_ENTER_COMMAND",()=>eQ,"KEY_ESCAPE_COMMAND",()=>e2,"KEY_SPACE_COMMAND",()=>e0,"KEY_TAB_COMMAND",()=>e6,"LineBreakNode",()=>t3,"MOVE_TO_END",()=>eG,"MOVE_TO_START",()=>eq,"OUTDENT_CONTENT_COMMAND",()=>e7,"PASTE_COMMAND",()=>eK,"PASTE_TAG",()=>"paste","ParagraphNode",()=>iO,"REDO_COMMAND",()=>eU,"REMOVE_TEXT_COMMAND",()=>eB,"RootNode",()=>iC,"SELECTION_CHANGE_COMMAND",()=>eA,"SELECTION_INSERT_CLIPBOARD_NODES_COMMAND",()=>eb,"SELECT_ALL_COMMAND",()=>tl,"SKIP_DOM_SELECTION_TAG",()=>tQ,"SKIP_SELECTION_FOCUS_TAG",()=>t0,"TEXT_TYPE_TO_FORMAT",()=>S,"TabNode",()=>np,"TextNode",()=>nr,"UNDO_COMMAND",()=>ej,"addClassNamesToElement",()=>lB,"buildImportMap",()=>tG,"configExtension",()=>l$,"createCommand",()=>eM,"createEditor",()=>iw,"createState",()=>P,"defineExtension",()=>lP,"getDOMSelection",()=>rP,"getDOMTextNode",()=>iG,"getNearestEditorFromDOMNode",()=>iz,"getRegisteredNode",()=>i$,"getTextDirection",()=>iY,"isBlockDomNode",()=>rz,"isDOMDocumentNode",()=>iJ,"isDOMNode",()=>rF,"isDocumentFragment",()=>rK,"isHTMLAnchorElement",()=>r$,"isHTMLElement",()=>rL,"isInlineDomNode",()=>rB,"isSelectionCapturedInDecoratorInput",()=>iF,"isSelectionWithinEditor",()=>iK,"makeStepwiseIterator",()=>lh,"mergeRegister",()=>lW,"normalizeClassNames",()=>lK,"removeClassNamesFromElement",()=>lz,"safeCast",()=>lL,"setNodeIndentFromDOM",()=>rV,"shallowMergeConfig",()=>lF,"toggleTextFormatType",()=>iV],703057);let lj=new Map;function lU(e,t){let n=e.getRootElement();if(null===n)return[];let i=n.getBoundingClientRect(),r=getComputedStyle(n),l=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),o=Array.from(t.getClientRects()),s,a=o.length;o.sort((e,t)=>{let n=e.top-t.top;return 3>=Math.abs(n)?e.left-t.left:n});for(let e=0;et.top&&s.left+s.width>t.left,r=t.width+l===i.width;n||r?(o.splice(e--,1),a--):s=t}return o}function lH(e){let t={};if(!e)return t;for(let n of e.split(";"))if(""!==n){let[e,i]=n.split(/:([^]+)/);e&&i&&(t[e.trim()]=i.trim())}return t}function lJ(e){let t=lj.get(e);return void 0===t&&(t=lH(e),lj.set(e,t)),t}function lG(e){let t=rY().getElementByKey(e.getKey());if(null===t)return null;let n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function lV(e){return lG(iS(e)?e:e.getParentOrThrow())}function lq(e){let t=lV(e);return null!==t&&"rtl"===t.direction}function lX(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"self",i=e.getStartEndPoints();if(t.isSelected(e)&&!iU(t)&&null!==i){let[r,l]=i,o=e.isBackward(),s=r.getNode(),a=l.getNode(),u=t.is(s),d=t.is(a);if(u||d){let[i,r]=nM(e),l=s.is(a),u=t.is(o?a:s),d=t.is(o?s:a),c,f=0;l?(f=i>r?r:i,c=i>r?i:r):u?(f=o?r:i,c=void 0):d&&(f=0,c=o?i:r);let g=t.__text.slice(f,c);g!==t.__text&&("clone"===n&&(t=rG(t)),t.__text=g)}}return t}function lZ(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return ip(t)||lY(177),e.offset===t.getChildrenSize()}function lQ(e){let t=e.getStyle(),n=lH(t);lj.set(t,n)}function l0(e,t){(nv(e)?e.isCollapsed():ng(e)||ip(e))||lY(280);let n=lJ(nv(e)?e.style:ng(e)?e.getStyle():e.getTextStyle()),i=Object.entries(t).reduce((t,i)=>{let[r,l]=i;return"function"==typeof l?t[r]=l(n[r],e):null===l?delete t[r]:t[r]=l,t},{...n}),r=function(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}(i);nv(e)||ng(e)?e.setStyle(r):e.setTextStyle(r),lj.set(r,i)}function l1(e,t){if(nv(e)&&e.isCollapsed()){l0(e,t);let n=e.anchor.getNode();ip(n)&&n.isEmpty()&&l0(n,t)}!function(e){let t=nB();if(!t)return;let n=new Map,i=e=>n.get(e.getKey())||[0,e.getTextContentSize()];if(nv(t))for(let e of lv(t).getTextSlices())e&&n.set(e.caret.origin.getKey(),e.getSliceIndices());for(let n of t.getNodes()){if(!ng(n)||!n.canHaveFormat())continue;let[t,r]=i(n);r!==t&&e(iU(n)||0===t&&r===n.getTextContentSize()?n:n.splitText(t,r)[+(0!==t)])}nv(t)&&"text"===t.anchor.type&&"text"===t.focus.type&&t.anchor.key===t.focus.key&&function(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:i,offset:r,type:l}=t;t.set(n.key,n.offset,n.type),n.set(i,r,l)}}(t)}(e=>{l0(e,t)});let n=e.getNodes();if(n.length>0){let e=new Set;for(let i of n){if(!ip(i)||!i.canBeEmpty()||0!==i.getChildrenSize())continue;let n=i.getKey();e.has(n)||(e.add(n),l0(i,t))}}}function l2(e,t){let n=e.getFormatType(),i=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),i!==t.getIndent()&&t.setIndent(i)}function l3(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l2;if(null===e)return;let i=e.getStartEndPoints(),r=new Map,l=null;if(i){let[e,t]=i;(l=nL()).anchor.set(e.key,e.offset,e.type),l.focus.set(t.key,t.offset,t.type);let n=rQ(e.getNode(),rW),o=rQ(t.getNode(),rW);ip(n)&&r.set(n.getKey(),n),ip(o)&&r.set(o.getKey(),o)}for(let t of e.getNodes())if(ip(t)&&rW(t))r.set(t.getKey(),t);else if(null===i){let e=rQ(t,rW);ip(e)&&r.set(e.getKey(),e)}for(let[e,i]of r){let r=t();n(i,r),i.replace(r,!0),l&&(e===l.anchor.key&&l.anchor.set(r.getKey(),l.anchor.offset,l.anchor.type),e===l.focus.key&&l.focus.set(r.getKey(),l.focus.offset,l.focus.type))}l&&e.is(nB())&&re(l)}function l6(e){let t=l5(e);return null!==t&&"vertical-rl"===t.writingMode}function l5(e){let t=e.anchor.getNode();return ip(t)?lG(t):lV(t)}function l4(e,t){let n=l6(e)?!t:t;l7(e)&&(n=!n);let i=lC(e.focus,n?"previous":"next");if(lA(i))return!1;for(let e of lc(i)){if(r8(e))return!e.origin.isInline();if(!ip(e.origin)){if(iy(e.origin))return!0;break}}return!1}function l7(e){let t=l5(e);return null!==t&&"rtl"===t.direction}function l9(e,t,n){let i,r=l7(e);i=l6(e)||r?!n:n,e.modify(t?"extend":"move",i,"character")}function l8(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=null,r=e.getNodes(),l=e.anchor,o=e.focus,s=e.isBackward(),a=s?o.offset:l.offset,u=s?o.getNode():l.getNode();if(nv(e)&&e.isCollapsed()&&""!==e.style){let n=lJ(e.style);if(null!==n&&t in n)return n[t]}for(let e=0;e1?t-1:0),i=1;ilQ,"$getSelectionStyleValueForProperty",()=>l8,"$isAtNodeEnd",()=>lZ,"$isParentRTL",()=>lq,"$moveCharacter",()=>l9,"$patchStyleText",()=>l1,"$setBlocksType",()=>l3,"$shouldOverrideDefaultCharacterSelection",()=>l4,"$sliceSelectedTextNodeContent",()=>lX,"createRectsFromDOMRange",()=>lU,"getStyleObjectFromCSS",()=>lJ],974725);let ot="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,on=ot&&"documentMode"in document?document.documentMode:null,oi=(ot&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ot&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));function or(e){return e?e.getAdjacentCaret():null}function ol(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function oo(e){let t=rQ(e,e=>ip(e)&&!e.isInline());return ip(t)||oe(4,e.__key),t}function os(e,t,n){let i=lb(t,"next");for(let e=i;e;e=lI(e,n))i=e;return r7(i)&&oe(283),i.insert(e.isInline()?iA().append(e):e),lb(li(e.getLatest(),"next"),t.direction)}function oa(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function ou(e){let t=nB();if(!nv(t))return!1;let n=new Set,i=t.getNodes();for(let t=0;tip(e)&&!e.isInline());if(null===o)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}ot&&"InputEvent"in window&&!on&&new window.InputEvent("input"),ot&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ot&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,ot&&/Android/.test(navigator.userAgent),ot&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ot&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);let od=!(oi||!ot)&&void 0;function oc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=1;if(function(){if(void 0===od){let e=document.createElement("div");e.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty("zoom","2"),od=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return od}()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}e.s(["$getAdjacentCaret",()=>or,"$getNearestBlockElementAncestorOrThrow",()=>oo,"$getNearestNodeOfType",()=>ol,"$handleIndentAndOutdent",()=>ou,"$insertNodeToNearestRootAtCaret",()=>os,"calculateZoomLevel",()=>oc,"objectKlassEquals",()=>oa],410911)},546910,600745,84657,626161,463370,e=>{"use strict";var t=e.i(942347);let n=(0,t.createContext)(null);function i(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}function r(){let e=(0,t.useContext)(n);return null==e&&function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;in,"createLexicalComposerContext",()=>i,"useLexicalComposerContext",()=>r],600745);var l=e.i(703057),o=e.i(162115);let s="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,a=s?t.useLayoutEffect:t.useEffect,u={tag:l.HISTORY_MERGE_TAG};function d(e){let{initialConfig:r,children:d}=e,c=(0,t.useMemo)(()=>{let{theme:e,namespace:t,nodes:n,onError:o,editorState:a,html:d}=r,c=i(null,e),f=(0,l.createEditor)({editable:r.editable,html:d,namespace:t,nodes:n,onError:e=>o(e,f),theme:e});return function(e,t){if(null!==t){if(void 0===t)e.update(()=>{let t=(0,l.$getRoot)();if(t.isEmpty()){let n=(0,l.$createParagraphNode)();t.append(n);let i=s?document.activeElement:null;(null!==(0,l.$getSelection)()||null!==i&&i===e.getRootElement())&&n.select()}},u);else if(null!==t)switch(typeof t){case"string":{let n=e.parseEditorState(t);e.setEditorState(n,u);break}case"object":e.setEditorState(t,u);break;case"function":e.update(()=>{(0,l.$getRoot)().isEmpty()&&t(e)},u)}}}(f,a),[f,c]},[]);return a(()=>{let e=r.editable,[t]=c;t.setEditable(void 0===e||e)},[]),(0,o.jsx)(n.Provider,{value:c,children:d})}function c(e){return()=>(function(e){if(!function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(e)return!1;let n=(0,l.$getRoot)().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;let t=(0,l.$getRoot)().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;ed],546910),e.s(["$canShowPlaceholderCurry",()=>c],84657);let f="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,g=(0,t.forwardRef)(function(e,n){let{editor:i,ariaActiveDescendant:r,ariaAutoComplete:l,ariaControls:s,ariaDescribedBy:a,ariaErrorMessage:u,ariaExpanded:d,ariaInvalid:c,ariaLabel:g,ariaLabelledBy:h,ariaMultiline:p,ariaOwns:_,ariaRequired:m,autoCapitalize:y,className:C,id:S,role:N="textbox",spellCheck:x=!0,style:v,tabIndex:E,"data-testid":T,...O}=e,[M,A]=(0,t.useState)(i.isEditable()),b=(0,t.useCallback)(e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView?i.setRootElement(e):i.setRootElement(null)},[i]),D=(0,t.useMemo)(()=>(function(){for(var e=arguments.length,t=Array(e),n=0;n{for(let n of t)"function"==typeof n?n(e):null!=n&&(n.current=e)}})(n,b),[b,n]);return f(()=>(A(i.isEditable()),i.registerEditableListener(e=>{A(e)})),[i]),(0,o.jsx)("div",{"aria-activedescendant":M?r:void 0,"aria-autocomplete":M?l:"none","aria-controls":M?s:void 0,"aria-describedby":a,...null!=u?{"aria-errormessage":u}:{},"aria-expanded":M&&"combobox"===N?!!d:void 0,...null!=c?{"aria-invalid":c}:{},"aria-label":g,"aria-labelledby":h,"aria-multiline":p,"aria-owns":M?_:void 0,"aria-readonly":!M||void 0,"aria-required":m,autoCapitalize:y,className:C,contentEditable:M,"data-testid":T,id:S,ref:D,role:N,spellCheck:x,style:v,tabIndex:E,...O})});function h(e){return e.getEditorState().read(c(e.isComposing()))}let p=(0,t.forwardRef)(function(e,t){let{placeholder:n,...i}=e,[l]=r();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g,{editor:l,...i,ref:t}),null!=n&&(0,o.jsx)(_,{editor:l,content:n})]})});function _(e){let{content:n,editor:i}=e,r=function(e){let[n,i]=(0,t.useState)(()=>h(e));return f(()=>{function t(){i(h(e))}return t(),(0,l.mergeRegister)(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),n}(i),[s,a]=(0,t.useState)(i.isEditable());if((0,t.useLayoutEffect)(()=>(a(i.isEditable()),i.registerEditableListener(e=>{a(e)})),[i]),!r)return null;let u=null;return"function"==typeof n?u=n(s):null!==n&&(u=n),null===u?null:(0,o.jsx)("div",{"aria-hidden":!0,children:u})}e.s(["ContentEditable",()=>p],626161);var m=t;let y=(0,m.createContext)(null),C={didCatch:!1,error:null};class S extends m.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=C}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(e.resetKeys,i)&&(this.props.onReset?.({next:i,prev:e.resetKeys,reason:"keys"}),this.setState(C))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:r,error:l}=this.state,o=e;if(r){let e={error:l,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(n)o=(0,m.createElement)(n,e);else if(void 0!==i)o=i;else throw l}return(0,m.createElement)(y.Provider,{value:{didCatch:r,error:l,resetErrorBoundary:this.resetErrorBoundary}},o)}}function N(e){let{children:t,onError:n}=e;return(0,o.jsx)(S,{fallback:(0,o.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:n,children:t})}e.s(["LexicalErrorBoundary",()=>N],463370)},501522,e=>{"use strict";let t,n;var i=e.i(703057),r=e.i(410911);let l=Symbol.for("preact-signals");function o(){if(u>1)return void u--;let e,t=!1;for(;void 0!==n;){let i=n;for(n=void 0,d++;void 0!==i;){let n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&p(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=n}}if(d=0,u--,t)throw e}function s(e){if(u>0)return e();u++;try{return e()}finally{o()}}function a(e){let n=t;t=void 0;try{return e()}finally{t=n}}let u=0,d=0,c=0;function f(e){if(void 0===t)return;let n=e.n;return void 0===n||n.t!==t?(n={i:0,S:e,p:t.s,n:void 0,t:t,e:void 0,x:void 0,r:n},void 0!==t.s&&(t.s.n=n),t.s=n,e.n=n,32&t.f&&e.S(n),n):-1===n.i?(n.i=0,void 0!==n.n&&(n.n.p=n.p,void 0!==n.p&&(n.p.n=n.n),n.p=t.s,n.n=void 0,t.s.n=n,t.s=n),n):void 0}function g(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function h(e,t){return new g(e,t)}function p(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function _(e){for(let t=e.s;void 0!==t;t=t.n){let n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function m(e){let t,n=e.s;for(;void 0!==n;){let e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function y(e,t){g.call(this,void 0),this.x=e,this.s=void 0,this.g=c-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function C(e){let n=e.u;if(e.u=void 0,"function"==typeof n){u++;let i=t;t=void 0;try{n()}catch(t){throw e.f&=-2,e.f|=8,S(e),t}finally{t=i,o()}}}function S(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,C(e)}function N(e){if(t!==this)throw Error("Out-of-order effect");m(this),t=e,this.f&=-2,8&this.f&&S(this),o()}function x(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function v(e,t){let n=new x(e,t);try{n.c()}catch(e){throw n.d(),e}let i=n.d.bind(n);return i[Symbol.dispose]=i,i}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};for(let i in e){let r=t[i],l=h(void 0===r?e[i]:r);n[i]=l}return n}function T(){let e=(0,i.$getRoot)(),t=(0,i.$getSelection)(),n=(0,i.$createParagraphNode)();e.clear(),e.append(n),null!==t&&n.select(),(0,i.$isRangeSelection)(t)&&(t.format=0)}g.prototype.brand=l,g.prototype.h=function(){return!0},g.prototype.S=function(e){let t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:a(()=>{var e;null==(e=this.W)||e.call(this)}))},g.prototype.U=function(e){if(void 0!==this.t){let t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&a(()=>{var e;null==(e=this.Z)||e.call(this)}))}},g.prototype.subscribe=function(e){return v(()=>{let n=this.value,i=t;t=void 0;try{e(n)}finally{t=i}},{name:"sub"})},g.prototype.valueOf=function(){return this.value},g.prototype.toString=function(){return this.value+""},g.prototype.toJSON=function(){return this.value},g.prototype.peek=function(){let e=t;t=void 0;try{return this.value}finally{t=e}},Object.defineProperty(g.prototype,"value",{get(){let e=f(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(d>100)throw Error("Cycle detected");this.v=e,this.i++,c++,u++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{o()}}}}),y.prototype=new g,y.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f)||(this.f&=-5,this.g===c))return!0;if(this.g=c,this.f|=1,this.i>0&&!p(this))return this.f&=-2,!0;let e=t;try{_(this),t=this;let e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return t=e,m(this),this.f&=-2,!0},y.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}g.prototype.S.call(this,e)},y.prototype.U=function(e){if(void 0!==this.t&&(g.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(y.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=f(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),x.prototype.c=function(){let e=this.S();try{if(8&this.f||void 0===this.x)return;let e=this.x();"function"==typeof e&&(this.u=e)}finally{e()}},x.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,C(this),_(this),u++;let e=t;return t=this,N.bind(this,e)},x.prototype.N=function(){2&this.f||(this.f|=2,this.o=n,n=this)},x.prototype.d=function(){this.f|=8,1&this.f||S(this)},x.prototype.dispose=function(){this.d()},(0,i.defineExtension)({build:(e,t,n)=>E(t),config:(0,i.safeCast)({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let i=n.getOutput();return v(()=>i.disabled.value?void 0:e.registerRootListener(t=>{e.focus(()=>{let e=document.activeElement;null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})},{defaultSelection:i.defaultSelection.peek()})}))}}),(0,i.defineExtension)({build:(e,t,n)=>E(t),config:(0,i.safeCast)({$onClear:T}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:r}=n.getOutput();return v(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T;return e.registerCommand(i.CLEAR_EDITOR_COMMAND,n=>(e.update(t),!0),i.COMMAND_PRIORITY_EDITOR)})(e,r.value))}});let O=(0,i.createState)("format",{parse:e=>"number"==typeof e?e:0});class M extends i.DecoratorNode{$config(){return this.config("decorator-text",{extends:i.DecoratorNode,stateConfigs:[{flat:!0,stateConfig:O}]})}getFormat(){return(0,i.$getState)(this,O)}getFormatFlags(e,t){return(0,i.toggleTextFormatType)(this.getFormat(),e,t)}hasFormat(e){let t=i.TEXT_TYPE_TO_FORMAT[e];return 0!=(this.getFormat()&t)}setFormat(e){return(0,i.$setState)(this,O,e)}toggleFormat(e){let t=this.getFormat(),n=(0,i.toggleTextFormatType)(t,e,null);return this.setFormat(n)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}}function A(e,t){let n;return h(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}(0,i.defineExtension)({name:"@lexical/extension/DecoratorText",nodes:()=>[M],register:(e,t,n)=>e.registerCommand(i.FORMAT_TEXT_COMMAND,e=>{let t=(0,i.$getSelection)();if((0,i.$isNodeSelection)(t)||(0,i.$isRangeSelection)(t))for(let n of t.getNodes())n instanceof M&&n.toggleFormat(e);return!1},i.COMMAND_PRIORITY_LOW)});let b=(0,i.defineExtension)({build:e=>A(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:"@lexical/extension/EditorState"});function D(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;it,getSignal:this.getSignal.bind(this)};this.state=Object.assign(n,{id:5,output:t,registerState:i})}register(e,t){this._signal=t;let n=this.state;5!==n.id&&D(308,String(n.id),String(5));let i=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=Object.assign(n,{id:6}),()=>{let e=this.state;7!==e.id&&D(309,String(n.id),String(7)),this.state=Object.assign(e,{id:5}),i&&i()}}afterRegistration(e){let t,n=this.state;return 6!==n.id&&D(310,String(n.id),String(6)),this.extension.afterRegistration&&(t=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=Object.assign(n,{id:7}),t}getSignal(){return void 0===this._signal&&D(311),this._signal}getInitResult(){void 0===this.extension.init&&D(312,this.extension.name);let e=this.state;return e.id>=4||D(313,String(e.id),String(4)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return e.id>=3||D(314,String(e.id),String(3)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&D(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&D(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return e.id>=7||D(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||w}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(e=>{let[t]=e;return t})),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;e.id>=5||D(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}let k={tag:i.HISTORY_MERGE_TAG};function I(){let e=(0,i.$getRoot)();e.isEmpty()&&e.append((0,i.$createParagraphNode)())}let P=(0,i.defineExtension)({config:(0,i.safeCast)({setOptions:k,updateOptions:k}),init:e=>{let{$initialEditorState:t=I}=e;return{$initialEditorState:t,initialized:!1}},afterRegistration(e,t,n){let{updateOptions:r,setOptions:l}=t,o=n.getInitResult();if(!o.initialized){o.initialized=!0;let{$initialEditorState:t}=o;if((0,i.$isEditorState)(t))e.setEditorState(t,l);else if("function"==typeof t)e.update(()=>{t(e)},r);else if(t&&("string"==typeof t||"object"==typeof t)){let n=e.parseEditorState(t);e.setEditorState(n,l)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[i.RootNode,i.TextNode,i.LineBreakNode,i.TabNode,i.ParagraphNode]}),$=Symbol.for("@lexical/extension/LexicalBuilder");function L(){}function F(e){throw e}function K(e){return Array.isArray(e)?e:[e]}let B="0.41.0+prod.esm";class z{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){for(const t of(this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=B,this.roots=e,e))this.addExtension(t)}static fromExtensions(e){let t=[K(P)];for(let n of e)t.push(K(n));return new z(t)}static maybeFromEditor(e){let t=e[$];return t&&(t.PACKAGE_VERSION!==B&&D(292,t.PACKAGE_VERSION,B),t instanceof z||D(293)),t}static fromEditor(e){let t=z.maybeFromEditor(e);return void 0===t&&D(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign((0,i.createEditor)({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[$]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=L;function t(){try{e()}finally{e=L}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=(0,i.mergeRegister)(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&D(295,e.name),t}addEdge(e,t,n){let i=this.outgoingConfigEdges.get(e);i?i.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let r=this.incomingEdges.get(t);r?r.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&D(296);let[t]=K(e);"string"!=typeof t.name&&D(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(void 0!==n&&n.extension!==t&&D(298,t.name),!n){n=new R(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);for(let n of("string"==typeof e&&D(299,t.name,e),t.conflictsWith||[]))this.extensionNameMap.has(n)&&D(299,t.name,n),this.conflicts.set(n,t.name);for(let e of t.dependencies||[]){let n=K(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,i)=>{var r,l;let o=n.state;if(2===o.id)return;let s=n.extension.name;0===o.id||D(300,s,i||"[unknown]"),0===(r=o).id||D(304,String(r.id),String(0)),n.state=o=Object.assign(r,{id:1});let a=this.outgoingConfigEdges.get(s);if(a)for(let e of a.keys()){let n=this.extensionNameMap.get(e);n&&t(n,s)}1===(l=o).id||D(305,String(l.id),String(1)),n.state=o=Object.assign(l,{id:2}),e.push(n)};for(let e of this.extensionNameMap.values())0===e.state.id&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);for(let i of(void 0===n&&D(301,e.name),t))n.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],l=n.signal;for(let n of t){let t=n.register(e,l);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return(0,i.mergeRegister)(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,i=new Map,r={},l={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(void 0!==o.onError&&(e.onError=o.onError),void 0!==o.disableEvents&&(e.disableEvents=o.disableEvents),void 0!==o.parentEditor&&(e.parentEditor=o.parentEditor),void 0!==o.editable&&(e.editable=o.editable),void 0!==o.namespace&&(e.namespace=o.namespace),void 0!==o.$initialEditorState&&(e.$initialEditorState=o.$initialEditorState),o.nodes){for(let e of("function"==typeof o.nodes?o.nodes():o.nodes)||[]){if("function"!=typeof e){let t=n.get(e.replace);t&&D(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())i.set(e,t);o.html.import&&Object.assign(r,o.html.import)}o.theme&&function e(t,n){if(t&&n&&!Array.isArray(n)&&"object"==typeof t&&"object"==typeof n){for(let i in n)t[i]=e(t[i],n[i]);return t}return n}(l,o.theme)}Object.keys(l).length>0&&(e.theme=l),t.size&&(e.nodes=[...t]);let s=Object.keys(r).length>0,a=i.size>0;for(let t of((s||a)&&(e.html={},s&&(e.html.import=r),a&&(e.html.export=i)),o))t.init(e);return e.onError||(e.onError=F),e}}function W(e,t){let n=z.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}let Y=new Set,j=(0,i.defineExtension)({build(e,t,n){let r=n.getDependency(b).output,l=h({watchedNodeKeys:new Map}),o=A(()=>{},()=>v(()=>{let e=o.peek(),{watchedNodeKeys:t}=l.value,n,s=!1;r.value.read(()=>{if((0,i.$getSelection)())for(let[r,l]of t.entries()){if(0===l.size){t.delete(r);continue}let o=(0,i.$getNodeByKey)(r),a=o&&o.isSelected()||!1;s=s||a!==(!!e&&e.has(r)),a&&(n=n||new Set).add(r)}}),!s&&n&&e&&n.size===e.size||(o.value=n)}));return{watchNodeKey:function(e){let t=new y(()=>(o.value||Y).has(e),void 0),{watchedNodeKeys:n}=l.peek(),i=n.get(e),r=void 0!==i;return(i=i||new Set).add(t),r||(n.set(e,i),l.value={watchedNodeKeys:n}),t}}},dependencies:[b],name:"@lexical/extension/NodeSelection"});(0,i.createCommand)("INSERT_HORIZONTAL_RULE_COMMAND");class U extends i.DecoratorNode{static getType(){return"horizontalrule"}static clone(e){return new U(e.__key)}static importJSON(e){return J().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:H,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return(0,i.addClassNamesToElement)(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function H(){return{node:J()}}function J(){return(0,i.$create)(U)}function G(e){return e.canBeEmpty()}(0,i.defineExtension)({dependencies:[b,j],name:"@lexical/extension/HorizontalRule",nodes:()=>[U],register(e,t,n){let{watchNodeKey:r}=n.getDependency(j).output,l=h({nodeSelections:new Map}),o=e._config.theme.hrSelected??"selected";return(0,i.mergeRegister)(e.registerCommand(i.CLICK_COMMAND,e=>{if((0,i.isDOMNode)(e.target)){let t=(0,i.$getNodeFromDOMNode)(e.target);if(t instanceof U)return function(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(0,i.$getSelection)(),l=e.isSelected(),o=e.getKey();n&&(0,i.$isNodeSelection)(r)?t=r:(t=(0,i.$createNodeSelection)(),(0,i.$setSelection)(t)),l?t.delete(o):t.add(o)}(t,e.shiftKey),!0}return!1},i.COMMAND_PRIORITY_LOW),e.registerMutationListener(U,(t,n)=>{s(()=>{let n=!1,{nodeSelections:i}=l.peek();for(let[l,o]of t.entries())if("destroyed"===o)i.delete(l),n=!0;else{let t=i.get(l),o=e.getElementByKey(l);t?t.domNode.value=o:(n=!0,i.set(l,{domNode:h(o),selectedSignal:r(l)}))}n&&(l.value={nodeSelections:i})})}),v(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of l.value.nodeSelections.values())e.push(v(()=>{let e=t.value;e&&(n.value?(0,i.addClassNamesToElement)(e,o):(0,i.removeClassNamesFromElement)(e,o))}));return(0,i.mergeRegister)(...e)}))}}),(0,i.defineExtension)({build:(e,t,n)=>E(t),config:(0,i.safeCast)({$canIndent:G,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:l,maxIndent:o,$canIndent:s}=n.getOutput();return v(()=>{if(!l.value)return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G;return(0,i.mergeRegister)(e.registerCommand(i.KEY_TAB_COMMAND,t=>{let n=(0,i.$getSelection)();if(!(0,i.$isRangeSelection)(n))return!1;t.preventDefault();let l=!function(e){if(e.getNodes().filter(e=>(0,i.$isBlockElementNode)(e)&&e.canIndent()).length>0)return!0;let t=e.anchor,n=e.focus,l=n.isBefore(t)?n:t,o=l.getNode(),s=(0,r.$getNearestBlockElementAncestorOrThrow)(o);if(s.canIndent()){let e=s.getKey(),t=(0,i.$createRangeSelection)();if(t.anchor.set(e,0,"element"),t.focus.set(e,0,"element"),(t=(0,i.$normalizeSelection__EXPERIMENTAL)(t)).anchor.is(l))return!0}return!1}(n)?i.INSERT_TAB_COMMAND:t.shiftKey?i.OUTDENT_CONTENT_COMMAND:i.INDENT_CONTENT_COMMAND;return e.dispatchCommand(l,void 0)},i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.INDENT_CONTENT_COMMAND,()=>{let e="number"==typeof t?t:t?t.peek():null,l=(0,i.$getSelection)();if(!(0,i.$isRangeSelection)(l))return!1;let o="function"==typeof n?n:n.peek();return(0,r.$handleIndentAndOutdent)(t=>{if(o(t)){let n=t.getIndent()+1;(!e||nz,"batch",()=>s,"effect",()=>v,"getPeerDependencyFromEditor",()=>W,"namedSignals",()=>E])},789922,231365,20207,903858,729009,e=>{"use strict";var t=e.i(600745),n=e.i(501522),i=e.i(703057);function r(e){e.undoStack=[],e.redoStack=[],e.current=null}function l(e,t,n){let l,o,s,a,u,d=(l=Date.now(),o=0,s=Date.now(),a=0,u=null,(t,r,d,c,f,g)=>{let h=Date.now();if(g.has(i.COMPOSITION_START_TAG)&&(s=l,a=o,u=t),g.has(i.HISTORIC_TAG))return o=0,l=h,2;g.has(i.COMPOSITION_END_TAG)&&u&&(l=s,o=a,t=u);let p=function(e,t,n,r,l){if(null===e||0===n.size&&0===r.size&&!l)return 0;let o=t._selection,s=e._selection;if(l)return 1;if(!((0,i.$isRangeSelection)(o)&&(0,i.$isRangeSelection)(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;let a=function(e,t,n){let r=e._nodeMap,l=[];for(let e of t){let t=r.get(e);void 0!==t&&l.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);void 0===n||(0,i.$isRootNode)(n)||l.push(n)}return l}(t,n,r);if(0===a.length)return 0;if(a.length>1){let n=t._nodeMap,r=n.get(o.anchor.key),l=n.get(s.anchor.key);return r&&l&&!e._nodeMap.has(r.__key)&&(0,i.$isTextNode)(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}let u=a[0],d=e._nodeMap.get(u.__key);if(!(0,i.$isTextNode)(d)||!(0,i.$isTextNode)(u)||d.__mode!==u.__mode)return 0;let c=d.__text,f=u.__text;if(c===f)return 0;let g=o.anchor,h=s.anchor;if(g.key!==h.key||"text"!==g.type)return 0;let p=g.offset,_=h.offset,m=f.length-c.length;return 1===m&&_===p-1?2:-1===m&&_===p+1?3:4*(-1===m&&_===p)}(t,r,c,f,e.isComposing()),_=(()=>{var s,a;let u,_,m,y,C=null===d||d.editor===e,S=g.has(i.HISTORY_PUSH_TAG);if(!S&&C&&g.has(i.HISTORY_MERGE_TAG))return 0;if(1===p)return 2;if(null===t)return 1;let N=r._selection;if(!(c.size>0||f.size>0))return 2*(null===N);let x="number"==typeof n?n:n.peek();return!1===S&&0!==p&&p===o&&hu.exportJSON()))!==JSON.stringify(r.read(()=>_.exportJSON())))?1:0})();return l=h,o=p,_});return(0,i.mergeRegister)(e.registerCommand(i.UNDO_COMMAND,()=>((function(e,t){let n=t.redoStack,r=t.undoStack;if(0!==r.length){let l=t.current,o=r.pop();null!==l&&(n.push(l),e.dispatchCommand(i.CAN_REDO_COMMAND,!0)),0===r.length&&e.dispatchCommand(i.CAN_UNDO_COMMAND,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:i.HISTORIC_TAG})}})(e,t),!0),i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.REDO_COMMAND,()=>((function(e,t){let n=t.redoStack,r=t.undoStack;if(0!==n.length){let l=t.current;null!==l&&(r.push(l),e.dispatchCommand(i.CAN_UNDO_COMMAND,!0));let o=n.pop();0===n.length&&e.dispatchCommand(i.CAN_REDO_COMMAND,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:i.HISTORIC_TAG})}})(e,t),!0),i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.CLEAR_EDITOR_COMMAND,()=>(r(t),!1),i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.CLEAR_HISTORY_COMMAND,()=>(r(t),e.dispatchCommand(i.CAN_REDO_COMMAND,!1),e.dispatchCommand(i.CAN_UNDO_COMMAND,!1),!0),i.COMMAND_PRIORITY_EDITOR),e.registerUpdateListener(n=>{let{editorState:r,prevEditorState:l,dirtyLeaves:o,dirtyElements:s,tags:a}=n,u=t.current,c=t.redoStack,f=t.undoStack,g=null===u?null:u.editorState;if(null!==u&&r===g)return;let h=d(l,r,u,o,s,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(i.CAN_REDO_COMMAND,!1)),null!==u&&(f.push({...u}),e.dispatchCommand(i.CAN_UNDO_COMMAND,!0));else if(2===h)return;t.current={editor:e,editorState:r}}))}function o(){return{current:null,redoStack:[],undoStack:[]}}let s=(0,i.defineExtension)({build:(e,t)=>{let{delay:i,createInitialHistoryState:r,disabled:l}=t;return(0,n.namedSignals)({delay:i,disabled:l,historyState:r(e)})},config:(0,i.safeCast)({createInitialHistoryState:o,delay:300,disabled:"u"{let r=i.getOutput();return(0,n.effect)(()=>r.disabled.value?void 0:l(e,r.historyState.value,r.delay))}});(0,i.defineExtension)({dependencies:[(0,i.configExtension)(s,{createInitialHistoryState:()=>{throw Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(e,t,i){var r;let{output:l}=i.getDependency(s),o=(r=e._parentEditor)?(0,n.getPeerDependencyFromEditor)(r,s.name):null;if(!o)return()=>{};let a=o.output;return(0,n.effect)(()=>(0,n.batch)(()=>{l.delay.value=a.delay.value,l.historyState.value=a.historyState.value,l.disabled.value=a.disabled.value}))}});var a=e.i(942347);function u(e){let{delay:n,externalHistoryState:i}=e,[r]=(0,t.useLexicalComposerContext)();return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=(0,a.useMemo)(()=>t||o(),[t]);(0,a.useEffect)(()=>l(e,i,n),[n,e,i])}(r,i,n),null}e.s(["HistoryPlugin",()=>u],789922);let d="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.useLayoutEffect:a.useEffect;function c(e){let{ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:r=!1,onChange:l}=e,[o]=(0,t.useLexicalComposerContext)();return d(()=>{if(l)return o.registerUpdateListener(e=>{let{editorState:t,dirtyElements:s,dirtyLeaves:a,prevEditorState:u,tags:d}=e;r&&0===s.size&&0===a.size||n&&d.has(i.HISTORY_MERGE_TAG)||u.isEmpty()||l(t,o,d)})},[o,n,r,l]),null}e.s(["OnChangePlugin",()=>c],231365);let f="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.useLayoutEffect:a.useEffect;function g(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}let h=(0,i.defineExtension)({name:"@lexical/react/ReactProvider"});var p=e.i(939050),_=e.i(162115),m=e.i(84657);function y(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let l=n.data;if("string"==typeof l){let t;try{t=JSON.parse(l)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){let r=t.payload;if(r&&"makeChanges"===r.functionId){let t=r.args;if(t){let[r,l,o,s,a]=t;e.update(()=>{let e=(0,i.$getSelection)();if((0,i.$isRangeSelection)(e)){let t=e.anchor,u=t.getNode(),d=0,c=0;if((0,i.$isTextNode)(u)&&r>=0&&l>=0&&(d=r,c=r+l,e.setTextNodeRange(u,d,u,c)),d===c&&""===o||(e.insertRawText(o),u=t.getNode()),(0,i.$isTextNode)(u)){d=s,c=s+a;let t=u.getTextContentSize();d=d>t?t:d,c=c>t?t:c,e.setTextNodeRange(u,d,u,c)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}let C=(0,i.defineExtension)({build:(e,t,i)=>(0,n.namedSignals)(t),config:(0,i.safeCast)({disabled:"u"(0,n.effect)(()=>i.getOutput().disabled.value?void 0:y(e))});var S=e.i(974725);let N=new Set(["STYLE","SCRIPT"]);var x=e.i(410911);function v(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;ie}).createHTML(l):l,"text/html");return T(n,function(e,t){let n=(0,i.isDOMDocumentNode)(t)?t.body.childNodes:t.childNodes,r=[],l=[];for(let t of n)if(!N.has(t.nodeName)){let n=function e(t,n,r,l){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Map,s=arguments.length>5?arguments[5]:void 0,a=[];if(N.has(t.nodeName))return a;let u=null,d=function(e,t){let{nodeName:n}=e,i=t._htmlConversions.get(n.toLowerCase()),r=null;if(void 0!==i)for(let t of i){let n=t(e);null!==n&&(null===r||(r.priority||0)<=(n.priority||0))&&(r=n)}return null!==r?r.conversion:null}(t,n),c=d?d(t):null,f=null;if(null!==c){f=c.after;let e=c.node;if(null!==(u=Array.isArray(e)?e[e.length-1]:e)){for(let[,e]of o)if(!(u=e(u,s)))break;u&&a.push(...Array.isArray(e)?e:[u])}null!=c.forChild&&o.set(t.nodeName,c.forChild)}let g=t.childNodes,h=[],p=(null==u||!(0,i.$isRootOrShadowRoot)(u))&&(null!=u&&(0,i.$isBlockElementNode)(u)||l);for(let t=0;t{let e=new i.ArtificialNode__DO_NOT_USE;return r.push(e),e}:i.$createParagraphNode)),null==u?h.length>0?a=a.concat(h):(0,i.isBlockDomNode)(t)&&null!=t.nextSibling&&null!=t.previousSibling&&(0,i.isInlineDomNode)(t.nextSibling)&&(0,i.isInlineDomNode)(t.previousSibling)&&(a=a.concat((0,i.$createLineBreakNode)())):(0,i.$isElementNode)(u)&&u.append(...h),a}(t,e,l,!1);null!==n&&(r=r.concat(n))}return function(e){for(let t of e)t.getNextSibling()instanceof i.ArtificialNode__DO_NOT_USE&&t.insertAfter((0,i.$createLineBreakNode)());for(let t of e){for(let e of t.getChildren())t.insertBefore(e);t.remove()}}(l),r}(n,e),t)}catch(e){console.error(e)}let s=o||e.getData("text/uri-list");if(null!=s)if((0,i.$isRangeSelection)(t)){let e=s.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t{e.update(()=>{i(A(e,t,n))})});let r=e.getRootElement(),l=e._window||window,o=l.document,s=(0,i.getDOMSelection)(l);if(null===r||null===s)return!1;let a=o.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(o.createTextNode("#")),r.append(a);let u=new Range;return u.setStart(a,0),u.setEnd(a,1),s.removeAllRanges(),s.addRange(u),new Promise((t,r)=>{let s=e.registerCommand(i.COPY_COMMAND,i=>((0,x.objectKlassEquals)(i,ClipboardEvent)&&(s(),null!==O&&(l.clearTimeout(O),O=null),t(A(e,i,n))),!0),i.COMMAND_PRIORITY_CRITICAL);O=l.setTimeout(()=>{s(),O=null,t(!1)},50),o.execCommand("copy"),a.remove()})}function A(e,t,n){if(void 0===n){let t=(0,i.getDOMSelection)(e._window),r=(0,i.$getSelection)();if(!r||r.isCollapsed()||!t)return!1;let l=t.anchorNode,o=t.focusNode;if(null!==l&&null!==o&&!(0,i.isSelectionWithinEditor)(e,l,o))return!1;n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,i.$getSelection)(),t={"text/plain":e?e.getTextContent():""};if(e){let n=(0,i.$getEditor)();for(let[i,r]of b){let l=r(n,e);null!==l&&(t[i]=l)}}return t}(r)}t.preventDefault();let r=t.clipboardData;return null!==r&&(function(e,t){for(let[n]of b)void 0===t[n]&&e.setData(n,"");for(let n in t){let i=t[n];void 0!==i&&e.setData(n,i)}}(r,n),!0)}let b=[["text/html",function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,i.$getSelection)();return null==n&&v(166),(0,i.$isRangeSelection)(n)&&n.isCollapsed()||0===n.getNodes().length?"":function(t,n){if("u"3&&void 0!==arguments[3]?arguments[3]:null,o=null===l||n.isSelected(l),s=(0,i.$isElementNode)(n)&&n.excludeFromCopy("html"),a=n;null!==l&&(0,i.$isTextNode)(n)&&(a=(0,S.$sliceSelectedTextNodeContent)(l,n,"clone"));let u=(0,i.$isElementNode)(a)?a.getChildren():[],d=(0,i.getRegisteredNode)(t,a.getType()),{element:c,after:f}=d&&void 0!==d.exportDOM?d.exportDOM(t,a):a.exportDOM(t);if(!c)return!1;let g=document.createDocumentFragment();for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:(0,i.$getSelection)();return null==t&&v(166),(0,i.$isRangeSelection)(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){let n=[],r=(0,i.$getRoot)().getChildren();for(let l=0;l3&&void 0!==arguments[3]?arguments[3]:[],u=null===n||r.isSelected(n),d=(0,i.$isElementNode)(r)&&r.excludeFromCopy("html"),c=r;null!==n&&(0,i.$isTextNode)(c)&&(c=(0,S.$sliceSelectedTextNodeContent)(n,c,"clone"));let f=(0,i.$isElementNode)(c)?c.getChildren():[],g=(o=(l=c).exportJSON(),s=l.constructor,o.type!==s.getType()&&v(58,s.name),(0,i.$isElementNode)(l)&&(Array.isArray(o.children)||v(59,s.name)),o);(0,i.$isTextNode)(c)&&0===c.getTextContentSize()&&(u=!1);for(let l=0;ltypeof window&&void 0!==window.document&&void 0!==window.document.createElement,k=R&&"documentMode"in document?document.documentMode:null,I=R&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),P=!(!R||!("InputEvent"in window)||k)&&"getTargetRanges"in new window.InputEvent("input"),$=R&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),L=R&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,F=R&&/^(?=.*Chrome).*/i.test(navigator.userAgent),K=R&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&I&&!F,B=(0,D.createCommand)("DRAG_DROP_PASTE_FILE");class z extends D.ElementNode{static getType(){return"quote"}static clone(e){return new z(e.__key)}createDOM(e){let t=document.createElement("blockquote");return(0,D.addClassNamesToElement)(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:H,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,D.isHTMLElement)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return W().updateFromJSON(e)}insertNewAfter(e,t){let n=(0,D.$createParagraphNode)(),i=this.getDirection();return n.setDirection(i),this.insertAfter(n,t),n}collapseAtStart(){let e=(0,D.$createParagraphNode)();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function W(){return(0,D.$applyNodeReplacement)(new z)}class Y extends D.ElementNode{__tag;static getType(){return"heading"}static clone(e){return new Y(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),i=e.theme.heading;if(void 0!==i){let e=i[t];(0,D.addClassNamesToElement)(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:U,priority:0}),h2:e=>({conversion:U,priority:0}),h3:e=>({conversion:U,priority:0}),h4:e=>({conversion:U,priority:0}),h5:e=>({conversion:U,priority:0}),h6:e=>({conversion:U,priority:0}),p:e=>{let t=e.firstChild;return null!==t&&j(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>j(e)?{conversion:e=>({node:J("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,D.isHTMLElement)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return J(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=e?e.anchor.offset:0,i=this.getLastDescendant(),r=i&&(!e||e.anchor.key!==i.getKey()||n!==i.getTextContentSize())&&e?J(this.getTag()):(0,D.$createParagraphNode)(),l=this.getDirection();if(r.setDirection(l),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){let e=(0,D.$createParagraphNode)();e.select(),this.replace(e,!0)}return r}collapseAtStart(){let e=this.isEmpty()?(0,D.$createParagraphNode)():J(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function j(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function U(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=J(t),null!==e.style&&((0,D.setNodeIndentFromDOM)(e,n),n.setFormat(e.style.textAlign))),{node:n}}function H(e){let t=W();return null!==e.style&&(t.setFormat(e.style.textAlign),(0,D.setNodeIndentFromDOM)(e,t)),{node:t}}function J(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"h1";return(0,D.$applyNodeReplacement)(new Y(e))}function G(e){let t=null;if((0,x.objectKlassEquals)(e,DragEvent)?t=e.dataTransfer:(0,x.objectKlassEquals)(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];let n=t.types,i=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[i,Array.from(t.files),r]}function V(e){let t=(0,D.$getNearestNodeFromDOMNode)(e);return(0,D.$isDecoratorNode)(t)}function q(e){for(let t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function X(e){return(0,D.mergeRegister)(e.registerCommand(D.CLICK_COMMAND,e=>{let t=(0,D.$getSelection)();return!!(0,D.$isNodeSelection)(t)&&(t.clear(),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.DELETE_CHARACTER_COMMAND,e=>{let t=(0,D.$getSelection)();return(0,D.$isRangeSelection)(t)?(t.deleteCharacter(e),!0):!!(0,D.$isNodeSelection)(t)&&(t.deleteNodes(),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.DELETE_WORD_COMMAND,e=>{let t=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(t)&&(t.deleteWord(e),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.DELETE_LINE_COMMAND,e=>{let t=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(t)&&(t.deleteLine(e),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.CONTROLLED_TEXT_INSERTION_COMMAND,t=>{let n=(0,D.$getSelection)();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;let i=t.dataTransfer;if(null!=i)E(i,n,e);else if((0,D.$isRangeSelection)(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.REMOVE_TEXT_COMMAND,()=>{let e=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(e)&&(e.removeText(),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.FORMAT_TEXT_COMMAND,e=>{let t=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(t)&&(t.formatText(e),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.FORMAT_ELEMENT_COMMAND,e=>{let t=(0,D.$getSelection)();if(!(0,D.$isRangeSelection)(t)&&!(0,D.$isNodeSelection)(t))return!1;for(let n of t.getNodes()){let t=(0,D.$findMatchingParent)(n,e=>(0,D.$isElementNode)(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.INSERT_LINE_BREAK_COMMAND,e=>{let t=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(t)&&(t.insertLineBreak(e),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.INSERT_PARAGRAPH_COMMAND,()=>{let e=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(e)&&(e.insertParagraph(),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.INSERT_TAB_COMMAND,()=>{let e=(0,D.$createTabNode)(),t=(0,D.$getSelection)();return(0,D.$isRangeSelection)(t)&&(e.setFormat(t.format),e.setStyle(t.style)),(0,D.$insertNodes)([e]),!0},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.INDENT_CONTENT_COMMAND,()=>(0,x.$handleIndentAndOutdent)(e=>{let t=e.getIndent();e.setIndent(t+1)}),D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.OUTDENT_CONTENT_COMMAND,()=>(0,x.$handleIndentAndOutdent)(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_ARROW_UP_COMMAND,e=>{let t=(0,D.$getSelection)();if((0,D.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if((0,D.$isRangeSelection)(t)){let n=(0,D.$getAdjacentNode)(t.focus,!0);if(!e.shiftKey&&(0,D.$isDecoratorNode)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_ARROW_DOWN_COMMAND,e=>{let t=(0,D.$getSelection)();if((0,D.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if((0,D.$isRangeSelection)(t)){let n;if("root"===(n=t.focus).key&&n.offset===(0,D.$getRoot)().getChildrenSize())return e.preventDefault(),!0;let i=(0,D.$getAdjacentNode)(t.focus,!1);if(!e.shiftKey&&(0,D.$isDecoratorNode)(i)&&!i.isIsolated()&&!i.isInline())return i.selectNext(),e.preventDefault(),!0}return!1},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_ARROW_LEFT_COMMAND,e=>{let t=(0,D.$getSelection)();if((0,D.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),(0,S.$isParentRTL)(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!(0,D.$isRangeSelection)(t))return!1;if((0,S.$shouldOverrideDefaultCharacterSelection)(t,!0)){let n=e.shiftKey;return e.preventDefault(),(0,S.$moveCharacter)(t,n,!0),!0}return!1},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_ARROW_RIGHT_COMMAND,e=>{let t=(0,D.$getSelection)();if((0,D.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),(0,S.$isParentRTL)(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!(0,D.$isRangeSelection)(t))return!1;let n=e.shiftKey;return!!(0,S.$shouldOverrideDefaultCharacterSelection)(t,!1)&&(e.preventDefault(),(0,S.$moveCharacter)(t,n,!1),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_BACKSPACE_COMMAND,t=>{if(V(t.target))return!1;let n=(0,D.$getSelection)();if((0,D.$isRangeSelection)(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(0!==t.offset)return!1;let n=t.getNode();if((0,D.$isRootNode)(n))return!1;let i=(0,x.$getNearestBlockElementAncestorOrThrow)(n);return i.getIndent()>0&&(i.is(n)||n.is(i.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(D.OUTDENT_CONTENT_COMMAND,void 0);if(L&&"ko-KR"===navigator.language)return!1}else if(!(0,D.$isNodeSelection)(n))return!1;return t.preventDefault(),e.dispatchCommand(D.DELETE_CHARACTER_COMMAND,!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_DELETE_COMMAND,t=>{if(V(t.target))return!1;let n=(0,D.$getSelection)();return!(!(0,D.$isRangeSelection)(n)&&!(0,D.$isNodeSelection)(n))&&(t.preventDefault(),e.dispatchCommand(D.DELETE_CHARACTER_COMMAND,!1))},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_ENTER_COMMAND,t=>{let n=(0,D.$getSelection)();if(!(0,D.$isRangeSelection)(n))return!1;if(q(n),null!==t){if((L||$||K)&&P)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(D.INSERT_LINE_BREAK_COMMAND,!1)}return e.dispatchCommand(D.INSERT_PARAGRAPH_COMMAND,void 0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_ESCAPE_COMMAND,()=>{let t=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(t)&&(e.blur(),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.DROP_COMMAND,t=>{let[,n]=G(t);if(n.length>0){let i=w(t.clientX,t.clientY);if(null!==i){let{offset:t,node:r}=i,l=(0,D.$getNearestNodeFromDOMNode)(r);if(null!==l){let e=(0,D.$createRangeSelection)();if((0,D.$isTextNode)(l))e.anchor.set(l.getKey(),t,"text"),e.focus.set(l.getKey(),t,"text");else{let t=l.getParentOrThrow().getKey(),n=l.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}let n=(0,D.$normalizeSelection__EXPERIMENTAL)(e);(0,D.$setSelection)(n)}e.dispatchCommand(B,n)}return t.preventDefault(),!0}let i=(0,D.$getSelection)();return!!(0,D.$isRangeSelection)(i)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.DRAGSTART_COMMAND,e=>{let[t]=G(e),n=(0,D.$getSelection)();return!(t&&!(0,D.$isRangeSelection)(n))},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.DRAGOVER_COMMAND,e=>{let[t]=G(e),n=(0,D.$getSelection)();if(t&&!(0,D.$isRangeSelection)(n))return!1;let i=w(e.clientX,e.clientY);if(null!==i){let t=(0,D.$getNearestNodeFromDOMNode)(i.node);(0,D.$isDecoratorNode)(t)&&e.preventDefault()}return!0},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.SELECT_ALL_COMMAND,()=>((0,D.$selectAll)(),!0),D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.COPY_COMMAND,t=>(M(e,(0,x.objectKlassEquals)(t,ClipboardEvent)?t:null),!0),D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.CUT_COMMAND,t=>((async function(e,t){await M(t,(0,x.objectKlassEquals)(e,ClipboardEvent)?e:null),t.update(()=>{let e=(0,D.$getSelection)();(0,D.$isRangeSelection)(e)?e.removeText():(0,D.$isNodeSelection)(e)&&e.getNodes().forEach(e=>e.remove())})})(t,e),!0),D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.PASTE_COMMAND,t=>{let[,n,i]=G(t);return n.length>0&&!i?(e.dispatchCommand(B,n),!0):!((0,D.isDOMNode)(t.target)&&(0,D.isSelectionCapturedInDecoratorInput)(t.target))&&null!==(0,D.$getSelection)()&&(t.preventDefault(),e.update(()=>{let n=(0,D.$getSelection)(),i=(0,x.objectKlassEquals)(t,InputEvent)||(0,x.objectKlassEquals)(t,KeyboardEvent)?null:t.clipboardData;null!=i&&null!==n&&E(i,n,e)},{tag:D.PASTE_TAG}),!0)},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_SPACE_COMMAND,e=>{let t=(0,D.$getSelection)();return(0,D.$isRangeSelection)(t)&&q(t),!1},D.COMMAND_PRIORITY_EDITOR),e.registerCommand(D.KEY_TAB_COMMAND,e=>{let t=(0,D.$getSelection)();return(0,D.$isRangeSelection)(t)&&q(t),!1},D.COMMAND_PRIORITY_EDITOR))}(0,D.defineExtension)({conflictsWith:["@lexical/plain-text"],dependencies:[C],name:"@lexical/rich-text",nodes:()=>[Y,z],register:X}),e.s(["eventFiles",()=>G,"registerRichText",()=>X],20207);let Z="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.useLayoutEffect:a.useEffect;function Q(e){let{editor:t,ErrorBoundary:n}=e;return function(e,t){let[n,i]=(0,a.useState)(()=>e.getDecorators());return Z(()=>e.registerDecoratorListener(e=>{(0,p.flushSync)(()=>{i(e)})}),[e]),(0,a.useEffect)(()=>{i(e.getDecorators())},[e]),(0,a.useMemo)(()=>{let i=[],r=Object.keys(n);for(let l=0;le._onError(t),children:(0,_.jsx)(a.Suspense,{fallback:null,children:n[o]})}),u=e.getElementByKey(o);null!==u&&i.push((0,p.createPortal)(s,u,o))}return i},[t,n,e])}(t,n)}function ee(e){let{editor:t,ErrorBoundary:i}=e;return!function(e){let t=n.LexicalBuilder.maybeFromEditor(e);if(t&&t.hasExtensionByName(h.name)){for(let e of["@lexical/plain-text","@lexical/rich-text"])t.hasExtensionByName(e)&&function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i(0,i.mergeRegister)(X(n),y(n)),[n=s]),(0,_.jsxs)(_.Fragment,{children:[r,(0,_.jsx)(ei,{content:l}),(0,_.jsx)(ee,{editor:s,ErrorBoundary:o})]})}function ei(e){let{content:n}=e,[r]=(0,t.useLexicalComposerContext)(),l=function(e){let[t,n]=(0,a.useState)(()=>et(e));return Z(()=>{function t(){n(et(e))}return t(),(0,i.mergeRegister)(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(r),o=function(e){let[n]=(0,t.useLexicalComposerContext)(),i=(0,a.useMemo)(()=>e(n),[n,e]),[r,l]=(0,a.useState)(()=>i.initialValueFn()),o=(0,a.useRef)(r);return f(()=>{let{initialValueFn:e,subscribe:t}=i,n=e();return o.current!==n&&(o.current=n,l(n)),t(e=>{o.current=e,l(e)})},[i,e]),r}(g);return l?"function"==typeof n?n(o):n:null}e.s(["RichTextPlugin",()=>en],903858),e.i(816688);var er=e.i(675066),el=e.i(935139);let eo=(0,a.memo)(e=>{let{compact:t,value:n,className:i}=e,{t:r}=(0,er.useTranslation)();return(0,_.jsx)("div",{className:(0,el.cn)("pointer-events-none absolute left-0 top-0 h-full w-full select-none text-sm text-components-input-text-placeholder",t?"text-[13px] leading-5":"text-sm leading-6",i),children:n||r("promptEditor.placeholder",{ns:"common"})})});e.s(["default",0,eo],729009)}]);