@ckeditor/ckeditor5-real-time-collaboration 45.2.0-alpha.5 → 45.2.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x211f06,Plugin as _0x486528,PendingActions as _0x6d09d3,Context as _0x4a720a}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x3dd157,CKEditorError as _0x8096d1,Collection as _0x2352b1,global as _0x4088ca,version as ht,uid as _0x5d1ca4,KeystrokeHandler as _0xf61f50}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x30c50d,View as _0x4dc61c,ListView as _0x234a9c,ListItemView as lt,LabelView as pt,BalloonPanelView as _0x4ffbc1,clickOutsideHandler as _0x44ee83,BodyCollection as _0x30d9f0}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ft,History as _0x58a725,NoOperation as _0x20d737,InsertOperation as _0xe81088,MarkerOperation as _0x3efc82,RootAttributeOperation as _0x3b127c,transformSets as _0x4c0930,OperationFactory as _0x1aa629}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as mt,WEB_SOCKET_GATEWAY_STATES as _0x35869f,CollaborativeEditingService as _0x2dfe59,User as gt,CommentsService as _0x2f39ac,TrackChangesService as at,RevisionHistoryService as nt,EditorService as ot}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x323468,UserView as ut}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x30c0a5}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x332f96}from'es-toolkit/compat';class c extends _0x211f06{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>mt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x30c50d];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2730ed){super(_0x2730ed),this['set']('state',_0x35869f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x3dd157);}['init'](){const _0x26943=this['context'],_0x5d47e3=_0x26943['plugins']['get']('CloudServices'),_0x5d52be=_0x26943['plugins']['get'](_0x30c50d);if(!_0x5d47e3['token'])throw new _0x8096d1('websocketgateway-missing-token',this);if(!_0x5d47e3['webSocketUrl'])throw new _0x8096d1('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x5d47e3['token'],_0x5d47e3['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2f2c52=>{if(this['connection']=_0x2f2c52,this['bind']('state')['to'](_0x2f2c52,'state',this,'_isBrowserOffline',(_0x5a6306,_0x31b5e5)=>('connected'!==_0x5a6306&&(this['_shouldPluginsReconnect']=!0x0),_0x31b5e5||_0x5a6306!==_0x35869f['CONNECTED']?_0x35869f['DISCONNECTED']:this['state']==_0x35869f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x35869f['CONNECTING']):_0x35869f['CONNECTED'])),this['connection']['on']('error',(_0x4ab810,_0x3afe2b)=>{if('limitExceeded'!==_0x3afe2b['code'])throw console['error'](_0x3afe2b),new _0x8096d1('cloudservices-init',null,{'originalError':_0x3afe2b});_0x5d52be['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x2f2c52['me'])return new Promise(_0x4e7920=>_0x2f2c52['on']('change:me',_0x4e7920));})['catch'](_0x11c92e=>{throw console['error'](_0x11c92e),new _0x8096d1('cloudservices-init',null,{'originalError':_0x11c92e});});}['addToReconnectionStack'](_0x5334cc){if('function'!=typeof _0x5334cc['reconnect'])throw new _0x8096d1('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5334cc))throw new _0x8096d1('websocketgateway-plugin-already-registered',this,{'name':_0x5334cc['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5334cc);}['removeFromReconnectionStack'](_0xfaa7c6){this['_reconnectionStack']['delete'](_0xfaa7c6);}['isInReconnectionStack'](_0x17bd14){return this['_reconnectionStack']['has'](_0x17bd14);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x3435d4=>_0x3435d4['reconnect']())))['then'](()=>this['state']=_0x35869f['CONNECTED'])['catch'](_0x3681fc=>{throw console['error'](_0x3681fc),new _0x8096d1('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x35869f['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x211f06{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x323468];}constructor(_0x53943c){super(_0x53943c),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2352b1(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x323468);}['init'](){const _0x10aa32=this['context']['plugins']['get'](c);this['listenTo'](_0x10aa32,'change:state',(_0x5c85bb,_0x4fd45c,_0x288e57)=>{if('connected'!==_0x288e57)this['channelSessions']['forEach'](_0x388eac=>_0x388eac['clear']()),this['channelConnectedUsers']['forEach'](_0x345023=>_0x345023['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x18ea6c,_0xd93f30]of this['_registeredSessions'])for(const _0x3ada2a of _0xd93f30)this['_handleSessionAdd'](_0x18ea6c,_0x3ada2a);}}),this['_createUser'](_0x10aa32['connection']['me'],!0x0);}['register'](_0x33741b,_0x152ca8){if(this['_registeredSessions']['has'](_0x33741b))throw new _0x8096d1('sessions-register-already-registered',null,{'channelId':_0x33741b});this['_registeredSessions']['set'](_0x33741b,_0x152ca8),this['channelSessions']['set'](_0x33741b,new _0x2352b1()),this['channelConnectedUsers']['set'](_0x33741b,new _0x2352b1()),this['listenTo'](_0x152ca8,'add',(_0xbdbbe3,_0x76ea54)=>this['_handleSessionAdd'](_0x33741b,_0x76ea54)),this['listenTo'](_0x152ca8,'remove',(_0x556ec6,_0x4fbaac)=>this['_handleSessionRemove'](_0x33741b,_0x4fbaac));for(const _0x3e854b of _0x152ca8)this['_handleSessionAdd'](_0x33741b,_0x3e854b);}['unregister'](_0x38a9c3){if(!this['_registeredSessions']['has'](_0x38a9c3))throw new _0x8096d1('sessions-unregister-not-exist',null,{'channelId':_0x38a9c3});const _0x4e2d8e=this['_registeredSessions']['get'](_0x38a9c3);this['stopListening'](_0x4e2d8e);for(const _0x4d4655 of _0x4e2d8e)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x38a9c3,_0x4d4655);this['_registeredSessions']['delete'](_0x38a9c3),this['channelSessions']['delete'](_0x38a9c3),this['channelConnectedUsers']['delete'](_0x38a9c3);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0xbd367e){for(const _0x5d9ecd of this['channelSessions']['values']())for(const _0x17bc3f of _0x5d9ecd)if(_0x17bc3f['id']===_0xbd367e)return _0x17bc3f['user'];}['getUserSessions'](_0x6c038,_0x4a424f){const _0x3e6954=_0x4a424f?[this['channelSessions']['get'](_0x4a424f)]:this['channelSessions']['values'](),_0x56a3d0=new Set();for(const _0x1196e8 of _0x3e6954)for(const _0x30b3fe of _0x1196e8)_0x30b3fe['user']['id']===_0x6c038['id']&&_0x56a3d0['add'](_0x30b3fe['id']);return _0x56a3d0;}['getUserRole'](_0x1e6d8f){for(const _0x114d2f of this['channelSessions']['values']())for(const _0x378105 of _0x114d2f)if(_0x378105['user']===_0x1e6d8f)return _0x378105['role'];}['_handleSessionAdd'](_0x3580c9,_0x5a00c6){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x261833=_0x5a00c6['user'],_0x1cbb92=this['_users']['getUser'](_0x261833['id'])||this['_createUser'](_0x261833),_0x2fce6d=Object['assign']({},_0x5a00c6,{'user':_0x1cbb92});this['channelSessions']['get'](_0x3580c9)['add'](_0x2fce6d);const _0x47fd9f=this['channelConnectedUsers']['get'](_0x3580c9);_0x47fd9f['has'](_0x1cbb92['id'])||_0x47fd9f['add'](_0x1cbb92),this['allConnectedUsers']['has'](_0x1cbb92['id'])||this['allConnectedUsers']['add'](_0x1cbb92,_0x1cbb92['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3580c9,{'channelId':_0x3580c9,'session':_0x2fce6d});}['_handleSessionRemove'](_0x5f2abd,_0x965f10){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x3573f7=this['channelConnectedUsers']['get'](_0x5f2abd),_0x2533ff=_0x965f10['user'];_0x2533ff['id']&&(this['channelSessions']['get'](_0x5f2abd)['remove'](_0x965f10['id']),_0x3573f7['has'](_0x2533ff['id'])&&!this['getUserSessions'](_0x2533ff,_0x5f2abd)['size']&&_0x3573f7['remove'](_0x2533ff['id']),this['allConnectedUsers']['get'](_0x2533ff['id'])&&!this['getUserSessions'](_0x2533ff)['size']&&this['allConnectedUsers']['remove'](_0x2533ff['id']));}['_createUser'](_0x70942b,_0x9cc3d3){const _0x1f2ed5=this['_users']['addUser'](_0x70942b);return _0x9cc3d3&&this['_users']['defineMe'](_0x70942b['id']),_0x1f2ed5['orderNumber']=this['_uniqueUsersCount']++,_0x1f2ed5;}}class I extends _0x486528{['_domEmitter']=new(_0x3dd157())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4a1a96=this['editor'],_0x276d7d=_0x4a1a96['plugins']['get'](i);_0x4a1a96['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4c3b7d,{writer:_0x127232})=>function(_0x5accb3,_0x39bd84,_0x151342,_0x44949c){const _0x4e4212=_0x5accb3['markerName']['split'](':')[0x2],_0x12d95d=_0x151342['getUserBySessionId'](_0x4e4212);if(!_0x12d95d||_0x4e4212===_0x151342['mySessionId'])return;if(!_0x44949c['model']['schema']['checkChild'](_0x5accb3['markerRange']['start'],'$text'))return;const _0x5d25e3={'class':'ck-user__marker\x20'+_0x12d95d['color']['getMarkerClass'](),'data-name':_0x12d95d['name'],'data-session-id':_0x4e4212},_0x5c231d=_0x44949c['model']['markers']['get'](_0x5accb3['markerName']),_0x329bbf=_0x5c231d['getStart'](),_0xa0e72b=_0x329bbf['nodeAfter'],_0x15c70a=_0x44949c['model']['schema'];if(_0xa0e72b&&_0x15c70a['isObject'](_0xa0e72b)&&_0x15c70a['isInline'](_0xa0e72b)&&!_0x44949c['model']['markers']['get']('user:range:'+_0x4e4212)['getRange']()['isCollapsed'])return;const _0x209641=_0x329bbf['parent'];return _0x44949c['model']['schema']['isLimit'](_0x209641)&&!_0x44949c['model']['hasContent'](_0x209641)&&(_0x5d25e3['contenteditable']=!0x1),function(_0x64862a,_0x46bca5,_0x195ee2){const _0x42e7a4=_0x64862a['createUIElement']('span',_0x46bca5);return _0x64862a['setCustomProperty']('userPositionMarker',!0x0,_0x42e7a4),_0x42e7a4['render']=function(_0x31d593){const _0x4fc078=this['toDomElement'](_0x31d593),_0x1efa6f=document['createElement']('span');return _0x1efa6f['classList']['add']('ck-user__marker-tooltip'),_0x1efa6f['setAttribute']('contenteditable','false'),_0x1efa6f['setAttribute']('spellcheck','false'),_0x1efa6f['textContent']=_0x195ee2['name'],_0x4fc078['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x1efa6f['outerHTML']+'⁠',_0x4fc078['addEventListener']('mouseenter',()=>{_0x4fc078['classList']['add']('ck-user__marker_hovered');}),_0x4fc078['addEventListener']('mouseleave',()=>{_0x4fc078['classList']['remove']('ck-user__marker_hovered');}),_0x4fc078;},_0x42e7a4['isSimilar']=function(_0x38ed35){return!(!this['getCustomProperty']('userPositionMarker')||!_0x38ed35['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x38ed35['getAttribute']('data-session-id'));},_0x42e7a4;}(_0x39bd84,_0x5d25e3,_0x12d95d);}(_0x4c3b7d,_0x127232,_0x276d7d,_0x4a1a96)}),_0x4a1a96['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x6c044a=>function(_0x34a64f,_0x6a5820){const _0x565761=_0x34a64f['markerName']['split'](':')[0x2];if(_0x565761===_0x6a5820['mySessionId'])return null;const _0x3f1636=_0x6a5820['getUserBySessionId'](_0x565761);if(!_0x3f1636)return{'id':_0x565761,'classes':[]};return{'id':_0x565761,'classes':['ck-user__selection',_0x3f1636['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x565761},'priority':0x7d0+_0x3f1636['orderNumber']};}(_0x6c044a,_0x276d7d)}),function(_0x5c0e35){const _0x153d53=_0x5c0e35['model'],_0x135e9b=new Map(),_0x77cdb8=_0x5c0e35['plugins']['get'](i);_0x153d53['markers']['on']('update:user:range',(_0x4760fb,_0x4fd221,_0x36d8e2,_0x19fd30)=>{if(!_0x19fd30&&_0x135e9b['get'](_0x4fd221['name']))return _0x135e9b['get'](_0x4fd221['name'])['detach'](),void _0x135e9b['delete'](_0x4fd221['name']);const _0x86760f=_0x4fd221['name']['split'](':')[0x2];if(_0x86760f===_0x77cdb8['mySessionId'])return;const _0x2c30d9='user:position:'+_0x86760f;_0x153d53['markers']['has'](_0x2c30d9)&&_0x5c0e35['editing']['reconvertMarker'](_0x2c30d9),_0x4fd221['on']('change:range',(_0xc06f85,_0x33b62a,_0x48c867)=>{if('$graveyard'!=_0x33b62a['root']['rootName']&&'$graveyard'==_0x4fd221['getRange']()['root']['rootName']&&!_0x135e9b['has'](_0x4fd221['name'])){const _0x107933=_0x153d53['schema']['getNearestSelectionRange'](_0x48c867['deletionPosition']);if(_0x107933){const _0x52b4ac=ft['fromRange'](_0x107933);_0x135e9b['set'](_0x4fd221['name'],_0x52b4ac),_0x52b4ac['on']('change:range',(_0x131dc9,_0x4b4f0c,_0xcc662)=>{if('$graveyard'==_0x52b4ac['root']['rootName']){const _0x1319f9=_0x153d53['schema']['getNearestSelectionRange'](_0xcc662['deletionPosition']);_0x1319f9?(_0x52b4ac['start']=_0x1319f9['start'],_0x52b4ac['end']=_0x1319f9['end']):(_0x135e9b['delete'](_0x4fd221['name']),_0x52b4ac['detach']());}});}}});}),_0x153d53['document']['on']('change',()=>{_0x135e9b['size']>0x0&&_0x153d53['enqueueChange']({'isUndoable':!0x1},_0x4b0e74=>{for(const [_0x34e37e,_0x57edbf]of _0x135e9b)'$graveyard'==_0x153d53['markers']['get'](_0x34e37e)['getRange']()['root']['rootName']&&(L(_0x34e37e['split'](':')[0x2],_0x57edbf['toRange'](),_0x153d53,_0x4b0e74),_0x57edbf['detach']());_0x135e9b['clear']();});});}(_0x4a1a96),this['_domEmitter']['listenTo'](_0x4088ca['document'],'keydown',(_0x2653ed,{key:_0x106537})=>{'Escape'===_0x106537&&function(_0x267d03){_0x267d03['editing']['view']['change'](_0x458741=>{for(const _0x25a540 of _0x267d03['model']['markers']){if(!_0x25a540['name']['startsWith']('user:position'))continue;const _0x3d1d82=_0x267d03['editing']['mapper']['markerNameToElements'](_0x25a540['name']);if(_0x3d1d82){for(const _0x9bddea of _0x3d1d82)_0x458741['removeClass']('ck-user__marker_hovered',_0x9bddea);}}});}(_0x4a1a96);},{'useCapture':!0x0});}['afterInit'](){const _0x59f57a=this['editor'],_0x5ab806=_0x59f57a['commands']['get']('undo');_0x5ab806&&_0x59f57a['model']['on']('applyOperation',(_0x27ab74,_0xc192a0)=>{const _0x4c3ba6=_0xc192a0[0x0];if(!_0x4c3ba6['isDocumentOperation'])return;if('marker'!=_0x4c3ba6['type']||!_0x4c3ba6['name']['startsWith']('user:'))return;const _0x5de6ad=_0x4c3ba6['batch'];_0x5ab806['_createdBatches']['has'](_0x5de6ad)&&(_0x4c3ba6['newRange']=_0x4c3ba6['oldRange']?_0x59f57a['model']['createRange'](_0x4c3ba6['oldRange']['start'],_0x4c3ba6['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x44570e=this['editor'],_0x14130f=_0x44570e['model']['document'],_0x3571fb=_0x44570e['plugins']['get'](i);_0x44570e['model']['enqueueChange']({'isUndoable':!0x1},_0x68124=>{const _0x2ab93e='user:range:'+_0x3571fb['mySessionId'],_0x18a52b='user:position:'+_0x3571fb['mySessionId'],_0x4098e1=_0x44570e['model']['markers']['has'](_0x2ab93e);_0x44570e['editing']['view']['hasDomSelection']?L(_0x3571fb['mySessionId'],_0x14130f['selection']['getFirstRange'](),_0x44570e['model'],_0x68124):_0x4098e1&&(_0x68124['removeMarker'](_0x2ab93e),_0x68124['removeMarker'](_0x18a52b));});}}function L(_0x335e68,_0x4a27a8,_0x1d79b4,_0x26910f){const _0x5e8d4c='user:range:'+_0x335e68,_0x43e2ef='user:position:'+_0x335e68,_0x345797=_0x4a27a8['getContainedElement']();let _0x55f6f0=_0x4a27a8['start'];if(_0x345797&&_0x345797['is']('element','tableCell')){const _0x5d2d76=function(_0x2d2daa,_0x1d7825){for(const _0x265d33 of _0x2d2daa['getPositions']())if(_0x1d7825['schema']['checkChild'](_0x265d33,'$text'))return _0x265d33;}(_0x4a27a8,_0x1d79b4);_0x5d2d76&&(_0x55f6f0=_0x5d2d76,_0x4a27a8=_0x26910f['createRange'](_0x55f6f0));}const _0x464d49=_0x26910f['createRange'](_0x55f6f0);_0x1d79b4['markers']['has'](_0x5e8d4c)?(_0x26910f['updateMarker'](_0x5e8d4c,{'range':_0x4a27a8}),_0x26910f['updateMarker'](_0x43e2ef,{'range':_0x464d49})):(_0x26910f['addMarker'](_0x5e8d4c,{'range':_0x4a27a8,'usingOperation':!0x0}),_0x26910f['addMarker'](_0x43e2ef,{'range':_0x464d49,'usingOperation':!0x0}));}function R(_0x227b2c,_0x1bfd95,_0x344591){const _0x135678=_0x227b2c['t'],t=_0x227b2c['t'];switch(_0x1bfd95){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0x135678({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x344591);default:return'';}}let C=0x1;class l extends _0x486528{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x2dfe59)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,I,_0x6d09d3,_0x323468,_0x30c50d];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x2c8018=this['serverHistory']['getOperations']();for(let _0xc90d6f=_0x2c8018['length']-0x1;_0xc90d6f>=0x0;_0xc90d6f--){const _0x3d13b9=_0x2c8018[_0xc90d6f];if(!this['_disconnectionOperations']['has'](_0x3d13b9))return _0x3d13b9['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1bb218){if(super(_0x1bb218),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x58a725(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x8096d1('collaboration-missing-channelid',this);const _0x35cfac=_0x1bb218['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x35cfac,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x30c0a5(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new B(this['_disconnectionOperations']);}['init'](){const _0x242a6d=this['editor'],_0x118aab=_0x242a6d['plugins']['get'](_0x323468),_0x3ef908=_0x242a6d['plugins']['get'](c);this['listenTo'](_0x118aab,'getOperationAuthor',(_0x44522d,_0x5e2ff1)=>{const _0x1fee10=_0x5e2ff1[0x0];_0x1fee10['_authorId']&&(_0x44522d['return']=_0x118aab['getUser'](_0x1fee10['_authorId']),_0x44522d['stop']()),null===_0x1fee10['_authorId']&&(_0x44522d['return']=null,_0x44522d['stop']());},{'priority':'high'}),this['listenTo'](_0x242a6d['model']['document']['selection'],'change:range',(_0x186f39,_0x55fa2b)=>{_0x55fa2b['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x242a6d['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x242a6d['model']['on']('applyOperation',(_0x1c48a1,_0x6ec0e3)=>{const _0x5b1126=_0x6ec0e3[0x0];_0x5b1126['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5b1126),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3ef908,'state',this,'_hasSynchronizationProblem',(_0xee8797,_0xea70d2)=>'connected'===_0xee8797&&!_0xea70d2),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x242a6d['disableReadOnlyMode']('rtc-offline'):_0x242a6d['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x242a6d['disableReadOnlyMode']('rtc-offline'):_0x242a6d['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1c3240=this['editor']['plugins']['get'](i),_0x20607a=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x1c3240['unregister'](this['_channelId']);const _0x18200b=await this['_service']['reconnect'](_0x20607a['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x18200b)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x43762b=await this['_service']['getConnectedSessions']();_0x1c3240['register'](this['_channelId'],_0x43762b),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x22923b){if(function(_0x3213bb){return'404'===_0x3213bb['code'];}(_0x22923b)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5ee504){return'409'===_0x5ee504['code'];}(_0x22923b)){const _0x2d793d=R(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x2d793d);}else{if(!(_0x22923b instanceof E))throw _0x22923b;this['_handleReconnectionError']();}}}}['destroy'](){const _0x24883e=this['editor']['plugins']['get'](c),_0x2335fc=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2335fc['channelSessions']['has'](this['_channelId'])&&_0x2335fc['unregister'](this['_channelId']),_0x24883e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x7622b){if(this['sessionId']!==_0x7622b['sessionId']&&this['_lastSyncedOperationId']!==_0x7622b['lastOperationId'])throw new E();return this['sessionId']=_0x7622b['sessionId'],this['_handleServerResponse']([],{..._0x7622b,'wereChangesApplied':!0x1,'data':_0x7622b['data']},'reconnect');}async['_connectService'](_0x2cbdcd,_0x51cc6d=!0x1){const {connection:_0x2a3d5f}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2a3d5f,this['_channelId'])['then'](_0x532376=>this['_initSessionsHandling'](_0x532376))['catch'](_0x2e203b=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x2e203b);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x1a8bfd,_0x41bd5a)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x41bd5a);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3d8e92=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2cbdcd);this['_isPendingUpdate']=!0x0;const _0x3377d9=await this['_service']['connect'](_0x2a3d5f,this['_compressOperations'](_0x2cbdcd),_0x3d8e92);if(this['sessionId']=_0x3377d9['sessionId'],_0x51cc6d){if(!_0x3377d9['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3377d9['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2cbdcd,_0x3377d9,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3377d9,_0x2cbdcd);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x54382f=this['editor']['plugins']['get'](i),_0x36134e=this['editor']['plugins']['get'](I),_0xa67c26=_0x54382f['channelSessions']['get'](this['_channelId']);_0xa67c26&&_0xa67c26['length']>0x1?_0x36134e['createUserMarkerOperations']():this['listenTo'](_0x54382f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x54382f['channelSessions']['get'](this['_channelId'])['length']&&_0x36134e['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x1d35be,_0x2affb4,_0x4f3f37,_0x1f0389){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2affb4){const _0x2fbd0c=this['_decompressOperations'](_0x4f3f37,_0x1f0389);await this['_fetchMissingUsers'](_0x2fbd0c),this['_handleExternalOperations'](_0x2fbd0c,_0x2affb4,_0x4f3f37['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x596974}=this['editor'];let _0x943058;try{_0x943058=await this['_service']['getDocumentDetails']();}catch{const _0x560b3a=R(_0x596974,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x560b3a);}const _0x34553f=_0x943058['currentDocumentSession']||_0x943058['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x34553f['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x513d95=R(_0x596974,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x513d95);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x160d1c){const _0x1df6e2=this['editor']['plugins']['get'](i);this['listenTo'](_0x1df6e2,'sessionAdd:'+this['_channelId'],(_0x5a0468,{session:_0x593757})=>{if(_0x593757['id']===_0x1df6e2['mySessionId']){_0x5a0468['off']();const _0xfdc051=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x265bcd=_0x593757['permissions'];_0xfdc051&&_0xfdc051['isEnabled']&&(_0x265bcd=_0x265bcd['filter'](_0x25eec0=>'document:write'!==_0x25eec0)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x265bcd,this['_channelId']);}}),_0x1df6e2['register'](this['_channelId'],_0x160d1c);}['_initThrowingOnDataSet'](){const _0x2529e5=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x340dce)=>{if(!_0x340dce[_0x340dce['length']-0x1]['suppressErrorInCollaboration'])throw new _0x8096d1('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2529e5['apply'](this['editor']['data'],_0x340dce);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x3e207f,[_0x29847e])=>{if(this['_document']['version'])throw new _0x8096d1('realtimecollaborationclient-init-document-already-initialized',this);_0x3e207f['stop'](),this['_setPendingAction']();const _0x59d2d8=this['editor']['config']['get']('rootsAttributes'),_0x12c0e4=this['_getOperationsFromInitData'](_0x29847e,_0x59d2d8);0x0==_0x12c0e4['length']&&_0x12c0e4['push'](new _0x20d737(0x0)),_0x3e207f['return']=this['_connectService'](_0x12c0e4)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4e63c7=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4e63c7))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x175151,[_0x17a20a,_0x20e4ac])=>{_0x175151['stop']();const _0x268621=this['editor']['model']['document']['getRoot'](_0x17a20a);if(!this['_knownRootNames']['has'](_0x17a20a)){const _0x13423e=_0x20e4ac&&_0x20e4ac['data']?_0x20e4ac['data']:'',_0x249cbf=_0x20e4ac&&_0x20e4ac['attributes']?_0x20e4ac['attributes']:{};await this['_loadRoot'](_0x17a20a,_0x13423e,_0x249cbf);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x268621['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x268621);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x73dc7){const _0xa4bd1e=this['editor']['plugins']['get'](_0x323468),{connection:_0xcbf359}=this['editor']['plugins']['get'](c),_0x56d485=new Set();for(const _0x2b5fb3 of _0x73dc7){const _0xc6a4c=_0x2b5fb3['_authorId'];_0xc6a4c&&!_0xa4bd1e['getUser'](_0xc6a4c)&&_0x56d485['add'](_0xc6a4c);}if(0x0===_0x56d485['size'])return;const _0x3dcc1e=await gt['getMany'](_0xcbf359,Array['from'](_0x56d485));for(const _0x18ea6d of _0x3dcc1e)_0xa4bd1e['getUser'](_0x18ea6d['id'])||_0xa4bd1e['addUser'](_0x18ea6d);}['_getOperationsFromInitData'](_0x41dc89,_0x2c233e={}){const _0x19df4e=this['editor']['model'],_0x31ee55=[];let _0x1eb141=0x0;const _0x37cc92='string'==typeof _0x41dc89?{'main':_0x41dc89}:_0x41dc89;for(const _0x560080 of Object['keys'](_0x37cc92)){if(!this['_document']['roots']['has'](_0x560080))throw new _0x8096d1('realtimecollaborationclient-init-non-existent-root',this);const _0x1cda1e=this['editor']['data']['parse'](_0x37cc92[_0x560080]),_0x5b2e48=this['_document']['getRoot'](_0x560080),_0x35c0e0=new _0xe81088(_0x19df4e['createPositionAt'](_0x5b2e48,0x0),_0x1cda1e,_0x1eb141++);_0x31ee55['push'](_0x35c0e0);for(const [_0x141a2e,_0x206c3f]of _0x1cda1e['markers']){const _0x1995fb=_0x19df4e['createRange'](_0x19df4e['createPositionFromPath'](_0x5b2e48,_0x206c3f['start']['path']['slice']()),_0x19df4e['createPositionFromPath'](_0x5b2e48,_0x206c3f['end']['path']['slice']())),_0x156cf1=new _0x3efc82(_0x141a2e,null,_0x1995fb,_0x19df4e['markers'],!0x0,_0x1eb141++);_0x31ee55['push'](_0x156cf1);}}if(_0x2c233e)for(const [_0x59b2fd,_0x1dc528]of Object['entries'](_0x2c233e)){const _0x19e29b=_0x19df4e['document']['getRoot'](_0x59b2fd);if(!_0x19e29b)throw new _0x8096d1('multi-root-editor-root-attributes-no-root',null);for(const [_0x1d4060,_0x518be0]of Object['entries'](_0x1dc528))if(null!==_0x518be0){const _0x53c60d=new _0x3b127c(_0x19e29b,_0x1d4060,null,_0x518be0,_0x1eb141++);_0x31ee55['push'](_0x53c60d);}}return _0x31ee55;}async['_loadRoot'](_0x1eee4,_0x3a15a5,_0x24e18e){this['_getOperationsFromInitData']({[_0x1eee4]:_0x3a15a5},{[_0x1eee4]:_0x24e18e})['forEach']((_0x5b9d12,_0x4db2f5)=>{_0x5b9d12['baseVersion']=this['_document']['version']+_0x4db2f5,_0x5b9d12['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x5b9d12);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x17f7d9,_0x4d9f86){let _0x14979a;this['_offset']=_0x17f7d9['offset'];const _0x225aa8=_0x17f7d9['wereChangesApplied']&&!_0x17f7d9['initData'],_0x4f5888=_0x225aa8?0x0:_0x17f7d9['data']['baseVersion'];if(_0x4d9f86['forEach'](_0xe9e04=>{_0xe9e04['_isInit']=!0x0,_0xe9e04['createdAt']=_0x17f7d9['sessionCreatedAt'],_0xe9e04['_authorId']=null;}),_0x225aa8)_0x14979a=_0x4d9f86,this['_applyOperationsSet'](_0x14979a,_0x225aa8);else{if(_0x17f7d9['initData']){const _0x5d0cf2=this['_getOperationsFromInitData'](_0x17f7d9['initData']);this['_document']['history']['version']=-_0x5d0cf2['length'],_0x5d0cf2['forEach'](_0x50dcd6=>{_0x50dcd6['baseVersion']-=_0x5d0cf2['length'],_0x50dcd6['createdAt']=_0x17f7d9['sessionCreatedAt'],_0x50dcd6['_isInit']=!0x0,_0x50dcd6['_authorId']=null;}),this['_applyOperationsSet'](_0x5d0cf2,!0x0),this['serverHistory']['version']=-_0x5d0cf2['length']+this['_offset'],this['_updateServerHistory'](_0x5d0cf2);}this['_document']['history']['version']=_0x4f5888,_0x14979a=this['_decompressOperations'](_0x17f7d9['data'],_0x17f7d9['metadata']),await this['_fetchMissingUsers'](_0x14979a),this['_applyOperationsSet'](_0x14979a,_0x225aa8);}_0x17f7d9['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x14979a,_0x17f7d9['lastOperationId']),this['_lastSyncedOperationId']=_0x17f7d9['lastOperationId']),this['serverHistory']['version']=_0x4f5888+this['_offset'],this['_updateServerHistory'](_0x14979a),_0x4d9f86['filter'](_0x90e212=>{const _0x231411=this['_getAffectedRoot'](_0x90e212);return _0x231411&&!this['_knownRootNames']['has'](_0x231411);})['forEach']((_0x4c9a85,_0x3914b4)=>{_0x4c9a85['baseVersion']=this['_document']['version']+_0x3914b4,this['_saveOperationInBuffer'](_0x4c9a85);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x51a6c1,_0x2eff2a){const _0x83808c=_0x2eff2a&&_0x2eff2a['message'];if(_0x83808c&&_0x83808c['startsWith']('realtimecollaborationclient'))throw _0x2eff2a;const _0x47857f=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x47857f['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x8096d1(_0x51a6c1,this['editor'],_0x83808c?{'originalError':_0x83808c}:void 0x0);}['_saveOperationInBuffer'](_0x3ae9bd){this['_knownOperations']['has'](_0x3ae9bd)||(this['_knownOperations']['add'](_0x3ae9bd),this['_bufferedOperations']['push'](_0x3ae9bd),this['_pendingAction']||'marker'==_0x3ae9bd['type']&&!_0x3ae9bd['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x99e899=!0x1){!_0x99e899&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x268172=>{_0x268172&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3c6d7a=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5168b0){return _0x5168b0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5168b0['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5168b0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3c6d7a)||this['_crash'](_0x3c6d7a['message'],_0x3c6d7a);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2d7a66=>{this['on']('change:_isPendingUpdate',()=>{_0x2d7a66();});});}async['_sendBufferedOperations'](){const _0x1a1122=this['editor']['plugins']['get'](I);if(this['_shouldSendSelectionUpdate']()&&(_0x1a1122['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3fa629=[...this['_bufferedOperations']];for(const _0x4a5c9a of _0x3fa629)_0x4a5c9a['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4a5c9a);const _0x3bff7d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3fa629),_0x51faf0=C++,_0x53a4c7=this['_compressOperations'](_0x3fa629),_0x5c748d=await this['_service']['sendOperations'](_0x53a4c7,_0x53a4c7['baseVersion'],_0x3bff7d);try{return await this['_handleServerResponse'](_0x3fa629,_0x5c748d,_0x51faf0);}catch(_0x50df67){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x50df67);}}async['_handleServerResponse'](_0x35dfaa,_0x155a2d,_0x346194){if('error'in _0x155a2d)throw _0x155a2d['error'];let _0x102bb0=!0x1;if(_0x155a2d['wereChangesApplied']){_0x155a2d['lastOperationId']&&(this['_lastSyncedOperationId']=_0x155a2d['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xe3c3cd=>!_0x35dfaa['includes'](_0xe3c3cd));for(const _0x224889 of _0x35dfaa)_0x224889['createdAt']='lastOperationAcceptedAt'in _0x155a2d&&_0x155a2d['lastOperationAcceptedAt']||void 0x0;N(_0x35dfaa,_0x155a2d['version']-_0x35dfaa['length']),this['_updateServerHistory'](_0x35dfaa);const _0x2e5393=_0x35dfaa['filter'](_0x358f79=>{if(!_0x358f79['_isInit'])return!0x1;const _0x3cd1eb=this['_getAffectedRoot'](_0x358f79);return _0x3cd1eb&&!this['_knownRootNames']['has'](_0x3cd1eb);});N(_0x2e5393,this['_document']['version']),this['_applyOperationsSet'](_0x2e5393),_0x102bb0=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1467aa=this['_decompressOperations'](_0x155a2d['data'],_0x155a2d['metadata'])['filter'](_0x3bbb3d=>_0x3bbb3d['baseVersion']>=this['_lastServerVersion']);_0x1467aa['forEach'](_0xe91820=>this['_addKnownRoot'](_0xe91820)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x54152a=>!_0x54152a['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x54152a))),this['_bufferedOperations']['length']&&N(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1467aa),_0x102bb0=this['_handleExternalOperations'](_0x1467aa,_0x155a2d['version'],_0x155a2d['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x102bb0?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x4dc855,_0x3826ec,_0x4986f4){try{const _0x3fc92d={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x327853,operationsB:_0x3dd8e8,originalOperations:_0x45718c}=_0x4c0930(_0x4dc855,this['_bufferedOperations'],_0x3fc92d);N(_0x327853,this['_document']['version']),N(_0x3dd8e8,_0x3826ec);for(const _0x5c9adb of _0x327853){const _0x236069=_0x45718c['get'](_0x5c9adb);_0x5c9adb['_authorId']=_0x236069?_0x236069['_authorId']:null;}_0x4986f4&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4dc855,_0x4986f4),this['_lastSyncedOperationId']=_0x4986f4),this['_bufferedOperations']=[..._0x3dd8e8],this['_applyOperationsSet'](_0x327853),this['_updateServerHistory'](_0x4dc855);}catch(_0x19f06a){return console['error'](_0x19f06a),!0x1;}return!0x0;}['_applyOperationsSet'](_0xe5dc8,_0x251916=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5555bc=>{for(const _0x5ab340 of _0xe5dc8)this['_knownOperations']['add'](_0x5ab340),this['_addKnownRoot'](_0x5ab340),_0x5555bc['batch']['addOperation'](_0x5ab340),this['editor']['model']['applyOperation'](_0x5ab340);});}['_addKnownRoot'](_0x1e23c3){const _0x3dde3b=this['_getAffectedRoot'](_0x1e23c3);_0x3dde3b&&this['_knownRootNames']['add'](_0x3dde3b);}['_getAffectedRoot'](_0x2bb6bd){let _0x2bd45c,_0x4c53fe;switch(_0x2bb6bd['type']){case'insert':_0x2bd45c=_0x2bb6bd['position']['root'];break;case'marker':if(_0x4c53fe=_0x2bb6bd['newRange'],!_0x4c53fe)return null;_0x2bd45c=_0x4c53fe['root'];break;case'addRootAttribute':_0x2bd45c=_0x2bb6bd['root'];break;case'addRoot':_0x2bd45c=_0x2bb6bd['affectedSelectable'];break;case'move':_0x2bd45c=_0x2bb6bd['targetPosition']['root'];break;default:return null;}return _0x2bd45c['rootName'];}['_updateServerHistory'](_0x28bd28){_0x28bd28['forEach'](_0x503e2c=>{const _0x58b4ea=_0x503e2c['clone']();_0x58b4ea['_authorId']=_0x503e2c['_authorId'],_0x58b4ea['_isInit']=!!_0x503e2c['_isInit'],_0x58b4ea['createdAt']=_0x503e2c['createdAt'],_0x58b4ea['baseVersion']+=this['_offset'],_0x503e2c['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x58b4ea),this['serverHistory']['addOperation'](_0x58b4ea);});}['_handleReconnectionError'](_0x38f0f8){const _0x126190=this['editor']['plugins']['get']('Notification'),_0xf3c396=this['editor']['locale'];_0x38f0f8||(_0x38f0f8=R(_0xf3c396,'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x126190['showWarning'](_0x38f0f8,{'title':R(_0xf3c396,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x6d09d3)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x6d09d3)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x290185){const _0x3ea6c3=_0x290185['map'](_0x483af2=>_0x483af2['toJSON']());return this['_compressor']['compress'](_0x3ea6c3);}['_decompressOperations'](_0x1c3260,_0x477ce2){return this['_compressor']['decompress'](_0x1c3260)['map']((_0x1ca2c4,_0x1b8adf)=>{const _0x5d5ba3='init'==_0x477ce2[_0x1b8adf]['type'];if('InsertOperation'==_0x1ca2c4['__className']){const _0x64c180=_0x1ca2c4['position']['root'];!this['_document']['getRoot'](_0x64c180)&&(this['_document']['createRoot']('$root',_0x64c180)['_isAttached']=!0x1);}const _0x22879a=_0x1aa629['fromJSON'](_0x1ca2c4,this['_document']);return _0x22879a['wasUndone']=_0x1ca2c4['wasUndone'],_0x22879a['_isInit']=_0x5d5ba3,_0x22879a['_authorId']=_0x5d5ba3?null:_0x477ce2[_0x1b8adf]['userId'],_0x22879a['_isDisconnection']='cs:removeUser'===_0x477ce2[_0x1b8adf]['type'],_0x22879a['createdAt']=_0x477ce2[_0x1b8adf]['createdAt'],_0x22879a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x115cee=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x115cee&&_0x115cee['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class E extends Error{}function N(_0x2bfa0b,_0x5e0eca){for(const _0x240eab of _0x2bfa0b)_0x240eab['baseVersion']=_0x5e0eca++;}class B{['_ignoredOperations'];['_operationToId'];constructor(_0x158280){this['_ignoredOperations']=_0x158280,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x75c0c7){let _0x209dce=_0x75c0c7['length'];for(;_0x209dce--;){const _0x5626b4=_0x75c0c7[_0x209dce];if(!this['_ignoredOperations']['has'](_0x5626b4)){if(!this['_operationToId']['has'](_0x5626b4)){const _0x5123a6=_0x5d1ca4()['slice'](0x1,0x12);this['_operationToId']['set'](_0x5626b4,_0x5123a6);}return this['_operationToId']['get'](_0x5626b4);}}}['setIdForTheLastOperation'](_0x1e4a0d,_0x1db141){if(!_0x1db141)return;let _0x23562f=_0x1e4a0d['length'];for(;_0x23562f--;){const _0x312400=_0x1e4a0d[_0x23562f];this['_ignoredOperations']['has'](_0x312400)||this['_operationToId']['set'](_0x312400,_0x1db141);}}}class n extends _0x486528{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x211f06{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x2f39ac)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x323468];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5ea200){super(_0x5ea200),this['_services']=new Map();}async['init'](){const _0xafeba7=this['context'],_0x4822ff=_0xafeba7['plugins']['get']('CommentsRepository');if(_0xafeba7['plugins']['get'](c)['addToReconnectionStack'](this),_0x4822ff['adapter']={'addCommentThread':async({channelId:_0x55c527,threadId:_0x552e0c,comments:_0x3c1ba4,resolvedAt:_0x1a2bce,resolvedBy:_0x2922ac,context:_0x24aae3,attributes:_0x224382})=>{const _0x39ed0a=await this['_getService'](_0x55c527)['addCommentThread']({'commentThreadId':_0x552e0c,'comments':_0x3c1ba4['map'](_0xa15a79=>function(_0x5ee7b8,_0x143407,_0x264a45){return{'commentThreadId':_0x264a45,'commentId':_0x5ee7b8['commentId'],'userId':_0x5ee7b8['authorId'],'content':_0x5ee7b8['content'],'documentId':_0x143407,'createdAt':_0x5ee7b8['createdAt'],'attributes':_0x5ee7b8['attributes']||{}};}(_0xa15a79,_0x55c527,_0x552e0c)),'resolvedAt':_0x1a2bce,'resolvedBy':_0x2922ac,'context':_0x24aae3,'attributes':_0x224382})['catch'](wt);return{'threadId':_0x39ed0a['commentThreadId'],'comments':_0x39ed0a['comments']};},'getCommentThread':async({channelId:_0x2e369d,threadId:_0x596d88})=>{const _0x4d6d51=await this['_getService'](_0x2e369d)['getCommentThread'](_0x596d88)['catch'](wt);return _0x4d6d51['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4d6d51]),{'threadId':_0x4d6d51['commentThreadId'],'comments':_0x4d6d51['comments']['map'](K),'context':_0x4d6d51['context'],'resolvedAt':_0x4d6d51['resolvedAt'],'resolvedBy':_0x4d6d51['resolvedBy'],'attributes':_0x4d6d51['attributes']||{}});},'updateCommentThread':async({channelId:_0x1c06c2,threadId:_0x348280,context:_0x4babb7,unlinkedAt:_0x5ccdd4,attributes:_0x5b165f})=>this['_getService'](_0x1c06c2)['updateCommentThread']({'commentThreadId':_0x348280,'context':_0x4babb7,'attributes':_0x5b165f,'unlinkedAt':_0x5ccdd4})['catch'](H)['catch'](wt),'resolveCommentThread':async({channelId:_0x55879a,threadId:_0xd23773})=>{const _0x4ab343=await this['_getService'](_0x55879a)['resolveCommentThread'](_0xd23773)['catch'](H)['catch'](wt);return{'threadId':_0x4ab343['commentThreadId'],'resolvedAt':_0x4ab343['resolvedAt'],'resolvedBy':_0x4ab343['resolvedBy']};},'reopenCommentThread':async({channelId:_0x14720b,threadId:_0x5d84dd})=>this['_getService'](_0x14720b)['reopenCommentThread'](_0x5d84dd)['catch'](H)['catch'](wt),'removeCommentThread':({channelId:_0x130cee,threadId:_0x2f3c2a})=>this['_getService'](_0x130cee)['removeCommentThread'](_0x2f3c2a)['catch'](H)['catch'](wt),'addComment':({channelId:_0x53b191,threadId:_0x5c6d2c,commentId:_0x1107ca,content:_0x5a802e,attributes:_0x4bd6b})=>this['_getService'](_0x53b191)['addComment'](_0x5c6d2c,_0x1107ca,_0x5a802e,_0x4bd6b)['catch'](wt),'updateComment':({channelId:_0x5efa9f,threadId:_0x505ee6,commentId:_0x42cba1,content:_0x4ec34b,attributes:_0x3aa53d})=>this['_getService'](_0x5efa9f)['updateComment'](_0x505ee6,_0x42cba1,_0x4ec34b,_0x3aa53d)['catch'](H)['catch'](wt),'removeComment':({channelId:_0x4f289f,threadId:_0xdbfd27,commentId:_0x429658})=>this['_getService'](_0x4f289f)['removeComment'](_0xdbfd27,_0x429658)['catch'](H)['catch'](wt)},_0xafeba7 instanceof _0x4a720a){const _0x5ae179=_0xafeba7['config']['get']('collaboration.channelId'),_0x359312=_0xafeba7['plugins']['get'](i);await this['_setUpService'](_0x5ae179);const _0x35c218=await this['_services']['get'](_0x5ae179)['getConnectedSessions']();this['listenTo'](_0x359312,'sessionAdd:'+_0x5ae179,(_0x5f2836,{session:_0x4d0612})=>{_0x4d0612['id']===_0x359312['mySessionId']&&(_0x5f2836['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4d0612['permissions'],_0x5ae179));}),_0x359312['register'](_0x5ae179,_0x35c218);}}async['_setUpService'](_0x3c83a2){if(this['_services']['has'](_0x3c83a2))throw new _0x8096d1('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x3c83a2});const _0x37bc96=this['context']['plugins']['get']('CommentsRepository'),_0x3b71f1=new a['CommentsService'](_0x3c83a2);this['_services']['set'](_0x3c83a2,_0x3b71f1),this['listenTo'](_0x3b71f1,'commentThreadAdded',(_0x388cd5,_0x326834)=>{const {commentThreadId:_0x41befb,documentId:_0x5c214f,context:_0x775f3,attributes:_0x54fd3a,resolvedAt:_0x256dd0,resolvedBy:_0x24a1a2,comments:_0x118ec4}=_0x326834;_0x37bc96['getCommentThread'](_0x41befb)||_0x37bc96['addCommentThread']({'threadId':_0x41befb,'channelId':_0x5c214f,'comments':_0x118ec4?_0x118ec4['map'](K):[],'context':_0x775f3,'attributes':_0x54fd3a,'resolvedAt':_0x256dd0,'resolvedBy':_0x24a1a2,'isFromAdapter':!0x0});}),this['listenTo'](_0x3b71f1,'commentThreadUpdated',(_0x44a6b5,{commentThreadId:_0x5bed26,documentId:_0x3bbf7f,context:_0x543ec8,unlinkedAt:_0x161341,attributes:_0x939181})=>{_0x37bc96['getCommentThread'](_0x5bed26)&&_0x37bc96['updateCommentThread']({'threadId':_0x5bed26,'channelId':_0x3bbf7f,'context':_0x543ec8,'unlinkedAt':_0x161341,'attributes':_0x939181,'isFromAdapter':!0x0});}),this['listenTo'](_0x3b71f1,'commentThreadResolved',(_0x2d107f,{commentThreadId:_0x3905ef,resolvedBy:_0x59b620,resolvedAt:_0xeaf6bb})=>{const _0x23181e=_0x37bc96['getCommentThread'](_0x3905ef);_0x23181e&&_0x23181e['resolve']({'resolvedBy':_0x59b620,'resolvedAt':_0xeaf6bb,'isFromAdapter':!0x0});}),this['listenTo'](_0x3b71f1,'commentThreadReopened',(_0x1bac1c,{commentThreadId:_0x3155b8})=>{const _0x84c273=_0x37bc96['getCommentThread'](_0x3155b8);_0x84c273&&_0x84c273['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3b71f1,'commentThreadRemoved',(_0x29287d,{commentThreadId:_0x250184})=>{const _0x23afe1=_0x37bc96['getCommentThread'](_0x250184);_0x23afe1&&_0x23afe1['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3b71f1,'commentAdded',(_0x1a5478,_0x54ddec)=>{const _0x5a6581=_0x54ddec['commentThreadId'],_0x5c8852=_0x37bc96['getCommentThread'](_0x5a6581);_0x5c8852&&_0x5c8852['addComment']({...K(_0x54ddec),'isFromAdapter':!0x0});}),this['listenTo'](_0x3b71f1,'commentUpdated',(_0x18ffa5,{commentThreadId:_0x3739d0,commentId:_0x41c6df,content:_0x8dde2e,attributes:_0x16b672})=>{const _0x1dcf13=_0x37bc96['getCommentThread'](_0x3739d0);if(_0x1dcf13){const _0x2a1940=_0x1dcf13['getComment'](_0x41c6df);_0x2a1940&&_0x2a1940['update']({'content':_0x8dde2e,'attributes':_0x16b672,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3b71f1,'commentRemoved',(_0x1da001,{commentThreadId:_0x5eef1b,commentId:_0x3e1522})=>{const _0x5eeb2f=_0x37bc96['getCommentThread'](_0x5eef1b);if(_0x5eeb2f){const _0x29d984=_0x5eeb2f['getComment'](_0x3e1522);_0x29d984&&_0x29d984['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x3c83a2);}['destroy'](){if(this['context']instanceof _0x4a720a){const _0xf35ac7=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0xf35ac7);}}['_terminateService'](_0x825502){if(!this['_services']['has'](_0x825502))throw new _0x8096d1('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x825502});this['_getService'](_0x825502)['disconnect'](),this['_services']['delete'](_0x825502);}async['reconnect'](){for(const _0x383274 of this['_services']['keys']())await this['_connectService'](_0x383274);if(this['context']instanceof _0x4a720a){const _0x626d23=this['context']['config']['get']('collaboration.channelId'),_0x15cfd8=this['context']['plugins']['get'](i);_0x15cfd8['unregister'](_0x626d23);const _0x4c67e9=await this['_services']['get'](_0x626d23)['getConnectedSessions']();_0x15cfd8['register'](_0x626d23,_0x4c67e9);}}async['_connectService'](_0x2957f8){const {connection:_0x416af1}=this['context']['plugins']['get'](c),_0x21520d=this['context']['plugins']['get']('CommentsRepository'),_0x574d0d=this['_services']['get'](_0x2957f8),_0x249b9e=await _0x574d0d['connect'](_0x416af1);await this['_fetchMissingUsersForThreads'](_0x249b9e);const _0x2a9e6e=new Set(Array['from'](_0x21520d['getCommentThreads']({'channelId':_0x2957f8}),_0x58c7b3=>_0x58c7b3['id']));for(const _0x4214dc of _0x249b9e)_0x4214dc['deletedAt']||_0x2a9e6e['delete'](_0x4214dc['commentThreadId']);for(const _0x35b592 of _0x2a9e6e)_0x21520d['getCommentThread'](_0x35b592)['remove']({'isFromAdapter':!0x0});for(const _0x3f1dfb of _0x249b9e){let _0x277aa6=_0x21520d['getCommentThread'](_0x3f1dfb['commentThreadId']);const {commentThreadId:_0x5baa55,context:_0x4f91b5,attributes:_0x497b10,resolvedBy:_0x3f16e3,resolvedAt:_0x4c265c,unlinkedAt:_0x558053,deletedAt:_0x40389c}=_0x3f1dfb;if(_0x40389c)continue;_0x277aa6||(_0x277aa6=_0x21520d['addCommentThread']({'channelId':_0x2957f8,'threadId':_0x5baa55,'context':_0x4f91b5,'attributes':_0x497b10||{},'resolvedBy':_0x3f16e3,'resolvedAt':_0x4c265c,'unlinkedAt':_0x558053,'isFromAdapter':!0x0}));const _0x371e1c=new Set(Array['from'](_0x277aa6['comments'],_0x4b7a56=>_0x4b7a56['id']));for(const _0x510293 of _0x3f1dfb['comments'])_0x371e1c['delete'](_0x510293['commentId']);for(const _0x13f770 of _0x371e1c)_0x277aa6['getComment'](_0x13f770)['remove']({'isFromAdapter':!0x0});for(const _0x21ce4b of _0x3f1dfb['comments']){const _0x9a9db9=_0x277aa6['getComment'](_0x21ce4b['commentId']);_0x9a9db9?_0x9a9db9['content']!==_0x21ce4b['content']&&_0x9a9db9['update']({'content':_0x21ce4b['content'],'isFromAdapter':!0x0}):_0x277aa6['addComment'](Object['assign'](K(_0x21ce4b),{'isFromAdapter':!0x0}));}}}['_getService'](_0x11840e){if(!this['_services']['has'](_0x11840e))throw new _0x8096d1('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x11840e});return this['_services']['get'](_0x11840e);}async['_fetchMissingUsersForThreads'](_0x57eb57){const _0x5e9abf=this['context']['plugins']['get'](_0x323468),{connection:_0x37aaba}=this['context']['plugins']['get'](c),_0xcb6382=new Set();for(const {resolvedBy:_0x2f2bec,comments:_0x1d4d6b}of _0x57eb57){_0x2f2bec&&!_0x5e9abf['getUser'](_0x2f2bec)&&_0xcb6382['add'](_0x2f2bec);for(const {userId:_0x3989f2}of _0x1d4d6b)_0x5e9abf['getUser'](_0x3989f2)||_0xcb6382['add'](_0x3989f2);}if(0x0===_0xcb6382['size'])return;const _0x92306e=await gt['getMany'](_0x37aaba,Array['from'](_0xcb6382));for(const _0x1c551d of _0x92306e)_0x5e9abf['getUser'](_0x1c551d['id'])||_0x5e9abf['addUser'](_0x1c551d);}}async function H(_0x12031d){if('404'!==_0x12031d['code'])throw _0x12031d;}function wt(_0x11e2ab){if((_0xbb6a7f=_0x11e2ab)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0xbb6a7f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xbb6a7f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0xbb6a7f;throw _0x11e2ab;}function K(_0x168afa){return{'threadId':_0x168afa['commentThreadId'],'commentId':_0x168afa['commentId'],'content':_0x168afa['content'],'createdAt':_0x168afa['createdAt'],'authorId':_0x168afa['userId'],'attributes':_0x168afa['attributes']||{}};}class f extends _0x486528{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3928e3){super(_0x3928e3);const _0xae6f08=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0xae6f08);}['init'](){const _0x106353=this['editor']['plugins']['get'](c),_0x58f6fa=this['editor']['plugins']['get']('TrackChangesEditing');return _0x58f6fa['adapter']={'getSuggestion':async _0x524546=>{await this['_waitForServiceReady']();const _0x475553=await this['_trackChangesService']['get'](_0x524546)['catch'](J);return await this['_fetchMissingUsersForThreads']([_0x475553]),_0x475553;},'addSuggestion':async({id:_0x427538,type:_0x1adcf5,data:_0x3cf44c,originalSuggestionId:_0x4a2977,attributes:_0x4cc844})=>{await this['_waitForServiceReady']();const _0x27f840={'id':_0x427538,'type':_0x1adcf5,'data':_0x3cf44c,'originalSuggestionId':_0x4a2977,'attributes':_0x4cc844},_0x313c76=await this['_trackChangesService']['add'](_0x427538,_0x1adcf5,_0x3cf44c,_0x4a2977,_0x4cc844)['catch'](_0x397546=>{if(vt(_0x397546))return new Promise(_0x53a4d7=>{this['_bufferedRequests']['set'](_0x427538,{'resolve':_0x53a4d7,'suggestionData':_0x27f840});});throw _0x397546;});return this['_bufferedRequests']['delete'](_0x427538),_0x313c76;},'updateSuggestion':async(_0x174526,_0x46dab3)=>{if(await this['_waitForServiceReady'](),'open'!==_0x46dab3['state'])return this['_trackChangesService']['update'](_0x174526,_0x46dab3)['catch'](J);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x359889,_0x196fdb)=>{_0x58f6fa['hasSuggestion'](_0x196fdb['id'])&&(_0x58f6fa['getSuggestion'](_0x196fdb['id'])['attributes']=_0x196fdb['attributes']);}),this['_trackChangesService']['connect'](_0x106353['connection'])['then'](_0x1d4363=>(_0x106353['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1d4363)['then'](()=>{for(const _0x523b11 of _0x1d4363){_0x58f6fa['addSuggestionData'](_0x523b11)['_saved']=!0x0;}})));}async['reconnect'](){const _0x2f58c2=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x2452dc}=this['editor']['plugins']['get'](c),_0x1e550d=await this['_trackChangesService']['connect'](_0x2452dc);await this['_fetchMissingUsersForThreads'](_0x1e550d);for(const {suggestionData:_0x402ca7,resolve:_0xd5f982}of this['_bufferedRequests']['values']()){let _0x3c1443=_0x1e550d['find'](_0x5791ac=>_0x5791ac['id']===_0x402ca7['id']);_0x3c1443||(_0x3c1443=await this['_trackChangesService']['add'](_0x402ca7['id'],_0x402ca7['type'],_0x402ca7['data'],_0x402ca7['originalSuggestionId'])),_0xd5f982(_0x3c1443);}for(const _0x4c12c3 of _0x1e550d)_0x2f58c2['hasSuggestion'](_0x4c12c3['id'])||_0x2f58c2['addSuggestionData'](_0x4c12c3);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x404e94=>{this['listenTo'](this['_trackChangesService'],'connected',_0x4a3ef6=>{_0x4a3ef6['off'](),_0x404e94();});});}async['_fetchMissingUsersForThreads'](_0xe803d4){const _0x3d7334=this['editor']['plugins']['get'](_0x323468),{connection:_0x21b204}=this['editor']['plugins']['get'](c),_0x491ef6=new Set();for(const {authorId:_0x5b32fe}of _0xe803d4)_0x3d7334['getUser'](_0x5b32fe)||_0x491ef6['add'](_0x5b32fe);if(0x0===_0x491ef6['size'])return;const _0x117efe=await gt['getMany'](_0x21b204,Array['from'](_0x491ef6));for(const _0x36a8c4 of _0x117efe)_0x3d7334['getUser'](_0x36a8c4['id'])||_0x3d7334['addUser'](_0x36a8c4);}}function J(_0x3f8332){if(vt(_0x3f8332))return new Promise(()=>{});throw _0x3f8332;}function vt(_0x31bf02){return _0x31bf02['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x31bf02['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x486528{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xa1a489=this['editor']['plugins']['get'](c),_0x3fefdf=this['editor']['plugins']['get']('CommentsEditing'),_0x4f139f=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0xa1a489,'change:state',(_0x4296e0,_0x25aca8,_0x394872)=>{_0x3fefdf['isThreadsLoadingPaused']='connected'!==_0x394872;});}),this['listenTo'](_0xa1a489,'change:state',(_0x2ccdf6,_0xe97775,_0xcf653c)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xcf653c);}),_0x4f139f['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x486528{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x486528{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>nt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x323468];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x992325){super(_0x992325);const _0x3710a9=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x3710a9);}async['init'](){const _0x38263b=this['editor']['plugins']['get'](l),_0x321cc4=_0x38263b['serverHistory'],_0x42a1c5=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x321cc4,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x38263b['sessionId']});const _0x125bc8=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x5bcfe2=await ot['isBundleUploaded'](_0x42a1c5['connection'],_0x125bc8);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x126621})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x126621)),'updateRevisions':async _0x18bcdd=>{await this['_waitForServiceReady']();const _0x3d3ccb=this['_revisionTracker']['currentRevision'];if(_0x5bcfe2&&0x1===_0x18bcdd['length']&&_0x18bcdd[0x0]['id']===_0x3d3ccb['id'])return _0x18bcdd;for(const _0x5570ac of _0x18bcdd)_0x5570ac['id']===_0x3d3ccb['id']&&(_0x5570ac['isEmptyCurrent']=_0x5570ac['fromVersion']===_0x5570ac['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x18bcdd,this['_lastRequestId'])['then'](_0x438be8=>(this['_lastRequestId']=_0x438be8,_0x18bcdd))['catch'](_0xea2e4c=>{if(ct(_0xea2e4c)||'400'===_0xea2e4c['code']&&void 0x0!==_0xea2e4c['data']['wrongRequestId']){for(const _0x2f500f of _0x18bcdd){!this['_revisionTracker']['repository']['getRevision'](_0x2f500f['id'])||this['_revisionTracker']['_bufferUpdate'](_0x2f500f['id'],_0x2f500f,!0x1);}if(ct(_0xea2e4c))throw _0xea2e4c;return _0x18bcdd;}throw _0xea2e4c;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x225541,{revisionsData:_0x5244f9,requestId:_0x55b3af})=>{Math['max'](..._0x5244f9['map'](_0xaaa8e4=>_0xaaa8e4['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5244f9,_0x55b3af);}):this['_handleRevisionsUpdate'](_0x5244f9,_0x55b3af);});const {revisions:_0xcbd42f,requestId:_0x604e42}=await this['_revisionHistoryService']['connect'](_0x42a1c5['connection']);_0x42a1c5['addToReconnectionStack'](this),this['_lastRequestId']=_0x604e42,await this['_fetchMissingUsers'](_0xcbd42f);for(const _0xed7536 of _0xcbd42f)this['_revisionTracker']['addRevisionData'](_0xed7536);this['listenTo'](_0x38263b,'change:_isConnected',(_0x1f4ef3,_0x74f304,_0x36d511)=>{_0x36d511&&(this['_oldOffset']=_0x38263b['_offset'],_0x1f4ef3['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x42a1c5,'state',_0x3ee893=>_0x3ee893===_0x35869f['CONNECTED']);}async['reconnect'](){const _0x55d7c4=this['editor']['plugins']['get'](c),_0x19f54a=this['editor']['plugins']['get'](l),_0x1645db=async()=>{const _0x30d0e5=this['_revisionTracker']['currentRevision'],_0x24ae99=_0x30d0e5['id'],_0x43fc7f=_0x24ae99!==_0x19f54a['sessionId'];if(_0x43fc7f){const _0x5b3ba9=_0x19f54a['_offset']-this['_oldOffset'],_0x2827b3=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x30d0e5['toVersion']+_0x5b3ba9!==_0x2827b3){const _0x59b61b=_0x30d0e5['fromVersion']+_0x5b3ba9,_0x346ae5=this['editor']['plugins']['get'](_0x323468),_0x22f0e2=this['_revisionTracker']['buildRevisionData']({'revision':_0x30d0e5,'from':_0x59b61b,'to':_0x2827b3});_0x22f0e2['id']=_0x30d0e5['id'];const _0xd1a817=_0x22f0e2['authorsIds']['map'](_0x3cd3d9=>_0x346ae5['getUser'](_0x3cd3d9));_0x30d0e5['_update']({..._0x22f0e2,'authors':_0xd1a817},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x30d0e5['id'],_0x22f0e2,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2827b3,(_0x30d0e5['toVersion']===_0x30d0e5['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x24ae99)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x24ae99),this['_revisionTracker']['_createCurrentRevision'](_0x2827b3));}const {revisions:_0x578b7c,requestId:_0x3c0d2c}=await this['_revisionHistoryService']['reconnect'](_0x55d7c4['connection'],this['_lastRequestId']);_0x43fc7f&&_0x578b7c['length']>0x0?_0x19f54a['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x578b7c),this['_handleRevisionsUpdate'](_0x578b7c,_0x3c0d2c),this['_revisionTracker']['sendBufferedUpdates']());};return _0x19f54a['_isConnected']?_0x1645db():new Promise((_0x396a18,_0x22b0c1)=>{_0x19f54a['once']('change:_isConnected',()=>{_0x1645db()['then'](_0x396a18)['catch'](_0x22b0c1);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3c8f6d=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3d6c3d=>{_0x3d6c3d['off'](),_0x3c8f6d();});});}['_getLatestVersionFromServerOperations'](){const _0x2141c2=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x46453e of _0x2141c2)if('marker'!==_0x46453e['type']||_0x46453e['affectsData'])return _0x46453e['baseVersion']+0x1;}['_getLatestVersion'](){const _0x457ac8=this['editor']['plugins']['get'](l);return new Promise(_0x35afea=>{_0x457ac8['_isPendingUpdate']?_0x457ac8['once']('change:_isPendingUpdate',()=>{_0x35afea(this['_getLatestVersionFromServerOperations']());}):_0x35afea(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4f116c,_0x59ec15){const _0x43d70b=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x59ec15;for(const _0x410d6 of _0x4f116c){const _0x7b886c=_0x43d70b['getRevision'](_0x410d6['id']);if(_0x7b886c){if((_0x410d6['fromVersion']||_0x410d6['toVersion'])&&(_0x410d6['diffData']=null),_0x7b886c===this['_revisionTracker']['currentRevision']){const _0x194ebf=Math['max'](_0x7b886c['toVersion'],_0x410d6['toVersion']),_0x48c9bf=Math['max'](_0x7b886c['fromVersion'],_0x410d6['fromVersion']);let _0xfb8776;_0x7b886c['toVersion']===_0x410d6['toVersion']&&_0x7b886c['fromVersion']===_0x410d6['fromVersion']?(_0xfb8776=!0x0,this['_preventResendingRevisionData'](_0x410d6)):_0x410d6['toVersion']===_0x194ebf&&_0x410d6['fromVersion']===_0x48c9bf?_0xfb8776=!0x1:(_0x7b886c['toVersion']===_0x194ebf&&_0x7b886c['fromVersion']===_0x48c9bf||this['_fixRevision']({'revision':_0x7b886c,'from':_0x48c9bf,'to':_0x194ebf}),_0xfb8776=!0x0),_0xfb8776&&(delete _0x410d6['fromVersion'],delete _0x410d6['toVersion'],delete _0x410d6['diffData'],delete _0x410d6['createdAt'],delete _0x410d6['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x410d6),this['_preventResendingRevisionData'](_0x410d6);}else this['_revisionTracker']['addRevisionData'](_0x410d6);}const _0x4b74c5=_0x43d70b['getRevisions']();_0x4b74c5['reverse']();for(let _0x27911d=0x0;_0x27911d<_0x4b74c5['length']-0x1;_0x27911d++){const _0x331f79=_0x4b74c5[_0x27911d],_0x20cf5e=_0x4b74c5[_0x27911d+0x1];if(_0x331f79['fromVersion']<_0x20cf5e['toVersion']){const _0x182cb7=_0x20cf5e['toVersion'],_0x1cc23f=Math['max'](_0x182cb7,_0x331f79['toVersion']);this['_fixRevision']({'revision':_0x331f79,'from':_0x182cb7,'to':_0x1cc23f});}}}['_fixRevision']({revision:_0x6ee6ff,from:_0x56d7b4,to:_0x1cd23f}={}){const _0x62ad0c=this['editor']['plugins']['get'](_0x323468),_0x5e3e08=this['_revisionTracker']['buildRevisionData']({'revision':_0x6ee6ff,'from':_0x56d7b4,'to':_0x1cd23f});_0x5e3e08['authors']=_0x5e3e08['authorsIds']['map'](_0x1e944b=>_0x62ad0c['getUser'](_0x1e944b)),_0x6ee6ff['_update'](_0x5e3e08);}['_preventResendingRevisionData'](_0x4688bc){const _0x48ffc0={};_0x48ffc0['id']=_0x4688bc['id'];for(const _0x1713dd of Object['keys'](_0x4688bc))'id'!==_0x1713dd&&(_0x48ffc0[_0x1713dd]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x48ffc0['id'],_0x48ffc0,!0x0);}async['_fetchMissingUsers'](_0x383cba){const _0x25c5a1=this['editor']['plugins']['get'](_0x323468),{connection:_0x4d0b27}=this['editor']['plugins']['get'](c),_0x116b68=new Set();for(const _0x5d9a64 of _0x383cba){for(const _0x539d3a of _0x5d9a64['authorsIds'])_0x257bab(_0x539d3a);_0x5d9a64['creatorId']&&_0x257bab(_0x5d9a64['creatorId']);}if(0x0===_0x116b68['size'])return;const _0x1f09ba=await gt['getMany'](_0x4d0b27,Array['from'](_0x116b68));for(const _0x319f61 of _0x1f09ba)_0x25c5a1['getUser'](_0x319f61['id'])||_0x25c5a1['addUser'](_0x319f61);function _0x257bab(_0x40e7c2){_0x25c5a1['getUser'](_0x40e7c2)||_0x116b68['add'](_0x40e7c2);}}}function ct(_0x15150e){return _0x15150e['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x15150e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x15150e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x486528{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class tt extends _0x4dc61c{['_collapseAt'];constructor(_0x21d472,_0x4eeca2=0x6){super(_0x21d472);const _0x223c51=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4eeca2,this['bind']('isHidden')['to'](this,'usersCount',_0x4f07e8=>_0x4f07e8<_0x4eeca2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x223c51['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x223c51['to']('usersCount',_0x2d2444=>'+'+(_0x2d2444-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x4dc61c{['items'];['keystrokes'];constructor(_0x50a90f){super(_0x50a90f);const _0x35c41e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0xf61f50(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x35c41e['if']('hasPopup'),'aria-expanded':_0x35c41e['to']('isExpanded',_0x25dac8=>this['hasPopup']&&String(_0x25dac8)),'aria-label':_0x35c41e['to']('hasPopup',_0x3863c8=>R(_0x50a90f,_0x3863c8?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x35c41e['to']('hasPopup',_0xd856d4=>!!_0xd856d4&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x35c41e['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x35c41e['to'](_0xf0e2b6=>{const _0x606376=_0xf0e2b6,_0xbf7e19=document['querySelector']('.ck-presence-list__dropdown-list'),_0x5666a6=document['querySelector']('.ck-balloon-panel_with-arrow');_0xbf7e19?.['contains'](_0x606376['relatedTarget'])||_0x5666a6?.['contains'](_0x606376['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x28c38c,_0x3aa5bf,_0x5c2125)=>{this['element']&&(_0x5c2125?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class Z extends _0x4dc61c{['counterView'];['inlineListView'];constructor(_0x453342,_0x568e89=0x6){super(_0x453342);const _0x44e968=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new tt(this['locale'],_0x568e89),this['inlineListView']=new ts(_0x453342),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2953a8 of this['inlineListView']['items'])_0x2953a8['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x44e968['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class st extends _0x4dc61c{['listWrapperView'];constructor(_0x3eba53,_0xa75b80){super(_0x3eba53);const _0x402163=this['bindTemplate'];this['listWrapperView']=new _t(_0x3eba53,_0xa75b80),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0x3eba53,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x402163['to'](_0x4fbe4d=>{const _0x26885f=_0x4fbe4d,_0x3dc96b=document['querySelector']('.ck-presence-list__list'),_0x22863b=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3dc96b?.['contains'](_0x26885f['relatedTarget'])||_0x22863b?.['contains'](_0x26885f['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class _t extends _0x234a9c{constructor(_0x22cc32,_0x2ecd3e){super(_0x22cc32);const _0x54bf45=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2ecd3e?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x54bf45['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x54bf45['to']('role'),'aria-label':_0x54bf45['to']('ariaLabel'),'aria-labelledby':_0x54bf45['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x4088ca['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4d6d44=this['element'];_0x4d6d44&&(this['_isScrollable']=Math['max'](_0x4d6d44['scrollHeight'],_0x4d6d44['clientHeight'])>0.8*window['innerHeight']);}}class it extends lt{['userView'];constructor(_0x276423,_0x117785,_0x5f1197){super(_0x276423);const _0xbcec12=this['bindTemplate'];this['userView']=new ut(_0x276423,_0x117785);const _0x4b1376={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x117785['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x117785['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x117785['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5f1197&&(_0x4b1376['tag']='button',_0x4b1376['on']={'click':_0xbcec12['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4b1376);}['focus'](){this['element']['focus']();}}class et extends _0x4dc61c{['userView'];['markerView'];constructor(_0x2adf08,_0x134e89,_0x3d85fe){super(_0x2adf08);const _0x2ba5fd=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ut(_0x2adf08,_0x134e89),this['markerView']=new dt(_0x2adf08,_0x134e89);const _0x48a712=new pt(_0x2adf08);_0x48a712['template']['tag']='span',_0x48a712['text']=_0x134e89['name'];const _0x25c59f={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x2ba5fd['to']('isFocusable',_0x119366=>!!_0x119366&&0x0),'aria-labelledby':_0x48a712['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x2ba5fd['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x2ba5fd['to']('hasTooltip',_0x2f3b65=>!_0x2f3b65),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x48a712]};_0x3d85fe&&(_0x25c59f['tag']='button',_0x25c59f['on']={'click':_0x2ba5fd['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x25c59f);}}class dt extends _0x4dc61c{constructor(_0x45ebaf,_0x25e3aa){super(_0x45ebaf),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x25e3aa['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const rt={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x211f06{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40cc05){super(_0x40cc05),this['context']['config']['define']('presenceList',rt);const _0x40d638=_0x40cc05['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x40d638)throw new _0x8096d1('presencelist-collapseat-invalid-format',this);if(_0x40d638<0x1)throw new _0x8096d1('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2352b1(),this['balloonPanelView']=new _0x4ffbc1(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x5e3173 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5e3173);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4d826e,_0x1c9538)=>{this['_handleUserAdd'](_0x1c9538);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x11334a,_0x20e819)=>{this['_handleUserRemove'](_0x20e819);});}['_createView'](){const _0x36bafd=this['context'],_0x5dc187=new Z(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x847dec=this['balloonPanelView'];if(!_0x332f96(_0x36bafd['config']['get']('presenceList.container')))throw new _0x8096d1('presencelist-missing-container',this);return _0x5dc187['counterView']['bind']('usersCount')['to'](this),_0x5dc187['bind']('isCollapsed')['to'](this,'usersCount',_0xebe8a2=>{const {collapseAt:_0x3c1af6}=_0x36bafd['config']['get']('presenceList'),_0x30d6e0=_0xebe8a2>=_0x3c1af6;if(_0x30d6e0&&!_0x5dc187['inlineListView']['items']['find'](_0x58efdc=>_0x58efdc instanceof tt)){const _0xde1b6a=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xde1b6a&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x5dc187['inlineListView']['items']['add'](_0x5dc187['counterView']);}return _0x30d6e0||this['hideDropdown'](),_0x30d6e0;}),_0x5dc187['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x682c8b=>{const _0x215f82=_0x36bafd['config']['get']('presenceList'),_0x57c4dc=new et(_0x36bafd['locale'],_0x682c8b,!!_0x215f82['onClick']);return _0x57c4dc['bind']('hasTooltip')['to'](_0x5dc187,'isCollapsed',_0xd7d68=>!_0xd7d68),_0x57c4dc['bind']('isFocusable')['to'](_0x5dc187,'isCollapsed',_0x43498c=>!_0x43498c),_0x215f82['onClick']&&this['listenTo'](_0x57c4dc,'execute',()=>{this['view']['isCollapsed']||_0x215f82['onClick'](_0x682c8b,_0x57c4dc['element']);}),_0x57c4dc;}),this['listenTo'](_0x5dc187['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x5dc187['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x5dc187['inlineListView']['keystrokes']['set']('Enter',(_0x14e57a,_0x172e25)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x172e25());}),_0x5dc187['render'](),_0x847dec['render'](),_0x44ee83({'emitter':_0x5dc187,'activator':()=>_0x847dec['isVisible'],'contextElements':[_0x847dec['element'],_0x5dc187['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x36bafd['config']['get']('presenceList.container')['appendChild'](_0x5dc187['element']),this['_bodyCollection']=new _0x30d9f0(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5dc187;}['_handleUserAdd'](_0x81c6a5){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x81c6a5['isMe'])return;const _0x2eb271=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2eb271-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x22bff7=_0x81c6a5['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x81c6a5,_0x22bff7);}['_handleUserRemove'](_0x3c768f){this['usersCount']--;const {collapseAt:_0x4a391d}=this['context']['config']['get']('presenceList'),_0x53e1a4=this['usersCount']>=_0x4a391d;if(this['currentDisplayedUsers']['get'](_0x3c768f['id']))this['currentDisplayedUsers']['remove'](_0x3c768f['id']);else{if(_0x53e1a4&&this['currentDisplayedUsers']['length']+0x1===_0x4a391d-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x53e1a4?0x1:0x0)<this['usersCount']){for(const _0x3e8cb7 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x3e8cb7['id'])&&(this['currentDisplayedUsers']['add'](_0x3e8cb7,Math['min'](this['currentDisplayedUsers']['length']-(_0x53e1a4?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x53e1a4?0x1:0x0)===_0x4a391d-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x246864=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new st(this['context']['locale'],!!_0x246864['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x507829}=this['presenceDropdownView'];_0x507829['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x36e759=>{if(!_0x246864['displayMe']&&_0x36e759['isMe'])return null;const _0x48a248=new it(this['context']['locale'],_0x36e759,!!_0x246864['onClick']);return _0x246864['onClick']&&this['listenTo'](_0x48a248,'execute',()=>{_0x246864['onClick'](_0x36e759,_0x48a248['element']);}),_0x48a248;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x507829['focus'](),_0x507829['checkIfScrollable']();const _0x42f862=(_0xbeec6c,_0x4f3c20)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x4f3c20();};_0x507829['keystrokes']['set']('Esc',_0x42f862),_0x507829['keystrokes']['set']('Shift+Tab',_0x42f862),_0x507829['keystrokes']['set']('Tab',(_0x323a0b,_0x3b519d)=>{!function(_0x30eab7){const _0x164bfd=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x2eb837=>_0x2eb837+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x229815=[...document['body']['querySelectorAll'](_0x164bfd)]['filter'](_0x2b867f=>_0x2b867f===document['activeElement']||_0x2b867f['offsetWidth']+_0x2b867f['offsetHeight']>0x0)['sort']((_0x3c9df3,_0x5589a8)=>(_0x3c9df3['tabIndex']||0x0)-(_0x5589a8['tabIndex']||0x0)),_0xb0572b=_0x229815['indexOf'](_0x30eab7),_0x2ef696=_0x229815[(_0xb0572b+0x1)%_0x229815['length']];_0x2ef696&&_0x2ef696['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3b519d();}),_0x507829['focusTracker']['add'](this['view']['element']),_0x507829['focusTracker']['on']('change:isFocused',(_0x278ee2,_0x3675af,_0x292dad)=>{_0x292dad||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x211f06{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
23
+ import{ContextPlugin as _0x6e3cec,Plugin as _0x2d3c3d,PendingActions as _0x198b2a,Context as _0x427df}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x19722b,CKEditorError as _0x42186d,Collection as _0x2fd983,global as _0x17d00d,version as nt,uid as _0x401110,KeystrokeHandler as _0x5b08a7}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4775e8,View as _0x1f1e81,ListView as _0x2837ad,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x53a00a,clickOutsideHandler as _0x3527e1,BodyCollection as _0x30db24}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x2d6d08,NoOperation as _0x9a9dca,InsertOperation as _0x4536dc,MarkerOperation as _0x226fed,RootAttributeOperation as _0x2c43ba,transformSets as _0x138667,OperationFactory as _0x48a87d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x4e41a1,CollaborativeEditingService as _0x3be59a,User as dt,CommentsService as _0x20bf0f,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0xb8f378,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x3c22ea}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x35aebf}from'es-toolkit/compat';class c extends _0x6e3cec{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4775e8];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x157d5b){super(_0x157d5b),this['set']('state',_0x4e41a1['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x19722b);}['init'](){const _0x1e8d62=this['context'],_0x48a966=_0x1e8d62['plugins']['get']('CloudServices'),_0x4be19f=_0x1e8d62['plugins']['get'](_0x4775e8);if(!_0x48a966['token'])throw new _0x42186d('websocketgateway-missing-token',this);if(!_0x48a966['webSocketUrl'])throw new _0x42186d('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x48a966['token'],_0x48a966['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3b7c7a=>{if(this['connection']=_0x3b7c7a,this['bind']('state')['to'](_0x3b7c7a,'state',this,'_isBrowserOffline',(_0x193899,_0x4fca0d)=>('connected'!==_0x193899&&(this['_shouldPluginsReconnect']=!0x0),_0x4fca0d||_0x193899!==_0x4e41a1['CONNECTED']?_0x4e41a1['DISCONNECTED']:this['state']==_0x4e41a1['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x4e41a1['CONNECTING']):_0x4e41a1['CONNECTED'])),this['connection']['on']('error',(_0x5a2ebb,_0x101e47)=>{if('limitExceeded'!==_0x101e47['code'])throw console['error'](_0x101e47),new _0x42186d('cloudservices-init',null,{'originalError':_0x101e47});_0x4be19f['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x3b7c7a['me'])return new Promise(_0x49c5f8=>_0x3b7c7a['on']('change:me',_0x49c5f8));})['catch'](_0x4d905b=>{throw console['error'](_0x4d905b),new _0x42186d('cloudservices-init',null,{'originalError':_0x4d905b});});}['addToReconnectionStack'](_0x55993d){if('function'!=typeof _0x55993d['reconnect'])throw new _0x42186d('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x55993d))throw new _0x42186d('websocketgateway-plugin-already-registered',this,{'name':_0x55993d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x55993d);}['removeFromReconnectionStack'](_0x43b79c){this['_reconnectionStack']['delete'](_0x43b79c);}['isInReconnectionStack'](_0x1cb4ea){return this['_reconnectionStack']['has'](_0x1cb4ea);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x507431=>_0x507431['reconnect']())))['then'](()=>this['state']=_0x4e41a1['CONNECTED'])['catch'](_0x5e1465=>{throw console['error'](_0x5e1465),new _0x42186d('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x4e41a1['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x6e3cec{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0xb8f378];}constructor(_0x363ac1){super(_0x363ac1),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2fd983(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0xb8f378);}['init'](){const _0x154c7f=this['context']['plugins']['get'](c);this['listenTo'](_0x154c7f,'change:state',(_0x2bedf1,_0x4cc26c,_0x214b3b)=>{if('connected'!==_0x214b3b)this['channelSessions']['forEach'](_0x26644c=>_0x26644c['clear']()),this['channelConnectedUsers']['forEach'](_0x369724=>_0x369724['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x67a1f4,_0x14416d]of this['_registeredSessions'])for(const _0x516117 of _0x14416d)this['_handleSessionAdd'](_0x67a1f4,_0x516117);}}),this['_createUser'](_0x154c7f['connection']['me'],!0x0);}['register'](_0x4dd465,_0x4e0d76){if(this['_registeredSessions']['has'](_0x4dd465))throw new _0x42186d('sessions-register-already-registered',null,{'channelId':_0x4dd465});this['_registeredSessions']['set'](_0x4dd465,_0x4e0d76),this['channelSessions']['set'](_0x4dd465,new _0x2fd983()),this['channelConnectedUsers']['set'](_0x4dd465,new _0x2fd983()),this['listenTo'](_0x4e0d76,'add',(_0x5184de,_0x4749c1)=>this['_handleSessionAdd'](_0x4dd465,_0x4749c1)),this['listenTo'](_0x4e0d76,'remove',(_0x255e87,_0x85a88c)=>this['_handleSessionRemove'](_0x4dd465,_0x85a88c));for(const _0x401d0a of _0x4e0d76)this['_handleSessionAdd'](_0x4dd465,_0x401d0a);}['unregister'](_0x2c706b){if(!this['_registeredSessions']['has'](_0x2c706b))throw new _0x42186d('sessions-unregister-not-exist',null,{'channelId':_0x2c706b});const _0x6b6814=this['_registeredSessions']['get'](_0x2c706b);this['stopListening'](_0x6b6814);for(const _0xc7c06a of _0x6b6814)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2c706b,_0xc7c06a);this['_registeredSessions']['delete'](_0x2c706b),this['channelSessions']['delete'](_0x2c706b),this['channelConnectedUsers']['delete'](_0x2c706b);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0xdd4a03){for(const _0x56ad61 of this['channelSessions']['values']())for(const _0x4f611c of _0x56ad61)if(_0x4f611c['id']===_0xdd4a03)return _0x4f611c['user'];}['getUserSessions'](_0x284412,_0x44a817){const _0x3231ab=_0x44a817?[this['channelSessions']['get'](_0x44a817)]:this['channelSessions']['values'](),_0x1fda95=new Set();for(const _0x56e646 of _0x3231ab)for(const _0x1c0f78 of _0x56e646)_0x1c0f78['user']['id']===_0x284412['id']&&_0x1fda95['add'](_0x1c0f78['id']);return _0x1fda95;}['getUserRole'](_0x564c65){for(const _0x345e8e of this['channelSessions']['values']())for(const _0x962415 of _0x345e8e)if(_0x962415['user']===_0x564c65)return _0x962415['role'];}['_handleSessionAdd'](_0x203019,_0x23d374){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x282a11=_0x23d374['user'],_0x82c496=this['_users']['getUser'](_0x282a11['id'])||this['_createUser'](_0x282a11),_0x5d7f99=Object['assign']({},_0x23d374,{'user':_0x82c496});this['channelSessions']['get'](_0x203019)['add'](_0x5d7f99);const _0x1db735=this['channelConnectedUsers']['get'](_0x203019);_0x1db735['has'](_0x82c496['id'])||_0x1db735['add'](_0x82c496),this['allConnectedUsers']['has'](_0x82c496['id'])||this['allConnectedUsers']['add'](_0x82c496,_0x82c496['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x203019,{'channelId':_0x203019,'session':_0x5d7f99});}['_handleSessionRemove'](_0x3354a8,_0x159939){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1abfd2=this['channelConnectedUsers']['get'](_0x3354a8),_0x50fb3f=_0x159939['user'];_0x50fb3f['id']&&(this['channelSessions']['get'](_0x3354a8)['remove'](_0x159939['id']),_0x1abfd2['has'](_0x50fb3f['id'])&&!this['getUserSessions'](_0x50fb3f,_0x3354a8)['size']&&_0x1abfd2['remove'](_0x50fb3f['id']),this['allConnectedUsers']['get'](_0x50fb3f['id'])&&!this['getUserSessions'](_0x50fb3f)['size']&&this['allConnectedUsers']['remove'](_0x50fb3f['id']));}['_createUser'](_0x1f1d31,_0x2a7e81){const _0x3ca1ec=this['_users']['addUser'](_0x1f1d31);return _0x2a7e81&&this['_users']['defineMe'](_0x1f1d31['id']),_0x3ca1ec['orderNumber']=this['_uniqueUsersCount']++,_0x3ca1ec;}}class q extends _0x2d3c3d{['_domEmitter']=new(_0x19722b())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4f273f=this['editor'],_0x37caba=_0x4f273f['plugins']['get'](i);_0x4f273f['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x854b3c,{writer:_0x254c54})=>function(_0x3286e7,_0x21e841,_0x35c618,_0x1da4df){const _0x1933f0=_0x3286e7['markerName']['split'](':')[0x2],_0x2da2e8=_0x35c618['getUserBySessionId'](_0x1933f0);if(!_0x2da2e8||_0x1933f0===_0x35c618['mySessionId'])return;if(!_0x1da4df['model']['schema']['checkChild'](_0x3286e7['markerRange']['start'],'$text'))return;const _0x22196a={'class':'ck-user__marker\x20'+_0x2da2e8['color']['getMarkerClass'](),'data-name':_0x2da2e8['name'],'data-session-id':_0x1933f0},_0x371e33=_0x1da4df['model']['markers']['get'](_0x3286e7['markerName']),_0x277b8a=_0x371e33['getStart'](),_0x3404fa=_0x277b8a['nodeAfter'],_0x48e5fe=_0x1da4df['model']['schema'];if(_0x3404fa&&_0x48e5fe['isObject'](_0x3404fa)&&_0x48e5fe['isInline'](_0x3404fa)&&!_0x1da4df['model']['markers']['get']('user:range:'+_0x1933f0)['getRange']()['isCollapsed'])return;const _0x2e49ce=_0x277b8a['parent'];return _0x1da4df['model']['schema']['isLimit'](_0x2e49ce)&&!_0x1da4df['model']['hasContent'](_0x2e49ce)&&(_0x22196a['contenteditable']=!0x1),function(_0x453c9e,_0x422480,_0xbc1bb6){const _0x323d9a=_0x453c9e['createUIElement']('span',_0x422480);return _0x453c9e['setCustomProperty']('userPositionMarker',!0x0,_0x323d9a),_0x323d9a['render']=function(_0x48cf51){const _0x494b06=this['toDomElement'](_0x48cf51),_0x6ceaeb=document['createElement']('span');return _0x6ceaeb['classList']['add']('ck-user__marker-tooltip'),_0x6ceaeb['setAttribute']('contenteditable','false'),_0x6ceaeb['setAttribute']('spellcheck','false'),_0x6ceaeb['textContent']=_0xbc1bb6['name'],_0x494b06['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x6ceaeb['outerHTML']+'⁠',_0x494b06['addEventListener']('mouseenter',()=>{_0x494b06['classList']['add']('ck-user__marker_hovered');}),_0x494b06['addEventListener']('mouseleave',()=>{_0x494b06['classList']['remove']('ck-user__marker_hovered');}),_0x494b06;},_0x323d9a['isSimilar']=function(_0x269780){return!(!this['getCustomProperty']('userPositionMarker')||!_0x269780['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x269780['getAttribute']('data-session-id'));},_0x323d9a;}(_0x21e841,_0x22196a,_0x2da2e8);}(_0x854b3c,_0x254c54,_0x37caba,_0x4f273f)}),_0x4f273f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3f8f6c=>function(_0x182eff,_0x3c188b){const _0x3412e9=_0x182eff['markerName']['split'](':')[0x2];if(_0x3412e9===_0x3c188b['mySessionId'])return null;const _0x346030=_0x3c188b['getUserBySessionId'](_0x3412e9);if(!_0x346030)return{'id':_0x3412e9,'classes':[]};return{'id':_0x3412e9,'classes':['ck-user__selection',_0x346030['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3412e9},'priority':0x7d0+_0x346030['orderNumber']};}(_0x3f8f6c,_0x37caba)}),function(_0x20f735){const _0x260b66=_0x20f735['model'],_0x38a500=new Map(),_0x47062a=_0x20f735['plugins']['get'](i);_0x260b66['markers']['on']('update:user:range',(_0x72283,_0x2ad813,_0x3454a2,_0x4519ad)=>{if(!_0x4519ad&&_0x38a500['get'](_0x2ad813['name']))return _0x38a500['get'](_0x2ad813['name'])['detach'](),void _0x38a500['delete'](_0x2ad813['name']);const _0x2a1c04=_0x2ad813['name']['split'](':')[0x2];if(_0x2a1c04===_0x47062a['mySessionId'])return;const _0x361444='user:position:'+_0x2a1c04;_0x260b66['markers']['has'](_0x361444)&&_0x20f735['editing']['reconvertMarker'](_0x361444),_0x2ad813['on']('change:range',(_0x32c1c7,_0x1e1ba4,_0x1d4a67)=>{if('$graveyard'!=_0x1e1ba4['root']['rootName']&&'$graveyard'==_0x2ad813['getRange']()['root']['rootName']&&!_0x38a500['has'](_0x2ad813['name'])){const _0x25e334=_0x260b66['schema']['getNearestSelectionRange'](_0x1d4a67['deletionPosition']);if(_0x25e334){const _0x3d7469=ht['fromRange'](_0x25e334);_0x38a500['set'](_0x2ad813['name'],_0x3d7469),_0x3d7469['on']('change:range',(_0x4e091b,_0x1fd8e1,_0x57e8ac)=>{if('$graveyard'==_0x3d7469['root']['rootName']){const _0x162001=_0x260b66['schema']['getNearestSelectionRange'](_0x57e8ac['deletionPosition']);_0x162001?(_0x3d7469['start']=_0x162001['start'],_0x3d7469['end']=_0x162001['end']):(_0x38a500['delete'](_0x2ad813['name']),_0x3d7469['detach']());}});}}});}),_0x260b66['document']['on']('change',()=>{_0x38a500['size']>0x0&&_0x260b66['enqueueChange']({'isUndoable':!0x1},_0x28004e=>{for(const [_0x359fad,_0x54865e]of _0x38a500)'$graveyard'==_0x260b66['markers']['get'](_0x359fad)['getRange']()['root']['rootName']&&(te(_0x359fad['split'](':')[0x2],_0x54865e['toRange'](),_0x260b66,_0x28004e),_0x54865e['detach']());_0x38a500['clear']();});});}(_0x4f273f),this['_domEmitter']['listenTo'](_0x17d00d['document'],'keydown',(_0x3b69b1,{key:_0x35f8e4})=>{'Escape'===_0x35f8e4&&function(_0x4464d6){_0x4464d6['editing']['view']['change'](_0x3d5663=>{for(const _0xaf2664 of _0x4464d6['model']['markers']){if(!_0xaf2664['name']['startsWith']('user:position'))continue;const _0xec2037=_0x4464d6['editing']['mapper']['markerNameToElements'](_0xaf2664['name']);if(_0xec2037){for(const _0x3c9df3 of _0xec2037)_0x3d5663['removeClass']('ck-user__marker_hovered',_0x3c9df3);}}});}(_0x4f273f);},{'useCapture':!0x0});}['afterInit'](){const _0x50992c=this['editor'],_0x11addc=_0x50992c['commands']['get']('undo');_0x11addc&&_0x50992c['model']['on']('applyOperation',(_0x4aef53,_0x3c2430)=>{const _0x2f99a3=_0x3c2430[0x0];if(!_0x2f99a3['isDocumentOperation'])return;if('marker'!=_0x2f99a3['type']||!_0x2f99a3['name']['startsWith']('user:'))return;const _0x3911aa=_0x2f99a3['batch'];_0x11addc['_createdBatches']['has'](_0x3911aa)&&(_0x2f99a3['newRange']=_0x2f99a3['oldRange']?_0x50992c['model']['createRange'](_0x2f99a3['oldRange']['start'],_0x2f99a3['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3b3b29=this['editor'],_0x51d9b0=_0x3b3b29['model']['document'],_0x117826=_0x3b3b29['plugins']['get'](i);_0x3b3b29['model']['enqueueChange']({'isUndoable':!0x1},_0x4ffb31=>{const _0x1eb968='user:range:'+_0x117826['mySessionId'],_0xe70ff9='user:position:'+_0x117826['mySessionId'],_0x43822=_0x3b3b29['model']['markers']['has'](_0x1eb968);_0x3b3b29['editing']['view']['hasDomSelection']?te(_0x117826['mySessionId'],_0x51d9b0['selection']['getFirstRange'](),_0x3b3b29['model'],_0x4ffb31):_0x43822&&(_0x4ffb31['removeMarker'](_0x1eb968),_0x4ffb31['removeMarker'](_0xe70ff9));});}}function te(_0xe3939c,_0x21b508,_0x466b85,_0x1280ec){const _0xd1e5b8='user:range:'+_0xe3939c,_0x383c31='user:position:'+_0xe3939c,_0x49e6c3=_0x21b508['getContainedElement']();let _0x120eaa=_0x21b508['start'];if(_0x49e6c3&&_0x49e6c3['is']('element','tableCell')){const _0x4940ab=function(_0x805ae8,_0x238ffb){for(const _0x33965f of _0x805ae8['getPositions']())if(_0x238ffb['schema']['checkChild'](_0x33965f,'$text'))return _0x33965f;}(_0x21b508,_0x466b85);_0x4940ab&&(_0x120eaa=_0x4940ab,_0x21b508=_0x1280ec['createRange'](_0x120eaa));}const _0x279eeb=_0x1280ec['createRange'](_0x120eaa);_0x466b85['markers']['has'](_0xd1e5b8)?(_0x1280ec['updateMarker'](_0xd1e5b8,{'range':_0x21b508}),_0x1280ec['updateMarker'](_0x383c31,{'range':_0x279eeb})):(_0x1280ec['addMarker'](_0xd1e5b8,{'range':_0x21b508,'usingOperation':!0x0}),_0x1280ec['addMarker'](_0x383c31,{'range':_0x279eeb,'usingOperation':!0x0}));}function G(_0x2160a7,_0x49a6ac,_0x5b9ddf){const _0x10cb0f=_0x2160a7['t'],t=_0x2160a7['t'];switch(_0x49a6ac){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0x10cb0f({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x5b9ddf);default:return'';}}let J=0x1;class l extends _0x2d3c3d{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x3be59a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x198b2a,_0xb8f378,_0x4775e8];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x44dd28=this['serverHistory']['getOperations']();for(let _0x5a4cc6=_0x44dd28['length']-0x1;_0x5a4cc6>=0x0;_0x5a4cc6--){const _0x1291ff=_0x44dd28[_0x5a4cc6];if(!this['_disconnectionOperations']['has'](_0x1291ff))return _0x1291ff['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x217c3a){if(super(_0x217c3a),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2d6d08(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x42186d('collaboration-missing-channelid',this);const _0x4ddd88=_0x217c3a['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4ddd88,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3c22ea(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Y(this['_disconnectionOperations']);}['init'](){const _0x35c916=this['editor'],_0x4dbe79=_0x35c916['plugins']['get'](_0xb8f378),_0x2bfde0=_0x35c916['plugins']['get'](c);this['listenTo'](_0x4dbe79,'getOperationAuthor',(_0x4cc6ca,_0xd11c9f)=>{const _0x1b3d4a=_0xd11c9f[0x0];_0x1b3d4a['_authorId']&&(_0x4cc6ca['return']=_0x4dbe79['getUser'](_0x1b3d4a['_authorId']),_0x4cc6ca['stop']()),null===_0x1b3d4a['_authorId']&&(_0x4cc6ca['return']=null,_0x4cc6ca['stop']());},{'priority':'high'}),this['listenTo'](_0x35c916['model']['document']['selection'],'change:range',(_0xa0bc96,_0x31b7ef)=>{_0x31b7ef['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x35c916['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x35c916['model']['on']('applyOperation',(_0x54057a,_0x3f835d)=>{const _0x2b4769=_0x3f835d[0x0];_0x2b4769['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2b4769),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2bfde0,'state',this,'_hasSynchronizationProblem',(_0x346a4c,_0x4df4f8)=>'connected'===_0x346a4c&&!_0x4df4f8),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x35c916['disableReadOnlyMode']('rtc-offline'):_0x35c916['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x35c916['disableReadOnlyMode']('rtc-offline'):_0x35c916['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5efe81=this['editor']['plugins']['get'](i),_0x6e2367=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x5efe81['unregister'](this['_channelId']);const _0x2dd901=await this['_service']['reconnect'](_0x6e2367['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x2dd901)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1f8c2a=await this['_service']['getConnectedSessions']();_0x5efe81['register'](this['_channelId'],_0x1f8c2a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1f9344){if(function(_0x9b1e4){return'404'===_0x9b1e4['code'];}(_0x1f9344)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x14b323){return'409'===_0x14b323['code'];}(_0x1f9344)){const _0x1768f3=G(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x1768f3);}else{if(!(_0x1f9344 instanceof Q))throw _0x1f9344;this['_handleReconnectionError']();}}}}['destroy'](){const _0xf0d283=this['editor']['plugins']['get'](c),_0x433bea=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x433bea['channelSessions']['has'](this['_channelId'])&&_0x433bea['unregister'](this['_channelId']),_0xf0d283['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4a08b5){if(this['sessionId']!==_0x4a08b5['sessionId']&&this['_lastSyncedOperationId']!==_0x4a08b5['lastOperationId'])throw new Q();return this['sessionId']=_0x4a08b5['sessionId'],this['_handleServerResponse']([],{..._0x4a08b5,'wereChangesApplied':!0x1,'data':_0x4a08b5['data']},'reconnect');}async['_connectService'](_0x4dbcf7,_0x59a443=!0x1){const {connection:_0x36682e}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x36682e,this['_channelId'])['then'](_0x24b860=>this['_initSessionsHandling'](_0x24b860))['catch'](_0x5a4f87=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5a4f87);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x2de53b,_0x523e1a)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x523e1a);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x25cad0=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4dbcf7);this['_isPendingUpdate']=!0x0;const _0xb9d01f=await this['_service']['connect'](_0x36682e,this['_compressOperations'](_0x4dbcf7),_0x25cad0);if(this['sessionId']=_0xb9d01f['sessionId'],_0x59a443){if(!_0xb9d01f['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xb9d01f['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4dbcf7,_0xb9d01f,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xb9d01f,_0x4dbcf7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x15053c=this['editor']['plugins']['get'](i),_0x51e5d0=this['editor']['plugins']['get'](q),_0x57b3ac=_0x15053c['channelSessions']['get'](this['_channelId']);_0x57b3ac&&_0x57b3ac['length']>0x1?_0x51e5d0['createUserMarkerOperations']():this['listenTo'](_0x15053c,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x15053c['channelSessions']['get'](this['_channelId'])['length']&&_0x51e5d0['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x342a71,_0x2d680e,_0x528852,_0x323577){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2d680e){const _0x208267=this['_decompressOperations'](_0x528852,_0x323577);await this['_fetchMissingUsers'](_0x208267),this['_handleExternalOperations'](_0x208267,_0x2d680e,_0x528852['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x331956}=this['editor'];let _0x1eb9f2;try{_0x1eb9f2=await this['_service']['getDocumentDetails']();}catch{const _0x4f898d=G(_0x331956,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x4f898d);}const _0x181712=_0x1eb9f2['currentDocumentSession']||_0x1eb9f2['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x181712['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x434ff1=G(_0x331956,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x434ff1);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x32abf3){const _0x126fb0=this['editor']['plugins']['get'](i);this['listenTo'](_0x126fb0,'sessionAdd:'+this['_channelId'],(_0x320002,{session:_0x5d4e69})=>{if(_0x5d4e69['id']===_0x126fb0['mySessionId']){_0x320002['off']();const _0x16b11e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x23b794=_0x5d4e69['permissions'];_0x16b11e&&_0x16b11e['isEnabled']&&(_0x23b794=_0x23b794['filter'](_0xe890a0=>'document:write'!==_0xe890a0)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x23b794,this['_channelId']);}}),_0x126fb0['register'](this['_channelId'],_0x32abf3);}['_initThrowingOnDataSet'](){const _0x3146b7=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2a95db)=>{if(!_0x2a95db[_0x2a95db['length']-0x1]['suppressErrorInCollaboration'])throw new _0x42186d('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3146b7['apply'](this['editor']['data'],_0x2a95db);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x56c998,[_0x57b49b])=>{if(this['_document']['version'])throw new _0x42186d('realtimecollaborationclient-init-document-already-initialized',this);_0x56c998['stop'](),this['_setPendingAction']();const _0xa38023=this['editor']['config']['get']('rootsAttributes'),_0x2d157a=this['_getOperationsFromInitData'](_0x57b49b,_0xa38023);0x0==_0x2d157a['length']&&_0x2d157a['push'](new _0x9a9dca(0x0)),_0x56c998['return']=this['_connectService'](_0x2d157a)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3d0dc7=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3d0dc7))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x520532,[_0x1decfe,_0x1b16f4])=>{_0x520532['stop']();const _0xa5db2f=this['editor']['model']['document']['getRoot'](_0x1decfe);if(!this['_knownRootNames']['has'](_0x1decfe)){const _0x208223=_0x1b16f4&&_0x1b16f4['data']?_0x1b16f4['data']:'',_0x5c5958=_0x1b16f4&&_0x1b16f4['attributes']?_0x1b16f4['attributes']:{};await this['_loadRoot'](_0x1decfe,_0x208223,_0x5c5958);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0xa5db2f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0xa5db2f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x6e4728){const _0x166e7a=this['editor']['plugins']['get'](_0xb8f378),{connection:_0x1e0f41}=this['editor']['plugins']['get'](c),_0x64981f=new Set();for(const _0x4f3eee of _0x6e4728){const _0x3079cb=_0x4f3eee['_authorId'];_0x3079cb&&!_0x166e7a['getUser'](_0x3079cb)&&_0x64981f['add'](_0x3079cb);}if(0x0===_0x64981f['size'])return;const _0x2b29a4=await dt['getMany'](_0x1e0f41,Array['from'](_0x64981f));for(const _0xd549ea of _0x2b29a4)_0x166e7a['getUser'](_0xd549ea['id'])||_0x166e7a['addUser'](_0xd549ea);}['_getOperationsFromInitData'](_0x5bee2d,_0x4eecca={}){const _0x28f7fa=this['editor']['model'],_0x6aa9ef=[];let _0x28f34d=0x0;const _0x195ed4='string'==typeof _0x5bee2d?{'main':_0x5bee2d}:_0x5bee2d;for(const _0x50a8f4 of Object['keys'](_0x195ed4)){if(!this['_document']['roots']['has'](_0x50a8f4))throw new _0x42186d('realtimecollaborationclient-init-non-existent-root',this);const _0xeff023=this['editor']['data']['parse'](_0x195ed4[_0x50a8f4]),_0x1f075c=this['_document']['getRoot'](_0x50a8f4),_0x444b15=new _0x4536dc(_0x28f7fa['createPositionAt'](_0x1f075c,0x0),_0xeff023,_0x28f34d++);_0x6aa9ef['push'](_0x444b15);for(const [_0x4e063d,_0x4772e8]of _0xeff023['markers']){const _0x2f859c=_0x28f7fa['createRange'](_0x28f7fa['createPositionFromPath'](_0x1f075c,_0x4772e8['start']['path']['slice']()),_0x28f7fa['createPositionFromPath'](_0x1f075c,_0x4772e8['end']['path']['slice']())),_0x5627b0=new _0x226fed(_0x4e063d,null,_0x2f859c,_0x28f7fa['markers'],!0x0,_0x28f34d++);_0x6aa9ef['push'](_0x5627b0);}}if(_0x4eecca)for(const [_0x197f87,_0x565d12]of Object['entries'](_0x4eecca)){const _0x2104b8=_0x28f7fa['document']['getRoot'](_0x197f87);if(!_0x2104b8)throw new _0x42186d('multi-root-editor-root-attributes-no-root',null);for(const [_0x4a41b0,_0x19b686]of Object['entries'](_0x565d12))if(null!==_0x19b686){const _0x437e01=new _0x2c43ba(_0x2104b8,_0x4a41b0,null,_0x19b686,_0x28f34d++);_0x6aa9ef['push'](_0x437e01);}}return _0x6aa9ef;}async['_loadRoot'](_0x51868e,_0x44e3aa,_0x15a1ef){this['_getOperationsFromInitData']({[_0x51868e]:_0x44e3aa},{[_0x51868e]:_0x15a1ef})['forEach']((_0x182a31,_0x520748)=>{_0x182a31['baseVersion']=this['_document']['version']+_0x520748,_0x182a31['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x182a31);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x406d84,_0x2d3153){let _0x24c9da;this['_offset']=_0x406d84['offset'];const _0x5cae5c=_0x406d84['wereChangesApplied']&&!_0x406d84['initData'],_0x34209e=_0x5cae5c?0x0:_0x406d84['data']['baseVersion'];if(_0x2d3153['forEach'](_0x37b9c9=>{_0x37b9c9['_isInit']=!0x0,_0x37b9c9['createdAt']=_0x406d84['sessionCreatedAt'],_0x37b9c9['_authorId']=null;}),_0x5cae5c)_0x24c9da=_0x2d3153,this['_applyOperationsSet'](_0x24c9da,_0x5cae5c);else{if(_0x406d84['initData']){const _0x3346ec=this['_getOperationsFromInitData'](_0x406d84['initData']);this['_document']['history']['version']=-_0x3346ec['length'],_0x3346ec['forEach'](_0x40c5dc=>{_0x40c5dc['baseVersion']-=_0x3346ec['length'],_0x40c5dc['createdAt']=_0x406d84['sessionCreatedAt'],_0x40c5dc['_isInit']=!0x0,_0x40c5dc['_authorId']=null;}),this['_applyOperationsSet'](_0x3346ec,!0x0),this['serverHistory']['version']=-_0x3346ec['length']+this['_offset'],this['_updateServerHistory'](_0x3346ec);}this['_document']['history']['version']=_0x34209e,_0x24c9da=this['_decompressOperations'](_0x406d84['data'],_0x406d84['metadata']),await this['_fetchMissingUsers'](_0x24c9da),this['_applyOperationsSet'](_0x24c9da,_0x5cae5c);}_0x406d84['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x24c9da,_0x406d84['lastOperationId']),this['_lastSyncedOperationId']=_0x406d84['lastOperationId']),this['serverHistory']['version']=_0x34209e+this['_offset'],this['_updateServerHistory'](_0x24c9da),_0x2d3153['filter'](_0x4189ca=>{const _0x26eb94=this['_getAffectedRoot'](_0x4189ca);return _0x26eb94&&!this['_knownRootNames']['has'](_0x26eb94);})['forEach']((_0x356695,_0x31f78a)=>{_0x356695['baseVersion']=this['_document']['version']+_0x31f78a,this['_saveOperationInBuffer'](_0x356695);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x27990d,_0x5f4f0f){const _0x89b3a8=_0x5f4f0f&&_0x5f4f0f['message'];if(_0x89b3a8&&_0x89b3a8['startsWith']('realtimecollaborationclient'))throw _0x5f4f0f;const _0x37f7a8=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x37f7a8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x42186d(_0x27990d,this['editor'],_0x89b3a8?{'originalError':_0x89b3a8}:void 0x0);}['_saveOperationInBuffer'](_0x26273b){this['_knownOperations']['has'](_0x26273b)||(this['_knownOperations']['add'](_0x26273b),this['_bufferedOperations']['push'](_0x26273b),this['_pendingAction']||'marker'==_0x26273b['type']&&!_0x26273b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x1764d0=!0x1){!_0x1764d0&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xbc0f77=>{_0xbc0f77&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0xf37a2f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2b5694){return _0x2b5694['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2b5694['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2b5694['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0xf37a2f)||this['_crash'](_0xf37a2f['message'],_0xf37a2f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x480694=>{this['on']('change:_isPendingUpdate',()=>{_0x480694();});});}async['_sendBufferedOperations'](){const _0x37114a=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x37114a['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x38c329=[...this['_bufferedOperations']];for(const _0x29bcb6 of _0x38c329)_0x29bcb6['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x29bcb6);const _0x59b19e=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x38c329),_0x533f11=J++,_0x47c914=this['_compressOperations'](_0x38c329),_0x160b1b=await this['_service']['sendOperations'](_0x47c914,_0x47c914['baseVersion'],_0x59b19e);try{return await this['_handleServerResponse'](_0x38c329,_0x160b1b,_0x533f11);}catch(_0x456a5c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x456a5c);}}async['_handleServerResponse'](_0x4f6039,_0x18716a,_0x4855ff){if('error'in _0x18716a)throw _0x18716a['error'];let _0x2d4634=!0x1;if(_0x18716a['wereChangesApplied']){_0x18716a['lastOperationId']&&(this['_lastSyncedOperationId']=_0x18716a['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x197a9f=>!_0x4f6039['includes'](_0x197a9f));for(const _0x3ca634 of _0x4f6039)_0x3ca634['createdAt']='lastOperationAcceptedAt'in _0x18716a&&_0x18716a['lastOperationAcceptedAt']||void 0x0;X(_0x4f6039,_0x18716a['version']-_0x4f6039['length']),this['_updateServerHistory'](_0x4f6039);const _0x47c49c=_0x4f6039['filter'](_0xcd0751=>{if(!_0xcd0751['_isInit'])return!0x1;const _0x5d43c5=this['_getAffectedRoot'](_0xcd0751);return _0x5d43c5&&!this['_knownRootNames']['has'](_0x5d43c5);});X(_0x47c49c,this['_document']['version']),this['_applyOperationsSet'](_0x47c49c),_0x2d4634=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4b0eae=this['_decompressOperations'](_0x18716a['data'],_0x18716a['metadata'])['filter'](_0x4aaf92=>_0x4aaf92['baseVersion']>=this['_lastServerVersion']);_0x4b0eae['forEach'](_0x1aa55c=>this['_addKnownRoot'](_0x1aa55c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5f4498=>!_0x5f4498['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5f4498))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x4b0eae),_0x2d4634=this['_handleExternalOperations'](_0x4b0eae,_0x18716a['version'],_0x18716a['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x2d4634?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x43d81b,_0x313654,_0x149013){try{const _0x26e3df={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2e06a4,operationsB:_0x9cfce5,originalOperations:_0x3ef869}=_0x138667(_0x43d81b,this['_bufferedOperations'],_0x26e3df);X(_0x2e06a4,this['_document']['version']),X(_0x9cfce5,_0x313654);for(const _0x4ba2e6 of _0x2e06a4){const _0x25327e=_0x3ef869['get'](_0x4ba2e6);_0x4ba2e6['_authorId']=_0x25327e?_0x25327e['_authorId']:null;}_0x149013&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x43d81b,_0x149013),this['_lastSyncedOperationId']=_0x149013),this['_bufferedOperations']=[..._0x9cfce5],this['_applyOperationsSet'](_0x2e06a4),this['_updateServerHistory'](_0x43d81b);}catch(_0x3decb0){return console['error'](_0x3decb0),!0x1;}return!0x0;}['_applyOperationsSet'](_0x42ada7,_0x218b17=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3db3c3=>{for(const _0x471a47 of _0x42ada7)this['_knownOperations']['add'](_0x471a47),this['_addKnownRoot'](_0x471a47),_0x3db3c3['batch']['addOperation'](_0x471a47),this['editor']['model']['applyOperation'](_0x471a47);});}['_addKnownRoot'](_0x5dd61a){const _0x72b09d=this['_getAffectedRoot'](_0x5dd61a);_0x72b09d&&this['_knownRootNames']['add'](_0x72b09d);}['_getAffectedRoot'](_0x24069a){let _0x50306b,_0x259174;switch(_0x24069a['type']){case'insert':_0x50306b=_0x24069a['position']['root'];break;case'marker':if(_0x259174=_0x24069a['newRange'],!_0x259174)return null;_0x50306b=_0x259174['root'];break;case'addRootAttribute':_0x50306b=_0x24069a['root'];break;case'addRoot':_0x50306b=_0x24069a['affectedSelectable'];break;case'move':_0x50306b=_0x24069a['targetPosition']['root'];break;default:return null;}return _0x50306b['rootName'];}['_updateServerHistory'](_0x35058f){_0x35058f['forEach'](_0x41f4c4=>{const _0x358508=_0x41f4c4['clone']();_0x358508['_authorId']=_0x41f4c4['_authorId'],_0x358508['_isInit']=!!_0x41f4c4['_isInit'],_0x358508['createdAt']=_0x41f4c4['createdAt'],_0x358508['baseVersion']+=this['_offset'],_0x41f4c4['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x358508),this['serverHistory']['addOperation'](_0x358508);});}['_handleReconnectionError'](_0x3b7e56){const _0x2b60e5=this['editor']['plugins']['get']('Notification'),_0xa1c37b=this['editor']['locale'];_0x3b7e56||(_0x3b7e56=G(_0xa1c37b,'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x2b60e5['showWarning'](_0x3b7e56,{'title':G(_0xa1c37b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x198b2a)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x198b2a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x58f241){const _0x102a18=_0x58f241['map'](_0x42f0ff=>_0x42f0ff['toJSON']());return this['_compressor']['compress'](_0x102a18);}['_decompressOperations'](_0xbeadac,_0x5aca23){return this['_compressor']['decompress'](_0xbeadac)['map']((_0x586cde,_0x1b7d9f)=>{const _0x29701e='init'==_0x5aca23[_0x1b7d9f]['type'];if('InsertOperation'==_0x586cde['__className']){const _0x133168=_0x586cde['position']['root'];!this['_document']['getRoot'](_0x133168)&&(this['_document']['createRoot']('$root',_0x133168)['_isAttached']=!0x1);}const _0x3e16bf=_0x48a87d['fromJSON'](_0x586cde,this['_document']);return _0x3e16bf['wasUndone']=_0x586cde['wasUndone'],_0x3e16bf['_isInit']=_0x29701e,_0x3e16bf['_authorId']=_0x29701e?null:_0x5aca23[_0x1b7d9f]['userId'],_0x3e16bf['_isDisconnection']='cs:removeUser'===_0x5aca23[_0x1b7d9f]['type'],_0x3e16bf['createdAt']=_0x5aca23[_0x1b7d9f]['createdAt'],_0x3e16bf;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x46750c=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x46750c&&_0x46750c['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x2e8a7a,_0x5412b5){for(const _0x2d8294 of _0x2e8a7a)_0x2d8294['baseVersion']=_0x5412b5++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x210026){this['_ignoredOperations']=_0x210026,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1e5c34){let _0x4cbbd4=_0x1e5c34['length'];for(;_0x4cbbd4--;){const _0x1882d9=_0x1e5c34[_0x4cbbd4];if(!this['_ignoredOperations']['has'](_0x1882d9)){if(!this['_operationToId']['has'](_0x1882d9)){const _0x108db7=_0x401110()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1882d9,_0x108db7);}return this['_operationToId']['get'](_0x1882d9);}}}['setIdForTheLastOperation'](_0x3cac63,_0x42cce2){if(!_0x42cce2)return;let _0x5ab31d=_0x3cac63['length'];for(;_0x5ab31d--;){const _0x372c50=_0x3cac63[_0x5ab31d];this['_ignoredOperations']['has'](_0x372c50)||this['_operationToId']['set'](_0x372c50,_0x42cce2);}}}class n extends _0x2d3c3d{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x6e3cec{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x20bf0f)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0xb8f378];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x111dc5){super(_0x111dc5),this['_services']=new Map();}async['init'](){const _0x4a8d04=this['context'],_0x129c9c=_0x4a8d04['plugins']['get']('CommentsRepository');if(_0x4a8d04['plugins']['get'](c)['addToReconnectionStack'](this),_0x129c9c['adapter']={'addCommentThread':async({channelId:_0x5aebef,threadId:_0x22108d,comments:_0x247a37,resolvedAt:_0x4f289e,resolvedBy:_0x432163,context:_0x1112ae,attributes:_0x40ac06})=>{const _0x582699=await this['_getService'](_0x5aebef)['addCommentThread']({'commentThreadId':_0x22108d,'comments':_0x247a37['map'](_0x55d52a=>function(_0xd323c6,_0x16e105,_0x39fdaa){return{'commentThreadId':_0x39fdaa,'commentId':_0xd323c6['commentId'],'userId':_0xd323c6['authorId'],'content':_0xd323c6['content'],'documentId':_0x16e105,'createdAt':_0xd323c6['createdAt'],'attributes':_0xd323c6['attributes']||{}};}(_0x55d52a,_0x5aebef,_0x22108d)),'resolvedAt':_0x4f289e,'resolvedBy':_0x432163,'context':_0x1112ae,'attributes':_0x40ac06})['catch'](ut);return{'threadId':_0x582699['commentThreadId'],'comments':_0x582699['comments']};},'getCommentThread':async({channelId:_0x45fa80,threadId:_0x108283})=>{const _0x157148=await this['_getService'](_0x45fa80)['getCommentThread'](_0x108283)['catch'](ut);return _0x157148['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x157148]),{'threadId':_0x157148['commentThreadId'],'comments':_0x157148['comments']['map'](_),'context':_0x157148['context'],'resolvedAt':_0x157148['resolvedAt'],'resolvedBy':_0x157148['resolvedBy'],'attributes':_0x157148['attributes']||{}});},'updateCommentThread':async({channelId:_0x24dcfd,threadId:_0x41931e,context:_0x361935,unlinkedAt:_0x1f32cc,attributes:_0x22836a})=>this['_getService'](_0x24dcfd)['updateCommentThread']({'commentThreadId':_0x41931e,'context':_0x361935,'attributes':_0x22836a,'unlinkedAt':_0x1f32cc})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x29e630,threadId:_0x4df2eb})=>{const _0x2e2b7e=await this['_getService'](_0x29e630)['resolveCommentThread'](_0x4df2eb)['catch'](S)['catch'](ut);return{'threadId':_0x2e2b7e['commentThreadId'],'resolvedAt':_0x2e2b7e['resolvedAt'],'resolvedBy':_0x2e2b7e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x6633cb,threadId:_0x26e78d})=>this['_getService'](_0x6633cb)['reopenCommentThread'](_0x26e78d)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x874241,threadId:_0x46d774})=>this['_getService'](_0x874241)['removeCommentThread'](_0x46d774)['catch'](S)['catch'](ut),'addComment':({channelId:_0xed5b60,threadId:_0x5b095e,commentId:_0x523e4c,content:_0x4ac8f2,attributes:_0x9285a2})=>this['_getService'](_0xed5b60)['addComment'](_0x5b095e,_0x523e4c,_0x4ac8f2,_0x9285a2)['catch'](ut),'updateComment':({channelId:_0x232105,threadId:_0x599a5a,commentId:_0x1b8afe,content:_0x4ccaaa,attributes:_0x5ef4fc})=>this['_getService'](_0x232105)['updateComment'](_0x599a5a,_0x1b8afe,_0x4ccaaa,_0x5ef4fc)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x73f578,threadId:_0x41fa3c,commentId:_0x497692})=>this['_getService'](_0x73f578)['removeComment'](_0x41fa3c,_0x497692)['catch'](S)['catch'](ut)},_0x4a8d04 instanceof _0x427df){const _0xa5f47b=_0x4a8d04['config']['get']('collaboration.channelId'),_0x49866b=_0x4a8d04['plugins']['get'](i);await this['_setUpService'](_0xa5f47b);const _0x4c76d7=await this['_services']['get'](_0xa5f47b)['getConnectedSessions']();this['listenTo'](_0x49866b,'sessionAdd:'+_0xa5f47b,(_0x333d94,{session:_0xd99ec6})=>{_0xd99ec6['id']===_0x49866b['mySessionId']&&(_0x333d94['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0xd99ec6['permissions'],_0xa5f47b));}),_0x49866b['register'](_0xa5f47b,_0x4c76d7);}}async['_setUpService'](_0x26c4a1){if(this['_services']['has'](_0x26c4a1))throw new _0x42186d('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x26c4a1});const _0x3fe41f=this['context']['plugins']['get']('CommentsRepository'),_0x5da069=new a['CommentsService'](_0x26c4a1);this['_services']['set'](_0x26c4a1,_0x5da069),this['listenTo'](_0x5da069,'commentThreadAdded',(_0x5f316f,_0x436b5a)=>{const {commentThreadId:_0xebd85e,documentId:_0x29795c,context:_0x5e4125,attributes:_0x4ef92f,resolvedAt:_0x227d1a,resolvedBy:_0x5dd020,comments:_0x30303e}=_0x436b5a;_0x3fe41f['getCommentThread'](_0xebd85e)||_0x3fe41f['addCommentThread']({'threadId':_0xebd85e,'channelId':_0x29795c,'comments':_0x30303e?_0x30303e['map'](_):[],'context':_0x5e4125,'attributes':_0x4ef92f,'resolvedAt':_0x227d1a,'resolvedBy':_0x5dd020,'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadUpdated',(_0x1aa0ba,{commentThreadId:_0x5f1a4b,documentId:_0x236490,context:_0x904839,unlinkedAt:_0x1ec780,attributes:_0x134872})=>{_0x3fe41f['getCommentThread'](_0x5f1a4b)&&_0x3fe41f['updateCommentThread']({'threadId':_0x5f1a4b,'channelId':_0x236490,'context':_0x904839,'unlinkedAt':_0x1ec780,'attributes':_0x134872,'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadResolved',(_0x43994b,{commentThreadId:_0x3164ea,resolvedBy:_0x19cea6,resolvedAt:_0x2dceb7})=>{const _0x5a66e1=_0x3fe41f['getCommentThread'](_0x3164ea);_0x5a66e1&&_0x5a66e1['resolve']({'resolvedBy':_0x19cea6,'resolvedAt':_0x2dceb7,'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadReopened',(_0x19121a,{commentThreadId:_0x2c687d})=>{const _0x1fcdba=_0x3fe41f['getCommentThread'](_0x2c687d);_0x1fcdba&&_0x1fcdba['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadRemoved',(_0x34d9a6,{commentThreadId:_0x4e6f89})=>{const _0xdc4569=_0x3fe41f['getCommentThread'](_0x4e6f89);_0xdc4569&&_0xdc4569['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentAdded',(_0x187920,_0x120934)=>{const _0x1231c6=_0x120934['commentThreadId'],_0x4a58b7=_0x3fe41f['getCommentThread'](_0x1231c6);_0x4a58b7&&_0x4a58b7['addComment']({..._(_0x120934),'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentUpdated',(_0x31c919,{commentThreadId:_0x538797,commentId:_0x27cdba,content:_0x2ff7b5,attributes:_0x3101f1})=>{const _0x4e6ccc=_0x3fe41f['getCommentThread'](_0x538797);if(_0x4e6ccc){const _0x432bf9=_0x4e6ccc['getComment'](_0x27cdba);_0x432bf9&&_0x432bf9['update']({'content':_0x2ff7b5,'attributes':_0x3101f1,'isFromAdapter':!0x0});}}),this['listenTo'](_0x5da069,'commentRemoved',(_0x46185a,{commentThreadId:_0x2d4449,commentId:_0x784b1})=>{const _0x598c84=_0x3fe41f['getCommentThread'](_0x2d4449);if(_0x598c84){const _0x285e0b=_0x598c84['getComment'](_0x784b1);_0x285e0b&&_0x285e0b['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x26c4a1);}['destroy'](){if(this['context']instanceof _0x427df){const _0x3c4c94=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3c4c94);}}['_terminateService'](_0x4beeb0){if(!this['_services']['has'](_0x4beeb0))throw new _0x42186d('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4beeb0});this['_getService'](_0x4beeb0)['disconnect'](),this['_services']['delete'](_0x4beeb0);}async['reconnect'](){for(const _0x5bb00c of this['_services']['keys']())await this['_connectService'](_0x5bb00c);if(this['context']instanceof _0x427df){const _0x1e9ab5=this['context']['config']['get']('collaboration.channelId'),_0x2ab12c=this['context']['plugins']['get'](i);_0x2ab12c['unregister'](_0x1e9ab5);const _0x537fd2=await this['_services']['get'](_0x1e9ab5)['getConnectedSessions']();_0x2ab12c['register'](_0x1e9ab5,_0x537fd2);}}async['_connectService'](_0x13aba3){const {connection:_0x45911a}=this['context']['plugins']['get'](c),_0xcafee1=this['context']['plugins']['get']('CommentsRepository'),_0x35329c=this['_services']['get'](_0x13aba3),_0x22af57=await _0x35329c['connect'](_0x45911a);await this['_fetchMissingUsersForThreads'](_0x22af57);const _0xe95199=new Set(Array['from'](_0xcafee1['getCommentThreads']({'channelId':_0x13aba3}),_0x4b3575=>_0x4b3575['id']));for(const _0x50ca11 of _0x22af57)_0x50ca11['deletedAt']||_0xe95199['delete'](_0x50ca11['commentThreadId']);for(const _0x1c5977 of _0xe95199)_0xcafee1['getCommentThread'](_0x1c5977)['remove']({'isFromAdapter':!0x0});for(const _0x225769 of _0x22af57){let _0x5e503d=_0xcafee1['getCommentThread'](_0x225769['commentThreadId']);const {commentThreadId:_0xee6b91,context:_0x157b8f,attributes:_0x1ff237,resolvedBy:_0x40de5b,resolvedAt:_0x39d64d,unlinkedAt:_0x1128d8,deletedAt:_0x3b4a2d}=_0x225769;if(_0x3b4a2d)continue;_0x5e503d||(_0x5e503d=_0xcafee1['addCommentThread']({'channelId':_0x13aba3,'threadId':_0xee6b91,'context':_0x157b8f,'attributes':_0x1ff237||{},'resolvedBy':_0x40de5b,'resolvedAt':_0x39d64d,'unlinkedAt':_0x1128d8,'isFromAdapter':!0x0}));const _0x3711de=new Set(Array['from'](_0x5e503d['comments'],_0x580eea=>_0x580eea['id']));for(const _0x588b18 of _0x225769['comments'])_0x3711de['delete'](_0x588b18['commentId']);for(const _0x2eb3dd of _0x3711de)_0x5e503d['getComment'](_0x2eb3dd)['remove']({'isFromAdapter':!0x0});for(const _0x3d4273 of _0x225769['comments']){const _0x338410=_0x5e503d['getComment'](_0x3d4273['commentId']);_0x338410?_0x338410['content']!==_0x3d4273['content']&&_0x338410['update']({'content':_0x3d4273['content'],'isFromAdapter':!0x0}):_0x5e503d['addComment'](Object['assign'](_(_0x3d4273),{'isFromAdapter':!0x0}));}}}['_getService'](_0x578421){if(!this['_services']['has'](_0x578421))throw new _0x42186d('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x578421});return this['_services']['get'](_0x578421);}async['_fetchMissingUsersForThreads'](_0x39cfb1){const _0x4b6d81=this['context']['plugins']['get'](_0xb8f378),{connection:_0x549e10}=this['context']['plugins']['get'](c),_0x28712c=new Set();for(const {resolvedBy:_0x235d6e,comments:_0x320ca9}of _0x39cfb1){_0x235d6e&&!_0x4b6d81['getUser'](_0x235d6e)&&_0x28712c['add'](_0x235d6e);for(const {userId:_0x4ca853}of _0x320ca9)_0x4b6d81['getUser'](_0x4ca853)||_0x28712c['add'](_0x4ca853);}if(0x0===_0x28712c['size'])return;const _0x5147e3=await dt['getMany'](_0x549e10,Array['from'](_0x28712c));for(const _0x468779 of _0x5147e3)_0x4b6d81['getUser'](_0x468779['id'])||_0x4b6d81['addUser'](_0x468779);}}async function S(_0x40529c){if('404'!==_0x40529c['code'])throw _0x40529c;}function ut(_0x4f3b44){if((_0x2d0038=_0x4f3b44)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2d0038['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2d0038['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2d0038;throw _0x4f3b44;}function _(_0x571b37){return{'threadId':_0x571b37['commentThreadId'],'commentId':_0x571b37['commentId'],'content':_0x571b37['content'],'createdAt':_0x571b37['createdAt'],'authorId':_0x571b37['userId'],'attributes':_0x571b37['attributes']||{}};}class f extends _0x2d3c3d{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c7853){super(_0x2c7853);const _0x34186a=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x34186a);}['init'](){const _0x36271c=this['editor']['plugins']['get'](c),_0x584105=this['editor']['plugins']['get']('TrackChangesEditing');return _0x584105['adapter']={'getSuggestion':async _0x3a26aa=>{await this['_waitForServiceReady']();const _0x571db9=await this['_trackChangesService']['get'](_0x3a26aa)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x571db9]),_0x571db9;},'addSuggestion':async({id:_0x3903e0,type:_0x564ef2,data:_0x5563cc,originalSuggestionId:_0x592b7c,attributes:_0x27c7c2})=>{await this['_waitForServiceReady']();const _0xb86823={'id':_0x3903e0,'type':_0x564ef2,'data':_0x5563cc,'originalSuggestionId':_0x592b7c,'attributes':_0x27c7c2},_0x19b22a=await this['_trackChangesService']['add'](_0x3903e0,_0x564ef2,_0x5563cc,_0x592b7c,_0x27c7c2)['catch'](_0x4aa8f9=>{if(ft(_0x4aa8f9))return new Promise(_0x189327=>{this['_bufferedRequests']['set'](_0x3903e0,{'resolve':_0x189327,'suggestionData':_0xb86823});});throw _0x4aa8f9;});return this['_bufferedRequests']['delete'](_0x3903e0),_0x19b22a;},'updateSuggestion':async(_0x370c0e,_0x2a25c8)=>{if(await this['_waitForServiceReady'](),'open'!==_0x2a25c8['state'])return this['_trackChangesService']['update'](_0x370c0e,_0x2a25c8)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1ae932,_0x1dc748)=>{_0x584105['hasSuggestion'](_0x1dc748['id'])&&(_0x584105['getSuggestion'](_0x1dc748['id'])['attributes']=_0x1dc748['attributes']);}),this['_trackChangesService']['connect'](_0x36271c['connection'])['then'](_0x32d4c1=>(_0x36271c['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x32d4c1)['then'](()=>{for(const _0x1a6814 of _0x32d4c1){_0x584105['addSuggestionData'](_0x1a6814)['_saved']=!0x0;}})));}async['reconnect'](){const _0x376b5b=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3097c1}=this['editor']['plugins']['get'](c),_0x3f77c6=await this['_trackChangesService']['connect'](_0x3097c1);await this['_fetchMissingUsersForThreads'](_0x3f77c6);for(const {suggestionData:_0x3961de,resolve:_0x90d0d8}of this['_bufferedRequests']['values']()){let _0x2df5a2=_0x3f77c6['find'](_0x9e9565=>_0x9e9565['id']===_0x3961de['id']);_0x2df5a2||(_0x2df5a2=await this['_trackChangesService']['add'](_0x3961de['id'],_0x3961de['type'],_0x3961de['data'],_0x3961de['originalSuggestionId'])),_0x90d0d8(_0x2df5a2);}for(const _0xba0e03 of _0x3f77c6)_0x376b5b['hasSuggestion'](_0xba0e03['id'])||_0x376b5b['addSuggestionData'](_0xba0e03);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2f62c9=>{this['listenTo'](this['_trackChangesService'],'connected',_0xa90d10=>{_0xa90d10['off'](),_0x2f62c9();});});}async['_fetchMissingUsersForThreads'](_0x1e8277){const _0x12c73f=this['editor']['plugins']['get'](_0xb8f378),{connection:_0x291b50}=this['editor']['plugins']['get'](c),_0x44c79f=new Set();for(const {authorId:_0x47e41a}of _0x1e8277)_0x12c73f['getUser'](_0x47e41a)||_0x44c79f['add'](_0x47e41a);if(0x0===_0x44c79f['size'])return;const _0x246da0=await dt['getMany'](_0x291b50,Array['from'](_0x44c79f));for(const _0x544e9f of _0x246da0)_0x12c73f['getUser'](_0x544e9f['id'])||_0x12c73f['addUser'](_0x544e9f);}}function R(_0x13f10d){if(ft(_0x13f10d))return new Promise(()=>{});throw _0x13f10d;}function ft(_0x40c049){return _0x40c049['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x40c049['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x2d3c3d{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x392553=this['editor']['plugins']['get'](c),_0x2eb82e=this['editor']['plugins']['get']('CommentsEditing'),_0x100647=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x392553,'change:state',(_0x178dd5,_0x2a9e0c,_0xebbe2a)=>{_0x2eb82e['isThreadsLoadingPaused']='connected'!==_0xebbe2a;});}),this['listenTo'](_0x392553,'change:state',(_0x1d5c95,_0x34e034,_0x261edf)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x261edf);}),_0x100647['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x2d3c3d{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x2d3c3d{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0xb8f378];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b8e93){super(_0x5b8e93);const _0xbf7f84=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0xbf7f84);}async['init'](){const _0x46f720=this['editor']['plugins']['get'](l),_0x3a879e=_0x46f720['serverHistory'],_0x22553f=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x3a879e,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x46f720['sessionId']});const _0x2c9ebb=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x2e04d6=await tt['isBundleUploaded'](_0x22553f['connection'],_0x2c9ebb);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x16df4f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x16df4f)),'updateRevisions':async _0xb9e078=>{await this['_waitForServiceReady']();const _0xa50f0e=this['_revisionTracker']['currentRevision'];if(_0x2e04d6&&0x1===_0xb9e078['length']&&_0xb9e078[0x0]['id']===_0xa50f0e['id'])return _0xb9e078;for(const _0x3a286b of _0xb9e078)_0x3a286b['id']===_0xa50f0e['id']&&(_0x3a286b['isEmptyCurrent']=_0x3a286b['fromVersion']===_0x3a286b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xb9e078,this['_lastRequestId'])['then'](_0x5c774b=>(this['_lastRequestId']=_0x5c774b,_0xb9e078))['catch'](_0xda3ba1=>{if(st(_0xda3ba1)||'400'===_0xda3ba1['code']&&void 0x0!==_0xda3ba1['data']['wrongRequestId']){for(const _0x51d38e of _0xb9e078){!this['_revisionTracker']['repository']['getRevision'](_0x51d38e['id'])||this['_revisionTracker']['_bufferUpdate'](_0x51d38e['id'],_0x51d38e,!0x1);}if(st(_0xda3ba1))throw _0xda3ba1;return _0xb9e078;}throw _0xda3ba1;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xd297bf,{revisionsData:_0x5f6dac,requestId:_0x417085})=>{Math['max'](..._0x5f6dac['map'](_0x40070b=>_0x40070b['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5f6dac,_0x417085);}):this['_handleRevisionsUpdate'](_0x5f6dac,_0x417085);});const {revisions:_0x150b53,requestId:_0xef2f06}=await this['_revisionHistoryService']['connect'](_0x22553f['connection']);_0x22553f['addToReconnectionStack'](this),this['_lastRequestId']=_0xef2f06,await this['_fetchMissingUsers'](_0x150b53);for(const _0x1c6785 of _0x150b53)this['_revisionTracker']['addRevisionData'](_0x1c6785);this['listenTo'](_0x46f720,'change:_isConnected',(_0x1bb490,_0x178042,_0xc1bbdd)=>{_0xc1bbdd&&(this['_oldOffset']=_0x46f720['_offset'],_0x1bb490['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x22553f,'state',_0x351ae7=>_0x351ae7===_0x4e41a1['CONNECTED']);}async['reconnect'](){const _0x5c1baf=this['editor']['plugins']['get'](c),_0x37f83f=this['editor']['plugins']['get'](l),_0x3b9817=async()=>{const _0x41413d=this['_revisionTracker']['currentRevision'],_0x38266e=_0x41413d['id'],_0x16207d=_0x38266e!==_0x37f83f['sessionId'];if(_0x16207d){const _0xaa1a81=_0x37f83f['_offset']-this['_oldOffset'],_0xb792=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x41413d['toVersion']+_0xaa1a81!==_0xb792){const _0x2c3129=_0x41413d['fromVersion']+_0xaa1a81,_0x22555d=this['editor']['plugins']['get'](_0xb8f378),_0x5b55fe=this['_revisionTracker']['buildRevisionData']({'revision':_0x41413d,'from':_0x2c3129,'to':_0xb792});_0x5b55fe['id']=_0x41413d['id'];const _0xdf0332=_0x5b55fe['authorsIds']['map'](_0x108358=>_0x22555d['getUser'](_0x108358));_0x41413d['_update']({..._0x5b55fe,'authors':_0xdf0332},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x41413d['id'],_0x5b55fe,!0x0);}this['_revisionTracker']['_startingVersion']=_0xb792,(_0x41413d['toVersion']===_0x41413d['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x38266e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x38266e),this['_revisionTracker']['_createCurrentRevision'](_0xb792));}const {revisions:_0x2f9b0e,requestId:_0x6021a5}=await this['_revisionHistoryService']['reconnect'](_0x5c1baf['connection'],this['_lastRequestId']);_0x16207d&&_0x2f9b0e['length']>0x0?_0x37f83f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x2f9b0e),this['_handleRevisionsUpdate'](_0x2f9b0e,_0x6021a5),this['_revisionTracker']['sendBufferedUpdates']());};return _0x37f83f['_isConnected']?_0x3b9817():new Promise((_0x43594d,_0x3f342a)=>{_0x37f83f['once']('change:_isConnected',()=>{_0x3b9817()['then'](_0x43594d)['catch'](_0x3f342a);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x52bc50=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x483de0=>{_0x483de0['off'](),_0x52bc50();});});}['_getLatestVersionFromServerOperations'](){const _0x2d115c=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x238792 of _0x2d115c)if('marker'!==_0x238792['type']||_0x238792['affectsData'])return _0x238792['baseVersion']+0x1;}['_getLatestVersion'](){const _0x4ac4a4=this['editor']['plugins']['get'](l);return new Promise(_0x3a52a8=>{_0x4ac4a4['_isPendingUpdate']?_0x4ac4a4['once']('change:_isPendingUpdate',()=>{_0x3a52a8(this['_getLatestVersionFromServerOperations']());}):_0x3a52a8(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x33f3ee,_0x5f09ca){const _0x22ba26=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5f09ca;for(const _0x51db6a of _0x33f3ee){const _0x44dcef=_0x22ba26['getRevision'](_0x51db6a['id']);if(_0x44dcef){if((_0x51db6a['fromVersion']||_0x51db6a['toVersion'])&&(_0x51db6a['diffData']=null),_0x44dcef===this['_revisionTracker']['currentRevision']){const _0x2bbd47=Math['max'](_0x44dcef['toVersion'],_0x51db6a['toVersion']),_0x45d9e1=Math['max'](_0x44dcef['fromVersion'],_0x51db6a['fromVersion']);let _0x142fda;_0x44dcef['toVersion']===_0x51db6a['toVersion']&&_0x44dcef['fromVersion']===_0x51db6a['fromVersion']?(_0x142fda=!0x0,this['_preventResendingRevisionData'](_0x51db6a)):_0x51db6a['toVersion']===_0x2bbd47&&_0x51db6a['fromVersion']===_0x45d9e1?_0x142fda=!0x1:(_0x44dcef['toVersion']===_0x2bbd47&&_0x44dcef['fromVersion']===_0x45d9e1||this['_fixRevision']({'revision':_0x44dcef,'from':_0x45d9e1,'to':_0x2bbd47}),_0x142fda=!0x0),_0x142fda&&(delete _0x51db6a['fromVersion'],delete _0x51db6a['toVersion'],delete _0x51db6a['diffData'],delete _0x51db6a['createdAt'],delete _0x51db6a['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x51db6a),this['_preventResendingRevisionData'](_0x51db6a);}else this['_revisionTracker']['addRevisionData'](_0x51db6a);}const _0x45c155=_0x22ba26['getRevisions']();_0x45c155['reverse']();for(let _0x3e7dfe=0x0;_0x3e7dfe<_0x45c155['length']-0x1;_0x3e7dfe++){const _0x370b7b=_0x45c155[_0x3e7dfe],_0xf9bed9=_0x45c155[_0x3e7dfe+0x1];if(_0x370b7b['fromVersion']<_0xf9bed9['toVersion']){const _0x309730=_0xf9bed9['toVersion'],_0x374caa=Math['max'](_0x309730,_0x370b7b['toVersion']);this['_fixRevision']({'revision':_0x370b7b,'from':_0x309730,'to':_0x374caa});}}}['_fixRevision']({revision:_0x1d8ea8,from:_0x155e19,to:_0x2225b1}={}){const _0xda001d=this['editor']['plugins']['get'](_0xb8f378),_0x85a321=this['_revisionTracker']['buildRevisionData']({'revision':_0x1d8ea8,'from':_0x155e19,'to':_0x2225b1});_0x85a321['authors']=_0x85a321['authorsIds']['map'](_0x23ae3=>_0xda001d['getUser'](_0x23ae3)),_0x1d8ea8['_update'](_0x85a321);}['_preventResendingRevisionData'](_0x14687a){const _0x32fb61={};_0x32fb61['id']=_0x14687a['id'];for(const _0x16f65f of Object['keys'](_0x14687a))'id'!==_0x16f65f&&(_0x32fb61[_0x16f65f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x32fb61['id'],_0x32fb61,!0x0);}async['_fetchMissingUsers'](_0x4a24cc){const _0x24b84d=this['editor']['plugins']['get'](_0xb8f378),{connection:_0x3c1191}=this['editor']['plugins']['get'](c),_0x351138=new Set();for(const _0x2cae3d of _0x4a24cc){for(const _0x54e07e of _0x2cae3d['authorsIds'])_0x59d5a1(_0x54e07e);_0x2cae3d['creatorId']&&_0x59d5a1(_0x2cae3d['creatorId']);}if(0x0===_0x351138['size'])return;const _0x5d6d80=await dt['getMany'](_0x3c1191,Array['from'](_0x351138));for(const _0x25b493 of _0x5d6d80)_0x24b84d['getUser'](_0x25b493['id'])||_0x24b84d['addUser'](_0x25b493);function _0x59d5a1(_0x137f44){_0x24b84d['getUser'](_0x137f44)||_0x351138['add'](_0x137f44);}}}function st(_0x41a610){return _0x41a610['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x41a610['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41a610['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x2d3c3d{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x1f1e81{['_collapseAt'];constructor(_0x503896,_0x2dc319=0x6){super(_0x503896);const _0x59b92b=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x2dc319,this['bind']('isHidden')['to'](this,'usersCount',_0x800baf=>_0x800baf<_0x2dc319),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x59b92b['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x59b92b['to']('usersCount',_0x37a4ac=>'+'+(_0x37a4ac-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x1f1e81{['items'];['keystrokes'];constructor(_0x15dfad){super(_0x15dfad);const _0x4a6fdf=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5b08a7(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x4a6fdf['if']('hasPopup'),'aria-expanded':_0x4a6fdf['to']('isExpanded',_0x275de3=>this['hasPopup']&&String(_0x275de3)),'aria-label':_0x4a6fdf['to']('hasPopup',_0x6744ab=>G(_0x15dfad,_0x6744ab?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x4a6fdf['to']('hasPopup',_0x4f0a29=>!!_0x4f0a29&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x4a6fdf['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x4a6fdf['to'](_0x2dea86=>{const _0x547f99=_0x2dea86,_0x50da7e=document['querySelector']('.ck-presence-list__dropdown-list'),_0x523eee=document['querySelector']('.ck-balloon-panel_with-arrow');_0x50da7e?.['contains'](_0x547f99['relatedTarget'])||_0x523eee?.['contains'](_0x547f99['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x53e7c6,_0x55b847,_0x474e06)=>{this['element']&&(_0x474e06?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x1f1e81{['counterView'];['inlineListView'];constructor(_0x1c3ce0,_0x39d106=0x6){super(_0x1c3ce0);const _0x48aa51=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x39d106),this['inlineListView']=new ts(_0x1c3ce0),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x392a50 of this['inlineListView']['items'])_0x392a50['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x48aa51['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x1f1e81{['listWrapperView'];constructor(_0x5f4eb1,_0x497614){super(_0x5f4eb1);const _0x5b7b65=this['bindTemplate'];this['listWrapperView']=new mt(_0x5f4eb1,_0x497614),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x5f4eb1,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5b7b65['to'](_0x24a702=>{const _0x153ffd=_0x24a702,_0xdb3dd5=document['querySelector']('.ck-presence-list__list'),_0x476934=document['querySelector']('.ck-balloon-panel_with-arrow');_0xdb3dd5?.['contains'](_0x153ffd['relatedTarget'])||_0x476934?.['contains'](_0x153ffd['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x2837ad{constructor(_0x936546,_0x2fe4a8){super(_0x936546);const _0x220eb3=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2fe4a8?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x220eb3['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x220eb3['to']('role'),'aria-label':_0x220eb3['to']('ariaLabel'),'aria-labelledby':_0x220eb3['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x17d00d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xd2c7a9=this['element'];_0xd2c7a9&&(this['_isScrollable']=Math['max'](_0xd2c7a9['scrollHeight'],_0xd2c7a9['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x10d4a7,_0x4fc489,_0xa594ab){super(_0x10d4a7);const _0x339187=this['bindTemplate'];this['userView']=new ct(_0x10d4a7,_0x4fc489);const _0x205c6d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4fc489['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4fc489['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4fc489['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xa594ab&&(_0x205c6d['tag']='button',_0x205c6d['on']={'click':_0x339187['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x205c6d);}['focus'](){this['element']['focus']();}}class y extends _0x1f1e81{['userView'];['markerView'];constructor(_0xf20989,_0x355cf3,_0x25d65a){super(_0xf20989);const _0x284fd5=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xf20989,_0x355cf3),this['markerView']=new at(_0xf20989,_0x355cf3);const _0x22c8a1=new ot(_0xf20989);_0x22c8a1['template']['tag']='span',_0x22c8a1['text']=_0x355cf3['name'];const _0x27532a={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x284fd5['to']('isFocusable',_0x47a759=>!!_0x47a759&&0x0),'aria-labelledby':_0x22c8a1['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x284fd5['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x284fd5['to']('hasTooltip',_0x2c2a5d=>!_0x2c2a5d),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x22c8a1]};_0x25d65a&&(_0x27532a['tag']='button',_0x27532a['on']={'click':_0x284fd5['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x27532a);}}class at extends _0x1f1e81{constructor(_0x21f685,_0x17f799){super(_0x21f685),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x17f799['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x6e3cec{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x274153){super(_0x274153),this['context']['config']['define']('presenceList',C);const _0x360400=_0x274153['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x360400)throw new _0x42186d('presencelist-collapseat-invalid-format',this);if(_0x360400<0x1)throw new _0x42186d('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2fd983(),this['balloonPanelView']=new _0x53a00a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x1bdb5f of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1bdb5f);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4600d6,_0x26b076)=>{this['_handleUserAdd'](_0x26b076);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x75c088,_0x618851)=>{this['_handleUserRemove'](_0x618851);});}['_createView'](){const _0x42c3fd=this['context'],_0x5505e5=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x5d0890=this['balloonPanelView'];if(!_0x35aebf(_0x42c3fd['config']['get']('presenceList.container')))throw new _0x42186d('presencelist-missing-container',this);return _0x5505e5['counterView']['bind']('usersCount')['to'](this),_0x5505e5['bind']('isCollapsed')['to'](this,'usersCount',_0xcf84a=>{const {collapseAt:_0x186013}=_0x42c3fd['config']['get']('presenceList'),_0xcf0ded=_0xcf84a>=_0x186013;if(_0xcf0ded&&!_0x5505e5['inlineListView']['items']['find'](_0x405e37=>_0x405e37 instanceof A)){const _0x1abf47=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1abf47&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x5505e5['inlineListView']['items']['add'](_0x5505e5['counterView']);}return _0xcf0ded||this['hideDropdown'](),_0xcf0ded;}),_0x5505e5['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x31e29c=>{const _0x42a6df=_0x42c3fd['config']['get']('presenceList'),_0x3565bc=new y(_0x42c3fd['locale'],_0x31e29c,!!_0x42a6df['onClick']);return _0x3565bc['bind']('hasTooltip')['to'](_0x5505e5,'isCollapsed',_0x1a7223=>!_0x1a7223),_0x3565bc['bind']('isFocusable')['to'](_0x5505e5,'isCollapsed',_0x4cf586=>!_0x4cf586),_0x42a6df['onClick']&&this['listenTo'](_0x3565bc,'execute',()=>{this['view']['isCollapsed']||_0x42a6df['onClick'](_0x31e29c,_0x3565bc['element']);}),_0x3565bc;}),this['listenTo'](_0x5505e5['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x5505e5['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x5505e5['inlineListView']['keystrokes']['set']('Enter',(_0x23c6ba,_0x3b5f8f)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3b5f8f());}),_0x5505e5['render'](),_0x5d0890['render'](),_0x3527e1({'emitter':_0x5505e5,'activator':()=>_0x5d0890['isVisible'],'contextElements':[_0x5d0890['element'],_0x5505e5['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x42c3fd['config']['get']('presenceList.container')['appendChild'](_0x5505e5['element']),this['_bodyCollection']=new _0x30db24(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5505e5;}['_handleUserAdd'](_0x39c82f){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x39c82f['isMe'])return;const _0x2cd6dd=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2cd6dd-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4d44a9=_0x39c82f['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x39c82f,_0x4d44a9);}['_handleUserRemove'](_0x1dbdd0){this['usersCount']--;const {collapseAt:_0x10365c}=this['context']['config']['get']('presenceList'),_0x298450=this['usersCount']>=_0x10365c;if(this['currentDisplayedUsers']['get'](_0x1dbdd0['id']))this['currentDisplayedUsers']['remove'](_0x1dbdd0['id']);else{if(_0x298450&&this['currentDisplayedUsers']['length']+0x1===_0x10365c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x298450?0x1:0x0)<this['usersCount']){for(const _0x5cf579 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5cf579['id'])&&(this['currentDisplayedUsers']['add'](_0x5cf579,Math['min'](this['currentDisplayedUsers']['length']-(_0x298450?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x298450?0x1:0x0)===_0x10365c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3e95c7=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x3e95c7['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x10f869}=this['presenceDropdownView'];_0x10f869['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x455d5d=>{if(!_0x3e95c7['displayMe']&&_0x455d5d['isMe'])return null;const _0x1c11df=new k(this['context']['locale'],_0x455d5d,!!_0x3e95c7['onClick']);return _0x3e95c7['onClick']&&this['listenTo'](_0x1c11df,'execute',()=>{_0x3e95c7['onClick'](_0x455d5d,_0x1c11df['element']);}),_0x1c11df;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x10f869['focus'](),_0x10f869['checkIfScrollable']();const _0x1940b8=(_0x1e07e0,_0x22b564)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x22b564();};_0x10f869['keystrokes']['set']('Esc',_0x1940b8),_0x10f869['keystrokes']['set']('Shift+Tab',_0x1940b8),_0x10f869['keystrokes']['set']('Tab',(_0x40ca84,_0x97fc46)=>{!function(_0x35754c){const _0x2e249e=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x1a3f85=>_0x1a3f85+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x168db5=[...document['body']['querySelectorAll'](_0x2e249e)]['filter'](_0xaac535=>_0xaac535===document['activeElement']||_0xaac535['offsetWidth']+_0xaac535['offsetHeight']>0x0)['sort']((_0x9f10ed,_0x211b55)=>(_0x9f10ed['tabIndex']||0x0)-(_0x211b55['tabIndex']||0x0)),_0x2fb4a2=_0x168db5['indexOf'](_0x35754c),_0xf73f95=_0x168db5[(_0x2fb4a2+0x1)%_0x168db5['length']];_0xf73f95&&_0xf73f95['focus']();}(this['view']['element']),this['hideDropdown'](),_0x97fc46();}),_0x10f869['focusTracker']['add'](this['view']['element']),_0x10f869['focusTracker']['on']('change:isFocused',(_0x30a073,_0x256f50,_0x23ebb3)=>{_0x23ebb3||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x6e3cec{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};