0||D.length>0||C.length>0)&&s.emit("change",[{added:m,updated:D,removed:C},o]),(m.length>0||c.length>0||C.length>0)&&s.emit("update",[{added:m,updated:c,removed:C},o])},y1=s=>{const i=M0.getState(s).undoManager;if(i!=null)return i.undo(),!0},f1=s=>{const i=M0.getState(s).undoManager;if(i!=null)return i.redo(),!0},B1=new Set(["paragraph"]),Y1=(s,i)=>!(s instanceof M6)||!(s.content instanceof C6)||!(s.content.type instanceof L6||s.content.type instanceof y6&&i.has(s.content.type.nodeName))||s.content.type._length===0,F1=({protectedNodes:s=B1,trackedOrigins:i=[],undoManager:o=null}={})=>new Qr({key:M0,state:{init:(a,h)=>{const m=pt.getState(h),c=o||new g6(m.type,{trackedOrigins:new Set([pt].concat(i)),deleteFilter:D=>Y1(D,s),captureTransaction:D=>D.meta.get("addToHistory")!==!1});return{undoManager:c,prevSel:null,hasUndoOps:c.undoStack.length>0,hasRedoOps:c.redoStack.length>0}},apply:(a,h,m,c)=>{const D=pt.getState(c).binding,C=h.undoManager,p=C.undoStack.length>0,M=C.redoStack.length>0;return D?{undoManager:C,prevSel:A6(D,m),hasUndoOps:p,hasRedoOps:M}:p!==h.hasUndoOps||M!==h.hasRedoOps?Object.assign({},h,{hasUndoOps:C.undoStack.length>0,hasRedoOps:C.redoStack.length>0}):h}},view:a=>{const h=pt.getState(a.state),m=M0.getState(a.state).undoManager;return m.on("stack-item-added",({stackItem:c})=>{const D=h.binding;D&&c.meta.set(D,M0.getState(a.state).prevSel)}),m.on("stack-item-popped",({stackItem:c})=>{const D=h.binding;D&&(D.beforeTransactionSelection=c.meta.get(D)||D.beforeTransactionSelection)}),{destroy:()=>{m.destroy()}}}}),v1=Xr.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(s=>s.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:s,state:i,dispatch:o})=>(s.setMeta("preventDispatch",!0),M0.getState(i).undoManager.undoStack.length===0?!1:o?y1(i):!0),redo:()=>({tr:s,state:i,dispatch:o})=>(s.setMeta("preventDispatch",!0),M0.getState(i).undoManager.redoStack.length===0?!1:o?f1(i):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){var s;const i=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),o=F1(this.options.yUndoOptions),a=o.spec.view;o.spec.view=c=>{const{undoManager:D}=M0.getState(c.state);D.restore&&(D.restore(),D.restore=()=>{});const C=a?a(c):void 0;return{destroy:()=>{const p=D.trackedOrigins.has(D),M=D._observers;D.restore=()=>{p&&D.trackedOrigins.add(D),D.doc.on("afterTransaction",D.afterTransactionHandler),D._observers=M},C!=null&&C.destroy&&C.destroy()}}};const h={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender},m=f6(i,h);return this.editor.options.enableContentCheck&&((s=i.doc)===null||s===void 0||s.on("beforeTransaction",()=>{try{const c=B6(i);if(c.content.length===0)return;this.editor.schema.nodeFromJSON(c).check()}catch(c){return this.editor.emit("contentError",{error:c,editor:this.editor,disableCollaboration:()=>{var D;(D=i.doc)===null||D===void 0||D.destroy(),this.storage.isDisabled=!0}}),!1}})),[m,o,this.editor.options.enableContentCheck&&new Qr({key:new Y6("filterInvalidContent"),filterTransaction:()=>{var c;return this.storage.isDisabled&&((c=i.doc)===null||c===void 0||c.destroy()),!0}})].filter(Boolean)}}),k1=Xr.create({addOptions(){return{fileId:null}},addStorage(){return{started:!1}},onCreate(){if(this.options.fileId===null)throw new Error("fileId needs to be provided");this.storage.started=!0},onSelectionUpdate({editor:s}){if(!this.storage.started)return;const i=s.state.selection.$anchor.pos;sessionStorage.setItem("text-lastPos-"+this.options.fileId,i)},addCommands(){return{autofocus:()=>({commands:s,editor:i})=>{const o=sessionStorage.getItem("text-lastPos-"+this.options.fileId);return o?s.focus(o):s.focus("start")}}}});function Ia(s){const i=new Uint8Array(s);return uo(i)}function Da(s){return eo(s)}const mo=0,xt=1,Ra=2,Ea=(s,i)=>{X(s,mo);const o=to(i);C0(s,o)},ho=(s,i,o)=>{X(s,xt),C0(s,It(i,o))},T1=(s,i,o)=>ho(i,o,ja(s)),co=(s,i,o)=>{try{so(i,ja(s),o)}catch(a){console.error("Caught error while handling a Yjs update",a)}},Do=(s,i)=>{X(s,Ra),C0(s,i)},b1=co,Ui=(s,i,o,a)=>{const h=Ae(s);switch(h){case mo:T1(s,i,o);break;case xt:co(s,o,a);break;case Ra:b1(s,o,a);break;default:throw new Error("Unknown message type")}return h},Eo=new Map;class x1{constructor(i){this.room=i,this.onmessage=null,this._onChange=o=>o.key===i&&this.onmessage!==null&&this.onmessage({data:eo(o.newValue||"")}),k6(this._onChange)}postMessage(i){T6.setItem(this.room,uo(b6(i)))}close(){x6(this._onChange)}}const w1=typeof BroadcastChannel>"u"?x1:BroadcastChannel,Va=s=>F6(Eo,s,()=>{const i=v6(),o=new w1(s);return o.onmessage=a=>i.forEach(h=>h(a.data,"broadcastchannel")),{bc:o,subs:i}}),j1=(s,i)=>(Va(s).subs.add(i),i),S1=(s,i)=>{const o=Va(s),a=o.subs.delete(i);return a&&o.subs.size===0&&(o.bc.close(),Eo.delete(s)),a},me=(s,i,o=null)=>{const a=Va(s);a.bc.postMessage(i),a.subs.forEach(h=>h(i,o))},H1=0,O1=(s,i,o)=>{switch(Ae(s)){case H1:o(i,Kr(s))}},P1=s=>w6(s,(i,o)=>"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(i))).join("&"),A0=0,po=3,Me=1,I1=2,Ie=[];Ie[A0]=(s,i,o,a,h)=>{X(s,A0);const m=j6(i),c=Ui(i,s,o.doc,o);a&&((c===xt||c===Ra)&&Ui(m,du(),o.remote,o),c===xt&&!o.synced&&(o.synced=!0))},Ie[po]=(s,i,o,a,h)=>{X(s,Me),C0(s,Re(o.awareness,[o.doc.clientID]))},Ie[Me]=(s,i,o,a,h)=>{L1(o.awareness,ja(i),o)},Ie[I1]=(s,i,o,a,h)=>{O1(i,o.doc,(m,c)=>R1(o,c))};const Ji=3e4,R1=(s,i)=>console.warn("Permission denied to access ".concat(s.url,".\n").concat(i)),go=(s,i,o)=>{const a=Zr(i),h=du(),m=Ae(a),c=s.messageHandlers[m];return c?c(h,a,s,o,m):console.error("Unable to compute message"),h},Ao=s=>{if(s.shouldConnect&&s.ws===null){const i=new s._WS(s.url,s.protocols);i.binaryType="arraybuffer",s.ws=i,s.wsconnecting=!0,s.wsconnected=!1,s.synced=!1,i.onmessage=o=>{s.wsLastMessageReceived=O0();const a=go(s,new Uint8Array(o.data),!0);ao(a)>1&&i.send(ou(a))},i.onerror=o=>{s.emit("connection-error",[o,s])},i.onclose=o=>{s.emit("connection-close",[o,s]),s.ws=null,s.wsconnecting=!1,s.wsconnected?(s.wsconnected=!1,s.synced=!1,Pa(s.awareness,Array.from(s.awareness.getStates().keys()).filter(a=>a!==s.doc.clientID),s),s.emit("status",[{status:"disconnected"}])):s.wsUnsuccessfulReconnects++,setTimeout(Ao,S6(H6(2,s.wsUnsuccessfulReconnects)*100,s.maxBackoffTime),s)},i.onopen=()=>{s.wsLastMessageReceived=O0(),s.wsconnecting=!1,s.wsconnected=!0,s.wsUnsuccessfulReconnects=0,s.emit("status",[{status:"connected"}]);const o=du();if(X(o,A0),Ea(o,s.doc),i.send(ou(o)),s.awareness.getLocalState()!==null){const a=du();X(a,Me),C0(a,Re(s.awareness,[s.doc.clientID])),i.send(ou(a))}},s.emit("status",[{status:"connecting"}])}},Ns=(s,i)=>{const o=s.ws;s.wsconnected&&o&&o.readyState===o.OPEN&&o.send(i),s.bcconnected&&me(s.bcChannel,i,s)};class V1 extends Gr{constructor(i,o,a,{connect:h=!0,awareness:m=new C1(a),params:c={},protocols:D=[],WebSocketPolyfill:C=WebSocket,resyncInterval:p=-1,maxBackoffTime:M=2500,disableBc:F=!1}={}){for(super();i[i.length-1]==="/";)i=i.slice(0,i.length-1);this.serverUrl=i,this.bcChannel=i+"/"+o,this.maxBackoffTime=M,this.params=c,this.protocols=D,this.roomname=o,this.doc=a,this._WS=C,this.awareness=m,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=F,this.wsUnsuccessfulReconnects=0,this.messageHandlers=Ie.slice(),this.remote=new Sa,this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=h,this._resyncInterval=0,p>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const v=du();X(v,A0),Ea(v,a),this.ws.send(ou(v))}},p)),this._bcSubscriber=(v,B)=>{if(B!==this){const k=go(this,new Uint8Array(v),!1);ao(k)>1&&me(this.bcChannel,ou(k),this)}},this._updateHandler=(v,B,k)=>{if(B!==this){const G=to(this.remote),f=It(k,G),q=du();X(q,A0),Do(q,f),Ns(this,ou(q))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:v,updated:B,removed:k},G)=>{const f=du();X(f,Me),C0(f,Re(m,[this.doc.clientID])),Ns(this,ou(f))},this._exitHandler=()=>{Pa(this.awareness,[a.clientID],"app closed")},Ni&&typeof Ee<"u"&&Ee.on("exit",this._exitHandler),m.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&Ji 0||D.length>0||C.length>0)&&s.emit("change",[{added:m,updated:D,removed:C},o]),(m.length>0||c.length>0||C.length>0)&&s.emit("update",[{added:m,updated:c,removed:C},o])},y1=s=>{const i=M0.getState(s).undoManager;if(i!=null)return i.undo(),!0},f1=s=>{const i=M0.getState(s).undoManager;if(i!=null)return i.redo(),!0},B1=new Set(["paragraph"]),Y1=(s,i)=>!(s instanceof M6)||!(s.content instanceof C6)||!(s.content.type instanceof L6||s.content.type instanceof y6&&i.has(s.content.type.nodeName))||s.content.type._length===0,F1=({protectedNodes:s=B1,trackedOrigins:i=[],undoManager:o=null}={})=>new Qr({key:M0,state:{init:(a,h)=>{const m=pt.getState(h),c=o||new g6(m.type,{trackedOrigins:new Set([pt].concat(i)),deleteFilter:D=>Y1(D,s),captureTransaction:D=>D.meta.get("addToHistory")!==!1});return{undoManager:c,prevSel:null,hasUndoOps:c.undoStack.length>0,hasRedoOps:c.redoStack.length>0}},apply:(a,h,m,c)=>{const D=pt.getState(c).binding,C=h.undoManager,p=C.undoStack.length>0,M=C.redoStack.length>0;return D?{undoManager:C,prevSel:A6(D,m),hasUndoOps:p,hasRedoOps:M}:p!==h.hasUndoOps||M!==h.hasRedoOps?Object.assign({},h,{hasUndoOps:C.undoStack.length>0,hasRedoOps:C.redoStack.length>0}):h}},view:a=>{const h=pt.getState(a.state),m=M0.getState(a.state).undoManager;return m.on("stack-item-added",({stackItem:c})=>{const D=h.binding;D&&c.meta.set(D,M0.getState(a.state).prevSel)}),m.on("stack-item-popped",({stackItem:c})=>{const D=h.binding;D&&(D.beforeTransactionSelection=c.meta.get(D)||D.beforeTransactionSelection)}),{destroy:()=>{m.destroy()}}}}),v1=Xr.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(s=>s.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:s,state:i,dispatch:o})=>(s.setMeta("preventDispatch",!0),M0.getState(i).undoManager.undoStack.length===0?!1:o?y1(i):!0),redo:()=>({tr:s,state:i,dispatch:o})=>(s.setMeta("preventDispatch",!0),M0.getState(i).undoManager.redoStack.length===0?!1:o?f1(i):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){var s;const i=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),o=F1(this.options.yUndoOptions),a=o.spec.view;o.spec.view=c=>{const{undoManager:D}=M0.getState(c.state);D.restore&&(D.restore(),D.restore=()=>{});const C=a?a(c):void 0;return{destroy:()=>{const p=D.trackedOrigins.has(D),M=D._observers;D.restore=()=>{p&&D.trackedOrigins.add(D),D.doc.on("afterTransaction",D.afterTransactionHandler),D._observers=M},C!=null&&C.destroy&&C.destroy()}}};const h={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender},m=f6(i,h);return this.editor.options.enableContentCheck&&((s=i.doc)===null||s===void 0||s.on("beforeTransaction",()=>{try{const c=B6(i);if(c.content.length===0)return;this.editor.schema.nodeFromJSON(c).check()}catch(c){return this.editor.emit("contentError",{error:c,editor:this.editor,disableCollaboration:()=>{var D;(D=i.doc)===null||D===void 0||D.destroy(),this.storage.isDisabled=!0}}),!1}})),[m,o,this.editor.options.enableContentCheck&&new Qr({key:new Y6("filterInvalidContent"),filterTransaction:()=>{var c;return this.storage.isDisabled&&((c=i.doc)===null||c===void 0||c.destroy()),!0}})].filter(Boolean)}}),k1=Xr.create({addOptions(){return{fileId:null}},addStorage(){return{started:!1}},onCreate(){if(this.options.fileId===null)throw new Error("fileId needs to be provided");this.storage.started=!0},onSelectionUpdate({editor:s}){if(!this.storage.started)return;const i=s.state.selection.$anchor.pos;sessionStorage.setItem("text-lastPos-"+this.options.fileId,i)},addCommands(){return{autofocus:()=>({commands:s,editor:i})=>{const o=sessionStorage.getItem("text-lastPos-"+this.options.fileId);return o?s.focus(o):s.focus("start")}}}});function Ia(s){const i=new Uint8Array(s);return uo(i)}function Da(s){return eo(s)}const mo=0,xt=1,Ra=2,Ea=(s,i)=>{X(s,mo);const o=to(i);C0(s,o)},ho=(s,i,o)=>{X(s,xt),C0(s,It(i,o))},T1=(s,i,o)=>ho(i,o,ja(s)),co=(s,i,o)=>{try{so(i,ja(s),o)}catch(a){console.error("Caught error while handling a Yjs update",a)}},Do=(s,i)=>{X(s,Ra),C0(s,i)},b1=co,Ui=(s,i,o,a)=>{const h=Ae(s);switch(h){case mo:T1(s,i,o);break;case xt:co(s,o,a);break;case Ra:b1(s,o,a);break;default:throw new Error("Unknown message type")}return h},Eo=new Map;class x1{constructor(i){this.room=i,this.onmessage=null,this._onChange=o=>o.key===i&&this.onmessage!==null&&this.onmessage({data:eo(o.newValue||"")}),k6(this._onChange)}postMessage(i){T6.setItem(this.room,uo(b6(i)))}close(){x6(this._onChange)}}const w1=typeof BroadcastChannel>"u"?x1:BroadcastChannel,Va=s=>F6(Eo,s,()=>{const i=v6(),o=new w1(s);return o.onmessage=a=>i.forEach(h=>h(a.data,"broadcastchannel")),{bc:o,subs:i}}),j1=(s,i)=>(Va(s).subs.add(i),i),S1=(s,i)=>{const o=Va(s),a=o.subs.delete(i);return a&&o.subs.size===0&&(o.bc.close(),Eo.delete(s)),a},me=(s,i,o=null)=>{const a=Va(s);a.bc.postMessage(i),a.subs.forEach(h=>h(i,o))},H1=0,O1=(s,i,o)=>{switch(Ae(s)){case H1:o(i,Kr(s))}},P1=s=>w6(s,(i,o)=>"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(i))).join("&"),A0=0,po=3,Me=1,I1=2,Ie=[];Ie[A0]=(s,i,o,a,h)=>{X(s,A0);const m=j6(i),c=Ui(i,s,o.doc,o);a&&((c===xt||c===Ra)&&Ui(m,du(),o.remote,o),c===xt&&!o.synced&&(o.synced=!0))},Ie[po]=(s,i,o,a,h)=>{X(s,Me),C0(s,Re(o.awareness,[o.doc.clientID]))},Ie[Me]=(s,i,o,a,h)=>{L1(o.awareness,ja(i),o)},Ie[I1]=(s,i,o,a,h)=>{O1(i,o.doc,(m,c)=>R1(o,c))};const Ji=3e4,R1=(s,i)=>console.warn("Permission denied to access ".concat(s.url,".\n").concat(i)),go=(s,i,o)=>{const a=Zr(i),h=du(),m=Ae(a),c=s.messageHandlers[m];return c?c(h,a,s,o,m):console.error("Unable to compute message"),h},Ao=s=>{if(s.shouldConnect&&s.ws===null){const i=new s._WS(s.url,s.protocols);i.binaryType="arraybuffer",s.ws=i,s.wsconnecting=!0,s.wsconnected=!1,s.synced=!1,i.onmessage=o=>{s.wsLastMessageReceived=O0();const a=go(s,new Uint8Array(o.data),!0);ao(a)>1&&i.send(ou(a))},i.onerror=o=>{s.emit("connection-error",[o,s])},i.onclose=o=>{s.emit("connection-close",[o,s]),s.ws=null,s.wsconnecting=!1,s.wsconnected?(s.wsconnected=!1,s.synced=!1,Pa(s.awareness,Array.from(s.awareness.getStates().keys()).filter(a=>a!==s.doc.clientID),s),s.emit("status",[{status:"disconnected"}])):s.wsUnsuccessfulReconnects++,setTimeout(Ao,S6(H6(2,s.wsUnsuccessfulReconnects)*100,s.maxBackoffTime),s)},i.onopen=()=>{s.wsLastMessageReceived=O0(),s.wsconnecting=!1,s.wsconnected=!0,s.wsUnsuccessfulReconnects=0,s.emit("status",[{status:"connected"}]);const o=du();if(X(o,A0),Ea(o,s.doc),i.send(ou(o)),s.awareness.getLocalState()!==null){const a=du();X(a,Me),C0(a,Re(s.awareness,[s.doc.clientID])),i.send(ou(a))}},s.emit("status",[{status:"connecting"}])}},Ns=(s,i)=>{const o=s.ws;s.wsconnected&&o&&o.readyState===o.OPEN&&o.send(i),s.bcconnected&&me(s.bcChannel,i,s)};class V1 extends Gr{constructor(i,o,a,{connect:h=!0,awareness:m=new C1(a),params:c={},protocols:D=[],WebSocketPolyfill:C=WebSocket,resyncInterval:p=-1,maxBackoffTime:M=2500,disableBc:F=!1}={}){for(super();i[i.length-1]==="/";)i=i.slice(0,i.length-1);this.serverUrl=i,this.bcChannel=i+"/"+o,this.maxBackoffTime=M,this.params=c,this.protocols=D,this.roomname=o,this.doc=a,this._WS=C,this.awareness=m,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=F,this.wsUnsuccessfulReconnects=0,this.messageHandlers=Ie.slice(),this.remote=new Sa,this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=h,this._resyncInterval=0,p>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const v=du();X(v,A0),Ea(v,a),this.ws.send(ou(v))}},p)),this._bcSubscriber=(v,B)=>{if(B!==this){const k=go(this,new Uint8Array(v),!1);ao(k)>1&&me(this.bcChannel,ou(k),this)}},this._updateHandler=(v,B,k)=>{if(B!==this){const G=to(this.remote),f=It(k,G),q=du();X(q,A0),Do(q,f),Ns(this,ou(q))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:v,updated:B,removed:k},G)=>{const f=du();X(f,Me),C0(f,Re(m,[this.doc.clientID])),Ns(this,ou(f))},this._exitHandler=()=>{Pa(this.awareness,[a.clientID],"app closed")},Ni&&typeof Ee<"u"&&Ee.on("exit",this._exitHandler),m.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&Ji \n\t\t\t\t{{ syncError.data.data.error }}\n\t\t\t\t\n\t\t\t\t{{ t('text', 'Reload') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Document has been changed outside of the editor. The changes cannot be applied') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Document could not be loaded. Please check your internet connection.') }}\n\t\t\t\t{{ t('text', 'Reconnect') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Document idle for {timeout} minutes, click to continue editing', { timeout: IDLE_TIMEOUT }) }}\n\t\t\t\t{{ t('text', 'Reconnect') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'This file is opened read-only as it is currently locked by {user}.', { user: lock.displayName }) }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Last saved') }}: {{ lastSavedString }}\n\t\t\t \n\t\t\t\t{{ syncError.data.data.error }}\n\t\t\t\t\n\t\t\t\t{{ t('text', 'Reload') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Document has been changed outside of the editor. The changes cannot be applied') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Document could not be loaded. Please check your internet connection.') }}\n\t\t\t\t{{ t('text', 'Reconnect') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Document idle for {timeout} minutes, click to continue editing', { timeout: IDLE_TIMEOUT }) }}\n\t\t\t\t{{ t('text', 'Reconnect') }}\n\t\t\t \n\t\t\t\t{{ t('text', 'This file is opened read-only as it is currently locked by {user}.', { user: lock.displayName }) }}\n\t\t\t \n\t\t\t\t{{ t('text', 'Last saved') }}: {{ lastSavedString }}\n\t\t\t".concat(zi(s),"
");this.$editor.chain().setContent(a,o).command(({tr:h})=>(h.setMeta("addToHistory",o),!0)).run()},setInitialYjsState(s,{isRichEditor:i}){const o=i?bt.render(s)+"":"".concat(zi(s),"
"),a=i?bo():xo(),h=U6(o,a.options.extensions),m=J6.fromJSON(a.schema,h),c=It((D=>{const C=new Sa;C.clientID=0;const p=C.get("default",G6);return p.doc&&q6(D,p),C})(m));so(this.$ydoc,c)}}},kc={name:"CollisionResolveDialog",components:{NcButton:wa},mixins:[io,ih,wo,ro],props:{syncError:{type:Object,default:null}},data(){return{clicked:!1}},methods:{resolveThisVersion(){this.clicked=!0,this.$syncService.forceSave().then(()=>this.$syncService.syncUp()),this.$editor.setEditable(!this.readOnly)},resolveServerVersion(){const{outsideChange:s}=this.syncError.data;this.clicked=!0,this.$editor.setEditable(!this.readOnly),this.setContent(s,{isRichEditor:this.$isRichEditor}),this.$syncService.forceSave().then(()=>this.$syncService.syncUp())}}};var Tc=function(){var s=this,i=s._self._c;return i("div",{staticClass:"collision-resolve-dialog",class:{"icon-loading":s.clicked},attrs:{id:"resolve-conflicts"}},[i("NcButton",{attrs:{disabled:s.clicked,"data-cy":"resolveThisVersion"},on:{click:s.resolveThisVersion}},[s._v(" "+s._s(s.t("text","Use current version"))+" ")]),i("NcButton",{attrs:{disabled:s.clicked,"data-cy":"resolveServerVersion"},on:{click:s.resolveServerVersion}},[s._v(" "+s._s(s.t("text","Use the saved version"))+" ")])],1)},bc=[],xc=tu(kc,Tc,bc,!1,null,"8ab72257");const wc=xc.exports,jc={name:"DocumentStatus",components:{CollisionResolveDialog:wc,Lock:M1,NcNoteCard:n1},props:{idle:{type:Boolean,require:!0},lock:{type:Object,default:null},syncError:{type:Object,default:null},hasConnectionIssue:{type:Boolean,require:!0},isResolvingConflict:{type:Boolean,require:!0}},data(){return{IDLE_TIMEOUT:Na}},computed:{hasSyncCollission(){return this.syncError&&this.syncError.type===$.SAVE_COLLISSION},isLoadingError(){return this.syncError&&this.syncError.type===$.LOAD_ERROR},hasWarning(){return this.syncError||this.hasConnectionIssue}},methods:{reconnect(){this.$emit("reconnect")},reload(){window.location.reload()}}};var Sc=function(){var s=this,i=s._self._c;return i("div",{staticClass:"document-status"},[s.hasWarning?i("NcNoteCard",{attrs:{type:"warning"}},[s.isLoadingError?i("p",[s._v(" "+s._s(s.syncError.data.data.error)+" "),s.syncError.data.status===412?i("a",{staticClass:"button primary",on:{click:s.reload}},[s._v(s._s(s.t("text","Reload")))]):s._e()]):s.hasSyncCollission?i("p",[s._v(" "+s._s(s.t("text","Document has been changed outside of the editor. The changes cannot be applied"))+" ")]):s.hasConnectionIssue?i("p",[s._v(" "+s._s(s.t("text","Document could not be loaded. Please check your internet connection."))+" "),i("a",{staticClass:"button primary",on:{click:s.reconnect}},[s._v(s._s(s.t("text","Reconnect")))])]):s._e()]):s.idle?i("NcNoteCard",{attrs:{type:"info"}},[i("p",[s._v(" "+s._s(s.t("text","Document idle for {timeout} minutes, click to continue editing",{timeout:s.IDLE_TIMEOUT}))+" "),i("a",{staticClass:"button primary",on:{click:s.reconnect}},[s._v(s._s(s.t("text","Reconnect")))])])]):s._e(),s.lock?i("NcNoteCard",{attrs:{type:"info"},scopedSlots:s._u([{key:"icon",fn:function(){return[i("Lock",{attrs:{size:20}})]},proxy:!0}],null,!1,326953187)},[i("p",[s._v(" "+s._s(s.t("text","This file is opened read-only as it is currently locked by {user}.",{user:s.lock.displayName}))+" ")])]):s._e(),s.isResolvingConflict?i("CollisionResolveDialog",{attrs:{"sync-error":s.syncError}}):s._e()],1)},Hc=[],Oc=tu(jc,Sc,Hc,!1,null,"64a8995a");const Pc=Oc.exports,Ic=()=>document.documentElement.clientWidth,Ki=()=>Ic()<768,Rc={data(){return{isMobile:Ki()}},beforeMount(){this.$onResize=lo(()=>{this.isMobile=Ki()},100),window.addEventListener("resize",this.$onResize)},beforeDestroy(){window.removeEventListener("resize",this.$onResize)}};function Vc(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jo={exports:{}};(function(s,i){(function(o,a){s.exports=a()})(g0,function(){var o;function a(){return o.apply(null,arguments)}function h(u){o=u}function m(u){return u instanceof Array||Object.prototype.toString.call(u)==="[object Array]"}function c(u){return u!=null&&Object.prototype.toString.call(u)==="[object Object]"}function D(u,e){return Object.prototype.hasOwnProperty.call(u,e)}function C(u){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(u).length===0;var e;for(e in u)if(D(u,e))return!1;return!0}function p(u){return u===void 0}function M(u){return typeof u=="number"||Object.prototype.toString.call(u)==="[object Number]"}function F(u){return u instanceof Date||Object.prototype.toString.call(u)==="[object Date]"}function v(u,e){var n=[],r,d=u.length;for(r=0;r".concat(zi(s),"
");this.$editor.chain().setContent(a,o).command(({tr:h})=>(h.setMeta("addToHistory",o),!0)).run()},setInitialYjsState(s,{isRichEditor:i}){const o=i?bt.render(s)+"":"".concat(zi(s),"
"),a=i?bo():xo(),h=U6(o,a.options.extensions),m=J6.fromJSON(a.schema,h),c=It((D=>{const C=new Sa;C.clientID=0;const p=C.get("default",G6);return p.doc&&q6(D,p),C})(m));so(this.$ydoc,c)}}},kc={name:"CollisionResolveDialog",components:{NcButton:wa},mixins:[io,ih,wo,ro],props:{syncError:{type:Object,default:null}},data(){return{clicked:!1}},methods:{resolveThisVersion(){this.clicked=!0,this.$syncService.forceSave().then(()=>this.$syncService.syncUp()),this.$editor.setEditable(!this.readOnly)},resolveServerVersion(){const{outsideChange:s}=this.syncError.data;this.clicked=!0,this.$editor.setEditable(!this.readOnly),this.setContent(s,{isRichEditor:this.$isRichEditor}),this.$syncService.forceSave().then(()=>this.$syncService.syncUp())}}};var Tc=function(){var s=this,i=s._self._c;return i("div",{staticClass:"collision-resolve-dialog",class:{"icon-loading":s.clicked},attrs:{id:"resolve-conflicts"}},[i("NcButton",{attrs:{disabled:s.clicked,"data-cy":"resolveThisVersion"},on:{click:s.resolveThisVersion}},[s._v(" "+s._s(s.t("text","Use current version"))+" ")]),i("NcButton",{attrs:{disabled:s.clicked,"data-cy":"resolveServerVersion"},on:{click:s.resolveServerVersion}},[s._v(" "+s._s(s.t("text","Use the saved version"))+" ")])],1)},bc=[],xc=tu(kc,Tc,bc,!1,null,"8ab72257");const wc=xc.exports,jc={name:"DocumentStatus",components:{CollisionResolveDialog:wc,Lock:M1,NcNoteCard:n1},props:{idle:{type:Boolean,require:!0},lock:{type:Object,default:null},syncError:{type:Object,default:null},hasConnectionIssue:{type:Boolean,require:!0},isResolvingConflict:{type:Boolean,require:!0}},data(){return{IDLE_TIMEOUT:Na}},computed:{hasSyncCollission(){return this.syncError&&this.syncError.type===$.SAVE_COLLISSION},isLoadingError(){return this.syncError&&this.syncError.type===$.LOAD_ERROR},hasWarning(){return this.syncError||this.hasConnectionIssue}},methods:{reconnect(){this.$emit("reconnect")},reload(){window.location.reload()}}};var Sc=function(){var s=this,i=s._self._c;return i("div",{staticClass:"document-status"},[s.hasWarning?i("NcNoteCard",{attrs:{type:"warning"}},[s.isLoadingError?i("p",[s._v(" "+s._s(s.syncError.data.data.error)+" "),s.syncError.data.status===412?i("a",{staticClass:"button primary",on:{click:s.reload}},[s._v(s._s(s.t("text","Reload")))]):s._e()]):s.hasSyncCollission?i("p",[s._v(" "+s._s(s.t("text","Document has been changed outside of the editor. The changes cannot be applied"))+" ")]):s.hasConnectionIssue?i("p",[s._v(" "+s._s(s.t("text","Document could not be loaded. Please check your internet connection."))+" "),i("a",{staticClass:"button primary",on:{click:s.reconnect}},[s._v(s._s(s.t("text","Reconnect")))])]):s._e()]):s.idle?i("NcNoteCard",{attrs:{type:"info"}},[i("p",[s._v(" "+s._s(s.t("text","Document idle for {timeout} minutes, click to continue editing",{timeout:s.IDLE_TIMEOUT}))+" "),i("a",{staticClass:"button primary",on:{click:s.reconnect}},[s._v(s._s(s.t("text","Reconnect")))])])]):s._e(),s.lock?i("NcNoteCard",{attrs:{type:"info"},scopedSlots:s._u([{key:"icon",fn:function(){return[i("Lock",{attrs:{size:20}})]},proxy:!0}],null,!1,326953187)},[i("p",[s._v(" "+s._s(s.t("text","This file is opened read-only as it is currently locked by {user}.",{user:s.lock.displayName}))+" ")])]):s._e(),s.isResolvingConflict?i("CollisionResolveDialog",{attrs:{"sync-error":s.syncError}}):s._e()],1)},Hc=[],Oc=tu(jc,Sc,Hc,!1,null,"64a8995a");const Pc=Oc.exports,Ic=()=>document.documentElement.clientWidth,Ki=()=>Ic()<768,Rc={data(){return{isMobile:Ki()}},beforeMount(){this.$onResize=lo(()=>{this.isMobile=Ki()},100),window.addEventListener("resize",this.$onResize)},beforeDestroy(){window.removeEventListener("resize",this.$onResize)}};function Vc(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jo={exports:{}};(function(s,i){(function(o,a){s.exports=a()})(g0,function(){var o;function a(){return o.apply(null,arguments)}function h(u){o=u}function m(u){return u instanceof Array||Object.prototype.toString.call(u)==="[object Array]"}function c(u){return u!=null&&Object.prototype.toString.call(u)==="[object Object]"}function D(u,e){return Object.prototype.hasOwnProperty.call(u,e)}function C(u){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(u).length===0;var e;for(e in u)if(D(u,e))return!1;return!0}function p(u){return u===void 0}function M(u){return typeof u=="number"||Object.prototype.toString.call(u)==="[object Number]"}function F(u){return u instanceof Date||Object.prototype.toString.call(u)==="[object Date]"}function v(u,e){var n=[],r,d=u.length;for(r=0;r${escapeHtml(content)}
`\n\t\t\tthis.$editor.chain()\n\t\t\t\t.setContent(html, addToHistory)\n\t\t\t\t.command(({ tr }) => {\n\t\t\t\t\ttr.setMeta('addToHistory', addToHistory)\n\t\t\t\t\treturn true\n\t\t\t\t})\n\t\t\t\t.run()\n\t\t},\n\n\t\tsetInitialYjsState(content, { isRichEditor }) {\n\t\t\tconst html = isRichEditor\n\t\t\t\t? markdownit.render(content) + ''\n\t\t\t\t: `${escapeHtml(content)}
`\n\n\t\t\tconst editor = isRichEditor\n\t\t\t\t? createRichEditor()\n\t\t\t\t: createPlainEditor()\n\n\t\t\tconst json = generateJSON(html, editor.options.extensions)\n\n\t\t\tconst doc = Node.fromJSON(editor.schema, json)\n\t\t\tconst getBaseDoc = (doc) => {\n\t\t\t\tconst ydoc = new Doc()\n\t\t\t\t// In order to make the initial document state idempotent, we need to reset the clientID\n\t\t\t\t// While this is not recommended, we cannot avoid it here as we lack another mechanism\n\t\t\t\t// to generate the initial state on the server side\n\t\t\t\t// The only other option to avoid this could be to generate the initial state once and push\n\t\t\t\t// it to the server immediately, however this would require read only sessions to be able\n\t\t\t\t// to still push a state\n\t\t\t\tydoc.clientID = 0\n\t\t\t\tconst type = /** @type {XmlFragment} */ (ydoc.get('default', XmlFragment))\n\t\t\t\tif (!type.doc) {\n\t\t\t\t\t// This should not happen but is aligned with the upstream implementation\n\t\t\t\t\t// https://github.com/yjs/y-prosemirror/blob/8db24263770c2baaccb08e08ea9ef92dbcf8a9da/src/lib.js#L209\n\t\t\t\t\treturn ydoc\n\t\t\t\t}\n\n\t\t\t\tprosemirrorToYXmlFragment(doc, type)\n\t\t\t\treturn ydoc\n\t\t\t}\n\n\t\t\tconst baseUpdate = encodeStateAsUpdate(getBaseDoc(doc))\n\t\t\tapplyUpdate(this.$ydoc, baseUpdate)\n\t\t},\n\t},\n}\n","\n\n\n\t\n\t\t\t\t
\n\t\t\n\t 0\">\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t 0\">\n\t\t\t\t\t
\n\t\t\t{{ t('text', 'Translate') }}
\n\t\t\t{{ t('text', 'To translate individual parts of the text, select it before using the translate function.') }}\n\t\t\t${escapeHtml(content)}
`\n\t\t\tthis.$editor.chain()\n\t\t\t\t.setContent(html, addToHistory)\n\t\t\t\t.command(({ tr }) => {\n\t\t\t\t\ttr.setMeta('addToHistory', addToHistory)\n\t\t\t\t\treturn true\n\t\t\t\t})\n\t\t\t\t.run()\n\t\t},\n\n\t\tsetInitialYjsState(content, { isRichEditor }) {\n\t\t\tconst html = isRichEditor\n\t\t\t\t? markdownit.render(content) + ''\n\t\t\t\t: `${escapeHtml(content)}
`\n\n\t\t\tconst editor = isRichEditor\n\t\t\t\t? createRichEditor()\n\t\t\t\t: createPlainEditor()\n\n\t\t\tconst json = generateJSON(html, editor.options.extensions)\n\n\t\t\tconst doc = Node.fromJSON(editor.schema, json)\n\t\t\tconst getBaseDoc = (doc) => {\n\t\t\t\tconst ydoc = new Doc()\n\t\t\t\t// In order to make the initial document state idempotent, we need to reset the clientID\n\t\t\t\t// While this is not recommended, we cannot avoid it here as we lack another mechanism\n\t\t\t\t// to generate the initial state on the server side\n\t\t\t\t// The only other option to avoid this could be to generate the initial state once and push\n\t\t\t\t// it to the server immediately, however this would require read only sessions to be able\n\t\t\t\t// to still push a state\n\t\t\t\tydoc.clientID = 0\n\t\t\t\tconst type = /** @type {XmlFragment} */ (ydoc.get('default', XmlFragment))\n\t\t\t\tif (!type.doc) {\n\t\t\t\t\t// This should not happen but is aligned with the upstream implementation\n\t\t\t\t\t// https://github.com/yjs/y-prosemirror/blob/8db24263770c2baaccb08e08ea9ef92dbcf8a9da/src/lib.js#L209\n\t\t\t\t\treturn ydoc\n\t\t\t\t}\n\n\t\t\t\tprosemirrorToYXmlFragment(doc, type)\n\t\t\t\treturn ydoc\n\t\t\t}\n\n\t\t\tconst baseUpdate = encodeStateAsUpdate(getBaseDoc(doc))\n\t\t\tapplyUpdate(this.$ydoc, baseUpdate)\n\t\t},\n\t},\n}\n","\n\n\n\t\n\t\t\t\t
\n\t\t\n\t 0\">\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t 0\">\n\t\t\t\t\t
\n\t\t\t{{ t('text', 'Translate') }}
\n\t\t\t{{ t('text', 'To translate individual parts of the text, select it before using the translate function.') }}\n\t\t\t=i?this.right.slice(n-i,r-i):this.left.slice(n,i).append(this.right.slice(0,r-i))},t.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new t(r,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(u),k=u;const Z=500;class m{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,h,d=[],c=[];return this.items.forEach((l,p)=>{if(!l.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,c.push(l);return}if(i){c.push(new g(l.map));let f=l.step.map(i.slice(o)),y;f&&s.maybeStep(f).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],d.push(new g(y,void 0,void 0,d.length+c.length))),o--,y&&i.appendMap(y,o)}else s.maybeStep(l.step);if(l.selection)return a=i?l.selection.map(i.slice(o)):l.selection,h=new m(this.items.slice(0,r).append(c.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:h,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,h=!i&&a.length?a.get(a.length-1):null;for(let c=0;cZ&&(l=l.compress(this.items.length-r.length)),l}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let h=s.step.map(n.slice(r)),d=h&&h.getMap();if(r--,d&&n.appendMap(d,r),h){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let l=new g(d.invert(),h,c),p,f=i.length-1;(p=i.length&&i[f].merge(l))?i[f]=p:i.push(l)}}else s.map&&r--},this.items.length,0),new m(k.from(i.reverse()),o)}}m.empty=new m(k.empty,0);function tt(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class g{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new g(n.getMap().invert(),n,this.selection)}}}class v{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const et=20;function nt(e,t,n,r){let i=n.getMeta(w),o;if(i)return i.historyState;n.getMeta(ot)&&(e=new v(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(w))return s.getMeta(w).redo?new v(e.done.addTransform(n,void 0,r,M(t)),e.undone,T(n.mapping.maps),e.prevTime,e.prevComposition):new v(e.done,e.undone.addTransform(n,void 0,r,M(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),h=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!rt(n,e.prevRanges)),d=s?I(e.prevRanges,n.mapping):T(n.mapping.maps);return new v(e.done.addTransform(n,h?t.selection.getBookmark():void 0,r,M(t)),m.empty,d,n.time,a!=null?a:e.prevComposition)}else return(o=n.getMeta("rebased"))?new v(e.done.rebased(n,o),e.undone.rebased(n,o),I(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new v(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),I(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function rt(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=i?this.right.slice(n-i,r-i):this.left.slice(n,i).append(this.right.slice(0,r-i))},t.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new t(r,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(u),k=u;const Z=500;class m{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,h,d=[],c=[];return this.items.forEach((l,p)=>{if(!l.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,c.push(l);return}if(i){c.push(new g(l.map));let f=l.step.map(i.slice(o)),y;f&&s.maybeStep(f).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],d.push(new g(y,void 0,void 0,d.length+c.length))),o--,y&&i.appendMap(y,o)}else s.maybeStep(l.step);if(l.selection)return a=i?l.selection.map(i.slice(o)):l.selection,h=new m(this.items.slice(0,r).append(c.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:h,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,h=!i&&a.length?a.get(a.length-1):null;for(let c=0;cZ&&(l=l.compress(this.items.length-r.length)),l}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let h=s.step.map(n.slice(r)),d=h&&h.getMap();if(r--,d&&n.appendMap(d,r),h){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let l=new g(d.invert(),h,c),p,f=i.length-1;(p=i.length&&i[f].merge(l))?i[f]=p:i.push(l)}}else s.map&&r--},this.items.length,0),new m(k.from(i.reverse()),o)}}m.empty=new m(k.empty,0);function tt(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class g{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new g(n.getMap().invert(),n,this.selection)}}}class v{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const et=20;function nt(e,t,n,r){let i=n.getMeta(w),o;if(i)return i.historyState;n.getMeta(ot)&&(e=new v(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(w))return s.getMeta(w).redo?new v(e.done.addTransform(n,void 0,r,M(t)),e.undone,T(n.mapping.maps),e.prevTime,e.prevComposition):new v(e.done,e.undone.addTransform(n,void 0,r,M(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),h=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!rt(n,e.prevRanges)),d=s?I(e.prevRanges,n.mapping):T(n.mapping.maps);return new v(e.done.addTransform(n,h?t.selection.getBookmark():void 0,r,M(t)),m.empty,d,n.time,a!=null?a:e.prevComposition)}else return(o=n.getMeta("rebased"))?new v(e.done.rebased(n,o),e.undone.rebased(n,o),I(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new v(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),I(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function rt(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o"+s(e)+"
"},extensions:()=>[r,n]},props:{content:{type:String,required:!0}}};var i=function(){var e=this,t=e._self._c;return t("BaseReader",{attrs:{content:e.content}})},c=[],m=o(p,i,c,!1,null,null);const u=m.exports;export{u as P};
+import{P as r,C as n}from"./RichText-DVZrSIIc.chunk.mjs";import{n as o,e as s}from"./_plugin-vue2_normalizer-BK4l00Gr.chunk.mjs";import{B as a}from"./BaseReader-DcYqK5yo.chunk.mjs";const p={name:"PlainTextReader",components:{BaseReader:a},provide:{renderHtml(e){return""+s(e)+"
"},extensions:()=>[r,n]},props:{content:{type:String,required:!0}}};var i=function(){var e=this,t=e._self._c;return t("BaseReader",{attrs:{content:e.content}})},c=[],m=o(p,i,c,!1,null,null);const u=m.exports;export{u as P};
diff --git a/js/PlainTextReader-Dnaz3Vmd.chunk.mjs.license b/js/PlainTextReader-ImuwrvNO.chunk.mjs.license
similarity index 100%
rename from js/PlainTextReader-Dnaz3Vmd.chunk.mjs.license
rename to js/PlainTextReader-ImuwrvNO.chunk.mjs.license
diff --git a/js/PlainTextReader-Dnaz3Vmd.chunk.mjs.map b/js/PlainTextReader-ImuwrvNO.chunk.mjs.map
similarity index 94%
rename from js/PlainTextReader-Dnaz3Vmd.chunk.mjs.map
rename to js/PlainTextReader-ImuwrvNO.chunk.mjs.map
index 8c620f21731..757be876e0a 100644
--- a/js/PlainTextReader-Dnaz3Vmd.chunk.mjs.map
+++ b/js/PlainTextReader-ImuwrvNO.chunk.mjs.map
@@ -1 +1 @@
-{"version":3,"file":"PlainTextReader-Dnaz3Vmd.chunk.mjs","sources":["../src/components/PlainTextReader.vue"],"sourcesContent":["\n\n\n\tr.type.name)));this.content.forEach(r=>r.check())}toJSON(){let n={type:this.type.name};for(let r in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(r=>r.toJSON())),n}static fromJSON(n,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let i;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=r.marks.map(n.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(r.text,i)}let o=B.fromJSON(n,r.content),s=n.nodeType(r.type).create(r.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};Br.prototype.text=void 0;class ba extends Br{constructor(n,r,i,o){if(super(n,r,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$m(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,r){return this.text.slice(n,r)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new ba(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new ba(this.type,this.attrs,n,this.marks)}cut(n=0,r=this.text.length){return n==0&&r==this.text.length?this:this.withText(this.text.slice(n,r))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function $m(e,n){for(let r=e.length-1;r>=0;r--)n=e[r].type.name+"("+n+")";return n}class Hr{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,r){let i=new jw(n,r);if(i.next==null)return Hr.empty;let o=Hm(i);i.next&&i.err("Unexpected trailing text");let s=Jw(Zw(o));return Xw(s,i),s}matchType(n){for(let r=0;r