@ckeditor/ckeditor5-real-time-collaboration 48.3.0-alpha.7 → 48.3.0-alpha.8

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 (148) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/translations/af.js +1 -1
  3. package/dist/translations/af.umd.js +1 -1
  4. package/dist/translations/ar.js +1 -1
  5. package/dist/translations/ar.umd.js +1 -1
  6. package/dist/translations/ast.js +1 -1
  7. package/dist/translations/ast.umd.js +1 -1
  8. package/dist/translations/az.js +1 -1
  9. package/dist/translations/az.umd.js +1 -1
  10. package/dist/translations/be.js +1 -1
  11. package/dist/translations/be.umd.js +1 -1
  12. package/dist/translations/bg.js +1 -1
  13. package/dist/translations/bg.umd.js +1 -1
  14. package/dist/translations/bn.js +1 -1
  15. package/dist/translations/bn.umd.js +1 -1
  16. package/dist/translations/bs.js +1 -1
  17. package/dist/translations/bs.umd.js +1 -1
  18. package/dist/translations/ca.js +1 -1
  19. package/dist/translations/ca.umd.js +1 -1
  20. package/dist/translations/cs.js +1 -1
  21. package/dist/translations/cs.umd.js +1 -1
  22. package/dist/translations/da.js +1 -1
  23. package/dist/translations/da.umd.js +1 -1
  24. package/dist/translations/de-ch.js +1 -1
  25. package/dist/translations/de-ch.umd.js +1 -1
  26. package/dist/translations/de.js +1 -1
  27. package/dist/translations/de.umd.js +1 -1
  28. package/dist/translations/el.js +1 -1
  29. package/dist/translations/el.umd.js +1 -1
  30. package/dist/translations/en-au.js +1 -1
  31. package/dist/translations/en-au.umd.js +1 -1
  32. package/dist/translations/en-gb.js +1 -1
  33. package/dist/translations/en-gb.umd.js +1 -1
  34. package/dist/translations/en.js +1 -1
  35. package/dist/translations/en.umd.js +1 -1
  36. package/dist/translations/eo.js +1 -1
  37. package/dist/translations/eo.umd.js +1 -1
  38. package/dist/translations/es-co.js +1 -1
  39. package/dist/translations/es-co.umd.js +1 -1
  40. package/dist/translations/es.js +1 -1
  41. package/dist/translations/es.umd.js +1 -1
  42. package/dist/translations/et.js +1 -1
  43. package/dist/translations/et.umd.js +1 -1
  44. package/dist/translations/eu.js +1 -1
  45. package/dist/translations/eu.umd.js +1 -1
  46. package/dist/translations/fa.js +1 -1
  47. package/dist/translations/fa.umd.js +1 -1
  48. package/dist/translations/fi.js +1 -1
  49. package/dist/translations/fi.umd.js +1 -1
  50. package/dist/translations/fr.js +1 -1
  51. package/dist/translations/fr.umd.js +1 -1
  52. package/dist/translations/gl.js +1 -1
  53. package/dist/translations/gl.umd.js +1 -1
  54. package/dist/translations/gu.js +1 -1
  55. package/dist/translations/gu.umd.js +1 -1
  56. package/dist/translations/he.js +1 -1
  57. package/dist/translations/he.umd.js +1 -1
  58. package/dist/translations/hi.js +1 -1
  59. package/dist/translations/hi.umd.js +1 -1
  60. package/dist/translations/hr.js +1 -1
  61. package/dist/translations/hr.umd.js +1 -1
  62. package/dist/translations/hu.js +1 -1
  63. package/dist/translations/hu.umd.js +1 -1
  64. package/dist/translations/hy.js +1 -1
  65. package/dist/translations/hy.umd.js +1 -1
  66. package/dist/translations/id.js +1 -1
  67. package/dist/translations/id.umd.js +1 -1
  68. package/dist/translations/it.js +1 -1
  69. package/dist/translations/it.umd.js +1 -1
  70. package/dist/translations/ja.js +1 -1
  71. package/dist/translations/ja.umd.js +1 -1
  72. package/dist/translations/jv.js +1 -1
  73. package/dist/translations/jv.umd.js +1 -1
  74. package/dist/translations/kk.js +1 -1
  75. package/dist/translations/kk.umd.js +1 -1
  76. package/dist/translations/km.js +1 -1
  77. package/dist/translations/km.umd.js +1 -1
  78. package/dist/translations/kn.js +1 -1
  79. package/dist/translations/kn.umd.js +1 -1
  80. package/dist/translations/ko.js +1 -1
  81. package/dist/translations/ko.umd.js +1 -1
  82. package/dist/translations/ku.js +1 -1
  83. package/dist/translations/ku.umd.js +1 -1
  84. package/dist/translations/lt.js +1 -1
  85. package/dist/translations/lt.umd.js +1 -1
  86. package/dist/translations/lv.js +1 -1
  87. package/dist/translations/lv.umd.js +1 -1
  88. package/dist/translations/ms.js +1 -1
  89. package/dist/translations/ms.umd.js +1 -1
  90. package/dist/translations/nb.js +1 -1
  91. package/dist/translations/nb.umd.js +1 -1
  92. package/dist/translations/ne.js +1 -1
  93. package/dist/translations/ne.umd.js +1 -1
  94. package/dist/translations/nl.js +1 -1
  95. package/dist/translations/nl.umd.js +1 -1
  96. package/dist/translations/no.js +1 -1
  97. package/dist/translations/no.umd.js +1 -1
  98. package/dist/translations/oc.js +1 -1
  99. package/dist/translations/oc.umd.js +1 -1
  100. package/dist/translations/pl.js +1 -1
  101. package/dist/translations/pl.umd.js +1 -1
  102. package/dist/translations/pt-br.js +1 -1
  103. package/dist/translations/pt-br.umd.js +1 -1
  104. package/dist/translations/pt.js +1 -1
  105. package/dist/translations/pt.umd.js +1 -1
  106. package/dist/translations/ro.js +1 -1
  107. package/dist/translations/ro.umd.js +1 -1
  108. package/dist/translations/ru.js +1 -1
  109. package/dist/translations/ru.umd.js +1 -1
  110. package/dist/translations/si.js +1 -1
  111. package/dist/translations/si.umd.js +1 -1
  112. package/dist/translations/sk.js +1 -1
  113. package/dist/translations/sk.umd.js +1 -1
  114. package/dist/translations/sl.js +1 -1
  115. package/dist/translations/sl.umd.js +1 -1
  116. package/dist/translations/sq.js +1 -1
  117. package/dist/translations/sq.umd.js +1 -1
  118. package/dist/translations/sr-latn.js +1 -1
  119. package/dist/translations/sr-latn.umd.js +1 -1
  120. package/dist/translations/sr.js +1 -1
  121. package/dist/translations/sr.umd.js +1 -1
  122. package/dist/translations/sv.js +1 -1
  123. package/dist/translations/sv.umd.js +1 -1
  124. package/dist/translations/th.js +1 -1
  125. package/dist/translations/th.umd.js +1 -1
  126. package/dist/translations/ti.js +1 -1
  127. package/dist/translations/ti.umd.js +1 -1
  128. package/dist/translations/tk.js +1 -1
  129. package/dist/translations/tk.umd.js +1 -1
  130. package/dist/translations/tr.js +1 -1
  131. package/dist/translations/tr.umd.js +1 -1
  132. package/dist/translations/tt.js +1 -1
  133. package/dist/translations/tt.umd.js +1 -1
  134. package/dist/translations/ug.js +1 -1
  135. package/dist/translations/ug.umd.js +1 -1
  136. package/dist/translations/uk.js +1 -1
  137. package/dist/translations/uk.umd.js +1 -1
  138. package/dist/translations/ur.js +1 -1
  139. package/dist/translations/ur.umd.js +1 -1
  140. package/dist/translations/uz.js +1 -1
  141. package/dist/translations/uz.umd.js +1 -1
  142. package/dist/translations/vi.js +1 -1
  143. package/dist/translations/vi.umd.js +1 -1
  144. package/dist/translations/zh-cn.js +1 -1
  145. package/dist/translations/zh-cn.umd.js +1 -1
  146. package/dist/translations/zh.js +1 -1
  147. package/dist/translations/zh.umd.js +1 -1
  148. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Context as _0x403fa9,ContextPlugin as _0x748e16,PendingActions as _0x459316,Plugin as _0xba3866}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3f1dcf,Collection as _0x271755,DomEmitterMixin as _0x57ba7a,KeystrokeHandler as _0x5a77f1,global as _0x3c55b7,uid as _0x5920c8,version as _0x13d0cc}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x14124b,BodyCollection as _0x47ad2b,LabelView as _0x1a8e59,ListItemView as _0x1b5251,ListView as _0x5dc78c,Notification as _0x211bfd,View as _0x48e552,clickOutsideHandler as _0x2c9d92}from'@ckeditor/ckeditor5-ui';import{History as _0x53181b,InsertOperation as _0x583136,MarkerOperation as _0x47ba36,ModelLiveRange as _0x4f59fe,NoOperation as _0xdf2d5c,OperationFactory as _0x56b57a,RootAttributeOperation as _0x1f58d5,transformOperationSets as _0x20990c}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0xb6ab9f}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x221ac5,CommentsService as _0x29a0a9,EditorService as _0x451a45,RevisionHistoryService as _0x145221,TrackChangesService as _0x52f9bc,User as _0x4a06bf,WEB_SOCKET_GATEWAY_STATES as _0x2ba2b3,WebSocketGateway as _0x2dfe16}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x10a99c,Users as _0x14b59c}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x2a74e1}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x32388c,TrackChangesEditing as _0x2053c1}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x2de072,CommentsEditing as _0x34f96c,CommentsRepository as _0x509c50}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x5a9f69}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x19e585}from'es-toolkit/compat';var z=class WebSocketGateway extends _0x748e16{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>_0x2dfe16)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return[_0xb6ab9f,_0x211bfd];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xdb0f0d){super(_0xdb0f0d),this['set']('state',_0x2ba2b3['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x57ba7a())();}['init'](){const _0x4ef527=this['context'],_0x1f000a=_0x4ef527['plugins']['get'](_0xb6ab9f),_0x3f9df8=_0x4ef527['plugins']['get'](_0x211bfd);if(!_0x1f000a['token'])throw new _0x3f1dcf('websocketgateway-missing-token',this);if(!_0x1f000a['webSocketUrl'])throw new _0x3f1dcf('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'](_0x1f000a['token'],_0x1f000a['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x25317e=>{if(this['connection']=_0x25317e,this['bind']('state')['to'](_0x25317e,'state',this,'_isBrowserOffline',(_0x131bbb,_0x309896)=>('connected'!==_0x131bbb&&(this['_shouldPluginsReconnect']=!0x0),_0x309896||_0x131bbb!==_0x2ba2b3['CONNECTED']?_0x2ba2b3['DISCONNECTED']:this['state']==_0x2ba2b3['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x2ba2b3['CONNECTING']):_0x2ba2b3['CONNECTED'])),this['connection']['on']('error',(_0x51c4d1,_0x15eae5)=>{if('limitExceeded'!==_0x15eae5['code'])throw console['error'](_0x15eae5),new _0x3f1dcf('cloudservices-init',null,{'originalError':_0x15eae5});_0x3f9df8['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'});}),!_0x25317e['me'])return new Promise(_0x202dcf=>_0x25317e['on']('change:me',_0x202dcf));})['catch'](_0xb57fce=>{throw console['error'](_0xb57fce),new _0x3f1dcf('cloudservices-init',null,{'originalError':_0xb57fce});});}['addToReconnectionStack'](_0x44ab6c){if('function'!=typeof _0x44ab6c['reconnect'])throw new _0x3f1dcf('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x44ab6c))throw new _0x3f1dcf('websocketgateway-plugin-already-registered',this,{'name':_0x44ab6c['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x44ab6c);}['removeFromReconnectionStack'](_0x113526){this['_reconnectionStack']['delete'](_0x113526);}['isInReconnectionStack'](_0x3435c3){return this['_reconnectionStack']['has'](_0x3435c3);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x59b903=>_0x59b903['reconnect']())))['then'](()=>this['state']=_0x2ba2b3['CONNECTED'])['catch'](_0x56115a=>{throw console['error'](_0x56115a),new _0x3f1dcf('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x2ba2b3['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}},Y=class extends _0x748e16{['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[z,_0x14b59c];}constructor(_0x566d1f){super(_0x566d1f),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x271755(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x14b59c);}['init'](){const _0x49f177=this['context']['plugins']['get'](z);this['listenTo'](_0x49f177,'change:state',(_0x26b0f9,_0x140476,_0x2aedfa)=>{if('connected'!==_0x2aedfa)this['channelSessions']['forEach'](_0x2091bd=>_0x2091bd['clear']()),this['channelConnectedUsers']['forEach'](_0x5221f5=>_0x5221f5['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x11f1cb,_0x552a13]of this['_registeredSessions'])for(const _0x340ef0 of _0x552a13)this['_handleSessionAdd'](_0x11f1cb,_0x340ef0);}}),this['_createUser'](_0x49f177['connection']['me'],!0x0);}['register'](_0x447a62,_0x4bb800){if(this['_registeredSessions']['has'](_0x447a62))throw new _0x3f1dcf('sessions-register-already-registered',null,{'channelId':_0x447a62});this['_registeredSessions']['set'](_0x447a62,_0x4bb800),this['channelSessions']['set'](_0x447a62,new _0x271755()),this['channelConnectedUsers']['set'](_0x447a62,new _0x271755()),this['listenTo'](_0x4bb800,'add',(_0x5f5af3,_0x19f655)=>this['_handleSessionAdd'](_0x447a62,_0x19f655)),this['listenTo'](_0x4bb800,'remove',(_0x3c4d4f,_0x47959b)=>this['_handleSessionRemove'](_0x447a62,_0x47959b));for(const _0x165186 of _0x4bb800)this['_handleSessionAdd'](_0x447a62,_0x165186);}['unregister'](_0x59cb1d){if(!this['_registeredSessions']['has'](_0x59cb1d))throw new _0x3f1dcf('sessions-unregister-not-exist',null,{'channelId':_0x59cb1d});const _0x343997=this['_registeredSessions']['get'](_0x59cb1d);this['stopListening'](_0x343997);for(const _0x36c5af of _0x343997)'connected'===this['context']['plugins']['get'](z)['state']&&this['_handleSessionRemove'](_0x59cb1d,_0x36c5af);this['_registeredSessions']['delete'](_0x59cb1d),this['channelSessions']['delete'](_0x59cb1d),this['channelConnectedUsers']['delete'](_0x59cb1d);}get['mySessionId'](){return this['context']['plugins']['get'](z)['connection']['sessionId'];}['getUserBySessionId'](_0x110dfb){for(const _0x2a82dd of this['channelSessions']['values']())for(const _0x1f1828 of _0x2a82dd)if(_0x1f1828['id']===_0x110dfb)return _0x1f1828['user'];}['getUserSessions'](_0x46cad1,_0x39ab31){const _0x4292ba=_0x39ab31?[this['channelSessions']['get'](_0x39ab31)]:this['channelSessions']['values'](),_0x194fc5=new Set();for(const _0xa35611 of _0x4292ba)for(const _0xc7c3aa of _0xa35611)_0xc7c3aa['user']['id']===_0x46cad1['id']&&_0x194fc5['add'](_0xc7c3aa['id']);return _0x194fc5;}['getUserRole'](_0x830609){for(const _0x4c4b4b of this['channelSessions']['values']())for(const _0x12f23b of _0x4c4b4b)if(_0x12f23b['user']===_0x830609)return _0x12f23b['role'];}['_handleSessionAdd'](_0x3de142,_0x3464f9){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x3b88b6=_0x3464f9['user'],_0x16433e=this['_users']['getUser'](_0x3b88b6['id'])||this['_createUser'](_0x3b88b6),_0x51014c=Object['assign']({},_0x3464f9,{'user':_0x16433e});if(this['channelSessions']['get'](_0x3de142)['add'](_0x51014c),!_0x3b88b6['hiddenInPresenceList']){const _0x198c85=this['channelConnectedUsers']['get'](_0x3de142);_0x198c85['has'](_0x16433e['id'])||_0x198c85['add'](_0x16433e),this['allConnectedUsers']['has'](_0x16433e['id'])||_0x3b88b6['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x16433e,_0x16433e['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x3de142,{'channelId':_0x3de142,'session':_0x51014c});}['_handleSessionRemove'](_0x56ae9e,_0x13386e){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x16553e=this['channelConnectedUsers']['get'](_0x56ae9e),_0x597058=_0x13386e['user'];_0x597058['id']&&(this['channelSessions']['get'](_0x56ae9e)['remove'](_0x13386e['id']),_0x16553e['has'](_0x597058['id'])&&!this['getUserSessions'](_0x597058,_0x56ae9e)['size']&&_0x16553e['remove'](_0x597058['id']),this['allConnectedUsers']['get'](_0x597058['id'])&&!this['getUserSessions'](_0x597058)['size']&&this['allConnectedUsers']['remove'](_0x597058['id']));}['_createUser'](_0x2b0bff,_0x14d5a5){const _0xfbb730=this['_users']['addUser'](_0x2b0bff);return _0x14d5a5&&this['_users']['defineMe'](_0x2b0bff['id']),_0xfbb730['orderNumber']=this['_uniqueUsersCount']++,_0xfbb730;}},K=class extends _0xba3866{['_domEmitter']=new(_0x57ba7a())();static get['requires'](){return[Y];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x11176b=this['editor'],_0x21661e=_0x11176b['plugins']['get'](Y);_0x11176b['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3523f2,{writer:_0x569048})=>function(_0x4d5a61,_0x5a1c82,_0x5af390,_0x509f6f){const _0x4dde0d=_0x4d5a61['markerName']['split'](':')[0x2],_0x2313e4=_0x5af390['getUserBySessionId'](_0x4dde0d);if(!_0x2313e4||_0x4dde0d===_0x5af390['mySessionId'])return;if(!_0x509f6f['model']['schema']['checkChild'](_0x4d5a61['markerRange']['start'],'$text'))return;const _0x42520d={'class':'ck-user__marker\x20'+_0x2313e4['color']['getMarkerClass'](),'style':Q(_0x2313e4),'data-name':_0x2313e4['name'],'data-session-id':_0x4dde0d},_0x50c6df=_0x509f6f['model']['markers']['get'](_0x4d5a61['markerName'])['getStart'](),_0x13fdd5=_0x50c6df['nodeAfter'],_0x45add8=_0x509f6f['model']['schema'];if(_0x13fdd5&&_0x45add8['isObject'](_0x13fdd5)&&_0x45add8['isInline'](_0x13fdd5)&&!_0x509f6f['model']['markers']['get']('user:range:'+_0x4dde0d)['getRange']()['isCollapsed'])return;const _0x1a12bd=_0x50c6df['parent'];return _0x509f6f['model']['schema']['isLimit'](_0x1a12bd)&&!_0x509f6f['model']['hasContent'](_0x1a12bd)&&(_0x42520d['contenteditable']=!0x1),function(_0x2d51f0,_0xca55da,_0x37b357){const _0x4cca1e=_0x2d51f0['createUIElement']('span',_0xca55da);return _0x2d51f0['setCustomProperty']('userPositionMarker',!0x0,_0x4cca1e),_0x4cca1e['render']=function(_0x5cf9a5){const _0x49617a=this['toDomElement'](_0x5cf9a5),_0x13986c=document['createElement']('span');return _0x13986c['classList']['add']('ck-user__marker-tooltip'),_0x13986c['setAttribute']('contenteditable','false'),_0x13986c['setAttribute']('spellcheck','false'),_0x13986c['textContent']=_0x37b357['name'],_0x49617a['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x13986c['outerHTML']+'⁠',_0x49617a['addEventListener']('mouseenter',()=>{_0x49617a['classList']['add']('ck-user__marker_hovered');}),_0x49617a['addEventListener']('mouseleave',()=>{_0x49617a['classList']['remove']('ck-user__marker_hovered');}),_0x49617a;},_0x4cca1e['isSimilar']=function(_0x4c69a8){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4c69a8['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4c69a8['getAttribute']('data-session-id'));},_0x4cca1e;}(_0x5a1c82,_0x42520d,_0x2313e4);}(_0x3523f2,_0x569048,_0x21661e,_0x11176b)}),_0x11176b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x72152f=>function(_0x2ed3a2,_0x5e7402){const _0x4904d1=_0x2ed3a2['markerName']['split'](':')[0x2];if(_0x4904d1===_0x5e7402['mySessionId'])return null;const _0xf37422=_0x5e7402['getUserBySessionId'](_0x4904d1);return _0xf37422?{'id':_0x4904d1,'classes':['ck-user__selection',_0xf37422['color']['getSelectionClass']()],'attributes':{'style':Q(_0xf37422),'data-session-id':_0x4904d1},'priority':0x7d0+_0xf37422['orderNumber']}:{'id':_0x4904d1,'classes':[]};}(_0x72152f,_0x21661e)}),function(_0xb05daa){const _0x4ac8e8=_0xb05daa['model'],_0x5b2114=new Map(),_0x6a15c9=_0xb05daa['plugins']['get'](Y);_0x4ac8e8['markers']['on']('update:user:range',(_0xc44db8,_0x11876d,_0x410b0f,_0x3a0559)=>{if(!_0x3a0559&&_0x5b2114['get'](_0x11876d['name']))return _0x5b2114['get'](_0x11876d['name'])['detach'](),void _0x5b2114['delete'](_0x11876d['name']);const _0x514bec=_0x11876d['name']['split'](':')[0x2];if(_0x514bec===_0x6a15c9['mySessionId'])return;const _0x20f235='user:position:'+_0x514bec;_0x4ac8e8['markers']['has'](_0x20f235)&&_0xb05daa['editing']['reconvertMarker'](_0x20f235),_0x11876d['on']('change:range',(_0x5e0a39,_0x1f5028,_0x4e0292)=>{if('$graveyard'!=_0x1f5028['root']['rootName']&&'$graveyard'==_0x11876d['getRange']()['root']['rootName']&&!_0x5b2114['has'](_0x11876d['name'])){const _0x119ba7=_0x4ac8e8['schema']['getNearestSelectionRange'](_0x4e0292['deletionPosition']);if(_0x119ba7){const _0xa2ad22=_0x4f59fe['fromRange'](_0x119ba7);_0x5b2114['set'](_0x11876d['name'],_0xa2ad22),_0xa2ad22['on']('change:range',(_0x42361d,_0x34e7c3,_0x57d859)=>{if('$graveyard'==_0xa2ad22['root']['rootName']){const _0x2fa38b=_0x4ac8e8['schema']['getNearestSelectionRange'](_0x57d859['deletionPosition']);_0x2fa38b?(_0xa2ad22['start']=_0x2fa38b['start'],_0xa2ad22['end']=_0x2fa38b['end']):(_0x5b2114['delete'](_0x11876d['name']),_0xa2ad22['detach']());}});}}});}),_0x4ac8e8['document']['on']('change',()=>{_0x5b2114['size']>0x0&&_0x4ac8e8['enqueueChange']({'isUndoable':!0x1},_0x5473bb=>{for(const [_0x5636c3,_0x5f1303]of _0x5b2114)'$graveyard'==_0x4ac8e8['markers']['get'](_0x5636c3)['getRange']()['root']['rootName']&&(J(_0x5636c3['split'](':')[0x2],_0x5f1303['toRange'](),_0x4ac8e8,_0x5473bb),_0x5f1303['detach']());_0x5b2114['clear']();});});}(_0x11176b),this['_domEmitter']['listenTo'](_0x3c55b7['document'],'keydown',(_0x9e9c43,{key:_0x397599})=>{'Escape'===_0x397599&&function(_0x28fad3){_0x28fad3['editing']['view']['change'](_0x479eac=>{for(const _0x17ebab of _0x28fad3['model']['markers']){if(!_0x17ebab['name']['startsWith']('user:position'))continue;const _0x5dcfa0=_0x28fad3['editing']['mapper']['markerNameToElements'](_0x17ebab['name']);if(_0x5dcfa0){for(const _0x10c121 of _0x5dcfa0)_0x479eac['removeClass']('ck-user__marker_hovered',_0x10c121);}}});}(_0x11176b);},{'useCapture':!0x0});}['afterInit'](){const _0x13f0a0=this['editor'],_0x4e0765=_0x13f0a0['commands']['get']('undo');_0x4e0765&&_0x13f0a0['model']['on']('applyOperation',(_0x327bf8,_0x5a0cf9)=>{const _0x4ef288=_0x5a0cf9[0x0];if(!_0x4ef288['isDocumentOperation'])return;if('marker'!=_0x4ef288['type']||!_0x4ef288['name']['startsWith']('user:'))return;const _0x527cac=_0x4ef288['batch'];_0x4e0765['_createdBatches']['has'](_0x527cac)&&(_0x4ef288['newRange']=_0x4ef288['oldRange']?_0x13f0a0['model']['createRange'](_0x4ef288['oldRange']['start'],_0x4ef288['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x19140a=this['editor'],_0x54bea4=_0x19140a['model']['document'],_0x503e02=_0x19140a['plugins']['get'](Y);_0x19140a['model']['enqueueChange']({'isUndoable':!0x1},_0xb28743=>{const _0x2e24f5='user:range:'+_0x503e02['mySessionId'],_0x1a7b5a='user:position:'+_0x503e02['mySessionId'],_0x495670=_0x19140a['model']['markers']['has'](_0x2e24f5);_0x19140a['editing']['view']['hasDomSelection']?J(_0x503e02['mySessionId'],_0x54bea4['selection']['getFirstRange'](),_0x19140a['model'],_0xb28743):_0x495670&&(_0xb28743['removeMarker'](_0x2e24f5),_0xb28743['removeMarker'](_0x1a7b5a));});}};function J(_0x405971,_0x32999a,_0x38b46e,_0x580069){const _0xccf4b5='user:range:'+_0x405971,_0x400cbc='user:position:'+_0x405971,_0x2eb70b=_0x32999a['getContainedElement']();let _0x252acc=_0x32999a['start'];if(_0x2eb70b&&_0x2eb70b['is']('element','tableCell')){const _0x38c47f=function(_0x397faa,_0x5a9f87){for(const _0x55aa70 of _0x397faa['getPositions']())if(_0x5a9f87['schema']['checkChild'](_0x55aa70,'$text'))return _0x55aa70;}(_0x32999a,_0x38b46e);_0x38c47f&&(_0x252acc=_0x38c47f,_0x32999a=_0x580069['createRange'](_0x252acc));}const _0x2820ba=_0x580069['createRange'](_0x252acc);_0x38b46e['markers']['has'](_0xccf4b5)?(_0x580069['updateMarker'](_0xccf4b5,{'range':_0x32999a}),_0x580069['updateMarker'](_0x400cbc,{'range':_0x2820ba})):(_0x580069['addMarker'](_0xccf4b5,{'range':_0x32999a,'usingOperation':!0x0}),_0x580069['addMarker'](_0x400cbc,{'range':_0x2820ba,'usingOperation':!0x0}));}function Q(_0x17dc38){return'--ck-user-color:'+_0x17dc38['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x17dc38['color']['getColorAlphaVariable']()+';';}function X(_0x35504e,_0x5bc7b8,_0x6644c1){const _0x294ab5=_0x35504e['t'],t=_0x35504e['t'];switch(_0x5bc7b8){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 _0x294ab5({'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'},_0x6644c1);default:return'';}}let Z=0x1;var tt=class RealTimeCollaborationClient extends _0xba3866{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x221ac5)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[z,Y,K,_0x459316,_0x14b59c,_0x211bfd];}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 _0x337092=this['serverHistory']['getOperations']();for(let _0x421624=_0x337092['length']-0x1;_0x421624>=0x0;_0x421624--){const _0x1b9df5=_0x337092[_0x421624];if(!this['_disconnectionOperations']['has'](_0x1b9df5))return _0x1b9df5['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1f6f5e){if(super(_0x1f6f5e),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x53181b(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3f1dcf('collaboration-missing-channelid',this);const _0x3e5190=_0x1f6f5e['config']['get']('cloudServices.bundleVersion')||_0x13d0cc;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x3e5190,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2a74e1(),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 it(this['_disconnectionOperations']);}['init'](){const _0x3b8800=this['editor'],_0x171a9e=_0x3b8800['plugins']['get'](_0x14b59c),_0x48fefd=_0x3b8800['plugins']['get'](z);this['listenTo'](_0x171a9e,'getOperationAuthor',(_0x1b16e0,_0xdcdc00)=>{const _0x5e95ca=_0xdcdc00[0x0];_0x5e95ca['_authorId']&&(_0x1b16e0['return']=_0x171a9e['getUser'](_0x5e95ca['_authorId']),_0x1b16e0['stop']()),null===_0x5e95ca['_authorId']&&(_0x1b16e0['return']=null,_0x1b16e0['stop']());},{'priority':'high'}),this['listenTo'](_0x3b8800['model']['document']['selection'],'change:range',(_0x56b3b7,_0x29503e)=>{_0x29503e['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3b8800['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3b8800['model']['on']('applyOperation',(_0x232082,_0x37b2c0)=>{const _0x247bea=_0x37b2c0[0x0];_0x247bea['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x247bea),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x48fefd,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x45133f,_0xa65a3c,_0x5ed702)=>'connected'===_0x45133f&&!_0xa65a3c&&!_0x5ed702),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3b8800['disableReadOnlyMode']('rtc-offline'):_0x3b8800['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3b8800['disableReadOnlyMode']('rtc-offline'):_0x3b8800['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x25ec32=this['editor']['plugins']['get'](Y),_0x6bf8b=this['editor']['plugins']['get'](z);try{this['_isPendingUpdate']=!0x0,_0x25ec32['unregister'](this['_channelId']);const _0x292a3c=await this['_service']['reconnect'](_0x6bf8b['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x292a3c)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1f323e=await this['_service']['getConnectedSessions']();_0x25ec32['register'](this['_channelId'],_0x1f323e),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4b4926){if(function(_0x20e7e7){return'404'===_0x20e7e7['code'];}(_0x4b4926)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0xc01c06){return'409'===_0xc01c06['code'];}(_0x4b4926)){const _0x54f244=X(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'](_0x54f244);}else{if(!(_0x4b4926 instanceof et))throw _0x4b4926;this['_handleReconnectionError']();}}}}['destroy'](){const _0x33850a=this['editor']['plugins']['get'](z),_0x495159=this['editor']['plugins']['get'](Y);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x495159['channelSessions']['has'](this['_channelId'])&&_0x495159['unregister'](this['_channelId']),_0x33850a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x23594f){if(this['sessionId']!==_0x23594f['sessionId']&&this['_lastSyncedOperationId']!==_0x23594f['lastOperationId'])throw new et();return this['sessionId']=_0x23594f['sessionId'],this['_handleServerResponse']([],{..._0x23594f,'wereChangesApplied':!0x1,'data':_0x23594f['data']},'reconnect');}async['_connectService'](_0x35fd64,_0x2a2f9b=!0x1){const {connection:_0x2b0c52}=this['editor']['plugins']['get'](z);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x2b0c52,this['_channelId'])['then'](_0x2fb09f=>this['_initSessionsHandling'](_0x2fb09f))['catch'](_0x36d4d7=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x36d4d7);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x2b2992,_0x58c65b)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x58c65b);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x34accd=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x35fd64);this['_isPendingUpdate']=!0x0;const _0x431fbf=await this['_service']['connect'](_0x2b0c52,this['_compressOperations'](_0x35fd64),_0x34accd);if(this['sessionId']=_0x431fbf['sessionId'],_0x2a2f9b){if(!_0x431fbf['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x431fbf['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x35fd64,_0x431fbf,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x431fbf,_0x35fd64);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2ed613=this['editor']['plugins']['get'](Y),_0x449b7f=this['editor']['plugins']['get'](K),_0x581c27=_0x2ed613['channelSessions']['get'](this['_channelId']);_0x581c27&&_0x581c27['length']>0x1?_0x449b7f['createUserMarkerOperations']():this['listenTo'](_0x2ed613,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2ed613['channelSessions']['get'](this['_channelId'])['length']&&_0x449b7f['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x12e31b,_0x1ba4cd,_0x5416b9,_0x1202d8){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1ba4cd){const _0x5c98d0=this['_decompressOperations'](_0x5416b9,_0x1202d8);await this['_fetchMissingUsers'](_0x5c98d0),this['_handleExternalOperations'](_0x5c98d0,_0x1ba4cd,_0x5416b9['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x745783}=this['editor'];let _0xa46834;try{_0xa46834=await this['_service']['getDocumentDetails']();}catch{const _0x6b90ca=X(_0x745783,'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'](_0x6b90ca);}const _0x10d9eb=_0xa46834['currentDocumentSession']||_0xa46834['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x10d9eb['lastOperationId']){const _0x5e4d93=X(_0x745783,'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'](_0x5e4d93);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_handleChannelDisconnected'](){const _0x3c2dc9=this['editor']['plugins']['get'](z);if(this['_isConnected']=!0x1,!_0x3c2dc9['connection']||'connected'!==_0x3c2dc9['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x58a819=this['editor']['plugins']['get'](Y);_0x58a819['channelSessions']['has'](this['_channelId'])&&_0x58a819['unregister'](this['_channelId']),_0x3c2dc9['removeFromReconnectionStack'](this),this['_disconnectService']();}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x25b5c5){const _0x2fb853=this['editor']['plugins']['get'](Y);this['listenTo'](_0x2fb853,'sessionAdd:'+this['_channelId'],(_0x57f6af,{session:_0x303f94})=>{if(_0x303f94['id']===_0x2fb853['mySessionId']){_0x57f6af['off']();const _0x3eceb0=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x500ad9=_0x303f94['permissions'];_0x3eceb0&&_0x3eceb0['isEnabled']&&(_0x500ad9=_0x500ad9['filter'](_0x220bb7=>'document:write'!==_0x220bb7)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x500ad9,this['_channelId']);}}),_0x2fb853['register'](this['_channelId'],_0x25b5c5);}['_initThrowingOnDataSet'](){const _0x312f58=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5bd71d)=>{if(!_0x5bd71d[_0x5bd71d['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3f1dcf('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x312f58['apply'](this['editor']['data'],_0x5bd71d);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2d215b,[_0x5c43f2])=>{if(this['_document']['version'])throw new _0x3f1dcf('realtimecollaborationclient-init-document-already-initialized',this);_0x2d215b['stop'](),this['_setPendingAction']();const _0x131532=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x3e2665])=>!_0x3e2665['lazyLoad'])['map'](([_0x193dfc,_0x29d255])=>[_0x193dfc,_0x29d255['modelAttributes']||{}])),_0x3d9520=this['_getOperationsFromInitData'](_0x5c43f2,_0x131532);0x0==_0x3d9520['length']&&_0x3d9520['push'](new _0xdf2d5c(0x0)),_0x2d215b['return']=this['_connectService'](_0x3d9520)['then'](()=>{this['editor']['plugins']['get'](z)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2e76b9=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2e76b9))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x26b5b8,[_0x40211c,_0x35a673])=>{_0x26b5b8['stop']();const _0x13a680=this['editor']['model']['document']['getRoot'](_0x40211c);if(!this['_knownRootNames']['has'](_0x40211c)){const _0x27b643=_0x35a673&&_0x35a673['data']?_0x35a673['data']:'',_0x2cd396=_0x35a673&&_0x35a673['attributes']?_0x35a673['attributes']:{};await this['_loadRoot'](_0x40211c,_0x27b643,_0x2cd396);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x13a680['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x13a680);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x446065){const _0x17d180=this['editor']['plugins']['get'](_0x14b59c),{connection:_0x1cff43}=this['editor']['plugins']['get'](z),_0x299afd=new Set();for(const _0x40fca1 of _0x446065){const _0x1bdad3=_0x40fca1['_authorId'];_0x1bdad3&&!_0x17d180['getUser'](_0x1bdad3)&&_0x299afd['add'](_0x1bdad3);}if(0x0===_0x299afd['size'])return;const _0x10a2fc=await _0x4a06bf['getMany'](_0x1cff43,Array['from'](_0x299afd));for(const _0x5ccc64 of _0x10a2fc)_0x17d180['getUser'](_0x5ccc64['id'])||_0x17d180['addUser'](_0x5ccc64);}['_getOperationsFromInitData'](_0x28b108,_0x4867f4={}){const _0x3be3cc=this['editor']['model'],_0x3b914b=[];let _0x49dfff=0x0;const _0x2f687a='string'==typeof _0x28b108?{'main':_0x28b108}:_0x28b108;for(const _0x30351c of Object['keys'](_0x2f687a)){if(!this['_document']['roots']['has'](_0x30351c))throw new _0x3f1dcf('realtimecollaborationclient-init-non-existent-root',this);const _0x5ce60f=this['_document']['getRoot'](_0x30351c),_0x207714=this['editor']['data']['parse'](_0x2f687a[_0x30351c],_0x5ce60f),_0x248257=new _0x583136(_0x3be3cc['createPositionAt'](_0x5ce60f,0x0),_0x207714,_0x49dfff++);_0x3b914b['push'](_0x248257);for(const [_0x1a7591,_0xeaf457]of _0x207714['markers']){const _0x567d54=new _0x47ba36(_0x1a7591,null,_0x3be3cc['createRange'](_0x3be3cc['createPositionFromPath'](_0x5ce60f,_0xeaf457['start']['path']['slice']()),_0x3be3cc['createPositionFromPath'](_0x5ce60f,_0xeaf457['end']['path']['slice']())),_0x3be3cc['markers'],!0x0,_0x49dfff++);_0x3b914b['push'](_0x567d54);}}if(_0x4867f4)for(const [_0x4233ac,_0x3a7fa7]of Object['entries'](_0x4867f4)){const _0x4faa75=_0x3be3cc['document']['getRoot'](_0x4233ac);if(!_0x4faa75)throw new _0x3f1dcf('multi-root-editor-root-attributes-no-root',null);for(const [_0x320451,_0x4495d0]of Object['entries'](_0x3a7fa7))if(null!==_0x4495d0){const _0x45361c=new _0x1f58d5(_0x4faa75,_0x320451,null,_0x4495d0,_0x49dfff++);_0x3b914b['push'](_0x45361c);}}return _0x3b914b;}async['_loadRoot'](_0x2de611,_0x4c5a01,_0xf160c4){this['_getOperationsFromInitData']({[_0x2de611]:_0x4c5a01},{[_0x2de611]:_0xf160c4})['forEach']((_0x5e3739,_0x177e81)=>{_0x5e3739['baseVersion']=this['_document']['version']+_0x177e81,_0x5e3739['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x5e3739);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x46630b,_0xbbb102){let _0x498d83;this['_offset']=_0x46630b['offset'];const _0x4f9d68=_0x46630b['wereChangesApplied']&&!_0x46630b['initData'],_0x2d7816=_0x4f9d68?0x0:_0x46630b['data']['baseVersion'];if(_0xbbb102['forEach'](_0x4cf7bd=>{_0x4cf7bd['_isInit']=!0x0,_0x4cf7bd['createdAt']=_0x46630b['sessionCreatedAt'],_0x4cf7bd['_authorId']=null;}),_0x4f9d68)_0x498d83=_0xbbb102,this['_applyOperationsSet'](_0x498d83,_0x4f9d68);else{if(_0x46630b['initData']){const _0x2bef6b=this['_getOperationsFromInitData'](_0x46630b['initData']);this['_document']['history']['version']=-_0x2bef6b['length'],_0x2bef6b['forEach'](_0x19b2ad=>{_0x19b2ad['baseVersion']-=_0x2bef6b['length'],_0x19b2ad['createdAt']=_0x46630b['sessionCreatedAt'],_0x19b2ad['_isInit']=!0x0,_0x19b2ad['_authorId']=null;}),this['_applyOperationsSet'](_0x2bef6b,!0x0),this['serverHistory']['version']=-_0x2bef6b['length']+this['_offset'],this['_updateServerHistory'](_0x2bef6b);}this['_document']['history']['version']=_0x2d7816,_0x498d83=this['_decompressOperations'](_0x46630b['data'],_0x46630b['metadata']),await this['_fetchMissingUsers'](_0x498d83),this['_applyOperationsSet'](_0x498d83,_0x4f9d68);}_0x46630b['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x498d83,_0x46630b['lastOperationId']),this['_lastSyncedOperationId']=_0x46630b['lastOperationId']),this['serverHistory']['version']=_0x2d7816+this['_offset'],this['_updateServerHistory'](_0x498d83),_0xbbb102['filter'](_0x542cf4=>{const _0x15ee7e=this['_getAffectedRoot'](_0x542cf4);return _0x15ee7e&&!this['_knownRootNames']['has'](_0x15ee7e);})['forEach']((_0x1c797b,_0x176c5d)=>{_0x1c797b['baseVersion']=this['_document']['version']+_0x176c5d,this['_saveOperationInBuffer'](_0x1c797b);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x47571a,_0x473ac5){const _0x32ca48=_0x473ac5&&_0x473ac5['message'];if(_0x32ca48&&_0x32ca48['startsWith']('realtimecollaborationclient'))throw _0x473ac5;const _0x42cc84=this['editor']['plugins']['get'](z);throw this['_isPendingUpdate']=!0x0,_0x42cc84['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3f1dcf(_0x47571a,this['editor'],_0x32ca48?{'originalError':_0x32ca48}:void 0x0);}['_saveOperationInBuffer'](_0x247e61){this['_knownOperations']['has'](_0x247e61)||(this['_knownOperations']['add'](_0x247e61),this['_bufferedOperations']['push'](_0x247e61),this['_pendingAction']||'marker'==_0x247e61['type']&&!_0x247e61['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5981e2=!0x1){!_0x5981e2&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x6a168a=>{_0x6a168a&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x48c911=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x36e595){return _0x36e595['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x36e595['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x36e595['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x48c911)||this['_crash'](_0x48c911['message'],_0x48c911);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5d1f01=>{this['on']('change:_isPendingUpdate',()=>{_0x5d1f01();});});}async['_sendBufferedOperations'](){const _0x3e7c69=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x3e7c69['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x27acbf=[...this['_bufferedOperations']];for(const _0xdd5b28 of _0x27acbf)_0xdd5b28['wasUndone']=this['_document']['history']['isUndoneOperation'](_0xdd5b28);const _0x4c6331=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x27acbf),_0x1fc59a=Z++,_0xa962bd=this['_compressOperations'](_0x27acbf),_0x2fd447=await this['_service']['sendOperations'](_0xa962bd,_0xa962bd['baseVersion'],_0x4c6331);try{return await this['_handleServerResponse'](_0x27acbf,_0x2fd447,_0x1fc59a);}catch(_0x48be73){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x48be73);}}async['_handleServerResponse'](_0x133ba2,_0x1580a8,_0x1f6ac4){if('error'in _0x1580a8)throw _0x1580a8['error'];let _0x3d60be=!0x1;if(_0x1580a8['wereChangesApplied']){_0x1580a8['lastOperationId']&&(this['_lastSyncedOperationId']=_0x1580a8['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2b6e39=>!_0x133ba2['includes'](_0x2b6e39));for(const _0x3197a1 of _0x133ba2)_0x3197a1['createdAt']='lastOperationAcceptedAt'in _0x1580a8&&_0x1580a8['lastOperationAcceptedAt']||void 0x0;st(_0x133ba2,_0x1580a8['version']-_0x133ba2['length']),this['_updateServerHistory'](_0x133ba2);const _0x35f9dd=_0x133ba2['filter'](_0x4b3c64=>{if(!_0x4b3c64['_isInit'])return!0x1;const _0x10edd5=this['_getAffectedRoot'](_0x4b3c64);return _0x10edd5&&!this['_knownRootNames']['has'](_0x10edd5);});st(_0x35f9dd,this['_document']['version']),this['_applyOperationsSet'](_0x35f9dd),_0x3d60be=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x117c34=this['_decompressOperations'](_0x1580a8['data'],_0x1580a8['metadata'])['filter'](_0x1b8a3b=>_0x1b8a3b['baseVersion']>=this['_lastServerVersion']);_0x117c34['forEach'](_0x238673=>this['_addKnownRoot'](_0x238673)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x372412=>!_0x372412['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x372412))),this['_bufferedOperations']['length']&&st(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x117c34),_0x3d60be=this['_handleExternalOperations'](_0x117c34,_0x1580a8['version'],_0x1580a8['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x3d60be?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3adf5d,_0x1c2bdf,_0x879f62){try{const _0xd9b75a={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4b6e48,operationsB:_0x11aeb1,originalOperations:_0x2c8a48}=_0x20990c(_0x3adf5d,this['_bufferedOperations'],_0xd9b75a);st(_0x4b6e48,this['_document']['version']),st(_0x11aeb1,_0x1c2bdf);for(const _0xae1e1a of _0x4b6e48){const _0x58de26=_0x2c8a48['get'](_0xae1e1a);_0x58de26?(_0xae1e1a['_authorId']=_0x58de26['_authorId'],'noop'!==_0xae1e1a['type']&&(_0xae1e1a['_aiSource']=_0x58de26['_aiSource'])):_0xae1e1a['_authorId']=null;}for(const _0x511ba6 of _0x11aeb1)'noop'!==_0x511ba6['type']&&(_0x511ba6['_aiSource']=_0x2c8a48['get'](_0x511ba6)?.['_aiSource']);_0x879f62&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3adf5d,_0x879f62),this['_lastSyncedOperationId']=_0x879f62),this['_bufferedOperations']=[..._0x11aeb1],this['_applyOperationsSet'](_0x4b6e48),this['_updateServerHistory'](_0x3adf5d);}catch(_0x5339da){return console['error'](_0x5339da),!0x1;}return!0x0;}['_applyOperationsSet'](_0xb5260b,_0x4af0e6=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x36d88f=>{for(const _0x3dbd22 of _0xb5260b)this['_knownOperations']['add'](_0x3dbd22),this['_addKnownRoot'](_0x3dbd22),_0x36d88f['batch']['addOperation'](_0x3dbd22),this['editor']['model']['applyOperation'](_0x3dbd22);});}['_addKnownRoot'](_0x6559ab){const _0x2f9cfc=this['_getAffectedRoot'](_0x6559ab);_0x2f9cfc&&this['_knownRootNames']['add'](_0x2f9cfc);}['_getAffectedRoot'](_0x295e2d){let _0x42fb2,_0x19bd63;switch(_0x295e2d['type']){case'insert':_0x42fb2=_0x295e2d['position']['root'];break;case'marker':if(_0x19bd63=_0x295e2d['newRange'],!_0x19bd63)return null;_0x42fb2=_0x19bd63['root'];break;case'addRootAttribute':_0x42fb2=_0x295e2d['root'];break;case'addRoot':_0x42fb2=_0x295e2d['affectedSelectable'];break;case'move':_0x42fb2=_0x295e2d['targetPosition']['root'];break;default:return null;}return _0x42fb2['rootName'];}['_updateServerHistory'](_0x13a4e3){_0x13a4e3['forEach'](_0x1e8f18=>{const _0x53eed0=_0x1e8f18['clone']();_0x53eed0['_authorId']=_0x1e8f18['_authorId'],_0x53eed0['_isInit']=!!_0x1e8f18['_isInit'],_0x53eed0['_aiSource']=_0x1e8f18['_aiSource'],_0x53eed0['createdAt']=_0x1e8f18['createdAt'],_0x53eed0['baseVersion']+=this['_offset'],_0x1e8f18['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x53eed0),this['serverHistory']['addOperation'](_0x53eed0);});}['_handleReconnectionError'](_0x7e57f9){const _0x2d697a=this['editor']['plugins']['get']('Notification'),_0x377aae=this['editor']['locale'];_0x7e57f9||(_0x7e57f9=X(_0x377aae,'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.')),_0x2d697a['showWarning'](_0x7e57f9,{'title':X(_0x377aae,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](z)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x459316)['add'](X(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x459316)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x591f61){const _0xce2364=_0x591f61['map'](_0xc32b47=>_0xc32b47['toJSON']());return this['_compressor']['compress'](_0xce2364);}['_decompressOperations'](_0x5390b5,_0x59df75){return this['_compressor']['decompress'](_0x5390b5)['map']((_0x2524e0,_0x97e5cd)=>{const _0x1fe0f4='init'==_0x59df75[_0x97e5cd]['type'];if('InsertOperation'==_0x2524e0['__className']){const _0x1a2cb5=_0x2524e0['position']['root'];!this['_document']['getRoot'](_0x1a2cb5)&&(this['_document']['createRoot']('$unknown',_0x1a2cb5)['_isAttached']=!0x1);}else{if('RootOperation'==_0x2524e0['__className']){const _0x5a821d=this['_document']['getRoot'](_0x2524e0['rootName']);_0x5a821d&&'$unknown'==_0x5a821d['name']&&_0x2524e0['elementName']!=_0x5a821d['name']&&(_0x5a821d['name']=_0x2524e0['elementName']);}}const _0x84f06d=_0x56b57a['fromJSON'](_0x2524e0,this['_document']);return _0x84f06d['wasUndone']=_0x2524e0['wasUndone'],_0x84f06d['_isInit']=_0x1fe0f4,_0x84f06d['_authorId']=_0x1fe0f4?null:_0x59df75[_0x97e5cd]['userId'],_0x84f06d['_isDisconnection']='cs:removeUser'===_0x59df75[_0x97e5cd]['type'],_0x84f06d['_aiSource']=_0x2524e0['_aiSource']||void 0x0,_0x84f06d['createdAt']=_0x59df75[_0x97e5cd]['createdAt'],_0x84f06d;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5f5960=this['editor']['plugins']['get'](Y)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5f5960&&_0x5f5960['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},et=class extends Error{};function st(_0x3690ab,_0x2d77f4){for(const _0x283ad2 of _0x3690ab)_0x283ad2['baseVersion']=_0x2d77f4++;}var it=class{['_ignoredOperations'];['_operationToId'];constructor(_0x3267fa){this['_ignoredOperations']=_0x3267fa,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x599390){let _0x37da33=_0x599390['length'];for(;_0x37da33--;){const _0x1bcb32=_0x599390[_0x37da33];if(!this['_ignoredOperations']['has'](_0x1bcb32)){if(!this['_operationToId']['has'](_0x1bcb32)){const _0x2f7371=_0x5920c8()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1bcb32,_0x2f7371);}return this['_operationToId']['get'](_0x1bcb32);}}}['setIdForTheLastOperation'](_0x4e73e9,_0x175188){if(!_0x175188)return;let _0x111954=_0x4e73e9['length'];for(;_0x111954--;){const _0x2c8d5=_0x4e73e9[_0x111954];this['_ignoredOperations']['has'](_0x2c8d5)||this['_operationToId']['set'](_0x2c8d5,_0x175188);}}},nt=class extends _0xba3866{static get['requires'](){return[tt];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ot=class CloudServicesCommentsAdapter extends _0x748e16{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x29a0a9)());['_services'];static get['requires'](){return[z,_0x509c50,Y,_0x14b59c];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x325c96){super(_0x325c96),this['_services']=new Map();}async['init'](){const _0x209358=this['context'],_0xadcd70=_0x209358['plugins']['get'](_0x509c50);if(_0x209358['plugins']['get'](z)['addToReconnectionStack'](this),_0xadcd70['adapter']={'addCommentThread':async({channelId:_0x29f47e,threadId:_0x5cc06b,comments:_0x32fb9a,resolvedAt:_0x53bcf4,resolvedBy:_0x434c0f,context:_0x3964d1,attributes:_0x3fe98a})=>{const _0x3c8ba8=await this['_getService'](_0x29f47e)['addCommentThread']({'commentThreadId':_0x5cc06b,'comments':_0x32fb9a['map'](_0x489f80=>function(_0x2bc15c,_0x6e6540,_0x1666ee){return{'commentThreadId':_0x1666ee,'commentId':_0x2bc15c['commentId'],'userId':_0x2bc15c['authorId'],'content':_0x2bc15c['content'],'documentId':_0x6e6540,'createdAt':_0x2bc15c['createdAt'],'attributes':_0x2bc15c['attributes']||{}};}(_0x489f80,_0x29f47e,_0x5cc06b)),'resolvedAt':_0x53bcf4,'resolvedBy':_0x434c0f,'context':_0x3964d1,'attributes':_0x3fe98a})['catch'](ct);return{'threadId':_0x3c8ba8['commentThreadId'],'comments':_0x3c8ba8['comments']};},'getCommentThread':async({channelId:_0xdbffdc,threadId:_0x27104a})=>{const _0x37d741=await this['_getService'](_0xdbffdc)['getCommentThread'](_0x27104a)['catch'](rt)['catch'](ct);return _0x37d741?_0x37d741['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x37d741]),{'threadId':_0x37d741['commentThreadId'],'comments':_0x37d741['comments']['map'](at),'context':_0x37d741['context'],'resolvedAt':_0x37d741['resolvedAt'],'resolvedBy':_0x37d741['resolvedBy'],'attributes':_0x37d741['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x399fe9,threadId:_0x4b9a38,context:_0x5a7d3b,unlinkedAt:_0x28ad74,attributes:_0x552f33})=>this['_getService'](_0x399fe9)['updateCommentThread']({'commentThreadId':_0x4b9a38,'context':_0x5a7d3b,'attributes':_0x552f33,'unlinkedAt':_0x28ad74})['catch'](rt)['catch'](ct),'resolveCommentThread':async({channelId:_0x780ccf,threadId:_0x3289c4})=>{const _0xa8e9af=await this['_getService'](_0x780ccf)['resolveCommentThread'](_0x3289c4)['catch'](rt)['catch'](ct);return{'threadId':_0xa8e9af['commentThreadId'],'resolvedAt':_0xa8e9af['resolvedAt'],'resolvedBy':_0xa8e9af['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2a2030,threadId:_0x1709dc})=>this['_getService'](_0x2a2030)['reopenCommentThread'](_0x1709dc)['catch'](rt)['catch'](ct),'removeCommentThread':({channelId:_0x5b275b,threadId:_0x4fdef8})=>this['_getService'](_0x5b275b)['removeCommentThread'](_0x4fdef8)['catch'](rt)['catch'](ct),'addComment':({channelId:_0x58b11f,threadId:_0x38c36c,commentId:_0x5c1e83,content:_0xb8decb,attributes:_0x3e2e7c})=>this['_getService'](_0x58b11f)['addComment'](_0x38c36c,_0x5c1e83,_0xb8decb,_0x3e2e7c)['catch'](ct),'updateComment':({channelId:_0xd7e592,threadId:_0x2488d2,commentId:_0x3f0b4a,content:_0xd8a389,attributes:_0x4880ad})=>this['_getService'](_0xd7e592)['updateComment'](_0x2488d2,_0x3f0b4a,_0xd8a389,_0x4880ad)['catch'](rt)['catch'](ct),'removeComment':({channelId:_0x482820,threadId:_0x3727d4,commentId:_0xf56223})=>this['_getService'](_0x482820)['removeComment'](_0x3727d4,_0xf56223)['catch'](rt)['catch'](ct)},_0x209358 instanceof _0x403fa9){const _0x1a86ad=_0x209358['config']['get']('collaboration.channelId'),_0x59bf18=_0x209358['plugins']['get'](Y);await this['_setUpService'](_0x1a86ad);const _0x4640d9=await this['_services']['get'](_0x1a86ad)['getConnectedSessions']();this['listenTo'](_0x59bf18,'sessionAdd:'+_0x1a86ad,(_0x77d140,{session:_0x1bcbfa})=>{_0x1bcbfa['id']===_0x59bf18['mySessionId']&&(_0x77d140['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1bcbfa['permissions'],_0x1a86ad));}),_0x59bf18['register'](_0x1a86ad,_0x4640d9);}}async['_setUpService'](_0x126d9b){if(this['_services']['has'](_0x126d9b))throw new _0x3f1dcf('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x126d9b});const _0x8073aa=this['context']['plugins']['get'](_0x509c50),_0x670555=new CloudServicesCommentsAdapter['CommentsService'](_0x126d9b);this['_services']['set'](_0x126d9b,_0x670555),this['listenTo'](_0x670555,'commentThreadAdded',(_0x9a5c71,_0x220b76)=>{const {commentThreadId:_0x4cdcc0,documentId:_0xffaf88,context:_0x5c9f05,attributes:_0x1208c7,resolvedAt:_0x14b1d1,resolvedBy:_0x159208,comments:_0x8b4fc5}=_0x220b76;_0x8073aa['getCommentThread'](_0x4cdcc0)||_0x8073aa['addCommentThread']({'threadId':_0x4cdcc0,'channelId':_0xffaf88,'comments':_0x8b4fc5?_0x8b4fc5['map'](at):[],'context':_0x5c9f05,'attributes':_0x1208c7,'resolvedAt':_0x14b1d1,'resolvedBy':_0x159208,'isFromAdapter':!0x0});}),this['listenTo'](_0x670555,'commentThreadUpdated',(_0x2b9271,{commentThreadId:_0x4ebc8a,documentId:_0x16f0bf,context:_0x240e0b,unlinkedAt:_0x17512e,attributes:_0x450be6})=>{_0x8073aa['getCommentThread'](_0x4ebc8a)&&_0x8073aa['updateCommentThread']({'threadId':_0x4ebc8a,'channelId':_0x16f0bf,'context':_0x240e0b,'unlinkedAt':_0x17512e,'attributes':_0x450be6,'isFromAdapter':!0x0});}),this['listenTo'](_0x670555,'commentThreadResolved',(_0x2926db,{commentThreadId:_0x34735b,resolvedBy:_0x42edf4,resolvedAt:_0x32903e})=>{const _0x4d3556=_0x8073aa['getCommentThread'](_0x34735b);_0x4d3556&&_0x4d3556['resolve']({'resolvedBy':_0x42edf4,'resolvedAt':_0x32903e,'isFromAdapter':!0x0});}),this['listenTo'](_0x670555,'commentThreadReopened',(_0x512af9,{commentThreadId:_0xbf68b0})=>{const _0x56373f=_0x8073aa['getCommentThread'](_0xbf68b0);_0x56373f&&_0x56373f['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x670555,'commentThreadRemoved',(_0x20cf6d,{commentThreadId:_0x16bf90})=>{const _0x9ea317=_0x8073aa['getCommentThread'](_0x16bf90);_0x9ea317&&_0x9ea317['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x670555,'commentAdded',(_0x2e254a,_0x25d3c4)=>{const _0x4a0a74=_0x25d3c4['commentThreadId'],_0x373afc=_0x8073aa['getCommentThread'](_0x4a0a74);_0x373afc&&_0x373afc['addComment']({...at(_0x25d3c4),'isFromAdapter':!0x0});}),this['listenTo'](_0x670555,'commentUpdated',(_0x4e01b9,{commentThreadId:_0x22e777,commentId:_0x4ed7c3,content:_0x42018a,attributes:_0x2b73a4})=>{const _0x457d9f=_0x8073aa['getCommentThread'](_0x22e777);if(_0x457d9f){const _0x51eee6=_0x457d9f['getComment'](_0x4ed7c3);_0x51eee6&&_0x51eee6['update']({'content':_0x42018a,'attributes':_0x2b73a4,'isFromAdapter':!0x0});}}),this['listenTo'](_0x670555,'commentRemoved',(_0x3c9b80,{commentThreadId:_0x5aafe5,commentId:_0x259bb6})=>{const _0x4d97f3=_0x8073aa['getCommentThread'](_0x5aafe5);if(_0x4d97f3){const _0x5e76d1=_0x4d97f3['getComment'](_0x259bb6);_0x5e76d1&&_0x5e76d1['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x670555,'disconnected',()=>{'connected'===this['context']['plugins']['get'](z)['connection']?.['state']&&(this['_services']['delete'](_0x126d9b),this['stopListening'](_0x670555));}),await this['_connectService'](_0x126d9b);}['destroy'](){if(this['context']instanceof _0x403fa9){const _0x40ea8a=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x40ea8a)&&this['_terminateService'](_0x40ea8a);}}['_terminateService'](_0x55b4af){if(!this['_services']['has'](_0x55b4af))throw new _0x3f1dcf('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x55b4af});this['_getService'](_0x55b4af)['disconnect'](),this['_services']['delete'](_0x55b4af);}async['reconnect'](){for(const _0xb0c144 of this['_services']['keys']())await this['_connectService'](_0xb0c144);if(this['context']instanceof _0x403fa9){const _0x303bcf=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x303bcf)){const _0x2b4d00=this['context']['plugins']['get'](Y);_0x2b4d00['unregister'](_0x303bcf);const _0x14ad8f=await this['_services']['get'](_0x303bcf)['getConnectedSessions']();_0x2b4d00['register'](_0x303bcf,_0x14ad8f);}}}async['_connectService'](_0x919bc3){const {connection:_0x39ca14}=this['context']['plugins']['get'](z),_0x19c903=this['context']['plugins']['get'](_0x509c50),_0x3ef6a0=await this['_services']['get'](_0x919bc3)['connect'](_0x39ca14);await this['_fetchMissingUsersForThreads'](_0x3ef6a0);const _0x33c959=new Set(Array['from'](_0x19c903['getCommentThreads']({'channelId':_0x919bc3}),_0x52e847=>_0x52e847['id']));for(const _0x49d5d7 of _0x3ef6a0)_0x49d5d7['deletedAt']||_0x33c959['delete'](_0x49d5d7['commentThreadId']);for(const _0x1504bb of _0x33c959)_0x19c903['getCommentThread'](_0x1504bb)['remove']({'isFromAdapter':!0x0});for(const _0x217f19 of _0x3ef6a0){let _0x3c8260=_0x19c903['getCommentThread'](_0x217f19['commentThreadId']);const {commentThreadId:_0x531e7f,context:_0xdd1c3c,attributes:_0x313285,resolvedBy:_0x27de7e,resolvedAt:_0x5261f0,unlinkedAt:_0xaada5b,deletedAt:_0x2b9b8b}=_0x217f19;if(_0x2b9b8b)continue;_0x3c8260||(_0x3c8260=_0x19c903['addCommentThread']({'channelId':_0x919bc3,'threadId':_0x531e7f,'context':_0xdd1c3c,'attributes':_0x313285||{},'resolvedBy':_0x27de7e,'resolvedAt':_0x5261f0,'unlinkedAt':_0xaada5b,'isFromAdapter':!0x0}));const _0x1dd299=new Set(Array['from'](_0x3c8260['comments'],_0x185ec4=>_0x185ec4['id']));for(const _0x2b3eac of _0x217f19['comments'])_0x1dd299['delete'](_0x2b3eac['commentId']);for(const _0x1a8563 of _0x1dd299)_0x3c8260['getComment'](_0x1a8563)['remove']({'isFromAdapter':!0x0});for(const _0x49f908 of _0x217f19['comments']){const _0x5329c0=_0x3c8260['getComment'](_0x49f908['commentId']);_0x5329c0?_0x5329c0['content']!==_0x49f908['content']&&_0x5329c0['update']({'content':_0x49f908['content'],'isFromAdapter':!0x0}):_0x3c8260['addComment'](Object['assign'](at(_0x49f908),{'isFromAdapter':!0x0}));}}}['_getService'](_0x4617f8){if(!this['_services']['has'](_0x4617f8))throw new _0x3f1dcf('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4617f8});return this['_services']['get'](_0x4617f8);}async['_fetchMissingUsersForThreads'](_0x276900){const _0x5296be=this['context']['plugins']['get'](_0x14b59c),{connection:_0x4f5b98}=this['context']['plugins']['get'](z),_0x4d12e0=new Set();for(const {resolvedBy:_0x3b7557,comments:_0x399c51}of _0x276900){_0x3b7557&&!_0x5296be['getUser'](_0x3b7557)&&_0x4d12e0['add'](_0x3b7557);for(const {userId:_0x307635}of _0x399c51)_0x5296be['getUser'](_0x307635)||_0x4d12e0['add'](_0x307635);}if(0x0===_0x4d12e0['size'])return;const _0x15e4cc=await _0x4a06bf['getMany'](_0x4f5b98,Array['from'](_0x4d12e0));for(const _0x15948c of _0x15e4cc)_0x5296be['getUser'](_0x15948c['id'])||_0x5296be['addUser'](_0x15948c);}};async function rt(_0x411f50){if('404'!==_0x411f50['code'])throw _0x411f50;}function ct(_0x580874){if((_0x2b76c2=_0x580874)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2b76c2['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2b76c2['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2b76c2;throw _0x580874;}function at(_0x141807){return{'threadId':_0x141807['commentThreadId'],'commentId':_0x141807['commentId'],'content':_0x141807['content'],'createdAt':_0x141807['createdAt'],'authorId':_0x141807['userId'],'attributes':_0x141807['attributes']||{}};}var ht=class CloudServicesTrackChangesAdapter extends _0xba3866{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>_0x52f9bc)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[ot,_0x2053c1,z];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4bc7f4){super(_0x4bc7f4);const _0x952971=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x952971);}['init'](){const _0x59e87=this['editor']['plugins']['get'](z),_0x270547=this['editor']['plugins']['get'](_0x2053c1);return _0x270547['adapter']={'getSuggestion':async _0x1265a1=>{await this['_waitForServiceReady']();const _0x58f45b=await this['_trackChangesService']['get'](_0x1265a1)['catch'](lt);return await this['_fetchMissingUsersForThreads']([_0x58f45b]),_0x58f45b;},'addSuggestion':async({id:_0x2c78fe,type:_0x4078e1,data:_0x1a4f1f,originalSuggestionId:_0x14c493,attributes:_0x474004})=>{await this['_waitForServiceReady']();const _0x50bac6={'id':_0x2c78fe,'type':_0x4078e1,'data':_0x1a4f1f,'originalSuggestionId':_0x14c493,'attributes':_0x474004},_0x307ce1=await this['_trackChangesService']['add'](_0x2c78fe,_0x4078e1,_0x1a4f1f,_0x14c493,_0x474004)['catch'](_0x2f5214=>{if(dt(_0x2f5214))return new Promise(_0x3f1dd7=>{this['_bufferedRequests']['set'](_0x2c78fe,{'resolve':_0x3f1dd7,'suggestionData':_0x50bac6});});throw _0x2f5214;});return this['_bufferedRequests']['delete'](_0x2c78fe),_0x307ce1;},'updateSuggestion':async(_0x42c526,_0x2922fa)=>{if(await this['_waitForServiceReady'](),'open'!==_0x2922fa['state'])return this['_trackChangesService']['update'](_0x42c526,_0x2922fa)['catch'](lt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x17ab5a,_0x41022b)=>{_0x270547['hasSuggestion'](_0x41022b['id'])&&(_0x270547['getSuggestion'](_0x41022b['id'])['attributes']=_0x41022b['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x59e87['connection']?.['state']&&(_0x59e87['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0x59e87['connection'])['then'](_0x270351=>(_0x59e87['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x270351)['then'](()=>{for(const _0x1916da of _0x270351){_0x270547['addSuggestionData'](_0x1916da)['_saved']=!0x0;}})));}async['reconnect'](){const _0x58e2ec=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x48667c}=this['editor']['plugins']['get'](z),_0x5f4e3f=await this['_trackChangesService']['connect'](_0x48667c);await this['_fetchMissingUsersForThreads'](_0x5f4e3f);for(const {suggestionData:_0x390f23,resolve:_0x40611b}of this['_bufferedRequests']['values']()){let _0x1e199e=_0x5f4e3f['find'](_0x1cf7d3=>_0x1cf7d3['id']===_0x390f23['id']);_0x1e199e||(_0x1e199e=await this['_trackChangesService']['add'](_0x390f23['id'],_0x390f23['type'],_0x390f23['data'],_0x390f23['originalSuggestionId'])),_0x40611b(_0x1e199e);}for(const _0x5a1033 of _0x5f4e3f)_0x58e2ec['hasSuggestion'](_0x5a1033['id'])||_0x58e2ec['addSuggestionData'](_0x5a1033);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x30b853=>{this['listenTo'](this['_trackChangesService'],'connected',_0x1e5475=>{_0x1e5475['off'](),_0x30b853();});});}async['_fetchMissingUsersForThreads'](_0x3846ae){const _0x25e627=this['editor']['plugins']['get'](_0x14b59c),{connection:_0x47faf9}=this['editor']['plugins']['get'](z),_0x1ce2e6=new Set();for(const {authorId:_0x56ed2d}of _0x3846ae)_0x25e627['getUser'](_0x56ed2d)||_0x1ce2e6['add'](_0x56ed2d);if(0x0===_0x1ce2e6['size'])return;const _0x88e019=await _0x4a06bf['getMany'](_0x47faf9,Array['from'](_0x1ce2e6));for(const _0x2ac593 of _0x88e019)_0x25e627['getUser'](_0x2ac593['id'])||_0x25e627['addUser'](_0x2ac593);}};function lt(_0x163de0){if(dt(_0x163de0))return new Promise(()=>{});throw _0x163de0;}function dt(_0x23797e){return _0x23797e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x23797e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var ut=class extends _0xba3866{static get['requires'](){return[_0x2de072,ot,nt,z];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xb39199=this['editor']['plugins']['get'](z),_0x5af1a5=this['editor']['plugins']['get'](_0x34f96c),_0x3d0df2=this['editor']['plugins']['get'](ot);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0xb39199,'change:state',(_0x5d0968,_0x14b5c1,_0x2631b0)=>{_0x5af1a5['isThreadsLoadingPaused']='connected'!==_0x2631b0;});}),this['listenTo'](_0xb39199,'change:state',(_0x375938,_0x38c37f,_0x3f193b)=>{this['editor']['plugins']['get'](_0x509c50)['switchReadOnly']('connected'!==_0x3f193b);}),_0x3d0df2['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){const _0xa428c4=this['editor']['plugins']['get'](ot),_0x3aa8fb=this['editor']['config']['get']('collaboration.channelId');_0xa428c4['_services']['has'](_0x3aa8fb)&&_0xa428c4['_terminateService'](_0x3aa8fb),super['destroy']();}},ft=class extends _0xba3866{static get['requires'](){return[ut,ht,_0x32388c];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},mt=class CloudServicesRevisionHistoryAdapter extends _0xba3866{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x145221)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[z,tt,_0x5a9f69,Y,_0x14b59c];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x196545){super(_0x196545);const _0x102b89=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x102b89);}async['init'](){const _0x988b1d=this['editor']['plugins']['get'](tt),_0x10f343=_0x988b1d['serverHistory'],_0x4542ed=this['editor']['plugins']['get'](z);this['_revisionTracker']['setSource']({'history':_0x10f343,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x988b1d['sessionId']});const _0x35943b=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x13d0cc,_0x50061f=await _0x451a45['isBundleUploaded'](_0x4542ed['connection'],_0x35943b);this['editor']['plugins']['get'](_0x5a9f69)['adapter']={'getRevision':async({revisionId:_0xcd959d})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0xcd959d)),'updateRevisions':async _0x1f7f67=>{await this['_waitForServiceReady']();const _0x46eff9=this['_revisionTracker']['currentRevision'];if(_0x50061f&&0x1===_0x1f7f67['length']&&_0x1f7f67[0x0]['id']===_0x46eff9['id'])return _0x1f7f67;for(const _0x1a46ae of _0x1f7f67)_0x1a46ae['id']===_0x46eff9['id']&&(_0x1a46ae['isEmptyCurrent']=_0x1a46ae['fromVersion']===_0x1a46ae['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x1f7f67,this['_lastRequestId'])['then'](_0x24b6e4=>(this['_lastRequestId']=_0x24b6e4,_0x1f7f67))['catch'](_0xfe4758=>{if(pt(_0xfe4758)||'400'===_0xfe4758['code']&&void 0x0!==_0xfe4758['data']['wrongRequestId']){for(const _0x20ec98 of _0x1f7f67)this['_revisionTracker']['repository']['getRevision'](_0x20ec98['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x20ec98['id'],_0x20ec98,!0x1);if(pt(_0xfe4758)&&'destroyed'!==this['editor']['state'])throw _0xfe4758;return _0x1f7f67;}throw _0xfe4758;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x291b4c,{revisionsData:_0x3b42c6,requestId:_0x59b439})=>{Math['max'](..._0x3b42c6['map'](_0x211bfa=>_0x211bfa['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3b42c6,_0x59b439);}):this['_handleRevisionsUpdate'](_0x3b42c6,_0x59b439);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x4542ed['connection']?.['state']&&(_0x4542ed['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x217fc7,requestId:_0x2d58bf}=await this['_revisionHistoryService']['connect'](_0x4542ed['connection']);_0x4542ed['addToReconnectionStack'](this),this['_lastRequestId']=_0x2d58bf,await this['_fetchMissingUsers'](_0x217fc7);for(const _0x2cb31c of _0x217fc7)this['_revisionTracker']['addRevisionData'](_0x2cb31c);this['listenTo'](_0x988b1d,'change:_isConnected',(_0x5c98e,_0x412975,_0x1b6331)=>{_0x1b6331&&(this['_oldOffset']=_0x988b1d['_offset'],_0x5c98e['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async['reconnect'](){const _0x343bdf=this['editor']['plugins']['get'](z),_0x9ea0b5=this['editor']['plugins']['get'](tt),_0x4c988a=async()=>{const _0x39c09b=this['_revisionTracker']['currentRevision'],_0x4615fd=_0x39c09b['id'],_0x36e2e3=_0x4615fd!==_0x9ea0b5['sessionId'];if(_0x36e2e3){const _0x186ba2=_0x9ea0b5['_offset']-this['_oldOffset'],_0xa4e785=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x39c09b['toVersion']+_0x186ba2!==_0xa4e785){const _0x57ff45=_0x39c09b['fromVersion']+_0x186ba2,_0x35f919=this['editor']['plugins']['get'](_0x14b59c),_0x246c1b=this['_revisionTracker']['buildRevisionData']({'revision':_0x39c09b,'from':_0x57ff45,'to':_0xa4e785});_0x246c1b['id']=_0x39c09b['id'];const _0x214190=_0x246c1b['authorsIds']['map'](_0x56ae05=>_0x35f919['getUser'](_0x56ae05));_0x39c09b['_update']({..._0x246c1b,'authors':_0x214190},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x39c09b['id'],_0x246c1b,!0x0);}this['_revisionTracker']['_startingVersion']=_0xa4e785,_0x39c09b['toVersion']!==_0x39c09b['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x4615fd)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x4615fd),this['_revisionTracker']['_createCurrentRevision'](_0xa4e785);}const {revisions:_0x1d2a07,requestId:_0x333f81}=await this['_revisionHistoryService']['reconnect'](_0x343bdf['connection'],this['_lastRequestId']);_0x36e2e3&&_0x1d2a07['length']>0x0?_0x9ea0b5['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x1d2a07),this['_handleRevisionsUpdate'](_0x1d2a07,_0x333f81),this['_revisionTracker']['sendBufferedUpdates']());};return _0x9ea0b5['_isConnected']?_0x4c988a():new Promise((_0x599c40,_0x2fdb67)=>{_0x9ea0b5['once']('change:_isConnected',()=>{_0x4c988a()['then'](_0x599c40)['catch'](_0x2fdb67);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5b0b93=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3dd27c=>{_0x3dd27c['off'](),_0x5b0b93();});});}['_getLatestVersionFromServerOperations'](){const _0x33d68b=this['editor']['plugins']['get'](tt)['serverHistory']['getOperations']()['reverse']();for(const _0x4a4067 of _0x33d68b)if('marker'!==_0x4a4067['type']||_0x4a4067['affectsData'])return _0x4a4067['baseVersion']+0x1;}['_getLatestVersion'](){const _0x512f12=this['editor']['plugins']['get'](tt);return new Promise(_0x3f5395=>{_0x512f12['_isPendingUpdate']?_0x512f12['once']('change:_isPendingUpdate',()=>{_0x3f5395(this['_getLatestVersionFromServerOperations']());}):_0x3f5395(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x343d1b,_0x3fab77){const _0x5a1d34=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3fab77;for(const _0x2c1045 of _0x343d1b){const _0x70a4e2=_0x5a1d34['getRevision'](_0x2c1045['id']);if(_0x70a4e2){if((_0x2c1045['fromVersion']||_0x2c1045['toVersion'])&&(_0x2c1045['diffData']=null),_0x70a4e2===this['_revisionTracker']['currentRevision']){const _0x3b9a21=Math['max'](_0x70a4e2['toVersion'],_0x2c1045['toVersion']),_0x146d1a=Math['max'](_0x70a4e2['fromVersion'],_0x2c1045['fromVersion']);let _0x46e85a;_0x70a4e2['toVersion']===_0x2c1045['toVersion']&&_0x70a4e2['fromVersion']===_0x2c1045['fromVersion']?(_0x46e85a=!0x0,this['_preventResendingRevisionData'](_0x2c1045)):_0x2c1045['toVersion']===_0x3b9a21&&_0x2c1045['fromVersion']===_0x146d1a?_0x46e85a=!0x1:(_0x70a4e2['toVersion']===_0x3b9a21&&_0x70a4e2['fromVersion']===_0x146d1a||this['_fixRevision']({'revision':_0x70a4e2,'from':_0x146d1a,'to':_0x3b9a21}),_0x46e85a=!0x0),_0x46e85a&&(delete _0x2c1045['fromVersion'],delete _0x2c1045['toVersion'],delete _0x2c1045['diffData'],delete _0x2c1045['createdAt'],delete _0x2c1045['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2c1045),this['_preventResendingRevisionData'](_0x2c1045);}else this['_revisionTracker']['addRevisionData'](_0x2c1045);}const _0x1ea12c=_0x5a1d34['getRevisions']();_0x1ea12c['reverse']();for(let _0x3426f7=0x0;_0x3426f7<_0x1ea12c['length']-0x1;_0x3426f7++){const _0x286c52=_0x1ea12c[_0x3426f7],_0x5ec5ce=_0x1ea12c[_0x3426f7+0x1];if(_0x286c52['fromVersion']<_0x5ec5ce['toVersion']){const _0x5a1b47=_0x5ec5ce['toVersion'],_0x52d406=Math['max'](_0x5a1b47,_0x286c52['toVersion']);this['_fixRevision']({'revision':_0x286c52,'from':_0x5a1b47,'to':_0x52d406});}}}['_fixRevision']({revision:_0x5e66cc,from:_0x347669,to:_0x302298}={}){const _0x4789db=this['editor']['plugins']['get'](_0x14b59c),_0x30131b=this['_revisionTracker']['buildRevisionData']({'revision':_0x5e66cc,'from':_0x347669,'to':_0x302298});_0x30131b['authors']=_0x30131b['authorsIds']['map'](_0x5b9422=>_0x4789db['getUser'](_0x5b9422)),_0x5e66cc['_update'](_0x30131b);}['_preventResendingRevisionData'](_0x234e29){const _0x2e3098={};_0x2e3098['id']=_0x234e29['id'];for(const _0x104abe of Object['keys'](_0x234e29))'id'!==_0x104abe&&(_0x2e3098[_0x104abe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2e3098['id'],_0x2e3098,!0x0);}async['_fetchMissingUsers'](_0x515b84){const _0x2d2ce7=this['editor']['plugins']['get'](_0x14b59c),{connection:_0x411f61}=this['editor']['plugins']['get'](z),_0x1d37c9=new Set();for(const _0x131289 of _0x515b84){for(const _0x435b9f of _0x131289['authorsIds'])_0x16a9c7(_0x435b9f);_0x131289['creatorId']&&_0x16a9c7(_0x131289['creatorId']);}if(0x0===_0x1d37c9['size'])return;const _0x5ed725=await _0x4a06bf['getMany'](_0x411f61,Array['from'](_0x1d37c9));for(const _0x471f55 of _0x5ed725)_0x2d2ce7['getUser'](_0x471f55['id'])||_0x2d2ce7['addUser'](_0x471f55);function _0x16a9c7(_0x2206ea){_0x2d2ce7['getUser'](_0x2206ea)||_0x1d37c9['add'](_0x2206ea);}}};function pt(_0x1785da){return _0x1785da['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1785da['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1785da['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var gt=class extends _0xba3866{static get['requires'](){return[_0x5a9f69,mt,nt];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class extends _0x48e552{['_collapseAt'];constructor(_0x3410b9,_0x5d35cf=0x6){super(_0x3410b9);const _0x3a90a5=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x5d35cf,this['bind']('isHidden')['to'](this,'usersCount',_0x10b17a=>_0x10b17a<_0x5d35cf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3a90a5['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':_0x3a90a5['to']('usersCount',_0x689953=>'+'+(_0x689953-this['_collapseAt']+0x2)['toString']())}]}]}]});}},vt=class extends _0x48e552{['items'];['keystrokes'];constructor(_0x12fd0d){super(_0x12fd0d);const _0x349288=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5a77f1(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x349288['if']('hasPopup'),'aria-expanded':_0x349288['to']('isExpanded',_0x57e5a1=>this['hasPopup']&&String(_0x57e5a1)),'aria-label':_0x349288['to']('hasPopup',_0x2ab32a=>X(_0x12fd0d,_0x2ab32a?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x349288['to']('hasPopup',_0x12e514=>!!_0x12e514&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x349288['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x349288['to'](_0x20331d=>{const _0x339a37=_0x20331d,_0x3dd63d=document['querySelector']('.ck-presence-list__dropdown-list'),_0x57f34b=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3dd63d?.['contains'](_0x339a37['relatedTarget'])||_0x57f34b?.['contains'](_0x339a37['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4d1c6c,_0x10eec6,_0x29355b)=>{this['element']&&(_0x29355b?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']);}},_t=class extends _0x48e552{['counterView'];['inlineListView'];constructor(_0x5943de,_0x48ddfc=0x6){super(_0x5943de);const _0x522a1a=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new wt(this['locale'],_0x48ddfc),this['inlineListView']=new vt(_0x5943de),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x1dcd54 of this['inlineListView']['items'])_0x1dcd54['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',_0x522a1a['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},yt=class extends _0x48e552{['listWrapperView'];constructor(_0x2804e9,_0xfad4b0){super(_0x2804e9);const _0x4b4029=this['bindTemplate'];this['listWrapperView']=new bt(_0x2804e9,_0xfad4b0),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':X(_0x2804e9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x4b4029['to'](_0x46d8cb=>{const _0x3c7a09=_0x46d8cb,_0x2eb313=document['querySelector']('.ck-presence-list__list'),_0x3f4605=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2eb313?.['contains'](_0x3c7a09['relatedTarget'])||_0x3f4605?.['contains'](_0x3c7a09['relatedTarget'])||this['fire']('presencelist:hide');})}});}},bt=class extends _0x5dc78c{constructor(_0x3c7315,_0x165b69){super(_0x3c7315);const _0x1d6657=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x165b69?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1d6657['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1d6657['to']('role'),'aria-label':_0x1d6657['to']('ariaLabel'),'aria-labelledby':_0x1d6657['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3c55b7['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xf5b646=this['element'];_0xf5b646&&(this['_isScrollable']=Math['max'](_0xf5b646['scrollHeight'],_0xf5b646['clientHeight'])>0.8*window['innerHeight']);}},kt=class extends _0x1b5251{['userView'];constructor(_0x41917e,_0x5e3fd8,_0x323907){super(_0x41917e);const _0x2b14b9=this['bindTemplate'];this['userView']=new _0x10a99c(_0x41917e,_0x5e3fd8);const _0x401c12={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x5e3fd8['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x5e3fd8['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5e3fd8['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x5e3fd8['color']['getColorVariable'](),'--ck-user-color-alpha':_0x5e3fd8['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x323907&&(_0x401c12['tag']='button',_0x401c12['on']={'click':_0x2b14b9['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x401c12);}['focus'](){this['element']['focus']();}},It=class extends _0x48e552{['userView'];['markerView'];constructor(_0x8add37,_0x592c65,_0x9d8126){super(_0x8add37);const _0x557311=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x10a99c(_0x8add37,_0x592c65),this['markerView']=new St(_0x8add37,_0x592c65);const _0x514788=new _0x1a8e59(_0x8add37);_0x514788['template']['tag']='span',_0x514788['text']=_0x592c65['name'];const _0x3b498a={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x557311['to']('isFocusable',_0x4a6ee9=>!!_0x4a6ee9&&0x0),'aria-labelledby':_0x514788['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x557311['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x557311['to']('hasTooltip',_0x5d8e98=>!_0x5d8e98),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x514788]};_0x9d8126&&(_0x3b498a['tag']='button',_0x3b498a['on']={'click':_0x557311['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3b498a);}},St=class extends _0x48e552{constructor(_0x2e005d,_0x203f22){super(_0x2e005d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x203f22['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x203f22['color']['getColorVariable'](),'--ck-user-color-alpha':_0x203f22['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Tt={'collapseAt':0x6,'displayMe':!0x0};var Ct=class extends _0x748e16{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1db676){super(_0x1db676),this['context']['config']['define']('presenceList',Tt);const _0x4c829c=_0x1db676['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4c829c)throw new _0x3f1dcf('presencelist-collapseat-invalid-format',this);if(_0x4c829c<0x1)throw new _0x3f1dcf('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Y)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x271755(),this['balloonPanelView']=new _0x14124b(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[Y];}['init'](){for(const _0x1a14e4 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1a14e4);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4a380d,_0x5b8c21)=>{this['_handleUserAdd'](_0x5b8c21);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x29c3f9,_0xfcd914)=>{this['_handleUserRemove'](_0xfcd914);});}['_createView'](){const _0x1f3b4d=this['context'],_0x5b9e34=new _t(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x180e1d=this['balloonPanelView'];if(!_0x19e585(_0x1f3b4d['config']['get']('presenceList.container')))throw new _0x3f1dcf('presencelist-missing-container',this);return _0x5b9e34['counterView']['bind']('usersCount')['to'](this),_0x5b9e34['bind']('isCollapsed')['to'](this,'usersCount',_0x15dd36=>{const {collapseAt:_0x484f56}=_0x1f3b4d['config']['get']('presenceList'),_0x204725=_0x15dd36>=_0x484f56;if(_0x204725&&!_0x5b9e34['inlineListView']['items']['find'](_0xfa0868=>_0xfa0868 instanceof wt)){const _0x35d131=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x35d131&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x5b9e34['inlineListView']['items']['add'](_0x5b9e34['counterView']);}return _0x204725||this['hideDropdown'](),_0x204725;}),_0x5b9e34['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x550eac=>{const _0x2cb979=_0x1f3b4d['config']['get']('presenceList'),_0x28d68a=new It(_0x1f3b4d['locale'],_0x550eac,!!_0x2cb979['onClick']);return _0x28d68a['bind']('hasTooltip')['to'](_0x5b9e34,'isCollapsed',_0x4bd06a=>!_0x4bd06a),_0x28d68a['bind']('isFocusable')['to'](_0x5b9e34,'isCollapsed',_0x5bd38b=>!_0x5bd38b),_0x2cb979['onClick']&&this['listenTo'](_0x28d68a,'execute',()=>{this['view']['isCollapsed']||_0x2cb979['onClick'](_0x550eac,_0x28d68a['element']);}),_0x28d68a;}),this['listenTo'](_0x5b9e34['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x5b9e34['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x5b9e34['inlineListView']['keystrokes']['set']('Enter',(_0x84918c,_0x4950bd)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4950bd());}),_0x5b9e34['render'](),_0x180e1d['render'](),_0x2c9d92({'emitter':_0x5b9e34,'activator':()=>_0x180e1d['isVisible'],'contextElements':[_0x180e1d['element'],_0x5b9e34['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1f3b4d['config']['get']('presenceList.container')['appendChild'](_0x5b9e34['element']),this['_bodyCollection']=new _0x47ad2b(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5b9e34;}['_handleUserAdd'](_0x1e2534){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1e2534['isMe'])return;const _0x2d4234=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2d4234-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x386402=_0x1e2534['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1e2534,_0x386402);}['_handleUserRemove'](_0x596775){this['usersCount']--;const {collapseAt:_0x384f6c}=this['context']['config']['get']('presenceList'),_0x3c4ad2=this['usersCount']>=_0x384f6c;if(this['currentDisplayedUsers']['get'](_0x596775['id']))this['currentDisplayedUsers']['remove'](_0x596775['id']);else{if(_0x3c4ad2&&this['currentDisplayedUsers']['length']+0x1===_0x384f6c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x3c4ad2?0x1:0x0)<this['usersCount']){for(const _0x1bd1a2 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1bd1a2['id'])&&(this['currentDisplayedUsers']['add'](_0x1bd1a2,Math['min'](this['currentDisplayedUsers']['length']-(_0x3c4ad2?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x3c4ad2?0x1:0x0)===_0x384f6c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x26bd4d=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new yt(this['context']['locale'],!!_0x26bd4d['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x290c89}=this['presenceDropdownView'];_0x290c89['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x13b94d=>{if(!_0x26bd4d['displayMe']&&_0x13b94d['isMe'])return null;const _0x48ee4b=new kt(this['context']['locale'],_0x13b94d,!!_0x26bd4d['onClick']);return _0x26bd4d['onClick']&&this['listenTo'](_0x48ee4b,'execute',()=>{_0x26bd4d['onClick'](_0x13b94d,_0x48ee4b['element']);}),_0x48ee4b;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x290c89['focus'](),_0x290c89['checkIfScrollable']();const _0x1ec367=(_0x3c09ef,_0x39f51a)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x39f51a();};_0x290c89['keystrokes']['set']('Esc',_0x1ec367),_0x290c89['keystrokes']['set']('Shift+Tab',_0x1ec367),_0x290c89['keystrokes']['set']('Tab',(_0x5a2ca7,_0x5bcb37)=>{!function(_0x375f37){const _0x3346d4=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x2e63ad=>_0x2e63ad+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2e0010=[...document['body']['querySelectorAll'](_0x3346d4)]['filter'](_0x4d113e=>_0x4d113e===document['activeElement']||_0x4d113e['offsetWidth']+_0x4d113e['offsetHeight']>0x0)['sort']((_0x2ea8ed,_0x4591d8)=>(_0x2ea8ed['tabIndex']||0x0)-(_0x4591d8['tabIndex']||0x0)),_0x1c11e0=_0x2e0010[(_0x2e0010['indexOf'](_0x375f37)+0x1)%_0x2e0010['length']];_0x1c11e0&&_0x1c11e0['focus']();}(this['view']['element']),this['hideDropdown'](),_0x5bcb37();}),_0x290c89['focusTracker']['add'](this['view']['element']),_0x290c89['focusTracker']['on']('change:isFocused',(_0x311396,_0x199116,_0x36419c)=>{_0x36419c||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}},At=class extends _0x748e16{static get['requires'](){return[Y,Ct];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ot as CloudServicesCommentsAdapter,mt as CloudServicesRevisionHistoryAdapter,ht as CloudServicesTrackChangesAdapter,At as PresenceList,Ct as PresenceListUI,tt as RealTimeCollaborationClient,ut as RealTimeCollaborativeComments,nt as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,Y as Sessions,z as WebSocketGateway};
23
+ import{Context as _0x313231,ContextPlugin as _0x221616,PendingActions as _0x766066,Plugin as _0x5f1cf5}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x50e9a5,Collection as _0x33f44f,DomEmitterMixin as _0x2f79df,KeystrokeHandler as _0x20ead0,global as _0x439457,uid as _0x470f23,version as _0x41d6e0}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x10bbaa,BodyCollection as _0x1807ae,LabelView as _0x1d152c,ListItemView as _0x53e056,ListView as _0x25af46,Notification as _0x1c3502,View as _0x35c92d,clickOutsideHandler as _0x78d497}from'@ckeditor/ckeditor5-ui';import{History as _0x3f6fe1,InsertOperation as _0x43440d,MarkerOperation as _0xb42fcd,ModelLiveRange as _0x3229fc,NoOperation as _0x4581f8,OperationFactory as _0x51b2ec,RootAttributeOperation as _0x4d3eb0,transformOperationSets as _0x398a9c}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x1682be}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x254adb,CommentsService as _0x81b75c,EditorService as _0x2e6152,RevisionHistoryService as _0x33def3,TrackChangesService as _0x4fa6f3,User as _0x4ada42,WEB_SOCKET_GATEWAY_STATES as _0x4e234c,WebSocketGateway as _0x3c6e33}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x5945f1,Users as _0xf7f8c7}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x2f5550}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x4adb42,TrackChangesEditing as _0x190ac6}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x49c2f5,CommentsEditing as _0x1afef8,CommentsRepository as _0x57d3f8}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x4ca2bb}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x551d97}from'es-toolkit/compat';var z=class WebSocketGateway extends _0x221616{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>_0x3c6e33)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return[_0x1682be,_0x1c3502];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1af8ea){super(_0x1af8ea),this['set']('state',_0x4e234c['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2f79df())();}['init'](){const _0x4d91d1=this['context'],_0x18c532=_0x4d91d1['plugins']['get'](_0x1682be),_0x4e5248=_0x4d91d1['plugins']['get'](_0x1c3502);if(!_0x18c532['token'])throw new _0x50e9a5('websocketgateway-missing-token',this);if(!_0x18c532['webSocketUrl'])throw new _0x50e9a5('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'](_0x18c532['token'],_0x18c532['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x12a4db=>{if(this['connection']=_0x12a4db,this['bind']('state')['to'](_0x12a4db,'state',this,'_isBrowserOffline',(_0x33aad3,_0xb2daa)=>('connected'!==_0x33aad3&&(this['_shouldPluginsReconnect']=!0x0),_0xb2daa||_0x33aad3!==_0x4e234c['CONNECTED']?_0x4e234c['DISCONNECTED']:this['state']==_0x4e234c['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x4e234c['CONNECTING']):_0x4e234c['CONNECTED'])),this['connection']['on']('error',(_0x5835fc,_0x3e2042)=>{if('limitExceeded'!==_0x3e2042['code'])throw console['error'](_0x3e2042),new _0x50e9a5('cloudservices-init',null,{'originalError':_0x3e2042});_0x4e5248['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'});}),!_0x12a4db['me'])return new Promise(_0x2e7fd3=>_0x12a4db['on']('change:me',_0x2e7fd3));})['catch'](_0x1c2977=>{throw console['error'](_0x1c2977),new _0x50e9a5('cloudservices-init',null,{'originalError':_0x1c2977});});}['addToReconnectionStack'](_0xbf37e4){if('function'!=typeof _0xbf37e4['reconnect'])throw new _0x50e9a5('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0xbf37e4))throw new _0x50e9a5('websocketgateway-plugin-already-registered',this,{'name':_0xbf37e4['constructor']['pluginName']});this['_reconnectionStack']['add'](_0xbf37e4);}['removeFromReconnectionStack'](_0x37d7e4){this['_reconnectionStack']['delete'](_0x37d7e4);}['isInReconnectionStack'](_0x48a720){return this['_reconnectionStack']['has'](_0x48a720);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1b5086=>_0x1b5086['reconnect']())))['then'](()=>this['state']=_0x4e234c['CONNECTED'])['catch'](_0x56534e=>{throw console['error'](_0x56534e),new _0x50e9a5('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x4e234c['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}},Y=class extends _0x221616{['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[z,_0xf7f8c7];}constructor(_0x527670){super(_0x527670),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x33f44f(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0xf7f8c7);}['init'](){const _0xa605f6=this['context']['plugins']['get'](z);this['listenTo'](_0xa605f6,'change:state',(_0x5186cc,_0x484c0b,_0xcb5309)=>{if('connected'!==_0xcb5309)this['channelSessions']['forEach'](_0x291bf4=>_0x291bf4['clear']()),this['channelConnectedUsers']['forEach'](_0xf8c534=>_0xf8c534['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x1d77cb,_0x15bbca]of this['_registeredSessions'])for(const _0x4fc207 of _0x15bbca)this['_handleSessionAdd'](_0x1d77cb,_0x4fc207);}}),this['_createUser'](_0xa605f6['connection']['me'],!0x0);}['register'](_0x4f2f15,_0x5b08fb){if(this['_registeredSessions']['has'](_0x4f2f15))throw new _0x50e9a5('sessions-register-already-registered',null,{'channelId':_0x4f2f15});this['_registeredSessions']['set'](_0x4f2f15,_0x5b08fb),this['channelSessions']['set'](_0x4f2f15,new _0x33f44f()),this['channelConnectedUsers']['set'](_0x4f2f15,new _0x33f44f()),this['listenTo'](_0x5b08fb,'add',(_0x182f34,_0xf9c460)=>this['_handleSessionAdd'](_0x4f2f15,_0xf9c460)),this['listenTo'](_0x5b08fb,'remove',(_0x28eb85,_0x5019ec)=>this['_handleSessionRemove'](_0x4f2f15,_0x5019ec));for(const _0x764b3c of _0x5b08fb)this['_handleSessionAdd'](_0x4f2f15,_0x764b3c);}['unregister'](_0x36ff1f){if(!this['_registeredSessions']['has'](_0x36ff1f))throw new _0x50e9a5('sessions-unregister-not-exist',null,{'channelId':_0x36ff1f});const _0x1761fd=this['_registeredSessions']['get'](_0x36ff1f);this['stopListening'](_0x1761fd);for(const _0x3dbfbd of _0x1761fd)'connected'===this['context']['plugins']['get'](z)['state']&&this['_handleSessionRemove'](_0x36ff1f,_0x3dbfbd);this['_registeredSessions']['delete'](_0x36ff1f),this['channelSessions']['delete'](_0x36ff1f),this['channelConnectedUsers']['delete'](_0x36ff1f);}get['mySessionId'](){return this['context']['plugins']['get'](z)['connection']['sessionId'];}['getUserBySessionId'](_0xe423d9){for(const _0x48439d of this['channelSessions']['values']())for(const _0x5314e7 of _0x48439d)if(_0x5314e7['id']===_0xe423d9)return _0x5314e7['user'];}['getUserSessions'](_0x11d76f,_0x48134f){const _0x5dd702=_0x48134f?[this['channelSessions']['get'](_0x48134f)]:this['channelSessions']['values'](),_0x2f58fe=new Set();for(const _0x1a81c1 of _0x5dd702)for(const _0x6378e8 of _0x1a81c1)_0x6378e8['user']['id']===_0x11d76f['id']&&_0x2f58fe['add'](_0x6378e8['id']);return _0x2f58fe;}['getUserRole'](_0x2c1ae0){for(const _0x5ee461 of this['channelSessions']['values']())for(const _0x3ca901 of _0x5ee461)if(_0x3ca901['user']===_0x2c1ae0)return _0x3ca901['role'];}['_handleSessionAdd'](_0x16a844,_0xeb0b64){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x31f43c=_0xeb0b64['user'],_0x3ac546=this['_users']['getUser'](_0x31f43c['id'])||this['_createUser'](_0x31f43c),_0x53bce1=Object['assign']({},_0xeb0b64,{'user':_0x3ac546});if(this['channelSessions']['get'](_0x16a844)['add'](_0x53bce1),!_0x31f43c['hiddenInPresenceList']){const _0x2c9268=this['channelConnectedUsers']['get'](_0x16a844);_0x2c9268['has'](_0x3ac546['id'])||_0x2c9268['add'](_0x3ac546),this['allConnectedUsers']['has'](_0x3ac546['id'])||_0x31f43c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x3ac546,_0x3ac546['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x16a844,{'channelId':_0x16a844,'session':_0x53bce1});}['_handleSessionRemove'](_0x1c0be9,_0x501f4e){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x28d999=this['channelConnectedUsers']['get'](_0x1c0be9),_0x21f613=_0x501f4e['user'];_0x21f613['id']&&(this['channelSessions']['get'](_0x1c0be9)['remove'](_0x501f4e['id']),_0x28d999['has'](_0x21f613['id'])&&!this['getUserSessions'](_0x21f613,_0x1c0be9)['size']&&_0x28d999['remove'](_0x21f613['id']),this['allConnectedUsers']['get'](_0x21f613['id'])&&!this['getUserSessions'](_0x21f613)['size']&&this['allConnectedUsers']['remove'](_0x21f613['id']));}['_createUser'](_0x45592d,_0x24db02){const _0x3459bb=this['_users']['addUser'](_0x45592d);return _0x24db02&&this['_users']['defineMe'](_0x45592d['id']),_0x3459bb['orderNumber']=this['_uniqueUsersCount']++,_0x3459bb;}},K=class extends _0x5f1cf5{['_domEmitter']=new(_0x2f79df())();static get['requires'](){return[Y];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xb746a1=this['editor'],_0x5b2cb3=_0xb746a1['plugins']['get'](Y);_0xb746a1['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0xcc54cb,{writer:_0x478687})=>function(_0x558c3c,_0x3141ef,_0x362f14,_0x382b9c){const _0x327bd8=_0x558c3c['markerName']['split'](':')[0x2],_0xb216e=_0x362f14['getUserBySessionId'](_0x327bd8);if(!_0xb216e||_0x327bd8===_0x362f14['mySessionId'])return;if(!_0x382b9c['model']['schema']['checkChild'](_0x558c3c['markerRange']['start'],'$text'))return;const _0x45af20={'class':'ck-user__marker\x20'+_0xb216e['color']['getMarkerClass'](),'style':Q(_0xb216e),'data-name':_0xb216e['name'],'data-session-id':_0x327bd8},_0x2d252a=_0x382b9c['model']['markers']['get'](_0x558c3c['markerName'])['getStart'](),_0x225358=_0x2d252a['nodeAfter'],_0x1aff38=_0x382b9c['model']['schema'];if(_0x225358&&_0x1aff38['isObject'](_0x225358)&&_0x1aff38['isInline'](_0x225358)&&!_0x382b9c['model']['markers']['get']('user:range:'+_0x327bd8)['getRange']()['isCollapsed'])return;const _0x39f034=_0x2d252a['parent'];return _0x382b9c['model']['schema']['isLimit'](_0x39f034)&&!_0x382b9c['model']['hasContent'](_0x39f034)&&(_0x45af20['contenteditable']=!0x1),function(_0x328a13,_0x4fb0f2,_0x29efc6){const _0x268c88=_0x328a13['createUIElement']('span',_0x4fb0f2);return _0x328a13['setCustomProperty']('userPositionMarker',!0x0,_0x268c88),_0x268c88['render']=function(_0x557db2){const _0x543285=this['toDomElement'](_0x557db2),_0x343a98=document['createElement']('span');return _0x343a98['classList']['add']('ck-user__marker-tooltip'),_0x343a98['setAttribute']('contenteditable','false'),_0x343a98['setAttribute']('spellcheck','false'),_0x343a98['textContent']=_0x29efc6['name'],_0x543285['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x343a98['outerHTML']+'⁠',_0x543285['addEventListener']('mouseenter',()=>{_0x543285['classList']['add']('ck-user__marker_hovered');}),_0x543285['addEventListener']('mouseleave',()=>{_0x543285['classList']['remove']('ck-user__marker_hovered');}),_0x543285;},_0x268c88['isSimilar']=function(_0x12e063){return!(!this['getCustomProperty']('userPositionMarker')||!_0x12e063['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x12e063['getAttribute']('data-session-id'));},_0x268c88;}(_0x3141ef,_0x45af20,_0xb216e);}(_0xcc54cb,_0x478687,_0x5b2cb3,_0xb746a1)}),_0xb746a1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xdc86b3=>function(_0x560df0,_0x3eec57){const _0x342a10=_0x560df0['markerName']['split'](':')[0x2];if(_0x342a10===_0x3eec57['mySessionId'])return null;const _0x44f306=_0x3eec57['getUserBySessionId'](_0x342a10);return _0x44f306?{'id':_0x342a10,'classes':['ck-user__selection',_0x44f306['color']['getSelectionClass']()],'attributes':{'style':Q(_0x44f306),'data-session-id':_0x342a10},'priority':0x7d0+_0x44f306['orderNumber']}:{'id':_0x342a10,'classes':[]};}(_0xdc86b3,_0x5b2cb3)}),function(_0x4689b0){const _0x1383f8=_0x4689b0['model'],_0x1f131a=new Map(),_0x46e114=_0x4689b0['plugins']['get'](Y);_0x1383f8['markers']['on']('update:user:range',(_0x5dfd06,_0x19ccb9,_0x5ce2d4,_0x2a6183)=>{if(!_0x2a6183&&_0x1f131a['get'](_0x19ccb9['name']))return _0x1f131a['get'](_0x19ccb9['name'])['detach'](),void _0x1f131a['delete'](_0x19ccb9['name']);const _0x337028=_0x19ccb9['name']['split'](':')[0x2];if(_0x337028===_0x46e114['mySessionId'])return;const _0x399270='user:position:'+_0x337028;_0x1383f8['markers']['has'](_0x399270)&&_0x4689b0['editing']['reconvertMarker'](_0x399270),_0x19ccb9['on']('change:range',(_0x10b873,_0x112530,_0x35b0a6)=>{if('$graveyard'!=_0x112530['root']['rootName']&&'$graveyard'==_0x19ccb9['getRange']()['root']['rootName']&&!_0x1f131a['has'](_0x19ccb9['name'])){const _0x343549=_0x1383f8['schema']['getNearestSelectionRange'](_0x35b0a6['deletionPosition']);if(_0x343549){const _0x4a3f16=_0x3229fc['fromRange'](_0x343549);_0x1f131a['set'](_0x19ccb9['name'],_0x4a3f16),_0x4a3f16['on']('change:range',(_0x39981e,_0x45fee6,_0x5da234)=>{if('$graveyard'==_0x4a3f16['root']['rootName']){const _0xf69d64=_0x1383f8['schema']['getNearestSelectionRange'](_0x5da234['deletionPosition']);_0xf69d64?(_0x4a3f16['start']=_0xf69d64['start'],_0x4a3f16['end']=_0xf69d64['end']):(_0x1f131a['delete'](_0x19ccb9['name']),_0x4a3f16['detach']());}});}}});}),_0x1383f8['document']['on']('change',()=>{_0x1f131a['size']>0x0&&_0x1383f8['enqueueChange']({'isUndoable':!0x1},_0x441d92=>{for(const [_0x5d64a5,_0x1ad0ea]of _0x1f131a)'$graveyard'==_0x1383f8['markers']['get'](_0x5d64a5)['getRange']()['root']['rootName']&&(J(_0x5d64a5['split'](':')[0x2],_0x1ad0ea['toRange'](),_0x1383f8,_0x441d92),_0x1ad0ea['detach']());_0x1f131a['clear']();});});}(_0xb746a1),this['_domEmitter']['listenTo'](_0x439457['document'],'keydown',(_0x21d06a,{key:_0x3a90c8})=>{'Escape'===_0x3a90c8&&function(_0x10822c){_0x10822c['editing']['view']['change'](_0x241ec0=>{for(const _0x31f4a6 of _0x10822c['model']['markers']){if(!_0x31f4a6['name']['startsWith']('user:position'))continue;const _0x417e59=_0x10822c['editing']['mapper']['markerNameToElements'](_0x31f4a6['name']);if(_0x417e59){for(const _0x2ba340 of _0x417e59)_0x241ec0['removeClass']('ck-user__marker_hovered',_0x2ba340);}}});}(_0xb746a1);},{'useCapture':!0x0});}['afterInit'](){const _0xcd736a=this['editor'],_0x57665e=_0xcd736a['commands']['get']('undo');_0x57665e&&_0xcd736a['model']['on']('applyOperation',(_0x4550a8,_0xf1f4f7)=>{const _0x98e79c=_0xf1f4f7[0x0];if(!_0x98e79c['isDocumentOperation'])return;if('marker'!=_0x98e79c['type']||!_0x98e79c['name']['startsWith']('user:'))return;const _0x3aa13c=_0x98e79c['batch'];_0x57665e['_createdBatches']['has'](_0x3aa13c)&&(_0x98e79c['newRange']=_0x98e79c['oldRange']?_0xcd736a['model']['createRange'](_0x98e79c['oldRange']['start'],_0x98e79c['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x284123=this['editor'],_0x27b146=_0x284123['model']['document'],_0x574caa=_0x284123['plugins']['get'](Y);_0x284123['model']['enqueueChange']({'isUndoable':!0x1},_0x199420=>{const _0xbfe09f='user:range:'+_0x574caa['mySessionId'],_0x417f04='user:position:'+_0x574caa['mySessionId'],_0xb2649a=_0x284123['model']['markers']['has'](_0xbfe09f);_0x284123['editing']['view']['hasDomSelection']?J(_0x574caa['mySessionId'],_0x27b146['selection']['getFirstRange'](),_0x284123['model'],_0x199420):_0xb2649a&&(_0x199420['removeMarker'](_0xbfe09f),_0x199420['removeMarker'](_0x417f04));});}};function J(_0x2dec2f,_0x5480bf,_0x2bf831,_0x50b250){const _0x389533='user:range:'+_0x2dec2f,_0x4957b9='user:position:'+_0x2dec2f,_0x3f6dd0=_0x5480bf['getContainedElement']();let _0x10a8ef=_0x5480bf['start'];if(_0x3f6dd0&&_0x3f6dd0['is']('element','tableCell')){const _0x3c3451=function(_0x26256d,_0x41737d){for(const _0x3105ad of _0x26256d['getPositions']())if(_0x41737d['schema']['checkChild'](_0x3105ad,'$text'))return _0x3105ad;}(_0x5480bf,_0x2bf831);_0x3c3451&&(_0x10a8ef=_0x3c3451,_0x5480bf=_0x50b250['createRange'](_0x10a8ef));}const _0x205138=_0x50b250['createRange'](_0x10a8ef);_0x2bf831['markers']['has'](_0x389533)?(_0x50b250['updateMarker'](_0x389533,{'range':_0x5480bf}),_0x50b250['updateMarker'](_0x4957b9,{'range':_0x205138})):(_0x50b250['addMarker'](_0x389533,{'range':_0x5480bf,'usingOperation':!0x0}),_0x50b250['addMarker'](_0x4957b9,{'range':_0x205138,'usingOperation':!0x0}));}function Q(_0x3153da){return'--ck-user-color:'+_0x3153da['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x3153da['color']['getColorAlphaVariable']()+';';}function X(_0x596843,_0x4ad949,_0x55198c){const _0x4df3f4=_0x596843['t'],t=_0x596843['t'];switch(_0x4ad949){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 _0x4df3f4({'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'},_0x55198c);default:return'';}}let Z=0x1;var tt=class RealTimeCollaborationClient extends _0x5f1cf5{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x254adb)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[z,Y,K,_0x766066,_0xf7f8c7,_0x1c3502];}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 _0x36125b=this['serverHistory']['getOperations']();for(let _0x189e0a=_0x36125b['length']-0x1;_0x189e0a>=0x0;_0x189e0a--){const _0x383e4f=_0x36125b[_0x189e0a];if(!this['_disconnectionOperations']['has'](_0x383e4f))return _0x383e4f['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x310625){if(super(_0x310625),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x3f6fe1(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x50e9a5('collaboration-missing-channelid',this);const _0x51a9f7=_0x310625['config']['get']('cloudServices.bundleVersion')||_0x41d6e0;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x51a9f7,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2f5550(),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 it(this['_disconnectionOperations']);}['init'](){const _0x13b901=this['editor'],_0x2d2b7c=_0x13b901['plugins']['get'](_0xf7f8c7),_0x23a3a1=_0x13b901['plugins']['get'](z);this['listenTo'](_0x2d2b7c,'getOperationAuthor',(_0x1d4f0a,_0x3599ac)=>{const _0x14c441=_0x3599ac[0x0];_0x14c441['_authorId']&&(_0x1d4f0a['return']=_0x2d2b7c['getUser'](_0x14c441['_authorId']),_0x1d4f0a['stop']()),null===_0x14c441['_authorId']&&(_0x1d4f0a['return']=null,_0x1d4f0a['stop']());},{'priority':'high'}),this['listenTo'](_0x13b901['model']['document']['selection'],'change:range',(_0x39b397,_0x141afd)=>{_0x141afd['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x13b901['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x13b901['model']['on']('applyOperation',(_0x2ef380,_0x13e2fe)=>{const _0x554f39=_0x13e2fe[0x0];_0x554f39['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x554f39),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x23a3a1,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x913db6,_0xf7147c,_0x276186)=>'connected'===_0x913db6&&!_0xf7147c&&!_0x276186),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x13b901['disableReadOnlyMode']('rtc-offline'):_0x13b901['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x13b901['disableReadOnlyMode']('rtc-offline'):_0x13b901['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x36a38a=this['editor']['plugins']['get'](Y),_0x503754=this['editor']['plugins']['get'](z);try{this['_isPendingUpdate']=!0x0,_0x36a38a['unregister'](this['_channelId']);const _0x2f690a=await this['_service']['reconnect'](_0x503754['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x2f690a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3afccd=await this['_service']['getConnectedSessions']();_0x36a38a['register'](this['_channelId'],_0x3afccd),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x7400cf){if(function(_0x21f5f0){return'404'===_0x21f5f0['code'];}(_0x7400cf)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0xd3a6c0){return'409'===_0xd3a6c0['code'];}(_0x7400cf)){const _0x39d829=X(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'](_0x39d829);}else{if(!(_0x7400cf instanceof et))throw _0x7400cf;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1bfbbf=this['editor']['plugins']['get'](z),_0x5a3696=this['editor']['plugins']['get'](Y);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5a3696['channelSessions']['has'](this['_channelId'])&&_0x5a3696['unregister'](this['_channelId']),_0x1bfbbf['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x231b60){if(this['sessionId']!==_0x231b60['sessionId']&&this['_lastSyncedOperationId']!==_0x231b60['lastOperationId'])throw new et();return this['sessionId']=_0x231b60['sessionId'],this['_handleServerResponse']([],{..._0x231b60,'wereChangesApplied':!0x1,'data':_0x231b60['data']},'reconnect');}async['_connectService'](_0x400e33,_0x5ca336=!0x1){const {connection:_0x3ccfbb}=this['editor']['plugins']['get'](z);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x3ccfbb,this['_channelId'])['then'](_0x5d2d6d=>this['_initSessionsHandling'](_0x5d2d6d))['catch'](_0x5882b6=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5882b6);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x272fd1,_0x12547e)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x12547e);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x2e1c4e=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x400e33);this['_isPendingUpdate']=!0x0;const _0xf4b45c=await this['_service']['connect'](_0x3ccfbb,this['_compressOperations'](_0x400e33),_0x2e1c4e);if(this['sessionId']=_0xf4b45c['sessionId'],_0x5ca336){if(!_0xf4b45c['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xf4b45c['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x400e33,_0xf4b45c,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xf4b45c,_0x400e33);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x14659f=this['editor']['plugins']['get'](Y),_0x136cc3=this['editor']['plugins']['get'](K),_0x3a303b=_0x14659f['channelSessions']['get'](this['_channelId']);_0x3a303b&&_0x3a303b['length']>0x1?_0x136cc3['createUserMarkerOperations']():this['listenTo'](_0x14659f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x14659f['channelSessions']['get'](this['_channelId'])['length']&&_0x136cc3['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x18ce20,_0x18fb7f,_0x489c1f,_0x435124){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x18fb7f){const _0x53dec7=this['_decompressOperations'](_0x489c1f,_0x435124);await this['_fetchMissingUsers'](_0x53dec7),this['_handleExternalOperations'](_0x53dec7,_0x18fb7f,_0x489c1f['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3f7954}=this['editor'];let _0x4e1d5c;try{_0x4e1d5c=await this['_service']['getDocumentDetails']();}catch{const _0x40eacf=X(_0x3f7954,'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'](_0x40eacf);}const _0x1b7439=_0x4e1d5c['currentDocumentSession']||_0x4e1d5c['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x1b7439['lastOperationId']){const _0x58f294=X(_0x3f7954,'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'](_0x58f294);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_handleChannelDisconnected'](){const _0x348ba8=this['editor']['plugins']['get'](z);if(this['_isConnected']=!0x1,!_0x348ba8['connection']||'connected'!==_0x348ba8['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x409172=this['editor']['plugins']['get'](Y);_0x409172['channelSessions']['has'](this['_channelId'])&&_0x409172['unregister'](this['_channelId']),_0x348ba8['removeFromReconnectionStack'](this),this['_disconnectService']();}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4e93ad){const _0x354acf=this['editor']['plugins']['get'](Y);this['listenTo'](_0x354acf,'sessionAdd:'+this['_channelId'],(_0x2d0485,{session:_0x43c70a})=>{if(_0x43c70a['id']===_0x354acf['mySessionId']){_0x2d0485['off']();const _0xd19c7b=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x17e3b4=_0x43c70a['permissions'];_0xd19c7b&&_0xd19c7b['isEnabled']&&(_0x17e3b4=_0x17e3b4['filter'](_0x41901b=>'document:write'!==_0x41901b)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x17e3b4,this['_channelId']);}}),_0x354acf['register'](this['_channelId'],_0x4e93ad);}['_initThrowingOnDataSet'](){const _0xc88ee1=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xf00c28)=>{if(!_0xf00c28[_0xf00c28['length']-0x1]['suppressErrorInCollaboration'])throw new _0x50e9a5('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0xc88ee1['apply'](this['editor']['data'],_0xf00c28);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2216de,[_0x36938c])=>{if(this['_document']['version'])throw new _0x50e9a5('realtimecollaborationclient-init-document-already-initialized',this);_0x2216de['stop'](),this['_setPendingAction']();const _0x2e1d24=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x4d4d25])=>!_0x4d4d25['lazyLoad'])['map'](([_0x315b41,_0x4b8464])=>[_0x315b41,_0x4b8464['modelAttributes']||{}])),_0x290048=this['_getOperationsFromInitData'](_0x36938c,_0x2e1d24);0x0==_0x290048['length']&&_0x290048['push'](new _0x4581f8(0x0)),_0x2216de['return']=this['_connectService'](_0x290048)['then'](()=>{this['editor']['plugins']['get'](z)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3c884d=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3c884d))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x29ec7a,[_0x3eb3b5,_0x598c7e])=>{_0x29ec7a['stop']();const _0x375f6e=this['editor']['model']['document']['getRoot'](_0x3eb3b5);if(!this['_knownRootNames']['has'](_0x3eb3b5)){const _0x46f642=_0x598c7e&&_0x598c7e['data']?_0x598c7e['data']:'',_0x5e1225=_0x598c7e&&_0x598c7e['attributes']?_0x598c7e['attributes']:{};await this['_loadRoot'](_0x3eb3b5,_0x46f642,_0x5e1225);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x375f6e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x375f6e);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x36e232){const _0x5b0d32=this['editor']['plugins']['get'](_0xf7f8c7),{connection:_0x29fa6a}=this['editor']['plugins']['get'](z),_0x13c67a=new Set();for(const _0x31547c of _0x36e232){const _0x5056c0=_0x31547c['_authorId'];_0x5056c0&&!_0x5b0d32['getUser'](_0x5056c0)&&_0x13c67a['add'](_0x5056c0);}if(0x0===_0x13c67a['size'])return;const _0x413a28=await _0x4ada42['getMany'](_0x29fa6a,Array['from'](_0x13c67a));for(const _0x450901 of _0x413a28)_0x5b0d32['getUser'](_0x450901['id'])||_0x5b0d32['addUser'](_0x450901);}['_getOperationsFromInitData'](_0x455a84,_0x886c47={}){const _0x1951b2=this['editor']['model'],_0x324cbb=[];let _0x24e111=0x0;const _0x5696ae='string'==typeof _0x455a84?{'main':_0x455a84}:_0x455a84;for(const _0x5880ad of Object['keys'](_0x5696ae)){if(!this['_document']['roots']['has'](_0x5880ad))throw new _0x50e9a5('realtimecollaborationclient-init-non-existent-root',this);const _0x35fa68=this['_document']['getRoot'](_0x5880ad),_0x3e2267=this['editor']['data']['parse'](_0x5696ae[_0x5880ad],_0x35fa68),_0x41ff62=new _0x43440d(_0x1951b2['createPositionAt'](_0x35fa68,0x0),_0x3e2267,_0x24e111++);_0x324cbb['push'](_0x41ff62);for(const [_0x4b2a8c,_0xd10657]of _0x3e2267['markers']){const _0xd17705=new _0xb42fcd(_0x4b2a8c,null,_0x1951b2['createRange'](_0x1951b2['createPositionFromPath'](_0x35fa68,_0xd10657['start']['path']['slice']()),_0x1951b2['createPositionFromPath'](_0x35fa68,_0xd10657['end']['path']['slice']())),_0x1951b2['markers'],!0x0,_0x24e111++);_0x324cbb['push'](_0xd17705);}}if(_0x886c47)for(const [_0x45d79a,_0x108a7e]of Object['entries'](_0x886c47)){const _0x5af8c0=_0x1951b2['document']['getRoot'](_0x45d79a);if(!_0x5af8c0)throw new _0x50e9a5('multi-root-editor-root-attributes-no-root',null);for(const [_0xc239c3,_0x23c212]of Object['entries'](_0x108a7e))if(null!==_0x23c212){const _0x43620d=new _0x4d3eb0(_0x5af8c0,_0xc239c3,null,_0x23c212,_0x24e111++);_0x324cbb['push'](_0x43620d);}}return _0x324cbb;}async['_loadRoot'](_0x310e9d,_0x534679,_0x55be39){this['_getOperationsFromInitData']({[_0x310e9d]:_0x534679},{[_0x310e9d]:_0x55be39})['forEach']((_0x14a0c1,_0x381376)=>{_0x14a0c1['baseVersion']=this['_document']['version']+_0x381376,_0x14a0c1['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x14a0c1);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x3284a4,_0x36ebd1){let _0x3daa7c;this['_offset']=_0x3284a4['offset'];const _0x598cb6=_0x3284a4['wereChangesApplied']&&!_0x3284a4['initData'],_0x549126=_0x598cb6?0x0:_0x3284a4['data']['baseVersion'];if(_0x36ebd1['forEach'](_0x1cbc20=>{_0x1cbc20['_isInit']=!0x0,_0x1cbc20['createdAt']=_0x3284a4['sessionCreatedAt'],_0x1cbc20['_authorId']=null;}),_0x598cb6)_0x3daa7c=_0x36ebd1,this['_applyOperationsSet'](_0x3daa7c,_0x598cb6);else{if(_0x3284a4['initData']){const _0x1824ea=this['_getOperationsFromInitData'](_0x3284a4['initData']);this['_document']['history']['version']=-_0x1824ea['length'],_0x1824ea['forEach'](_0x15b014=>{_0x15b014['baseVersion']-=_0x1824ea['length'],_0x15b014['createdAt']=_0x3284a4['sessionCreatedAt'],_0x15b014['_isInit']=!0x0,_0x15b014['_authorId']=null;}),this['_applyOperationsSet'](_0x1824ea,!0x0),this['serverHistory']['version']=-_0x1824ea['length']+this['_offset'],this['_updateServerHistory'](_0x1824ea);}this['_document']['history']['version']=_0x549126,_0x3daa7c=this['_decompressOperations'](_0x3284a4['data'],_0x3284a4['metadata']),await this['_fetchMissingUsers'](_0x3daa7c),this['_applyOperationsSet'](_0x3daa7c,_0x598cb6);}_0x3284a4['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3daa7c,_0x3284a4['lastOperationId']),this['_lastSyncedOperationId']=_0x3284a4['lastOperationId']),this['serverHistory']['version']=_0x549126+this['_offset'],this['_updateServerHistory'](_0x3daa7c),_0x36ebd1['filter'](_0x37a849=>{const _0x4b005c=this['_getAffectedRoot'](_0x37a849);return _0x4b005c&&!this['_knownRootNames']['has'](_0x4b005c);})['forEach']((_0x1e93ca,_0x2f2b2c)=>{_0x1e93ca['baseVersion']=this['_document']['version']+_0x2f2b2c,this['_saveOperationInBuffer'](_0x1e93ca);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2fde59,_0x2443bb){const _0xdf87d4=_0x2443bb&&_0x2443bb['message'];if(_0xdf87d4&&_0xdf87d4['startsWith']('realtimecollaborationclient'))throw _0x2443bb;const _0x1ec2f7=this['editor']['plugins']['get'](z);throw this['_isPendingUpdate']=!0x0,_0x1ec2f7['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x50e9a5(_0x2fde59,this['editor'],_0xdf87d4?{'originalError':_0xdf87d4}:void 0x0);}['_saveOperationInBuffer'](_0x49c815){this['_knownOperations']['has'](_0x49c815)||(this['_knownOperations']['add'](_0x49c815),this['_bufferedOperations']['push'](_0x49c815),this['_pendingAction']||'marker'==_0x49c815['type']&&!_0x49c815['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x52abca=!0x1){!_0x52abca&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x184a95=>{_0x184a95&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x313813=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5e1c74){return _0x5e1c74['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5e1c74['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5e1c74['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x313813)||this['_crash'](_0x313813['message'],_0x313813);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x22cbd6=>{this['on']('change:_isPendingUpdate',()=>{_0x22cbd6();});});}async['_sendBufferedOperations'](){const _0x5560b9=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x5560b9['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5d03ec=[...this['_bufferedOperations']];for(const _0x5eafb3 of _0x5d03ec)_0x5eafb3['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5eafb3);const _0x25705a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5d03ec),_0x3b0045=Z++,_0x5b1288=this['_compressOperations'](_0x5d03ec),_0x13e000=await this['_service']['sendOperations'](_0x5b1288,_0x5b1288['baseVersion'],_0x25705a);try{return await this['_handleServerResponse'](_0x5d03ec,_0x13e000,_0x3b0045);}catch(_0x1ef26c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1ef26c);}}async['_handleServerResponse'](_0x30c6a5,_0x4134e0,_0x1d96ff){if('error'in _0x4134e0)throw _0x4134e0['error'];let _0x17119c=!0x1;if(_0x4134e0['wereChangesApplied']){_0x4134e0['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4134e0['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4654f1=>!_0x30c6a5['includes'](_0x4654f1));for(const _0x5304dc of _0x30c6a5)_0x5304dc['createdAt']='lastOperationAcceptedAt'in _0x4134e0&&_0x4134e0['lastOperationAcceptedAt']||void 0x0;st(_0x30c6a5,_0x4134e0['version']-_0x30c6a5['length']),this['_updateServerHistory'](_0x30c6a5);const _0xe7dc86=_0x30c6a5['filter'](_0x547c95=>{if(!_0x547c95['_isInit'])return!0x1;const _0x2629e0=this['_getAffectedRoot'](_0x547c95);return _0x2629e0&&!this['_knownRootNames']['has'](_0x2629e0);});st(_0xe7dc86,this['_document']['version']),this['_applyOperationsSet'](_0xe7dc86),_0x17119c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4451cb=this['_decompressOperations'](_0x4134e0['data'],_0x4134e0['metadata'])['filter'](_0x3c2bd=>_0x3c2bd['baseVersion']>=this['_lastServerVersion']);_0x4451cb['forEach'](_0x156554=>this['_addKnownRoot'](_0x156554)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x97d14a=>!_0x97d14a['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x97d14a))),this['_bufferedOperations']['length']&&st(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x4451cb),_0x17119c=this['_handleExternalOperations'](_0x4451cb,_0x4134e0['version'],_0x4134e0['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x17119c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0xd4a06e,_0x29eb5b,_0x4f18bb){try{const _0x111839={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x58312d,operationsB:_0x3fb1ee,originalOperations:_0x6bd947}=_0x398a9c(_0xd4a06e,this['_bufferedOperations'],_0x111839);st(_0x58312d,this['_document']['version']),st(_0x3fb1ee,_0x29eb5b);for(const _0x5f2133 of _0x58312d){const _0x4a9178=_0x6bd947['get'](_0x5f2133);_0x4a9178?(_0x5f2133['_authorId']=_0x4a9178['_authorId'],'noop'!==_0x5f2133['type']&&(_0x5f2133['_aiSource']=_0x4a9178['_aiSource'])):_0x5f2133['_authorId']=null;}for(const _0x5c6c21 of _0x3fb1ee)'noop'!==_0x5c6c21['type']&&(_0x5c6c21['_aiSource']=_0x6bd947['get'](_0x5c6c21)?.['_aiSource']);_0x4f18bb&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xd4a06e,_0x4f18bb),this['_lastSyncedOperationId']=_0x4f18bb),this['_bufferedOperations']=[..._0x3fb1ee],this['_applyOperationsSet'](_0x58312d),this['_updateServerHistory'](_0xd4a06e);}catch(_0x135fc6){return console['error'](_0x135fc6),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5d5e7f,_0x3916fd=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x421c7b=>{for(const _0x3d7cf5 of _0x5d5e7f)this['_knownOperations']['add'](_0x3d7cf5),this['_addKnownRoot'](_0x3d7cf5),_0x421c7b['batch']['addOperation'](_0x3d7cf5),this['editor']['model']['applyOperation'](_0x3d7cf5);});}['_addKnownRoot'](_0xdf7f08){const _0x45195d=this['_getAffectedRoot'](_0xdf7f08);_0x45195d&&this['_knownRootNames']['add'](_0x45195d);}['_getAffectedRoot'](_0x801787){let _0x488813,_0x437573;switch(_0x801787['type']){case'insert':_0x488813=_0x801787['position']['root'];break;case'marker':if(_0x437573=_0x801787['newRange'],!_0x437573)return null;_0x488813=_0x437573['root'];break;case'addRootAttribute':_0x488813=_0x801787['root'];break;case'addRoot':_0x488813=_0x801787['affectedSelectable'];break;case'move':_0x488813=_0x801787['targetPosition']['root'];break;default:return null;}return _0x488813['rootName'];}['_updateServerHistory'](_0x4bc2e5){_0x4bc2e5['forEach'](_0x33548f=>{const _0x227939=_0x33548f['clone']();_0x227939['_authorId']=_0x33548f['_authorId'],_0x227939['_isInit']=!!_0x33548f['_isInit'],_0x227939['_aiSource']=_0x33548f['_aiSource'],_0x227939['createdAt']=_0x33548f['createdAt'],_0x227939['baseVersion']+=this['_offset'],_0x33548f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x227939),this['serverHistory']['addOperation'](_0x227939);});}['_handleReconnectionError'](_0x4627ce){const _0x18079f=this['editor']['plugins']['get']('Notification'),_0x2d7174=this['editor']['locale'];_0x4627ce||(_0x4627ce=X(_0x2d7174,'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.')),_0x18079f['showWarning'](_0x4627ce,{'title':X(_0x2d7174,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](z)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x766066)['add'](X(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x766066)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2e9517){const _0x4ac241=_0x2e9517['map'](_0x24214e=>_0x24214e['toJSON']());return this['_compressor']['compress'](_0x4ac241);}['_decompressOperations'](_0x207f1b,_0x529248){return this['_compressor']['decompress'](_0x207f1b)['map']((_0xb4c9a3,_0x33f5dd)=>{const _0x2c6ba1='init'==_0x529248[_0x33f5dd]['type'];if('InsertOperation'==_0xb4c9a3['__className']){const _0x3c871e=_0xb4c9a3['position']['root'];!this['_document']['getRoot'](_0x3c871e)&&(this['_document']['createRoot']('$unknown',_0x3c871e)['_isAttached']=!0x1);}else{if('RootOperation'==_0xb4c9a3['__className']){const _0x1919d1=this['_document']['getRoot'](_0xb4c9a3['rootName']);_0x1919d1&&'$unknown'==_0x1919d1['name']&&_0xb4c9a3['elementName']!=_0x1919d1['name']&&(_0x1919d1['name']=_0xb4c9a3['elementName']);}}const _0x5e59bf=_0x51b2ec['fromJSON'](_0xb4c9a3,this['_document']);return _0x5e59bf['wasUndone']=_0xb4c9a3['wasUndone'],_0x5e59bf['_isInit']=_0x2c6ba1,_0x5e59bf['_authorId']=_0x2c6ba1?null:_0x529248[_0x33f5dd]['userId'],_0x5e59bf['_isDisconnection']='cs:removeUser'===_0x529248[_0x33f5dd]['type'],_0x5e59bf['_aiSource']=_0xb4c9a3['_aiSource']||void 0x0,_0x5e59bf['createdAt']=_0x529248[_0x33f5dd]['createdAt'],_0x5e59bf;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x14c04c=this['editor']['plugins']['get'](Y)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x14c04c&&_0x14c04c['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},et=class extends Error{};function st(_0x1ef8c0,_0x41647f){for(const _0x54c717 of _0x1ef8c0)_0x54c717['baseVersion']=_0x41647f++;}var it=class{['_ignoredOperations'];['_operationToId'];constructor(_0x523aab){this['_ignoredOperations']=_0x523aab,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x5072c6){let _0x61a94b=_0x5072c6['length'];for(;_0x61a94b--;){const _0xef14af=_0x5072c6[_0x61a94b];if(!this['_ignoredOperations']['has'](_0xef14af)){if(!this['_operationToId']['has'](_0xef14af)){const _0x543abb=_0x470f23()['slice'](0x1,0x12);this['_operationToId']['set'](_0xef14af,_0x543abb);}return this['_operationToId']['get'](_0xef14af);}}}['setIdForTheLastOperation'](_0x423e06,_0x42426b){if(!_0x42426b)return;let _0x4f5816=_0x423e06['length'];for(;_0x4f5816--;){const _0x12afff=_0x423e06[_0x4f5816];this['_ignoredOperations']['has'](_0x12afff)||this['_operationToId']['set'](_0x12afff,_0x42426b);}}},nt=class extends _0x5f1cf5{static get['requires'](){return[tt];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ot=class CloudServicesCommentsAdapter extends _0x221616{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x81b75c)());['_services'];static get['requires'](){return[z,_0x57d3f8,Y,_0xf7f8c7];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe85c30){super(_0xe85c30),this['_services']=new Map();}async['init'](){const _0x2e8849=this['context'],_0x3e6676=_0x2e8849['plugins']['get'](_0x57d3f8);if(_0x2e8849['plugins']['get'](z)['addToReconnectionStack'](this),_0x3e6676['adapter']={'addCommentThread':async({channelId:_0x18578b,threadId:_0x5d7b7d,comments:_0x1cd691,resolvedAt:_0x169529,resolvedBy:_0x8611bb,context:_0x56b7c2,attributes:_0x2dbd79})=>{const _0x11bd07=await this['_getService'](_0x18578b)['addCommentThread']({'commentThreadId':_0x5d7b7d,'comments':_0x1cd691['map'](_0x354350=>function(_0x1f8980,_0x2d1a88,_0x3b80ed){return{'commentThreadId':_0x3b80ed,'commentId':_0x1f8980['commentId'],'userId':_0x1f8980['authorId'],'content':_0x1f8980['content'],'documentId':_0x2d1a88,'createdAt':_0x1f8980['createdAt'],'attributes':_0x1f8980['attributes']||{}};}(_0x354350,_0x18578b,_0x5d7b7d)),'resolvedAt':_0x169529,'resolvedBy':_0x8611bb,'context':_0x56b7c2,'attributes':_0x2dbd79})['catch'](ct);return{'threadId':_0x11bd07['commentThreadId'],'comments':_0x11bd07['comments']};},'getCommentThread':async({channelId:_0x372bc8,threadId:_0x2e5008})=>{const _0x2d6ba4=await this['_getService'](_0x372bc8)['getCommentThread'](_0x2e5008)['catch'](rt)['catch'](ct);return _0x2d6ba4?_0x2d6ba4['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2d6ba4]),{'threadId':_0x2d6ba4['commentThreadId'],'comments':_0x2d6ba4['comments']['map'](at),'context':_0x2d6ba4['context'],'resolvedAt':_0x2d6ba4['resolvedAt'],'resolvedBy':_0x2d6ba4['resolvedBy'],'attributes':_0x2d6ba4['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x52a6fa,threadId:_0xb13384,context:_0x5a2139,unlinkedAt:_0x28d437,attributes:_0x400253})=>this['_getService'](_0x52a6fa)['updateCommentThread']({'commentThreadId':_0xb13384,'context':_0x5a2139,'attributes':_0x400253,'unlinkedAt':_0x28d437})['catch'](rt)['catch'](ct),'resolveCommentThread':async({channelId:_0x377b47,threadId:_0x53ac04})=>{const _0x53dd41=await this['_getService'](_0x377b47)['resolveCommentThread'](_0x53ac04)['catch'](rt)['catch'](ct);return{'threadId':_0x53dd41['commentThreadId'],'resolvedAt':_0x53dd41['resolvedAt'],'resolvedBy':_0x53dd41['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2c2650,threadId:_0x140c1c})=>this['_getService'](_0x2c2650)['reopenCommentThread'](_0x140c1c)['catch'](rt)['catch'](ct),'removeCommentThread':({channelId:_0xc26127,threadId:_0x115698})=>this['_getService'](_0xc26127)['removeCommentThread'](_0x115698)['catch'](rt)['catch'](ct),'addComment':({channelId:_0x11ec92,threadId:_0x26495b,commentId:_0x2bebdc,content:_0x5496d4,attributes:_0x45c8d7})=>this['_getService'](_0x11ec92)['addComment'](_0x26495b,_0x2bebdc,_0x5496d4,_0x45c8d7)['catch'](ct),'updateComment':({channelId:_0x2702c0,threadId:_0x1d18f4,commentId:_0x246f1b,content:_0x27312a,attributes:_0x302932})=>this['_getService'](_0x2702c0)['updateComment'](_0x1d18f4,_0x246f1b,_0x27312a,_0x302932)['catch'](rt)['catch'](ct),'removeComment':({channelId:_0x5df528,threadId:_0x20af12,commentId:_0x22ddcf})=>this['_getService'](_0x5df528)['removeComment'](_0x20af12,_0x22ddcf)['catch'](rt)['catch'](ct)},_0x2e8849 instanceof _0x313231){const _0x51a829=_0x2e8849['config']['get']('collaboration.channelId'),_0x25c256=_0x2e8849['plugins']['get'](Y);await this['_setUpService'](_0x51a829);const _0x1c9246=await this['_services']['get'](_0x51a829)['getConnectedSessions']();this['listenTo'](_0x25c256,'sessionAdd:'+_0x51a829,(_0x1b82b4,{session:_0x1e95b1})=>{_0x1e95b1['id']===_0x25c256['mySessionId']&&(_0x1b82b4['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1e95b1['permissions'],_0x51a829));}),_0x25c256['register'](_0x51a829,_0x1c9246);}}async['_setUpService'](_0x1ca1f2){if(this['_services']['has'](_0x1ca1f2))throw new _0x50e9a5('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x1ca1f2});const _0x22a2fa=this['context']['plugins']['get'](_0x57d3f8),_0x27b610=new CloudServicesCommentsAdapter['CommentsService'](_0x1ca1f2);this['_services']['set'](_0x1ca1f2,_0x27b610),this['listenTo'](_0x27b610,'commentThreadAdded',(_0x27a2ec,_0x5e67e7)=>{const {commentThreadId:_0x54d5ea,documentId:_0x291754,context:_0x27057,attributes:_0x1e7edf,resolvedAt:_0x49c56d,resolvedBy:_0x1ae056,comments:_0x135bab}=_0x5e67e7;_0x22a2fa['getCommentThread'](_0x54d5ea)||_0x22a2fa['addCommentThread']({'threadId':_0x54d5ea,'channelId':_0x291754,'comments':_0x135bab?_0x135bab['map'](at):[],'context':_0x27057,'attributes':_0x1e7edf,'resolvedAt':_0x49c56d,'resolvedBy':_0x1ae056,'isFromAdapter':!0x0});}),this['listenTo'](_0x27b610,'commentThreadUpdated',(_0xfc05fc,{commentThreadId:_0x18a75c,documentId:_0x6a8d9a,context:_0x485e08,unlinkedAt:_0xaba44f,attributes:_0x2f5120})=>{_0x22a2fa['getCommentThread'](_0x18a75c)&&_0x22a2fa['updateCommentThread']({'threadId':_0x18a75c,'channelId':_0x6a8d9a,'context':_0x485e08,'unlinkedAt':_0xaba44f,'attributes':_0x2f5120,'isFromAdapter':!0x0});}),this['listenTo'](_0x27b610,'commentThreadResolved',(_0x42cc16,{commentThreadId:_0x226df5,resolvedBy:_0x256a6c,resolvedAt:_0x2f5085})=>{const _0x4c53d7=_0x22a2fa['getCommentThread'](_0x226df5);_0x4c53d7&&_0x4c53d7['resolve']({'resolvedBy':_0x256a6c,'resolvedAt':_0x2f5085,'isFromAdapter':!0x0});}),this['listenTo'](_0x27b610,'commentThreadReopened',(_0x4fefca,{commentThreadId:_0x11ad44})=>{const _0x5a8125=_0x22a2fa['getCommentThread'](_0x11ad44);_0x5a8125&&_0x5a8125['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x27b610,'commentThreadRemoved',(_0x40b8e2,{commentThreadId:_0x17b3d5})=>{const _0x492868=_0x22a2fa['getCommentThread'](_0x17b3d5);_0x492868&&_0x492868['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x27b610,'commentAdded',(_0x5e3bf2,_0x5b431d)=>{const _0x43a41f=_0x5b431d['commentThreadId'],_0x15a324=_0x22a2fa['getCommentThread'](_0x43a41f);_0x15a324&&_0x15a324['addComment']({...at(_0x5b431d),'isFromAdapter':!0x0});}),this['listenTo'](_0x27b610,'commentUpdated',(_0x188e69,{commentThreadId:_0x1e146d,commentId:_0x38f40a,content:_0x3e06a8,attributes:_0x590683})=>{const _0x112a29=_0x22a2fa['getCommentThread'](_0x1e146d);if(_0x112a29){const _0x344eaf=_0x112a29['getComment'](_0x38f40a);_0x344eaf&&_0x344eaf['update']({'content':_0x3e06a8,'attributes':_0x590683,'isFromAdapter':!0x0});}}),this['listenTo'](_0x27b610,'commentRemoved',(_0x1427ba,{commentThreadId:_0xc418a8,commentId:_0x2cd3b3})=>{const _0x2fcff1=_0x22a2fa['getCommentThread'](_0xc418a8);if(_0x2fcff1){const _0x1a2f46=_0x2fcff1['getComment'](_0x2cd3b3);_0x1a2f46&&_0x1a2f46['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x27b610,'disconnected',()=>{'connected'===this['context']['plugins']['get'](z)['connection']?.['state']&&(this['_services']['delete'](_0x1ca1f2),this['stopListening'](_0x27b610));}),await this['_connectService'](_0x1ca1f2);}['destroy'](){if(this['context']instanceof _0x313231){const _0xdfa3a0=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0xdfa3a0)&&this['_terminateService'](_0xdfa3a0);}}['_terminateService'](_0x3e332d){if(!this['_services']['has'](_0x3e332d))throw new _0x50e9a5('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x3e332d});this['_getService'](_0x3e332d)['disconnect'](),this['_services']['delete'](_0x3e332d);}async['reconnect'](){for(const _0x3fdda0 of this['_services']['keys']())await this['_connectService'](_0x3fdda0);if(this['context']instanceof _0x313231){const _0x384ef3=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x384ef3)){const _0x5c71f7=this['context']['plugins']['get'](Y);_0x5c71f7['unregister'](_0x384ef3);const _0x47fadc=await this['_services']['get'](_0x384ef3)['getConnectedSessions']();_0x5c71f7['register'](_0x384ef3,_0x47fadc);}}}async['_connectService'](_0x560dbc){const {connection:_0x590bf6}=this['context']['plugins']['get'](z),_0x3c891d=this['context']['plugins']['get'](_0x57d3f8),_0x4b1df0=await this['_services']['get'](_0x560dbc)['connect'](_0x590bf6);await this['_fetchMissingUsersForThreads'](_0x4b1df0);const _0x27f09e=new Set(Array['from'](_0x3c891d['getCommentThreads']({'channelId':_0x560dbc}),_0x483f2d=>_0x483f2d['id']));for(const _0x2c2f2f of _0x4b1df0)_0x2c2f2f['deletedAt']||_0x27f09e['delete'](_0x2c2f2f['commentThreadId']);for(const _0x11b421 of _0x27f09e)_0x3c891d['getCommentThread'](_0x11b421)['remove']({'isFromAdapter':!0x0});for(const _0x48fd74 of _0x4b1df0){let _0x46aa93=_0x3c891d['getCommentThread'](_0x48fd74['commentThreadId']);const {commentThreadId:_0x69467b,context:_0x3f293a,attributes:_0x422e44,resolvedBy:_0x1c85da,resolvedAt:_0x337f4d,unlinkedAt:_0xe2db92,deletedAt:_0x182d79}=_0x48fd74;if(_0x182d79)continue;_0x46aa93||(_0x46aa93=_0x3c891d['addCommentThread']({'channelId':_0x560dbc,'threadId':_0x69467b,'context':_0x3f293a,'attributes':_0x422e44||{},'resolvedBy':_0x1c85da,'resolvedAt':_0x337f4d,'unlinkedAt':_0xe2db92,'isFromAdapter':!0x0}));const _0x4ab3ce=new Set(Array['from'](_0x46aa93['comments'],_0x338f71=>_0x338f71['id']));for(const _0x31011c of _0x48fd74['comments'])_0x4ab3ce['delete'](_0x31011c['commentId']);for(const _0x2a9b5c of _0x4ab3ce)_0x46aa93['getComment'](_0x2a9b5c)['remove']({'isFromAdapter':!0x0});for(const _0x2d3ba6 of _0x48fd74['comments']){const _0x6e805d=_0x46aa93['getComment'](_0x2d3ba6['commentId']);_0x6e805d?_0x6e805d['content']!==_0x2d3ba6['content']&&_0x6e805d['update']({'content':_0x2d3ba6['content'],'isFromAdapter':!0x0}):_0x46aa93['addComment'](Object['assign'](at(_0x2d3ba6),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5d053f){if(!this['_services']['has'](_0x5d053f))throw new _0x50e9a5('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5d053f});return this['_services']['get'](_0x5d053f);}async['_fetchMissingUsersForThreads'](_0x56db02){const _0x23d4b3=this['context']['plugins']['get'](_0xf7f8c7),{connection:_0x28bd0d}=this['context']['plugins']['get'](z),_0xfc9694=new Set();for(const {resolvedBy:_0x37a154,comments:_0x525ba3}of _0x56db02){_0x37a154&&!_0x23d4b3['getUser'](_0x37a154)&&_0xfc9694['add'](_0x37a154);for(const {userId:_0x3907c4}of _0x525ba3)_0x23d4b3['getUser'](_0x3907c4)||_0xfc9694['add'](_0x3907c4);}if(0x0===_0xfc9694['size'])return;const _0x1675e9=await _0x4ada42['getMany'](_0x28bd0d,Array['from'](_0xfc9694));for(const _0x1a17b2 of _0x1675e9)_0x23d4b3['getUser'](_0x1a17b2['id'])||_0x23d4b3['addUser'](_0x1a17b2);}};async function rt(_0xc1243d){if('404'!==_0xc1243d['code'])throw _0xc1243d;}function ct(_0x16c187){if((_0x1ed930=_0x16c187)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1ed930['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1ed930['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1ed930;throw _0x16c187;}function at(_0x483f7e){return{'threadId':_0x483f7e['commentThreadId'],'commentId':_0x483f7e['commentId'],'content':_0x483f7e['content'],'createdAt':_0x483f7e['createdAt'],'authorId':_0x483f7e['userId'],'attributes':_0x483f7e['attributes']||{}};}var ht=class CloudServicesTrackChangesAdapter extends _0x5f1cf5{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x4fa6f3)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[ot,_0x190ac6,z];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x161f22){super(_0x161f22);const _0x3cc9eb=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x3cc9eb);}['init'](){const _0xb44f2=this['editor']['plugins']['get'](z),_0x62e9c4=this['editor']['plugins']['get'](_0x190ac6);return _0x62e9c4['adapter']={'getSuggestion':async _0x5c51e7=>{await this['_waitForServiceReady']();const _0x518d79=await this['_trackChangesService']['get'](_0x5c51e7)['catch'](lt);return await this['_fetchMissingUsersForThreads']([_0x518d79]),_0x518d79;},'addSuggestion':async({id:_0x4a1afa,type:_0x81e06a,data:_0x5f173c,originalSuggestionId:_0x400c69,attributes:_0x1d8972})=>{await this['_waitForServiceReady']();const _0x53f6bf={'id':_0x4a1afa,'type':_0x81e06a,'data':_0x5f173c,'originalSuggestionId':_0x400c69,'attributes':_0x1d8972},_0x273241=await this['_trackChangesService']['add'](_0x4a1afa,_0x81e06a,_0x5f173c,_0x400c69,_0x1d8972)['catch'](_0x22fd80=>{if(dt(_0x22fd80))return new Promise(_0x2e4f2f=>{this['_bufferedRequests']['set'](_0x4a1afa,{'resolve':_0x2e4f2f,'suggestionData':_0x53f6bf});});throw _0x22fd80;});return this['_bufferedRequests']['delete'](_0x4a1afa),_0x273241;},'updateSuggestion':async(_0x3432ca,_0x119c21)=>{if(await this['_waitForServiceReady'](),'open'!==_0x119c21['state'])return this['_trackChangesService']['update'](_0x3432ca,_0x119c21)['catch'](lt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x33c694,_0x2fcb55)=>{_0x62e9c4['hasSuggestion'](_0x2fcb55['id'])&&(_0x62e9c4['getSuggestion'](_0x2fcb55['id'])['attributes']=_0x2fcb55['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0xb44f2['connection']?.['state']&&(_0xb44f2['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0xb44f2['connection'])['then'](_0x41be81=>(_0xb44f2['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x41be81)['then'](()=>{for(const _0x10f993 of _0x41be81){_0x62e9c4['addSuggestionData'](_0x10f993)['_saved']=!0x0;}})));}async['reconnect'](){const _0x64abce=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x4cbab1}=this['editor']['plugins']['get'](z),_0x362b5a=await this['_trackChangesService']['connect'](_0x4cbab1);await this['_fetchMissingUsersForThreads'](_0x362b5a);for(const {suggestionData:_0x53e571,resolve:_0x463dee}of this['_bufferedRequests']['values']()){let _0x1ea07f=_0x362b5a['find'](_0x10b38=>_0x10b38['id']===_0x53e571['id']);_0x1ea07f||(_0x1ea07f=await this['_trackChangesService']['add'](_0x53e571['id'],_0x53e571['type'],_0x53e571['data'],_0x53e571['originalSuggestionId'])),_0x463dee(_0x1ea07f);}for(const _0x3956e4 of _0x362b5a)_0x64abce['hasSuggestion'](_0x3956e4['id'])||_0x64abce['addSuggestionData'](_0x3956e4);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x36eaf8=>{this['listenTo'](this['_trackChangesService'],'connected',_0x508e31=>{_0x508e31['off'](),_0x36eaf8();});});}async['_fetchMissingUsersForThreads'](_0x10243b){const _0x5adca1=this['editor']['plugins']['get'](_0xf7f8c7),{connection:_0x402b5f}=this['editor']['plugins']['get'](z),_0x28a309=new Set();for(const {authorId:_0x52d541}of _0x10243b)_0x5adca1['getUser'](_0x52d541)||_0x28a309['add'](_0x52d541);if(0x0===_0x28a309['size'])return;const _0x18a6a7=await _0x4ada42['getMany'](_0x402b5f,Array['from'](_0x28a309));for(const _0x1bff3b of _0x18a6a7)_0x5adca1['getUser'](_0x1bff3b['id'])||_0x5adca1['addUser'](_0x1bff3b);}};function lt(_0x11d347){if(dt(_0x11d347))return new Promise(()=>{});throw _0x11d347;}function dt(_0x37ffd6){return _0x37ffd6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x37ffd6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var ut=class extends _0x5f1cf5{static get['requires'](){return[_0x49c2f5,ot,nt,z];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x19cbb1=this['editor']['plugins']['get'](z),_0x55ad88=this['editor']['plugins']['get'](_0x1afef8),_0x3e9338=this['editor']['plugins']['get'](ot);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x19cbb1,'change:state',(_0x209769,_0x4560c2,_0x5edbd5)=>{_0x55ad88['isThreadsLoadingPaused']='connected'!==_0x5edbd5;});}),this['listenTo'](_0x19cbb1,'change:state',(_0x229ebc,_0x6cd21f,_0x5872b0)=>{this['editor']['plugins']['get'](_0x57d3f8)['switchReadOnly']('connected'!==_0x5872b0);}),_0x3e9338['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){const _0x270c81=this['editor']['plugins']['get'](ot),_0x1b5389=this['editor']['config']['get']('collaboration.channelId');_0x270c81['_services']['has'](_0x1b5389)&&_0x270c81['_terminateService'](_0x1b5389),super['destroy']();}},ft=class extends _0x5f1cf5{static get['requires'](){return[ut,ht,_0x4adb42];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},mt=class CloudServicesRevisionHistoryAdapter extends _0x5f1cf5{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x33def3)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[z,tt,_0x4ca2bb,Y,_0xf7f8c7];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x27d0ea){super(_0x27d0ea);const _0x5b9ccf=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x5b9ccf);}async['init'](){const _0x32da28=this['editor']['plugins']['get'](tt),_0x327ebb=_0x32da28['serverHistory'],_0x2edb65=this['editor']['plugins']['get'](z);this['_revisionTracker']['setSource']({'history':_0x327ebb,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x32da28['sessionId']});const _0x218fba=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x41d6e0,_0x1c51ba=await _0x2e6152['isBundleUploaded'](_0x2edb65['connection'],_0x218fba);this['editor']['plugins']['get'](_0x4ca2bb)['adapter']={'getRevision':async({revisionId:_0x3d29fa})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3d29fa)),'updateRevisions':async _0x55aa37=>{await this['_waitForServiceReady']();const _0x1ffa18=this['_revisionTracker']['currentRevision'];if(_0x1c51ba&&0x1===_0x55aa37['length']&&_0x55aa37[0x0]['id']===_0x1ffa18['id'])return _0x55aa37;for(const _0x23a46b of _0x55aa37)_0x23a46b['id']===_0x1ffa18['id']&&(_0x23a46b['isEmptyCurrent']=_0x23a46b['fromVersion']===_0x23a46b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x55aa37,this['_lastRequestId'])['then'](_0x58e55d=>(this['_lastRequestId']=_0x58e55d,_0x55aa37))['catch'](_0x40e62d=>{if(pt(_0x40e62d)||'400'===_0x40e62d['code']&&void 0x0!==_0x40e62d['data']['wrongRequestId']){for(const _0x2fad60 of _0x55aa37)this['_revisionTracker']['repository']['getRevision'](_0x2fad60['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x2fad60['id'],_0x2fad60,!0x1);if(pt(_0x40e62d)&&'destroyed'!==this['editor']['state'])throw _0x40e62d;return _0x55aa37;}throw _0x40e62d;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1556b6,{revisionsData:_0x2bcd41,requestId:_0x531f57})=>{Math['max'](..._0x2bcd41['map'](_0xadac7e=>_0xadac7e['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2bcd41,_0x531f57);}):this['_handleRevisionsUpdate'](_0x2bcd41,_0x531f57);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x2edb65['connection']?.['state']&&(_0x2edb65['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x5d2d74,requestId:_0x1ccff7}=await this['_revisionHistoryService']['connect'](_0x2edb65['connection']);_0x2edb65['addToReconnectionStack'](this),this['_lastRequestId']=_0x1ccff7,await this['_fetchMissingUsers'](_0x5d2d74);for(const _0x4282cf of _0x5d2d74)this['_revisionTracker']['addRevisionData'](_0x4282cf);this['listenTo'](_0x32da28,'change:_isConnected',(_0xd8fc93,_0x52a5ec,_0x3458f9)=>{_0x3458f9&&(this['_oldOffset']=_0x32da28['_offset'],_0xd8fc93['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async['reconnect'](){const _0x4b65e1=this['editor']['plugins']['get'](z),_0x3b7775=this['editor']['plugins']['get'](tt),_0x3f8a4f=async()=>{const _0x4e399e=this['_revisionTracker']['currentRevision'],_0x4c851c=_0x4e399e['id'],_0x116445=_0x4c851c!==_0x3b7775['sessionId'];if(_0x116445){const _0x365bf6=_0x3b7775['_offset']-this['_oldOffset'],_0x934356=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x4e399e['toVersion']+_0x365bf6!==_0x934356){const _0x51f095=_0x4e399e['fromVersion']+_0x365bf6,_0xd6d73e=this['editor']['plugins']['get'](_0xf7f8c7),_0xbe8c5a=this['_revisionTracker']['buildRevisionData']({'revision':_0x4e399e,'from':_0x51f095,'to':_0x934356});_0xbe8c5a['id']=_0x4e399e['id'];const _0x390a94=_0xbe8c5a['authorsIds']['map'](_0x5ded80=>_0xd6d73e['getUser'](_0x5ded80));_0x4e399e['_update']({..._0xbe8c5a,'authors':_0x390a94},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4e399e['id'],_0xbe8c5a,!0x0);}this['_revisionTracker']['_startingVersion']=_0x934356,_0x4e399e['toVersion']!==_0x4e399e['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x4c851c)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x4c851c),this['_revisionTracker']['_createCurrentRevision'](_0x934356);}const {revisions:_0x113599,requestId:_0x26044d}=await this['_revisionHistoryService']['reconnect'](_0x4b65e1['connection'],this['_lastRequestId']);_0x116445&&_0x113599['length']>0x0?_0x3b7775['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x113599),this['_handleRevisionsUpdate'](_0x113599,_0x26044d),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3b7775['_isConnected']?_0x3f8a4f():new Promise((_0x295605,_0x105840)=>{_0x3b7775['once']('change:_isConnected',()=>{_0x3f8a4f()['then'](_0x295605)['catch'](_0x105840);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x2cfb29=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x31c213=>{_0x31c213['off'](),_0x2cfb29();});});}['_getLatestVersionFromServerOperations'](){const _0xc5be54=this['editor']['plugins']['get'](tt)['serverHistory']['getOperations']()['reverse']();for(const _0x472a6b of _0xc5be54)if('marker'!==_0x472a6b['type']||_0x472a6b['affectsData'])return _0x472a6b['baseVersion']+0x1;}['_getLatestVersion'](){const _0x138b0e=this['editor']['plugins']['get'](tt);return new Promise(_0x29fe4d=>{_0x138b0e['_isPendingUpdate']?_0x138b0e['once']('change:_isPendingUpdate',()=>{_0x29fe4d(this['_getLatestVersionFromServerOperations']());}):_0x29fe4d(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x99d967,_0x762f57){const _0x23aa5a=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x762f57;for(const _0x45b038 of _0x99d967){const _0x494d33=_0x23aa5a['getRevision'](_0x45b038['id']);if(_0x494d33){if((_0x45b038['fromVersion']||_0x45b038['toVersion'])&&(_0x45b038['diffData']=null),_0x494d33===this['_revisionTracker']['currentRevision']){const _0x59bc3c=Math['max'](_0x494d33['toVersion'],_0x45b038['toVersion']),_0x183c83=Math['max'](_0x494d33['fromVersion'],_0x45b038['fromVersion']);let _0x2491f8;_0x494d33['toVersion']===_0x45b038['toVersion']&&_0x494d33['fromVersion']===_0x45b038['fromVersion']?(_0x2491f8=!0x0,this['_preventResendingRevisionData'](_0x45b038)):_0x45b038['toVersion']===_0x59bc3c&&_0x45b038['fromVersion']===_0x183c83?_0x2491f8=!0x1:(_0x494d33['toVersion']===_0x59bc3c&&_0x494d33['fromVersion']===_0x183c83||this['_fixRevision']({'revision':_0x494d33,'from':_0x183c83,'to':_0x59bc3c}),_0x2491f8=!0x0),_0x2491f8&&(delete _0x45b038['fromVersion'],delete _0x45b038['toVersion'],delete _0x45b038['diffData'],delete _0x45b038['createdAt'],delete _0x45b038['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x45b038),this['_preventResendingRevisionData'](_0x45b038);}else this['_revisionTracker']['addRevisionData'](_0x45b038);}const _0x1c5f13=_0x23aa5a['getRevisions']();_0x1c5f13['reverse']();for(let _0x3082ef=0x0;_0x3082ef<_0x1c5f13['length']-0x1;_0x3082ef++){const _0xd403e1=_0x1c5f13[_0x3082ef],_0x327fa7=_0x1c5f13[_0x3082ef+0x1];if(_0xd403e1['fromVersion']<_0x327fa7['toVersion']){const _0x59c8c6=_0x327fa7['toVersion'],_0x3f4d5d=Math['max'](_0x59c8c6,_0xd403e1['toVersion']);this['_fixRevision']({'revision':_0xd403e1,'from':_0x59c8c6,'to':_0x3f4d5d});}}}['_fixRevision']({revision:_0x34a8fb,from:_0xae3a46,to:_0x5ca572}={}){const _0x2652d6=this['editor']['plugins']['get'](_0xf7f8c7),_0x299dac=this['_revisionTracker']['buildRevisionData']({'revision':_0x34a8fb,'from':_0xae3a46,'to':_0x5ca572});_0x299dac['authors']=_0x299dac['authorsIds']['map'](_0x2794a3=>_0x2652d6['getUser'](_0x2794a3)),_0x34a8fb['_update'](_0x299dac);}['_preventResendingRevisionData'](_0x376cd9){const _0x404c9d={};_0x404c9d['id']=_0x376cd9['id'];for(const _0x25384e of Object['keys'](_0x376cd9))'id'!==_0x25384e&&(_0x404c9d[_0x25384e]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x404c9d['id'],_0x404c9d,!0x0);}async['_fetchMissingUsers'](_0x3c1be1){const _0x4e25ed=this['editor']['plugins']['get'](_0xf7f8c7),{connection:_0x3a7cbd}=this['editor']['plugins']['get'](z),_0x28a657=new Set();for(const _0x332b8a of _0x3c1be1){for(const _0x5c6731 of _0x332b8a['authorsIds'])_0x5aaaea(_0x5c6731);_0x332b8a['creatorId']&&_0x5aaaea(_0x332b8a['creatorId']);}if(0x0===_0x28a657['size'])return;const _0x35b722=await _0x4ada42['getMany'](_0x3a7cbd,Array['from'](_0x28a657));for(const _0x1151da of _0x35b722)_0x4e25ed['getUser'](_0x1151da['id'])||_0x4e25ed['addUser'](_0x1151da);function _0x5aaaea(_0x7d151){_0x4e25ed['getUser'](_0x7d151)||_0x28a657['add'](_0x7d151);}}};function pt(_0x3d37ad){return _0x3d37ad['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x3d37ad['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3d37ad['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var gt=class extends _0x5f1cf5{static get['requires'](){return[_0x4ca2bb,mt,nt];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class extends _0x35c92d{['_collapseAt'];constructor(_0x1f02ab,_0x30edaa=0x6){super(_0x1f02ab);const _0x51f6b1=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x30edaa,this['bind']('isHidden')['to'](this,'usersCount',_0x5d2905=>_0x5d2905<_0x30edaa),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x51f6b1['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':_0x51f6b1['to']('usersCount',_0x5e17df=>'+'+(_0x5e17df-this['_collapseAt']+0x2)['toString']())}]}]}]});}},vt=class extends _0x35c92d{['items'];['keystrokes'];constructor(_0x34357d){super(_0x34357d);const _0x566737=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x20ead0(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x566737['if']('hasPopup'),'aria-expanded':_0x566737['to']('isExpanded',_0x4a373b=>this['hasPopup']&&String(_0x4a373b)),'aria-label':_0x566737['to']('hasPopup',_0x2852a9=>X(_0x34357d,_0x2852a9?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x566737['to']('hasPopup',_0x180bd7=>!!_0x180bd7&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x566737['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x566737['to'](_0x4a0c72=>{const _0x31f017=_0x4a0c72,_0x2b2f30=document['querySelector']('.ck-presence-list__dropdown-list'),_0xf96a07=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2b2f30?.['contains'](_0x31f017['relatedTarget'])||_0xf96a07?.['contains'](_0x31f017['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x5db2db,_0x45fa57,_0x1215d0)=>{this['element']&&(_0x1215d0?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']);}},_t=class extends _0x35c92d{['counterView'];['inlineListView'];constructor(_0x417059,_0x5ac504=0x6){super(_0x417059);const _0x47cbc5=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new wt(this['locale'],_0x5ac504),this['inlineListView']=new vt(_0x417059),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x359500 of this['inlineListView']['items'])_0x359500['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',_0x47cbc5['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},yt=class extends _0x35c92d{['listWrapperView'];constructor(_0x2dcb2e,_0x52267a){super(_0x2dcb2e);const _0x5ae619=this['bindTemplate'];this['listWrapperView']=new bt(_0x2dcb2e,_0x52267a),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':X(_0x2dcb2e,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5ae619['to'](_0xf93d1e=>{const _0x310f6a=_0xf93d1e,_0x1ba94e=document['querySelector']('.ck-presence-list__list'),_0x52ff9a=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1ba94e?.['contains'](_0x310f6a['relatedTarget'])||_0x52ff9a?.['contains'](_0x310f6a['relatedTarget'])||this['fire']('presencelist:hide');})}});}},bt=class extends _0x25af46{constructor(_0x3f2a32,_0x242e48){super(_0x3f2a32);const _0x31b549=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x242e48?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x31b549['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x31b549['to']('role'),'aria-label':_0x31b549['to']('ariaLabel'),'aria-labelledby':_0x31b549['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x439457['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3e35c1=this['element'];_0x3e35c1&&(this['_isScrollable']=Math['max'](_0x3e35c1['scrollHeight'],_0x3e35c1['clientHeight'])>0.8*window['innerHeight']);}},kt=class extends _0x53e056{['userView'];constructor(_0x47241b,_0x9c1646,_0xbaa427){super(_0x47241b);const _0x3d138e=this['bindTemplate'];this['userView']=new _0x5945f1(_0x47241b,_0x9c1646);const _0x2291f0={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x9c1646['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x9c1646['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x9c1646['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x9c1646['color']['getColorVariable'](),'--ck-user-color-alpha':_0x9c1646['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0xbaa427&&(_0x2291f0['tag']='button',_0x2291f0['on']={'click':_0x3d138e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2291f0);}['focus'](){this['element']['focus']();}},It=class extends _0x35c92d{['userView'];['markerView'];constructor(_0x428af2,_0x565cb0,_0xc26cfe){super(_0x428af2);const _0x331928=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x5945f1(_0x428af2,_0x565cb0),this['markerView']=new St(_0x428af2,_0x565cb0);const _0x253f06=new _0x1d152c(_0x428af2);_0x253f06['template']['tag']='span',_0x253f06['text']=_0x565cb0['name'];const _0x257ee8={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x331928['to']('isFocusable',_0x2f930e=>!!_0x2f930e&&0x0),'aria-labelledby':_0x253f06['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x331928['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x331928['to']('hasTooltip',_0x4570b8=>!_0x4570b8),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x253f06]};_0xc26cfe&&(_0x257ee8['tag']='button',_0x257ee8['on']={'click':_0x331928['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x257ee8);}},St=class extends _0x35c92d{constructor(_0x10ec70,_0x1b1018){super(_0x10ec70),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1b1018['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x1b1018['color']['getColorVariable'](),'--ck-user-color-alpha':_0x1b1018['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Tt={'collapseAt':0x6,'displayMe':!0x0};var Ct=class extends _0x221616{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5544e2){super(_0x5544e2),this['context']['config']['define']('presenceList',Tt);const _0x212047=_0x5544e2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x212047)throw new _0x50e9a5('presencelist-collapseat-invalid-format',this);if(_0x212047<0x1)throw new _0x50e9a5('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Y)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x33f44f(),this['balloonPanelView']=new _0x10bbaa(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[Y];}['init'](){for(const _0x5bb5d1 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5bb5d1);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1ec0f3,_0x356467)=>{this['_handleUserAdd'](_0x356467);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5b955d,_0x2be381)=>{this['_handleUserRemove'](_0x2be381);});}['_createView'](){const _0x4200b7=this['context'],_0x35e085=new _t(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3b9b5b=this['balloonPanelView'];if(!_0x551d97(_0x4200b7['config']['get']('presenceList.container')))throw new _0x50e9a5('presencelist-missing-container',this);return _0x35e085['counterView']['bind']('usersCount')['to'](this),_0x35e085['bind']('isCollapsed')['to'](this,'usersCount',_0x57d2b7=>{const {collapseAt:_0x1222ae}=_0x4200b7['config']['get']('presenceList'),_0xff04e8=_0x57d2b7>=_0x1222ae;if(_0xff04e8&&!_0x35e085['inlineListView']['items']['find'](_0x19fe8f=>_0x19fe8f instanceof wt)){const _0x331590=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x331590&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x35e085['inlineListView']['items']['add'](_0x35e085['counterView']);}return _0xff04e8||this['hideDropdown'](),_0xff04e8;}),_0x35e085['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x2dcc42=>{const _0x598c9e=_0x4200b7['config']['get']('presenceList'),_0x40ec76=new It(_0x4200b7['locale'],_0x2dcc42,!!_0x598c9e['onClick']);return _0x40ec76['bind']('hasTooltip')['to'](_0x35e085,'isCollapsed',_0x115bca=>!_0x115bca),_0x40ec76['bind']('isFocusable')['to'](_0x35e085,'isCollapsed',_0x389670=>!_0x389670),_0x598c9e['onClick']&&this['listenTo'](_0x40ec76,'execute',()=>{this['view']['isCollapsed']||_0x598c9e['onClick'](_0x2dcc42,_0x40ec76['element']);}),_0x40ec76;}),this['listenTo'](_0x35e085['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x35e085['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x35e085['inlineListView']['keystrokes']['set']('Enter',(_0x443b62,_0x4fa083)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4fa083());}),_0x35e085['render'](),_0x3b9b5b['render'](),_0x78d497({'emitter':_0x35e085,'activator':()=>_0x3b9b5b['isVisible'],'contextElements':[_0x3b9b5b['element'],_0x35e085['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4200b7['config']['get']('presenceList.container')['appendChild'](_0x35e085['element']),this['_bodyCollection']=new _0x1807ae(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x35e085;}['_handleUserAdd'](_0xa1933d){if(!this['context']['config']['get']('presenceList.displayMe')&&_0xa1933d['isMe'])return;const _0x2e78ad=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2e78ad-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4d74eb=_0xa1933d['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0xa1933d,_0x4d74eb);}['_handleUserRemove'](_0x572336){this['usersCount']--;const {collapseAt:_0x2fe713}=this['context']['config']['get']('presenceList'),_0x42548a=this['usersCount']>=_0x2fe713;if(this['currentDisplayedUsers']['get'](_0x572336['id']))this['currentDisplayedUsers']['remove'](_0x572336['id']);else{if(_0x42548a&&this['currentDisplayedUsers']['length']+0x1===_0x2fe713-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x42548a?0x1:0x0)<this['usersCount']){for(const _0x32137d of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x32137d['id'])&&(this['currentDisplayedUsers']['add'](_0x32137d,Math['min'](this['currentDisplayedUsers']['length']-(_0x42548a?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x42548a?0x1:0x0)===_0x2fe713-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x54c51d=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new yt(this['context']['locale'],!!_0x54c51d['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x503a2f}=this['presenceDropdownView'];_0x503a2f['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x15910a=>{if(!_0x54c51d['displayMe']&&_0x15910a['isMe'])return null;const _0x493f90=new kt(this['context']['locale'],_0x15910a,!!_0x54c51d['onClick']);return _0x54c51d['onClick']&&this['listenTo'](_0x493f90,'execute',()=>{_0x54c51d['onClick'](_0x15910a,_0x493f90['element']);}),_0x493f90;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x503a2f['focus'](),_0x503a2f['checkIfScrollable']();const _0x48f26c=(_0x2bcd0d,_0x2ef39a)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2ef39a();};_0x503a2f['keystrokes']['set']('Esc',_0x48f26c),_0x503a2f['keystrokes']['set']('Shift+Tab',_0x48f26c),_0x503a2f['keystrokes']['set']('Tab',(_0x15f5ef,_0x319e8c)=>{!function(_0x33a726){const _0x2b0d99=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xe23347=>_0xe23347+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x13516f=[...document['body']['querySelectorAll'](_0x2b0d99)]['filter'](_0x4a5605=>_0x4a5605===document['activeElement']||_0x4a5605['offsetWidth']+_0x4a5605['offsetHeight']>0x0)['sort']((_0x5b39a9,_0x5a7410)=>(_0x5b39a9['tabIndex']||0x0)-(_0x5a7410['tabIndex']||0x0)),_0x79d748=_0x13516f[(_0x13516f['indexOf'](_0x33a726)+0x1)%_0x13516f['length']];_0x79d748&&_0x79d748['focus']();}(this['view']['element']),this['hideDropdown'](),_0x319e8c();}),_0x503a2f['focusTracker']['add'](this['view']['element']),_0x503a2f['focusTracker']['on']('change:isFocused',(_0x4b5f48,_0x17474a,_0x5b1ad2)=>{_0x5b1ad2||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}},At=class extends _0x221616{static get['requires'](){return[Y,Ct];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ot as CloudServicesCommentsAdapter,mt as CloudServicesRevisionHistoryAdapter,ht as CloudServicesTrackChangesAdapter,At as PresenceList,Ct as PresenceListUI,tt as RealTimeCollaborationClient,ut as RealTimeCollaborativeComments,nt as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,Y as Sessions,z as WebSocketGateway};