sykpcomposer 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -38,5 +38,5 @@ Check the top-level render call using <`+I+">.")}return w}}function Is(p,w){{if(
38
38
  `||s===`\r
39
39
  `?r.push(Xe()):s===" "?r.push(Vt()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,v,x,y){const b=_.getNode(),T=b.getChildAtIndex(_.offset),S=ie(),E=oe(b)?we().append(S):S;S.setFormat(x),S.setStyle(y),T===null?b.append(E):T.insertBefore(E),_.is(v)&&v.set(S.__key,0,"text"),_.set(S.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let d=u[0];j(d)||L(26);const g=d.getTextContent().length,h=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=g,l.set(s.key,c,"text")),this.isCollapsed()&&a===g&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!at(_)||(_=ie(),_.setFormat(i),_.setStyle(o),h.canInsertTextAfter()?d.insertAfter(_):h.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(j(_)&&!at(_)||(_=ie(),_.setFormat(i),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==g){const _=ie(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Do(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const y=ie(e);return y.select(),void d.replace(y)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===i&&v===o){if(Wl(d)){const y=ie(e);return y.setFormat(i),y.setStyle(o),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=ie(e);if(y.setFormat(i),y.setStyle(o),y.select(),a===0)d.insertBefore(y,!1);else{const[b]=d.splitText(a);b.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(o)}const x=c-a;d=d.spliceText(a,x,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=C(d)?d:d.getParentOrThrow();let x=C(m)?m:m.getParentOrThrow(),y=m;if(!v.is(x)&&x.isInline())do y=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(j(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const N=ie(m.getTextContent());m.replace(N),m=N}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const N=m.getParentOrThrow();N.canBeEmpty()||N.getChildrenSize()!==1?m.remove():N.remove()}else _.add(m.__key);const b=x.getChildren(),T=new Set(u),S=v.is(x),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let N=b.length-1;N>=0;N--){const M=b[N];if(M.is(d)||C(M)&&M.isParentOf(d))break;M.isAttached()&&(!T.has(M)||M.is(y)?S||E.insertAfter(M,!1):M.remove())}if(!S){let N=x,M=null;for(;N!==null;){const R=N.getChildren(),B=R.length;(B===0||R[B-1].is(M))&&(_.delete(N.__key),M=N),N=N.getParent()}}if(d.isToken())if(a===g)d.select();else{const N=ie(e);N.select(),d.replace(N)}else d=d.spliceText(a,g-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let N=1;N<f;N++){const M=u[N],R=M.__key;_.has(R)||M.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const x of t)j(x)&&r.push(x);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const g=f.getFormatFlags(e,null),h=i-1;let m=r[h];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(at(f)||d===0&&_===f.getTextContentSize())f.setFormat(g);else{const x=f.splitText(d,_),y=d===0?x[0]:x[1];y.setFormat(g),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-d,"text")}return void(this.format=g)}d===0||at(f)||([,f]=f.splitText(d),d=0),f.setFormat(g);const v=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||at(m)||([m]=m.splitText(_)),m.setFormat(v));for(let x=u+1;x<h;x++){const y=r[x],b=y.getFormatFlags(e,v);y.setFormat(b)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=g|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=O();return k(g)||L(134),g.insertNodes(e)}const t=wr((this.isBackward()?this.focus:this.anchor).getNode(),dt),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Jr(this);t.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(C(g)||Y(g))&&!g.isInline())){C(t)||L(135);const g=Jr(this);return t.splice(g,0,e),void r.selectEnd()}const i=function(g){const h=we();let m=null;for(let _=0;_<g.length;_++){const v=g[_],x=Kt(v);if(x||Y(v)&&v.isInline()||C(v)&&v.isInline()||j(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),h.append(m),x))continue;m!==null&&m.append(v)}else h.append(v),m=null}return h}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&dt(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||L(135),t.append(...c.getChildren()),c=s[1]),c&&function(g,h,m){const _=h.getParentOrThrow().getLastChild();let v=h;const x=[h];for(;v!==_;)v.getNextSibling()||L(140),v=v.getNextSibling(),x.push(v);let y=g;for(const b of x)y=y.insertAfter(b)}(t,c);const f=wr(o,dt);l&&C(f)&&(l.canMergeWhenEmpty()||dt(a))&&(f.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=C(t)?t.getLastChild():null;Kt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=we();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=Jr(this),t=wr(this.anchor.getNode(),dt);C(t)||L(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=Xe();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=Kr(this);if(t===0)return[];if(t===1){if(j(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,g=s.splitText(f,d),h=f===0?g[0]:g[1];return h!=null?[h]:[]}return[s]}const u=i.isBefore(o);if(j(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(j(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Pt(i,t);if(Y(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const g=Po();return g.add(l.__key),void Se(g)}const d=t?l.getPreviousSibling():l.getNextSibling();if(j(d)){const g=d.__key,h=t?d.getTextContent().length:0;return i.set(g,h,"text"),void(s&&o.set(g,h,"text"))}{const g=l.getParentOrThrow();let h,m;return C(d)?(m=d.__key,h=t?d.getChildrenSize():0):(h=l.getIndexWithinParent(),m=g.__key,t||h++),i.set(m,h,"element"),void(s&&o.set(m,h,"element"))}}const a=Z(),c=Te(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Tr(u,a,f),function(d,g,h,m){d.modify(g,h,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),g=this.anchor.getNode(),h=oe(g)?g:bl(g);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let x=0;x<m.length;x++){const y=m[x];vr(y,h)?_.push(y):v=!0}if(v&&_.length>0)if(t){const x=_[0];C(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{const x=_[_.length-1];C(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(x){const y=x.focus,b=x.anchor,T=b.key,S=b.offset,E=b.type;Ue(b,y.key,y.offset,y.type),Ue(y,T,S,E),x._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(C(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=Pt(o,e);if(Y(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Po();l.add(s.__key),Se(l)}else s.remove(),Z().dispatchCommand(nn,void 0);return}if(!e&&C(s)&&C(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Lo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Lo(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),g=f.getNode();if(d===g&&u.type==="text"&&f.type==="text"){const h=u.offset,m=f.offset,_=h<m,v=_?h:m,x=_?m:h,y=x-1;v!==y&&(Vi(d.getTextContent().slice(v,x))||(c?f.offset=y:u.offset=y))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ve(n){return n instanceof Dn}function ko(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Kr(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[ko(t),ko(r)]}function Lo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function jo(n,e,t,r){let i,o=e;if(n.nodeType===Lt){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],f=!1;if(u===c)u=l[o+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&o--}if(i=ct(u),j(i))o=Qi(i,s);else{let d=ct(n);if(d===null)return null;if(C(d)){o=Math.min(d.getChildrenSize(),o);let g=d.getChildAtIndex(o);if(C(g)&&function(h,m,_){const v=h.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(g,0,t)){const h=s?g.getLastDescendant():g.getFirstDescendant();h===null?d=g:(g=h,d=C(g)?g:g.getParentOrThrow()),o=0}j(g)?(i=g,d=null,o=Qi(g,s)):g!==d&&s&&!f&&o++}else{const g=d.getIndexWithinParent();o=e===0&&Y(d)&&ct(n)===d?g:g+1,d=d.getParentOrThrow()}if(C(d))return be(d.__key,o,"element")}}else i=ct(n);return j(i)?be(i.__key,o,"text"):null}function Io(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&C(s)&&s.isInline()){const l=s.getPreviousSibling();j(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):j(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();j(l)&&(n.key=l.__key,n.offset=0)}}}function Do(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Io(n,r,i),Io(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=Z();if(o.isComposing()&&o._compositionKey!==n.key&&k(t)){const s=t.anchor,l=t.focus;Ue(n,s.key,s.offset,s.type),Ue(e,l.key,l.offset,l.type)}}}function Oo(n,e,t,r,i,o){if(n===null||t===null||!jt(i,n,t))return null;const s=jo(n,e,k(o)?o.anchor:null,i);if(s===null)return null;const l=jo(t,r,k(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ct(n),c=ct(t);if(Y(a)&&Y(c))return null}return Do(s,l,o),[s,l]}function Qr(n){return C(n)&&!n.isInline()}function Ao(n,e,t,r,i,o){const s=Ie(),l=new $e(be(n,e,i),be(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Ul(){const n=be("root",0,"element"),e=be("root",0,"element");return new $e(n,e,0,"")}function Po(){return new Dn(new Set)}function Vr(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!ur&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(k(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&k(n)&&!jt(t,c,u))return n.clone();const g=Oo(c,f,u,d,t,n);if(g===null)return null;const[h,m]=g;return new $e(h,m,k(n)?n.format:0,k(n)?n.style:"")}function O(){return Ie()._selection}function Jt(){return Z()._editorState._selection}function On(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),zo(n)}}else{const c=n.isBackward(),u=c?o:i,f=u.getNode(),d=c?i:o,g=d.getNode();if(e.is(f)){const h=u.offset;(t<=h&&r>0||t<h&&r<0)&&u.set(a,Math.max(0,h+r),"element")}if(e.is(g)){const h=d.offset;(t<=h&&r>0||t<h&&r<0)&&d.set(a,Math.max(0,h+r),"element")}}zo(n)}function zo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(C(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(C(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function An(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,j(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,j(i)?l="text":C(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Ro(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function $l(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==o||f!==null&&gr(f))return;if(!k(e))return void(n!==null&&jt(t,l,a)&&r.removeAllRanges());const d=e.anchor,g=e.focus,h=d.key,m=g.key,_=xn(t,h),v=xn(t,m),x=d.offset,y=g.offset,b=e.format,T=e.style,S=e.isCollapsed();let E=_,N=v,M=!1;if(d.type==="text"){E=_n(_);const V=d.getNode();M=V.getFormat()!==b||V.getStyle()!==T}else k(n)&&n.anchor.type==="text"&&(M=!0);var R,B,ee,J,F;if(g.type==="text"&&(N=_n(v)),E!==null&&N!==null&&(S&&(n===null||M||k(n)&&(n.format!==b||n.style!==T))&&(R=b,B=T,ee=x,J=h,F=performance.now(),ho=[R,B,ee,J,F]),c!==x||u!==y||l!==E||a!==N||r.type==="Range"&&S||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(E,x,N,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const V=e instanceof $e&&e.anchor.type==="element"?E.childNodes[x]||null:r.rangeCount>0?r.getRangeAt(0):null;if(V!==null){let ce;if(V instanceof Text){const De=document.createRange();De.selectNode(V),ce=De.getBoundingClientRect()}else ce=V.getBoundingClientRect();(function(De,Ke,Ht){const Xt=Ht.ownerDocument,en=Xt.defaultView;if(en===null)return;let{top:xt,bottom:vt}=Ke,Ct=0,St=0,pe=Ht;for(;pe!==null;){const nt=pe===Xt.body;if(nt)Ct=0,St=Cn(De).innerHeight;else{const Qe=pe.getBoundingClientRect();Ct=Qe.top,St=Qe.bottom}let Me=0;if(xt<Ct?Me=-(Ct-xt):vt>St&&(Me=vt-St),Me!==0)if(nt)en.scrollBy(0,Me);else{const Qe=pe.scrollTop;pe.scrollTop+=Me;const rt=pe.scrollTop-Qe;xt-=rt,vt-=rt}if(nt)break;pe=vn(pe)}})(t,ce,o)}}zr=!0}}function Yl(n){let e=O()||Jt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function Jr(n){let e=n;n.isCollapsed()||e.removeText();const t=O();k(t)&&(e=t),k(e)||L(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!dt(i);)[i,o]=Kl(i,o);return o}function Kl(n,e){const t=n.getParent();if(!t){const i=we();return G().append(i),i.select(),[G(),0]}if(j(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new $e(be(n.__key,e,"element"),be(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,fe=!1,Zr=!1,Pn=0;const Fo={characterData:!0,childList:!0,subtree:!0};function Zt(){return fe||te!==null&&te._readOnly}function ge(){fe&&L(13)}function Wo(){Pn>99&&L(14)}function Ie(){return te===null&&L(195,Bo()),te}function Z(){return ne===null&&L(196,Bo()),ne}function Bo(){let n=0;const e=new Set,t=Fn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=pn(i);if(hr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Ql(){return ne}function Uo(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&L(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function $o(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Vl(n){return qr(n,Z()._nodes)}function qr(n,e){const t=n.type,r=e.get(t);r===void 0&&L(17,t);const i=r.klass;n.type!==i.getType()&&L(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=qr(s[l],e);o.append(a)}return o}function Yo(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ye(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==Je,c=te,u=fe,f=ne,d=n._updating,g=n._observer;let h=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&g!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const S=n._dirtyType,E=n._dirtyElements,N=n._dirtyLeaves;g.disconnect(),h=Il(o,t,n,S,E,N)}catch(S){if(S instanceof Error&&n._onError(S),Zr)throw S;return qo(n,null,r,t),Ai(n),n._dirtyType=lt,Zr=!0,Ye(n,o),void(Zr=!1)}finally{g.observe(r,Fo),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,x=n._updateTags,y=n._deferred;a&&(n._dirtyType=Je,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,E){const N=S._decorators;let M=S._pendingDecorators||N;const R=E._nodeMap;let B;for(B in M)R.has(B)||(M===N&&(M=$i(S)),delete M[B])}(n,t);const b=i?null:Te(n._window);if(n._editable&&b!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(g!==null&&g.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&Tr(S,n,r),$l(s,l,n,b,x,r)}wl(n,r,l),g!==null&&g.observe(r,Fo)}finally{ne=f,te=c}}h!==null&&function(S,E,N,M,R){const B=Array.from(S._listeners.mutation),ee=B.length;for(let J=0;J<ee;J++){const[F,V]=B[J],ce=E.get(V);ce!==void 0&&F(ce,{dirtyLeaves:M,prevEditorState:R,updateTags:N})}}(n,h,x,m,o),k(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(nn,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,qt("decorator",n,!0,T)),function(S,E,N){const M=Yi(E),R=Yi(N);M!==R&&qt("textcontent",S,!0,R)}(n,e||o,t),qt("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:x}),function(S,E){if(S._deferred=[],E.length!==0){const N=S._updating;S._updating=!0;try{for(let M=0;M<E.length;M++)E[M]()}finally{S._updating=N}}}(n,y),function(S){const E=S._updates;if(E.length!==0){const N=E.shift();if(N){const[M,R]=N;Vo(S,M,R)}}}(n)}function qt(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function Ko(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=Ko(n,e,t)}),i}const r=_r(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function Qo(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&L(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function Vo(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new Rn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,g=ne,h=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(x){const y=x.getEditorState()._selection,b=Te(x._window);return k(y)||y==null?Vr(y,b,x,null):y.clone()}(n));const _=n._compositionKey;e(),s=Qo(n,s),function(x,y){const b=y.getEditorState()._selection,T=x._selection;if(k(T)){const S=T.anchor,E=T.focus;let N;if(S.type==="text"&&(N=S.getNode(),N.selectionTransform(b,T)),E.type==="text"){const M=E.getNode();N!==M&&M.selectionTransform(b,T)}}}(c,n),n._dirtyType!==Je&&(s?function(x,y){const b=y._dirtyLeaves,T=x._nodeMap;for(const S of b){const E=T.get(S);j(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&Ri(E)}}(c,n):function(x,y){const b=y._dirtyLeaves,T=y._dirtyElements,S=x._nodeMap,E=Fe(),N=new Map;let M=b,R=M.size,B=T,ee=B.size;for(;R>0||ee>0;){if(R>0){y._dirtyLeaves=new Set;for(const J of M){const F=S.get(J);j(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Ri(F),F!==void 0&&$o(F,E)&&Uo(y,F,N),b.add(J)}if(M=y._dirtyLeaves,R=M.size,R>0){Pn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const J of B){const F=J[0],V=J[1];if(F!=="root"&&!V)continue;const ce=S.get(F);ce!==void 0&&$o(ce,E)&&Uo(y,ce,N),T.set(F,V)}M=y._dirtyLeaves,R=M.size,B=y._dirtyElements,ee=B.size,Pn++}y._dirtyLeaves=b,y._dirtyElements=T}(c,n),Qo(n),function(x,y,b,T){const S=x._nodeMap,E=y._nodeMap,N=[];for(const[M]of T){const R=E.get(M);R!==void 0&&(R.isAttached()||(C(R)&&ro(R,M,S,E,N,T),S.has(M)||T.delete(M),N.push(M)))}for(const M of N)E.delete(M);for(const M of b){const R=E.get(M);R===void 0||R.isAttached()||(S.has(M)||b.delete(M),E.delete(M))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(k(v)){const x=c._nodeMap,y=v.anchor.key,b=v.focus.key;x.get(y)!==void 0&&x.get(b)!==void 0||L(19)}else ve(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=lt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ye(n)}finally{te=f,fe=d,ne=g,n._updating=h,Pn=0}n._dirtyType!==Je||function(_,v){const x=v.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(x))return!0}else if(x!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ye(n)):u&&vl(()=>{Ye(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Vo(n,e,t)}class zn extends Ln{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),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}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return dl[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=Z()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(j(t)&&e.push(t),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ee)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ee.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ii[e];return!!(this.getFormat()&t)}return!1}select(e,t){ge();const r=O();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(j(a)||C(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(j(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return k(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Ao(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ii[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let f=null,d=o-t+i;if(e!==0)if(e===o)f=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(t>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){h===null&&L(100);const _=h.getNextSibling(),v=h.__key;Ze(h.getWritable()),c.push(v),h=_}}let g=f;for(let h=0;h<i;h++){const m=r[h];g!==null&&m.is(g)&&(f=g=g.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Ze(_);const v=m.__key;if(g===null)s.__first=v,_.__prev=null;else{const x=g.getWritable();x.__next=v,_.__prev=x.__key}m.__key===l&&L(76),_.__parent=l,a.push(v),g=m}if(e+t===o)g!==null&&(g.getWritable().__next=null,s.__last=g.__key);else if(u!==null){const h=u.getWritable();if(g!==null){const m=g.getWritable();h.__prev=g.__key,m.__next=u.__key}else h.__prev=null}if(s.__size=d,c.length){const h=O();if(k(h)){const m=new Set(c),_=new Set(a),{anchor:v,focus:x}=h;Jo(v,m,_)&&An(v,v.getNode(),this,f,u),Jo(x,m,_)&&An(x,x.getNode(),this,f,u),d!==0||this.canBeEmpty()||ut(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}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,r){return!1}canMergeWhenEmpty(){return!1}}function C(n){return n instanceof zn}function Jo(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class Jl extends Ln{constructor(e){super(e)}decorate(e,t){L(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(n){return n instanceof Jl}class Gt extends zn{static getType(){return"root"}static clone(){return new Gt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return!Zt()&&Z()._dirtyType!==Je||e===null?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||Y(r)||L(56)}return super.append(...e)}static importJSON(e){const t=G();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof Gt}function Gr(){return new Rn(new Map([["root",new Gt]]))}function Zo(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&L(130,t.name),C(n)){const r=e.children;Array.isArray(r)||L(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Zo(i[o]);r.push(s)}}return e}class Rn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Yo(t&&t.editor||null,this,e)}clone(e){const t=new Rn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Yo(null,this,()=>({root:Zo(G())}))}}class Hr extends zn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pt extends zn{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ke[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new pt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=At(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Zl,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Nr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=we();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=we();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||j(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Zl(n){const e=we();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function we(){return Sn(new pt)}function Xr(n){return n instanceof pt}const $=0,ql=4;function qo(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Gr(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Je,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function Gl(n){const e=n||{},t=Ql(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=Gr(),l=e.namespace||(i!==null?i._config.namespace:Ji()),a=e.editorState,c=[Gt,ht,Yt,Qt,pt,Hr,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,x=null;if(typeof _!="function"){const S=_;_=S.replace,v=S.with,x=S.withKlass||null}const y=_.getType(),b=_.transform(),T=new Set;b!==null&&T.add(b),g.set(y,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:x,transforms:T})}}const h=new Fn(s,i,g,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,x=new Set,y=b=>{Object.keys(b).forEach(T=>{let S=v.get(T);S===void 0&&(S=[],v.set(T,S)),S.push(b[T])})};return m.forEach(b=>{const T=b.klass.importDOM;if(T==null||x.has(T))return;x.add(T);const S=T.call(b.klass);S!==null&&y(S)}),_&&y(_),v}(g,f?f.import:void 0),d);return a!==void 0&&(h._pendingEditorState=a,h._dirtyType=lt),h}class Fn{constructor(e,t,r,i,o,s,l){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=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Je,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=Ji(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&L(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&L(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&L(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=kl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),he(s,()=>{const a=Ie();if(a.isEmpty())return;if(l==="root")return void G().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return D(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=At(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,qo(this,t,e,i),t!==null&&(this._config.disableEvents||Dl(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=lt,Ai(this),this._updateTags.add("history-merge"),Ye(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=kn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",vo),kn.set(c,(u||0)+1),l.__lexicalEditor=a;const f=xo(l);for(let d=0;d<Pr.length;d++){const[g,h]=Pr[d],m=typeof h=="function"?_=>{So(_)||(Co(_),(a.isEditable()||g==="click")&&h(_,a))}:_=>{if(So(_))return;Co(_);const v=a.isEditable();switch(g){case"cut":return v&&D(a,Xn,_);case"copy":return D(a,an,_);case"paste":return v&&D(a,Gn,_);case"dragstart":return v&&D(a,wi,_);case"dragover":return v&&D(a,Mi,_);case"dragend":return v&&D(a,Js,_);case"focus":return v&&D(a,Gs,_);case"blur":return v&&D(a,Hs,_);case"drop":return v&&D(a,bi,_)}};l.addEventListener(g,m),f.push(()=>{l.removeEventListener(g,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;qt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&L(38),Oi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ye(this)),this._pendingEditorState=e,this._dirtyType=lt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ye(this)}parseEditorState(e,t){return function(r,i,o){const s=Gr(),l=te,a=fe,c=ne,u=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,g=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,fe=!1,ne=i;try{const h=i._nodes;qr(r.root,h),o&&o(),s._readOnly=!0}catch(h){h instanceof Error&&i._onError(h)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=g,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ye(this),this.getEditorState().read(e,{editor:this})}update(e,t){he(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),he(this,()=>{const i=O(),o=G();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,qt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Fn.version="0.17.1+prod.esm";const Lc="";function Hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xl=Hl(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Go=P.createContext(null);function ea(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function et(){const n=P.useContext(Go);return n==null&&Xl(8),n}const Ho=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ta=Ho?P.useLayoutEffect:P.useEffect,Wn={tag:"history-merge"};function na({initialConfig:n,children:e}){const t=P.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=ea(null,r),u=Gl({editable:n.editable,html:a,namespace:i,nodes:o,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const g=G();if(g.isEmpty()){const h=we();g.append(h);const m=Ho?document.activeElement:null;(O()!==null||m!==null&&m===f.getRootElement())&&h.select()}},Wn);else if(d!==null)switch(typeof d){case"string":{const g=f.parseEditorState(d);f.setEditorState(g,Wn);break}case"object":f.setEditorState(d,Wn);break;case"function":f.update(()=>{G().isEmpty()&&d(f)},Wn)}}}(u,l),[u,c]},[]);return ta(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),A.jsx(Go.Provider,{value:t,children:e})}function ra({defaultSelection:n}){const[e]=et();return P.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ia(){return G().getTextContent()}function oa(n,e=!0){if(n)return!1;let t=ia();return e&&(t=t.trim()),t===""}function sa(n){if(!oa(n,!1))return!1;const e=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(Y(i))return!1;if(C(i)){if(!Xr(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!j(a))return!1}}}return!0}function Xo(n){return()=>sa(n)}function la(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}la(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}aa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ca=new Map;function ua(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function es(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,f]=Kr(n),d=s.is(l),g=e.is(o?l:s),h=e.is(o?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):g?(_=o?f:u,m=void 0):h&&(_=0,m=o?u:f),e.__text=e.__text.slice(_,m),e}}return e}function da(n){const e=n.getStyle(),t=ua(e);ca.set(e,t)}function ts(n,e){const t=Pt(n.focus,e);return Y(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function fa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ga(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ns(n,e,t){const r=ga(n);fa(n,e,t?!r:r,"character")}function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pa=ha(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const rs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_a=rs&&"documentMode"in document?document.documentMode:null;!(!rs||!("InputEvent"in window)||_a)&&"getTargetRanges"in new window.InputEvent("input");function _t(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function ma(n){const e=ei(n,t=>C(t)&&!t.isInline());return C(e)||pa(4,n.__key),e}const ei=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function tt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const is=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function ya({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:f,className:d,id:g,role:h="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":x,...y},b){const[T,S]=P.useState(n.isEditable()),E=P.useCallback(M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?n.setRootElement(M):n.setRootElement(null)},[n]),N=P.useMemo(()=>function(...M){return R=>{M.forEach(B=>{typeof B=="function"?B(R):B!=null&&(B.current=R)})}}(b,E),[E,b]);return is(()=>(S(n.isEditable()),n.registerEditableListener(M=>{S(M)})),[n]),A.jsx("div",{...y,"aria-activedescendant":T?e:void 0,"aria-autocomplete":T?t:"none","aria-controls":T?r:void 0,"aria-describedby":i,"aria-expanded":T&&h==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":T?c:void 0,"aria-readonly":!T||void 0,"aria-required":u,autoCapitalize:f,className:d,contentEditable:T,"data-testid":x,id:g,ref:N,role:T?h:void 0,spellCheck:m,style:_,tabIndex:v})}const xa=P.forwardRef(ya);function os(n){return n.getEditorState().read(Xo(n.isComposing()))}const va=P.forwardRef(Ca);function Ca(n,e){const{placeholder:t,...r}=n,[i]=et();return A.jsxs(A.Fragment,{children:[A.jsx(xa,{editor:i,...r,ref:e}),t!=null&&A.jsx(Sa,{editor:i,content:t})]})}function Sa({content:n,editor:e}){const t=function(s){const[l,a]=P.useState(()=>os(s));return is(()=>{function c(){const u=os(s);a(u)}return c(),_t(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=P.useState(e.isEditable());if(P.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:A.jsx("div",{"aria-hidden":!0,children:o})}const Bn=0,ti=1,ni=2,Ce=0,Ta=1,ss=2,Na=3,ba=4;function wa(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return Ce;const o=e._selection,s=n._selection;if(i)return Ta;if(!(k(o)&&k(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(v,x,y){const b=v._nodeMap,T=[];for(const S of x){const E=b.get(S);E!==void 0&&T.push(E)}for(const[S,E]of y){if(!E)continue;const N=b.get(S);N===void 0||oe(N)||T.push(N)}return T}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const v=e._nodeMap,x=v.get(o.anchor.key),y=v.get(s.anchor.key);return x&&y&&!n._nodeMap.has(x.__key)&&j(x)&&x.__text.length===1&&o.anchor.offset===1?ss:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!j(c)||!j(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,f=a.__text;if(u===f)return Ce;const d=o.anchor,g=s.anchor;if(d.key!==g.key||d.type!=="text")return Ce;const h=d.offset,m=g.offset,_=f.length-u.length;return _===1&&m===h-1?ss:_===-1&&m===h+1?Na:_===-1&&m===h?ba:Ce}function Ma(n,e){let t=Date.now(),r=Ce;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=Ce,t=u,ni;const f=wa(i,o,l,a,n.isComposing()),d=(()=>{const g=s===null||s.editor===n,h=c.has("history-push");if(!h&&g&&c.has("history-merge"))return Bn;if(i===null)return ti;const m=o._selection;return l.size>0||a.size>0?h===!1&&f!==Ce&&f===r&&u<t+e&&g||l.size===1&&function(_,v,x){const y=v._nodeMap.get(_),b=x._nodeMap.get(_),T=v._selection,S=x._selection;return!(k(T)&&k(S)&&T.anchor.type==="element"&&T.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!j(y)||!j(b)||y.__parent!==b.__parent)&&JSON.stringify(v.read(()=>y.exportJSON()))===JSON.stringify(x.read(()=>b.exportJSON()))}(Array.from(l)[0],i,o)?Bn:ti:m!==null?Bn:ni})();return t=u,r=f,d}}function ls(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ea(n,e,t){const r=Ma(n,t);return _t(n.registerCommand(on,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(Et,!0)),a.length===0&&o.dispatchCommand(kt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(sn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(kt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Et,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(Zs,()=>(ls(e),!1),$),n.registerCommand(qs,()=>(ls(e),n.dispatchCommand(Et,!1),n.dispatchCommand(kt,!1),!0),$),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,g=u===null?null:u.editorState;if(u!==null&&o===g)return;const h=r(s,o,u,l,a,c);if(h===ti)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Et,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(kt,!0));else if(h===ni)return;e.current={editor:n,editorState:o}}))}function ka(){return{current:null,redoStack:[],undoStack:[]}}function La({delay:n,externalHistoryState:e}){const[t]=et();return function(r,i,o=1e3){const s=P.useMemo(()=>i||ka(),[i]);P.useEffect(()=>Ea(r,s,o),[o,r,s])}(t,e,n),null}const ja=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Ia(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Da(){return function(n){const[e]=et(),t=P.useMemo(()=>n(e),[e,n]),r=P.useRef(t.initialValueFn()),[i,o]=P.useState(r.current);return ja(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(Ia)}function Oa(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,f,d,g,h]=a;n.update(()=>{const m=O();if(k(m)){const _=m.anchor;let v=_.getNode(),x=0,y=0;if(j(v)&&c>=0&&u>=0&&(x=c,y=c+u,m.setTextNodeRange(v,x,v,y)),x===y&&f===""||(m.insertRawText(f),v=_.getNode()),j(v)){x=d,y=d+g;const b=v.getTextContentSize();x=x>b?b:x,y=y>b?b:y,m.setTextNodeRange(v,x,v,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Aa(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!cs.has(s.nodeName)){const l=us(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof Hr&&s.insertAfter(Xe());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Pa(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=G().getChildren();for(let i=0;i<r.length;i++)as(n,r[i],t,e);return t.innerHTML}function as(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let g=Mr(e);g=j(g)&&r!==null?es(r,g):g,s=g}const l=C(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let g=0;g<l.length;g++){const h=l[g],m=as(n,h,d,r);!i&&C(e)&&m&&e.extractWithChild(h,r,"html")&&(i=!0)}if(i&&!o){if(Nr(u)&&u.append(d),t.append(u),f){const g=f.call(s,u);g&&u.replaceWith(g)}}else t.append(d);return i}const cs=new Set(["STYLE","SCRIPT"]);function us(n,e,t,r,i=new Map,o){let s=[];if(cs.has(n.nodeName))return s;let l=null;const a=function(h,m){const{nodeName:_}=h,v=m._htmlConversions.get(_.toLowerCase());let x=null;if(v!==void 0)for(const y of v){const b=y(h);b!==null&&(x===null||(x.priority||0)<(b.priority||0))&&(x=b)}return x!==null?x.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const h=c.node;if(l=Array.isArray(h)?h[h.length-1]:h,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(h)?h:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const g=(l==null||!ut(l))&&(l!=null&&Qr(l)||r);for(let h=0;h<f.length;h++)d.push(...us(f[h],e,t,g,new Map(i),l));return u!=null&&(d=u(d)),Tn(n)&&(d=za(n,d,g?()=>{const h=new Hr;return t.push(h),h}:we)),l==null?d.length>0?s=s.concat(d):Tn(n)&&function(h){return h.nextSibling==null||h.previousSibling==null?!1:br(h.nextSibling)&&br(h.previousSibling)}(n)&&(s=s.concat(Xe())):C(l)&&l.append(...d),s}function za(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Qr(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Qr(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function Ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Un=Ra(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Fa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ds=n=>Fa?(n||window).getSelection():null;function Wa(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?"":Pa(n,e)}function Ba(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Ua(n,e))}function fs(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return gs(t,$a(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return gs(t,Aa(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(k(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=O();if(k(a)){const c=s[l];c===`
40
40
  `||c===`\r
41
- `?a.insertParagraph():c===" "?a.insertNodes([Vt()]):a.insertText(c)}}}else e.insertRawText(o)}function gs(n,e,t){n.dispatchCommand(Ws,{nodes:e,selection:t})||t.insertNodes(e)}function hs(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Mr(t);c=j(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Un(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Un(59,f.name)}return u}(s);if(j(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],f=hs(n,e,u,a.children);!i&&C(t)&&f&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function Ua(n,e){const t=[],r=G().getChildren();for(let i=0;i<r.length;i++)hs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function $a(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Vl(r);j(i)&&da(i),e.push(i)}return e}let mt=null;async function ps(n,e,t){if(mt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(_s(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=ds(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(an,f=>(tt(f,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,f,t))),!0),ql);mt=window.setTimeout(()=>{u(),mt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function _s(n,e,t){if(t===void 0){const i=ds(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!jt(n,o,s))return!1;const l=O();if(l===null)return!1;t=Ka(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Qa(r,t),!0)}const Ya=[["text/html",Wa],["application/x-lexical-editor",Ba]];function Ka(n=O()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ml();for(const[r,i]of Ya){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Qa(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function ms(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Va=yt&&"documentMode"in document?document.documentMode:null,Ja=!(!yt||!("InputEvent"in window)||Va)&&"getTargetRanges"in new window.InputEvent("input"),Za=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qa=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ga=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ha=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ga,ys=Fs();function $n(n){let e=null;if(tt(n,DragEvent)?e=n.dataTransfer:tt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function xs(n){const e=O();if(!k(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=ei(o,c=>C(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function Yn(n){const e=qe(n);return Y(e)}function Xa(n){return _t(n.registerCommand(_i,e=>{const t=O();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(Ve,e=>{const t=O();return!!k(t)&&(t.deleteCharacter(e),!0)},$),n.registerCommand(bt,e=>{const t=O();return!!k(t)&&(t.deleteWord(e),!0)},$),n.registerCommand(wt,e=>{const t=O();return!!k(t)&&(t.deleteLine(e),!0)},$),n.registerCommand(st,e=>{const t=O();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)fs(r,t,n);else if(k(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},$),n.registerCommand(Hn,()=>{const e=O();return!!k(e)&&(e.removeText(),!0)},$),n.registerCommand(de,e=>{const t=O();return!!k(t)&&(t.formatText(e),!0)},$),n.registerCommand(Mt,e=>{const t=O();if(!k(t)&&!ve(t))return!1;const r=t.getNodes();for(const i of r){const o=ei(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},$),n.registerCommand(ot,e=>{const t=O();return!!k(t)&&(t.insertLineBreak(e),!0)},$),n.registerCommand(rn,()=>{const e=O();return!!k(e)&&(e.insertParagraph(),!0)},$),n.registerCommand(Qs,()=>(Yl([Vt()]),!0),$),n.registerCommand(Vs,()=>xs(e=>{const t=e.getIndent();e.setIndent(t+1)}),$),n.registerCommand(Ni,()=>xs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),$),n.registerCommand(xi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(k(t)){const r=Pt(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},$),n.registerCommand(vi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(k(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Pt(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},$),n.registerCommand(yi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!k(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},$),n.registerCommand(mi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!k(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},$),n.registerCommand(Ci,e=>{if(Yn(e.target))return!1;const t=O();if(!k(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ma(i).getIndent()>0?n.dispatchCommand(Ni,void 0):n.dispatchCommand(Ve,!0)},$),n.registerCommand(Ti,e=>{if(Yn(e.target))return!1;const t=O();return!!k(t)&&(e.preventDefault(),n.dispatchCommand(Ve,!1))},$),n.registerCommand(ln,e=>{const t=O();if(!k(t))return!1;if(e!==null){if((qa||Za||Ha)&&Ja)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},$),n.registerCommand(Si,()=>{const e=O();return!!k(e)&&(n.blur(),!0)},$),n.registerCommand(bi,e=>{const[,t]=$n(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=qe(s);if(l!==null){const a=Ul();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Fi(a);Se(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=O();return!!k(r)},$),n.registerCommand(wi,e=>{const[t]=$n(e),r=O();return!(t&&!k(r))},$),n.registerCommand(Mi,e=>{const[t]=$n(e),r=O();if(t&&!k(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=qe(i.node);Y(o)&&e.preventDefault()}return!0},$),n.registerCommand(er,()=>(Nl(),!0),$),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),$),n.registerCommand(Xn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=O();k(i)?i.removeText():ve(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),$),n.registerCommand(Gn,e=>{const[,t,r]=$n(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):gr(e.target)?!1:O()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=O(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&fs(l,s,o)},{tag:"paste"})}(e,n),!0)},$))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function vs(n){return n.getEditorState().read(Xo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=P.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{di.flushSync(()=>{a(c)})}),[o]),P.useEffect(()=>{a(o.getDecorators())},[o]),P.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],g=A.jsx(s,{onError:m=>o._onError(m),children:A.jsx(P.Suspense,{fallback:null,children:l[d]})}),h=o.getElementByKey(d);h!==null&&c.push(di.createPortal(g,h,d))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Xa(o),Oa(o)),[o])}(r),A.jsxs(A.Fragment,{children:[n,A.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=P.useState(()=>vs(i));return ri(()=>{function l(){const a=vs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Da();return t?typeof n=="function"?n(r):n:null}function ii(n,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ii(n,e)}var Cs={error:null},nc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Cs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ii(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Cs)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(g,h){return!Object.is(g,u[h])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(Vn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Vn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Vn.Component);function rc({children:n,onError:e}){return A.jsx(nc,{fallback:A.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const ic={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},oc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MTIgNDI2Ljg1Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNzQuMiAxMjUuMyAyNjYuNzQgMGg3Ni42NUwyMTIuODggMTczLjk5bDEzNS45IDE4MC40NUgyNzJsLTk3Ljg0LTEzMS44LTk3LjUyIDEzMS44SDBMMTM1Ljg4IDE3NCA1LjA3IDBoNzcuMDRsOTIuMDkgMTI1LjN6bTMyMi4zOCAzMDEuNTVIMzczLjV2LTI0LjE0bDIuNDMtNi40M2M1LjQ1LTYuMyA2MC4zNC02OS40OCA2MC4zNC02OS42MyAyLjk0LTMuMzggNS40NC02LjM0IDcuNDctOC44NyAyLjI1LTIuNzgg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IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",oi=1;function Ss(){return A.jsx("div",{className:"divider"})}function lc(){const[n]=et(),e=P.useRef(null),[t,r]=P.useState(!1),[i,o]=P.useState(!1),[s,l]=P.useState(!1),[a,c]=P.useState(!1),[u,f]=P.useState(!1),[d,g]=P.useState(!1),[h,m]=P.useState(!1),[_,v]=P.useState(!1),x=P.useCallback(()=>{const y=O();k(y)&&(l(y.hasFormat("bold")),c(y.hasFormat("italic")),f(y.hasFormat("underline")),g(y.hasFormat("strikethrough")),m(y.hasFormat("subscript")),v(y.hasFormat("superscript")))},[]);return P.useEffect(()=>_t(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{x()})}),n.registerCommand(nn,(y,b)=>(x(),!1),oi),n.registerCommand(kt,y=>(r(y),!1),oi),n.registerCommand(Et,y=>(o(y),!1),oi)),[n,x]),A.jsxs("div",{className:"toolbar",ref:e,children:[A.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:A.jsx("i",{className:"format undo"})}),A.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:A.jsx("i",{className:"format redo"})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:A.jsx("i",{className:"format bold"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:A.jsx("i",{className:"format italic"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:A.jsx("i",{className:"format underline"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:A.jsx("i",{className:"format strikethrough"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:A.jsx("img",{src:sc,height:16,width:16,style:{marginTop:"1px"}})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Superscript",children:A.jsx("img",{src:oc,height:16,width:16,style:{marginTop:"5px"}})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:A.jsx("i",{className:"format left-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:A.jsx("i",{className:"format center-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:A.jsx("i",{className:"format right-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:A.jsx("i",{className:"format justify-align"})})," "]})}function ac(){return A.jsx("div",{className:"editor-placeholder",style:{marginLeft:"18px"},children:"Enter some rich text..."})}const cc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function uc(){return A.jsx(na,{initialConfig:cc,children:A.jsxs("div",{className:"editor-container",children:[A.jsx(lc,{}),A.jsxs("div",{className:"editor-inner",children:[A.jsx(ec,{contentEditable:A.jsx(va,{className:"editor-input"}),placeholder:A.jsx(ac,{}),ErrorBoundary:rc}),A.jsx(La,{}),A.jsx(ra,{})]})]})})}Pe.Editor=uc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
41
+ `?a.insertParagraph():c===" "?a.insertNodes([Vt()]):a.insertText(c)}}}else e.insertRawText(o)}function gs(n,e,t){n.dispatchCommand(Ws,{nodes:e,selection:t})||t.insertNodes(e)}function hs(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Mr(t);c=j(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Un(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Un(59,f.name)}return u}(s);if(j(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],f=hs(n,e,u,a.children);!i&&C(t)&&f&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function Ua(n,e){const t=[],r=G().getChildren();for(let i=0;i<r.length;i++)hs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function $a(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Vl(r);j(i)&&da(i),e.push(i)}return e}let mt=null;async function ps(n,e,t){if(mt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(_s(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=ds(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(an,f=>(tt(f,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,f,t))),!0),ql);mt=window.setTimeout(()=>{u(),mt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function _s(n,e,t){if(t===void 0){const i=ds(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!jt(n,o,s))return!1;const l=O();if(l===null)return!1;t=Ka(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Qa(r,t),!0)}const Ya=[["text/html",Wa],["application/x-lexical-editor",Ba]];function Ka(n=O()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ml();for(const[r,i]of Ya){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Qa(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function ms(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Va=yt&&"documentMode"in document?document.documentMode:null,Ja=!(!yt||!("InputEvent"in window)||Va)&&"getTargetRanges"in new window.InputEvent("input"),Za=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qa=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ga=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ha=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ga,ys=Fs();function $n(n){let e=null;if(tt(n,DragEvent)?e=n.dataTransfer:tt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function xs(n){const e=O();if(!k(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=ei(o,c=>C(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function Yn(n){const e=qe(n);return Y(e)}function Xa(n){return _t(n.registerCommand(_i,e=>{const t=O();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(Ve,e=>{const t=O();return!!k(t)&&(t.deleteCharacter(e),!0)},$),n.registerCommand(bt,e=>{const t=O();return!!k(t)&&(t.deleteWord(e),!0)},$),n.registerCommand(wt,e=>{const t=O();return!!k(t)&&(t.deleteLine(e),!0)},$),n.registerCommand(st,e=>{const t=O();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)fs(r,t,n);else if(k(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},$),n.registerCommand(Hn,()=>{const e=O();return!!k(e)&&(e.removeText(),!0)},$),n.registerCommand(de,e=>{const t=O();return!!k(t)&&(t.formatText(e),!0)},$),n.registerCommand(Mt,e=>{const t=O();if(!k(t)&&!ve(t))return!1;const r=t.getNodes();for(const i of r){const o=ei(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},$),n.registerCommand(ot,e=>{const t=O();return!!k(t)&&(t.insertLineBreak(e),!0)},$),n.registerCommand(rn,()=>{const e=O();return!!k(e)&&(e.insertParagraph(),!0)},$),n.registerCommand(Qs,()=>(Yl([Vt()]),!0),$),n.registerCommand(Vs,()=>xs(e=>{const t=e.getIndent();e.setIndent(t+1)}),$),n.registerCommand(Ni,()=>xs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),$),n.registerCommand(xi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(k(t)){const r=Pt(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},$),n.registerCommand(vi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(k(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Pt(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},$),n.registerCommand(yi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!k(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},$),n.registerCommand(mi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!k(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},$),n.registerCommand(Ci,e=>{if(Yn(e.target))return!1;const t=O();if(!k(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ma(i).getIndent()>0?n.dispatchCommand(Ni,void 0):n.dispatchCommand(Ve,!0)},$),n.registerCommand(Ti,e=>{if(Yn(e.target))return!1;const t=O();return!!k(t)&&(e.preventDefault(),n.dispatchCommand(Ve,!1))},$),n.registerCommand(ln,e=>{const t=O();if(!k(t))return!1;if(e!==null){if((qa||Za||Ha)&&Ja)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},$),n.registerCommand(Si,()=>{const e=O();return!!k(e)&&(n.blur(),!0)},$),n.registerCommand(bi,e=>{const[,t]=$n(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=qe(s);if(l!==null){const a=Ul();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Fi(a);Se(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=O();return!!k(r)},$),n.registerCommand(wi,e=>{const[t]=$n(e),r=O();return!(t&&!k(r))},$),n.registerCommand(Mi,e=>{const[t]=$n(e),r=O();if(t&&!k(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=qe(i.node);Y(o)&&e.preventDefault()}return!0},$),n.registerCommand(er,()=>(Nl(),!0),$),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),$),n.registerCommand(Xn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=O();k(i)?i.removeText():ve(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),$),n.registerCommand(Gn,e=>{const[,t,r]=$n(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):gr(e.target)?!1:O()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=O(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&fs(l,s,o)},{tag:"paste"})}(e,n),!0)},$))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function vs(n){return n.getEditorState().read(Xo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=P.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{di.flushSync(()=>{a(c)})}),[o]),P.useEffect(()=>{a(o.getDecorators())},[o]),P.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],g=A.jsx(s,{onError:m=>o._onError(m),children:A.jsx(P.Suspense,{fallback:null,children:l[d]})}),h=o.getElementByKey(d);h!==null&&c.push(di.createPortal(g,h,d))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Xa(o),Oa(o)),[o])}(r),A.jsxs(A.Fragment,{children:[n,A.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=P.useState(()=>vs(i));return ri(()=>{function l(){const a=vs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Da();return t?typeof n=="function"?n(r):n:null}function ii(n,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ii(n,e)}var Cs={error:null},nc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Cs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ii(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Cs)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(g,h){return!Object.is(g,u[h])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(Vn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Vn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Vn.Component);function rc({children:n,onError:e}){return A.jsx(nc,{fallback:A.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const ic={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},oc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBl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0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",oi=1;function Ss(){return A.jsx("div",{className:"divider"})}function lc(){const[n]=et(),e=P.useRef(null),[t,r]=P.useState(!1),[i,o]=P.useState(!1),[s,l]=P.useState(!1),[a,c]=P.useState(!1),[u,f]=P.useState(!1),[d,g]=P.useState(!1),[h,m]=P.useState(!1),[_,v]=P.useState(!1),x=P.useCallback(()=>{const y=O();k(y)&&(l(y.hasFormat("bold")),c(y.hasFormat("italic")),f(y.hasFormat("underline")),g(y.hasFormat("strikethrough")),m(y.hasFormat("subscript")),v(y.hasFormat("superscript")))},[]);return P.useEffect(()=>_t(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{x()})}),n.registerCommand(nn,(y,b)=>(x(),!1),oi),n.registerCommand(kt,y=>(r(y),!1),oi),n.registerCommand(Et,y=>(o(y),!1),oi)),[n,x]),A.jsxs("div",{className:"toolbar",ref:e,children:[A.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:A.jsx("i",{className:"format undo"})}),A.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:A.jsx("i",{className:"format redo"})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:A.jsx("i",{className:"format bold"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:A.jsx("i",{className:"format italic"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:A.jsx("i",{className:"format underline"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:A.jsx("i",{className:"format strikethrough"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:A.jsx("img",{src:sc,height:16,width:16,style:{marginTop:"1px"}})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Superscript",children:A.jsx("img",{src:oc,height:16,width:16,style:{marginTop:"5px"}})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:A.jsx("i",{className:"format left-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:A.jsx("i",{className:"format center-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:A.jsx("i",{className:"format right-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:A.jsx("i",{className:"format justify-align"})})," "]})}function ac(){return A.jsx("div",{className:"editor-placeholder",style:{padding:"20px"},children:"Enter some rich text..."})}const cc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function uc(){return A.jsx(na,{initialConfig:cc,children:A.jsxs("div",{className:"editor-container",children:[A.jsx(lc,{}),A.jsxs("div",{className:"editor-inner",children:[A.jsx(ec,{contentEditable:A.jsx(va,{className:"editor-input"}),placeholder:A.jsx(ac,{}),ErrorBoundary:rc}),A.jsx(La,{}),A.jsx(ra,{})]})]})})}Pe.Editor=uc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
42
42
  //# sourceMappingURL=index.umd.js.map