bookstack/public/dist/wysiwyg.js

22 lines
282 KiB
JavaScript
Raw Normal View History

// See the "/licenses" URI for full package license details
function k(o){return __DEV__?{type:o}:{}}var De=k("SELECTION_CHANGE_COMMAND"),ar=k("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),dr=k("CLICK_COMMAND"),Ge=k("DELETE_CHARACTER_COMMAND"),$t=k("INSERT_LINE_BREAK_COMMAND"),Pt=k("INSERT_PARAGRAPH_COMMAND"),lt=k("CONTROLLED_TEXT_INSERTION_COMMAND"),ro=k("PASTE_COMMAND"),_n=k("REMOVE_TEXT_COMMAND"),bt=k("DELETE_WORD_COMMAND"),at=k("DELETE_LINE_COMMAND"),Ne=k("FORMAT_TEXT_COMMAND"),io=k("UNDO_COMMAND"),so=k("REDO_COMMAND"),Gs=k("KEYDOWN_COMMAND"),Ro=k("KEY_ARROW_RIGHT_COMMAND"),Js=k("MOVE_TO_END"),Io=k("KEY_ARROW_LEFT_COMMAND"),js=k("MOVE_TO_START"),ko=k("KEY_ARROW_UP_COMMAND"),$o=k("KEY_ARROW_DOWN_COMMAND"),dt=k("KEY_ENTER_COMMAND"),Qs=k("KEY_SPACE_COMMAND"),Ft=k("KEY_BACKSPACE_COMMAND"),Po=k("KEY_ESCAPE_COMMAND"),Bt=k("KEY_DELETE_COMMAND"),Fo=k("KEY_TAB_COMMAND"),el=k("INSERT_TAB_COMMAND"),tl=k("INDENT_CONTENT_COMMAND"),ui=k("OUTDENT_CONTENT_COMMAND"),Bo=k("DROP_COMMAND"),cr=k("FORMAT_ELEMENT_COMMAND"),ur=k("DRAGSTART_COMMAND"),fr=k("DRAGOVER_COMMAND"),ol=k("DRAGEND_COMMAND"),lo=k("COPY_COMMAND"),ao=k("CUT_COMMAND"),yn=k("SELECT_ALL_COMMAND"),nl=k("CLEAR_EDITOR_COMMAND"),rl=k("CLEAR_HISTORY_COMMAND"),co=k("CAN_REDO_COMMAND"),uo=k("CAN_UNDO_COMMAND"),mr=k("FOCUS_COMMAND"),il=k("BLUR_COMMAND"),sl=k("KEY_MODIFIER_COMMAND");var me=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var wh=me&&"documentMode"in document?document.documentMode:null,Fe=me&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Be=me&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),fo=me&&"InputEvent"in window&&!wh?"getTargetRanges"in new window.InputEvent("input"):!1,Ht=me&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),St=me&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ld=me&&/Android/.test(navigator.userAgent),ll=me&&/^(?=.*Chrome).*/i.test(navigator.userAgent),al=me&&Ld&&ll,Kt=me&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ll;var mo=1,He=3,Lt=0,dl=1,Ut=2,Md=0,fi=1,mi=2,pr=1,gr=2,bn=4,Sn=8,hr=16,Nr=32,xr=64,Er=128,cl=pr|gr|bn|Sn|hr|Nr|xr|Er,pi=1,Ln=2,gi=1,hi=2,Ni=3,xi=4,Ei=5,Ti=6,vd="\xA0",Oh="\u200B",Mn=Ht||St||Kt?vd:Oh,Je=`
`,wd=Be?vd:Mn,Od="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Dd="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Dh=new RegExp("^[^"+Dd+"]*["+Od+"]"),Ah=new RegExp("^[^"+Od+"]*["+Dd+"]"),Ae={bold:pr,code:hr,highlight:Er,italic:gr,strikethrough:bn,subscript:Nr,superscript:xr,underline:Sn},Ad={directionless:pi,unmergeable:Ln},ul={center:hi,end:Ti,justify:xi,left:gi,right:Ni,start:Ei},Rd={[hi]:"center",[Ti]:"end",[xi]:"justify",[gi]:"left",[Ni]:"right",[Ei]:"start"},Id={normal:Md,segmented:mi,token:fi},kd={[Md]:"normal",[mi]:"segmented",[fi]:"token"};function E(o,e,...t){if(!o)throw new Error("Internal Lexical error: invariant() is meant to be replaced at compile time. There is no runtime version. Error: "+e)}function Ke(...o){let e=[];for(let t of o)if(t&&typeof t=="string")for(let[n]of t.matchAll(/\S+/g))e.push(n);return e}var Rh=100,ml=!1,pl=0;function $d(){return ml}function Ih(o){pl=o.timeStamp}function kh(o){pl===0&&vn(o).addEventListener("textInput",Ih,!0)}function fl(o,e,t){return e.__lexicalLineBreak===o||o[`__lexicalKey_${t._key}`]!==void 0}function $h(o){return o.getEditorState().read(()=>{let e=T();return e!==null?e.clone():null})}function Ph(o,e,t){let n=Se(t._window),r=null,i=null;n!==null&&n.anchorNode===o&&(r=n.anchorOffset,i=n.focusOffset);let s=o.nodeValue;s!==null&&Tr(e,s,r,i,!1)}function Fh(o,e,t){if(_(o)){let n=o.anchor.getNode();if(n.is(t)&&o.format!==n.getFormat())return!1}return e.nodeType===He&&t.isAttached()}function Pd(o,e,t){ml=!0;let n=performance.now()-pl>Rh;try{xe(o,()=>{let r=T()||$h(o),i=new Map,s=o.getRootElement(),l=o._editorState,a=o._blockCursorElement,d=!1,f="";for(let c=0;c<e.length;c++){let u=e[c],p=u.type,g=u.target,h=J(g,l);if(!(h===null&&g!==s||F(h))){if(p==="characterData")n&&y(h)&&Fh(r,g,h)&&Ph(g,h,o);else if(p==="childList"){d=!0;let C=u.addedNodes;for(let M=0;M<C.length;M++){let S=C[M],D=gl(S),O=S.parentNode;if(O!=null&&S!==a&&D===null&&(S.nodeName!=="BR"||!fl(S,O,o))){if(Be){let A=S.innerText||S.nodeValue;A&&(f+=A)}O.removeChild(S)}}let N=u.removedNodes,L=N.length;if(L>0){let M=0;for(let S=0;S<L;S++){let D=N[S];(D.nodeName==="BR"&&fl(D,g,o)||a===D)&&(g.appendChild(D),M++)}L!==M&&(g===s&&(h=hl(l)),i.set(g,h))}}}}if(i.size>0)for(let[c,u]of i)if(x(u)){let p=u.getChildrenKeys(),g=c.firstChild;for(let h=0;h<p.length;h++){let C=p[h],N=o.getElementByKey(C);N!==null&&(g==null?(c.appendChild(N),g=N):g!==N&&c.replaceChild(N,g),g=g.nextSibling)}}else y(u)&&u.markDirty();let m=t.takeRecords();if(m.length>0){for(let c=0;c<m.length;c++){let u=m[c],p=u.addedNodes,g=u.target;for(let h=0;h<p.length;h++){let C=p[h],N=C.parentNode;N!=null&&C.nodeName==="BR"&&!fl(C,g,o)&&N.removeChild(C)}}t.takeRecords()}r!==null&&(d&&(r.dirty=!0,Y(r)),Be&&yi(o)&&r.insertRawText(f))})}finally{ml=!1}}function Ci(o){let e=o._observer;if(e!==null){let t=e.takeRecords();Pd(o,t,e)}}function _i(o){kh(o),o._observer=new MutationObserver((e,t)=>{Pd(o,e,t)})}function Fd(o,e){let t=o.__mode,n=o.__format,r=o.__style,i=e.__mode,s=e.__format,l=e.__style;return(t===null||t===i)&&(n===null||n===s)&&(r===null||r===l)}function Bd(o,e){let t=o.mergeWithSibling(e),n=V()._normalizedNodes;return n.add(o.__key),n.add(e.__key),t}function Nl(o){let e=o;if(e.__text===""&&e.isSimpleText()&&!e.isUnmergeable()){e.remove();return}let t;for(;(t=e.getPreviousSibling())!==null&&y(t)&&t.isSimpleText()&&!t.isUnmergeable();)if(t.__text==="")t.remove();else if(Fd(t,e)){e=Bd(t,e);break}else break;let n;for(;(n=e.getNextSibling())!==null&&y(n)&&n.isSimpleText()&&!n.isUnmergeable();)if(n.__text==="")n.remove();else if(Fd(e,n)){e=Bd(e,n);break}else break}function Ho(o){return Hd(o.anchor),Hd(o.focus),o}function Hd(o){for(;o.type==="element";){let e=o.getNode(),t=o.offset,n,r;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),r=!0):(n=e.getChildAtIndex(t),r=!1),y(n)){o.set(n.__key,r?n.getTextContentSize():0,"text");break}else if(!x(n))break;o.set(n.__key,r?n.getChildrenSize():0,"element")}}var Bh=1;function Hh(){return""+Bh++}function zd(o,e){let t=o._nodes.get(e);return t===void 0&&E(!1,"regi
`)o.preventDefault(),w(e,$t,!1);else if(i===Je)o.preventDefault(),w(e,Pt,void 0);else if(i==null&&o.dataTransfer){let f=o.dataTransfer.getData("text/plain");o.preventDefault(),r.insertRawText(f)}else i!=null&&Zc(r,n,i,o.timeStamp,!0)?(o.preventDefault(),w(e,lt,i)):$n=i;Vc=o.timeStamp;return}switch(o.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{w(e,lt,o);break}case"insertFromComposition":{ie(null),w(e,lt,o);break}case"insertLineBreak":{ie(null),w(e,$t,!1);break}case"insertParagraph":{ie(null),Ar&&!St?(Ar=!1,w(e,$t,!1)):w(e,Pt,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{w(e,ro,o);break}case"deleteByComposition":{sN(a,d)&&w(e,_n,o);break}case"deleteByDrag":case"deleteByCut":{w(e,_n,o);break}case"deleteContent":{w(e,Ge,!1);break}case"deleteWordBackward":{w(e,bt,!0);break}case"deleteWordForward":{w(e,bt,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{w(e,at,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{w(e,at,!1);break}case"formatStrikeThrough":{w(e,Ne,"strikethrough");break}case"formatBold":{w(e,Ne,"bold");break}case"formatItalic":{w(e,Ne,"italic");break}case"formatUnderline":{w(e,Ne,"underline");break}case"historyUndo":{w(e,io,void 0);break}case"historyRedo":{w(e,so,void 0);break}default:}})}function dN(o,e){o.stopPropagation(),xe(e,()=>{let t=T(),n=o.data,r=Gc(o);if(n!=null&&_(t)&&Zc(t,r,n,o.timeStamp,!1)){Dr&&(Bl(e,n),Dr=!1);let s=t.anchor.getNode(),l=Se(e._window);if(l===null)return;let a=t.isBackward(),d=a?t.anchor.offset:t.focus.offset,f=a?t.focus.offset:t.anchor.offset;(!fo||t.isCollapsed()||!y(s)||l.anchorNode===null||s.getTextContent().slice(0,d)+n+s.getTextContent().slice(d+f)!==_l(l.anchorNode))&&w(e,lt,n);let m=n.length;Be&&m>1&&o.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=m),!Ht&&!St&&!Kt&&e.isComposing()&&(Rr=0,ie(null))}else Mi(!1,e,n!==null?n:void 0),Dr&&(Bl(e,n||void 0),Dr=!1);Zd()}),$n=null}function cN(o,e){xe(e,()=>{let t=T();if(_(t)&&!e.isComposing()){let n=t.anchor,r=t.anchor.getNode();ie(n.key),(o.timeStamp<Rr+Hl||n.type==="element"||!t.isCollapsed()||r.getFormat()!==t.format||y(r)&&r.getStyle()!==t.style)&&w(e,lt,wd)}})}function Bl(o,e){let t=o._compositionKey;if(ie(null),t!==null&&e!=null){if(e===""){let n=X(t),r=In(o.getElementByKey(t));r!==null&&r.nodeValue!==null&&y(n)&&Tr(n,r.nodeValue,null,null,!0);return}if(e[e.length-1]===`
`){let n=T();if(_(n)){let r=n.focus;n.anchor.set(r.key,r.offset,r.type),w(o,dt,null);return}}}Mi(!0,o,e)}function uN(o,e){Be?Dr=!0:xe(e,()=>{Bl(e,o.data)})}function fN(o,e){if(Rr=o.timeStamp,Yc=o.key,e.isComposing())return;let{key:t,shiftKey:n,ctrlKey:r,metaKey:i,altKey:s}=o;if(!w(e,Gs,o)&&t!=null){if(xc(t,r,s,i))w(e,Ro,o);else if(Ec(t,r,n,s,i))w(e,Js,o);else if(hc(t,r,s,i))w(e,Io,o);else if(Nc(t,r,n,s,i))w(e,js,o);else if(Tc(t,r,i))w(e,ko,o);else if(Cc(t,r,i))w(e,$o,o);else if(oc(t,n))Ar=!0,w(e,dt,o);else if(yc(t))w(e,Qs,o);else if(nc(t,r))o.preventDefault(),Ar=!0,w(e,$t,!0);else if(tc(t,n))Ar=!1,w(e,dt,o);else if(ac(t,s,i,r))wn(t)?w(e,Ft,o):(o.preventDefault(),w(e,Ge,!0));else if(Sc(t))w(e,Po,o);else if(dc(t,r,n,s,i))On(t)?w(e,Bt,o):(o.preventDefault(),w(e,Ge,!1));else if(rc(t,s,r))o.preventDefault(),w(e,bt,!0);else if(ic(t,s,r))o.preventDefault(),w(e,bt,!1);else if(sc(t,i))o.preventDefault(),w(e,at,!0);else if(lc(t,i))o.preventDefault(),w(e,at,!1);else if(jd(t,s,i,r))o.preventDefault(),w(e,Ne,"bold");else if(ec(t,s,i,r))o.preventDefault(),w(e,Ne,"underline");else if(Qd(t,s,i,r))o.preventDefault(),w(e,Ne,"italic");else if(Jd(t,s,r,i))w(e,Fo,o);else if(cc(t,n,i,r))o.preventDefault(),w(e,io,void 0);else if(uc(t,n,i,r))o.preventDefault(),w(e,so,void 0);else{let l=e._editorState._selection;_e(l)?fc(t,n,i,r)?(o.preventDefault(),w(e,lo,o)):mc(t,n,i,r)?(o.preventDefault(),w(e,ao,o)):yl(t,i,r)&&(o.preventDefault(),w(e,yn,o)):!Be&&yl(t,i,r)&&(o.preventDefault(),w(e,yn,o))}_c(r,n,s,i)&&w(e,sl,o)}}function Jc(o){let e=o.__lexicalEventHandles;return e===void 0&&(e=[],o.__lexicalEventHandles=e),e}var Pn=new Map;function jc(o){let e=o.target,t=e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView,n=Se(t);if(n===null)return;let r=bi(n.anchorNode);if(r===null)return;Fl&&(Fl=!1,xe(r,()=>{let f=ze(),m=n.anchorNode;if(m===null)return;let c=m.nodeType;if(c!==mo&&c!==He)return;let u=Ir(f,n,r,o);Y(u)}));let i=br(r),s=i[i.length-1],l=s._key,a=Pn.get(l),d=a||s;d!==r&&zc(n,d,!1),zc(n,r,!0),r!==s?Pn.set(l,r):a&&Pn.delete(l)}function Wc(o){o._lexicalHandled=!0}function qc(o){return o._lexicalHandled===!0}function Qc(o,e){let t=o.ownerDocument,n=Fi.get(t);(n===void 0||n<1)&&t.addEventListener("selectionchange",jc),Fi.set(t,(n||0)+1),o.__lexicalEditor=e;let r=Jc(o);for(let i=0;i<$l.length;i++){let[s,l]=$l[i],a=typeof l=="function"?d=>{qc(d)||(Wc(d),(e.isEditable()||s==="click")&&l(d,e))}:d=>{if(qc(d))return;Wc(d);let f=e.isEditable();switch(s){case"cut":return f&&w(e,ao,d);case"copy":return w(e,lo,d);case"paste":return f&&w(e,ro,d);case"dragstart":return f&&w(e,ur,d);case"dragover":return f&&w(e,fr,d);case"dragend":return f&&w(e,ol,d);case"focus":return f&&w(e,mr,d);case"blur":return f&&w(e,il,d);case"drop":return f&&w(e,Bo,d)}};o.addEventListener(s,a),r.push(()=>{o.removeEventListener(s,a)})}}function eu(o){let e=o.ownerDocument,t=Fi.get(e);E(t!==void 0,"Root element not registered");let n=t-1;E(n>=0,"Root element count less than 0"),Fi.set(e,n),n===0&&e.removeEventListener("selectionchange",jc);let r=Ko(o);Rn(r)?(mN(r),o.__lexicalEditor=null):r&&E(!1,"Attempted to remove event handlers from a node that does not belong to this build of Lexical");let i=Jc(o);for(let s=0;s<i.length;s++)i[s]();o.__lexicalEventHandles=[]}function mN(o){if(o._parentEditor!==null){let e=br(o),n=e[e.length-1]._key;Pn.get(n)===o&&Pn.delete(n)}else Pn.delete(o._key)}function tu(){Pl=!0}function ou(o,e,t,n,r){Xc=[o,e,t,n,r]}function Kl(o,e,t){de();let n=o.__key,r=o.getParent();if(r===null)return;let i=Mc(o),s=!1;if(_(i)&&e){let l=i.anchor,a=i.focus;l.key===n&&(Bn(l,o,r,o.getPreviousSibling(),o.getNextSibling()),s=!0),a.key===n&&(Bn(a,o,r,o.getPreviousSibling(),o.getNextSibling()),s=!0)}else _e(i)&&e&&o.isSelected()&&o.selectPrevious();if(_(i)&&e&&!s){let l=o.getIndexWithinParent();Wt(o),Fn(i,r,l,-1)}else Wt(o);!t&&!pe(r)&&!r.canBeEmpty()&&r.isEmpty()&&Kl(r,e),e&&G(r)&&r.isEmpty()&&r.selectEnd()}var vt=class{static getType(){E(!1,"LexicalNode: Node %s does not implement .getType().",this.name)}static clone(e){E(!1,"LexicalNode: Node %s does not implement .c
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>hN(e)||NN(e)?null:{conversion:gN,priority:0}}}static importJSON(e){return mt()}exportJSON(){return{type:"linebreak",version:1}}};function gN(o){return{node:mt()}}function mt(){return re(new Xo)}function Ce(o){return o instanceof Xo}function hN(o){let e=o.parentElement;if(e!==null&&go(e)){let t=e.firstChild;if(t===o||t.nextSibling===o&&Bi(t)){let n=e.lastChild;if(n===o||n.previousSibling===o&&Bi(n))return!0}}return!1}function NN(o){let e=o.parentElement;if(e!==null&&go(e)){let t=e.firstChild;if(t===o||t.nextSibling===o&&Bi(t))return!1;let n=e.lastChild;if(n===o||n.previousSibling===o&&Bi(n))return!0}return!1}function Bi(o){return o.nodeType===He&&/^( |\t|\r?\n)+$/.test(o.textContent||"")}function zl(o,e){return e&hr?"code":e&Er?"mark":e&Nr?"sub":e&xr?"sup":null}function Wl(o,e){return e&pr?"strong":e&gr?"em":"span"}function lu(o,e,t,n,r){let i=n.classList,s=po(r,"base");s!==void 0&&i.add(...s),s=po(r,"underlineStrikethrough");let l=!1,a=e&Sn&&e&bn,d=t&Sn&&t&bn;s!==void 0&&(d?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(let f in Ae){let c=Ae[f];if(s=po(r,f),s!==void 0)if(t&c){if(l&&(f==="underline"||f==="strikethrough")){e&c&&i.remove(...s);continue}(!(e&c)||a&&f==="underline"||f==="strikethrough")&&i.add(...s)}else e&c&&i.remove(...s)}}function xN(o,e){let t=o.length,n=e.length,r=0,i=0;for(;r<t&&r<n&&o[r]===e[r];)r++;for(;i+r<t&&i+r<n&&o[t-i-1]===e[n-i-1];)i++;return[r,t-r-i,e.slice(r,n-i)]}function au(o,e,t){let n=e.firstChild,r=t.isComposing(),s=o+(r?Mn:"");if(n==null)e.textContent=s;else{let l=n.nodeValue;if(l!==s)if(r||Be){let[a,d,f]=xN(l,s);d!==0&&n.deleteData(a,d),n.insertData(a,f)}else n.nodeValue=s}}function ru(o,e,t,n,r,i){au(r,o,e);let l=i.theme.text;l!==void 0&&lu(t,0,n,o,l)}function Hi(o,e){let t=document.createElement(e);return t.appendChild(o),t}var wt=class o extends vt{static getType(){return"text"}static clone(e){return new o(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return kd[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===fi}isComposing(){return this.__key===je()}isSegmented(){return this.getLatest().__mode===mi}isDirectionless(){return(this.getLatest().__detail&pi)!==0}isUnmergeable(){return(this.getLatest().__detail&Ln)!==0}hasFormat(e){let t=Ae[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){let r=this.getLatest().__format;return _r(r,e,t)}canHaveFormat(){return!0}createDOM(e,t){let n=this.__format,r=zl(this,n),i=Wl(this,n),s=r===null?i:r,l=document.createElement(s),a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),r!==null&&(a=document.createElement(i),l.appendChild(a));let d=this.__text;ru(a,this,i,n,d,e);let f=this.__style;return f!==""&&(l.style.cssText=f),l}updateDOM(e,t,n){let r=this.__text,i=e.__format,s=this.__format,l=zl(this,i),a=zl(this,s),d=Wl(this,i),f=Wl(this,s);if((l===null?d:l)!==(a===null?f:a))return!0;if(l===a&&d!==f){let N=t.firstChild;N==null&&E(!1,"updateDOM: prevInnerDOM is null or undefined");let L=document.createElement(f);return ru(L,this,f,s,r,n),t.replaceChild(L,N),!1}let u=t;a!==null&&l!==null&&(u=t.firstChild,u==null&&E(!1,"updateDOM: innerDOM is null or undefined")),au(r,u,this);let g=n.theme.text;g!==void 0&&i!==s&&lu(f,i,s,u,g);let h=e.__style,C=this.__style;return h!==C&&(t.style.cssText=C),!1}static importDOM(){return{"#text":()=>({conversion:yN,priority:0}),b:()=>({conversion:TN,priority:0}),code:()=>({conversion:No,priority:0}),em:()=>({conversion:No,priority:0}),i:()=>({conversion:No,priority:0}),s:()=>({conversion:No,priority:0}),span:()=>({conversion:EN,pr
`||a===`\r
`?i.push(mt()):a===" "?i.push(Ot()):a!==""&&i.push(Z(a))}return{node:i}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=e,i=!0;for(;r!==null&&(r=su(r,!1))!==null;){let s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=su(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Z(n)}}function su(o,e){let t=o;for(;;){let n;for(;(n=e?t.nextSibling:t.previousSibling)===null;){let i=t.parentElement;if(i===null)return null;t=i}if(t=n,t.nodeType===mo){let i=t.style.display;if(i===""&&!zo(t)||i!==""&&!i.startsWith("inline"))return null}let r=t;for(;(r=e?t.firstChild:t.lastChild)!==null;)t=r;if(t.nodeType===He)return t;if(t.nodeName==="BR")return null}}var bN={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function No(o){let e=bN[o.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Yl(o.style,e),node:null}}function Z(o=""){return re(new wt(o))}function y(o){return o instanceof wt}function Yl(o,e){let t=o.fontWeight,n=o.textDecoration.split(" "),r=t==="700"||t==="bold",i=n.includes("line-through"),s=o.fontStyle==="italic",l=n.includes("underline"),a=o.verticalAlign,d=o.color,f=o.backgroundColor;return m=>{if(!y(m))return m;r&&!m.hasFormat("bold")&&m.toggleFormat("bold"),i&&!m.hasFormat("strikethrough")&&m.toggleFormat("strikethrough"),s&&!m.hasFormat("italic")&&m.toggleFormat("italic"),l&&!m.hasFormat("underline")&&m.toggleFormat("underline"),a==="sub"&&!m.hasFormat("subscript")&&m.toggleFormat("subscript"),a==="super"&&!m.hasFormat("superscript")&&m.toggleFormat("superscript");let c=m.getStyle();return d&&(c+=`color: ${d};`),f&&f!=="transparent"&&(c+=`background-color: ${f};`),c&&m.setStyle(c),e&&!m.hasFormat(e)&&m.toggleFormat(e),m}}var Zo=class o extends wt{static getType(){return"tab"}static clone(e){return new o(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=Ln}static importDOM(){return null}static importJSON(e){let t=Ot();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){E(!1,"TabNode does not support setTextContent")}setDetail(e){E(!1,"TabNode does not support setDetail")}setMode(e){E(!1,"TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Ot(){return re(new Zo)}function Vl(o){return o instanceof Zo}var Gl=class{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){let t=this.getNode(),n=e.getNode(),r=this.offset,i=e.offset;if(x(t)){let s=t.getDescendantByIndex(r);t=s??t}if(x(n)){let s=n.getDescendantByIndex(i);n=s??n}return t===n?r<i:t.isBefore(n)}getNode(){let e=this.key,t=X(e);return t===null&&E(!1,"Point.getNode: node not found"),t}set(e,t,n){let r=this._selection,i=this.key;this.key=e,this.offset=t,this.type=n,ct()||(je()===i&&ie(e),r!==null&&(r.setCachedNodes(null),r.dirty=!0))}};function Re(o,e,t){return new Gl(o,e,t)}function Xl(o,e){let t=e.__key,n=o.offset,r="element";if(y(e)){r="text";let i=e.getTextContentSize();n>i&&(n=i)}else if(!x(e)){let i=e.getNextSibling();if(y(i))t=i.__key,n=0,r="text";else{let s=e.getParent();s&&(t=s.__key,n=e.getIndexWithinParent()+1)}}o.set(t,n,r)}function Ul(o,e){if(x(e)){let t=e.getLastDescendant();x(t)||y(t)?Xl(o,t):Xl(o,e)}else Xl(o,e)}function SN(o,e,t,n){let r=o.getNode(),i=r.getChildAtIndex(o.offset),s=Z(),l=G(r)?P().append(s):s;s.setFormat(t),s.setStyle(n),i===null?r.append(l):i.insertBefore(l),o.is(e)&&e.set(s.__key,0,"text"),o.set(s.__key,0,"text")}function xo(o,e,t,n){o.key=e,o.offset=t,o.type=n}var Ui=class o{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cache
`),c.isEmpty()?f=!1:f=!0;else if(f=!1,y(c)){let u=c.getTextContent();c===t?c===n?(r.type!=="element"||i.type!=="element"||i.offset===r.offset)&&(u=l<a?u.slice(l,a):u.slice(a,l)):u=s?u.slice(l):u.slice(a):c===n&&(u=s?u.slice(0,a):u.slice(0,l)),d+=u}else(F(c)||Ce(c))&&(c!==n||!this.isCollapsed())&&(d+=c.getTextContent())}return d}applyDOMRange(e){let t=V(),r=t.getEditorState()._selection,i=gu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;let[s,l]=i;xo(this.anchor,s.key,s.offset,s.type),xo(this.focus,l.key,l.offset,l.type),this._cachedNodes=null}clone(){let e=this.anchor,t=this.focus;return new o(Re(e.key,e.offset,e.type),Re(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=_r(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Ae[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let i=0;i<r;i++){let s=t[i];s===`
`||s===`\r
`?n.push(mt()):s===" "?n.push(Ot()):n.push(Z(s))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,s=t,l=n;!this.isCollapsed()&&n.isBefore(t)&&(s=n,l=t),s.type==="element"&&SN(s,l,r,i);let a=s.offset,d=l.offset,f=this.getNodes(),m=f.length,c=f[0];y(c)||E(!1,"insertText: first node is not a text node");let p=c.getTextContent().length,g=c.getParentOrThrow(),h=m-1,C=f[h];if(m===1&&l.type==="element"&&(d=p,l.set(s.key,d,"text")),this.isCollapsed()&&a===p&&(c.isSegmented()||c.isToken()||!c.canInsertTextAfter()||!g.canInsertTextAfter()&&c.getNextSibling()===null)){let N=c.getNextSibling();if((!y(N)||!N.canInsertTextBefore()||Ue(N))&&(N=Z(),N.setFormat(r),N.setStyle(i),g.canInsertTextAfter()?c.insertAfter(N):g.insertAfter(N)),N.select(0,0),c=N,e!==""){this.insertText(e);return}}else if(this.isCollapsed()&&a===0&&(c.isSegmented()||c.isToken()||!c.canInsertTextBefore()||!g.canInsertTextBefore()&&c.getPreviousSibling()===null)){let N=c.getPreviousSibling();if((!y(N)||Ue(N))&&(N=Z(),N.setFormat(r),g.canInsertTextBefore()?c.insertBefore(N):g.insertBefore(N)),N.select(),c=N,e!==""){this.insertText(e);return}}else if(c.isSegmented()&&a!==p){let N=Z(c.getTextContent());N.setFormat(r),c.replace(N),c=N}else if(!this.isCollapsed()&&e!==""){let N=C.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||x(N)&&(!N.canInsertTextBefore()||!N.canInsertTextAfter())){this.insertText(""),pu(this.anchor,this.focus,null),this.insertText(e);return}}if(m===1){if(c.isToken()){let S=Z(e);S.select(),c.replace(S);return}let N=c.getFormat(),L=c.getStyle();if(a===d&&(N!==r||L!==i))if(c.getTextContent()==="")c.setFormat(r),c.setStyle(i);else{let S=Z(e);if(S.setFormat(r),S.setStyle(i),S.select(),a===0)c.insertBefore(S,!1);else{let[D]=c.splitText(a);D.insertAfter(S,!1)}S.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);return}else if(Vl(c)){let S=Z(e);S.setFormat(r),S.setStyle(i),S.select(),c.replace(S);return}let M=d-a;c=c.spliceText(a,M,e,!0),c.getTextContent()===""?c.remove():this.anchor.type==="text"&&(c.isComposing()?this.anchor.offset-=e.length:(this.format=N,this.style=L))}else{let N=new Set([...c.getParentKeys(),...C.getParentKeys()]),L=x(c)?c:c.getParentOrThrow(),M=x(C)?C:C.getParentOrThrow(),S=C;if(!L.is(M)&&M.isInline())do S=M,M=M.getParentOrThrow();while(M.isInline());if(l.type==="text"&&(d!==0||C.getTextContent()==="")||l.type==="element"&&C.getIndexWithinParent()<d)if(y(C)&&!C.isToken()&&d!==C.getTextContentSize()){if(C.isSegmented()){let R=Z(C.getTextContent());C.replace(R),C=R}!G(l.getNode())&&l.type==="text"&&(C=C.spliceText(0,d,"")),N.add(C.__key)}else{let R=C.getParentOrThrow();!R.canBeEmpty()&&R.getChildrenSize()===1?R.remove():C.remove()}else N.add(C.__key);let D=M.getChildren(),O=new Set(f),A=L.is(M),$=L.isInline()&&c.getNextSibling()===null?L:c;for(let R=D.length-1;R>=0;R--){let U=D[R];if(U.is(c)||x(U)&&U.isParentOf(c))break;U.isAttached()&&(!O.has(U)||U.is(S)?A||$.insertAfter(U,!1):U.remove())}if(!A){let R=M,U=null;for(;R!==null;){let ee=R.getChildren(),Tn=ee.length;(Tn===0||ee[Tn-1].is(U))&&(N.delete(R.__key),U=R),R=R.getParent()}}if(!c.isToken())c=c.spliceText(a,p-a,e,!0),c.getTextContent()===""?c.remove():c.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);else if(a===p)c.select();else{let R=Z(e);R.select(),c.replace(R)}for(let R=1;R<m;R++){let U=f[R],ee=U.__key;N.has(ee)||U.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed()){this.toggleFormat(e),ie(null);return}let t=this.getNodes(),n=[];for(let N of t)y(N)&&n.push(N);let r=n.length;if(r===0){this.toggleFormat(e),ie(null);return}let i=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:i,d=l?i:s,f=0,m=n[0],c=a.type==="element"?0:a.offset;if(a.type==="text"&&c===m.getTextContentSize()&&(f=1,m=n[1],c=0),m==null)return;let u=m.getFormatFlags(e,null),p=r-1,g=n[p],h=d.type==="text"?d.offset:g.getTextContentSize();if(m.is(g)){if(c===h)return;if(Ue(m)||c===0&&h===m.getTextContentSize())m.setFormat(u);else{let N=m.splitText(c,h),L=c===0?N[0]:N[1];L.setFormat(u),a.
`||d===`\r
`?a.insertParagraph():d===" "?a.insertNodes([Ot()]):a.insertText(d)}}}else e.insertRawText(i)}function ca(o,e,t){o.dispatchCommand(ar,{nodes:e,selection:t})||t.insertNodes(e)}function rx(o){let e=o.exportJSON(),t=o.constructor;if(e.type!==t.getType()&&E(!1,"LexicalNode: Node %s does not implement .exportJSON().",t.name),x(o)){let n=e.children;Array.isArray(n)||E(!1,"LexicalNode: Node %s is an element but .exportJSON() does not have a children array.",t.name)}return e}function Ju(o,e,t,n=[]){let r=e!==null?t.isSelected(e):!0,i=x(t)&&t.excludeFromCopy("html"),s=t;if(e!==null){let d=Yt(t);d=y(d)&&e!==null?Pr(e,d):d,s=d}let l=x(s)?s.getChildren():[],a=rx(s);if(y(s)){let d=s.__text;d.length>0?a.text=d:r=!1}for(let d=0;d<l.length;d++){let f=l[d],m=Ju(o,e,f,a.children);!r&&x(t)&&m&&t.extractWithChild(f,e,"clone")&&(r=!0)}if(r&&!i)n.push(a);else if(Array.isArray(a.children))for(let d=0;d<a.children.length;d++){let f=a.children[d];n.push(f)}return r}function ju(o,e){let t=[],r=B().getChildren();for(let i=0;i<r.length;i++){let s=r[i];Ju(o,e,s,t)}return{namespace:o._config.namespace,nodes:t}}function Qu(o){let e=[];for(let t=0;t<o.length;t++){let n=o[t],r=Ql(n);y(r)&&ia(r),e.push(r)}return e}var ix=50,qn=null;async function Yn(o,e,t){if(qn!==null)return!1;if(e!==null)return new Promise((a,d)=>{o.update(()=>{a(Vu(o,e,t))})});let n=o.getRootElement(),r=o._window==null?window.document:o._window.document,i=Xu(o._window);if(n===null||i===null)return!1;let s=r.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(r.createTextNode("#")),n.append(s);let l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,d)=>{let f=o.registerCommand(lo,m=>(pt(m,ClipboardEvent)&&(f(),qn!==null&&(window.clearTimeout(qn),qn=null),a(Vu(o,m,t))),!0),Me);qn=window.setTimeout(()=>{f(),qn=null,a(!1)},ix),r.execCommand("copy"),s.remove()})}function Vu(o,e,t){if(t===void 0){let r=Xu(o._window);if(!r)return!1;let i=r.anchorNode,s=r.focusNode;if(i!==null&&s!==null&&!zt(o,i,s))return!1;let l=T();if(l===null)return!1;t=Qi(l)}e.preventDefault();let n=e.clipboardData;return n===null?!1:(ef(n,t),!0)}var sx=[["text/html",Zu],["application/x-lexical-editor",Gu]];function Qi(o=T()){let e={"text/plain":o?o.getTextContent():""};if(o){let t=Ll();for(let[n,r]of sx){let i=r(t,o);i!==null&&(e[n]=i)}}return e}function ef(o,e){for(let t in e){let n=e[t];n!==void 0&&o.setData(t,n)}}function es(o,e){if(typeof document.caretRangeFromPoint<"u"){let t=document.caretRangeFromPoint(o,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){let t=document.caretPositionFromPoint(o,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}else return null}var tf=k("DRAG_DROP_PASTE_FILE"),Co=class o extends z{static getType(){return"quote"}static clone(e){return new o(e.__key)}constructor(e){super(e)}createDOM(e){let t=document.createElement("blockquote");return Te(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:lx,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(t&&Ee(t)){this.isEmpty()&&t.append(document.createElement("br"));let n=this.getFormatType();t.style.textAlign=n}return{element:t}}static importJSON(e){let t=rf();return t.setFormat(e.format),t.setIndent(e.indent),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){let n=P(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=P();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function rf(){return re(new Co)}function ns(o){return o instanceof Co}var _o=class o extends z{static getType(){return"heading"}static clone(e){return new o(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){let t=this.__tag,n=document.createElement(t),i=e.theme.heading;if(i!==void 0){let s=i[t];Te(n,s)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:Vn,priority:0}),h2:e
`?null:(y(c)&&(a&&c.toggleFormat("bold"),d&&c.toggleFormat("strikethrough"),f&&c.toggleFormat("italic"),m&&c.toggleFormat("underline")),p.append(c),p)}return c},node:r}}function Ye(o,e=1,t){return re(new Et(o,e,t))}function I(o){return o instanceof Et}var _x=k("INSERT_TABLE_COMMAND");var Tt=class o extends z{static getType(){return"tablerow"}static clone(e){return new o(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:yx,priority:0})}}static importJSON(e){return sn(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(e){let t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),Te(t,e.theme.tableRow),t}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function yx(o){let e=o,t;return ls.test(e.style.height)&&(t=parseFloat(e.style.height)),{node:sn(t)}}function sn(o){return re(new Tt(o))}function se(o){return o instanceof Tt}function ba(o,e,t=!0){let n=Vr();for(let r=0;r<o;r++){let i=sn();for(let s=0;s<e;s++){let l=oe.NO_STATUS;typeof t=="object"?(r===0&&t.rows&&(l|=oe.ROW),s===0&&t.columns&&(l|=oe.COLUMN)):t&&(r===0&&(l|=oe.ROW),s===0&&(l|=oe.COLUMN));let a=Ye(l),d=P();d.append(Z()),a.append(d),i.append(a)}n.append(i)}return n}var ya=(o,e)=>o===oe.BOTH||o===e?e:oe.NO_STATUS;function as(o=!0){let e=T();E(_(e)||W(e),"Expected a RangeSelection or TableSelection");let t=e.focus.getNode(),[n,,r]=we(t),[i,s]=Ve(r,n,n),l=i[0].length,{startRow:a}=s;if(o){let d=a+n.__rowSpan-1,f=i[d],m=sn();for(let u=0;u<l;u++){let{cell:p,startRow:g}=f[u];if(g+p.__rowSpan-1<=d){let C=f[u].cell.__headerState,N=ya(C,oe.COLUMN);m.append(Ye(N).append(P()))}else p.setRowSpan(p.__rowSpan+1)}let c=r.getChildAtIndex(d);E(se(c),"focusEndRow is not a TableRowNode"),c.insertAfter(m)}else{let d=i[a],f=sn();for(let c=0;c<l;c++){let{cell:u,startRow:p}=d[c];if(p===a){let h=d[c].cell.__headerState,C=ya(h,oe.COLUMN);f.append(Ye(C).append(P()))}else u.setRowSpan(u.__rowSpan+1)}let m=r.getChildAtIndex(a);E(se(m),"focusEndRow is not a TableRowNode"),m.insertBefore(f)}}function ds(o=!0){let e=T();E(_(e)||W(e),"Expected a RangeSelection or TableSelection");let t=e.anchor.getNode(),n=e.focus.getNode(),[r]=we(t),[i,,s]=we(n),[l,a,d]=Ve(s,i,r),f=l.length,m=o?Math.max(a.startColumn,d.startColumn):Math.min(a.startColumn,d.startColumn),c=o?m+i.__colSpan-1:m-1,u=s.getFirstChild();E(se(u),"Expected firstTable child to be a row");let p=null;function g(C=oe.NO_STATUS){let N=Ye(C).append(P());return p===null&&(p=N),N}let h=u;e:for(let C=0;C<f;C++){if(C!==0){let A=h.getNextSibling();E(se(A),"Expected row nextSibling to be a row"),h=A}let N=l[C],L=N[c<0?0:c].cell.__headerState,M=ya(L,oe.ROW);if(c<0){Ma(h,g(M));continue}let{cell:S,startColumn:D,startRow:O}=N[c];if(D+S.__colSpan-1<=c){let A=S,$=O,R=c;for(;$!==C&&A.__rowSpan>1;)if(R-=S.__colSpan,R>=0){let{cell:U,startRow:ee}=N[R];A=U,$=ee}else{h.append(g(M));continue e}A.insertAfter(g(M))}else S.setColSpan(S.__colSpan+1)}p!==null&&Yr(p)}function Sa(){let o=T();E(_(o)||W(o),"Expected a RangeSelection or TableSelection");let e=o.anchor.getNode(),t=o.focus.getNode(),[n,,r]=we(e),[i]=we(t),[s,l,a]=Ve(r,n,i),{startRow:d}=l,{startRow:f}=a,m=f+i.__rowSpan-1;if(s.length===m-d+1){r.remove();return}let c=s[0].length,u=s[m+1],p=r.getChildAtIndex(m+1);for(let g=m;g>=d;g--){for(let C=c-1;C>=0;C--){let{cell:N,startRow:L,startColumn:M}=s[g][C];if(M===C&&(g===d&&L<d&&N.setRowSpan(N.__rowSpan-(L-d)),L>=d&&L+N.__rowSpan-1>m))if(N.setRowSpan(N.__rowSpan-(m-L+1)),E(p!==null,"Expected nextRowNode not to be null"),C===0)Ma(p,N);else{let{cell:S}=u[C-1];S.insertAfter(N)}}let h=r.getChildAtIndex(g);E(se(h),"Expected GridNode childAtIndex(%s) to be RowNode",String(g)),h.remove()}if(u!==void 0){let{cell:g}=u[0];Yr(g)}else{let g=s[d-1],{cell:h}=g[0];Yr(h)}}function La(){let o=T();E(_(o)||W(o),"Expected a Ran
`:" ")}return t}};function W(o){return o instanceof us}function fs(){let o=Re("root",0,"element"),e=Re("root",0,"element");return new us("root",o,e)}function bx(o){let e=[],t=[o];for(;t.length>0;){let n=t.pop();E(n!==void 0,"Stack.length > 0; can't be undefined"),x(n)&&t.unshift(...n.getChildren()),n!==o&&e.push(n)}return e}var Zr=class{constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(e=>e())}trackTable(){let e=new MutationObserver(t=>{this.editor.update(()=>{let n=!1;for(let i=0;i<t.length;i++){let a=t[i].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){n=!0;break}}if(!n)return;let r=this.editor.getElementByKey(this.tableNodeKey);if(!r)throw new Error("Expected to find TableElement in DOM");this.table=ln(r)})});this.editor.update(()=>{let t=this.editor.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");this.table=ln(t),e.observe(t,{attributes:!0,childList:!0,subtree:!0})})}clearHighlight(){let e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),e.update(()=>{let t=X(this.tableNodeKey);if(!Q(t))throw new Error("Expected TableNode.");let n=e.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");let r=ln(n);Xr(e,r,null),Y(null),e.dispatchCommand(De,void 0)})}enableHighlightStyle(){let e=this.editor;e.update(()=>{let t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");Wn(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let e=this.editor;e.update(()=>{let t=e.getElementByKey(this.tableNodeKey);if(!t)throw new Error("Expected to find TableElement in DOM");Te(t,e._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(e){if(e!==null&&e.tableKey===this.tableNodeKey){let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.disableHighlightStyle(),Xr(t,this.table,this.tableSelection)}else e==null?this.clearHighlight():(this.tableNodeKey=e.tableKey,this.updateTableTableSelection(e))}setFocusCellForSelection(e,t=!1){let n=this.editor;n.update(()=>{let r=X(this.tableNodeKey);if(!Q(r))throw new Error("Expected TableNode.");if(!n.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");let s=e.x,l=e.y;if(this.focusCell=e,this.anchorCell!==null){let a=wa(n._window);a&&a.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==s||this.anchorY!==l||t))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(s===this.focusX&&l===this.focusY)return;if(this.focusX=s,this.focusY=l,this.isHighlightingCells){let a=J(e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&I(a)&&r.is(Lo(a))){let d=a.getKey();this.tableSelection=this.tableSelection.clone()||fs(),this.focusCellNodeKey=d,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),Y(this.tableSelection),n.dispatchCommand(De,void 0),Xr(n,this.table,this.tableSelection)}}})}setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.editor.update(()=>{let t=J(e.elem);if(I(t)){let n=t.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():fs(),this.anchorCellNodeKey=n}})}formatCells(e){this.editor.update(()=>{le
`?null:(y(c)&&(a&&c.toggleFormat("bold"),d&&c.toggleFormat("strikethrough"),f&&c.toggleFormat("italic"),m&&c.toggleFormat("underline")),p.append(c),p)}return c},node:i}}function gs(o=oe.NO_STATUS,e=1,t){return new vo(o,e,t)}function le(o){return o instanceof vo}var kt=class{constructor(e){this.rowCount=0;this.columnCount=0;this.cells=[];this.buildCellMap(e)}buildCellMap(e){let t=[],n=(a,d,f)=>{typeof t[d]>"u"&&(t[d]=[]),t[d][a]=f},r=(a,d)=>!!(t[d]&&t[d][a]),i=e.getChildren().filter(a=>se(a));for(let a=0;a<i.length;a++){let f=i[a].getChildren().filter(c=>le(c)),m=0;for(let c=0;c<f.length;c++){let u=f[c],p=u.getColSpan()||1,g=u.getRowSpan()||1;for(let h=m;h<m+p;h++)for(let C=a;C<a+g;C++){for(;r(h,C);)m+=1,h+=1;n(h,C,u)}m+=p}}this.rowCount=t.length,this.columnCount=Math.max(...t.map(a=>a.length));let s=[],l=t[0][0];for(let a=0;a<this.rowCount;a++)for(let d=0;d<this.columnCount;d++)!t[a]||!t[a][d]?s.push(l):(s.push(t[a][d]),l=t[a][d]);this.cells=s}getCellAtPosition(e,t){let n=t*this.columnCount+e;if(n>=this.cells.length)throw new Error(`TableMap Error: Attempted to get cell ${n+1} of ${this.cells.length}`);return this.cells[n]}getCellsInRange(e){let t=Math.max(Math.min(e.fromX,e.toX),0),n=Math.min(Math.max(e.fromX,e.toX),this.columnCount-1),r=Math.max(Math.min(e.fromY,e.toY),0),i=Math.min(Math.max(e.fromY,e.toY),this.rowCount-1),s=new Set;for(let l=r;l<=i;l++)for(let a=t;a<=n;a++)s.add(this.getCellAtPosition(a,l));return[...s.values()]}getCellsInColumn(e){return this.getCellsInRange({fromX:e,toX:e,fromY:0,toY:this.rowCount-1})}getRangeForCell(e){let t=null,n=e.getKey();for(let r=0;r<this.rowCount;r++)for(let i=0;i<this.columnCount;i++){let s=r*this.columnCount+i;this.cells[s].getKey()===n&&(t===null?t={fromX:i,toX:i,fromY:r,toY:r}:(t.fromX=Math.min(t.fromX,i),t.toX=Math.max(t.toX,i),t.fromY=Math.min(t.fromY,r),t.toY=Math.max(t.toY,r)))}return t}};var dn=class o extends Tt{constructor(t){super(0,t);this.__styles=new Map}static getType(){return"custom-table-row"}static clone(t){let n=new o(t.__key);return n.__styles=new Map(t.__styles),n}getStyles(){let t=this.getLatest();return new Map(t.__styles)}setStyles(t){let n=this.getWritable();n.__styles=new Map(t)}createDOM(t){let n=super.createDOM(t);for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i);return n}updateDOM(t){return super.updateDOM(t)||this.__styles!==t.__styles}static importDOM(){return{tr:t=>({conversion:Bx,priority:0})}}static importJSON(t){let n=Hf();return n.setStyles(new Map(Object.entries(t.styles))),n}exportJSON(){return{...super.exportJSON(),height:0,type:"custom-table-row",styles:Object.fromEntries(this.__styles)}}};function Bx(o){let e=Hf();return o instanceof HTMLElement&&e.setStyles(Xn(o)),{node:e}}function Hf(){return new dn}function cn(o){return o instanceof dn}function Ia(o){return So(o,it)}function Uf(o){let e=zf(o),t=o.querySelector("colgroup"),n=[];return t&&(t.childElementCount===e?.childElementCount||!e)&&(n=Kf(t)),n.filter(Boolean).length===0&&e&&(n=Kf(e)),n}function zf(o){let e=o.querySelectorAll("tr"),t=0,n=null;for(let r of e)r.childElementCount>t&&(n=r,t=r.childElementCount);return n}function Kf(o){return[...o.children].map(e=>Hx(e))}function Hx(o){let e=o.style.width||o.getAttribute("width");return e&&!Number.isNaN(Number(e))&&(e=e+"px"),e||""}function ka(o,e,t){let n=o.getChildren(),r=0;for(let s of n){let l=s.getChildren().length;l>r&&(r=l)}let i=o.getColWidths();(i.length===0||i.length<r)&&(i=Array(r).fill("")),e+1>i.length&&console.error(`Attempted to set table column width for column [${e}] but only ${i.length} columns found`),i[e]=ht(t),o.setColWidths(i)}function Wf(o,e,t){let n=e.getColWidths();if(n.length>t&&n[t].endsWith("px"))return Number(n[t].replace("px",""));let r=o.getElementByKey(e.__key);if(r){let i=zf(r);if(i&&i.children.length>t)return i.children[t].clientWidth}return 0}function qf(o){let e=o.getParent();if(!se(e))return-1;let t=0,n=e.getChildren();for(let r of n){let i=r.getColSpan()||1;if(t+=i,r.getKey()===o.getKey())break}return t-1}function Yf(o,e){let t=Ia(o),n=qf(o);t&&n>=0&&ka(t,n,e)}function Vf(o,e){let
`;var $p='<svg version="1.1" viewBox="0 -960 960 960" xmlns="http://www.w3.org/2000/svg"><path class="editor-icon-color-bar" d="m80-2e-6v-160h800v160z"/><path d="m584-480-104-104-160 160 103 104zm-47-160 103 103 160-159-104-104zm-84-29 216 216-189 190c-16 16-34.833 24-56.5 24s-40.5-8-56.5-24l-27 23h-200l126-125c-16-16-24.333-35.167-25-57.5s7-41.5 23-57.5zm0 0 187-187c16-16 34.833-24 56.5-24s40.5 8 56.5 24l104 103c16 16 24 34.833 24 56.5s-8 40.5-24 56.5l-188 187z"/></svg>';var Pp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M80-400v-80h800v80H80Zm340-160v-120H200v-120h560v120H540v120H420Zm0 400v-160h120v160H420Z"/></svg>';var Fp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"/></svg>';var Bp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"/></svg>';var Hp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M320-240 80-480l240-240 57 57-184 184 183 183-56 56Zm320 0-57-57 184-184-183-183 56-56 240 240-240 240Z"/></svg>';var Kp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"/></svg>';function xn(o,e,t){return{label:o,icon:t,action(n){n.editor.dispatchCommand(Ne,e)},isActive(n){return pf(n,e)}}}var Up=xn("Bold","bold",Ap),zp=xn("Italic","italic",Rp),Wp=xn("Underline","underline",Ip),qp={label:"Text color",icon:kp},Yp={label:"Background color",icon:$p},Vp=xn("Strikethrough","strikethrough",Pp),Xp=xn("Superscript","superscript",Fp),Zp=xn("Subscript","subscript",Bp),Gp=xn("Inline code","code",Hp),Jp={label:"Clear formatting",icon:Kp,action(o){o.editor.update(()=>{let e=T();for(let t of e?.getNodes()||[])y(t)&&(t.setFormat(0),t.setStyle(""))})},isActive(){return!1}};var jp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"/></svg>';var Qp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"/></svg>';var eg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"/></svg>';var tg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"/></svg>';var og='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-800v400q0 17-11.5 28.5T400-360q-17 0-28.5-11.5T360-400v-160q-66 0-113-47t-47-113q0-66 47-113t113-47h280q17 0 28.5 11.5T680-840q0 17-11.5 28.5T640-800h-40v400q0 17-11.5 28.5T560-360q-17 0-28.5-11.5T520-400v-400h-80Zm-80 160v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Zm328 520H160q-17 0-28.5-11.5T120-240q0-17 11.5-28.5T160-280h528l-36-36q-11-11-11-28t11-28q11-11 28-11t28 11l104 104q12 12 12 28t-12 28L708-108q-11 11-28 11t-28-11q-11-11-11-28t11-28l36-36Z"/></svg>';var ng='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-800v400q0 17-11.5 28.5T400-360q-17 0-28.5-11.5T360-400v-160q-66 0-113-47t-47-113q0-66 47-113t113-47h280q17 0 28.5 11.5T680-840q0 17-11.5 28.5T640-800h-40v400q0 17-11.5 28.5T560-360q-17 0-28.5-11.5T520-400v-400h-80ZM272-200l36 36q11 11 11 28t-11 28q-11 11-28 11t-28-11L148-212q-12-12-12-28t12-28l104-104q11-11 28-11t28 11q11 11 11 28t-11 28l-36 3
`;var Hs=class extends ne{constructor(e,t){super([e]),this.button=e,this.dropdownButton=new Oe({button:{label:"Menu",icon:Jg},showOnHover:!1,direction:"vertical"},t),this.addChildren(this.dropdownButton)}buildDOM(){return b("div",{class:"editor-button-with-menu-container"},[this.button.getDOMElement(),this.dropdownButton.getDOMElement()])}};var En=class extends Xe{buildDOM(){return b("div",{class:"editor-separator"})}};function jg(o){let e=o.manager.getDefaultDirection()==="rtl";return new Cs("editor-toolbar-main",[new st(2,[new v(Np),new v(xp)]),new ys([new Ze(b("h2"),Lp),new Ze(b("h3"),Mp),new Ze(b("h4"),vp),new Ze(b("h5"),wp),new Ze(b("blockquote"),Op),new Ze(b("p"),Dp),new Oe({button:{label:"Callouts",format:"long"},showOnHover:!0,direction:"vertical"},[new Ze(b("p",{class:"callout info"}),_p),new Ze(b("p",{class:"callout success"}),Sp),new Ze(b("p",{class:"callout warning"}),bp),new Ze(b("p",{class:"callout danger"}),yp)])]),new st(6,[new v(Up),new v(zp),new v(Wp),new Oe({button:new Qr(qp,"color")},[new jr("color")]),new Oe({button:new Qr(Yp,"background-color")},[new jr("background-color")]),new v(Vp),new v(Xp),new v(Zp),new v(Gp),new v(Jp)]),new st(6,[new v(ig),new v(sg),new v(lg),new v(ag),e?new v(dg):null,e?new v(cg):null].filter(t=>t!==null)),new st(3,[new v(hg),new v(Ng),new v(xg),new v(Tg),new v(Eg)]),new st(4,[new v(ud),new Oe({button:Vm,direction:"vertical"},[new Oe({button:{label:"Insert",format:"long"},showOnHover:!0},[new Ss]),new En,new Oe({button:{label:"Cell",format:"long"},direction:"vertical",showOnHover:!0},[new v(sp),new v(lp),new v(ap)]),new Oe({button:{label:"Row",format:"long"},direction:"vertical",showOnHover:!0},[new v({...Xa,format:"long"}),new v({...Za,format:"long"}),new v({...Ga,format:"long"}),new v(Jm),new En,new v(jm),new v(Qm),new v(ep),new v(tp)]),new Oe({button:{label:"Column",format:"long"},direction:"vertical",showOnHover:!0},[new v({...Ja,format:"long"}),new v({...ja,format:"long"}),new v({...Qa,format:"long"}),new En,new v(op),new v(np),new v(rp),new v(ip)]),new En,new v({...Ya,format:"long"}),new v(Xm),new v(Zm),new v(Gm)]),new v(fd),new v(qg),new v(md),new Hs(new v(Vg),[new v(Xg)]),new v(Zg),new v(Gg)]),new st(3,[new v(Ep),new v(Tp)])])}function Qg(){return[new v(fd)]}function eh(){return[new v(ud),new v(Wg)]}function th(){return[new v(Yg)]}function oh(){return[new st(2,[new v(Ya),new v(Va)]),new st(3,[new v(Xa),new v(Za),new v(Ga)]),new st(3,[new v(Ja),new v(ja),new v(Qa)])]}var nh='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>';var Ks=class extends ne{constructor(e,t){super([new Ls(e.form)]),this.definition=e,this.key=t}show(e){let t=this.getDOMElement();document.body.append(t);let n=this.getForm();n.setValues(e),n.setOnCancel(this.hide.bind(this)),n.setOnSuccessfulSubmit(this.hide.bind(this)),this.getContext().manager.setModalActive(this.key,this)}hide(){this.getDOMElement().remove(),this.getContext().manager.setModalInactive(this.key)}getForm(){return this.children[0]}buildDOM(){let e=b("button",{class:"editor-modal-close",type:"button",title:this.trans("Close")});e.innerHTML=nh,e.addEventListener("click",this.hide.bind(this));let t=b("div",{class:"editor-modal editor-form-modal"},[b("div",{class:"editor-modal-header"},[b("div",{class:"editor-modal-title"},[this.trans(this.definition.title)]),e]),b("div",{class:"editor-modal-body"},[this.getForm().getDOMElement()])]),n=b("div",{class:"editor-modal-wrapper"},[t]);return n.addEventListener("click",r=>{r.target&&!t.contains(r.target)&&this.hide()}),n}};var Us=class extends ne{constructor(e,t){super(t),this.target=e}buildDOM(){return b("div",{class:"editor-context-toolbar"},this.getChildren().map(e=>e.getDOMElement()))}updatePosition(){let e=this.getContext().scrollDOM.getBoundingClientRect(),t=this.target.getBoundingClientRect(),n=this.getDOMElement(),r=n.getBoundingClientRect(),i=t.bottom>e.top&&t.top<e.bottom;if(n.hidden=!i,!i)return;let s=t.bottom+6+r.height>e.bottom;n.classList.toggle("is-a
`).length*19.2+18+24;n.style.height=`${l}px`;let a=Date.now();n.addEventListener("click",m=>{requestAnimationFrame(()=>{t.editor.update(()=>{$e(this.getNode())})})}),n.addEventListener("dblclick",m=>{t.editor.getEditorState().read(()=>{Jr(t.editor,this.getNode())})});let d=m=>{n.classList.toggle("selected",is(m,r))};t.manager.onSelectionChange(d),this.onDestroy(()=>{t.manager.offSelectionChange(d)});let f=m=>{this.editor=m.wysiwygView(n,document,this.latestCode,this.latestLanguage),setTimeout(()=>{n.style.height=""},12)};window.importVersioned("code").then(m=>{let c=Date.now()-a<20?20:0;setTimeout(()=>f(m),c)}),this.completedSetup=!0}update(){let t=this.getNode(),n=t.getCode(),r=t.getLanguage();this.latestCode===n&&this.latestLanguage===r||(this.latestLanguage=r,this.latestCode=n,this.editor&&(this.editor.setContent(n),this.editor.setMode(r,n)))}render(t,n){this.completedSetup?this.update():this.setup(t,n)}};var qs=class extends sr{constructor(){super(...arguments);this.completedSetup=!1}setup(t,n){let r=this.getNode();n.classList.add("editor-diagram"),n.addEventListener("click",s=>{t.editor.update(()=>{$e(this.getNode())})}),n.addEventListener("dblclick",s=>{t.editor.getEditorState().read(()=>{ai(t,this.getNode())})});let i=s=>{n.classList.toggle("selected",is(s,r))};t.manager.onSelectionChange(i),this.onDestroy(()=>{t.manager.offSelectionChange(i)}),this.completedSetup=!0}update(){}render(t,n){this.completedSetup?this.update():this.setup(t,n)}};var rh={submitText:"Save",async action(o,e){return rr(e.editor,o.get("source")?.toString()||""),!0},fields:[{label:"Source",name:"source",type:"textarea"}]};var pd={link:{title:"Insert/Edit Link",form:Ug},image:{title:"Insert/Edit Image",form:Kg},media:{title:"Insert/Edit Media",form:zg},source:{title:"Source code",form:rh},cell_properties:{title:"Cell Properties",form:Sm},row_properties:{title:"Row Properties",form:Mm},table_properties:{title:"Table Properties",form:wm}};function ih(o,e,t,n,r){let i=new zs,s={editor:n,containerDOM:o,editorDOM:e,scrollDOM:t,manager:i,translate(l){return r.translations[l]||l},error(l){let a=l instanceof Error?l.message:l;window.$events.error(a)},options:r};i.setContext(s),i.setToolbar(jg(s));for(let l of Object.keys(pd))i.registerModal(l,pd[l]);return i.registerContextToolbar("image",{selector:"img:not([drawio-diagram] img)",content:Qg()}),i.registerContextToolbar("link",{selector:"a",content:eh(),displayTargetLocator(l){return l.querySelector("img")||l}}),i.registerContextToolbar("code",{selector:".editor-code-block-wrap",content:th()}),i.registerContextToolbar("table",{selector:"td,th",content:oh(),displayTargetLocator(l){return l.closest("table")}}),i.registerDecoratorType("code",Ws),i.registerDecoratorType("diagram",qs),s}var lr=class{constructor(e,t,n){this.startX=0;this.startY=0;this.target=null;this.container=e,this.dragTargetSelector=t,this.options=n,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.container.addEventListener("mousedown",this.onMouseDown)}teardown(){this.container.removeEventListener("mousedown",this.onMouseDown),this.container.removeEventListener("mouseup",this.onMouseUp),this.container.removeEventListener("mousemove",this.onMouseMove)}onMouseDown(e){this.target=e.target.closest(this.dragTargetSelector),this.target&&(this.startX=e.screenX,this.startY=e.screenY,window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),this.options.down&&this.options.down(e,this.target))}onMouseMove(e){this.options.move&&this.target&&this.options.move(e,this.target,{x:e.screenX-this.startX,y:e.screenY-this.startY})}onMouseUp(e){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),this.options.up&&this.target&&this.options.up(e,this.target,{x:e.screenX-this.startX,y:e.screenY-this.startY})}};var gd=class{constructor(e,t){this.markerDom=null;this.mouseTracker=null;this.dragging=!1;this.targetCell=null;this.xMarkerAtStart=!1;this.yMarkerAtStart=!1;this.edi
//# sourceMappingURL=wysiwyg.js.map