UNPKG

@ckeditor/ckeditor5-real-time-collaboration

Version:

A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.

24 lines • 15.2 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x26303c=_0x47d8;(function(_0x17bd94,_0x4a35e5){const _0x349de6=_0x47d8,_0x59f0e=_0x17bd94();while(!![]){try{const _0x231522=parseInt(_0x349de6(0x1a9))/0x1+-parseInt(_0x349de6(0x14f))/0x2+-parseInt(_0x349de6(0x176))/0x3+-parseInt(_0x349de6(0x15d))/0x4+-parseInt(_0x349de6(0x17f))/0x5*(-parseInt(_0x349de6(0x15c))/0x6)+-parseInt(_0x349de6(0x152))/0x7+-parseInt(_0x349de6(0x1b1))/0x8*(-parseInt(_0x349de6(0x1ab))/0x9);if(_0x231522===_0x4a35e5)break;else _0x59f0e['push'](_0x59f0e['shift']());}catch(_0xbe2a2){_0x59f0e['push'](_0x59f0e['shift']());}}}(_0x5551,0xb63ec));import{Plugin as _0x35b850}from'ckeditor5/src/core.js';import{version as _0x172331}from'ckeditor5/src/utils.js';function _0x5551(){const _0x1d2355=['size','_fetchMissingUsers','_getLatestVersionFromServerOperations','_createCurrentRevision','toVersion','10zGDiPz','max','isConnected','cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.','isBundleUploaded','CONNECTED','revisionsUpdated','catch','sendBufferedUpdates','_handleRevisionsUpdate','remove','reverse','cloud-services-internal-error:\x20Not\x20connected.','data','_revisions','marker','diffData','authorsIds','connected','RevisionTracker','getUser','config','baseVersion','_getLatestVersion','repository','bind','_preventResendingRevisionData','_startingVersion','RevisionHistoryService','setRevisionData','connect','setSource','_update','_oldOffset','createdAt','startsWith','creatorId','_bufferedUpdates','once','listenTo','requires','cloud-services-internal-error:\x20Request\x20timeout.','367685AgvOZs','off','14121oBpNNK','_handleReconnectionError','RevisionHistory','_isPendingUpdate','_isConnected','400','15880DhpibR','change:_isConnected','addUser','getRevision','CloudServicesRevisionHistoryAdapter','then','_offset','currentRevision','connection','reconnect','from','addToReconnectionStack','buildRevisionData','_revisionHistoryService','fromVersion','getMany','map','1161622JhVHfk','getOperations','adapter','5318005sYTyfj','collaboration.channelId','wrongRequestId','code','cloudServices.bundleVersion','get','getRevisions','has','length','message','1807914AokUol','2437892SNsiHE','type','destroy','editor','init','serverHistory','_revisionTracker','isOfficialPlugin','affectsData','authors','_waitForServiceReady','pluginName','_bufferUpdate','isEnabled','addRevisionData','sessionId','isPremiumPlugin','_revisionDataBuilder','change:_isPendingUpdate','plugins','state','_lastRequestId','updateRevisions','add','isEmptyCurrent','4164939yTnWdd','keys','_fixRevision','reInit'];_0x5551=function(){return _0x1d2355;};return _0x5551();}import{Users as _0x1382a2}from'ckeditor5-collaboration/src/collaboration-core.js';import{RealTimeCollaborationClient as _0x58f7bf}from'../realtimecollaborativeediting/realtimecollaborationclient.js';import{WebSocketGateway as _0x5125b9}from'../realtimecollaborativeediting/websocketgateway.js';import{Sessions as _0x4d2843}from'../realtimecollaborativeediting/sessions.js';import{EditorService as _0x16fb5c,RevisionHistoryService as _0x39dab2,User as _0x29b6a6,WEB_SOCKET_GATEWAY_STATES as _0x559934}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';class c extends _0x35b850{static [_0x26303c(0x19b)]=/* #__PURE__ -- @preserve */ ((()=>_0x39dab2)());[_0x26303c(0x172)];[_0x26303c(0x163)];[_0x26303c(0x14b)];[_0x26303c(0x1a0)];static get[_0x26303c(0x1a7)](){const _0x51e007=_0x26303c;return[_0x5125b9,_0x58f7bf,_0x51e007(0x1ad),_0x4d2843,_0x1382a2];}static get[_0x26303c(0x168)](){const _0x50b9e4=_0x26303c;return _0x50b9e4(0x1b5);}static get[_0x26303c(0x164)](){return!0x0;}static get[_0x26303c(0x16d)](){return!0x0;}constructor(_0x43413a){const _0x33e736=_0x26303c;super(_0x43413a);const _0x12542f=this[_0x33e736(0x160)][_0x33e736(0x194)][_0x33e736(0x157)](_0x33e736(0x153));this[_0x33e736(0x172)]=null,this[_0x33e736(0x163)]=this[_0x33e736(0x160)][_0x33e736(0x170)][_0x33e736(0x157)](_0x33e736(0x192)),this[_0x33e736(0x14b)]=new c[(_0x33e736(0x19b))](_0x12542f);}async[_0x26303c(0x161)](){const _0x5276d2=_0x26303c,_0x1a1eb8=this[_0x5276d2(0x160)][_0x5276d2(0x170)][_0x5276d2(0x157)](_0x58f7bf),_0x6476b2=_0x1a1eb8[_0x5276d2(0x162)],_0x23fbe0=this[_0x5276d2(0x160)][_0x5276d2(0x170)][_0x5276d2(0x157)](_0x5125b9);this[_0x5276d2(0x163)][_0x5276d2(0x19e)]({'history':_0x6476b2,'getLatestVersion':()=>this[_0x5276d2(0x196)](),'getCurrentRevisionId':()=>_0x1a1eb8[_0x5276d2(0x16c)]});const _0x55b37e=this[_0x5276d2(0x160)][_0x5276d2(0x194)][_0x5276d2(0x157)](_0x5276d2(0x156))||_0x172331,_0x65b874=await _0x16fb5c[_0x5276d2(0x183)](_0x23fbe0[_0x5276d2(0x1b9)],_0x55b37e);this[_0x5276d2(0x160)][_0x5276d2(0x170)][_0x5276d2(0x157)](_0x5276d2(0x1ad))[_0x5276d2(0x151)]={'getRevision':async({revisionId:_0x11eb50})=>(await this[_0x5276d2(0x167)](),await this[_0x5276d2(0x14b)][_0x5276d2(0x1b4)](_0x11eb50)),'updateRevisions':async _0x1751f4=>{const _0x256410=_0x5276d2;await this[_0x256410(0x167)]();const _0x4a2ca0=this[_0x256410(0x163)][_0x256410(0x1b8)];if(_0x65b874&&0x1===_0x1751f4[_0x256410(0x15a)]&&_0x1751f4[0x0]['id']===_0x4a2ca0['id'])return _0x1751f4;for(const _0x294fcf of _0x1751f4)_0x294fcf['id']===_0x4a2ca0['id']&&(_0x294fcf[_0x256410(0x175)]=_0x294fcf[_0x256410(0x14c)]===_0x294fcf[_0x256410(0x17e)]);return this[_0x256410(0x14b)][_0x256410(0x173)](_0x1751f4,this[_0x256410(0x172)])[_0x256410(0x1b6)](_0x413769=>(this[_0x256410(0x172)]=_0x413769,_0x1751f4))[_0x256410(0x186)](_0x2200bb=>{const _0x46fcf5=_0x256410;if(q(_0x2200bb)||_0x46fcf5(0x1b0)===_0x2200bb[_0x46fcf5(0x155)]&&void 0x0!==_0x2200bb[_0x46fcf5(0x18c)][_0x46fcf5(0x154)]){for(const _0x50ed25 of _0x1751f4){!this[_0x46fcf5(0x163)][_0x46fcf5(0x197)][_0x46fcf5(0x1b4)](_0x50ed25['id'])||this[_0x46fcf5(0x163)][_0x46fcf5(0x169)](_0x50ed25['id'],_0x50ed25,!0x1);}if(q(_0x2200bb))throw _0x2200bb;return _0x1751f4;}throw _0x2200bb;});}},this[_0x5276d2(0x1a6)](this[_0x5276d2(0x14b)],_0x5276d2(0x185),(_0x515229,{revisionsData:_0x40e22c,requestId:_0x3b2f34})=>{const _0xbc9554=_0x5276d2;Math[_0xbc9554(0x180)](..._0x40e22c[_0xbc9554(0x14e)](_0x5a6f01=>_0x5a6f01[_0xbc9554(0x17e)]))>this[_0xbc9554(0x17c)]()-0x1?this[_0xbc9554(0x196)]()[_0xbc9554(0x1b6)](()=>{const _0xa9847a=_0xbc9554;this[_0xa9847a(0x188)](_0x40e22c,_0x3b2f34);}):this[_0xbc9554(0x188)](_0x40e22c,_0x3b2f34);});const {revisions:_0x57809,requestId:_0x490940}=await this[_0x5276d2(0x14b)][_0x5276d2(0x19d)](_0x23fbe0[_0x5276d2(0x1b9)]);_0x23fbe0[_0x5276d2(0x1bc)](this),this[_0x5276d2(0x172)]=_0x490940,await this[_0x5276d2(0x17b)](_0x57809);for(const _0x1c3528 of _0x57809)this[_0x5276d2(0x163)][_0x5276d2(0x16b)](_0x1c3528);this[_0x5276d2(0x1a6)](_0x1a1eb8,_0x5276d2(0x1b2),(_0x3bcaa9,_0x23c4fc,_0x445dfe)=>{const _0xc9cc16=_0x5276d2;_0x445dfe&&(this[_0xc9cc16(0x1a0)]=_0x1a1eb8[_0xc9cc16(0x1b7)],_0x3bcaa9[_0xc9cc16(0x1aa)]());}),this[_0x5276d2(0x163)][_0x5276d2(0x198)](_0x5276d2(0x16a))['to'](_0x23fbe0,_0x5276d2(0x171),_0x5b9425=>_0x5b9425===_0x559934[_0x5276d2(0x184)]);}async[_0x26303c(0x1ba)](){const _0x501a3d=_0x26303c,_0x416f4c=this[_0x501a3d(0x160)][_0x501a3d(0x170)][_0x501a3d(0x157)](_0x5125b9),_0x1cc9ca=this[_0x501a3d(0x160)][_0x501a3d(0x170)][_0x501a3d(0x157)](_0x58f7bf),_0x301fa2=async()=>{const _0x23a482=_0x501a3d,_0x36b32d=this[_0x23a482(0x163)][_0x23a482(0x1b8)],_0x139cd0=_0x36b32d['id'],_0x2cb494=_0x139cd0!==_0x1cc9ca[_0x23a482(0x16c)];if(_0x2cb494){const _0x3e33fa=_0x1cc9ca[_0x23a482(0x1b7)]-this[_0x23a482(0x1a0)],_0x4131b9=this[_0x23a482(0x17c)]();this[_0x23a482(0x163)][_0x23a482(0x16e)][_0x23a482(0x179)]();if(_0x36b32d[_0x23a482(0x17e)]+_0x3e33fa!==_0x4131b9){const _0x51cea3=_0x36b32d[_0x23a482(0x14c)]+_0x3e33fa,_0x58d46c=this[_0x23a482(0x160)][_0x23a482(0x170)][_0x23a482(0x157)](_0x1382a2),_0x79a8=this[_0x23a482(0x163)][_0x23a482(0x1bd)]({'revision':_0x36b32d,'from':_0x51cea3,'to':_0x4131b9});_0x79a8['id']=_0x36b32d['id'];const _0x4bd2dc=_0x79a8[_0x23a482(0x190)][_0x23a482(0x14e)](_0x467023=>_0x58d46c[_0x23a482(0x193)](_0x467023));_0x36b32d[_0x23a482(0x19f)]({..._0x79a8,'authors':_0x4bd2dc},!0x0),this[_0x23a482(0x163)][_0x23a482(0x169)](_0x36b32d['id'],_0x79a8,!0x0);}this[_0x23a482(0x163)][_0x23a482(0x19a)]=_0x4131b9,(_0x36b32d[_0x23a482(0x17e)]===_0x36b32d[_0x23a482(0x14c)]&&!this[_0x23a482(0x163)][_0x23a482(0x1a4)][_0x23a482(0x159)](_0x139cd0)&&this[_0x23a482(0x163)][_0x23a482(0x197)][_0x23a482(0x18d)][_0x23a482(0x189)](_0x139cd0),this[_0x23a482(0x163)][_0x23a482(0x17d)](_0x4131b9));}const {revisions:_0x4228d6,requestId:_0x105ee6}=await this[_0x23a482(0x14b)][_0x23a482(0x1ba)](_0x416f4c[_0x23a482(0x1b9)],this[_0x23a482(0x172)]);_0x2cb494&&_0x4228d6[_0x23a482(0x15a)]>0x0?_0x1cc9ca[_0x23a482(0x1ac)]():(await this[_0x23a482(0x17b)](_0x4228d6),this[_0x23a482(0x188)](_0x4228d6,_0x105ee6),this[_0x23a482(0x163)][_0x23a482(0x187)]());};return _0x1cc9ca[_0x501a3d(0x1af)]?_0x301fa2():new Promise((_0x58f42d,_0x4c6a9c)=>{const _0x3720d8=_0x501a3d;_0x1cc9ca[_0x3720d8(0x1a5)](_0x3720d8(0x1b2),()=>{const _0x1b0c87=_0x3720d8;_0x301fa2()[_0x1b0c87(0x1b6)](_0x58f42d)[_0x1b0c87(0x186)](_0x4c6a9c);});});}[_0x26303c(0x15f)](){const _0x597225=_0x26303c;super[_0x597225(0x15f)]();}async[_0x26303c(0x167)](){const _0x5e768a=_0x26303c;this[_0x5e768a(0x14b)][_0x5e768a(0x181)]||await new Promise(_0xe27eac=>{const _0x4d3a49=_0x5e768a;this[_0x4d3a49(0x1a6)](this[_0x4d3a49(0x14b)],_0x4d3a49(0x191),_0x4509e9=>{const _0x3399a5=_0x4d3a49;_0x4509e9[_0x3399a5(0x1aa)](),_0xe27eac();});});}[_0x26303c(0x17c)](){const _0x5e2d4d=_0x26303c,_0x395a8f=this[_0x5e2d4d(0x160)][_0x5e2d4d(0x170)][_0x5e2d4d(0x157)](_0x58f7bf)[_0x5e2d4d(0x162)][_0x5e2d4d(0x150)]()[_0x5e2d4d(0x18a)]();for(const _0x522373 of _0x395a8f)if(_0x5e2d4d(0x18e)!==_0x522373[_0x5e2d4d(0x15e)]||_0x522373[_0x5e2d4d(0x165)])return _0x522373[_0x5e2d4d(0x195)]+0x1;}[_0x26303c(0x196)](){const _0x41846e=_0x26303c,_0x217ff3=this[_0x41846e(0x160)][_0x41846e(0x170)][_0x41846e(0x157)](_0x58f7bf);return new Promise(_0x34bb40=>{const _0x48129c=_0x41846e;_0x217ff3[_0x48129c(0x1ae)]?_0x217ff3[_0x48129c(0x1a5)](_0x48129c(0x16f),()=>{const _0x35607c=_0x48129c;_0x34bb40(this[_0x35607c(0x17c)]());}):_0x34bb40(this[_0x48129c(0x17c)]());});}[_0x26303c(0x188)](_0x474f3d,_0x5363dc){const _0x2f6c9f=_0x26303c,_0x883814=this[_0x2f6c9f(0x163)][_0x2f6c9f(0x197)];this[_0x2f6c9f(0x172)]=_0x5363dc;for(const _0x32175a of _0x474f3d){const _0x42d587=_0x883814[_0x2f6c9f(0x1b4)](_0x32175a['id']);if(_0x42d587){if((_0x32175a[_0x2f6c9f(0x14c)]||_0x32175a[_0x2f6c9f(0x17e)])&&(_0x32175a[_0x2f6c9f(0x18f)]=null),_0x42d587===this[_0x2f6c9f(0x163)][_0x2f6c9f(0x1b8)]){const _0x33b5ec=Math[_0x2f6c9f(0x180)](_0x42d587[_0x2f6c9f(0x17e)],_0x32175a[_0x2f6c9f(0x17e)]),_0x30d0ac=Math[_0x2f6c9f(0x180)](_0x42d587[_0x2f6c9f(0x14c)],_0x32175a[_0x2f6c9f(0x14c)]);let _0x380aa1;_0x42d587[_0x2f6c9f(0x17e)]===_0x32175a[_0x2f6c9f(0x17e)]&&_0x42d587[_0x2f6c9f(0x14c)]===_0x32175a[_0x2f6c9f(0x14c)]?(_0x380aa1=!0x0,this[_0x2f6c9f(0x199)](_0x32175a)):_0x32175a[_0x2f6c9f(0x17e)]===_0x33b5ec&&_0x32175a[_0x2f6c9f(0x14c)]===_0x30d0ac?_0x380aa1=!0x1:(_0x42d587[_0x2f6c9f(0x17e)]===_0x33b5ec&&_0x42d587[_0x2f6c9f(0x14c)]===_0x30d0ac||this[_0x2f6c9f(0x178)]({'revision':_0x42d587,'from':_0x30d0ac,'to':_0x33b5ec}),_0x380aa1=!0x0),_0x380aa1&&(delete _0x32175a[_0x2f6c9f(0x14c)],delete _0x32175a[_0x2f6c9f(0x17e)],delete _0x32175a[_0x2f6c9f(0x18f)],delete _0x32175a[_0x2f6c9f(0x1a1)],delete _0x32175a[_0x2f6c9f(0x190)]);}this[_0x2f6c9f(0x163)][_0x2f6c9f(0x19c)](_0x32175a),this[_0x2f6c9f(0x199)](_0x32175a);}else this[_0x2f6c9f(0x163)][_0x2f6c9f(0x16b)](_0x32175a);}const _0x48c7fc=_0x883814[_0x2f6c9f(0x158)]();_0x48c7fc[_0x2f6c9f(0x18a)]();for(let _0x48ed86=0x0;_0x48ed86<_0x48c7fc[_0x2f6c9f(0x15a)]-0x1;_0x48ed86++){const _0x4fd348=_0x48c7fc[_0x48ed86],_0x2e44cd=_0x48c7fc[_0x48ed86+0x1];if(_0x4fd348[_0x2f6c9f(0x14c)]<_0x2e44cd[_0x2f6c9f(0x17e)]){const _0x3d23f9=_0x2e44cd[_0x2f6c9f(0x17e)],_0x12d29c=Math[_0x2f6c9f(0x180)](_0x3d23f9,_0x4fd348[_0x2f6c9f(0x17e)]);this[_0x2f6c9f(0x178)]({'revision':_0x4fd348,'from':_0x3d23f9,'to':_0x12d29c});}}}[_0x26303c(0x178)]({revision:_0x3a1d1b,from:_0x53137b,to:_0x843d1}={}){const _0x3ab9ff=_0x26303c,_0x503cd2=this[_0x3ab9ff(0x160)][_0x3ab9ff(0x170)][_0x3ab9ff(0x157)](_0x1382a2),_0xeb360d=this[_0x3ab9ff(0x163)][_0x3ab9ff(0x1bd)]({'revision':_0x3a1d1b,'from':_0x53137b,'to':_0x843d1});_0xeb360d[_0x3ab9ff(0x166)]=_0xeb360d[_0x3ab9ff(0x190)][_0x3ab9ff(0x14e)](_0x13c207=>_0x503cd2[_0x3ab9ff(0x193)](_0x13c207)),_0x3a1d1b[_0x3ab9ff(0x19f)](_0xeb360d);}[_0x26303c(0x199)](_0x5cf656){const _0x4a2f4f=_0x26303c,_0x3af78a={};_0x3af78a['id']=_0x5cf656['id'];for(const _0x2a0e90 of Object[_0x4a2f4f(0x177)](_0x5cf656))'id'!==_0x2a0e90&&(_0x3af78a[_0x2a0e90]=void 0x0);this[_0x4a2f4f(0x163)][_0x4a2f4f(0x169)](_0x3af78a['id'],_0x3af78a,!0x0);}async[_0x26303c(0x17b)](_0x5c76db){const _0x416ec4=_0x26303c,_0x198f9c=this[_0x416ec4(0x160)][_0x416ec4(0x170)][_0x416ec4(0x157)](_0x1382a2),{connection:_0x129794}=this[_0x416ec4(0x160)][_0x416ec4(0x170)][_0x416ec4(0x157)](_0x5125b9),_0x1aacdd=new Set();for(const _0x1dccb6 of _0x5c76db){for(const _0x30da8b of _0x1dccb6[_0x416ec4(0x190)])_0x3cd498(_0x30da8b);_0x1dccb6[_0x416ec4(0x1a3)]&&_0x3cd498(_0x1dccb6[_0x416ec4(0x1a3)]);}if(0x0===_0x1aacdd[_0x416ec4(0x17a)])return;const _0x1d1653=await _0x29b6a6[_0x416ec4(0x14d)](_0x129794,Array[_0x416ec4(0x1bb)](_0x1aacdd));for(const _0x52c0d3 of _0x1d1653)_0x198f9c[_0x416ec4(0x193)](_0x52c0d3['id'])||_0x198f9c[_0x416ec4(0x1b3)](_0x52c0d3);function _0x3cd498(_0xd7a5c9){const _0x5a180d=_0x416ec4;_0x198f9c[_0x5a180d(0x193)](_0xd7a5c9)||_0x1aacdd[_0x5a180d(0x174)](_0xd7a5c9);}}}function _0x47d8(_0x4031cd,_0xdac22a){const _0x5551cb=_0x5551();return _0x47d8=function(_0x47d824,_0x4a1ef7){_0x47d824=_0x47d824-0x14b;let _0x111784=_0x5551cb[_0x47d824];return _0x111784;},_0x47d8(_0x4031cd,_0xdac22a);}export{c as CloudServicesRevisionHistoryAdapter};function q(_0x2be08a){const _0x7fea0=_0x26303c;return _0x2be08a[_0x7fea0(0x15b)][_0x7fea0(0x1a2)](_0x7fea0(0x182))||_0x2be08a[_0x7fea0(0x15b)][_0x7fea0(0x1a2)](_0x7fea0(0x18b))||_0x2be08a[_0x7fea0(0x15b)][_0x7fea0(0x1a2)](_0x7fea0(0x1a8));}