@ckeditor/ckeditor5-real-time-collaboration 49.1.0-alpha.6 → 49.1.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.
Files changed (75) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/translations/af.umd.js +1 -1
  3. package/dist/translations/ar.umd.js +1 -1
  4. package/dist/translations/ast.umd.js +1 -1
  5. package/dist/translations/az.umd.js +1 -1
  6. package/dist/translations/be.umd.js +1 -1
  7. package/dist/translations/bg.umd.js +1 -1
  8. package/dist/translations/bn.umd.js +1 -1
  9. package/dist/translations/bs.umd.js +1 -1
  10. package/dist/translations/ca.umd.js +1 -1
  11. package/dist/translations/cs.umd.js +1 -1
  12. package/dist/translations/da.umd.js +1 -1
  13. package/dist/translations/de-ch.umd.js +1 -1
  14. package/dist/translations/de.umd.js +1 -1
  15. package/dist/translations/el.umd.js +1 -1
  16. package/dist/translations/en-au.umd.js +1 -1
  17. package/dist/translations/en-gb.umd.js +1 -1
  18. package/dist/translations/en.umd.js +1 -1
  19. package/dist/translations/eo.umd.js +1 -1
  20. package/dist/translations/es-co.umd.js +1 -1
  21. package/dist/translations/es.umd.js +1 -1
  22. package/dist/translations/et.umd.js +1 -1
  23. package/dist/translations/eu.umd.js +1 -1
  24. package/dist/translations/fa.umd.js +1 -1
  25. package/dist/translations/fi.umd.js +1 -1
  26. package/dist/translations/fr.umd.js +1 -1
  27. package/dist/translations/gl.umd.js +1 -1
  28. package/dist/translations/gu.umd.js +1 -1
  29. package/dist/translations/he.umd.js +1 -1
  30. package/dist/translations/hi.umd.js +1 -1
  31. package/dist/translations/hr.umd.js +1 -1
  32. package/dist/translations/hu.umd.js +1 -1
  33. package/dist/translations/hy.umd.js +1 -1
  34. package/dist/translations/id.umd.js +1 -1
  35. package/dist/translations/it.umd.js +1 -1
  36. package/dist/translations/ja.umd.js +1 -1
  37. package/dist/translations/jv.umd.js +1 -1
  38. package/dist/translations/kk.umd.js +1 -1
  39. package/dist/translations/km.umd.js +1 -1
  40. package/dist/translations/kn.umd.js +1 -1
  41. package/dist/translations/ko.umd.js +1 -1
  42. package/dist/translations/ku.umd.js +1 -1
  43. package/dist/translations/lt.umd.js +1 -1
  44. package/dist/translations/lv.umd.js +1 -1
  45. package/dist/translations/ms.umd.js +1 -1
  46. package/dist/translations/nb.umd.js +1 -1
  47. package/dist/translations/ne.umd.js +1 -1
  48. package/dist/translations/nl.umd.js +1 -1
  49. package/dist/translations/no.umd.js +1 -1
  50. package/dist/translations/oc.umd.js +1 -1
  51. package/dist/translations/pl.umd.js +1 -1
  52. package/dist/translations/pt-br.umd.js +1 -1
  53. package/dist/translations/pt.umd.js +1 -1
  54. package/dist/translations/ro.umd.js +1 -1
  55. package/dist/translations/ru.umd.js +1 -1
  56. package/dist/translations/si.umd.js +1 -1
  57. package/dist/translations/sk.umd.js +1 -1
  58. package/dist/translations/sl.umd.js +1 -1
  59. package/dist/translations/sq.umd.js +1 -1
  60. package/dist/translations/sr-latn.umd.js +1 -1
  61. package/dist/translations/sr.umd.js +1 -1
  62. package/dist/translations/sv.umd.js +1 -1
  63. package/dist/translations/th.umd.js +1 -1
  64. package/dist/translations/ti.umd.js +1 -1
  65. package/dist/translations/tk.umd.js +1 -1
  66. package/dist/translations/tr.umd.js +1 -1
  67. package/dist/translations/tt.umd.js +1 -1
  68. package/dist/translations/ug.umd.js +1 -1
  69. package/dist/translations/uk.umd.js +1 -1
  70. package/dist/translations/ur.umd.js +1 -1
  71. package/dist/translations/uz.umd.js +1 -1
  72. package/dist/translations/vi.umd.js +1 -1
  73. package/dist/translations/zh-cn.umd.js +1 -1
  74. package/dist/translations/zh.umd.js +1 -1
  75. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Context as _0x1c6641,ContextPlugin as _0xd92386,PendingActions as _0x303ebe,Plugin as _0x262914}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3d272c,Collection as _0x5addaf,DomEmitterMixin as _0x3e4ed6,KeystrokeHandler as _0x1af9e2,getOverlayMountRoot as _0x138971,global as _0x277f8e,trustedHtml as _0x5e2e73,uid as _0x2b2046,version as _0x4357dc}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x12e5db,LabelView as _0x49b0f3,ListItemView as _0x41e812,ListView as _0x4cc17e,Notification as _0x141771,OverlayHost as _0x590aa6,View as _0x594f2d,clickOutsideHandler as _0x54f668}from'@ckeditor/ckeditor5-ui';import{History as _0x241ab8,InsertOperation as _0x251129,MarkerOperation as _0x1ae6a9,ModelLiveRange as _0xb7933a,NoOperation as _0x5b70df,OperationFactory as _0x455877,RootAttributeOperation as _0x1af2bb,transformOperationSets as _0x127e37}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x4a9424}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x24c25e,CommentsService as _0x1a92a0,EditorService as _0x45a732,RevisionHistoryService as _0x45eb68,TrackChangesService as _0x44424a,User as _0x13af73,WEB_SOCKET_GATEWAY_STATES as _0x54974d,WebSocketGateway as _0x6fb142}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x160146,Users as _0x15de6b,isPointerStillOver as _0x207afd}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x3b99e}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0xed1670,TrackChangesEditing as _0x16108d}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x53cd39,CommentsEditing as _0x4e9a9b,CommentsRepository as _0x32c62d}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x5c14b1}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x3d354a}from'es-toolkit/compat';var K=class WebSocketGateway extends _0xd92386{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
- ((()=>_0x6fb142)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x4a9424,_0x141771];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x314f7a){super(_0x314f7a),this['set']('state',_0x54974d['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x3e4ed6())();}init(){const _0x173593=this['context'],_0x3478e6=_0x173593['plugins']['get'](_0x4a9424),_0x318943=_0x173593['plugins']['get'](_0x141771);if(!_0x3478e6['token'])throw new _0x3d272c('websocketgateway-missing-token',this);if(!_0x3478e6['webSocketUrl'])throw new _0x3d272c('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),WebSocketGateway['WebSocketGateway']['connect'](_0x3478e6['token'],_0x3478e6['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2f1b45=>{if(this['connection']=_0x2f1b45,this['bind']('state')['to'](_0x2f1b45,'state',this,'_isBrowserOffline',(_0x388b9c,_0xb24df)=>('connected'!==_0x388b9c&&(this['_shouldPluginsReconnect']=!0x0),_0xb24df||_0x388b9c!==_0x54974d['CONNECTED']?_0x54974d['DISCONNECTED']:this['state']==_0x54974d['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x54974d['CONNECTING']):_0x54974d['CONNECTED'])),this['connection']['on']('error',(_0x54b9b7,_0x2da180)=>{if('limitExceeded'!==_0x2da180['code'])throw console['error'](_0x2da180),new _0x3d272c('cloudservices-init',null,{'originalError':_0x2da180});_0x318943['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'});}),!_0x2f1b45['me'])return new Promise(_0xf25509=>_0x2f1b45['on']('change:me',_0xf25509));})['catch'](_0x1c4e62=>{throw console['error'](_0x1c4e62),new _0x3d272c('cloudservices-init',null,{'originalError':_0x1c4e62});});}addToReconnectionStack(_0x329d50){if('function'!=typeof _0x329d50['reconnect'])throw new _0x3d272c('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x329d50))throw new _0x3d272c('websocketgateway-plugin-already-registered',this,{'name':_0x329d50['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x329d50);}removeFromReconnectionStack(_0x399a44){this['_reconnectionStack']['delete'](_0x399a44);}isInReconnectionStack(_0x3e961c){return this['_reconnectionStack']['has'](_0x3e961c);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4f1e5e=>_0x4f1e5e['reconnect']())))['then'](()=>this['state']=_0x54974d['CONNECTED'])['catch'](_0x13a096=>{throw console['error'](_0x13a096),new _0x3d272c('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x54974d['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},J=class extends _0xd92386{['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[K,_0x15de6b];}constructor(_0x3956f4){super(_0x3956f4),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5addaf(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x15de6b);}init(){const _0x3b9d09=this['context']['plugins']['get'](K);this['listenTo'](_0x3b9d09,'change:state',(_0x536c56,_0x5e66d0,_0x3ce9f2)=>{if('connected'!==_0x3ce9f2)this['channelSessions']['forEach'](_0x421aad=>_0x421aad['clear']()),this['channelConnectedUsers']['forEach'](_0x5a20d3=>_0x5a20d3['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x26f297,_0x2bd5ef]of this['_registeredSessions'])for(const _0x123b38 of _0x2bd5ef)this['_handleSessionAdd'](_0x26f297,_0x123b38);}}),this['_createUser'](_0x3b9d09['connection']['me'],!0x0);}register(_0x493087,_0x59dcdc){if(this['_registeredSessions']['has'](_0x493087))throw new _0x3d272c('sessions-register-already-registered',null,{'channelId':_0x493087});this['_registeredSessions']['set'](_0x493087,_0x59dcdc),this['channelSessions']['set'](_0x493087,new _0x5addaf()),this['channelConnectedUsers']['set'](_0x493087,new _0x5addaf()),this['listenTo'](_0x59dcdc,'add',(_0x116622,_0x792af1)=>this['_handleSessionAdd'](_0x493087,_0x792af1)),this['listenTo'](_0x59dcdc,'remove',(_0x1aef99,_0xbe515d)=>this['_handleSessionRemove'](_0x493087,_0xbe515d));for(const _0x38a414 of _0x59dcdc)this['_handleSessionAdd'](_0x493087,_0x38a414);}unregister(_0x5c3bba){if(!this['_registeredSessions']['has'](_0x5c3bba))throw new _0x3d272c('sessions-unregister-not-exist',null,{'channelId':_0x5c3bba});const _0x4b5de7=this['_registeredSessions']['get'](_0x5c3bba);this['stopListening'](_0x4b5de7);for(const _0x363505 of _0x4b5de7)'connected'===this['context']['plugins']['get'](K)['state']&&this['_handleSessionRemove'](_0x5c3bba,_0x363505);this['_registeredSessions']['delete'](_0x5c3bba),this['channelSessions']['delete'](_0x5c3bba),this['channelConnectedUsers']['delete'](_0x5c3bba);}get['mySessionId'](){return this['context']['plugins']['get'](K)['connection']['sessionId'];}getUserBySessionId(_0x337612){for(const _0x332a5c of this['channelSessions']['values']())for(const _0x19696c of _0x332a5c)if(_0x19696c['id']===_0x337612)return _0x19696c['user'];}getUserSessions(_0x5a4bb9,_0x4c8ae2){const _0xbec4f4=_0x4c8ae2?[this['channelSessions']['get'](_0x4c8ae2)]:this['channelSessions']['values'](),_0xa90db5=new Set();for(const _0x228208 of _0xbec4f4)for(const _0xc3b460 of _0x228208)_0xc3b460['user']['id']===_0x5a4bb9['id']&&_0xa90db5['add'](_0xc3b460['id']);return _0xa90db5;}getUserRole(_0x4274ea){for(const _0x49d510 of this['channelSessions']['values']())for(const _0x14a44d of _0x49d510)if(_0x14a44d['user']===_0x4274ea)return _0x14a44d['role'];}['_handleSessionAdd'](_0x22d397,_0x22a18a){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x492d2c=_0x22a18a['user'],_0x497abe=this['_users']['getUser'](_0x492d2c['id'])||this['_createUser'](_0x492d2c),_0x255670=Object['assign']({},_0x22a18a,{'user':_0x497abe});if(this['channelSessions']['get'](_0x22d397)['add'](_0x255670),!_0x492d2c['hiddenInPresenceList']){const _0x43d7ea=this['channelConnectedUsers']['get'](_0x22d397);_0x43d7ea['has'](_0x497abe['id'])||_0x43d7ea['add'](_0x497abe),this['allConnectedUsers']['has'](_0x497abe['id'])||_0x492d2c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x497abe,_0x497abe['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x22d397,{'channelId':_0x22d397,'session':_0x255670});}['_handleSessionRemove'](_0x201219,_0xc47b7e){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x1d7a77=this['channelConnectedUsers']['get'](_0x201219),_0x30122b=_0xc47b7e['user'];_0x30122b['id']&&(this['channelSessions']['get'](_0x201219)['remove'](_0xc47b7e['id']),_0x1d7a77['has'](_0x30122b['id'])&&!this['getUserSessions'](_0x30122b,_0x201219)['size']&&_0x1d7a77['remove'](_0x30122b['id']),this['allConnectedUsers']['get'](_0x30122b['id'])&&!this['getUserSessions'](_0x30122b)['size']&&this['allConnectedUsers']['remove'](_0x30122b['id']));}_createUser(_0x243425,_0x903052){const _0x5913b5=this['_users']['addUser'](_0x243425);return _0x903052&&this['_users']['defineMe'](_0x243425['id']),_0x5913b5['orderNumber']=this['_uniqueUsersCount']++,_0x5913b5;}},X=class extends _0x262914{_domEmitter=new(_0x3e4ed6())();static get requires(){return[J];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x3bef84=this['editor'],_0x22b99d=_0x3bef84['plugins']['get'](J);_0x3bef84['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x448c24,{writer:_0x3fd1a3})=>function(_0x2980fa,_0x59c412,_0x30d97f,_0x4e41a1){const _0x3bba66=_0x2980fa['markerName']['split'](':')[0x2],_0x17ba1f=_0x30d97f['getUserBySessionId'](_0x3bba66);if(!_0x17ba1f||_0x3bba66===_0x30d97f['mySessionId'])return;if(!_0x4e41a1['model']['schema']['checkChild'](_0x2980fa['markerRange']['start'],'$text'))return;const _0x95650e={'class':'ck-user__marker\x20'+_0x17ba1f['color']['getMarkerClass'](),'style':tt(_0x17ba1f),'data-name':_0x17ba1f['name'],'data-session-id':_0x3bba66},_0x53e29b=_0x4e41a1['model']['markers']['get'](_0x2980fa['markerName'])['getStart'](),_0x2f8ac0=_0x53e29b['nodeAfter'],_0x59f9c2=_0x4e41a1['model']['schema'];if(_0x2f8ac0&&_0x59f9c2['isObject'](_0x2f8ac0)&&_0x59f9c2['isInline'](_0x2f8ac0)&&!_0x4e41a1['model']['markers']['get']('user:range:'+_0x3bba66)['getRange']()['isCollapsed'])return;const _0x43311=_0x53e29b['parent'];return _0x4e41a1['model']['schema']['isLimit'](_0x43311)&&!_0x4e41a1['model']['hasContent'](_0x43311)&&(_0x95650e['contenteditable']=!0x1),function(_0x28dd7e,_0x38ee40,_0x22b2e4){const _0x457b00=_0x28dd7e['createUIElement']('span',_0x38ee40);return _0x28dd7e['setCustomProperty']('userPositionMarker',!0x0,_0x457b00),_0x457b00['render']=function(_0xfffa08){const _0x2806e8=this['toDomElement'](_0xfffa08),_0x21dfed=document['createElement']('span');return _0x21dfed['classList']['add']('ck-user__marker-tooltip'),_0x21dfed['setAttribute']('contenteditable','false'),_0x21dfed['setAttribute']('spellcheck','false'),_0x21dfed['textContent']=_0x22b2e4['name'],_0x2806e8['innerHTML']=_0x5e2e73('⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x21dfed['outerHTML']+'⁠'),_0x2806e8['addEventListener']('mouseenter',()=>{_0x2806e8['classList']['add']('ck-user__marker_hovered');}),_0x2806e8['addEventListener']('mouseleave',()=>{_0x2806e8['classList']['remove']('ck-user__marker_hovered');}),_0x2806e8;},_0x457b00['isSimilar']=function(_0x5c9646){return!(!this['getCustomProperty']('userPositionMarker')||!_0x5c9646['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x5c9646['getAttribute']('data-session-id'));},_0x457b00;}(_0x59c412,_0x95650e,_0x17ba1f);}(_0x448c24,_0x3fd1a3,_0x22b99d,_0x3bef84)}),_0x3bef84['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3e8f67=>function(_0x1e640d,_0x44b4e1){const _0x548d0e=_0x1e640d['markerName']['split'](':')[0x2];if(_0x548d0e===_0x44b4e1['mySessionId'])return null;const _0x36e10c=_0x44b4e1['getUserBySessionId'](_0x548d0e);return _0x36e10c?{'id':_0x548d0e,'classes':['ck-user__selection',_0x36e10c['color']['getSelectionClass']()],'attributes':{'style':tt(_0x36e10c),'data-session-id':_0x548d0e},'priority':0x7d0+_0x36e10c['orderNumber']}:{'id':_0x548d0e,'classes':[]};}(_0x3e8f67,_0x22b99d)}),function(_0x29e4a7){const _0x4d1421=_0x29e4a7['model'],_0x46ebe8=new Map(),_0x1d2685=_0x29e4a7['plugins']['get'](J);_0x4d1421['markers']['on']('update:user:range',(_0x1a7a83,_0x207cea,_0xdd886f,_0x52627d)=>{if(!_0x52627d&&_0x46ebe8['get'](_0x207cea['name']))return _0x46ebe8['get'](_0x207cea['name'])['detach'](),void _0x46ebe8['delete'](_0x207cea['name']);const _0x226e26=_0x207cea['name']['split'](':')[0x2];if(_0x226e26===_0x1d2685['mySessionId'])return;const _0x4e13ce='user:position:'+_0x226e26;_0x4d1421['markers']['has'](_0x4e13ce)&&_0x29e4a7['editing']['reconvertMarker'](_0x4e13ce),_0x207cea['on']('change:range',(_0x285cae,_0xa0ae20,_0x4e057b)=>{if('$graveyard'!=_0xa0ae20['root']['rootName']&&'$graveyard'==_0x207cea['getRange']()['root']['rootName']&&!_0x46ebe8['has'](_0x207cea['name'])){const _0x24301c=_0x4d1421['schema']['getNearestSelectionRange'](_0x4e057b['deletionPosition']);if(_0x24301c){const _0x240c92=_0xb7933a['fromRange'](_0x24301c);_0x46ebe8['set'](_0x207cea['name'],_0x240c92),_0x240c92['on']('change:range',(_0xbb2c8a,_0x496098,_0x5a6d77)=>{if('$graveyard'==_0x240c92['root']['rootName']){const _0x1824b5=_0x4d1421['schema']['getNearestSelectionRange'](_0x5a6d77['deletionPosition']);_0x1824b5?(_0x240c92['start']=_0x1824b5['start'],_0x240c92['end']=_0x1824b5['end']):(_0x46ebe8['delete'](_0x207cea['name']),_0x240c92['detach']());}});}}});}),_0x4d1421['document']['on']('change',()=>{_0x46ebe8['size']>0x0&&_0x4d1421['enqueueChange']({'isUndoable':!0x1},_0x1647c8=>{for(const [_0x28f03d,_0x2e1785]of _0x46ebe8)'$graveyard'==_0x4d1421['markers']['get'](_0x28f03d)['getRange']()['root']['rootName']&&(Z(_0x28f03d['split'](':')[0x2],_0x2e1785['toRange'](),_0x4d1421,_0x1647c8),_0x2e1785['detach']());_0x46ebe8['clear']();});});}(_0x3bef84),this['_domEmitter']['listenTo'](_0x277f8e['document'],'keydown',(_0x597eec,{key:_0x3ea94c})=>{'Escape'===_0x3ea94c&&function(_0x42bfe8){_0x42bfe8['editing']['view']['change'](_0x154fcf=>{for(const _0x25ef63 of _0x42bfe8['model']['markers']){if(!_0x25ef63['name']['startsWith']('user:position'))continue;const _0x197466=_0x42bfe8['editing']['mapper']['markerNameToElements'](_0x25ef63['name']);if(_0x197466){for(const _0x51307c of _0x197466)_0x154fcf['removeClass']('ck-user__marker_hovered',_0x51307c);}}});}(_0x3bef84);},{'useCapture':!0x0});}afterInit(){const _0x49c08f=this['editor'],_0x381f32=_0x49c08f['commands']['get']('undo');_0x381f32&&_0x49c08f['model']['on']('applyOperation',(_0x43e846,_0x5b722e)=>{const _0x3dba06=_0x5b722e[0x0];if(!_0x3dba06['isDocumentOperation'])return;if('marker'!=_0x3dba06['type']||!_0x3dba06['name']['startsWith']('user:'))return;const _0x2c6cd3=_0x3dba06['batch'];_0x381f32['_createdBatches']['has'](_0x2c6cd3)&&(_0x3dba06['newRange']=_0x3dba06['oldRange']?_0x49c08f['model']['createRange'](_0x3dba06['oldRange']['start'],_0x3dba06['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x36ea31=this['editor'],_0x4d877c=_0x36ea31['model']['document'],_0x4b4ed2=_0x36ea31['plugins']['get'](J);_0x36ea31['model']['enqueueChange']({'isUndoable':!0x1},_0x24ba72=>{const _0x13e13b='user:range:'+_0x4b4ed2['mySessionId'],_0x4aaf02='user:position:'+_0x4b4ed2['mySessionId'],_0x57770f=_0x36ea31['model']['markers']['has'](_0x13e13b);_0x36ea31['editing']['view']['hasDomSelection']?Z(_0x4b4ed2['mySessionId'],_0x4d877c['selection']['getFirstRange'](),_0x36ea31['model'],_0x24ba72):_0x57770f&&(_0x24ba72['removeMarker'](_0x13e13b),_0x24ba72['removeMarker'](_0x4aaf02));});}};function Z(_0x5b32f1,_0x28d588,_0x40a1f7,_0x586340){const _0xac9c2c='user:range:'+_0x5b32f1,_0x30b31b='user:position:'+_0x5b32f1,_0x4d6231=_0x28d588['getContainedElement']();let _0x50c9d7=_0x28d588['start'];if(_0x4d6231&&_0x4d6231['is']('element','tableCell')){const _0xc60500=function(_0x22024d,_0x5cc500){for(const _0x5a1aad of _0x22024d['getPositions']())if(_0x5cc500['schema']['checkChild'](_0x5a1aad,'$text'))return _0x5a1aad;}(_0x28d588,_0x40a1f7);_0xc60500&&(_0x50c9d7=_0xc60500,_0x28d588=_0x586340['createRange'](_0x50c9d7));}const _0x5366b9=_0x586340['createRange'](_0x50c9d7);_0x40a1f7['markers']['has'](_0xac9c2c)?(_0x586340['updateMarker'](_0xac9c2c,{'range':_0x28d588}),_0x586340['updateMarker'](_0x30b31b,{'range':_0x5366b9})):(_0x586340['addMarker'](_0xac9c2c,{'range':_0x28d588,'usingOperation':!0x0}),_0x586340['addMarker'](_0x30b31b,{'range':_0x5366b9,'usingOperation':!0x0}));}function tt(_0x49e101){return'--ck-user-color:'+_0x49e101['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x49e101['color']['getColorAlphaVariable']()+';';}function et(_0x35ea28,_0x1c5169,_0x413c13){const _0x3c4a46=_0x35ea28['t'],t=_0x35ea28['t'];switch(_0x1c5169){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 _0x3c4a46({'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'},_0x413c13);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x262914{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
- ((()=>_0x24c25e)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[K,J,X,_0x303ebe,_0x15de6b,_0x141771];}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 _0x541649=this['serverHistory']['getOperations']();for(let _0x520121=_0x541649['length']-0x1;_0x520121>=0x0;_0x520121--){const _0x1bd029=_0x541649[_0x520121];if(!this['_disconnectionOperations']['has'](_0x1bd029))return _0x1bd029['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x524be8){if(super(_0x524be8),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x241ab8(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3d272c('collaboration-missing-channelid',this);const _0x45bf80=_0x524be8['config']['get']('cloudServices.bundleVersion')||_0x4357dc;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x45bf80,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3b99e(),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 ot(this['_disconnectionOperations']);}init(){const _0x9352d=this['editor'],_0x548909=_0x9352d['plugins']['get'](_0x15de6b),_0x20f32f=_0x9352d['plugins']['get'](K);this['listenTo'](_0x548909,'getOperationAuthor',(_0x558259,_0x706847)=>{const _0x279386=_0x706847[0x0];_0x279386['_authorId']&&(_0x558259['return']=_0x548909['getUser'](_0x279386['_authorId']),_0x558259['stop']()),null===_0x279386['_authorId']&&(_0x558259['return']=null,_0x558259['stop']());},{'priority':'high'}),this['listenTo'](_0x9352d['model']['document']['selection'],'change:range',(_0x1c0f59,_0x4d2496)=>{_0x4d2496['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x9352d['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x9352d['model']['on']('applyOperation',(_0x562d38,_0x1cd9c1)=>{const _0x2cbd2d=_0x1cd9c1[0x0];_0x2cbd2d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2cbd2d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x20f32f,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x19ad29,_0x561552,_0x39f091)=>'connected'===_0x19ad29&&!_0x561552&&!_0x39f091),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x9352d['disableReadOnlyMode']('rtc-offline'):_0x9352d['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x9352d['disableReadOnlyMode']('rtc-offline'):_0x9352d['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x349a58=this['editor']['plugins']['get'](J),_0x2cb084=this['editor']['plugins']['get'](K);try{this['_isPendingUpdate']=!0x0,_0x349a58['unregister'](this['_channelId']);const _0x1d7f44=await this['_service']['reconnect'](_0x2cb084['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1d7f44)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x43834f=await this['_service']['getConnectedSessions']();_0x349a58['register'](this['_channelId'],_0x43834f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x552f3d){if(function(_0x5278fc){return'404'===_0x5278fc['code'];}(_0x552f3d)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x212f44){return'409'===_0x212f44['code'];}(_0x552f3d)){const _0x4db39c=et(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'](_0x4db39c);}else{if(!(_0x552f3d instanceof nt))throw _0x552f3d;this['_handleReconnectionError']();}}}}destroy(){const _0x3cc67a=this['editor']['plugins']['get'](K),_0x5e4e2c=this['editor']['plugins']['get'](J);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5e4e2c['channelSessions']['has'](this['_channelId'])&&_0x5e4e2c['unregister'](this['_channelId']),_0x3cc67a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x3be934){if(this['sessionId']!==_0x3be934['sessionId']&&this['_lastSyncedOperationId']!==_0x3be934['lastOperationId'])throw new nt();return this['sessionId']=_0x3be934['sessionId'],this['_handleServerResponse']([],{..._0x3be934,'wereChangesApplied':!0x1,'data':_0x3be934['data']},'reconnect');}async _connectService(_0x4f1994,_0x1e389b=!0x1){const {connection:_0x55bb88}=this['editor']['plugins']['get'](K);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x55bb88,this['_channelId'])['then'](_0x105cd7=>this['_initSessionsHandling'](_0x105cd7))['catch'](_0x763213=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x763213);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3471de,_0x414e31)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x414e31);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x54c8d0=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4f1994);this['_isPendingUpdate']=!0x0;const _0x2e4b59=await this['_service']['connect'](_0x55bb88,this['_compressOperations'](_0x4f1994),_0x54c8d0);if(this['sessionId']=_0x2e4b59['sessionId'],_0x1e389b){if(!_0x2e4b59['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x2e4b59['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4f1994,_0x2e4b59,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x2e4b59,_0x4f1994);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x29cfa4=this['editor']['plugins']['get'](J),_0x494b18=this['editor']['plugins']['get'](X),_0xbf75dd=_0x29cfa4['channelSessions']['get'](this['_channelId']);_0xbf75dd&&_0xbf75dd['length']>0x1?_0x494b18['createUserMarkerOperations']():this['listenTo'](_0x29cfa4,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x29cfa4['channelSessions']['get'](this['_channelId'])['length']&&_0x494b18['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x244c73,_0x40ead1,_0xe409ea,_0x571bb6){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x40ead1){const _0x534334=this['_decompressOperations'](_0xe409ea,_0x571bb6);await this['_fetchMissingUsers'](_0x534334),this['_handleExternalOperations'](_0x534334,_0x40ead1,_0xe409ea['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x4808f9}=this['editor'];let _0xc502ee;try{_0xc502ee=await this['_service']['getDocumentDetails']();}catch{const _0x4f8b63=et(_0x4808f9,'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'](_0x4f8b63);}const _0x1fe62a=_0xc502ee['currentDocumentSession']||_0xc502ee['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x1fe62a['lastOperationId']){const _0x537124=et(_0x4808f9,'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 void this['_handleReconnectionError'](_0x537124);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0xaee70f=this['editor']['plugins']['get'](K);if(this['_isConnected']=!0x1,!_0xaee70f['connection']||'connected'!==_0xaee70f['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x6181bf=this['editor']['plugins']['get'](J);_0x6181bf['channelSessions']['has'](this['_channelId'])&&_0x6181bf['unregister'](this['_channelId']),_0xaee70f['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x56fbbe){const _0xdca057=this['editor']['plugins']['get'](J);this['listenTo'](_0xdca057,'sessionAdd:'+this['_channelId'],(_0x423d02,{session:_0x4e935d})=>{if(_0x4e935d['id']===_0xdca057['mySessionId']){_0x423d02['off']();const _0x5a5197=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x5a1c1c=_0x4e935d['permissions'];_0x5a5197&&_0x5a5197['isEnabled']&&(_0x5a1c1c=_0x5a1c1c['filter'](_0x5d5cd5=>'document:write'!==_0x5d5cd5)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x5a1c1c,this['_channelId']);}}),_0xdca057['register'](this['_channelId'],_0x56fbbe);}_initThrowingOnDataSet(){const _0x545540=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4efb6b)=>{if(!_0x4efb6b[_0x4efb6b['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3d272c('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x545540['apply'](this['editor']['data'],_0x4efb6b);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x211e51,[_0x4294f2])=>{if(this['_document']['version'])throw new _0x3d272c('realtimecollaborationclient-init-document-already-initialized',this);_0x211e51['stop'](),this['_setPendingAction']();const _0x22fd03=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x343a1f])=>!_0x343a1f['lazyLoad'])['map'](([_0x1e207a,_0x6e82b0])=>[_0x1e207a,_0x6e82b0['modelAttributes']||{}])),_0x5bc049=this['_getOperationsFromInitData'](_0x4294f2,_0x22fd03);0x0==_0x5bc049['length']&&_0x5bc049['push'](new _0x5b70df(0x0)),_0x211e51['return']=this['_connectService'](_0x5bc049)['then'](()=>{this['editor']['plugins']['get'](K)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x294bf7=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x294bf7))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3c9b67,[_0x2e9a03,_0x4501ec])=>{_0x3c9b67['stop']();const _0x46bf64=this['editor']['model']['document']['getRoot'](_0x2e9a03);if(!this['_knownRootNames']['has'](_0x2e9a03)){const _0x566ecd=_0x4501ec&&_0x4501ec['data']?_0x4501ec['data']:'',_0x17d667=_0x4501ec&&_0x4501ec['attributes']?_0x4501ec['attributes']:{};await this['_loadRoot'](_0x2e9a03,_0x566ecd,_0x17d667);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x46bf64['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x46bf64);});},{'priority':'high'});}async _fetchMissingUsers(_0x3ad665){const _0x2ef8c1=this['editor']['plugins']['get'](_0x15de6b),{connection:_0x2cdda3}=this['editor']['plugins']['get'](K),_0x19db4e=new Set();for(const _0x3406a1 of _0x3ad665){const _0x4ef567=_0x3406a1['_authorId'];_0x4ef567&&!_0x2ef8c1['getUser'](_0x4ef567)&&_0x19db4e['add'](_0x4ef567);}if(0x0===_0x19db4e['size'])return;const _0x3ea310=await _0x13af73['getMany'](_0x2cdda3,Array['from'](_0x19db4e));for(const _0x4726bf of _0x3ea310)_0x2ef8c1['getUser'](_0x4726bf['id'])||_0x2ef8c1['addUser'](_0x4726bf);}_getOperationsFromInitData(_0x377933,_0x17cabc={}){const _0x5952df=this['editor']['model'],_0x5abc3c=[];let _0x479929=0x0;const _0x1de158='string'==typeof _0x377933?{'main':_0x377933}:_0x377933;for(const _0x30807e of Object['keys'](_0x1de158)){if(!this['_document']['roots']['has'](_0x30807e))throw new _0x3d272c('realtimecollaborationclient-init-non-existent-root',this);const _0x43eb98=this['_document']['getRoot'](_0x30807e),_0xa48c7c=this['editor']['data']['parse'](_0x1de158[_0x30807e],_0x43eb98),_0x42cf3e=new _0x251129(_0x5952df['createPositionAt'](_0x43eb98,0x0),_0xa48c7c,_0x479929++);_0x5abc3c['push'](_0x42cf3e);for(const [_0x30f479,_0x219dd5]of _0xa48c7c['markers']){const _0x312bf6=_0x5952df['createRange'](_0x5952df['createPositionFromPath'](_0x43eb98,_0x219dd5['start']['path']['slice']()),_0x5952df['createPositionFromPath'](_0x43eb98,_0x219dd5['end']['path']['slice']())),_0x3dd85d=new _0x1ae6a9(_0x30f479,null,_0x312bf6,_0x5952df['markers'],!0x0,_0x479929++);_0x5abc3c['push'](_0x3dd85d);}}if(_0x17cabc)for(const [_0x278e18,_0x394440]of Object['entries'](_0x17cabc)){const _0x5542cb=_0x5952df['document']['getRoot'](_0x278e18);if(!_0x5542cb)throw new _0x3d272c('multi-root-editor-root-attributes-no-root',null);for(const [_0x360640,_0x211cff]of Object['entries'](_0x394440))if(null!==_0x211cff){const _0x11db48=new _0x1af2bb(_0x5542cb,_0x360640,null,_0x211cff,_0x479929++);_0x5abc3c['push'](_0x11db48);}}return _0x5abc3c;}async _loadRoot(_0x4cedf1,_0x3cc5ee,_0x3b8b28){this['_getOperationsFromInitData']({[_0x4cedf1]:_0x3cc5ee},{[_0x4cedf1]:_0x3b8b28})['forEach']((_0x749d6a,_0x465706)=>{_0x749d6a['baseVersion']=this['_document']['version']+_0x465706,_0x749d6a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x749d6a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0xa6d409,_0x26d198){let _0x4f5cb4;this['_offset']=_0xa6d409['offset'];const _0x4dcea1=_0xa6d409['wereChangesApplied']&&!_0xa6d409['initData'],_0xa472f9=_0x4dcea1?0x0:_0xa6d409['data']['baseVersion'];if(_0x26d198['forEach'](_0x1247e7=>{_0x1247e7['_isInit']=!0x0,_0x1247e7['createdAt']=_0xa6d409['sessionCreatedAt'],_0x1247e7['_authorId']=null;}),_0x4dcea1)_0x4f5cb4=_0x26d198,this['_applyOperationsSet'](_0x4f5cb4,_0x4dcea1);else{if(_0xa6d409['initData']){const _0xd581e2=this['_getOperationsFromInitData'](_0xa6d409['initData']);this['_document']['history']['version']=-_0xd581e2['length'],_0xd581e2['forEach'](_0x41a541=>{_0x41a541['baseVersion']-=_0xd581e2['length'],_0x41a541['createdAt']=_0xa6d409['sessionCreatedAt'],_0x41a541['_isInit']=!0x0,_0x41a541['_authorId']=null;}),this['_applyOperationsSet'](_0xd581e2,!0x0),this['serverHistory']['version']=-_0xd581e2['length']+this['_offset'],this['_updateServerHistory'](_0xd581e2);}this['_document']['history']['version']=_0xa472f9,_0x4f5cb4=this['_decompressOperations'](_0xa6d409['data'],_0xa6d409['metadata']),await this['_fetchMissingUsers'](_0x4f5cb4),this['_applyOperationsSet'](_0x4f5cb4,_0x4dcea1);}_0xa6d409['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4f5cb4,_0xa6d409['lastOperationId']),this['_lastSyncedOperationId']=_0xa6d409['lastOperationId']),this['serverHistory']['version']=_0xa472f9+this['_offset'],this['_updateServerHistory'](_0x4f5cb4),_0x26d198['filter'](_0x42199b=>{const _0x3f8591=this['_getAffectedRoot'](_0x42199b);return _0x3f8591&&!this['_knownRootNames']['has'](_0x3f8591);})['forEach']((_0xc5d91,_0x209cde)=>{_0xc5d91['baseVersion']=this['_document']['version']+_0x209cde,this['_saveOperationInBuffer'](_0xc5d91);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2a8e65,_0x4ce7ba){const _0x375908=_0x4ce7ba&&_0x4ce7ba['message'];if(_0x375908&&_0x375908['startsWith']('realtimecollaborationclient'))throw _0x4ce7ba;const _0x709881=this['editor']['plugins']['get'](K);throw this['_isPendingUpdate']=!0x0,_0x709881['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3d272c(_0x2a8e65,this['editor'],_0x375908?{'originalError':_0x375908}:void 0x0);}_saveOperationInBuffer(_0x3975a9){this['_knownOperations']['has'](_0x3975a9)||(this['_knownOperations']['add'](_0x3975a9),this['_bufferedOperations']['push'](_0x3975a9),this['_pendingAction']||'marker'==_0x3975a9['type']&&!_0x3975a9['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x49a7ae=!0x1){!_0x49a7ae&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x5d5de9=>{_0x5d5de9&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x1e6821=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5800cc){return _0x5800cc['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5800cc['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5800cc['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x1e6821)||this['_crash'](_0x1e6821['message'],_0x1e6821);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x28e553=>{this['on']('change:_isPendingUpdate',()=>{_0x28e553();});});}async _sendBufferedOperations(){const _0x21e40b=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x21e40b['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2b96be=[...this['_bufferedOperations']];for(const _0x5555fb of _0x2b96be)_0x5555fb['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5555fb);const _0xbac251=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2b96be),_0x23feff=st++,_0x3ecff4=this['_compressOperations'](_0x2b96be),_0x32559f=await this['_service']['sendOperations'](_0x3ecff4,_0x3ecff4['baseVersion'],_0xbac251);try{return await this['_handleServerResponse'](_0x2b96be,_0x32559f,_0x23feff);}catch(_0x5441c5){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5441c5);}}async['_handleServerResponse'](_0x5e6556,_0x2b4747,_0x22068a){if('error'in _0x2b4747)throw _0x2b4747['error'];let _0x322016;if(_0x2b4747['wereChangesApplied']){_0x2b4747['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2b4747['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x577a7c=>!_0x5e6556['includes'](_0x577a7c));for(const _0x3be278 of _0x5e6556)_0x3be278['createdAt']='lastOperationAcceptedAt'in _0x2b4747&&_0x2b4747['lastOperationAcceptedAt']||void 0x0;rt(_0x5e6556,_0x2b4747['version']-_0x5e6556['length']),this['_updateServerHistory'](_0x5e6556);const _0x397493=_0x5e6556['filter'](_0x8e0f10=>{if(!_0x8e0f10['_isInit'])return!0x1;const _0x3341bd=this['_getAffectedRoot'](_0x8e0f10);return _0x3341bd&&!this['_knownRootNames']['has'](_0x3341bd);});rt(_0x397493,this['_document']['version']),this['_applyOperationsSet'](_0x397493),_0x322016=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x24f944=this['_decompressOperations'](_0x2b4747['data'],_0x2b4747['metadata'])['filter'](_0x53f40d=>_0x53f40d['baseVersion']>=this['_lastServerVersion']);_0x24f944['forEach'](_0xe5313c=>this['_addKnownRoot'](_0xe5313c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x18e78e=>!_0x18e78e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x18e78e))),this['_bufferedOperations']['length']&&rt(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x24f944),_0x322016=this['_handleExternalOperations'](_0x24f944,_0x2b4747['version'],_0x2b4747['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x322016?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x584910,_0x223d16,_0x1177ac){try{const _0x5e6a4e={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3e8ef0,operationsB:_0x3cf33f,originalOperations:_0xc90d6c}=_0x127e37(_0x584910,this['_bufferedOperations'],_0x5e6a4e);rt(_0x3e8ef0,this['_document']['version']),rt(_0x3cf33f,_0x223d16);for(const _0x535c2e of _0x3e8ef0){const _0x5d41d3=_0xc90d6c['get'](_0x535c2e);_0x5d41d3?(_0x535c2e['_authorId']=_0x5d41d3['_authorId'],'noop'!==_0x535c2e['type']&&(_0x535c2e['_aiSource']=_0x5d41d3['_aiSource'])):_0x535c2e['_authorId']=null;}for(const _0x348497 of _0x3cf33f)'noop'!==_0x348497['type']&&(_0x348497['_aiSource']=_0xc90d6c['get'](_0x348497)?.['_aiSource']);_0x1177ac&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x584910,_0x1177ac),this['_lastSyncedOperationId']=_0x1177ac),this['_bufferedOperations']=[..._0x3cf33f],this['_applyOperationsSet'](_0x3e8ef0),this['_updateServerHistory'](_0x584910);}catch(_0x29d007){return console['error'](_0x29d007),!0x1;}return!0x0;}_applyOperationsSet(_0x258394,_0x1a3e61=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x452fb7=>{for(const _0x57c6f3 of _0x258394)this['_knownOperations']['add'](_0x57c6f3),this['_addKnownRoot'](_0x57c6f3),_0x452fb7['batch']['addOperation'](_0x57c6f3),this['editor']['model']['applyOperation'](_0x57c6f3);});}_addKnownRoot(_0x4522fd){const _0x153fb1=this['_getAffectedRoot'](_0x4522fd);_0x153fb1&&this['_knownRootNames']['add'](_0x153fb1);}_getAffectedRoot(_0x3705ac){let _0x3395d3,_0x375329;switch(_0x3705ac['type']){case'insert':_0x3395d3=_0x3705ac['position']['root'];break;case'marker':if(_0x375329=_0x3705ac['newRange'],!_0x375329)return null;_0x3395d3=_0x375329['root'];break;case'addRootAttribute':_0x3395d3=_0x3705ac['root'];break;case'addRoot':_0x3395d3=_0x3705ac['affectedSelectable'];break;case'move':_0x3395d3=_0x3705ac['targetPosition']['root'];break;default:return null;}return _0x3395d3['rootName'];}_updateServerHistory(_0x21e3a4){_0x21e3a4['forEach'](_0x296518=>{const _0x4d3031=_0x296518['clone']();_0x4d3031['_authorId']=_0x296518['_authorId'],_0x4d3031['_isInit']=!!_0x296518['_isInit'],_0x4d3031['_aiSource']=_0x296518['_aiSource'],_0x4d3031['createdAt']=_0x296518['createdAt'],_0x4d3031['baseVersion']+=this['_offset'],_0x296518['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4d3031),this['serverHistory']['addOperation'](_0x4d3031);});}_handleReconnectionError(_0x1dbd19){const _0x2eb74e=this['editor']['plugins']['get']('Notification'),_0x318ed4=this['editor']['locale'];_0x1dbd19||(_0x1dbd19=et(_0x318ed4,'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.')),_0x2eb74e['showWarning'](_0x1dbd19,{'title':et(_0x318ed4,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](K)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x303ebe)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x303ebe)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x4ce187){const _0x54db76=_0x4ce187['map'](_0xaebcce=>_0xaebcce['toJSON']());return this['_compressor']['compress'](_0x54db76);}_decompressOperations(_0x46b8f6,_0x54d1bb){return this['_compressor']['decompress'](_0x46b8f6)['map']((_0x16cb74,_0x3d1641)=>{const _0x789cb1='init'==_0x54d1bb[_0x3d1641]['type'];if('InsertOperation'==_0x16cb74['__className']){const _0x14b995=_0x16cb74['position']['root'];!this['_document']['getRoot'](_0x14b995)&&(this['_document']['createRoot']('$unknown',_0x14b995)['_isAttached']=!0x1);}else{if('RootOperation'==_0x16cb74['__className']){const _0x34da10=this['_document']['getRoot'](_0x16cb74['rootName']);_0x34da10&&'$unknown'==_0x34da10['name']&&_0x16cb74['elementName']!=_0x34da10['name']&&(_0x34da10['name']=_0x16cb74['elementName']);}}const _0x4b49e4=_0x455877['fromJSON'](_0x16cb74,this['_document']);return _0x4b49e4['wasUndone']=_0x16cb74['wasUndone'],_0x4b49e4['_isInit']=_0x789cb1,_0x4b49e4['_authorId']=_0x789cb1?null:_0x54d1bb[_0x3d1641]['userId'],_0x4b49e4['_isDisconnection']='cs:removeUser'===_0x54d1bb[_0x3d1641]['type'],_0x4b49e4['_aiSource']=_0x16cb74['_aiSource']||void 0x0,_0x4b49e4['createdAt']=_0x54d1bb[_0x3d1641]['createdAt'],_0x4b49e4;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x48fa31=this['editor']['plugins']['get'](J)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x48fa31&&_0x48fa31['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function rt(_0x2488ad,_0x59c142){for(const _0x410a43 of _0x2488ad)_0x410a43['baseVersion']=_0x59c142++;}var ot=class{_ignoredOperations;_operationToId;constructor(_0x15138c){this['_ignoredOperations']=_0x15138c,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x9462a3){let _0x4d5c1f=_0x9462a3['length'];for(;_0x4d5c1f--;){const _0x33e385=_0x9462a3[_0x4d5c1f];if(!this['_ignoredOperations']['has'](_0x33e385)){if(!this['_operationToId']['has'](_0x33e385)){const _0x6b2998=_0x2b2046()['slice'](0x1,0x12);this['_operationToId']['set'](_0x33e385,_0x6b2998);}return this['_operationToId']['get'](_0x33e385);}}}setIdForTheLastOperation(_0x4aff67,_0xab2be6){if(!_0xab2be6)return;let _0xafe3e0=_0x4aff67['length'];for(;_0xafe3e0--;){const _0x44f56a=_0x4aff67[_0xafe3e0];this['_ignoredOperations']['has'](_0x44f56a)||this['_operationToId']['set'](_0x44f56a,_0xab2be6);}}},ct=class extends _0x262914{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class extends _0x262914{['_sources']=new Map();_data=null;_hasStarted=!0x1;static get requires(){return[K,J,_0x15de6b];}static get['pluginName'](){return'RealTimeContentFetcher';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_register(_0x36aa4b,_0x16fbf7){if(this['_hasStarted'])throw new _0x3d272c('realtimecontentfetcher-register-after-init',null,{'name':_0x36aa4b});if(this['_sources']['has'](_0x36aa4b))throw new _0x3d272c('realtimecontentfetcher-register-duplicate',null,{'name':_0x36aa4b});this['_sources']['set'](_0x36aa4b,_0x16fbf7);}_takeInitialData(_0x1e501f){if(!this['_data'])throw new _0x3d272c('realtimecontentfetcher-data-not-ready',null,{'name':_0x1e501f});if(!this['_data']['has'](_0x1e501f))throw new _0x3d272c('realtimecontentfetcher-data-not-available',null,{'name':_0x1e501f});const _0xed5718=this['_data']['get'](_0x1e501f);return this['_data']['delete'](_0x1e501f),_0xed5718;}async init(){this['_hasStarted']=!0x0;const _0x43b983=Array['from'](this['_sources']),_0x4020eb=await Promise['all'](_0x43b983['map'](([,_0x278290])=>_0x278290['fetch']()));await this['_fetchMissingUsers'](_0x43b983['map'](([,_0x29e266],_0x2a5bfc)=>_0x29e266['getUserIds'](_0x4020eb[_0x2a5bfc]))),this['_data']=new Map(_0x43b983['map'](([_0xa1819d],_0x3f2c5e)=>[_0xa1819d,_0x4020eb[_0x3f2c5e]]));}async _fetchMissingUsers(_0xcaa326){const _0x274756=this['editor']['plugins']['get'](_0x15de6b),_0x2934b9=new Set();for(const _0x320e05 of _0xcaa326)for(const _0x35de76 of _0x320e05)_0x274756['getUser'](_0x35de76)||_0x2934b9['add'](_0x35de76);if(0x0===_0x2934b9['size'])return;const {connection:_0x23e3b9}=this['editor']['plugins']['get'](K),_0x5b7280=await _0x13af73['getMany'](_0x23e3b9,Array['from'](_0x2934b9));for(const _0x1fca0d of _0x5b7280)_0x274756['getUser'](_0x1fca0d['id'])||_0x274756['addUser'](_0x1fca0d);}};function ht(_0x1cf43d){const _0x5c78de=new Set();for(const {resolvedBy:_0xa7b6a8,comments:_0xe57a2e}of _0x1cf43d){_0xa7b6a8&&_0x5c78de['add'](_0xa7b6a8);for(const {userId:_0x394e6d}of _0xe57a2e)_0x5c78de['add'](_0x394e6d);}return _0x5c78de;}var lt=class CloudServicesCommentsAdapter extends _0xd92386{static CommentsService=/* #__PURE__ -- @preserve */
26
- ((()=>_0x1a92a0)());['_services'];_pendingServiceEvents=new Map();_channelsAwaitingInitialData=new Set();static get requires(){return[K,_0x32c62d,J,_0x15de6b];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44b61b){super(_0x44b61b),this['_services']=new Map();}async init(){const _0x1c2bd8=this['context'],_0x4583b3=_0x1c2bd8['plugins']['get'](_0x32c62d);if(_0x1c2bd8['plugins']['get'](K)['addToReconnectionStack'](this),_0x4583b3['adapter']={'addCommentThread':async({channelId:_0x2eaee1,threadId:_0x19a08e,comments:_0x4beb1f,resolvedAt:_0x4910ee,resolvedBy:_0x4549ce,context:_0x4e2ff9,attributes:_0x1d4628})=>{const _0x72e08b=await this['_getService'](_0x2eaee1)['addCommentThread']({'commentThreadId':_0x19a08e,'comments':_0x4beb1f['map'](_0x23eed0=>function(_0x3582e9,_0x2db243,_0x3462a1){return{'commentThreadId':_0x3462a1,'commentId':_0x3582e9['commentId'],'userId':_0x3582e9['authorId'],'content':_0x3582e9['content'],'documentId':_0x2db243,'createdAt':_0x3582e9['createdAt'],'attributes':_0x3582e9['attributes']||{}};}(_0x23eed0,_0x2eaee1,_0x19a08e)),'resolvedAt':_0x4910ee,'resolvedBy':_0x4549ce,'context':_0x4e2ff9,'attributes':_0x1d4628})['catch'](ut);return{'threadId':_0x72e08b['commentThreadId'],'comments':_0x72e08b['comments']};},'getCommentThread':async({channelId:_0x4f499f,threadId:_0x5cf28e})=>{const _0x3b502f=await this['_getService'](_0x4f499f)['getCommentThread'](_0x5cf28e)['catch'](dt)['catch'](ut);return _0x3b502f?_0x3b502f['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3b502f]),{'threadId':_0x3b502f['commentThreadId'],'comments':_0x3b502f['comments']['map'](ft),'context':_0x3b502f['context'],'resolvedAt':_0x3b502f['resolvedAt'],'resolvedBy':_0x3b502f['resolvedBy'],'attributes':_0x3b502f['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x45c0e1,threadId:_0x5c73ad,context:_0x51e146,unlinkedAt:_0x4cf37c,attributes:_0x2eca85})=>this['_getService'](_0x45c0e1)['updateCommentThread']({'commentThreadId':_0x5c73ad,'context':_0x51e146,'attributes':_0x2eca85,'unlinkedAt':_0x4cf37c})['catch'](dt)['catch'](ut),'resolveCommentThread':async({channelId:_0x18d7d4,threadId:_0x6e56de})=>{const _0x4ec27=await this['_getService'](_0x18d7d4)['resolveCommentThread'](_0x6e56de)['catch'](dt)['catch'](ut);return{'threadId':_0x4ec27['commentThreadId'],'resolvedAt':_0x4ec27['resolvedAt'],'resolvedBy':_0x4ec27['resolvedBy']};},'reopenCommentThread':async({channelId:_0x161641,threadId:_0x256fe3})=>this['_getService'](_0x161641)['reopenCommentThread'](_0x256fe3)['catch'](dt)['catch'](ut),'removeCommentThread':({channelId:_0x49b269,threadId:_0xb3274b})=>this['_getService'](_0x49b269)['removeCommentThread'](_0xb3274b)['catch'](dt)['catch'](ut),'addComment':({channelId:_0x578e97,threadId:_0x7d014a,commentId:_0x184e5d,content:_0x25e556,attributes:_0xbcc4e8})=>this['_getService'](_0x578e97)['addComment'](_0x7d014a,_0x184e5d,_0x25e556,_0xbcc4e8)['catch'](ut),'updateComment':({channelId:_0x35391c,threadId:_0x2d37d6,commentId:_0x1044d4,content:_0x2e1d8,attributes:_0x558f1a})=>this['_getService'](_0x35391c)['updateComment'](_0x2d37d6,_0x1044d4,_0x2e1d8,_0x558f1a)['catch'](dt)['catch'](ut),'removeComment':({channelId:_0x289172,threadId:_0x4f62be,commentId:_0x3f152c})=>this['_getService'](_0x289172)['removeComment'](_0x4f62be,_0x3f152c)['catch'](dt)['catch'](ut)},_0x1c2bd8 instanceof _0x1c6641){const _0x41397d=_0x1c2bd8['config']['get']('collaboration.channelId'),_0x464105=_0x1c2bd8['plugins']['get'](J);await this['_setUpService'](_0x41397d);const _0x334170=await this['_services']['get'](_0x41397d)['getConnectedSessions']();this['listenTo'](_0x464105,'sessionAdd:'+_0x41397d,(_0x38cb6b,{session:_0x3a6989})=>{_0x3a6989['id']===_0x464105['mySessionId']&&(_0x38cb6b['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3a6989['permissions'],_0x41397d));}),_0x464105['register'](_0x41397d,_0x334170);}}async _setUpService(_0x120a95){this['_createService'](_0x120a95),await this['_connectService'](_0x120a95);}_createService(_0x5fc04a){if(this['_services']['has'](_0x5fc04a))throw new _0x3d272c('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x5fc04a});const _0x4b5d68=this['context']['plugins']['get'](_0x32c62d),_0x8455aa=new CloudServicesCommentsAdapter['CommentsService'](_0x5fc04a);this['_services']['set'](_0x5fc04a,_0x8455aa),this['listenTo'](_0x8455aa,'commentThreadAdded',(_0x3def56,_0x2f3184)=>{const {commentThreadId:_0x17338d,documentId:_0x3d000d,context:_0x55c5d5,attributes:_0x4b4dd3,resolvedAt:_0x1a79ca,resolvedBy:_0x457390,comments:_0x47b336}=_0x2f3184,_0x1c30c4=_0x47b336?_0x47b336['map'](({userId:_0x196c8b})=>_0x196c8b):[];_0x457390&&_0x1c30c4['push'](_0x457390),this['_handleOrQueueServiceEvent'](_0x5fc04a,_0x1c30c4,()=>{_0x4b5d68['getCommentThread'](_0x17338d)||_0x4b5d68['addCommentThread']({'threadId':_0x17338d,'channelId':_0x3d000d,'comments':_0x47b336?_0x47b336['map'](ft):[],'context':_0x55c5d5,'attributes':_0x4b4dd3,'resolvedAt':_0x1a79ca,'resolvedBy':_0x457390,'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentThreadUpdated',(_0x4f83ac,{commentThreadId:_0x269dad,documentId:_0x402930,context:_0x387758,unlinkedAt:_0xc40425,attributes:_0x1a104f})=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[],()=>{_0x4b5d68['getCommentThread'](_0x269dad)&&_0x4b5d68['updateCommentThread']({'threadId':_0x269dad,'channelId':_0x402930,'context':_0x387758,'unlinkedAt':_0xc40425,'attributes':_0x1a104f,'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentThreadResolved',(_0x223733,{commentThreadId:_0x525f01,resolvedBy:_0x2181a6,resolvedAt:_0x38e1e9})=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[_0x2181a6],()=>{const _0x50ca3d=_0x4b5d68['getCommentThread'](_0x525f01);_0x50ca3d&&!_0x50ca3d['isResolved']&&_0x50ca3d['resolve']({'resolvedBy':_0x2181a6,'resolvedAt':_0x38e1e9,'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentThreadReopened',(_0x1a18d0,{commentThreadId:_0x317286})=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[],()=>{const _0x109184=_0x4b5d68['getCommentThread'](_0x317286);_0x109184&&_0x109184['isResolved']&&_0x109184['reopen']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentThreadRemoved',(_0x4b9cda,{commentThreadId:_0x315154})=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[],()=>{const _0x47c2d8=_0x4b5d68['getCommentThread'](_0x315154);_0x47c2d8&&_0x47c2d8['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentAdded',(_0xfcea1a,_0x391531)=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[_0x391531['userId']],()=>{const _0x289a06=_0x4b5d68['getCommentThread'](_0x391531['commentThreadId']);_0x289a06&&!_0x289a06['getComment'](_0x391531['commentId'])&&_0x289a06['addComment']({...ft(_0x391531),'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentUpdated',(_0x4fad90,{commentThreadId:_0x4d314d,commentId:_0x157d9d,content:_0x5d20e1,attributes:_0x229d99})=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[],()=>{const _0x3c82fa=_0x4b5d68['getCommentThread'](_0x4d314d)?.['getComment'](_0x157d9d);_0x3c82fa&&_0x3c82fa['update']({'content':_0x5d20e1,'attributes':_0x229d99,'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'commentRemoved',(_0x56c5f2,{commentThreadId:_0x4e0578,commentId:_0x2a8d9e})=>{this['_handleOrQueueServiceEvent'](_0x5fc04a,[],()=>{const _0xc4214c=_0x4b5d68['getCommentThread'](_0x4e0578)?.['getComment'](_0x2a8d9e);_0xc4214c&&_0xc4214c['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x8455aa,'disconnected',()=>{'connected'===this['context']['plugins']['get'](K)['connection']?.['state']&&(this['_services']['delete'](_0x5fc04a),this['_pendingServiceEvents']['delete'](_0x5fc04a),this['stopListening'](_0x8455aa));});}destroy(){if(this['context']instanceof _0x1c6641){const _0x58f8b1=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x58f8b1)&&this['_terminateService'](_0x58f8b1);}}_terminateService(_0x1f4c6b){if(!this['_services']['has'](_0x1f4c6b))throw new _0x3d272c('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1f4c6b});this['_getService'](_0x1f4c6b)['disconnect'](),this['_services']['delete'](_0x1f4c6b);}async reconnect(){for(const _0x2b7543 of this['_services']['keys']())await this['_connectService'](_0x2b7543);if(this['context']instanceof _0x1c6641){const _0x37154f=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x37154f)){const _0x1a7ef2=this['context']['plugins']['get'](J);_0x1a7ef2['unregister'](_0x37154f);const _0x126595=await this['_services']['get'](_0x37154f)['getConnectedSessions']();_0x1a7ef2['register'](_0x37154f,_0x126595);}}}_fetchInitialChannelData(_0x2e9518){return this['_channelsAwaitingInitialData']['add'](_0x2e9518),this['_fetchChannelData'](_0x2e9518);}async _applyInitialChannelData(_0x2f4f23,_0x44085f){this['_channelsAwaitingInitialData']['delete'](_0x2f4f23)&&await this['_applyChannelData'](_0x2f4f23,_0x44085f);}async _fetchChannelData(_0x50efa4){const {connection:_0x376585}=this['context']['plugins']['get'](K);return this['_pendingServiceEvents']['set'](_0x50efa4,[]),await this['_services']['get'](_0x50efa4)['connect'](_0x376585);}async _applyChannelData(_0xc428d0,_0x50f484){const _0xf7a0df=this['context']['plugins']['get'](_0x32c62d),_0x13dcd1=new Set(Array['from'](_0xf7a0df['getCommentThreads']({'channelId':_0xc428d0}),_0x5a1513=>_0x5a1513['id']));for(const _0x238a13 of _0x50f484)_0x238a13['deletedAt']||_0x13dcd1['delete'](_0x238a13['commentThreadId']);for(const _0x55a76b of _0x13dcd1)_0xf7a0df['getCommentThread'](_0x55a76b)['remove']({'isFromAdapter':!0x0});for(const _0x1ed99b of _0x50f484){let _0x53ff25=_0xf7a0df['getCommentThread'](_0x1ed99b['commentThreadId']);const {commentThreadId:_0x3c2b77,context:_0x10a777,attributes:_0x5a451a,resolvedBy:_0x5e71d0,resolvedAt:_0x4fdf64,unlinkedAt:_0x53fb85,deletedAt:_0x42595e}=_0x1ed99b;if(_0x42595e)continue;_0x53ff25||(_0x53ff25=_0xf7a0df['addCommentThread']({'channelId':_0xc428d0,'threadId':_0x3c2b77,'context':_0x10a777,'attributes':_0x5a451a||{},'resolvedBy':_0x5e71d0,'resolvedAt':_0x4fdf64,'unlinkedAt':_0x53fb85,'isFromAdapter':!0x0}));const _0x5d27ef=new Set(Array['from'](_0x53ff25['comments'],_0x3b8c0e=>_0x3b8c0e['id']));for(const _0x1c390d of _0x1ed99b['comments'])_0x5d27ef['delete'](_0x1c390d['commentId']);for(const _0x109765 of _0x5d27ef)_0x53ff25['getComment'](_0x109765)['remove']({'isFromAdapter':!0x0});for(const _0x157c4f of _0x1ed99b['comments']){const _0x3af8c4=_0x53ff25['getComment'](_0x157c4f['commentId']);_0x3af8c4?_0x3af8c4['content']!==_0x157c4f['content']&&_0x3af8c4['update']({'content':_0x157c4f['content'],'isFromAdapter':!0x0}):_0x53ff25['addComment'](Object['assign'](ft(_0x157c4f),{'isFromAdapter':!0x0}));}}await this['_applyPendingServiceEvents'](_0xc428d0);}_handleOrQueueServiceEvent(_0x268cf9,_0x227f06,_0x19c0ab){const _0x4839eb=this['_pendingServiceEvents']['get'](_0x268cf9);_0x4839eb?_0x4839eb['push']({'userIds':_0x227f06,'apply':_0x19c0ab}):_0x19c0ab();}async _applyPendingServiceEvents(_0x3ca515){const _0x351d57=this['_pendingServiceEvents']['get'](_0x3ca515)||[];for(;_0x351d57['length'];){const _0x1b98d0=_0x351d57['splice'](0x0);await this['_fetchMissingUsers'](_0x1b98d0['flatMap'](({userIds:_0x594a93})=>_0x594a93));for(const {apply:_0x524e3c}of _0x1b98d0)_0x524e3c();}this['_discardPendingServiceEvents'](_0x3ca515,_0x351d57);}_discardPendingServiceEvents(_0x254f46,_0x3c00f1){this['_pendingServiceEvents']['get'](_0x254f46)===_0x3c00f1&&this['_pendingServiceEvents']['delete'](_0x254f46);}async _connectService(_0x122de9){const _0x5dabb9=this['_channelsAwaitingInitialData']['delete'](_0x122de9),_0x3af059=this['_fetchChannelData'](_0x122de9),_0x359a3b=this['_pendingServiceEvents']['get'](_0x122de9);let _0x3e3c78=!0x1;try{const _0x39211b=await _0x3af059;_0x3e3c78=!0x0,await this['_fetchMissingUsersForThreads'](_0x39211b),await this['_applyChannelData'](_0x122de9,_0x39211b);}catch(_0x2afc93){throw this['_discardPendingServiceEvents'](_0x122de9,_0x359a3b),_0x5dabb9&&!_0x3e3c78&&this['_channelsAwaitingInitialData']['add'](_0x122de9),_0x2afc93;}}_getService(_0x1c0501){if(!this['_services']['has'](_0x1c0501))throw new _0x3d272c('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1c0501});return this['_services']['get'](_0x1c0501);}async _fetchMissingUsersForThreads(_0x478b24){return this['_fetchMissingUsers'](ht(_0x478b24));}async _fetchMissingUsers(_0x51b8c0){const _0x5f1b7f=this['context']['plugins']['get'](_0x15de6b),{connection:_0x4d9b1a}=this['context']['plugins']['get'](K),_0x435f61=Array['from'](new Set(_0x51b8c0))['filter'](_0x58e0f3=>!_0x5f1b7f['getUser'](_0x58e0f3));if(0x0===_0x435f61['length'])return;const _0x3dc30e=await _0x13af73['getMany'](_0x4d9b1a,_0x435f61);for(const _0x5de07a of _0x3dc30e)_0x5f1b7f['getUser'](_0x5de07a['id'])||_0x5f1b7f['addUser'](_0x5de07a);}};async function dt(_0x788f9d){if('404'!==_0x788f9d['code'])throw _0x788f9d;}function ut(_0x287c99){if((_0x40b924=_0x287c99)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x40b924['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x40b924['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x40b924;throw _0x287c99;}function ft(_0x53841b){return{'threadId':_0x53841b['commentThreadId'],'commentId':_0x53841b['commentId'],'content':_0x53841b['content'],'createdAt':_0x53841b['createdAt'],'authorId':_0x53841b['userId'],'attributes':_0x53841b['attributes']||{}};}var mt=class CloudServicesTrackChangesAdapter extends _0x262914{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>_0x44424a)());_bufferedRequests;_trackChangesService;['_isChannelFlushed']=!0x1;_pendingSuggestionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[lt,_0x16108d,K,at];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d81f4){super(_0x3d81f4);const _0x49dbea=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x49dbea),_0x3d81f4['plugins']['get'](at)['_register']('trackChanges',{'fetch':()=>this['_fetchInitialSuggestions'](),'getUserIds':_0x2087ce=>_0x2087ce['map'](({authorId:_0x4bec83})=>_0x4bec83)});}init(){const _0x368811=this['editor']['plugins']['get'](_0x16108d);_0x368811['adapter']={'getSuggestion':async _0x4a2891=>{await this['_waitForServiceReady']();const _0x3678d5=await this['_trackChangesService']['get'](_0x4a2891)['catch'](pt);return await this['_fetchMissingUsersForThreads']([_0x3678d5]),_0x3678d5;},'addSuggestion':async({id:_0x140ee0,type:_0x13423a,data:_0x35d7ba,originalSuggestionId:_0x36f481,attributes:_0x44b1e5})=>{await this['_waitForServiceReady']();const _0x485f1e={'id':_0x140ee0,'type':_0x13423a,'data':_0x35d7ba,'originalSuggestionId':_0x36f481,'attributes':_0x44b1e5},_0x5dd896=await this['_trackChangesService']['add'](_0x140ee0,_0x13423a,_0x35d7ba,_0x36f481,_0x44b1e5)['catch'](_0x595a7c=>{if(gt(_0x595a7c))return new Promise(_0x1ff328=>{this['_bufferedRequests']['set'](_0x140ee0,{'resolve':_0x1ff328,'suggestionData':_0x485f1e});});throw _0x595a7c;});return this['_bufferedRequests']['delete'](_0x140ee0),_0x5dd896;},'updateSuggestion':async(_0x9026c5,_0x127fb0)=>{if(await this['_waitForServiceReady'](),'open'!==_0x127fb0['state'])return this['_trackChangesService']['update'](_0x9026c5,_0x127fb0)['catch'](pt);}};const _0x30beb0=this['editor']['plugins']['get'](at)['_takeInitialData']('trackChanges');for(const _0x4ed69e of _0x30beb0){_0x368811['addSuggestionData'](_0x4ed69e)['_saved']=!0x0;}for(const {id:_0x305228,attributes:_0xd532e5}of this['_pendingSuggestionsUpdates'])this['_handleSuggestionUpdate'](_0x305228,_0xd532e5);this['_pendingSuggestionsUpdates']=null,this['_setReadyForReconnect']();}async _fetchInitialSuggestions(){const _0x2a49dc=this['editor']['plugins']['get'](K);this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x181c2d,{id:_0x327e40,attributes:_0xcc336e})=>{this['_pendingSuggestionsUpdates']?this['_pendingSuggestionsUpdates']['push']({'id':_0x327e40,'attributes':_0xcc336e}):this['_handleSuggestionUpdate'](_0x327e40,_0xcc336e);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x2a49dc['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x2a49dc['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));});const _0x287ab0=await this['_trackChangesService']['connect'](_0x2a49dc['connection']);return this['_isChannelFlushed']||_0x2a49dc['addToReconnectionStack'](this),_0x287ab0;}_handleSuggestionUpdate(_0x1872e4,_0x567e74){const _0x304386=this['editor']['plugins']['get'](_0x16108d);_0x304386['hasSuggestion'](_0x1872e4)&&(_0x304386['getSuggestion'](_0x1872e4)['attributes']=_0x567e74);}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x27723b=>console['error'](_0x27723b)));}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x1f3180=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1ac6c0}=this['editor']['plugins']['get'](K),_0x2042e6=await this['_trackChangesService']['connect'](_0x1ac6c0);await this['_fetchMissingUsersForThreads'](_0x2042e6);for(const {suggestionData:_0x10ea5a,resolve:_0x51a80e}of this['_bufferedRequests']['values']()){let _0x3e9e95=_0x2042e6['find'](_0x204beb=>_0x204beb['id']===_0x10ea5a['id']);_0x3e9e95||(_0x3e9e95=await this['_trackChangesService']['add'](_0x10ea5a['id'],_0x10ea5a['type'],_0x10ea5a['data'],_0x10ea5a['originalSuggestionId'])),_0x51a80e(_0x3e9e95);}for(const _0x400c7f of _0x2042e6)_0x1f3180['hasSuggestion'](_0x400c7f['id'])||_0x1f3180['addSuggestionData'](_0x400c7f);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x3ad632=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2d561e=>{_0x2d561e['off'](),_0x3ad632();});});}async _fetchMissingUsersForThreads(_0x3b395f){const _0x28a02a=this['editor']['plugins']['get'](_0x15de6b),{connection:_0x6a2a24}=this['editor']['plugins']['get'](K),_0x39b963=new Set();for(const {authorId:_0x204c4a}of _0x3b395f)_0x28a02a['getUser'](_0x204c4a)||_0x39b963['add'](_0x204c4a);if(0x0===_0x39b963['size'])return;const _0xa2c26d=await _0x13af73['getMany'](_0x6a2a24,Array['from'](_0x39b963));for(const _0x5be260 of _0xa2c26d)_0x28a02a['getUser'](_0x5be260['id'])||_0x28a02a['addUser'](_0x5be260);}};function pt(_0x18cee8){if(gt(_0x18cee8))return new Promise(()=>{});throw _0x18cee8;}function gt(_0x2e950c){return _0x2e950c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2e950c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var wt=class extends _0x262914{static get requires(){return[_0x53cd39,lt,ct,K,at];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b4217){super(_0x4b4217);const _0x348963=_0x4b4217['plugins']['get'](lt),_0x55012b=_0x4b4217['config']['get']('collaboration.channelId');_0x4b4217['plugins']['get'](at)['_register']('comments',{'fetch':()=>(_0x348963['_createService'](_0x55012b),_0x348963['_fetchInitialChannelData'](_0x55012b)),'getUserIds':ht});}init(){const _0x25a343=this['editor']['plugins']['get'](K),_0x45659b=this['editor']['plugins']['get'](_0x4e9a9b),_0x9819bc=this['editor']['plugins']['get'](lt);this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x25a343,'change:state',(_0x2059b8,_0x4b3556,_0x3af507)=>{_0x45659b['isThreadsLoadingPaused']='connected'!==_0x3af507;});}),this['listenTo'](_0x25a343,'change:state',(_0x5d22b6,_0x36605e,_0x36cb6a)=>{this['editor']['plugins']['get'](_0x32c62d)['switchReadOnly']('connected'!==_0x36cb6a);});const _0x5ee4fd=this['editor']['config']['get']('collaboration.channelId'),_0x27c43a=this['editor']['plugins']['get'](at)['_takeInitialData']('comments');return _0x9819bc['_applyInitialChannelData'](_0x5ee4fd,_0x27c43a);}destroy(){const _0xc32ed5=this['editor']['plugins']['get'](lt),_0x4f01de=this['editor']['config']['get']('collaboration.channelId');_0xc32ed5['_services']['has'](_0x4f01de)&&_0xc32ed5['_terminateService'](_0x4f01de),super['destroy']();}},vt=class extends _0x262914{static get requires(){return[wt,mt,_0xed1670];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},_t=class CloudServicesRevisionHistoryAdapter extends _0x262914{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
- ((()=>_0x45eb68)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;['_isChannelFlushed']=!0x1;_newestRevisionPrefetch=null;_pendingRevisionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[K,it,_0x5c14b1,J,_0x15de6b,at];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2925a8){super(_0x2925a8);const _0x4b3706=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x4b3706),this['set']('_isServiceConnected',!0x1),_0x2925a8['plugins']['get'](at)['_register']('revisionHistory',{'fetch':()=>this['_fetchInitialData'](),'getUserIds':({revisions:_0x4d9c03})=>_0x4d9c03['flatMap'](({authorsIds:_0x4066a0,creatorId:_0x389acb})=>_0x389acb?[..._0x4066a0,_0x389acb]:_0x4066a0)});}async init(){const _0x406178=this['editor']['plugins']['get'](it),{hasEditorBundle:_0x326b88,revisions:_0xfef435}=this['editor']['plugins']['get'](at)['_takeInitialData']('revisionHistory');this['listenTo'](this['editor']['data'],'ready',()=>{this['_setReadyForReconnect'](),this['_newestRevisionPrefetch']=null;}),this['editor']['plugins']['get'](_0x5c14b1)['adapter']={'getRevision':async({revisionId:_0x3fef2d})=>{const _0x48669e=this['_newestRevisionPrefetch'];return _0x48669e&&_0x48669e['revisionId']===_0x3fef2d?(this['_newestRevisionPrefetch']=null,_0x48669e['promise']):(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3fef2d));},'updateRevisions':async _0x2d5e3c=>{await this['_waitForServiceReady']();const _0x36a981=this['_revisionTracker']['currentRevision'];if(_0x326b88&&0x1===_0x2d5e3c['length']&&_0x2d5e3c[0x0]['id']===_0x36a981['id'])return _0x2d5e3c;for(const _0x3c466b of _0x2d5e3c)_0x3c466b['id']===_0x36a981['id']&&(_0x3c466b['isEmptyCurrent']=_0x3c466b['fromVersion']===_0x3c466b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2d5e3c,this['_lastRequestId'])['then'](_0x60f511=>(this['_lastRequestId']=_0x60f511,_0x2d5e3c))['catch'](_0x630315=>{if(yt(_0x630315)||'400'===_0x630315['code']&&void 0x0!==_0x630315['data']['wrongRequestId']){for(const _0x1746fb of _0x2d5e3c)this['_revisionTracker']['repository']['getRevision'](_0x1746fb['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x1746fb['id'],_0x1746fb,!0x1);if(yt(_0x630315)&&'destroyed'!==this['editor']['state'])throw _0x630315;return _0x2d5e3c;}throw _0x630315;});}};for(const _0x57c19b of _0xfef435)this['_revisionTracker']['addRevisionData'](_0x57c19b);this['listenTo'](_0x406178,'change:_isConnected',(_0x12c6fc,_0x4d8a5e,_0x452adb)=>{_0x452adb&&(this['_oldOffset']=_0x406178['_offset'],_0x12c6fc['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected'),await this['_applyPendingRevisionsUpdates']();}async _fetchInitialData(){const _0x3c8484=this['editor']['plugins']['get'](it),_0x133e5=this['editor']['plugins']['get'](K),_0x36f6ad=_0x3c8484['serverHistory'];this['_revisionTracker']['setSource']({'history':_0x36f6ad,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x3c8484['sessionId']}),this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1b90bc,{revisionsData:_0x5dcb47,requestId:_0x7f2f53})=>{_0x5dcb47['some'](({id:_0xefb22})=>_0xefb22===this['_newestRevisionPrefetch']?.['revisionId'])&&(this['_newestRevisionPrefetch']=null),Math['max'](..._0x5dcb47['map'](_0x548e6d=>_0x548e6d['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleOrQueueRevisionsUpdate'](_0x5dcb47,_0x7f2f53);}):this['_handleOrQueueRevisionsUpdate'](_0x5dcb47,_0x7f2f53);}),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x133e5['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x133e5['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const _0x873dd6=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x4357dc,[_0x51688c,_0x57b7da]=await Promise['all']([_0x45a732['isBundleUploaded'](_0x133e5['connection'],_0x873dd6),this['_revisionHistoryService']['connect'](_0x133e5['connection'])['then'](_0x248493=>(this['_lastRequestId']=_0x248493['requestId'],this['_isChannelFlushed']||_0x133e5['addToReconnectionStack'](this),this['_prefetchNewestRevision'](_0x248493['revisions']),_0x248493['revisions']))]);return{'hasEditorBundle':_0x51688c,'revisions':_0x57b7da};}_handleOrQueueRevisionsUpdate(_0x2d8d8d,_0x111e87){this['_pendingRevisionsUpdates']?this['_pendingRevisionsUpdates']['push']({'revisionsData':_0x2d8d8d,'requestId':_0x111e87}):this['_handleRevisionsUpdate'](_0x2d8d8d,_0x111e87);}async _applyPendingRevisionsUpdates(){for(;this['_pendingRevisionsUpdates']['length'];){const _0x144017=this['_pendingRevisionsUpdates']['splice'](0x0);await this['_fetchMissingUsers'](_0x144017['flatMap'](({revisionsData:_0x470b0e})=>_0x470b0e));for(const {revisionsData:_0x41d8f6,requestId:_0x4c4d4d}of _0x144017)this['_handleRevisionsUpdate'](_0x41d8f6,_0x4c4d4d);}this['_pendingRevisionsUpdates']=null;}_prefetchNewestRevision(_0x23d3b3){const _0x584819=_0x23d3b3['reduce']((_0x5de9d0,_0x44234c)=>_0x5de9d0?(_0x44234c['toVersion']-_0x5de9d0['toVersion']||_0x44234c['fromVersion']-_0x5de9d0['fromVersion'])>0x0?_0x44234c:_0x5de9d0:_0x44234c,null);if(!_0x584819||_0x584819['diffData'])return;const _0x361658=this['_revisionHistoryService']['getRevision'](_0x584819['id']);_0x361658['catch'](()=>{}),this['_newestRevisionPrefetch']={'revisionId':_0x584819['id'],'promise':_0x361658};}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x15771b=this['editor']['plugins']['get'](K),_0x5e5823=this['editor']['plugins']['get'](it),_0x45170f=async()=>{const _0x146486=this['_revisionTracker']['currentRevision'],_0x31adb5=_0x146486['id'],_0x3eeb1b=_0x31adb5!==_0x5e5823['sessionId'];if(_0x3eeb1b){const _0x4d3bb3=_0x5e5823['_offset']-this['_oldOffset'],_0x43f95e=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x146486['toVersion']+_0x4d3bb3!==_0x43f95e){const _0x3329c1=_0x146486['fromVersion']+_0x4d3bb3,_0x5651a4=this['editor']['plugins']['get'](_0x15de6b),_0x3a2d33=this['_revisionTracker']['buildRevisionData']({'revision':_0x146486,'from':_0x3329c1,'to':_0x43f95e});_0x3a2d33['id']=_0x146486['id'];const _0x5b11d2=_0x3a2d33['authorsIds']['map'](_0x2b8484=>_0x5651a4['getUser'](_0x2b8484));_0x146486['_update']({..._0x3a2d33,'authors':_0x5b11d2},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x146486['id'],_0x3a2d33,!0x0);}this['_revisionTracker']['_startingVersion']=_0x43f95e,_0x146486['toVersion']!==_0x146486['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x31adb5)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x31adb5),this['_revisionTracker']['_createCurrentRevision'](_0x43f95e);}const {revisions:_0x36a9d4,requestId:_0x439f1c}=await this['_revisionHistoryService']['reconnect'](_0x15771b['connection'],this['_lastRequestId']);_0x3eeb1b&&_0x36a9d4['length']>0x0?_0x5e5823['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x36a9d4),this['_handleRevisionsUpdate'](_0x36a9d4,_0x439f1c),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5e5823['_isConnected']?_0x45170f():new Promise((_0x10b915,_0x378af5)=>{_0x5e5823['once']('change:_isConnected',()=>{_0x45170f()['then'](_0x10b915)['catch'](_0x378af5);});});}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x38c84f=>console['error'](_0x38c84f)));}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1221a7=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x55e2a3=>{_0x55e2a3['off'](),_0x1221a7();});});}_getLatestVersionFromServerOperations(){const _0x5892cb=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x185392 of _0x5892cb)if('marker'!==_0x185392['type']||_0x185392['affectsData'])return _0x185392['baseVersion']+0x1;}_getLatestVersion(){const _0x187004=this['editor']['plugins']['get'](it);return new Promise(_0x3406fb=>{_0x187004['_isPendingUpdate']?_0x187004['once']('change:_isPendingUpdate',()=>{_0x3406fb(this['_getLatestVersionFromServerOperations']());}):_0x3406fb(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x1ceaf1,_0x7734d8){const _0x3bb3eb=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x7734d8;for(const _0x37f89a of _0x1ceaf1){const _0x17a1dc=_0x3bb3eb['getRevision'](_0x37f89a['id']);if(_0x17a1dc){if((_0x37f89a['fromVersion']||_0x37f89a['toVersion'])&&(_0x37f89a['diffData']=null),_0x17a1dc===this['_revisionTracker']['currentRevision']){const _0x33a1e0=Math['max'](_0x17a1dc['toVersion'],_0x37f89a['toVersion']),_0x29f7ea=Math['max'](_0x17a1dc['fromVersion'],_0x37f89a['fromVersion']);let _0x314fe2;_0x17a1dc['toVersion']===_0x37f89a['toVersion']&&_0x17a1dc['fromVersion']===_0x37f89a['fromVersion']?(_0x314fe2=!0x0,this['_preventResendingRevisionData'](_0x37f89a)):_0x37f89a['toVersion']===_0x33a1e0&&_0x37f89a['fromVersion']===_0x29f7ea?_0x314fe2=!0x1:(_0x17a1dc['toVersion']===_0x33a1e0&&_0x17a1dc['fromVersion']===_0x29f7ea||this['_fixRevision']({'revision':_0x17a1dc,'from':_0x29f7ea,'to':_0x33a1e0}),_0x314fe2=!0x0),_0x314fe2&&(delete _0x37f89a['fromVersion'],delete _0x37f89a['toVersion'],delete _0x37f89a['diffData'],delete _0x37f89a['createdAt'],delete _0x37f89a['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x37f89a),this['_preventResendingRevisionData'](_0x37f89a);}else this['_revisionTracker']['addRevisionData'](_0x37f89a);}const _0x17dfb2=_0x3bb3eb['getRevisions']();_0x17dfb2['reverse']();for(let _0x322e12=0x0;_0x322e12<_0x17dfb2['length']-0x1;_0x322e12++){const _0x2ea98f=_0x17dfb2[_0x322e12],_0x226f9b=_0x17dfb2[_0x322e12+0x1];if(_0x2ea98f['fromVersion']<_0x226f9b['toVersion']){const _0x405e20=_0x226f9b['toVersion'],_0x4bc22f=Math['max'](_0x405e20,_0x2ea98f['toVersion']);this['_fixRevision']({'revision':_0x2ea98f,'from':_0x405e20,'to':_0x4bc22f});}}}['_fixRevision']({revision:_0x4079ad,from:_0x49f0f0,to:_0x441257}={}){const _0x307ea4=this['editor']['plugins']['get'](_0x15de6b),_0x42a44b=this['_revisionTracker']['buildRevisionData']({'revision':_0x4079ad,'from':_0x49f0f0,'to':_0x441257});_0x42a44b['authors']=_0x42a44b['authorsIds']['map'](_0x3dc19d=>_0x307ea4['getUser'](_0x3dc19d)),_0x4079ad['_update'](_0x42a44b);}_preventResendingRevisionData(_0x1a8558){const _0x4b923e={};_0x4b923e['id']=_0x1a8558['id'];for(const _0xbf94e2 of Object['keys'](_0x1a8558))'id'!==_0xbf94e2&&(_0x4b923e[_0xbf94e2]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4b923e['id'],_0x4b923e,!0x0);}async _fetchMissingUsers(_0x222017){const _0x3b9c7f=this['editor']['plugins']['get'](_0x15de6b),{connection:_0x103c25}=this['editor']['plugins']['get'](K),_0x50e11d=new Set();for(const _0x5d443d of _0x222017){for(const _0x20ead7 of _0x5d443d['authorsIds']||[])_0x2047fd(_0x20ead7);_0x5d443d['creatorId']&&_0x2047fd(_0x5d443d['creatorId']);}if(0x0===_0x50e11d['size'])return;const _0x469f73=await _0x13af73['getMany'](_0x103c25,Array['from'](_0x50e11d));for(const _0x56ba1e of _0x469f73)_0x3b9c7f['getUser'](_0x56ba1e['id'])||_0x3b9c7f['addUser'](_0x56ba1e);function _0x2047fd(_0x41d0de){_0x3b9c7f['getUser'](_0x41d0de)||_0x50e11d['add'](_0x41d0de);}}};function yt(_0xae13aa){return _0xae13aa['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0xae13aa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xae13aa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var bt=class extends _0x262914{static get requires(){return[_0x5c14b1,_t,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},kt=class extends _0x594f2d{_collapseAt;constructor(_0x25da6a,_0xb15af3=0x6){super(_0x25da6a);const _0x373483=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0xb15af3,this['bind']('isHidden')['to'](this,'usersCount',_0x2d6b5a=>_0x2d6b5a<_0xb15af3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x373483['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':_0x373483['to']('usersCount',_0x40b77b=>'+'+(_0x40b77b-this['_collapseAt']+0x2)['toString']())}]}]}]});}},It=class extends _0x594f2d{items;keystrokes;constructor(_0x16b247){super(_0x16b247);const _0x262420=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x1af9e2(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x262420['if']('hasPopup'),'aria-expanded':_0x262420['to']('isExpanded',_0x3ac580=>this['hasPopup']&&String(_0x3ac580)),'aria-label':_0x262420['to']('hasPopup',_0x23fb65=>et(_0x16b247,_0x23fb65?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x262420['to']('hasPopup',_0x295ff4=>!!_0x295ff4&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0x1e6ff3,_0x3d06d2,_0x2226f9)=>{this['element']&&(_0x2226f9?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']);}},St=class extends _0x594f2d{counterView;inlineListView;constructor(_0x323b92,_0x5a5be2=0x6){super(_0x323b92);const _0x4ed6be=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new kt(this['locale'],_0x5a5be2),this['inlineListView']=new It(_0x323b92),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x32f800 of this['inlineListView']['items'])_0x32f800['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',_0x4ed6be['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},Ct=class extends _0x594f2d{listWrapperView;constructor(_0xeb251f,_0x137c85){super(_0xeb251f),this['listWrapperView']=new Tt(_0xeb251f,_0x137c85),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0xeb251f,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},Tt=class extends _0x4cc17e{constructor(_0x1648c9,_0xfed47b){super(_0x1648c9);const _0x2f5bbc=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xfed47b?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2f5bbc['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2f5bbc['to']('role'),'aria-label':_0x2f5bbc['to']('ariaLabel'),'aria-labelledby':_0x2f5bbc['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x277f8e['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1ea28d=this['element'];_0x1ea28d&&(this['_isScrollable']=Math['max'](_0x1ea28d['scrollHeight'],_0x1ea28d['clientHeight'])>0.8*window['innerHeight']);}},At=class extends _0x41e812{['userView'];constructor(_0x54c860,_0x2db4c3,_0x32a003){super(_0x54c860);const _0x4951de=this['bindTemplate'];this['userView']=new _0x160146(_0x54c860,_0x2db4c3);const _0x460ea2={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x2db4c3['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x2db4c3['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2db4c3['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x2db4c3['color']['getColorVariable'](),'--ck-user-color-alpha':_0x2db4c3['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x32a003&&(_0x460ea2['tag']='button',_0x460ea2['on']={'click':_0x4951de['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x460ea2);}['focus'](){this['element']['focus']();}},Pt=class extends _0x594f2d{['userView'];['markerView'];constructor(_0x1b6f3c,_0x560e23,_0x8aa734){super(_0x1b6f3c);const _0x2e5b87=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x160146(_0x1b6f3c,_0x560e23),this['markerView']=new Rt(_0x1b6f3c,_0x560e23);const _0x4e7feb=new _0x49b0f3(_0x1b6f3c);_0x4e7feb['template']['tag']='span',_0x4e7feb['text']=_0x560e23['name'];const _0x339075={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x2e5b87['to']('isFocusable',_0x16b878=>_0x16b878?0x0:-0x1),'aria-labelledby':_0x4e7feb['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x2e5b87['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x2e5b87['to']('hasTooltip',_0x2d2518=>!_0x2d2518),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4e7feb]};_0x8aa734&&(_0x339075['tag']='button',_0x339075['on']={'click':_0x2e5b87['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x339075);}},Rt=class extends _0x594f2d{constructor(_0x160c67,_0x442c27){super(_0x160c67),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x442c27['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x442c27['color']['getColorVariable'](),'--ck-user-color-alpha':_0x442c27['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Ot={'collapseAt':0x6,'displayMe':!0x0};var xt=class extends _0xd92386{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c955b){super(_0x2c955b),this['context']['config']['define']('presenceList',Ot);const _0x3af2d3=_0x2c955b['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3af2d3)throw new _0x3d272c('presencelist-collapseat-invalid-format',this);if(_0x3af2d3<0x1)throw new _0x3d272c('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](J)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5addaf(),this['balloonPanelView']=new _0x12e5db(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[J];}init(){for(const _0x179015 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x179015);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4b5f3e,_0x148861)=>{this['_handleUserAdd'](_0x148861);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5481ef,_0xfa0703)=>{this['_handleUserRemove'](_0xfa0703);});}_createView(){const _0x20426b=this['context'],_0x93a9de=new St(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x15275a=this['balloonPanelView'];if(!_0x3d354a(_0x20426b['config']['get']('presenceList.container')))throw new _0x3d272c('presencelist-missing-container',this);_0x93a9de['counterView']['bind']('usersCount')['to'](this),_0x93a9de['bind']('isCollapsed')['to'](this,'usersCount',_0x53e7a9=>{const {collapseAt:_0x504478}=_0x20426b['config']['get']('presenceList'),_0xb60875=_0x53e7a9>=_0x504478;if(_0xb60875&&!_0x93a9de['inlineListView']['items']['find'](_0x36d5d7=>_0x36d5d7 instanceof kt)){const _0x3547b0=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x3547b0&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x93a9de['inlineListView']['items']['add'](_0x93a9de['counterView']);}return _0xb60875||this['hideDropdown'](),_0xb60875;}),_0x93a9de['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x42e297=>{const _0x335834=_0x20426b['config']['get']('presenceList'),_0x398774=new Pt(_0x20426b['locale'],_0x42e297,!!_0x335834['onClick']);return _0x398774['bind']('hasTooltip')['to'](_0x93a9de,'isCollapsed',_0x4c2f84=>!_0x4c2f84),_0x398774['bind']('isFocusable')['to'](_0x93a9de,'isCollapsed',_0x584cba=>!_0x584cba),_0x335834['onClick']&&this['listenTo'](_0x398774,'execute',()=>{this['view']['isCollapsed']||_0x335834['onClick'](_0x42e297,_0x398774['element']);}),_0x398774;}),_0x93a9de['inlineListView']['keystrokes']['set']('Enter',(_0x2c8fff,_0x21c16e)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x21c16e());}),_0x93a9de['render'](),_0x15275a['render'](),_0x93a9de['listenTo'](_0x93a9de['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x28529a=(_0x367d06,_0x6dcc82)=>{this['_hideDropdownUnlessPointerInside'](_0x6dcc82);};return _0x93a9de['listenTo'](_0x93a9de['inlineListView']['element'],'mouseleave',_0x28529a),_0x93a9de['listenTo'](_0x15275a['element'],'mouseleave',_0x28529a),_0x54f668({'emitter':_0x93a9de,'activator':()=>_0x15275a['isVisible'],'contextElements':[_0x15275a['element'],_0x93a9de['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x20426b['config']['get']('presenceList.container')['appendChild'](_0x93a9de['element']),this['_overlayHost']=new _0x590aa6(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x93a9de;}_resolveOverlayTarget(){const _0x207d47=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x207d47)return _0x207d47;const _0x550fe8=this['context']['config']['get']('presenceList.container');return _0x550fe8?_0x138971(_0x550fe8):null;}['_handleUserAdd'](_0x1fb095){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1fb095['isMe'])return;const _0x2c7179=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2c7179-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x21634e=_0x1fb095['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1fb095,_0x21634e);}['_handleUserRemove'](_0x3f0a18){this['usersCount']--;const {collapseAt:_0x207c9e}=this['context']['config']['get']('presenceList'),_0x585cee=this['usersCount']>=_0x207c9e;if(this['currentDisplayedUsers']['get'](_0x3f0a18['id']))this['currentDisplayedUsers']['remove'](_0x3f0a18['id']);else{if(_0x585cee&&this['currentDisplayedUsers']['length']+0x1===_0x207c9e-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x585cee?0x1:0x0)<this['usersCount']){for(const _0x4934fc of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4934fc['id'])&&(this['currentDisplayedUsers']['add'](_0x4934fc,Math['min'](this['currentDisplayedUsers']['length']-(_0x585cee?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x585cee?0x1:0x0)===_0x207c9e-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3f6ce0=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Ct(this['context']['locale'],!!_0x3f6ce0['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x1b8ff3}=this['presenceDropdownView'];_0x1b8ff3['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x32d828=>{if(!_0x3f6ce0['displayMe']&&_0x32d828['isMe'])return null;const _0x42d0fc=new At(this['context']['locale'],_0x32d828,!!_0x3f6ce0['onClick']);return _0x3f6ce0['onClick']&&this['listenTo'](_0x42d0fc,'execute',()=>{_0x3f6ce0['onClick'](_0x32d828,_0x42d0fc['element']);}),_0x42d0fc;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0x5b0d87=_0x12e5db['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0x5b0d87['southArrowNorth'],_0x5b0d87['southArrowNorthMiddleWest'],_0x5b0d87['southArrowNorthMiddleEast'],_0x5b0d87['southArrowNorthWest'],_0x5b0d87['southArrowNorthEast'],_0x5b0d87['northArrowSouth'],_0x5b0d87['northArrowSouthMiddleWest'],_0x5b0d87['northArrowSouthMiddleEast'],_0x5b0d87['northArrowSouthWest'],_0x5b0d87['northArrowSouthEast'],_0x5b0d87['viewportStickyNorth']]}),_0x1b8ff3['focus'](),_0x1b8ff3['checkIfScrollable']();const _0x234309=(_0x3ef1b2,_0x53e703)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x53e703();};_0x1b8ff3['keystrokes']['set']('Esc',_0x234309),_0x1b8ff3['keystrokes']['set']('Shift+Tab',_0x234309),_0x1b8ff3['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x1b8ff3['focusTracker']['add'](this['view']['element']),_0x1b8ff3['focusTracker']['on']('change:isFocused',(_0x4e73df,_0x70139c,_0xe1db03)=>{_0xe1db03||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);}_hideDropdownUnlessPointerInside(_0x312548){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x3dd811=>_0x207afd(_0x3dd811,_0x312548))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},Nt=class extends _0xd92386{static get requires(){return[J,xt];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{lt as CloudServicesCommentsAdapter,_t as CloudServicesRevisionHistoryAdapter,mt as CloudServicesTrackChangesAdapter,Nt as PresenceList,xt as PresenceListUI,it as RealTimeCollaborationClient,wt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,bt as RealTimeCollaborativeRevisionHistory,vt as RealTimeCollaborativeTrackChanges,at as RealTimeContentFetcher,J as Sessions,K as WebSocketGateway};
23
+ import{Context as _0x5d909c,ContextPlugin as _0x2a424a,PendingActions as _0xb7e73c,Plugin as _0x323d44}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x72635a,Collection as _0x24fe62,DomEmitterMixin as _0x274dc9,KeystrokeHandler as _0x3967e9,getOverlayMountRoot as _0x279c1c,global as _0x31a7fc,trustedHtml as _0x30565c,uid as _0x543842,version as _0x52c089}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x2a8ccc,LabelView as _0x52aefb,ListItemView as _0x700f3a,ListView as _0x22761e,Notification as _0x2e29a3,OverlayHost as _0x5947b1,View as _0x1cf434,clickOutsideHandler as _0x23b991}from'@ckeditor/ckeditor5-ui';import{History as _0x205c8e,InsertOperation as _0x280c28,MarkerOperation as _0x29b12d,ModelLiveRange as _0x1c0129,NoOperation as _0x4314d0,OperationFactory as _0x4ec439,RootAttributeOperation as _0x147413,transformOperationSets as _0x242765}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x23128d}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x19181e,CommentsService as _0x4eed7c,EditorService as _0x59814e,RevisionHistoryService as _0x57fc4b,TrackChangesService as _0x58c0b7,User as _0x4c7d1e,WEB_SOCKET_GATEWAY_STATES as _0x3842a8,WebSocketGateway as _0x4046e2}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x5c2918,Users as _0x594ec5,isPointerStillOver as _0x331861}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x3dae34}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x3f6f2f,TrackChangesEditing as _0x30f396}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x43ef0d,CommentsEditing as _0x5e816a,CommentsRepository as _0x583a94}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x324b7a}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x302ca0}from'es-toolkit/compat';var K=class WebSocketGateway extends _0x2a424a{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
+ ((()=>_0x4046e2)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x23128d,_0x2e29a3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1719d6){super(_0x1719d6),this['set']('state',_0x3842a8['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x274dc9())();}init(){const _0x31aca9=this['context'],_0x4a63d3=_0x31aca9['plugins']['get'](_0x23128d),_0x2d0cbb=_0x31aca9['plugins']['get'](_0x2e29a3);if(!_0x4a63d3['token'])throw new _0x72635a('websocketgateway-missing-token',this);if(!_0x4a63d3['webSocketUrl'])throw new _0x72635a('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),WebSocketGateway['WebSocketGateway']['connect'](_0x4a63d3['token'],_0x4a63d3['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3bcba3=>{if(this['connection']=_0x3bcba3,this['bind']('state')['to'](_0x3bcba3,'state',this,'_isBrowserOffline',(_0x46d4c2,_0x13b546)=>('connected'!==_0x46d4c2&&(this['_shouldPluginsReconnect']=!0x0),_0x13b546||_0x46d4c2!==_0x3842a8['CONNECTED']?_0x3842a8['DISCONNECTED']:this['state']==_0x3842a8['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3842a8['CONNECTING']):_0x3842a8['CONNECTED'])),this['connection']['on']('error',(_0x4c667d,_0x28475e)=>{if('limitExceeded'!==_0x28475e['code'])throw console['error'](_0x28475e),new _0x72635a('cloudservices-init',null,{'originalError':_0x28475e});_0x2d0cbb['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'});}),!_0x3bcba3['me'])return new Promise(_0xdc2de4=>_0x3bcba3['on']('change:me',_0xdc2de4));})['catch'](_0x159c34=>{throw console['error'](_0x159c34),new _0x72635a('cloudservices-init',null,{'originalError':_0x159c34});});}addToReconnectionStack(_0x3a8d22){if('function'!=typeof _0x3a8d22['reconnect'])throw new _0x72635a('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3a8d22))throw new _0x72635a('websocketgateway-plugin-already-registered',this,{'name':_0x3a8d22['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3a8d22);}removeFromReconnectionStack(_0x187860){this['_reconnectionStack']['delete'](_0x187860);}isInReconnectionStack(_0x2bca91){return this['_reconnectionStack']['has'](_0x2bca91);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1dde1b=>_0x1dde1b['reconnect']())))['then'](()=>this['state']=_0x3842a8['CONNECTED'])['catch'](_0x18357d=>{throw console['error'](_0x18357d),new _0x72635a('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3842a8['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},J=class extends _0x2a424a{['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[K,_0x594ec5];}constructor(_0x241d48){super(_0x241d48),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x24fe62(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x594ec5);}init(){const _0x5bb3c5=this['context']['plugins']['get'](K);this['listenTo'](_0x5bb3c5,'change:state',(_0x3d9f64,_0x37a4f4,_0x15e6c3)=>{if('connected'!==_0x15e6c3)this['channelSessions']['forEach'](_0x4bac47=>_0x4bac47['clear']()),this['channelConnectedUsers']['forEach'](_0x50e7ac=>_0x50e7ac['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3ecf41,_0x319147]of this['_registeredSessions'])for(const _0x25e1e9 of _0x319147)this['_handleSessionAdd'](_0x3ecf41,_0x25e1e9);}}),this['_createUser'](_0x5bb3c5['connection']['me'],!0x0);}register(_0x284d57,_0x21602e){if(this['_registeredSessions']['has'](_0x284d57))throw new _0x72635a('sessions-register-already-registered',null,{'channelId':_0x284d57});this['_registeredSessions']['set'](_0x284d57,_0x21602e),this['channelSessions']['set'](_0x284d57,new _0x24fe62()),this['channelConnectedUsers']['set'](_0x284d57,new _0x24fe62()),this['listenTo'](_0x21602e,'add',(_0x5be8ed,_0x50da2b)=>this['_handleSessionAdd'](_0x284d57,_0x50da2b)),this['listenTo'](_0x21602e,'remove',(_0x3e0a64,_0x1de217)=>this['_handleSessionRemove'](_0x284d57,_0x1de217));for(const _0xd14cb3 of _0x21602e)this['_handleSessionAdd'](_0x284d57,_0xd14cb3);}unregister(_0x28ceef){if(!this['_registeredSessions']['has'](_0x28ceef))throw new _0x72635a('sessions-unregister-not-exist',null,{'channelId':_0x28ceef});const _0x1d597d=this['_registeredSessions']['get'](_0x28ceef);this['stopListening'](_0x1d597d);for(const _0x1346ae of _0x1d597d)'connected'===this['context']['plugins']['get'](K)['state']&&this['_handleSessionRemove'](_0x28ceef,_0x1346ae);this['_registeredSessions']['delete'](_0x28ceef),this['channelSessions']['delete'](_0x28ceef),this['channelConnectedUsers']['delete'](_0x28ceef);}get['mySessionId'](){return this['context']['plugins']['get'](K)['connection']['sessionId'];}getUserBySessionId(_0x5032a4){for(const _0x439da3 of this['channelSessions']['values']())for(const _0xf84e14 of _0x439da3)if(_0xf84e14['id']===_0x5032a4)return _0xf84e14['user'];}getUserSessions(_0x54f72f,_0x4639a1){const _0x439dcd=_0x4639a1?[this['channelSessions']['get'](_0x4639a1)]:this['channelSessions']['values'](),_0x1a691e=new Set();for(const _0x37bc66 of _0x439dcd)for(const _0x366a96 of _0x37bc66)_0x366a96['user']['id']===_0x54f72f['id']&&_0x1a691e['add'](_0x366a96['id']);return _0x1a691e;}getUserRole(_0x3a81e8){for(const _0x14727b of this['channelSessions']['values']())for(const _0x4efe13 of _0x14727b)if(_0x4efe13['user']===_0x3a81e8)return _0x4efe13['role'];}['_handleSessionAdd'](_0x2ec5b6,_0x5506d0){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x3e8f05=_0x5506d0['user'],_0xf170db=this['_users']['getUser'](_0x3e8f05['id'])||this['_createUser'](_0x3e8f05),_0x4233ef=Object['assign']({},_0x5506d0,{'user':_0xf170db});if(this['channelSessions']['get'](_0x2ec5b6)['add'](_0x4233ef),!_0x3e8f05['hiddenInPresenceList']){const _0x25b109=this['channelConnectedUsers']['get'](_0x2ec5b6);_0x25b109['has'](_0xf170db['id'])||_0x25b109['add'](_0xf170db),this['allConnectedUsers']['has'](_0xf170db['id'])||_0x3e8f05['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xf170db,_0xf170db['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x2ec5b6,{'channelId':_0x2ec5b6,'session':_0x4233ef});}['_handleSessionRemove'](_0x39f4d1,_0x52ba05){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x2be9b6=this['channelConnectedUsers']['get'](_0x39f4d1),_0x9b9930=_0x52ba05['user'];_0x9b9930['id']&&(this['channelSessions']['get'](_0x39f4d1)['remove'](_0x52ba05['id']),_0x2be9b6['has'](_0x9b9930['id'])&&!this['getUserSessions'](_0x9b9930,_0x39f4d1)['size']&&_0x2be9b6['remove'](_0x9b9930['id']),this['allConnectedUsers']['get'](_0x9b9930['id'])&&!this['getUserSessions'](_0x9b9930)['size']&&this['allConnectedUsers']['remove'](_0x9b9930['id']));}_createUser(_0x27fb02,_0x13b098){const _0x1e5cec=this['_users']['addUser'](_0x27fb02);return _0x13b098&&this['_users']['defineMe'](_0x27fb02['id']),_0x1e5cec['orderNumber']=this['_uniqueUsersCount']++,_0x1e5cec;}},X=class extends _0x323d44{_domEmitter=new(_0x274dc9())();static get requires(){return[J];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5afc95=this['editor'],_0x75cae8=_0x5afc95['plugins']['get'](J);_0x5afc95['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x2610f1,{writer:_0xc1c80d})=>function(_0x96f97,_0x34347e,_0xe40bc4,_0x4fd1f8){const _0x5519a3=_0x96f97['markerName']['split'](':')[0x2],_0x1809ac=_0xe40bc4['getUserBySessionId'](_0x5519a3);if(!_0x1809ac||_0x5519a3===_0xe40bc4['mySessionId'])return;if(!_0x4fd1f8['model']['schema']['checkChild'](_0x96f97['markerRange']['start'],'$text'))return;const _0x17754d={'class':'ck-user__marker\x20'+_0x1809ac['color']['getMarkerClass'](),'style':tt(_0x1809ac),'data-name':_0x1809ac['name'],'data-session-id':_0x5519a3},_0x9a56cb=_0x4fd1f8['model']['markers']['get'](_0x96f97['markerName'])['getStart'](),_0x18315b=_0x9a56cb['nodeAfter'],_0x11d12a=_0x4fd1f8['model']['schema'];if(_0x18315b&&_0x11d12a['isObject'](_0x18315b)&&_0x11d12a['isInline'](_0x18315b)&&!_0x4fd1f8['model']['markers']['get']('user:range:'+_0x5519a3)['getRange']()['isCollapsed'])return;const _0x1c1df0=_0x9a56cb['parent'];return _0x4fd1f8['model']['schema']['isLimit'](_0x1c1df0)&&!_0x4fd1f8['model']['hasContent'](_0x1c1df0)&&(_0x17754d['contenteditable']=!0x1),function(_0x152255,_0x2f9bf3,_0xb1fd2a){const _0x3503c8=_0x152255['createUIElement']('span',_0x2f9bf3);return _0x152255['setCustomProperty']('userPositionMarker',!0x0,_0x3503c8),_0x3503c8['render']=function(_0x956f7d){const _0x144d75=this['toDomElement'](_0x956f7d),_0x13ccc5=document['createElement']('span');return _0x13ccc5['classList']['add']('ck-user__marker-tooltip'),_0x13ccc5['setAttribute']('contenteditable','false'),_0x13ccc5['setAttribute']('spellcheck','false'),_0x13ccc5['textContent']=_0xb1fd2a['name'],_0x144d75['innerHTML']=_0x30565c('⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x13ccc5['outerHTML']+'⁠'),_0x144d75['addEventListener']('mouseenter',()=>{_0x144d75['classList']['add']('ck-user__marker_hovered');}),_0x144d75['addEventListener']('mouseleave',()=>{_0x144d75['classList']['remove']('ck-user__marker_hovered');}),_0x144d75;},_0x3503c8['isSimilar']=function(_0x8a737){return!(!this['getCustomProperty']('userPositionMarker')||!_0x8a737['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x8a737['getAttribute']('data-session-id'));},_0x3503c8;}(_0x34347e,_0x17754d,_0x1809ac);}(_0x2610f1,_0xc1c80d,_0x75cae8,_0x5afc95)}),_0x5afc95['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x28ceec=>function(_0x149ae2,_0x139183){const _0x34e1b6=_0x149ae2['markerName']['split'](':')[0x2];if(_0x34e1b6===_0x139183['mySessionId'])return null;const _0x1af596=_0x139183['getUserBySessionId'](_0x34e1b6);return _0x1af596?{'id':_0x34e1b6,'classes':['ck-user__selection',_0x1af596['color']['getSelectionClass']()],'attributes':{'style':tt(_0x1af596),'data-session-id':_0x34e1b6},'priority':0x7d0+_0x1af596['orderNumber']}:{'id':_0x34e1b6,'classes':[]};}(_0x28ceec,_0x75cae8)}),function(_0x17b6d4){const _0x5eedbd=_0x17b6d4['model'],_0x587c66=new Map(),_0xb8436=_0x17b6d4['plugins']['get'](J);_0x5eedbd['markers']['on']('update:user:range',(_0x416c6c,_0x56567f,_0x35a97d,_0x3800ae)=>{if(!_0x3800ae&&_0x587c66['get'](_0x56567f['name']))return _0x587c66['get'](_0x56567f['name'])['detach'](),void _0x587c66['delete'](_0x56567f['name']);const _0x347678=_0x56567f['name']['split'](':')[0x2];if(_0x347678===_0xb8436['mySessionId'])return;const _0x2eed0c='user:position:'+_0x347678;_0x5eedbd['markers']['has'](_0x2eed0c)&&_0x17b6d4['editing']['reconvertMarker'](_0x2eed0c),_0x56567f['on']('change:range',(_0x46a185,_0x250437,_0x39ce4c)=>{if('$graveyard'!=_0x250437['root']['rootName']&&'$graveyard'==_0x56567f['getRange']()['root']['rootName']&&!_0x587c66['has'](_0x56567f['name'])){const _0x456cb1=_0x5eedbd['schema']['getNearestSelectionRange'](_0x39ce4c['deletionPosition']);if(_0x456cb1){const _0x2bc615=_0x1c0129['fromRange'](_0x456cb1);_0x587c66['set'](_0x56567f['name'],_0x2bc615),_0x2bc615['on']('change:range',(_0x54f083,_0x36fdb0,_0x45f809)=>{if('$graveyard'==_0x2bc615['root']['rootName']){const _0x1b71b4=_0x5eedbd['schema']['getNearestSelectionRange'](_0x45f809['deletionPosition']);_0x1b71b4?(_0x2bc615['start']=_0x1b71b4['start'],_0x2bc615['end']=_0x1b71b4['end']):(_0x587c66['delete'](_0x56567f['name']),_0x2bc615['detach']());}});}}});}),_0x5eedbd['document']['on']('change',()=>{_0x587c66['size']>0x0&&_0x5eedbd['enqueueChange']({'isUndoable':!0x1},_0xbac985=>{for(const [_0x2e733f,_0x5578a6]of _0x587c66)'$graveyard'==_0x5eedbd['markers']['get'](_0x2e733f)['getRange']()['root']['rootName']&&(Z(_0x2e733f['split'](':')[0x2],_0x5578a6['toRange'](),_0x5eedbd,_0xbac985),_0x5578a6['detach']());_0x587c66['clear']();});});}(_0x5afc95),this['_domEmitter']['listenTo'](_0x31a7fc['document'],'keydown',(_0x373dce,{key:_0x5129b2})=>{'Escape'===_0x5129b2&&function(_0x586d0c){_0x586d0c['editing']['view']['change'](_0x45fafb=>{for(const _0x3fad57 of _0x586d0c['model']['markers']){if(!_0x3fad57['name']['startsWith']('user:position'))continue;const _0x1e05c0=_0x586d0c['editing']['mapper']['markerNameToElements'](_0x3fad57['name']);if(_0x1e05c0){for(const _0x5d841b of _0x1e05c0)_0x45fafb['removeClass']('ck-user__marker_hovered',_0x5d841b);}}});}(_0x5afc95);},{'useCapture':!0x0});}afterInit(){const _0x4960cb=this['editor'],_0xcf747c=_0x4960cb['commands']['get']('undo');_0xcf747c&&_0x4960cb['model']['on']('applyOperation',(_0x4397be,_0xc51d52)=>{const _0x296053=_0xc51d52[0x0];if(!_0x296053['isDocumentOperation'])return;if('marker'!=_0x296053['type']||!_0x296053['name']['startsWith']('user:'))return;const _0x52d37a=_0x296053['batch'];_0xcf747c['_createdBatches']['has'](_0x52d37a)&&(_0x296053['newRange']=_0x296053['oldRange']?_0x4960cb['model']['createRange'](_0x296053['oldRange']['start'],_0x296053['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x3d80eb=this['editor'],_0x443ced=_0x3d80eb['model']['document'],_0x2a1ff9=_0x3d80eb['plugins']['get'](J);_0x3d80eb['model']['enqueueChange']({'isUndoable':!0x1},_0xcb5cca=>{const _0x3e3f06='user:range:'+_0x2a1ff9['mySessionId'],_0x52f515='user:position:'+_0x2a1ff9['mySessionId'],_0x4c8cca=_0x3d80eb['model']['markers']['has'](_0x3e3f06);_0x3d80eb['editing']['view']['hasDomSelection']?Z(_0x2a1ff9['mySessionId'],_0x443ced['selection']['getFirstRange'](),_0x3d80eb['model'],_0xcb5cca):_0x4c8cca&&(_0xcb5cca['removeMarker'](_0x3e3f06),_0xcb5cca['removeMarker'](_0x52f515));});}};function Z(_0x14f512,_0x4eb3ea,_0x543817,_0x566e24){const _0x3bef60='user:range:'+_0x14f512,_0x1f0f4b='user:position:'+_0x14f512,_0x8dbff7=_0x4eb3ea['getContainedElement']();let _0x482403=_0x4eb3ea['start'];if(_0x8dbff7&&_0x8dbff7['is']('element','tableCell')){const _0x22578a=function(_0x48ab94,_0x9afcf7){for(const _0xc6cc9a of _0x48ab94['getPositions']())if(_0x9afcf7['schema']['checkChild'](_0xc6cc9a,'$text'))return _0xc6cc9a;}(_0x4eb3ea,_0x543817);_0x22578a&&(_0x482403=_0x22578a,_0x4eb3ea=_0x566e24['createRange'](_0x482403));}const _0x50ff20=_0x566e24['createRange'](_0x482403);_0x543817['markers']['has'](_0x3bef60)?(_0x566e24['updateMarker'](_0x3bef60,{'range':_0x4eb3ea}),_0x566e24['updateMarker'](_0x1f0f4b,{'range':_0x50ff20})):(_0x566e24['addMarker'](_0x3bef60,{'range':_0x4eb3ea,'usingOperation':!0x0}),_0x566e24['addMarker'](_0x1f0f4b,{'range':_0x50ff20,'usingOperation':!0x0}));}function tt(_0x1c6bfe){return'--ck-user-color:'+_0x1c6bfe['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x1c6bfe['color']['getColorAlphaVariable']()+';';}function et(_0x2927ee,_0x300da8,_0x8f7367){const _0x4825fd=_0x2927ee['t'],t=_0x2927ee['t'];switch(_0x300da8){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 _0x4825fd({'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'},_0x8f7367);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x323d44{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x19181e)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[K,J,X,_0xb7e73c,_0x594ec5,_0x2e29a3];}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 _0x1df4f3=this['serverHistory']['getOperations']();for(let _0x369dce=_0x1df4f3['length']-0x1;_0x369dce>=0x0;_0x369dce--){const _0xae17de=_0x1df4f3[_0x369dce];if(!this['_disconnectionOperations']['has'](_0xae17de))return _0xae17de['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x4f5595){if(super(_0x4f5595),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x205c8e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x72635a('collaboration-missing-channelid',this);const _0x221658=_0x4f5595['config']['get']('cloudServices.bundleVersion')||_0x52c089;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x221658,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3dae34(),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 ot(this['_disconnectionOperations']);}init(){const _0x459339=this['editor'],_0x108144=_0x459339['plugins']['get'](_0x594ec5),_0x1fd812=_0x459339['plugins']['get'](K);this['listenTo'](_0x108144,'getOperationAuthor',(_0x40792f,_0x3b1f92)=>{const _0x54fe17=_0x3b1f92[0x0];_0x54fe17['_authorId']&&(_0x40792f['return']=_0x108144['getUser'](_0x54fe17['_authorId']),_0x40792f['stop']()),null===_0x54fe17['_authorId']&&(_0x40792f['return']=null,_0x40792f['stop']());},{'priority':'high'}),this['listenTo'](_0x459339['model']['document']['selection'],'change:range',(_0x1ca273,_0x324b20)=>{_0x324b20['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x459339['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x459339['model']['on']('applyOperation',(_0x2284b8,_0x1b27e4)=>{const _0x26b8dd=_0x1b27e4[0x0];_0x26b8dd['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x26b8dd),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x1fd812,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x2a41e4,_0x4e3ed6,_0x547a58)=>'connected'===_0x2a41e4&&!_0x4e3ed6&&!_0x547a58),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x459339['disableReadOnlyMode']('rtc-offline'):_0x459339['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x459339['disableReadOnlyMode']('rtc-offline'):_0x459339['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x5769e6=this['editor']['plugins']['get'](J),_0x44c8fa=this['editor']['plugins']['get'](K);try{this['_isPendingUpdate']=!0x0,_0x5769e6['unregister'](this['_channelId']);const _0x202131=await this['_service']['reconnect'](_0x44c8fa['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x202131)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2ed53c=await this['_service']['getConnectedSessions']();_0x5769e6['register'](this['_channelId'],_0x2ed53c),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x188528){if(function(_0x3350e3){return'404'===_0x3350e3['code'];}(_0x188528)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5aca91){return'409'===_0x5aca91['code'];}(_0x188528)){const _0x90370a=et(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'](_0x90370a);}else{if(!(_0x188528 instanceof nt))throw _0x188528;this['_handleReconnectionError']();}}}}destroy(){const _0x50c83e=this['editor']['plugins']['get'](K),_0x183068=this['editor']['plugins']['get'](J);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x183068['channelSessions']['has'](this['_channelId'])&&_0x183068['unregister'](this['_channelId']),_0x50c83e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x1f8246){if(this['sessionId']!==_0x1f8246['sessionId']&&this['_lastSyncedOperationId']!==_0x1f8246['lastOperationId'])throw new nt();return this['sessionId']=_0x1f8246['sessionId'],this['_handleServerResponse']([],{..._0x1f8246,'wereChangesApplied':!0x1,'data':_0x1f8246['data']},'reconnect');}async _connectService(_0x174a96,_0x276c27=!0x1){const {connection:_0x337b55}=this['editor']['plugins']['get'](K);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x337b55,this['_channelId'])['then'](_0x58e29a=>this['_initSessionsHandling'](_0x58e29a))['catch'](_0x4962a3=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4962a3);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3d1bc6,_0x3b95ee)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3b95ee);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x6dfa58=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x174a96);this['_isPendingUpdate']=!0x0;const _0xf171fd=await this['_service']['connect'](_0x337b55,this['_compressOperations'](_0x174a96),_0x6dfa58);if(this['sessionId']=_0xf171fd['sessionId'],_0x276c27){if(!_0xf171fd['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xf171fd['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x174a96,_0xf171fd,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xf171fd,_0x174a96);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x2649ce=this['editor']['plugins']['get'](J),_0x224254=this['editor']['plugins']['get'](X),_0x55880e=_0x2649ce['channelSessions']['get'](this['_channelId']);_0x55880e&&_0x55880e['length']>0x1?_0x224254['createUserMarkerOperations']():this['listenTo'](_0x2649ce,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2649ce['channelSessions']['get'](this['_channelId'])['length']&&_0x224254['createUserMarkerOperations']();});}async _handleReceivedOperations(_0xc88c88,_0x3c4531,_0x938d68,_0x53f03a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3c4531){const _0x515b6b=this['_decompressOperations'](_0x938d68,_0x53f03a);await this['_fetchMissingUsers'](_0x515b6b),this['_handleExternalOperations'](_0x515b6b,_0x3c4531,_0x938d68['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x44f675}=this['editor'];let _0x2ad513;try{_0x2ad513=await this['_service']['getDocumentDetails']();}catch{const _0x1d04da=et(_0x44f675,'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'](_0x1d04da);}const _0x1a74c0=_0x2ad513['currentDocumentSession']||_0x2ad513['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x1a74c0['lastOperationId']){const _0x417411=et(_0x44f675,'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 void this['_handleReconnectionError'](_0x417411);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x53d876=this['editor']['plugins']['get'](K);if(this['_isConnected']=!0x1,!_0x53d876['connection']||'connected'!==_0x53d876['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x1b1d85=this['editor']['plugins']['get'](J);_0x1b1d85['channelSessions']['has'](this['_channelId'])&&_0x1b1d85['unregister'](this['_channelId']),_0x53d876['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x535db9){const _0xa9d3a1=this['editor']['plugins']['get'](J);this['listenTo'](_0xa9d3a1,'sessionAdd:'+this['_channelId'],(_0x2341e8,{session:_0x1a169a})=>{if(_0x1a169a['id']===_0xa9d3a1['mySessionId']){_0x2341e8['off']();const _0x1b6e0a=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x48db97=_0x1a169a['permissions'];_0x1b6e0a&&_0x1b6e0a['isEnabled']&&(_0x48db97=_0x48db97['filter'](_0x313d95=>'document:write'!==_0x313d95)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x48db97,this['_channelId']);}}),_0xa9d3a1['register'](this['_channelId'],_0x535db9);}_initThrowingOnDataSet(){const _0x5a6f22=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5d96ae)=>{if(!_0x5d96ae[_0x5d96ae['length']-0x1]['suppressErrorInCollaboration'])throw new _0x72635a('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5a6f22['apply'](this['editor']['data'],_0x5d96ae);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0xf8fb38,[_0x49f6e5])=>{if(this['_document']['version'])throw new _0x72635a('realtimecollaborationclient-init-document-already-initialized',this);_0xf8fb38['stop'](),this['_setPendingAction']();const _0x6a05c7=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x519aad])=>!_0x519aad['lazyLoad'])['map'](([_0x5f0555,_0x516804])=>[_0x5f0555,_0x516804['modelAttributes']||{}])),_0x3df142=this['_getOperationsFromInitData'](_0x49f6e5,_0x6a05c7);0x0==_0x3df142['length']&&_0x3df142['push'](new _0x4314d0(0x0)),_0xf8fb38['return']=this['_connectService'](_0x3df142)['then'](()=>{this['editor']['plugins']['get'](K)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x34da54=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x34da54))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x4881fd,[_0x864197,_0x5f17cc])=>{_0x4881fd['stop']();const _0x1b7021=this['editor']['model']['document']['getRoot'](_0x864197);if(!this['_knownRootNames']['has'](_0x864197)){const _0x306a75=_0x5f17cc&&_0x5f17cc['data']?_0x5f17cc['data']:'',_0x5a4e26=_0x5f17cc&&_0x5f17cc['attributes']?_0x5f17cc['attributes']:{};await this['_loadRoot'](_0x864197,_0x306a75,_0x5a4e26);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x1b7021['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x1b7021);});},{'priority':'high'});}async _fetchMissingUsers(_0x34a1c6){const _0x339cd3=this['editor']['plugins']['get'](_0x594ec5),{connection:_0xf23b39}=this['editor']['plugins']['get'](K),_0x5da6aa=new Set();for(const _0x4766aa of _0x34a1c6){const _0x3a34f8=_0x4766aa['_authorId'];_0x3a34f8&&!_0x339cd3['getUser'](_0x3a34f8)&&_0x5da6aa['add'](_0x3a34f8);}if(0x0===_0x5da6aa['size'])return;const _0x47f79e=await _0x4c7d1e['getMany'](_0xf23b39,Array['from'](_0x5da6aa));for(const _0x393559 of _0x47f79e)_0x339cd3['getUser'](_0x393559['id'])||_0x339cd3['addUser'](_0x393559);}_getOperationsFromInitData(_0x3fbbb1,_0x38915b={}){const _0x5d038e=this['editor']['model'],_0x48a18c=[];let _0x182145=0x0;const _0x20d3f0='string'==typeof _0x3fbbb1?{'main':_0x3fbbb1}:_0x3fbbb1;for(const _0x4e6fc2 of Object['keys'](_0x20d3f0)){if(!this['_document']['roots']['has'](_0x4e6fc2))throw new _0x72635a('realtimecollaborationclient-init-non-existent-root',this);const _0x2861f7=this['_document']['getRoot'](_0x4e6fc2),_0x2634bb=this['editor']['data']['parse'](_0x20d3f0[_0x4e6fc2],_0x2861f7),_0xa20d56=new _0x280c28(_0x5d038e['createPositionAt'](_0x2861f7,0x0),_0x2634bb,_0x182145++);_0x48a18c['push'](_0xa20d56);for(const [_0x490c9a,_0x2f596f]of _0x2634bb['markers']){const _0x1f0ae4=_0x5d038e['createRange'](_0x5d038e['createPositionFromPath'](_0x2861f7,_0x2f596f['start']['path']['slice']()),_0x5d038e['createPositionFromPath'](_0x2861f7,_0x2f596f['end']['path']['slice']())),_0x128ddf=new _0x29b12d(_0x490c9a,null,_0x1f0ae4,_0x5d038e['markers'],!0x0,_0x182145++);_0x48a18c['push'](_0x128ddf);}}if(_0x38915b)for(const [_0x415313,_0x49ceeb]of Object['entries'](_0x38915b)){const _0x5d223e=_0x5d038e['document']['getRoot'](_0x415313);if(!_0x5d223e)throw new _0x72635a('multi-root-editor-root-attributes-no-root',null);for(const [_0x530de0,_0xbec288]of Object['entries'](_0x49ceeb))if(null!==_0xbec288){const _0x41159c=new _0x147413(_0x5d223e,_0x530de0,null,_0xbec288,_0x182145++);_0x48a18c['push'](_0x41159c);}}return _0x48a18c;}async _loadRoot(_0xaf3242,_0x191f95,_0x52ec1a){this['_getOperationsFromInitData']({[_0xaf3242]:_0x191f95},{[_0xaf3242]:_0x52ec1a})['forEach']((_0x1659c9,_0x4f8b0c)=>{_0x1659c9['baseVersion']=this['_document']['version']+_0x4f8b0c,_0x1659c9['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1659c9);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x54a991,_0x57f395){let _0x251378;this['_offset']=_0x54a991['offset'];const _0xfbde59=_0x54a991['wereChangesApplied']&&!_0x54a991['initData'],_0x2df2e0=_0xfbde59?0x0:_0x54a991['data']['baseVersion'];if(_0x57f395['forEach'](_0x2ded68=>{_0x2ded68['_isInit']=!0x0,_0x2ded68['createdAt']=_0x54a991['sessionCreatedAt'],_0x2ded68['_authorId']=null;}),_0xfbde59)_0x251378=_0x57f395,this['_applyOperationsSet'](_0x251378,_0xfbde59);else{if(_0x54a991['initData']){const _0x4b0e76=this['_getOperationsFromInitData'](_0x54a991['initData']);this['_document']['history']['version']=-_0x4b0e76['length'],_0x4b0e76['forEach'](_0x293d18=>{_0x293d18['baseVersion']-=_0x4b0e76['length'],_0x293d18['createdAt']=_0x54a991['sessionCreatedAt'],_0x293d18['_isInit']=!0x0,_0x293d18['_authorId']=null;}),this['_applyOperationsSet'](_0x4b0e76,!0x0),this['serverHistory']['version']=-_0x4b0e76['length']+this['_offset'],this['_updateServerHistory'](_0x4b0e76);}this['_document']['history']['version']=_0x2df2e0,_0x251378=this['_decompressOperations'](_0x54a991['data'],_0x54a991['metadata']),await this['_fetchMissingUsers'](_0x251378),this['_applyOperationsSet'](_0x251378,_0xfbde59);}_0x54a991['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x251378,_0x54a991['lastOperationId']),this['_lastSyncedOperationId']=_0x54a991['lastOperationId']),this['serverHistory']['version']=_0x2df2e0+this['_offset'],this['_updateServerHistory'](_0x251378),_0x57f395['filter'](_0x24cfb7=>{const _0x138589=this['_getAffectedRoot'](_0x24cfb7);return _0x138589&&!this['_knownRootNames']['has'](_0x138589);})['forEach']((_0x531fb9,_0x498ec6)=>{_0x531fb9['baseVersion']=this['_document']['version']+_0x498ec6,this['_saveOperationInBuffer'](_0x531fb9);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x3d154e,_0x984e1d){const _0x9ee542=_0x984e1d&&_0x984e1d['message'];if(_0x9ee542&&_0x9ee542['startsWith']('realtimecollaborationclient'))throw _0x984e1d;const _0x59cf2e=this['editor']['plugins']['get'](K);throw this['_isPendingUpdate']=!0x0,_0x59cf2e['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x72635a(_0x3d154e,this['editor'],_0x9ee542?{'originalError':_0x9ee542}:void 0x0);}_saveOperationInBuffer(_0x4832b2){this['_knownOperations']['has'](_0x4832b2)||(this['_knownOperations']['add'](_0x4832b2),this['_bufferedOperations']['push'](_0x4832b2),this['_pendingAction']||'marker'==_0x4832b2['type']&&!_0x4832b2['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x131bf4=!0x1){!_0x131bf4&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x9f0cbf=>{_0x9f0cbf&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x22f827=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2aa3ce){return _0x2aa3ce['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2aa3ce['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2aa3ce['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x22f827)||this['_crash'](_0x22f827['message'],_0x22f827);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x58bb73=>{this['on']('change:_isPendingUpdate',()=>{_0x58bb73();});});}async _sendBufferedOperations(){const _0x88584d=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x88584d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x250754=[...this['_bufferedOperations']];for(const _0x59a388 of _0x250754)_0x59a388['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x59a388);const _0x5ade5d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x250754),_0x23dcd2=st++,_0x4eb18b=this['_compressOperations'](_0x250754),_0x92d60d=await this['_service']['sendOperations'](_0x4eb18b,_0x4eb18b['baseVersion'],_0x5ade5d);try{return await this['_handleServerResponse'](_0x250754,_0x92d60d,_0x23dcd2);}catch(_0x228890){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x228890);}}async['_handleServerResponse'](_0x3c5321,_0x550b17,_0x3490e4){if('error'in _0x550b17)throw _0x550b17['error'];let _0x402fd3;if(_0x550b17['wereChangesApplied']){_0x550b17['lastOperationId']&&(this['_lastSyncedOperationId']=_0x550b17['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4d9509=>!_0x3c5321['includes'](_0x4d9509));for(const _0x3e32af of _0x3c5321)_0x3e32af['createdAt']='lastOperationAcceptedAt'in _0x550b17&&_0x550b17['lastOperationAcceptedAt']||void 0x0;rt(_0x3c5321,_0x550b17['version']-_0x3c5321['length']),this['_updateServerHistory'](_0x3c5321);const _0x267595=_0x3c5321['filter'](_0x12f4dc=>{if(!_0x12f4dc['_isInit'])return!0x1;const _0x434929=this['_getAffectedRoot'](_0x12f4dc);return _0x434929&&!this['_knownRootNames']['has'](_0x434929);});rt(_0x267595,this['_document']['version']),this['_applyOperationsSet'](_0x267595),_0x402fd3=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1e7f83=this['_decompressOperations'](_0x550b17['data'],_0x550b17['metadata'])['filter'](_0x4e8ea0=>_0x4e8ea0['baseVersion']>=this['_lastServerVersion']);_0x1e7f83['forEach'](_0xa82ba6=>this['_addKnownRoot'](_0xa82ba6)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3970be=>!_0x3970be['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3970be))),this['_bufferedOperations']['length']&&rt(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1e7f83),_0x402fd3=this['_handleExternalOperations'](_0x1e7f83,_0x550b17['version'],_0x550b17['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x402fd3?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x35eb21,_0x348c69,_0x1ba103){try{const _0x369f01={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x18713d,operationsB:_0x3f1562,originalOperations:_0xb56746}=_0x242765(_0x35eb21,this['_bufferedOperations'],_0x369f01);rt(_0x18713d,this['_document']['version']),rt(_0x3f1562,_0x348c69);for(const _0x105e15 of _0x18713d){const _0x4893ab=_0xb56746['get'](_0x105e15);_0x4893ab?(_0x105e15['_authorId']=_0x4893ab['_authorId'],'noop'!==_0x105e15['type']&&(_0x105e15['_aiSource']=_0x4893ab['_aiSource'])):_0x105e15['_authorId']=null;}for(const _0x217cf5 of _0x3f1562)'noop'!==_0x217cf5['type']&&(_0x217cf5['_aiSource']=_0xb56746['get'](_0x217cf5)?.['_aiSource']);_0x1ba103&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x35eb21,_0x1ba103),this['_lastSyncedOperationId']=_0x1ba103),this['_bufferedOperations']=[..._0x3f1562],this['_applyOperationsSet'](_0x18713d),this['_updateServerHistory'](_0x35eb21);}catch(_0x199333){return console['error'](_0x199333),!0x1;}return!0x0;}_applyOperationsSet(_0x4d643e,_0x39567b=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3fe470=>{for(const _0xae1c89 of _0x4d643e)this['_knownOperations']['add'](_0xae1c89),this['_addKnownRoot'](_0xae1c89),_0x3fe470['batch']['addOperation'](_0xae1c89),this['editor']['model']['applyOperation'](_0xae1c89);});}_addKnownRoot(_0x492ca3){const _0x3833ce=this['_getAffectedRoot'](_0x492ca3);_0x3833ce&&this['_knownRootNames']['add'](_0x3833ce);}_getAffectedRoot(_0x577857){let _0x29a6ae,_0x526190;switch(_0x577857['type']){case'insert':_0x29a6ae=_0x577857['position']['root'];break;case'marker':if(_0x526190=_0x577857['newRange'],!_0x526190)return null;_0x29a6ae=_0x526190['root'];break;case'addRootAttribute':_0x29a6ae=_0x577857['root'];break;case'addRoot':_0x29a6ae=_0x577857['affectedSelectable'];break;case'move':_0x29a6ae=_0x577857['targetPosition']['root'];break;default:return null;}return _0x29a6ae['rootName'];}_updateServerHistory(_0x561df8){_0x561df8['forEach'](_0x1d222e=>{const _0x490906=_0x1d222e['clone']();_0x490906['_authorId']=_0x1d222e['_authorId'],_0x490906['_isInit']=!!_0x1d222e['_isInit'],_0x490906['_aiSource']=_0x1d222e['_aiSource'],_0x490906['createdAt']=_0x1d222e['createdAt'],_0x490906['baseVersion']+=this['_offset'],_0x1d222e['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x490906),this['serverHistory']['addOperation'](_0x490906);});}_handleReconnectionError(_0x132f05){const _0x423e45=this['editor']['plugins']['get']('Notification'),_0xe3c52a=this['editor']['locale'];_0x132f05||(_0x132f05=et(_0xe3c52a,'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.')),_0x423e45['showWarning'](_0x132f05,{'title':et(_0xe3c52a,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](K)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0xb7e73c)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0xb7e73c)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x4fe9e6){const _0x43ff27=_0x4fe9e6['map'](_0x26847e=>_0x26847e['toJSON']());return this['_compressor']['compress'](_0x43ff27);}_decompressOperations(_0x3ed9c1,_0x12f7eb){return this['_compressor']['decompress'](_0x3ed9c1)['map']((_0x5971b9,_0x235cfb)=>{const _0xea60a8='init'==_0x12f7eb[_0x235cfb]['type'];if('InsertOperation'==_0x5971b9['__className']){const _0x1c0d9c=_0x5971b9['position']['root'];!this['_document']['getRoot'](_0x1c0d9c)&&(this['_document']['createRoot']('$unknown',_0x1c0d9c)['_isAttached']=!0x1);}else{if('RootOperation'==_0x5971b9['__className']){const _0x53e665=this['_document']['getRoot'](_0x5971b9['rootName']);_0x53e665&&'$unknown'==_0x53e665['name']&&_0x5971b9['elementName']!=_0x53e665['name']&&(_0x53e665['name']=_0x5971b9['elementName']);}}const _0x3bf19d=_0x4ec439['fromJSON'](_0x5971b9,this['_document']);return _0x3bf19d['wasUndone']=_0x5971b9['wasUndone'],_0x3bf19d['_isInit']=_0xea60a8,_0x3bf19d['_authorId']=_0xea60a8?null:_0x12f7eb[_0x235cfb]['userId'],_0x3bf19d['_isDisconnection']='cs:removeUser'===_0x12f7eb[_0x235cfb]['type'],_0x3bf19d['_aiSource']=_0x5971b9['_aiSource']||void 0x0,_0x3bf19d['createdAt']=_0x12f7eb[_0x235cfb]['createdAt'],_0x3bf19d;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x2f1007=this['editor']['plugins']['get'](J)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2f1007&&_0x2f1007['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function rt(_0x41b1ea,_0x4c198c){for(const _0x5e20d4 of _0x41b1ea)_0x5e20d4['baseVersion']=_0x4c198c++;}var ot=class{_ignoredOperations;_operationToId;constructor(_0x30cf81){this['_ignoredOperations']=_0x30cf81,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x55c622){let _0x3ae3db=_0x55c622['length'];for(;_0x3ae3db--;){const _0x1bdafb=_0x55c622[_0x3ae3db];if(!this['_ignoredOperations']['has'](_0x1bdafb)){if(!this['_operationToId']['has'](_0x1bdafb)){const _0x1b457a=_0x543842()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1bdafb,_0x1b457a);}return this['_operationToId']['get'](_0x1bdafb);}}}setIdForTheLastOperation(_0x2371c4,_0x5e9d1a){if(!_0x5e9d1a)return;let _0x5f380a=_0x2371c4['length'];for(;_0x5f380a--;){const _0x42f2be=_0x2371c4[_0x5f380a];this['_ignoredOperations']['has'](_0x42f2be)||this['_operationToId']['set'](_0x42f2be,_0x5e9d1a);}}},ct=class extends _0x323d44{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class extends _0x323d44{['_sources']=new Map();_data=null;_hasStarted=!0x1;static get requires(){return[K,J,_0x594ec5];}static get['pluginName'](){return'RealTimeContentFetcher';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_register(_0x5df6de,_0xa88385){if(this['_hasStarted'])throw new _0x72635a('realtimecontentfetcher-register-after-init',null,{'name':_0x5df6de});if(this['_sources']['has'](_0x5df6de))throw new _0x72635a('realtimecontentfetcher-register-duplicate',null,{'name':_0x5df6de});this['_sources']['set'](_0x5df6de,_0xa88385);}_takeInitialData(_0x599407){if(!this['_data'])throw new _0x72635a('realtimecontentfetcher-data-not-ready',null,{'name':_0x599407});if(!this['_data']['has'](_0x599407))throw new _0x72635a('realtimecontentfetcher-data-not-available',null,{'name':_0x599407});const _0x1613be=this['_data']['get'](_0x599407);return this['_data']['delete'](_0x599407),_0x1613be;}async init(){this['_hasStarted']=!0x0;const _0x594d45=Array['from'](this['_sources']),_0x36c060=await Promise['all'](_0x594d45['map'](([,_0x2a3dd4])=>_0x2a3dd4['fetch']()));await this['_fetchMissingUsers'](_0x594d45['map'](([,_0x35943d],_0x99b804)=>_0x35943d['getUserIds'](_0x36c060[_0x99b804]))),this['_data']=new Map(_0x594d45['map'](([_0x397050],_0x453837)=>[_0x397050,_0x36c060[_0x453837]]));}async _fetchMissingUsers(_0x457887){const _0x3ec64a=this['editor']['plugins']['get'](_0x594ec5),_0x19fc30=new Set();for(const _0x987c71 of _0x457887)for(const _0x580e14 of _0x987c71)_0x3ec64a['getUser'](_0x580e14)||_0x19fc30['add'](_0x580e14);if(0x0===_0x19fc30['size'])return;const {connection:_0x482d63}=this['editor']['plugins']['get'](K),_0x188dee=await _0x4c7d1e['getMany'](_0x482d63,Array['from'](_0x19fc30));for(const _0x5908a3 of _0x188dee)_0x3ec64a['getUser'](_0x5908a3['id'])||_0x3ec64a['addUser'](_0x5908a3);}};function ht(_0x346af4){const _0x35709e=new Set();for(const {resolvedBy:_0x132d02,comments:_0x3c0b43}of _0x346af4){_0x132d02&&_0x35709e['add'](_0x132d02);for(const {userId:_0x421f30}of _0x3c0b43)_0x35709e['add'](_0x421f30);}return _0x35709e;}var lt=class CloudServicesCommentsAdapter extends _0x2a424a{static CommentsService=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x4eed7c)());['_services'];_pendingServiceEvents=new Map();_channelsAwaitingInitialData=new Set();static get requires(){return[K,_0x583a94,J,_0x594ec5];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3329b9){super(_0x3329b9),this['_services']=new Map();}async init(){const _0x1a77bf=this['context'],_0x541ba7=_0x1a77bf['plugins']['get'](_0x583a94);if(_0x1a77bf['plugins']['get'](K)['addToReconnectionStack'](this),_0x541ba7['adapter']={'addCommentThread':async({channelId:_0x2e12a6,threadId:_0x24d308,comments:_0x11e7f4,resolvedAt:_0x52d92,resolvedBy:_0x43ae0d,context:_0x36a37c,attributes:_0x289433})=>{const _0x42db6b=await this['_getService'](_0x2e12a6)['addCommentThread']({'commentThreadId':_0x24d308,'comments':_0x11e7f4['map'](_0x570f37=>function(_0x4b3e47,_0x180a3b,_0x2d1601){return{'commentThreadId':_0x2d1601,'commentId':_0x4b3e47['commentId'],'userId':_0x4b3e47['authorId'],'content':_0x4b3e47['content'],'documentId':_0x180a3b,'createdAt':_0x4b3e47['createdAt'],'attributes':_0x4b3e47['attributes']||{}};}(_0x570f37,_0x2e12a6,_0x24d308)),'resolvedAt':_0x52d92,'resolvedBy':_0x43ae0d,'context':_0x36a37c,'attributes':_0x289433})['catch'](ut);return{'threadId':_0x42db6b['commentThreadId'],'comments':_0x42db6b['comments']};},'getCommentThread':async({channelId:_0x25d8d5,threadId:_0x46f99f})=>{const _0x5f3163=await this['_getService'](_0x25d8d5)['getCommentThread'](_0x46f99f)['catch'](dt)['catch'](ut);return _0x5f3163?_0x5f3163['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5f3163]),{'threadId':_0x5f3163['commentThreadId'],'comments':_0x5f3163['comments']['map'](ft),'context':_0x5f3163['context'],'resolvedAt':_0x5f3163['resolvedAt'],'resolvedBy':_0x5f3163['resolvedBy'],'attributes':_0x5f3163['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x55e776,threadId:_0x32ff26,context:_0x48a58f,unlinkedAt:_0x53824d,attributes:_0x5bf65d})=>this['_getService'](_0x55e776)['updateCommentThread']({'commentThreadId':_0x32ff26,'context':_0x48a58f,'attributes':_0x5bf65d,'unlinkedAt':_0x53824d})['catch'](dt)['catch'](ut),'resolveCommentThread':async({channelId:_0x61493f,threadId:_0x47f5db})=>{const _0x5d9259=await this['_getService'](_0x61493f)['resolveCommentThread'](_0x47f5db)['catch'](dt)['catch'](ut);return{'threadId':_0x5d9259['commentThreadId'],'resolvedAt':_0x5d9259['resolvedAt'],'resolvedBy':_0x5d9259['resolvedBy']};},'reopenCommentThread':async({channelId:_0x25b041,threadId:_0x4c9a45})=>this['_getService'](_0x25b041)['reopenCommentThread'](_0x4c9a45)['catch'](dt)['catch'](ut),'removeCommentThread':({channelId:_0x4617f5,threadId:_0x4bf698})=>this['_getService'](_0x4617f5)['removeCommentThread'](_0x4bf698)['catch'](dt)['catch'](ut),'addComment':({channelId:_0xadf8ae,threadId:_0x2f774a,commentId:_0x56589a,content:_0x2ed57f,attributes:_0x5b8aab})=>this['_getService'](_0xadf8ae)['addComment'](_0x2f774a,_0x56589a,_0x2ed57f,_0x5b8aab)['catch'](ut),'updateComment':({channelId:_0x53b004,threadId:_0x5173b3,commentId:_0xdff5f8,content:_0x5b9421,attributes:_0x441851})=>this['_getService'](_0x53b004)['updateComment'](_0x5173b3,_0xdff5f8,_0x5b9421,_0x441851)['catch'](dt)['catch'](ut),'removeComment':({channelId:_0x264850,threadId:_0x2d7d0c,commentId:_0x3cdd24})=>this['_getService'](_0x264850)['removeComment'](_0x2d7d0c,_0x3cdd24)['catch'](dt)['catch'](ut)},_0x1a77bf instanceof _0x5d909c){const _0x3b2d8a=_0x1a77bf['config']['get']('collaboration.channelId'),_0x5e6de7=_0x1a77bf['plugins']['get'](J);await this['_setUpService'](_0x3b2d8a);const _0x1ebb99=await this['_services']['get'](_0x3b2d8a)['getConnectedSessions']();this['listenTo'](_0x5e6de7,'sessionAdd:'+_0x3b2d8a,(_0x2d6724,{session:_0x1a0dcc})=>{_0x1a0dcc['id']===_0x5e6de7['mySessionId']&&(_0x2d6724['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1a0dcc['permissions'],_0x3b2d8a));}),_0x5e6de7['register'](_0x3b2d8a,_0x1ebb99);}}async _setUpService(_0x4f7d32){this['_createService'](_0x4f7d32),await this['_connectService'](_0x4f7d32);}_createService(_0x40134f){if(this['_services']['has'](_0x40134f))throw new _0x72635a('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x40134f});const _0x5842f5=this['context']['plugins']['get'](_0x583a94),_0x28bcdd=new CloudServicesCommentsAdapter['CommentsService'](_0x40134f);this['_services']['set'](_0x40134f,_0x28bcdd),this['listenTo'](_0x28bcdd,'commentThreadAdded',(_0xf2e80,_0x54456c)=>{const {commentThreadId:_0x1806b1,documentId:_0x4cac41,context:_0x15f735,attributes:_0xe3f8a8,resolvedAt:_0x1836ed,resolvedBy:_0x173e8f,comments:_0x15782c}=_0x54456c,_0x2fe12a=_0x15782c?_0x15782c['map'](({userId:_0x4ff7aa})=>_0x4ff7aa):[];_0x173e8f&&_0x2fe12a['push'](_0x173e8f),this['_handleOrQueueServiceEvent'](_0x40134f,_0x2fe12a,()=>{_0x5842f5['getCommentThread'](_0x1806b1)||_0x5842f5['addCommentThread']({'threadId':_0x1806b1,'channelId':_0x4cac41,'comments':_0x15782c?_0x15782c['map'](ft):[],'context':_0x15f735,'attributes':_0xe3f8a8,'resolvedAt':_0x1836ed,'resolvedBy':_0x173e8f,'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentThreadUpdated',(_0x5a9d06,{commentThreadId:_0x5d50d6,documentId:_0x489d07,context:_0x1567e6,unlinkedAt:_0x28ca66,attributes:_0x36c453})=>{this['_handleOrQueueServiceEvent'](_0x40134f,[],()=>{_0x5842f5['getCommentThread'](_0x5d50d6)&&_0x5842f5['updateCommentThread']({'threadId':_0x5d50d6,'channelId':_0x489d07,'context':_0x1567e6,'unlinkedAt':_0x28ca66,'attributes':_0x36c453,'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentThreadResolved',(_0x291aad,{commentThreadId:_0xee60a5,resolvedBy:_0x58aefd,resolvedAt:_0x5c6e67})=>{this['_handleOrQueueServiceEvent'](_0x40134f,[_0x58aefd],()=>{const _0x3b0adc=_0x5842f5['getCommentThread'](_0xee60a5);_0x3b0adc&&!_0x3b0adc['isResolved']&&_0x3b0adc['resolve']({'resolvedBy':_0x58aefd,'resolvedAt':_0x5c6e67,'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentThreadReopened',(_0x2aaf06,{commentThreadId:_0x33fb26})=>{this['_handleOrQueueServiceEvent'](_0x40134f,[],()=>{const _0x46c406=_0x5842f5['getCommentThread'](_0x33fb26);_0x46c406&&_0x46c406['isResolved']&&_0x46c406['reopen']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentThreadRemoved',(_0x32dfee,{commentThreadId:_0x37c6da})=>{this['_handleOrQueueServiceEvent'](_0x40134f,[],()=>{const _0x365ce4=_0x5842f5['getCommentThread'](_0x37c6da);_0x365ce4&&_0x365ce4['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentAdded',(_0x4525f3,_0x37e987)=>{this['_handleOrQueueServiceEvent'](_0x40134f,[_0x37e987['userId']],()=>{const _0x4421f9=_0x5842f5['getCommentThread'](_0x37e987['commentThreadId']);_0x4421f9&&!_0x4421f9['getComment'](_0x37e987['commentId'])&&_0x4421f9['addComment']({...ft(_0x37e987),'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentUpdated',(_0x47ca00,{commentThreadId:_0x121109,commentId:_0x1ca3f3,content:_0x351219,attributes:_0x46381a})=>{this['_handleOrQueueServiceEvent'](_0x40134f,[],()=>{const _0x1c8b54=_0x5842f5['getCommentThread'](_0x121109)?.['getComment'](_0x1ca3f3);_0x1c8b54&&_0x1c8b54['update']({'content':_0x351219,'attributes':_0x46381a,'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'commentRemoved',(_0x44def2,{commentThreadId:_0x38b8a4,commentId:_0x592ce6})=>{this['_handleOrQueueServiceEvent'](_0x40134f,[],()=>{const _0x2ffd8a=_0x5842f5['getCommentThread'](_0x38b8a4)?.['getComment'](_0x592ce6);_0x2ffd8a&&_0x2ffd8a['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x28bcdd,'disconnected',()=>{'connected'===this['context']['plugins']['get'](K)['connection']?.['state']&&(this['_services']['delete'](_0x40134f),this['_pendingServiceEvents']['delete'](_0x40134f),this['stopListening'](_0x28bcdd));});}destroy(){if(this['context']instanceof _0x5d909c){const _0x76b9aa=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x76b9aa)&&this['_terminateService'](_0x76b9aa);}}_terminateService(_0x4164d3){if(!this['_services']['has'](_0x4164d3))throw new _0x72635a('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4164d3});this['_getService'](_0x4164d3)['disconnect'](),this['_services']['delete'](_0x4164d3);}async reconnect(){for(const _0x9fb452 of this['_services']['keys']())await this['_connectService'](_0x9fb452);if(this['context']instanceof _0x5d909c){const _0x52f2fb=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x52f2fb)){const _0x51f1d5=this['context']['plugins']['get'](J);_0x51f1d5['unregister'](_0x52f2fb);const _0x1f0264=await this['_services']['get'](_0x52f2fb)['getConnectedSessions']();_0x51f1d5['register'](_0x52f2fb,_0x1f0264);}}}_fetchInitialChannelData(_0x10ff9b){return this['_channelsAwaitingInitialData']['add'](_0x10ff9b),this['_fetchChannelData'](_0x10ff9b);}async _applyInitialChannelData(_0x3ce235,_0x543fea){this['_channelsAwaitingInitialData']['delete'](_0x3ce235)&&await this['_applyChannelData'](_0x3ce235,_0x543fea);}async _fetchChannelData(_0xf09454){const {connection:_0x51d9e4}=this['context']['plugins']['get'](K);return this['_pendingServiceEvents']['set'](_0xf09454,[]),await this['_services']['get'](_0xf09454)['connect'](_0x51d9e4);}async _applyChannelData(_0x4a10cd,_0x3bce4e){const _0x2bc451=this['context']['plugins']['get'](_0x583a94),_0x4d0f45=new Set(Array['from'](_0x2bc451['getCommentThreads']({'channelId':_0x4a10cd}),_0x406430=>_0x406430['id']));for(const _0x4be189 of _0x3bce4e)_0x4be189['deletedAt']||_0x4d0f45['delete'](_0x4be189['commentThreadId']);for(const _0x4542aa of _0x4d0f45)_0x2bc451['getCommentThread'](_0x4542aa)['remove']({'isFromAdapter':!0x0});for(const _0x76f6a8 of _0x3bce4e){let _0x31f4bd=_0x2bc451['getCommentThread'](_0x76f6a8['commentThreadId']);const {commentThreadId:_0x4c3eb7,context:_0x31d133,attributes:_0x199c86,resolvedBy:_0x10425a,resolvedAt:_0x5ded16,unlinkedAt:_0x5a621c,deletedAt:_0x2db60b}=_0x76f6a8;if(_0x2db60b)continue;_0x31f4bd||(_0x31f4bd=_0x2bc451['addCommentThread']({'channelId':_0x4a10cd,'threadId':_0x4c3eb7,'context':_0x31d133,'attributes':_0x199c86||{},'resolvedBy':_0x10425a,'resolvedAt':_0x5ded16,'unlinkedAt':_0x5a621c,'isFromAdapter':!0x0}));const _0x3715ff=new Set(Array['from'](_0x31f4bd['comments'],_0x515c92=>_0x515c92['id']));for(const _0x5d49bc of _0x76f6a8['comments'])_0x3715ff['delete'](_0x5d49bc['commentId']);for(const _0x1dc751 of _0x3715ff)_0x31f4bd['getComment'](_0x1dc751)['remove']({'isFromAdapter':!0x0});for(const _0xdfbae9 of _0x76f6a8['comments']){const _0x10914c=_0x31f4bd['getComment'](_0xdfbae9['commentId']);_0x10914c?_0x10914c['content']!==_0xdfbae9['content']&&_0x10914c['update']({'content':_0xdfbae9['content'],'isFromAdapter':!0x0}):_0x31f4bd['addComment'](Object['assign'](ft(_0xdfbae9),{'isFromAdapter':!0x0}));}}await this['_applyPendingServiceEvents'](_0x4a10cd);}_handleOrQueueServiceEvent(_0x38bd1d,_0x3dc0ea,_0x250834){const _0x25a721=this['_pendingServiceEvents']['get'](_0x38bd1d);_0x25a721?_0x25a721['push']({'userIds':_0x3dc0ea,'apply':_0x250834}):_0x250834();}async _applyPendingServiceEvents(_0x45f0a0){const _0x548a36=this['_pendingServiceEvents']['get'](_0x45f0a0)||[];for(;_0x548a36['length'];){const _0x42a5ad=_0x548a36['splice'](0x0);await this['_fetchMissingUsers'](_0x42a5ad['flatMap'](({userIds:_0x3f2288})=>_0x3f2288));for(const {apply:_0x5764b6}of _0x42a5ad)_0x5764b6();}this['_discardPendingServiceEvents'](_0x45f0a0,_0x548a36);}_discardPendingServiceEvents(_0x21b09f,_0x232086){this['_pendingServiceEvents']['get'](_0x21b09f)===_0x232086&&this['_pendingServiceEvents']['delete'](_0x21b09f);}async _connectService(_0x30d9bb){const _0x1b0e9c=this['_channelsAwaitingInitialData']['delete'](_0x30d9bb),_0x3dc98a=this['_fetchChannelData'](_0x30d9bb),_0x396cf4=this['_pendingServiceEvents']['get'](_0x30d9bb);let _0xb19562=!0x1;try{const _0x24e091=await _0x3dc98a;_0xb19562=!0x0,await this['_fetchMissingUsersForThreads'](_0x24e091),await this['_applyChannelData'](_0x30d9bb,_0x24e091);}catch(_0x5e0e26){throw this['_discardPendingServiceEvents'](_0x30d9bb,_0x396cf4),_0x1b0e9c&&!_0xb19562&&this['_channelsAwaitingInitialData']['add'](_0x30d9bb),_0x5e0e26;}}_getService(_0x4ea6a7){if(!this['_services']['has'](_0x4ea6a7))throw new _0x72635a('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4ea6a7});return this['_services']['get'](_0x4ea6a7);}async _fetchMissingUsersForThreads(_0x314741){return this['_fetchMissingUsers'](ht(_0x314741));}async _fetchMissingUsers(_0x11df43){const _0xc33f5e=this['context']['plugins']['get'](_0x594ec5),{connection:_0x529c82}=this['context']['plugins']['get'](K),_0x151d98=Array['from'](new Set(_0x11df43))['filter'](_0x31cb46=>!_0xc33f5e['getUser'](_0x31cb46));if(0x0===_0x151d98['length'])return;const _0x303df6=await _0x4c7d1e['getMany'](_0x529c82,_0x151d98);for(const _0x127da3 of _0x303df6)_0xc33f5e['getUser'](_0x127da3['id'])||_0xc33f5e['addUser'](_0x127da3);}};async function dt(_0x375a58){if('404'!==_0x375a58['code'])throw _0x375a58;}function ut(_0x19f561){if((_0x1ebad6=_0x19f561)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1ebad6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1ebad6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1ebad6;throw _0x19f561;}function ft(_0x2aa478){return{'threadId':_0x2aa478['commentThreadId'],'commentId':_0x2aa478['commentId'],'content':_0x2aa478['content'],'createdAt':_0x2aa478['createdAt'],'authorId':_0x2aa478['userId'],'attributes':_0x2aa478['attributes']||{}};}var mt=class CloudServicesTrackChangesAdapter extends _0x323d44{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x58c0b7)());_bufferedRequests;_trackChangesService;['_isChannelFlushed']=!0x1;_pendingSuggestionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[lt,_0x30f396,K,at];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x396332){super(_0x396332);const _0x3b4e37=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x3b4e37),_0x396332['plugins']['get'](at)['_register']('trackChanges',{'fetch':()=>this['_fetchInitialSuggestions'](),'getUserIds':_0x131baa=>_0x131baa['map'](({authorId:_0x473415})=>_0x473415)});}init(){const _0x44b379=this['editor']['plugins']['get'](_0x30f396);_0x44b379['adapter']={'getSuggestion':async _0x9e4db1=>{await this['_waitForServiceReady']();const _0x58b7b8=await this['_trackChangesService']['get'](_0x9e4db1)['catch'](pt);return await this['_fetchMissingUsersForThreads']([_0x58b7b8]),_0x58b7b8;},'addSuggestion':async({id:_0xc5b6dd,type:_0x5b925b,data:_0x51182d,originalSuggestionId:_0x4607d0,attributes:_0x2b4966})=>{await this['_waitForServiceReady']();const _0x49264c={'id':_0xc5b6dd,'type':_0x5b925b,'data':_0x51182d,'originalSuggestionId':_0x4607d0,'attributes':_0x2b4966},_0x1244e6=await this['_trackChangesService']['add'](_0xc5b6dd,_0x5b925b,_0x51182d,_0x4607d0,_0x2b4966)['catch'](_0x473373=>{if(gt(_0x473373))return new Promise(_0x3d7155=>{this['_bufferedRequests']['set'](_0xc5b6dd,{'resolve':_0x3d7155,'suggestionData':_0x49264c});});throw _0x473373;});return this['_bufferedRequests']['delete'](_0xc5b6dd),_0x1244e6;},'updateSuggestion':async(_0x33144d,_0x40e77c)=>{if(await this['_waitForServiceReady'](),'open'!==_0x40e77c['state'])return this['_trackChangesService']['update'](_0x33144d,_0x40e77c)['catch'](pt);}};const _0x21b20f=this['editor']['plugins']['get'](at)['_takeInitialData']('trackChanges');for(const _0x372ac3 of _0x21b20f){_0x44b379['addSuggestionData'](_0x372ac3)['_saved']=!0x0;}for(const {id:_0x23a56b,attributes:_0x4e4afd}of this['_pendingSuggestionsUpdates'])this['_handleSuggestionUpdate'](_0x23a56b,_0x4e4afd);this['_pendingSuggestionsUpdates']=null,this['_setReadyForReconnect']();}async _fetchInitialSuggestions(){const _0x296049=this['editor']['plugins']['get'](K);this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2a68d6,{id:_0x208ecf,attributes:_0x397e4c})=>{this['_pendingSuggestionsUpdates']?this['_pendingSuggestionsUpdates']['push']({'id':_0x208ecf,'attributes':_0x397e4c}):this['_handleSuggestionUpdate'](_0x208ecf,_0x397e4c);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x296049['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x296049['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));});const _0x17bc05=await this['_trackChangesService']['connect'](_0x296049['connection']);return this['_isChannelFlushed']||_0x296049['addToReconnectionStack'](this),_0x17bc05;}_handleSuggestionUpdate(_0x4fe748,_0x2b6201){const _0x469cb4=this['editor']['plugins']['get'](_0x30f396);_0x469cb4['hasSuggestion'](_0x4fe748)&&(_0x469cb4['getSuggestion'](_0x4fe748)['attributes']=_0x2b6201);}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x45af01=>console['error'](_0x45af01)));}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x118732=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1f6cf1}=this['editor']['plugins']['get'](K),_0x2fdae7=await this['_trackChangesService']['connect'](_0x1f6cf1);await this['_fetchMissingUsersForThreads'](_0x2fdae7);for(const {suggestionData:_0x28d9dd,resolve:_0x506d56}of this['_bufferedRequests']['values']()){let _0x2c4542=_0x2fdae7['find'](_0x592abc=>_0x592abc['id']===_0x28d9dd['id']);_0x2c4542||(_0x2c4542=await this['_trackChangesService']['add'](_0x28d9dd['id'],_0x28d9dd['type'],_0x28d9dd['data'],_0x28d9dd['originalSuggestionId'])),_0x506d56(_0x2c4542);}for(const _0x30e640 of _0x2fdae7)_0x118732['hasSuggestion'](_0x30e640['id'])||_0x118732['addSuggestionData'](_0x30e640);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x4afd83=>{this['listenTo'](this['_trackChangesService'],'connected',_0x295184=>{_0x295184['off'](),_0x4afd83();});});}async _fetchMissingUsersForThreads(_0x107d07){const _0x189c20=this['editor']['plugins']['get'](_0x594ec5),{connection:_0x15bb15}=this['editor']['plugins']['get'](K),_0x4fe76e=new Set();for(const {authorId:_0x381d88}of _0x107d07)_0x189c20['getUser'](_0x381d88)||_0x4fe76e['add'](_0x381d88);if(0x0===_0x4fe76e['size'])return;const _0x15d9e3=await _0x4c7d1e['getMany'](_0x15bb15,Array['from'](_0x4fe76e));for(const _0x450bef of _0x15d9e3)_0x189c20['getUser'](_0x450bef['id'])||_0x189c20['addUser'](_0x450bef);}};function pt(_0x32b217){if(gt(_0x32b217))return new Promise(()=>{});throw _0x32b217;}function gt(_0x4a9b75){return _0x4a9b75['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4a9b75['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var wt=class extends _0x323d44{static get requires(){return[_0x43ef0d,lt,ct,K,at];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x363cbd){super(_0x363cbd);const _0x138cdf=_0x363cbd['plugins']['get'](lt),_0x286fe8=_0x363cbd['config']['get']('collaboration.channelId');_0x363cbd['plugins']['get'](at)['_register']('comments',{'fetch':()=>(_0x138cdf['_createService'](_0x286fe8),_0x138cdf['_fetchInitialChannelData'](_0x286fe8)),'getUserIds':ht});}init(){const _0x15953a=this['editor']['plugins']['get'](K),_0x3229fa=this['editor']['plugins']['get'](_0x5e816a),_0x3f9af3=this['editor']['plugins']['get'](lt);this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x15953a,'change:state',(_0x5c21c9,_0x2b32f6,_0x336f6b)=>{_0x3229fa['isThreadsLoadingPaused']='connected'!==_0x336f6b;});}),this['listenTo'](_0x15953a,'change:state',(_0x33b392,_0x1d8dfa,_0x4230a1)=>{this['editor']['plugins']['get'](_0x583a94)['switchReadOnly']('connected'!==_0x4230a1);});const _0x56e0e9=this['editor']['config']['get']('collaboration.channelId'),_0x26d649=this['editor']['plugins']['get'](at)['_takeInitialData']('comments');return _0x3f9af3['_applyInitialChannelData'](_0x56e0e9,_0x26d649);}destroy(){const _0x491b9a=this['editor']['plugins']['get'](lt),_0x4b3e7d=this['editor']['config']['get']('collaboration.channelId');_0x491b9a['_services']['has'](_0x4b3e7d)&&_0x491b9a['_terminateService'](_0x4b3e7d),super['destroy']();}},vt=class extends _0x323d44{static get requires(){return[wt,mt,_0x3f6f2f];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},_t=class CloudServicesRevisionHistoryAdapter extends _0x323d44{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x57fc4b)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;['_isChannelFlushed']=!0x1;_newestRevisionPrefetch=null;_pendingRevisionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[K,it,_0x324b7a,J,_0x594ec5,at];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12cbdb){super(_0x12cbdb);const _0x2ecd55=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x2ecd55),this['set']('_isServiceConnected',!0x1),_0x12cbdb['plugins']['get'](at)['_register']('revisionHistory',{'fetch':()=>this['_fetchInitialData'](),'getUserIds':({revisions:_0x521b68})=>_0x521b68['flatMap'](({authorsIds:_0x2456a3,creatorId:_0x3a828b})=>_0x3a828b?[..._0x2456a3,_0x3a828b]:_0x2456a3)});}async init(){const _0x19bb17=this['editor']['plugins']['get'](it),{hasEditorBundle:_0x6adcc5,revisions:_0x538979}=this['editor']['plugins']['get'](at)['_takeInitialData']('revisionHistory');this['listenTo'](this['editor']['data'],'ready',()=>{this['_setReadyForReconnect'](),this['_newestRevisionPrefetch']=null;}),this['editor']['plugins']['get'](_0x324b7a)['adapter']={'getRevision':async({revisionId:_0x1e5c14})=>{const _0x50cc89=this['_newestRevisionPrefetch'];return _0x50cc89&&_0x50cc89['revisionId']===_0x1e5c14?(this['_newestRevisionPrefetch']=null,_0x50cc89['promise']):(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1e5c14));},'updateRevisions':async _0xbcf8df=>{await this['_waitForServiceReady']();const _0x2b41ce=this['_revisionTracker']['currentRevision'];if(_0x6adcc5&&0x1===_0xbcf8df['length']&&_0xbcf8df[0x0]['id']===_0x2b41ce['id'])return _0xbcf8df;for(const _0x325b94 of _0xbcf8df)_0x325b94['id']===_0x2b41ce['id']&&(_0x325b94['isEmptyCurrent']=_0x325b94['fromVersion']===_0x325b94['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xbcf8df,this['_lastRequestId'])['then'](_0x573266=>(this['_lastRequestId']=_0x573266,_0xbcf8df))['catch'](_0xc24b42=>{if(yt(_0xc24b42)||'400'===_0xc24b42['code']&&void 0x0!==_0xc24b42['data']['wrongRequestId']){for(const _0x3d8383 of _0xbcf8df)this['_revisionTracker']['repository']['getRevision'](_0x3d8383['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x3d8383['id'],_0x3d8383,!0x1);if(yt(_0xc24b42)&&'destroyed'!==this['editor']['state'])throw _0xc24b42;return _0xbcf8df;}throw _0xc24b42;});}};for(const _0x584e5d of _0x538979)this['_revisionTracker']['addRevisionData'](_0x584e5d);this['listenTo'](_0x19bb17,'change:_isConnected',(_0x4fa296,_0x1df905,_0x213df2)=>{_0x213df2&&(this['_oldOffset']=_0x19bb17['_offset'],_0x4fa296['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected'),await this['_applyPendingRevisionsUpdates']();}async _fetchInitialData(){const _0x4807e9=this['editor']['plugins']['get'](it),_0x5a8587=this['editor']['plugins']['get'](K),_0x13c456=_0x4807e9['serverHistory'];this['_revisionTracker']['setSource']({'history':_0x13c456,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4807e9['sessionId']}),this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x409681,{revisionsData:_0x1e5a9e,requestId:_0x5513da})=>{_0x1e5a9e['some'](({id:_0x5c7f4b})=>_0x5c7f4b===this['_newestRevisionPrefetch']?.['revisionId'])&&(this['_newestRevisionPrefetch']=null),Math['max'](..._0x1e5a9e['map'](_0x327195=>_0x327195['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleOrQueueRevisionsUpdate'](_0x1e5a9e,_0x5513da);}):this['_handleOrQueueRevisionsUpdate'](_0x1e5a9e,_0x5513da);}),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x5a8587['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x5a8587['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const _0x59e04d=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x52c089,[_0x59925f,_0x5613a1]=await Promise['all']([_0x59814e['isBundleUploaded'](_0x5a8587['connection'],_0x59e04d),this['_revisionHistoryService']['connect'](_0x5a8587['connection'])['then'](_0x3a5b71=>(this['_lastRequestId']=_0x3a5b71['requestId'],this['_isChannelFlushed']||_0x5a8587['addToReconnectionStack'](this),this['_prefetchNewestRevision'](_0x3a5b71['revisions']),_0x3a5b71['revisions']))]);return{'hasEditorBundle':_0x59925f,'revisions':_0x5613a1};}_handleOrQueueRevisionsUpdate(_0x38e611,_0x5a3a65){this['_pendingRevisionsUpdates']?this['_pendingRevisionsUpdates']['push']({'revisionsData':_0x38e611,'requestId':_0x5a3a65}):this['_handleRevisionsUpdate'](_0x38e611,_0x5a3a65);}async _applyPendingRevisionsUpdates(){for(;this['_pendingRevisionsUpdates']['length'];){const _0xd19901=this['_pendingRevisionsUpdates']['splice'](0x0);await this['_fetchMissingUsers'](_0xd19901['flatMap'](({revisionsData:_0x49dbfa})=>_0x49dbfa));for(const {revisionsData:_0x2f0c75,requestId:_0x502896}of _0xd19901)this['_handleRevisionsUpdate'](_0x2f0c75,_0x502896);}this['_pendingRevisionsUpdates']=null;}_prefetchNewestRevision(_0x11f3cd){const _0xcc7715=_0x11f3cd['reduce']((_0x3fd345,_0x1a2493)=>_0x3fd345?(_0x1a2493['toVersion']-_0x3fd345['toVersion']||_0x1a2493['fromVersion']-_0x3fd345['fromVersion'])>0x0?_0x1a2493:_0x3fd345:_0x1a2493,null);if(!_0xcc7715||_0xcc7715['diffData'])return;const _0x3ec8b3=this['_revisionHistoryService']['getRevision'](_0xcc7715['id']);_0x3ec8b3['catch'](()=>{}),this['_newestRevisionPrefetch']={'revisionId':_0xcc7715['id'],'promise':_0x3ec8b3};}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x35894c=this['editor']['plugins']['get'](K),_0x17699f=this['editor']['plugins']['get'](it),_0x57bba6=async()=>{const _0x2a625c=this['_revisionTracker']['currentRevision'],_0x2eaaa6=_0x2a625c['id'],_0x4b8b9f=_0x2eaaa6!==_0x17699f['sessionId'];if(_0x4b8b9f){const _0x530c6f=_0x17699f['_offset']-this['_oldOffset'],_0x43c533=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x2a625c['toVersion']+_0x530c6f!==_0x43c533){const _0x3d3edf=_0x2a625c['fromVersion']+_0x530c6f,_0x288205=this['editor']['plugins']['get'](_0x594ec5),_0x141d86=this['_revisionTracker']['buildRevisionData']({'revision':_0x2a625c,'from':_0x3d3edf,'to':_0x43c533});_0x141d86['id']=_0x2a625c['id'];const _0x5ca6a3=_0x141d86['authorsIds']['map'](_0x21280e=>_0x288205['getUser'](_0x21280e));_0x2a625c['_update']({..._0x141d86,'authors':_0x5ca6a3},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2a625c['id'],_0x141d86,!0x0);}this['_revisionTracker']['_startingVersion']=_0x43c533,_0x2a625c['toVersion']!==_0x2a625c['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x2eaaa6)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x2eaaa6),this['_revisionTracker']['_createCurrentRevision'](_0x43c533);}const {revisions:_0x124419,requestId:_0x361ddd}=await this['_revisionHistoryService']['reconnect'](_0x35894c['connection'],this['_lastRequestId']);_0x4b8b9f&&_0x124419['length']>0x0?_0x17699f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x124419),this['_handleRevisionsUpdate'](_0x124419,_0x361ddd),this['_revisionTracker']['sendBufferedUpdates']());};return _0x17699f['_isConnected']?_0x57bba6():new Promise((_0x19b22b,_0x3bbf81)=>{_0x17699f['once']('change:_isConnected',()=>{_0x57bba6()['then'](_0x19b22b)['catch'](_0x3bbf81);});});}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x378f74=>console['error'](_0x378f74)));}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x35a6d1=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x180446=>{_0x180446['off'](),_0x35a6d1();});});}_getLatestVersionFromServerOperations(){const _0xe2fa2d=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x417871 of _0xe2fa2d)if('marker'!==_0x417871['type']||_0x417871['affectsData'])return _0x417871['baseVersion']+0x1;}_getLatestVersion(){const _0x41061d=this['editor']['plugins']['get'](it);return new Promise(_0x38748f=>{_0x41061d['_isPendingUpdate']?_0x41061d['once']('change:_isPendingUpdate',()=>{_0x38748f(this['_getLatestVersionFromServerOperations']());}):_0x38748f(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x252a7d,_0x5a50da){const _0x24b8ca=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5a50da;for(const _0x1934b1 of _0x252a7d){const _0x1486cf=_0x24b8ca['getRevision'](_0x1934b1['id']);if(_0x1486cf){if((_0x1934b1['fromVersion']||_0x1934b1['toVersion'])&&(_0x1934b1['diffData']=null),_0x1486cf===this['_revisionTracker']['currentRevision']){const _0x46d221=Math['max'](_0x1486cf['toVersion'],_0x1934b1['toVersion']),_0xd1485a=Math['max'](_0x1486cf['fromVersion'],_0x1934b1['fromVersion']);let _0x5ef0d6;_0x1486cf['toVersion']===_0x1934b1['toVersion']&&_0x1486cf['fromVersion']===_0x1934b1['fromVersion']?(_0x5ef0d6=!0x0,this['_preventResendingRevisionData'](_0x1934b1)):_0x1934b1['toVersion']===_0x46d221&&_0x1934b1['fromVersion']===_0xd1485a?_0x5ef0d6=!0x1:(_0x1486cf['toVersion']===_0x46d221&&_0x1486cf['fromVersion']===_0xd1485a||this['_fixRevision']({'revision':_0x1486cf,'from':_0xd1485a,'to':_0x46d221}),_0x5ef0d6=!0x0),_0x5ef0d6&&(delete _0x1934b1['fromVersion'],delete _0x1934b1['toVersion'],delete _0x1934b1['diffData'],delete _0x1934b1['createdAt'],delete _0x1934b1['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1934b1),this['_preventResendingRevisionData'](_0x1934b1);}else this['_revisionTracker']['addRevisionData'](_0x1934b1);}const _0x5ee7f4=_0x24b8ca['getRevisions']();_0x5ee7f4['reverse']();for(let _0x44f9b1=0x0;_0x44f9b1<_0x5ee7f4['length']-0x1;_0x44f9b1++){const _0x18ad08=_0x5ee7f4[_0x44f9b1],_0x369b6b=_0x5ee7f4[_0x44f9b1+0x1];if(_0x18ad08['fromVersion']<_0x369b6b['toVersion']){const _0x2f432c=_0x369b6b['toVersion'],_0x5ae545=Math['max'](_0x2f432c,_0x18ad08['toVersion']);this['_fixRevision']({'revision':_0x18ad08,'from':_0x2f432c,'to':_0x5ae545});}}}['_fixRevision']({revision:_0x51b2d6,from:_0x34dc24,to:_0x577ec9}={}){const _0x24c14d=this['editor']['plugins']['get'](_0x594ec5),_0x471dab=this['_revisionTracker']['buildRevisionData']({'revision':_0x51b2d6,'from':_0x34dc24,'to':_0x577ec9});_0x471dab['authors']=_0x471dab['authorsIds']['map'](_0x45365f=>_0x24c14d['getUser'](_0x45365f)),_0x51b2d6['_update'](_0x471dab);}_preventResendingRevisionData(_0x5bc855){const _0x2285c6={};_0x2285c6['id']=_0x5bc855['id'];for(const _0x307cc9 of Object['keys'](_0x5bc855))'id'!==_0x307cc9&&(_0x2285c6[_0x307cc9]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2285c6['id'],_0x2285c6,!0x0);}async _fetchMissingUsers(_0x579bae){const _0x513eef=this['editor']['plugins']['get'](_0x594ec5),{connection:_0x3ef476}=this['editor']['plugins']['get'](K),_0x58bc60=new Set();for(const _0x1a8bcb of _0x579bae){for(const _0x4c079a of _0x1a8bcb['authorsIds']||[])_0xecba4b(_0x4c079a);_0x1a8bcb['creatorId']&&_0xecba4b(_0x1a8bcb['creatorId']);}if(0x0===_0x58bc60['size'])return;const _0x263668=await _0x4c7d1e['getMany'](_0x3ef476,Array['from'](_0x58bc60));for(const _0x3f8b13 of _0x263668)_0x513eef['getUser'](_0x3f8b13['id'])||_0x513eef['addUser'](_0x3f8b13);function _0xecba4b(_0x357ac6){_0x513eef['getUser'](_0x357ac6)||_0x58bc60['add'](_0x357ac6);}}};function yt(_0x1b7da8){return _0x1b7da8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1b7da8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1b7da8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var bt=class extends _0x323d44{static get requires(){return[_0x324b7a,_t,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},kt=class extends _0x1cf434{_collapseAt;constructor(_0x2b5a89,_0x4f31c1=0x6){super(_0x2b5a89);const _0x125e5e=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4f31c1,this['bind']('isHidden')['to'](this,'usersCount',_0x286618=>_0x286618<_0x4f31c1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x125e5e['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':_0x125e5e['to']('usersCount',_0xc3e82e=>'+'+(_0xc3e82e-this['_collapseAt']+0x2)['toString']())}]}]}]});}},It=class extends _0x1cf434{items;keystrokes;constructor(_0x5365c3){super(_0x5365c3);const _0x202bf9=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x3967e9(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x202bf9['if']('hasPopup'),'aria-expanded':_0x202bf9['to']('isExpanded',_0x3859d1=>this['hasPopup']&&String(_0x3859d1)),'aria-label':_0x202bf9['to']('hasPopup',_0xdb66f3=>et(_0x5365c3,_0xdb66f3?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x202bf9['to']('hasPopup',_0xe70c2a=>!!_0xe70c2a&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0x51468d,_0x17e30d,_0x204143)=>{this['element']&&(_0x204143?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']);}},St=class extends _0x1cf434{counterView;inlineListView;constructor(_0x3d9f6d,_0x57b4c1=0x6){super(_0x3d9f6d);const _0x36b2ed=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new kt(this['locale'],_0x57b4c1),this['inlineListView']=new It(_0x3d9f6d),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x450d21 of this['inlineListView']['items'])_0x450d21['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',_0x36b2ed['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},Ct=class extends _0x1cf434{listWrapperView;constructor(_0x47eaad,_0x3e0dd0){super(_0x47eaad),this['listWrapperView']=new Tt(_0x47eaad,_0x3e0dd0),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x47eaad,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},Tt=class extends _0x22761e{constructor(_0x14dee0,_0x4036ec){super(_0x14dee0);const _0x1287e5=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4036ec?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1287e5['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1287e5['to']('role'),'aria-label':_0x1287e5['to']('ariaLabel'),'aria-labelledby':_0x1287e5['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x31a7fc['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x2bb359=this['element'];_0x2bb359&&(this['_isScrollable']=Math['max'](_0x2bb359['scrollHeight'],_0x2bb359['clientHeight'])>0.8*window['innerHeight']);}},At=class extends _0x700f3a{['userView'];constructor(_0x5b401e,_0x28216a,_0x58df40){super(_0x5b401e);const _0x5b4870=this['bindTemplate'];this['userView']=new _0x5c2918(_0x5b401e,_0x28216a);const _0x489073={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x28216a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x28216a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x28216a['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x28216a['color']['getColorVariable'](),'--ck-user-color-alpha':_0x28216a['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x58df40&&(_0x489073['tag']='button',_0x489073['on']={'click':_0x5b4870['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x489073);}['focus'](){this['element']['focus']();}},Pt=class extends _0x1cf434{['userView'];['markerView'];constructor(_0x57e1b8,_0x1accfc,_0x2fbea8){super(_0x57e1b8);const _0x275c12=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x5c2918(_0x57e1b8,_0x1accfc),this['markerView']=new Rt(_0x57e1b8,_0x1accfc);const _0x124e75=new _0x52aefb(_0x57e1b8);_0x124e75['template']['tag']='span',_0x124e75['text']=_0x1accfc['name'];const _0x5deb72={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x275c12['to']('isFocusable',_0x32fa2c=>_0x32fa2c?0x0:-0x1),'aria-labelledby':_0x124e75['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x275c12['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x275c12['to']('hasTooltip',_0x214ca2=>!_0x214ca2),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x124e75]};_0x2fbea8&&(_0x5deb72['tag']='button',_0x5deb72['on']={'click':_0x275c12['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5deb72);}},Rt=class extends _0x1cf434{constructor(_0x9bf80a,_0xd15d9a){super(_0x9bf80a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xd15d9a['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0xd15d9a['color']['getColorVariable'](),'--ck-user-color-alpha':_0xd15d9a['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Ot={'collapseAt':0x6,'displayMe':!0x0};var xt=class extends _0x2a424a{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e769d){super(_0x1e769d),this['context']['config']['define']('presenceList',Ot);const _0x38b224=_0x1e769d['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x38b224)throw new _0x72635a('presencelist-collapseat-invalid-format',this);if(_0x38b224<0x1)throw new _0x72635a('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](J)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x24fe62(),this['balloonPanelView']=new _0x2a8ccc(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[J];}init(){for(const _0x59dd0d of this['_allConnectedUsers'])this['_handleUserAdd'](_0x59dd0d);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1758b8,_0x214449)=>{this['_handleUserAdd'](_0x214449);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x49e2c2,_0x4f7a35)=>{this['_handleUserRemove'](_0x4f7a35);});}_createView(){const _0x53902a=this['context'],_0x2b830f=new St(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4f9f27=this['balloonPanelView'];if(!_0x302ca0(_0x53902a['config']['get']('presenceList.container')))throw new _0x72635a('presencelist-missing-container',this);_0x2b830f['counterView']['bind']('usersCount')['to'](this),_0x2b830f['bind']('isCollapsed')['to'](this,'usersCount',_0x58b58b=>{const {collapseAt:_0x74f43d}=_0x53902a['config']['get']('presenceList'),_0x291a6e=_0x58b58b>=_0x74f43d;if(_0x291a6e&&!_0x2b830f['inlineListView']['items']['find'](_0x3bbbf0=>_0x3bbbf0 instanceof kt)){const _0xc67434=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xc67434&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x2b830f['inlineListView']['items']['add'](_0x2b830f['counterView']);}return _0x291a6e||this['hideDropdown'](),_0x291a6e;}),_0x2b830f['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x552cd6=>{const _0x322cd0=_0x53902a['config']['get']('presenceList'),_0x48e9f7=new Pt(_0x53902a['locale'],_0x552cd6,!!_0x322cd0['onClick']);return _0x48e9f7['bind']('hasTooltip')['to'](_0x2b830f,'isCollapsed',_0x59cf04=>!_0x59cf04),_0x48e9f7['bind']('isFocusable')['to'](_0x2b830f,'isCollapsed',_0xbc6df1=>!_0xbc6df1),_0x322cd0['onClick']&&this['listenTo'](_0x48e9f7,'execute',()=>{this['view']['isCollapsed']||_0x322cd0['onClick'](_0x552cd6,_0x48e9f7['element']);}),_0x48e9f7;}),_0x2b830f['inlineListView']['keystrokes']['set']('Enter',(_0x3e63c9,_0x14fbcd)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x14fbcd());}),_0x2b830f['render'](),_0x4f9f27['render'](),_0x2b830f['listenTo'](_0x2b830f['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x1f0553=(_0x3bce19,_0x28e087)=>{this['_hideDropdownUnlessPointerInside'](_0x28e087);};return _0x2b830f['listenTo'](_0x2b830f['inlineListView']['element'],'mouseleave',_0x1f0553),_0x2b830f['listenTo'](_0x4f9f27['element'],'mouseleave',_0x1f0553),_0x23b991({'emitter':_0x2b830f,'activator':()=>_0x4f9f27['isVisible'],'contextElements':[_0x4f9f27['element'],_0x2b830f['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x53902a['config']['get']('presenceList.container')['appendChild'](_0x2b830f['element']),this['_overlayHost']=new _0x5947b1(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x2b830f;}_resolveOverlayTarget(){const _0x580528=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x580528)return _0x580528;const _0x58d560=this['context']['config']['get']('presenceList.container');return _0x58d560?_0x279c1c(_0x58d560):null;}['_handleUserAdd'](_0x3523e3){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3523e3['isMe'])return;const _0x4c94bd=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x4c94bd-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x110f45=_0x3523e3['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3523e3,_0x110f45);}['_handleUserRemove'](_0x5ec7eb){this['usersCount']--;const {collapseAt:_0x109533}=this['context']['config']['get']('presenceList'),_0x2378df=this['usersCount']>=_0x109533;if(this['currentDisplayedUsers']['get'](_0x5ec7eb['id']))this['currentDisplayedUsers']['remove'](_0x5ec7eb['id']);else{if(_0x2378df&&this['currentDisplayedUsers']['length']+0x1===_0x109533-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x2378df?0x1:0x0)<this['usersCount']){for(const _0x3c182f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x3c182f['id'])&&(this['currentDisplayedUsers']['add'](_0x3c182f,Math['min'](this['currentDisplayedUsers']['length']-(_0x2378df?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x2378df?0x1:0x0)===_0x109533-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x49cf3d=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Ct(this['context']['locale'],!!_0x49cf3d['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x20cc90}=this['presenceDropdownView'];_0x20cc90['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4b8532=>{if(!_0x49cf3d['displayMe']&&_0x4b8532['isMe'])return null;const _0x25b784=new At(this['context']['locale'],_0x4b8532,!!_0x49cf3d['onClick']);return _0x49cf3d['onClick']&&this['listenTo'](_0x25b784,'execute',()=>{_0x49cf3d['onClick'](_0x4b8532,_0x25b784['element']);}),_0x25b784;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0x1e5632=_0x2a8ccc['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0x1e5632['southArrowNorth'],_0x1e5632['southArrowNorthMiddleWest'],_0x1e5632['southArrowNorthMiddleEast'],_0x1e5632['southArrowNorthWest'],_0x1e5632['southArrowNorthEast'],_0x1e5632['northArrowSouth'],_0x1e5632['northArrowSouthMiddleWest'],_0x1e5632['northArrowSouthMiddleEast'],_0x1e5632['northArrowSouthWest'],_0x1e5632['northArrowSouthEast'],_0x1e5632['viewportStickyNorth']]}),_0x20cc90['focus'](),_0x20cc90['checkIfScrollable']();const _0x591b7a=(_0x18131e,_0x223113)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x223113();};_0x20cc90['keystrokes']['set']('Esc',_0x591b7a),_0x20cc90['keystrokes']['set']('Shift+Tab',_0x591b7a),_0x20cc90['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x20cc90['focusTracker']['add'](this['view']['element']),_0x20cc90['focusTracker']['on']('change:isFocused',(_0x1ef4d1,_0x506fe7,_0x32ed03)=>{_0x32ed03||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);}_hideDropdownUnlessPointerInside(_0xf1edf5){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x2de6bf=>_0x331861(_0x2de6bf,_0xf1edf5))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},Nt=class extends _0x2a424a{static get requires(){return[J,xt];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{lt as CloudServicesCommentsAdapter,_t as CloudServicesRevisionHistoryAdapter,mt as CloudServicesTrackChangesAdapter,Nt as PresenceList,xt as PresenceListUI,it as RealTimeCollaborationClient,wt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,bt as RealTimeCollaborativeRevisionHistory,vt as RealTimeCollaborativeTrackChanges,at as RealTimeContentFetcher,J as Sessions,K as WebSocketGateway};