@ckeditor/ckeditor5-real-time-collaboration 46.0.0 → 46.0.1-alpha.1

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 (171) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.d.ts +0 -2
  152. package/src/index.js +1 -1
  153. package/src/presencelist/presencelistui.js +1 -1
  154. package/src/presencelist/view/presencecounterview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  156. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  158. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  159. package/src/presencelist/view/presencelistview.js +1 -1
  160. package/src/presencelist.js +1 -1
  161. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  162. package/src/realtimecollaborativecomments.js +1 -1
  163. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  164. package/src/realtimecollaborativeediting/sessions.js +1 -1
  165. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  166. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  167. package/src/realtimecollaborativeediting.js +1 -1
  168. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  169. package/src/realtimecollaborativerevisionhistory.js +1 -1
  170. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  171. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x5eed8d,Plugin as _0x510f18,PendingActions as _0x4d5129,Context as _0x1af3e4}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x288921,CKEditorError as _0x48b1a1,Collection as _0x59ff4d,global as _0x56f01e,version as nt,uid as _0x44ba32,KeystrokeHandler as _0x215b9f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4461e4,View as _0x595b19,ListView as _0x45cb04,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x4d7726,clickOutsideHandler as _0x57079e,BodyCollection as _0x4dede1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x21de7c,History as _0x17ce57,NoOperation as _0x1b9ec1,InsertOperation as _0x992cc3,MarkerOperation as _0x2059d2,RootAttributeOperation as _0x17026d,transformOperationSets as _0x4454b5,OperationFactory as _0x4147ed}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x2cce8e,User as lt,CommentsService as _0xb35a39,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x19feea,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x5f2273}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x349322}from'es-toolkit/compat';class n extends _0x5eed8d{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4461e4];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x111d5a){super(_0x111d5a),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x288921())();}['init'](){const _0x2f67eb=this['context'],_0xce8d9c=_0x2f67eb['plugins']['get']('CloudServices'),_0x15d97f=_0x2f67eb['plugins']['get'](_0x4461e4);if(!_0xce8d9c['token'])throw new _0x48b1a1('websocketgateway-missing-token',this);if(!_0xce8d9c['webSocketUrl'])throw new _0x48b1a1('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),n['WebSocketGateway']['connect'](_0xce8d9c['token'],_0xce8d9c['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4fd3aa=>{if(this['connection']=_0x4fd3aa,this['bind']('state')['to'](_0x4fd3aa,'state',this,'_isBrowserOffline',(_0x46573b,_0x4109dc)=>('connected'!==_0x46573b&&(this['_shouldPluginsReconnect']=!0x0),_0x4109dc||_0x46573b!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x4fcf6c,_0x58cc8d)=>{if('limitExceeded'!==_0x58cc8d['code'])throw console['error'](_0x58cc8d),new _0x48b1a1('cloudservices-init',null,{'originalError':_0x58cc8d});_0x15d97f['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'});}),!_0x4fd3aa['me'])return new Promise(_0x18d2fb=>_0x4fd3aa['on']('change:me',_0x18d2fb));})['catch'](_0x35339f=>{throw console['error'](_0x35339f),new _0x48b1a1('cloudservices-init',null,{'originalError':_0x35339f});});}['addToReconnectionStack'](_0x32bd79){if('function'!=typeof _0x32bd79['reconnect'])throw new _0x48b1a1('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x32bd79))throw new _0x48b1a1('websocketgateway-plugin-already-registered',this,{'name':_0x32bd79['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x32bd79);}['removeFromReconnectionStack'](_0x4249ff){this['_reconnectionStack']['delete'](_0x4249ff);}['isInReconnectionStack'](_0x116a25){return this['_reconnectionStack']['has'](_0x116a25);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0xe081b4=>_0xe081b4['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0xc9c216=>{throw console['error'](_0xc9c216),new _0x48b1a1('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x5eed8d{['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[n,_0x19feea];}constructor(_0x4822be){super(_0x4822be),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x59ff4d(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x19feea);}['init'](){const _0x5c9282=this['context']['plugins']['get'](n);this['listenTo'](_0x5c9282,'change:state',(_0x45a36d,_0x24e80a,_0x4ed265)=>{if('connected'!==_0x4ed265)this['channelSessions']['forEach'](_0x49c038=>_0x49c038['clear']()),this['channelConnectedUsers']['forEach'](_0x4a52e0=>_0x4a52e0['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3fce8d,_0x58735e]of this['_registeredSessions'])for(const _0x48948e of _0x58735e)this['_handleSessionAdd'](_0x3fce8d,_0x48948e);}}),this['_createUser'](_0x5c9282['connection']['me'],!0x0);}['register'](_0x26f788,_0x5426d6){if(this['_registeredSessions']['has'](_0x26f788))throw new _0x48b1a1('sessions-register-already-registered',null,{'channelId':_0x26f788});this['_registeredSessions']['set'](_0x26f788,_0x5426d6),this['channelSessions']['set'](_0x26f788,new _0x59ff4d()),this['channelConnectedUsers']['set'](_0x26f788,new _0x59ff4d()),this['listenTo'](_0x5426d6,'add',(_0xa2b463,_0x383897)=>this['_handleSessionAdd'](_0x26f788,_0x383897)),this['listenTo'](_0x5426d6,'remove',(_0x533d5a,_0x1e3401)=>this['_handleSessionRemove'](_0x26f788,_0x1e3401));for(const _0xe6cd7 of _0x5426d6)this['_handleSessionAdd'](_0x26f788,_0xe6cd7);}['unregister'](_0x1516a9){if(!this['_registeredSessions']['has'](_0x1516a9))throw new _0x48b1a1('sessions-unregister-not-exist',null,{'channelId':_0x1516a9});const _0x3623a6=this['_registeredSessions']['get'](_0x1516a9);this['stopListening'](_0x3623a6);for(const _0x4fa7a1 of _0x3623a6)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x1516a9,_0x4fa7a1);this['_registeredSessions']['delete'](_0x1516a9),this['channelSessions']['delete'](_0x1516a9),this['channelConnectedUsers']['delete'](_0x1516a9);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0xe11361){for(const _0x2f5474 of this['channelSessions']['values']())for(const _0x5ee193 of _0x2f5474)if(_0x5ee193['id']===_0xe11361)return _0x5ee193['user'];}['getUserSessions'](_0x582716,_0x33171d){const _0x2667c5=_0x33171d?[this['channelSessions']['get'](_0x33171d)]:this['channelSessions']['values'](),_0x57b5bc=new Set();for(const _0x1db4f6 of _0x2667c5)for(const _0x58f270 of _0x1db4f6)_0x58f270['user']['id']===_0x582716['id']&&_0x57b5bc['add'](_0x58f270['id']);return _0x57b5bc;}['getUserRole'](_0x59ba5c){for(const _0x5409f2 of this['channelSessions']['values']())for(const _0x1244a5 of _0x5409f2)if(_0x1244a5['user']===_0x59ba5c)return _0x1244a5['role'];}['_handleSessionAdd'](_0x4ae776,_0x1b5c6e){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x472b29=_0x1b5c6e['user'],_0x4728cb=this['_users']['getUser'](_0x472b29['id'])||this['_createUser'](_0x472b29),_0x13f35d=Object['assign']({},_0x1b5c6e,{'user':_0x4728cb});this['channelSessions']['get'](_0x4ae776)['add'](_0x13f35d);const _0x291350=this['channelConnectedUsers']['get'](_0x4ae776);_0x291350['has'](_0x4728cb['id'])||_0x291350['add'](_0x4728cb),this['allConnectedUsers']['has'](_0x4728cb['id'])||this['allConnectedUsers']['add'](_0x4728cb,_0x4728cb['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4ae776,{'channelId':_0x4ae776,'session':_0x13f35d});}['_handleSessionRemove'](_0x3b55de,_0x476548){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3b549d=this['channelConnectedUsers']['get'](_0x3b55de),_0x50c579=_0x476548['user'];_0x50c579['id']&&(this['channelSessions']['get'](_0x3b55de)['remove'](_0x476548['id']),_0x3b549d['has'](_0x50c579['id'])&&!this['getUserSessions'](_0x50c579,_0x3b55de)['size']&&_0x3b549d['remove'](_0x50c579['id']),this['allConnectedUsers']['get'](_0x50c579['id'])&&!this['getUserSessions'](_0x50c579)['size']&&this['allConnectedUsers']['remove'](_0x50c579['id']));}['_createUser'](_0x155c91,_0x158e0a){const _0x4db1a5=this['_users']['addUser'](_0x155c91);return _0x158e0a&&this['_users']['defineMe'](_0x155c91['id']),_0x4db1a5['orderNumber']=this['_uniqueUsersCount']++,_0x4db1a5;}}class V extends _0x510f18{['_domEmitter']=new(_0x288921())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x549ade=this['editor'],_0x5334d8=_0x549ade['plugins']['get'](i);_0x549ade['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5b8573,{writer:_0x37f85a})=>function(_0xabc88d,_0x41e7cc,_0x515754,_0x28c393){const _0x1a8d80=_0xabc88d['markerName']['split'](':')[0x2],_0x385d0f=_0x515754['getUserBySessionId'](_0x1a8d80);if(!_0x385d0f||_0x1a8d80===_0x515754['mySessionId'])return;if(!_0x28c393['model']['schema']['checkChild'](_0xabc88d['markerRange']['start'],'$text'))return;const _0x31e670={'class':'ck-user__marker\x20'+_0x385d0f['color']['getMarkerClass'](),'data-name':_0x385d0f['name'],'data-session-id':_0x1a8d80},_0x4bbf02=_0x28c393['model']['markers']['get'](_0xabc88d['markerName']),_0xcd5f0a=_0x4bbf02['getStart'](),_0x7c1803=_0xcd5f0a['nodeAfter'],_0x5acc88=_0x28c393['model']['schema'];if(_0x7c1803&&_0x5acc88['isObject'](_0x7c1803)&&_0x5acc88['isInline'](_0x7c1803)&&!_0x28c393['model']['markers']['get']('user:range:'+_0x1a8d80)['getRange']()['isCollapsed'])return;const _0x38cfe6=_0xcd5f0a['parent'];return _0x28c393['model']['schema']['isLimit'](_0x38cfe6)&&!_0x28c393['model']['hasContent'](_0x38cfe6)&&(_0x31e670['contenteditable']=!0x1),function(_0x123b39,_0x38e1f3,_0x4db31e){const _0x2431c6=_0x123b39['createUIElement']('span',_0x38e1f3);return _0x123b39['setCustomProperty']('userPositionMarker',!0x0,_0x2431c6),_0x2431c6['render']=function(_0x35edb2){const _0x4fd258=this['toDomElement'](_0x35edb2),_0x3df933=document['createElement']('span');return _0x3df933['classList']['add']('ck-user__marker-tooltip'),_0x3df933['setAttribute']('contenteditable','false'),_0x3df933['setAttribute']('spellcheck','false'),_0x3df933['textContent']=_0x4db31e['name'],_0x4fd258['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3df933['outerHTML']+'⁠',_0x4fd258['addEventListener']('mouseenter',()=>{_0x4fd258['classList']['add']('ck-user__marker_hovered');}),_0x4fd258['addEventListener']('mouseleave',()=>{_0x4fd258['classList']['remove']('ck-user__marker_hovered');}),_0x4fd258;},_0x2431c6['isSimilar']=function(_0x11b3bf){return!(!this['getCustomProperty']('userPositionMarker')||!_0x11b3bf['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x11b3bf['getAttribute']('data-session-id'));},_0x2431c6;}(_0x41e7cc,_0x31e670,_0x385d0f);}(_0x5b8573,_0x37f85a,_0x5334d8,_0x549ade)}),_0x549ade['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1bfd71=>function(_0x1d1758,_0x3cdaa4){const _0x4a0705=_0x1d1758['markerName']['split'](':')[0x2];if(_0x4a0705===_0x3cdaa4['mySessionId'])return null;const _0x300c6a=_0x3cdaa4['getUserBySessionId'](_0x4a0705);if(!_0x300c6a)return{'id':_0x4a0705,'classes':[]};return{'id':_0x4a0705,'classes':['ck-user__selection',_0x300c6a['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x4a0705},'priority':0x7d0+_0x300c6a['orderNumber']};}(_0x1bfd71,_0x5334d8)}),function(_0x318a3a){const _0x36903f=_0x318a3a['model'],_0x57e2c9=new Map(),_0x5b34c0=_0x318a3a['plugins']['get'](i);_0x36903f['markers']['on']('update:user:range',(_0x38efbc,_0x364585,_0x289bda,_0x5318e7)=>{if(!_0x5318e7&&_0x57e2c9['get'](_0x364585['name']))return _0x57e2c9['get'](_0x364585['name'])['detach'](),void _0x57e2c9['delete'](_0x364585['name']);const _0x31e7a0=_0x364585['name']['split'](':')[0x2];if(_0x31e7a0===_0x5b34c0['mySessionId'])return;const _0x4ac448='user:position:'+_0x31e7a0;_0x36903f['markers']['has'](_0x4ac448)&&_0x318a3a['editing']['reconvertMarker'](_0x4ac448),_0x364585['on']('change:range',(_0x5ed32f,_0x1dbb0c,_0xa9491a)=>{if('$graveyard'!=_0x1dbb0c['root']['rootName']&&'$graveyard'==_0x364585['getRange']()['root']['rootName']&&!_0x57e2c9['has'](_0x364585['name'])){const _0x54c818=_0x36903f['schema']['getNearestSelectionRange'](_0xa9491a['deletionPosition']);if(_0x54c818){const _0x49d297=_0x21de7c['fromRange'](_0x54c818);_0x57e2c9['set'](_0x364585['name'],_0x49d297),_0x49d297['on']('change:range',(_0x267191,_0x393ea9,_0x59062f)=>{if('$graveyard'==_0x49d297['root']['rootName']){const _0x2d2d25=_0x36903f['schema']['getNearestSelectionRange'](_0x59062f['deletionPosition']);_0x2d2d25?(_0x49d297['start']=_0x2d2d25['start'],_0x49d297['end']=_0x2d2d25['end']):(_0x57e2c9['delete'](_0x364585['name']),_0x49d297['detach']());}});}}});}),_0x36903f['document']['on']('change',()=>{_0x57e2c9['size']>0x0&&_0x36903f['enqueueChange']({'isUndoable':!0x1},_0x151fd0=>{for(const [_0x26b24a,_0x3a998c]of _0x57e2c9)'$graveyard'==_0x36903f['markers']['get'](_0x26b24a)['getRange']()['root']['rootName']&&(Z(_0x26b24a['split'](':')[0x2],_0x3a998c['toRange'](),_0x36903f,_0x151fd0),_0x3a998c['detach']());_0x57e2c9['clear']();});});}(_0x549ade),this['_domEmitter']['listenTo'](_0x56f01e['document'],'keydown',(_0xe29900,{key:_0x336c00})=>{'Escape'===_0x336c00&&function(_0x599749){_0x599749['editing']['view']['change'](_0x33d76a=>{for(const _0x60e92b of _0x599749['model']['markers']){if(!_0x60e92b['name']['startsWith']('user:position'))continue;const _0x29f5d0=_0x599749['editing']['mapper']['markerNameToElements'](_0x60e92b['name']);if(_0x29f5d0){for(const _0x5ae3e6 of _0x29f5d0)_0x33d76a['removeClass']('ck-user__marker_hovered',_0x5ae3e6);}}});}(_0x549ade);},{'useCapture':!0x0});}['afterInit'](){const _0x108c46=this['editor'],_0x52060a=_0x108c46['commands']['get']('undo');_0x52060a&&_0x108c46['model']['on']('applyOperation',(_0x350e9b,_0x2fbaab)=>{const _0x43caf2=_0x2fbaab[0x0];if(!_0x43caf2['isDocumentOperation'])return;if('marker'!=_0x43caf2['type']||!_0x43caf2['name']['startsWith']('user:'))return;const _0x1d266d=_0x43caf2['batch'];_0x52060a['_createdBatches']['has'](_0x1d266d)&&(_0x43caf2['newRange']=_0x43caf2['oldRange']?_0x108c46['model']['createRange'](_0x43caf2['oldRange']['start'],_0x43caf2['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x385011=this['editor'],_0x3237d9=_0x385011['model']['document'],_0x246e7b=_0x385011['plugins']['get'](i);_0x385011['model']['enqueueChange']({'isUndoable':!0x1},_0x3ed68b=>{const _0x136cee='user:range:'+_0x246e7b['mySessionId'],_0x588ecf='user:position:'+_0x246e7b['mySessionId'],_0x45902e=_0x385011['model']['markers']['has'](_0x136cee);_0x385011['editing']['view']['hasDomSelection']?Z(_0x246e7b['mySessionId'],_0x3237d9['selection']['getFirstRange'](),_0x385011['model'],_0x3ed68b):_0x45902e&&(_0x3ed68b['removeMarker'](_0x136cee),_0x3ed68b['removeMarker'](_0x588ecf));});}}function Z(_0x5138cd,_0x341b1a,_0x29b1be,_0x2b92b5){const _0x371984='user:range:'+_0x5138cd,_0x4ef213='user:position:'+_0x5138cd,_0x4d87b6=_0x341b1a['getContainedElement']();let _0x13a2fd=_0x341b1a['start'];if(_0x4d87b6&&_0x4d87b6['is']('element','tableCell')){const _0x50714e=function(_0x187c44,_0x4f73ef){for(const _0x45e60c of _0x187c44['getPositions']())if(_0x4f73ef['schema']['checkChild'](_0x45e60c,'$text'))return _0x45e60c;}(_0x341b1a,_0x29b1be);_0x50714e&&(_0x13a2fd=_0x50714e,_0x341b1a=_0x2b92b5['createRange'](_0x13a2fd));}const _0xeb8376=_0x2b92b5['createRange'](_0x13a2fd);_0x29b1be['markers']['has'](_0x371984)?(_0x2b92b5['updateMarker'](_0x371984,{'range':_0x341b1a}),_0x2b92b5['updateMarker'](_0x4ef213,{'range':_0xeb8376})):(_0x2b92b5['addMarker'](_0x371984,{'range':_0x341b1a,'usingOperation':!0x0}),_0x2b92b5['addMarker'](_0x4ef213,{'range':_0xeb8376,'usingOperation':!0x0}));}function W(_0x2cc422,_0x57324e,_0x13b0ca){const _0x49c39c=_0x2cc422['t'],t=_0x2cc422['t'];switch(_0x57324e){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 _0x49c39c({'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'},_0x13b0ca);default:return'';}}let G=0x1;class l extends _0x510f18{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x2cce8e)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,V,_0x4d5129,_0x19feea,_0x4461e4];}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 _0x38633c=this['serverHistory']['getOperations']();for(let _0x1fc218=_0x38633c['length']-0x1;_0x1fc218>=0x0;_0x1fc218--){const _0x56eace=_0x38633c[_0x1fc218];if(!this['_disconnectionOperations']['has'](_0x56eace))return _0x56eace['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x44e18e){if(super(_0x44e18e),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x17ce57(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x48b1a1('collaboration-missing-channelid',this);const _0x38c7a5=_0x44e18e['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x38c7a5,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x5f2273(),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 J(this['_disconnectionOperations']);}['init'](){const _0x401f22=this['editor'],_0x28256e=_0x401f22['plugins']['get'](_0x19feea),_0x18b930=_0x401f22['plugins']['get'](n);this['listenTo'](_0x28256e,'getOperationAuthor',(_0x2e646a,_0x4fe477)=>{const _0x155a75=_0x4fe477[0x0];_0x155a75['_authorId']&&(_0x2e646a['return']=_0x28256e['getUser'](_0x155a75['_authorId']),_0x2e646a['stop']()),null===_0x155a75['_authorId']&&(_0x2e646a['return']=null,_0x2e646a['stop']());},{'priority':'high'}),this['listenTo'](_0x401f22['model']['document']['selection'],'change:range',(_0x128a61,_0x2e8592)=>{_0x2e8592['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x401f22['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x401f22['model']['on']('applyOperation',(_0x62ffb3,_0x4c2807)=>{const _0x5c0b2b=_0x4c2807[0x0];_0x5c0b2b['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5c0b2b),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x18b930,'state',this,'_hasSynchronizationProblem',(_0x35d230,_0x388973)=>'connected'===_0x35d230&&!_0x388973),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x401f22['disableReadOnlyMode']('rtc-offline'):_0x401f22['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x401f22['disableReadOnlyMode']('rtc-offline'):_0x401f22['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4ff9a9=this['editor']['plugins']['get'](i),_0x3928e1=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4ff9a9['unregister'](this['_channelId']);const _0x2e69e3=await this['_service']['reconnect'](_0x3928e1['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x2e69e3)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4c8155=await this['_service']['getConnectedSessions']();_0x4ff9a9['register'](this['_channelId'],_0x4c8155),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4992c2){if(function(_0x1c0602){return'404'===_0x1c0602['code'];}(_0x4992c2)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5a0ba6){return'409'===_0x5a0ba6['code'];}(_0x4992c2)){const _0x2cc585=W(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'](_0x2cc585);}else{if(!(_0x4992c2 instanceof $))throw _0x4992c2;this['_handleReconnectionError']();}}}}['destroy'](){const _0x158980=this['editor']['plugins']['get'](n),_0xe9398=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0xe9398['channelSessions']['has'](this['_channelId'])&&_0xe9398['unregister'](this['_channelId']),_0x158980['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x243633){if(this['sessionId']!==_0x243633['sessionId']&&this['_lastSyncedOperationId']!==_0x243633['lastOperationId'])throw new $();return this['sessionId']=_0x243633['sessionId'],this['_handleServerResponse']([],{..._0x243633,'wereChangesApplied':!0x1,'data':_0x243633['data']},'reconnect');}async['_connectService'](_0x5cf94b,_0x11d52a=!0x1){const {connection:_0x23c139}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x23c139,this['_channelId'])['then'](_0x451068=>this['_initSessionsHandling'](_0x451068))['catch'](_0x42b4f9=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x42b4f9);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4b8b1d,_0x47d1e4)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x47d1e4);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x1a232a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5cf94b);this['_isPendingUpdate']=!0x0;const _0x160cbc=await this['_service']['connect'](_0x23c139,this['_compressOperations'](_0x5cf94b),_0x1a232a);if(this['sessionId']=_0x160cbc['sessionId'],_0x11d52a){if(!_0x160cbc['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x160cbc['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5cf94b,_0x160cbc,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x160cbc,_0x5cf94b);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x181d25=this['editor']['plugins']['get'](i),_0x5e7663=this['editor']['plugins']['get'](V),_0x117633=_0x181d25['channelSessions']['get'](this['_channelId']);_0x117633&&_0x117633['length']>0x1?_0x5e7663['createUserMarkerOperations']():this['listenTo'](_0x181d25,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x181d25['channelSessions']['get'](this['_channelId'])['length']&&_0x5e7663['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x54e55d,_0x562008,_0x2d4483,_0x3459df){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x562008){const _0x56be20=this['_decompressOperations'](_0x2d4483,_0x3459df);await this['_fetchMissingUsers'](_0x56be20),this['_handleExternalOperations'](_0x56be20,_0x562008,_0x2d4483['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x53ccac}=this['editor'];let _0x1e3409;try{_0x1e3409=await this['_service']['getDocumentDetails']();}catch{const _0x3fac89=W(_0x53ccac,'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'](_0x3fac89);}const _0x547484=_0x1e3409['currentDocumentSession']||_0x1e3409['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x547484['lastOperationId']){const _0x519849=W(_0x53ccac,'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'](_0x519849);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xdd2ef7){const _0x2e250a=this['editor']['plugins']['get'](i);this['listenTo'](_0x2e250a,'sessionAdd:'+this['_channelId'],(_0x29b5a9,{session:_0x1c19ad})=>{if(_0x1c19ad['id']===_0x2e250a['mySessionId']){_0x29b5a9['off']();const _0x272fff=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3bcdee=_0x1c19ad['permissions'];_0x272fff&&_0x272fff['isEnabled']&&(_0x3bcdee=_0x3bcdee['filter'](_0x5124af=>'document:write'!==_0x5124af)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3bcdee,this['_channelId']);}}),_0x2e250a['register'](this['_channelId'],_0xdd2ef7);}['_initThrowingOnDataSet'](){const _0x44dc8f=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1310f3)=>{if(!_0x1310f3[_0x1310f3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x48b1a1('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x44dc8f['apply'](this['editor']['data'],_0x1310f3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x56cb77,[_0x3b161a])=>{if(this['_document']['version'])throw new _0x48b1a1('realtimecollaborationclient-init-document-already-initialized',this);_0x56cb77['stop'](),this['_setPendingAction']();const _0x3ae909=this['editor']['config']['get']('rootsAttributes'),_0xb4d0c4=this['_getOperationsFromInitData'](_0x3b161a,_0x3ae909);0x0==_0xb4d0c4['length']&&_0xb4d0c4['push'](new _0x1b9ec1(0x0)),_0x56cb77['return']=this['_connectService'](_0xb4d0c4)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x5b20d5=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5b20d5))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3b3fbd,[_0x10568e,_0x39502a])=>{_0x3b3fbd['stop']();const _0x539d4e=this['editor']['model']['document']['getRoot'](_0x10568e);if(!this['_knownRootNames']['has'](_0x10568e)){const _0x4486ce=_0x39502a&&_0x39502a['data']?_0x39502a['data']:'',_0x34e319=_0x39502a&&_0x39502a['attributes']?_0x39502a['attributes']:{};await this['_loadRoot'](_0x10568e,_0x4486ce,_0x34e319);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x539d4e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x539d4e);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1d0614){const _0xd03d9b=this['editor']['plugins']['get'](_0x19feea),{connection:_0x2b3f96}=this['editor']['plugins']['get'](n),_0x1e3923=new Set();for(const _0x1421ea of _0x1d0614){const _0x461ff7=_0x1421ea['_authorId'];_0x461ff7&&!_0xd03d9b['getUser'](_0x461ff7)&&_0x1e3923['add'](_0x461ff7);}if(0x0===_0x1e3923['size'])return;const _0x4cf79d=await lt['getMany'](_0x2b3f96,Array['from'](_0x1e3923));for(const _0x346c9b of _0x4cf79d)_0xd03d9b['getUser'](_0x346c9b['id'])||_0xd03d9b['addUser'](_0x346c9b);}['_getOperationsFromInitData'](_0x475e62,_0x477a19={}){const _0x1f0876=this['editor']['model'],_0x2b6dc5=[];let _0x3d841e=0x0;const _0x1956cb='string'==typeof _0x475e62?{'main':_0x475e62}:_0x475e62;for(const _0x25e2d0 of Object['keys'](_0x1956cb)){if(!this['_document']['roots']['has'](_0x25e2d0))throw new _0x48b1a1('realtimecollaborationclient-init-non-existent-root',this);const _0xf5d28c=this['editor']['data']['parse'](_0x1956cb[_0x25e2d0]),_0x4a1c10=this['_document']['getRoot'](_0x25e2d0),_0x56cdf0=new _0x992cc3(_0x1f0876['createPositionAt'](_0x4a1c10,0x0),_0xf5d28c,_0x3d841e++);_0x2b6dc5['push'](_0x56cdf0);for(const [_0x288650,_0x689cbf]of _0xf5d28c['markers']){const _0x3ecb62=_0x1f0876['createRange'](_0x1f0876['createPositionFromPath'](_0x4a1c10,_0x689cbf['start']['path']['slice']()),_0x1f0876['createPositionFromPath'](_0x4a1c10,_0x689cbf['end']['path']['slice']())),_0x30c169=new _0x2059d2(_0x288650,null,_0x3ecb62,_0x1f0876['markers'],!0x0,_0x3d841e++);_0x2b6dc5['push'](_0x30c169);}}if(_0x477a19)for(const [_0x56ab9f,_0x513e57]of Object['entries'](_0x477a19)){const _0x73ff73=_0x1f0876['document']['getRoot'](_0x56ab9f);if(!_0x73ff73)throw new _0x48b1a1('multi-root-editor-root-attributes-no-root',null);for(const [_0x56e551,_0x468180]of Object['entries'](_0x513e57))if(null!==_0x468180){const _0x4781b3=new _0x17026d(_0x73ff73,_0x56e551,null,_0x468180,_0x3d841e++);_0x2b6dc5['push'](_0x4781b3);}}return _0x2b6dc5;}async['_loadRoot'](_0x147921,_0x57ebd3,_0x360574){this['_getOperationsFromInitData']({[_0x147921]:_0x57ebd3},{[_0x147921]:_0x360574})['forEach']((_0x51915c,_0x20a678)=>{_0x51915c['baseVersion']=this['_document']['version']+_0x20a678,_0x51915c['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x51915c);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1be2b1,_0x3446c9){let _0x4d2f06;this['_offset']=_0x1be2b1['offset'];const _0x21905d=_0x1be2b1['wereChangesApplied']&&!_0x1be2b1['initData'],_0x451ec9=_0x21905d?0x0:_0x1be2b1['data']['baseVersion'];if(_0x3446c9['forEach'](_0x1f8aac=>{_0x1f8aac['_isInit']=!0x0,_0x1f8aac['createdAt']=_0x1be2b1['sessionCreatedAt'],_0x1f8aac['_authorId']=null;}),_0x21905d)_0x4d2f06=_0x3446c9,this['_applyOperationsSet'](_0x4d2f06,_0x21905d);else{if(_0x1be2b1['initData']){const _0x411bef=this['_getOperationsFromInitData'](_0x1be2b1['initData']);this['_document']['history']['version']=-_0x411bef['length'],_0x411bef['forEach'](_0x372534=>{_0x372534['baseVersion']-=_0x411bef['length'],_0x372534['createdAt']=_0x1be2b1['sessionCreatedAt'],_0x372534['_isInit']=!0x0,_0x372534['_authorId']=null;}),this['_applyOperationsSet'](_0x411bef,!0x0),this['serverHistory']['version']=-_0x411bef['length']+this['_offset'],this['_updateServerHistory'](_0x411bef);}this['_document']['history']['version']=_0x451ec9,_0x4d2f06=this['_decompressOperations'](_0x1be2b1['data'],_0x1be2b1['metadata']),await this['_fetchMissingUsers'](_0x4d2f06),this['_applyOperationsSet'](_0x4d2f06,_0x21905d);}_0x1be2b1['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4d2f06,_0x1be2b1['lastOperationId']),this['_lastSyncedOperationId']=_0x1be2b1['lastOperationId']),this['serverHistory']['version']=_0x451ec9+this['_offset'],this['_updateServerHistory'](_0x4d2f06),_0x3446c9['filter'](_0x5b9602=>{const _0x35ad7a=this['_getAffectedRoot'](_0x5b9602);return _0x35ad7a&&!this['_knownRootNames']['has'](_0x35ad7a);})['forEach']((_0x4adeeb,_0x10c255)=>{_0x4adeeb['baseVersion']=this['_document']['version']+_0x10c255,this['_saveOperationInBuffer'](_0x4adeeb);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x144a87,_0xa94bfe){const _0x5a6e90=_0xa94bfe&&_0xa94bfe['message'];if(_0x5a6e90&&_0x5a6e90['startsWith']('realtimecollaborationclient'))throw _0xa94bfe;const _0x5af011=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x5af011['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x48b1a1(_0x144a87,this['editor'],_0x5a6e90?{'originalError':_0x5a6e90}:void 0x0);}['_saveOperationInBuffer'](_0x485c1d){this['_knownOperations']['has'](_0x485c1d)||(this['_knownOperations']['add'](_0x485c1d),this['_bufferedOperations']['push'](_0x485c1d),this['_pendingAction']||'marker'==_0x485c1d['type']&&!_0x485c1d['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x178f84=!0x1){!_0x178f84&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x130acc=>{_0x130acc&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x320f1d=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x48d621){return _0x48d621['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x48d621['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x48d621['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x320f1d)||this['_crash'](_0x320f1d['message'],_0x320f1d);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x364a7b=>{this['on']('change:_isPendingUpdate',()=>{_0x364a7b();});});}async['_sendBufferedOperations'](){const _0xaf3dd1=this['editor']['plugins']['get'](V);if(this['_shouldSendSelectionUpdate']()&&(_0xaf3dd1['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2aca33=[...this['_bufferedOperations']];for(const _0x25bd9e of _0x2aca33)_0x25bd9e['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x25bd9e);const _0x36db84=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2aca33),_0x23e7f6=G++,_0x24fa9c=this['_compressOperations'](_0x2aca33),_0x441e53=await this['_service']['sendOperations'](_0x24fa9c,_0x24fa9c['baseVersion'],_0x36db84);try{return await this['_handleServerResponse'](_0x2aca33,_0x441e53,_0x23e7f6);}catch(_0x282055){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x282055);}}async['_handleServerResponse'](_0x606bb3,_0x2ffc22,_0xe9999f){if('error'in _0x2ffc22)throw _0x2ffc22['error'];let _0x170c21=!0x1;if(_0x2ffc22['wereChangesApplied']){_0x2ffc22['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2ffc22['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x133c0f=>!_0x606bb3['includes'](_0x133c0f));for(const _0x24017b of _0x606bb3)_0x24017b['createdAt']='lastOperationAcceptedAt'in _0x2ffc22&&_0x2ffc22['lastOperationAcceptedAt']||void 0x0;K(_0x606bb3,_0x2ffc22['version']-_0x606bb3['length']),this['_updateServerHistory'](_0x606bb3);const _0x350770=_0x606bb3['filter'](_0x2f5dd4=>{if(!_0x2f5dd4['_isInit'])return!0x1;const _0x30efbd=this['_getAffectedRoot'](_0x2f5dd4);return _0x30efbd&&!this['_knownRootNames']['has'](_0x30efbd);});K(_0x350770,this['_document']['version']),this['_applyOperationsSet'](_0x350770),_0x170c21=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5a775a=this['_decompressOperations'](_0x2ffc22['data'],_0x2ffc22['metadata'])['filter'](_0x219a32=>_0x219a32['baseVersion']>=this['_lastServerVersion']);_0x5a775a['forEach'](_0x25cf26=>this['_addKnownRoot'](_0x25cf26)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x370213=>!_0x370213['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x370213))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5a775a),_0x170c21=this['_handleExternalOperations'](_0x5a775a,_0x2ffc22['version'],_0x2ffc22['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x170c21?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3cbb7a,_0x4cffff,_0x4c5b9e){try{const _0x3214b5={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4d14f4,operationsB:_0x2ec4c0,originalOperations:_0xe39f66}=_0x4454b5(_0x3cbb7a,this['_bufferedOperations'],_0x3214b5);K(_0x4d14f4,this['_document']['version']),K(_0x2ec4c0,_0x4cffff);for(const _0x307aca of _0x4d14f4){const _0x1edec9=_0xe39f66['get'](_0x307aca);_0x307aca['_authorId']=_0x1edec9?_0x1edec9['_authorId']:null;}_0x4c5b9e&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3cbb7a,_0x4c5b9e),this['_lastSyncedOperationId']=_0x4c5b9e),this['_bufferedOperations']=[..._0x2ec4c0],this['_applyOperationsSet'](_0x4d14f4),this['_updateServerHistory'](_0x3cbb7a);}catch(_0x166be4){return console['error'](_0x166be4),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2772fb,_0x70b8c2=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x395bfb=>{for(const _0xe8e651 of _0x2772fb)this['_knownOperations']['add'](_0xe8e651),this['_addKnownRoot'](_0xe8e651),_0x395bfb['batch']['addOperation'](_0xe8e651),this['editor']['model']['applyOperation'](_0xe8e651);});}['_addKnownRoot'](_0x38f516){const _0x449f4d=this['_getAffectedRoot'](_0x38f516);_0x449f4d&&this['_knownRootNames']['add'](_0x449f4d);}['_getAffectedRoot'](_0x140fc6){let _0x3c766a,_0x5e98d0;switch(_0x140fc6['type']){case'insert':_0x3c766a=_0x140fc6['position']['root'];break;case'marker':if(_0x5e98d0=_0x140fc6['newRange'],!_0x5e98d0)return null;_0x3c766a=_0x5e98d0['root'];break;case'addRootAttribute':_0x3c766a=_0x140fc6['root'];break;case'addRoot':_0x3c766a=_0x140fc6['affectedSelectable'];break;case'move':_0x3c766a=_0x140fc6['targetPosition']['root'];break;default:return null;}return _0x3c766a['rootName'];}['_updateServerHistory'](_0x458eef){_0x458eef['forEach'](_0x5e3b9e=>{const _0x5a0b36=_0x5e3b9e['clone']();_0x5a0b36['_authorId']=_0x5e3b9e['_authorId'],_0x5a0b36['_isInit']=!!_0x5e3b9e['_isInit'],_0x5a0b36['createdAt']=_0x5e3b9e['createdAt'],_0x5a0b36['baseVersion']+=this['_offset'],_0x5e3b9e['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5a0b36),this['serverHistory']['addOperation'](_0x5a0b36);});}['_handleReconnectionError'](_0x42fa87){const _0x2e93ad=this['editor']['plugins']['get']('Notification'),_0xa7d249=this['editor']['locale'];_0x42fa87||(_0x42fa87=W(_0xa7d249,'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.')),_0x2e93ad['showWarning'](_0x42fa87,{'title':W(_0xa7d249,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x4d5129)['add'](W(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x4d5129)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3fb8e3){const _0x39e448=_0x3fb8e3['map'](_0x4abe1e=>_0x4abe1e['toJSON']());return this['_compressor']['compress'](_0x39e448);}['_decompressOperations'](_0x79ce93,_0xd27166){return this['_compressor']['decompress'](_0x79ce93)['map']((_0x42b67e,_0x3e3eae)=>{const _0x125763='init'==_0xd27166[_0x3e3eae]['type'];if('InsertOperation'==_0x42b67e['__className']){const _0x27641a=_0x42b67e['position']['root'];!this['_document']['getRoot'](_0x27641a)&&(this['_document']['createRoot']('$root',_0x27641a)['_isAttached']=!0x1);}const _0x56a08a=_0x4147ed['fromJSON'](_0x42b67e,this['_document']);return _0x56a08a['wasUndone']=_0x42b67e['wasUndone'],_0x56a08a['_isInit']=_0x125763,_0x56a08a['_authorId']=_0x125763?null:_0xd27166[_0x3e3eae]['userId'],_0x56a08a['_isDisconnection']='cs:removeUser'===_0xd27166[_0x3e3eae]['type'],_0x56a08a['createdAt']=_0xd27166[_0x3e3eae]['createdAt'],_0x56a08a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2b35b7=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2b35b7&&_0x2b35b7['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x33b1c7,_0x24f79e){for(const _0x4ff84a of _0x33b1c7)_0x4ff84a['baseVersion']=_0x24f79e++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x30922d){this['_ignoredOperations']=_0x30922d,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3d06da){let _0x310f87=_0x3d06da['length'];for(;_0x310f87--;){const _0x159aab=_0x3d06da[_0x310f87];if(!this['_ignoredOperations']['has'](_0x159aab)){if(!this['_operationToId']['has'](_0x159aab)){const _0x2b015c=_0x44ba32()['slice'](0x1,0x12);this['_operationToId']['set'](_0x159aab,_0x2b015c);}return this['_operationToId']['get'](_0x159aab);}}}['setIdForTheLastOperation'](_0x4331da,_0x1413c6){if(!_0x1413c6)return;let _0x1c3858=_0x4331da['length'];for(;_0x1c3858--;){const _0x48cc8e=_0x4331da[_0x1c3858];this['_ignoredOperations']['has'](_0x48cc8e)||this['_operationToId']['set'](_0x48cc8e,_0x1413c6);}}}class a extends _0x510f18{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x5eed8d{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0xb35a39)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x19feea];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4af450){super(_0x4af450),this['_services']=new Map();}async['init'](){const _0x343b67=this['context'],_0x10e68d=_0x343b67['plugins']['get']('CommentsRepository');if(_0x343b67['plugins']['get'](n)['addToReconnectionStack'](this),_0x10e68d['adapter']={'addCommentThread':async({channelId:_0x3c3b10,threadId:_0x3feb2b,comments:_0x55409e,resolvedAt:_0x1fdc78,resolvedBy:_0x4d33ed,context:_0x2430f4,attributes:_0x42e4f9})=>{const _0x555fd0=await this['_getService'](_0x3c3b10)['addCommentThread']({'commentThreadId':_0x3feb2b,'comments':_0x55409e['map'](_0x295295=>function(_0xc421bd,_0x570287,_0x5a7fc8){return{'commentThreadId':_0x5a7fc8,'commentId':_0xc421bd['commentId'],'userId':_0xc421bd['authorId'],'content':_0xc421bd['content'],'documentId':_0x570287,'createdAt':_0xc421bd['createdAt'],'attributes':_0xc421bd['attributes']||{}};}(_0x295295,_0x3c3b10,_0x3feb2b)),'resolvedAt':_0x1fdc78,'resolvedBy':_0x4d33ed,'context':_0x2430f4,'attributes':_0x42e4f9})['catch'](dt);return{'threadId':_0x555fd0['commentThreadId'],'comments':_0x555fd0['comments']};},'getCommentThread':async({channelId:_0x1a4798,threadId:_0x18a37a})=>{const _0x5ec1a6=await this['_getService'](_0x1a4798)['getCommentThread'](_0x18a37a)['catch'](dt);return _0x5ec1a6['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5ec1a6]),{'threadId':_0x5ec1a6['commentThreadId'],'comments':_0x5ec1a6['comments']['map'](p),'context':_0x5ec1a6['context'],'resolvedAt':_0x5ec1a6['resolvedAt'],'resolvedBy':_0x5ec1a6['resolvedBy'],'attributes':_0x5ec1a6['attributes']||{}});},'updateCommentThread':async({channelId:_0x290262,threadId:_0x36fe34,context:_0xacef90,unlinkedAt:_0x5838a3,attributes:_0x5d23b3})=>this['_getService'](_0x290262)['updateCommentThread']({'commentThreadId':_0x36fe34,'context':_0xacef90,'attributes':_0x5d23b3,'unlinkedAt':_0x5838a3})['catch'](v)['catch'](dt),'resolveCommentThread':async({channelId:_0x37dc3f,threadId:_0x4ecf5d})=>{const _0x187fbd=await this['_getService'](_0x37dc3f)['resolveCommentThread'](_0x4ecf5d)['catch'](v)['catch'](dt);return{'threadId':_0x187fbd['commentThreadId'],'resolvedAt':_0x187fbd['resolvedAt'],'resolvedBy':_0x187fbd['resolvedBy']};},'reopenCommentThread':async({channelId:_0x454431,threadId:_0x22d60f})=>this['_getService'](_0x454431)['reopenCommentThread'](_0x22d60f)['catch'](v)['catch'](dt),'removeCommentThread':({channelId:_0x20dbf6,threadId:_0x5f4a16})=>this['_getService'](_0x20dbf6)['removeCommentThread'](_0x5f4a16)['catch'](v)['catch'](dt),'addComment':({channelId:_0xf53a35,threadId:_0x1f5fe4,commentId:_0x331adb,content:_0x164642,attributes:_0x4b4e7d})=>this['_getService'](_0xf53a35)['addComment'](_0x1f5fe4,_0x331adb,_0x164642,_0x4b4e7d)['catch'](dt),'updateComment':({channelId:_0x72a29a,threadId:_0x66ffd5,commentId:_0x8bcc53,content:_0x9bfcc3,attributes:_0x5d6bc9})=>this['_getService'](_0x72a29a)['updateComment'](_0x66ffd5,_0x8bcc53,_0x9bfcc3,_0x5d6bc9)['catch'](v)['catch'](dt),'removeComment':({channelId:_0x37470f,threadId:_0x35ec88,commentId:_0x17b08d})=>this['_getService'](_0x37470f)['removeComment'](_0x35ec88,_0x17b08d)['catch'](v)['catch'](dt)},_0x343b67 instanceof _0x1af3e4){const _0x366325=_0x343b67['config']['get']('collaboration.channelId'),_0x12b198=_0x343b67['plugins']['get'](i);await this['_setUpService'](_0x366325);const _0x4722a7=await this['_services']['get'](_0x366325)['getConnectedSessions']();this['listenTo'](_0x12b198,'sessionAdd:'+_0x366325,(_0x1ee21e,{session:_0x4f4431})=>{_0x4f4431['id']===_0x12b198['mySessionId']&&(_0x1ee21e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4f4431['permissions'],_0x366325));}),_0x12b198['register'](_0x366325,_0x4722a7);}}async['_setUpService'](_0x56b974){if(this['_services']['has'](_0x56b974))throw new _0x48b1a1('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x56b974});const _0x43435b=this['context']['plugins']['get']('CommentsRepository'),_0x54b50f=new s['CommentsService'](_0x56b974);this['_services']['set'](_0x56b974,_0x54b50f),this['listenTo'](_0x54b50f,'commentThreadAdded',(_0x3b0dd9,_0x172147)=>{const {commentThreadId:_0x2eab9d,documentId:_0x2f181e,context:_0x52848b,attributes:_0x5cae6d,resolvedAt:_0x468160,resolvedBy:_0x51afb8,comments:_0x15e277}=_0x172147;_0x43435b['getCommentThread'](_0x2eab9d)||_0x43435b['addCommentThread']({'threadId':_0x2eab9d,'channelId':_0x2f181e,'comments':_0x15e277?_0x15e277['map'](p):[],'context':_0x52848b,'attributes':_0x5cae6d,'resolvedAt':_0x468160,'resolvedBy':_0x51afb8,'isFromAdapter':!0x0});}),this['listenTo'](_0x54b50f,'commentThreadUpdated',(_0x2f4bec,{commentThreadId:_0x582340,documentId:_0x4df896,context:_0x14b0b1,unlinkedAt:_0x85a7bb,attributes:_0xa4107d})=>{_0x43435b['getCommentThread'](_0x582340)&&_0x43435b['updateCommentThread']({'threadId':_0x582340,'channelId':_0x4df896,'context':_0x14b0b1,'unlinkedAt':_0x85a7bb,'attributes':_0xa4107d,'isFromAdapter':!0x0});}),this['listenTo'](_0x54b50f,'commentThreadResolved',(_0x23558b,{commentThreadId:_0x324d0a,resolvedBy:_0x320627,resolvedAt:_0x17e97a})=>{const _0x4611d2=_0x43435b['getCommentThread'](_0x324d0a);_0x4611d2&&_0x4611d2['resolve']({'resolvedBy':_0x320627,'resolvedAt':_0x17e97a,'isFromAdapter':!0x0});}),this['listenTo'](_0x54b50f,'commentThreadReopened',(_0x5a1ab6,{commentThreadId:_0x5b40c2})=>{const _0x544a53=_0x43435b['getCommentThread'](_0x5b40c2);_0x544a53&&_0x544a53['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x54b50f,'commentThreadRemoved',(_0x1efb4f,{commentThreadId:_0x5b8ec2})=>{const _0x5dc574=_0x43435b['getCommentThread'](_0x5b8ec2);_0x5dc574&&_0x5dc574['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x54b50f,'commentAdded',(_0x4f6785,_0x3a4f3e)=>{const _0x3dfa77=_0x3a4f3e['commentThreadId'],_0x58cb0f=_0x43435b['getCommentThread'](_0x3dfa77);_0x58cb0f&&_0x58cb0f['addComment']({...p(_0x3a4f3e),'isFromAdapter':!0x0});}),this['listenTo'](_0x54b50f,'commentUpdated',(_0x4d1971,{commentThreadId:_0x4631ac,commentId:_0x1d4872,content:_0x18b7b0,attributes:_0x1de936})=>{const _0x41d4f0=_0x43435b['getCommentThread'](_0x4631ac);if(_0x41d4f0){const _0x3749bd=_0x41d4f0['getComment'](_0x1d4872);_0x3749bd&&_0x3749bd['update']({'content':_0x18b7b0,'attributes':_0x1de936,'isFromAdapter':!0x0});}}),this['listenTo'](_0x54b50f,'commentRemoved',(_0x87f2a9,{commentThreadId:_0x2c62bf,commentId:_0x5aebb5})=>{const _0x3971ee=_0x43435b['getCommentThread'](_0x2c62bf);if(_0x3971ee){const _0x17aeb6=_0x3971ee['getComment'](_0x5aebb5);_0x17aeb6&&_0x17aeb6['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x56b974);}['destroy'](){if(this['context']instanceof _0x1af3e4){const _0x361e6f=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x361e6f);}}['_terminateService'](_0x57e753){if(!this['_services']['has'](_0x57e753))throw new _0x48b1a1('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x57e753});this['_getService'](_0x57e753)['disconnect'](),this['_services']['delete'](_0x57e753);}async['reconnect'](){for(const _0x4b5e0a of this['_services']['keys']())await this['_connectService'](_0x4b5e0a);if(this['context']instanceof _0x1af3e4){const _0x2a3a2d=this['context']['config']['get']('collaboration.channelId'),_0x3c1f09=this['context']['plugins']['get'](i);_0x3c1f09['unregister'](_0x2a3a2d);const _0x563465=await this['_services']['get'](_0x2a3a2d)['getConnectedSessions']();_0x3c1f09['register'](_0x2a3a2d,_0x563465);}}async['_connectService'](_0x3e369f){const {connection:_0x3afdf0}=this['context']['plugins']['get'](n),_0x237ac5=this['context']['plugins']['get']('CommentsRepository'),_0x33798d=this['_services']['get'](_0x3e369f),_0x15c78e=await _0x33798d['connect'](_0x3afdf0);await this['_fetchMissingUsersForThreads'](_0x15c78e);const _0x12f1ce=new Set(Array['from'](_0x237ac5['getCommentThreads']({'channelId':_0x3e369f}),_0xa9d50d=>_0xa9d50d['id']));for(const _0x53e086 of _0x15c78e)_0x53e086['deletedAt']||_0x12f1ce['delete'](_0x53e086['commentThreadId']);for(const _0x59392d of _0x12f1ce)_0x237ac5['getCommentThread'](_0x59392d)['remove']({'isFromAdapter':!0x0});for(const _0x4a6188 of _0x15c78e){let _0x2060b0=_0x237ac5['getCommentThread'](_0x4a6188['commentThreadId']);const {commentThreadId:_0x25b337,context:_0x33c645,attributes:_0x1ea169,resolvedBy:_0x158db2,resolvedAt:_0x36cee2,unlinkedAt:_0x4233f5,deletedAt:_0xc4d435}=_0x4a6188;if(_0xc4d435)continue;_0x2060b0||(_0x2060b0=_0x237ac5['addCommentThread']({'channelId':_0x3e369f,'threadId':_0x25b337,'context':_0x33c645,'attributes':_0x1ea169||{},'resolvedBy':_0x158db2,'resolvedAt':_0x36cee2,'unlinkedAt':_0x4233f5,'isFromAdapter':!0x0}));const _0x2911dc=new Set(Array['from'](_0x2060b0['comments'],_0x26d67d=>_0x26d67d['id']));for(const _0x16fd0c of _0x4a6188['comments'])_0x2911dc['delete'](_0x16fd0c['commentId']);for(const _0x502f2b of _0x2911dc)_0x2060b0['getComment'](_0x502f2b)['remove']({'isFromAdapter':!0x0});for(const _0x4b0410 of _0x4a6188['comments']){const _0x4f8031=_0x2060b0['getComment'](_0x4b0410['commentId']);_0x4f8031?_0x4f8031['content']!==_0x4b0410['content']&&_0x4f8031['update']({'content':_0x4b0410['content'],'isFromAdapter':!0x0}):_0x2060b0['addComment'](Object['assign'](p(_0x4b0410),{'isFromAdapter':!0x0}));}}}['_getService'](_0x113e18){if(!this['_services']['has'](_0x113e18))throw new _0x48b1a1('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x113e18});return this['_services']['get'](_0x113e18);}async['_fetchMissingUsersForThreads'](_0x1cc83b){const _0x48453e=this['context']['plugins']['get'](_0x19feea),{connection:_0x2d3598}=this['context']['plugins']['get'](n),_0x2361ad=new Set();for(const {resolvedBy:_0x19b713,comments:_0xf63e0c}of _0x1cc83b){_0x19b713&&!_0x48453e['getUser'](_0x19b713)&&_0x2361ad['add'](_0x19b713);for(const {userId:_0x38d706}of _0xf63e0c)_0x48453e['getUser'](_0x38d706)||_0x2361ad['add'](_0x38d706);}if(0x0===_0x2361ad['size'])return;const _0x4449c2=await lt['getMany'](_0x2d3598,Array['from'](_0x2361ad));for(const _0x44f357 of _0x4449c2)_0x48453e['getUser'](_0x44f357['id'])||_0x48453e['addUser'](_0x44f357);}}async function v(_0x4a57f0){if('404'!==_0x4a57f0['code'])throw _0x4a57f0;}function dt(_0x322636){if((_0x1a7d85=_0x322636)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1a7d85['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1a7d85['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1a7d85;throw _0x322636;}function p(_0x2aa6fc){return{'threadId':_0x2aa6fc['commentThreadId'],'commentId':_0x2aa6fc['commentId'],'content':_0x2aa6fc['content'],'createdAt':_0x2aa6fc['createdAt'],'authorId':_0x2aa6fc['userId'],'attributes':_0x2aa6fc['attributes']||{}};}class m extends _0x510f18{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c859b){super(_0x3c859b);const _0x4dc6d7=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4dc6d7);}['init'](){const _0x173cc5=this['editor']['plugins']['get'](n),_0x2db64a=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2db64a['adapter']={'getSuggestion':async _0x130428=>{await this['_waitForServiceReady']();const _0x2c6ccc=await this['_trackChangesService']['get'](_0x130428)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x2c6ccc]),_0x2c6ccc;},'addSuggestion':async({id:_0xb6f3df,type:_0x2a87a0,data:_0x71db3d,originalSuggestionId:_0x5b03d4,attributes:_0x486fb6})=>{await this['_waitForServiceReady']();const _0x1c10ff={'id':_0xb6f3df,'type':_0x2a87a0,'data':_0x71db3d,'originalSuggestionId':_0x5b03d4,'attributes':_0x486fb6},_0xa98136=await this['_trackChangesService']['add'](_0xb6f3df,_0x2a87a0,_0x71db3d,_0x5b03d4,_0x486fb6)['catch'](_0x11c7fe=>{if(ut(_0x11c7fe))return new Promise(_0x2ff553=>{this['_bufferedRequests']['set'](_0xb6f3df,{'resolve':_0x2ff553,'suggestionData':_0x1c10ff});});throw _0x11c7fe;});return this['_bufferedRequests']['delete'](_0xb6f3df),_0xa98136;},'updateSuggestion':async(_0x4569ac,_0x451322)=>{if(await this['_waitForServiceReady'](),'open'!==_0x451322['state'])return this['_trackChangesService']['update'](_0x4569ac,_0x451322)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2a7cdb,_0x24fd14)=>{_0x2db64a['hasSuggestion'](_0x24fd14['id'])&&(_0x2db64a['getSuggestion'](_0x24fd14['id'])['attributes']=_0x24fd14['attributes']);}),this['_trackChangesService']['connect'](_0x173cc5['connection'])['then'](_0x144bc0=>(_0x173cc5['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x144bc0)['then'](()=>{for(const _0x21f808 of _0x144bc0){_0x2db64a['addSuggestionData'](_0x21f808)['_saved']=!0x0;}})));}async['reconnect'](){const _0x247bb8=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1db048}=this['editor']['plugins']['get'](n),_0x1b7659=await this['_trackChangesService']['connect'](_0x1db048);await this['_fetchMissingUsersForThreads'](_0x1b7659);for(const {suggestionData:_0x6cdca8,resolve:_0x2b0167}of this['_bufferedRequests']['values']()){let _0x3a7d4e=_0x1b7659['find'](_0x58b663=>_0x58b663['id']===_0x6cdca8['id']);_0x3a7d4e||(_0x3a7d4e=await this['_trackChangesService']['add'](_0x6cdca8['id'],_0x6cdca8['type'],_0x6cdca8['data'],_0x6cdca8['originalSuggestionId'])),_0x2b0167(_0x3a7d4e);}for(const _0x142385 of _0x1b7659)_0x247bb8['hasSuggestion'](_0x142385['id'])||_0x247bb8['addSuggestionData'](_0x142385);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1e1305=>{this['listenTo'](this['_trackChangesService'],'connected',_0x530ae1=>{_0x530ae1['off'](),_0x1e1305();});});}async['_fetchMissingUsersForThreads'](_0x4f985a){const _0x3908b6=this['editor']['plugins']['get'](_0x19feea),{connection:_0x15e04e}=this['editor']['plugins']['get'](n),_0xec7cbd=new Set();for(const {authorId:_0xe333f0}of _0x4f985a)_0x3908b6['getUser'](_0xe333f0)||_0xec7cbd['add'](_0xe333f0);if(0x0===_0xec7cbd['size'])return;const _0x4237b8=await lt['getMany'](_0x15e04e,Array['from'](_0xec7cbd));for(const _0x23daf5 of _0x4237b8)_0x3908b6['getUser'](_0x23daf5['id'])||_0x3908b6['addUser'](_0x23daf5);}}function A(_0x1e3e0f){if(ut(_0x1e3e0f))return new Promise(()=>{});throw _0x1e3e0f;}function ut(_0x4e3bea){return _0x4e3bea['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4e3bea['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x510f18{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x255b50=this['editor']['plugins']['get'](n),_0x484547=this['editor']['plugins']['get']('CommentsEditing'),_0x3e91ae=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x255b50,'change:state',(_0x546fae,_0x275fe4,_0x2d846b)=>{_0x484547['isThreadsLoadingPaused']='connected'!==_0x2d846b;});}),this['listenTo'](_0x255b50,'change:state',(_0x374288,_0x8dc9b9,_0xb7d49e)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xb7d49e);}),_0x3e91ae['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x510f18{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x510f18{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x19feea];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2dc12e){super(_0x2dc12e);const _0x1b07c4=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x1b07c4);}async['init'](){const _0x306db4=this['editor']['plugins']['get'](l),_0x2c14b4=_0x306db4['serverHistory'],_0x17240c=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x2c14b4,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x306db4['sessionId']});const _0x24dd1f=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x193894=await tt['isBundleUploaded'](_0x17240c['connection'],_0x24dd1f);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3aaad9})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3aaad9)),'updateRevisions':async _0x3bc975=>{await this['_waitForServiceReady']();const _0x1d169d=this['_revisionTracker']['currentRevision'];if(_0x193894&&0x1===_0x3bc975['length']&&_0x3bc975[0x0]['id']===_0x1d169d['id'])return _0x3bc975;for(const _0x29f42e of _0x3bc975)_0x29f42e['id']===_0x1d169d['id']&&(_0x29f42e['isEmptyCurrent']=_0x29f42e['fromVersion']===_0x29f42e['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3bc975,this['_lastRequestId'])['then'](_0x45b673=>(this['_lastRequestId']=_0x45b673,_0x3bc975))['catch'](_0x196ad3=>{if(st(_0x196ad3)||'400'===_0x196ad3['code']&&void 0x0!==_0x196ad3['data']['wrongRequestId']){for(const _0x47edd2 of _0x3bc975){!this['_revisionTracker']['repository']['getRevision'](_0x47edd2['id'])||this['_revisionTracker']['_bufferUpdate'](_0x47edd2['id'],_0x47edd2,!0x1);}if(st(_0x196ad3))throw _0x196ad3;return _0x3bc975;}throw _0x196ad3;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x2c90db,{revisionsData:_0x28a01b,requestId:_0x421e9b})=>{Math['max'](..._0x28a01b['map'](_0x5f5a7a=>_0x5f5a7a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x28a01b,_0x421e9b);}):this['_handleRevisionsUpdate'](_0x28a01b,_0x421e9b);});const {revisions:_0xc8b5a9,requestId:_0x4b927c}=await this['_revisionHistoryService']['connect'](_0x17240c['connection']);_0x17240c['addToReconnectionStack'](this),this['_lastRequestId']=_0x4b927c,await this['_fetchMissingUsers'](_0xc8b5a9);for(const _0x4c67ea of _0xc8b5a9)this['_revisionTracker']['addRevisionData'](_0x4c67ea);this['listenTo'](_0x306db4,'change:_isConnected',(_0x3d13ae,_0x5c5587,_0x4fe3f9)=>{_0x4fe3f9&&(this['_oldOffset']=_0x306db4['_offset'],_0x3d13ae['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x17240c,'state',_0x340581=>_0x340581===te['CONNECTED']);}async['reconnect'](){const _0x34791b=this['editor']['plugins']['get'](n),_0x527503=this['editor']['plugins']['get'](l),_0x1d70c3=async()=>{const _0x43ccaa=this['_revisionTracker']['currentRevision'],_0x5c26e6=_0x43ccaa['id'],_0x41bf13=_0x5c26e6!==_0x527503['sessionId'];if(_0x41bf13){const _0x4542ec=_0x527503['_offset']-this['_oldOffset'],_0x3e2072=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x43ccaa['toVersion']+_0x4542ec!==_0x3e2072){const _0x28ac09=_0x43ccaa['fromVersion']+_0x4542ec,_0x2cae39=this['editor']['plugins']['get'](_0x19feea),_0x5d4256=this['_revisionTracker']['buildRevisionData']({'revision':_0x43ccaa,'from':_0x28ac09,'to':_0x3e2072});_0x5d4256['id']=_0x43ccaa['id'];const _0x263e86=_0x5d4256['authorsIds']['map'](_0x13a426=>_0x2cae39['getUser'](_0x13a426));_0x43ccaa['_update']({..._0x5d4256,'authors':_0x263e86},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x43ccaa['id'],_0x5d4256,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3e2072,(_0x43ccaa['toVersion']===_0x43ccaa['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5c26e6)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5c26e6),this['_revisionTracker']['_createCurrentRevision'](_0x3e2072));}const {revisions:_0x36775c,requestId:_0x406c8f}=await this['_revisionHistoryService']['reconnect'](_0x34791b['connection'],this['_lastRequestId']);_0x41bf13&&_0x36775c['length']>0x0?_0x527503['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x36775c),this['_handleRevisionsUpdate'](_0x36775c,_0x406c8f),this['_revisionTracker']['sendBufferedUpdates']());};return _0x527503['_isConnected']?_0x1d70c3():new Promise((_0x407ae6,_0x5f2f2a)=>{_0x527503['once']('change:_isConnected',()=>{_0x1d70c3()['then'](_0x407ae6)['catch'](_0x5f2f2a);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x344c42=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x58eeb6=>{_0x58eeb6['off'](),_0x344c42();});});}['_getLatestVersionFromServerOperations'](){const _0x2554fa=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3bdfca of _0x2554fa)if('marker'!==_0x3bdfca['type']||_0x3bdfca['affectsData'])return _0x3bdfca['baseVersion']+0x1;}['_getLatestVersion'](){const _0x27765f=this['editor']['plugins']['get'](l);return new Promise(_0x3373ef=>{_0x27765f['_isPendingUpdate']?_0x27765f['once']('change:_isPendingUpdate',()=>{_0x3373ef(this['_getLatestVersionFromServerOperations']());}):_0x3373ef(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x16d0e9,_0x60351){const _0x1d62bd=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x60351;for(const _0x56ef4e of _0x16d0e9){const _0x463800=_0x1d62bd['getRevision'](_0x56ef4e['id']);if(_0x463800){if((_0x56ef4e['fromVersion']||_0x56ef4e['toVersion'])&&(_0x56ef4e['diffData']=null),_0x463800===this['_revisionTracker']['currentRevision']){const _0x8f286b=Math['max'](_0x463800['toVersion'],_0x56ef4e['toVersion']),_0x380ee7=Math['max'](_0x463800['fromVersion'],_0x56ef4e['fromVersion']);let _0x5a05e4;_0x463800['toVersion']===_0x56ef4e['toVersion']&&_0x463800['fromVersion']===_0x56ef4e['fromVersion']?(_0x5a05e4=!0x0,this['_preventResendingRevisionData'](_0x56ef4e)):_0x56ef4e['toVersion']===_0x8f286b&&_0x56ef4e['fromVersion']===_0x380ee7?_0x5a05e4=!0x1:(_0x463800['toVersion']===_0x8f286b&&_0x463800['fromVersion']===_0x380ee7||this['_fixRevision']({'revision':_0x463800,'from':_0x380ee7,'to':_0x8f286b}),_0x5a05e4=!0x0),_0x5a05e4&&(delete _0x56ef4e['fromVersion'],delete _0x56ef4e['toVersion'],delete _0x56ef4e['diffData'],delete _0x56ef4e['createdAt'],delete _0x56ef4e['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x56ef4e),this['_preventResendingRevisionData'](_0x56ef4e);}else this['_revisionTracker']['addRevisionData'](_0x56ef4e);}const _0x46cdc2=_0x1d62bd['getRevisions']();_0x46cdc2['reverse']();for(let _0x3271dc=0x0;_0x3271dc<_0x46cdc2['length']-0x1;_0x3271dc++){const _0x31ce97=_0x46cdc2[_0x3271dc],_0x241c79=_0x46cdc2[_0x3271dc+0x1];if(_0x31ce97['fromVersion']<_0x241c79['toVersion']){const _0x40c545=_0x241c79['toVersion'],_0x8e74bf=Math['max'](_0x40c545,_0x31ce97['toVersion']);this['_fixRevision']({'revision':_0x31ce97,'from':_0x40c545,'to':_0x8e74bf});}}}['_fixRevision']({revision:_0x572632,from:_0x269e7b,to:_0x174fe1}={}){const _0x36a92b=this['editor']['plugins']['get'](_0x19feea),_0x2d521f=this['_revisionTracker']['buildRevisionData']({'revision':_0x572632,'from':_0x269e7b,'to':_0x174fe1});_0x2d521f['authors']=_0x2d521f['authorsIds']['map'](_0x2db02b=>_0x36a92b['getUser'](_0x2db02b)),_0x572632['_update'](_0x2d521f);}['_preventResendingRevisionData'](_0xff88aa){const _0x386848={};_0x386848['id']=_0xff88aa['id'];for(const _0x40c1fa of Object['keys'](_0xff88aa))'id'!==_0x40c1fa&&(_0x386848[_0x40c1fa]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x386848['id'],_0x386848,!0x0);}async['_fetchMissingUsers'](_0x3d93ab){const _0xd739e4=this['editor']['plugins']['get'](_0x19feea),{connection:_0xc9c88d}=this['editor']['plugins']['get'](n),_0x235c5a=new Set();for(const _0x4e5e51 of _0x3d93ab){for(const _0x1b9495 of _0x4e5e51['authorsIds'])_0x53b6f4(_0x1b9495);_0x4e5e51['creatorId']&&_0x53b6f4(_0x4e5e51['creatorId']);}if(0x0===_0x235c5a['size'])return;const _0x48677a=await lt['getMany'](_0xc9c88d,Array['from'](_0x235c5a));for(const _0x4ceb5c of _0x48677a)_0xd739e4['getUser'](_0x4ceb5c['id'])||_0xd739e4['addUser'](_0x4ceb5c);function _0x53b6f4(_0x10442d){_0xd739e4['getUser'](_0x10442d)||_0x235c5a['add'](_0x10442d);}}}function st(_0x10e3d1){return _0x10e3d1['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x10e3d1['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x10e3d1['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x510f18{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x595b19{['_collapseAt'];constructor(_0x247803,_0xc96db9=0x6){super(_0x247803);const _0x4223bd=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0xc96db9,this['bind']('isHidden')['to'](this,'usersCount',_0x3e44a6=>_0x3e44a6<_0xc96db9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4223bd['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':_0x4223bd['to']('usersCount',_0x25c4ea=>'+'+(_0x25c4ea-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x595b19{['items'];['keystrokes'];constructor(_0x2f3401){super(_0x2f3401);const _0x2e654d=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x215b9f(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x2e654d['if']('hasPopup'),'aria-expanded':_0x2e654d['to']('isExpanded',_0x425ef6=>this['hasPopup']&&String(_0x425ef6)),'aria-label':_0x2e654d['to']('hasPopup',_0x2cab26=>W(_0x2f3401,_0x2cab26?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x2e654d['to']('hasPopup',_0x40778b=>!!_0x40778b&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x2e654d['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x2e654d['to'](_0x394943=>{const _0x559de5=_0x394943,_0x4de7cd=document['querySelector']('.ck-presence-list__dropdown-list'),_0x554d14=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4de7cd?.['contains'](_0x559de5['relatedTarget'])||_0x554d14?.['contains'](_0x559de5['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3ac477,_0x1e066c,_0x621435)=>{this['element']&&(_0x621435?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class k extends _0x595b19{['counterView'];['inlineListView'];constructor(_0xa3fe4c,_0xec0bf1=0x6){super(_0xa3fe4c);const _0x558ae3=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0xec0bf1),this['inlineListView']=new is(_0xa3fe4c),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x599d11 of this['inlineListView']['items'])_0x599d11['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',_0x558ae3['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x595b19{['listWrapperView'];constructor(_0x52fa51,_0x4295b4){super(_0x52fa51);const _0x5452b1=this['bindTemplate'];this['listWrapperView']=new pt(_0x52fa51,_0x4295b4),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':W(_0x52fa51,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5452b1['to'](_0x1c7d28=>{const _0x2e6693=_0x1c7d28,_0x28d5f0=document['querySelector']('.ck-presence-list__list'),_0xf45751=document['querySelector']('.ck-balloon-panel_with-arrow');_0x28d5f0?.['contains'](_0x2e6693['relatedTarget'])||_0xf45751?.['contains'](_0x2e6693['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x45cb04{constructor(_0x5de891,_0xa8dfbc){super(_0x5de891);const _0x152a75=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xa8dfbc?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x152a75['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x152a75['to']('role'),'aria-label':_0x152a75['to']('ariaLabel'),'aria-labelledby':_0x152a75['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x56f01e['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x57e41e=this['element'];_0x57e41e&&(this['_isScrollable']=Math['max'](_0x57e41e['scrollHeight'],_0x57e41e['clientHeight'])>0.8*window['innerHeight']);}}class P extends rt{['userView'];constructor(_0x27cd5e,_0x493796,_0x4f1c3a){super(_0x27cd5e);const _0x1b10f4=this['bindTemplate'];this['userView']=new ct(_0x27cd5e,_0x493796);const _0x3b7c64={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x493796['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x493796['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x493796['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4f1c3a&&(_0x3b7c64['tag']='button',_0x3b7c64['on']={'click':_0x1b10f4['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3b7c64);}['focus'](){this['element']['focus']();}}class _ extends _0x595b19{['userView'];['markerView'];constructor(_0x9746aa,_0x2b33cf,_0x5766d9){super(_0x9746aa);const _0x5d5189=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x9746aa,_0x2b33cf),this['markerView']=new at(_0x9746aa,_0x2b33cf);const _0x2f8f73=new ot(_0x9746aa);_0x2f8f73['template']['tag']='span',_0x2f8f73['text']=_0x2b33cf['name'];const _0x76b696={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5d5189['to']('isFocusable',_0x3433dd=>!!_0x3433dd&&0x0),'aria-labelledby':_0x2f8f73['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5d5189['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5d5189['to']('hasTooltip',_0x382309=>!_0x382309),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2f8f73]};_0x5766d9&&(_0x76b696['tag']='button',_0x76b696['on']={'click':_0x5d5189['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x76b696);}}class at extends _0x595b19{constructor(_0x14c876,_0x4a80e9){super(_0x14c876),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4a80e9['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x5eed8d{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2531a9){super(_0x2531a9),this['context']['config']['define']('presenceList',U);const _0x2c4cfb=_0x2531a9['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2c4cfb)throw new _0x48b1a1('presencelist-collapseat-invalid-format',this);if(_0x2c4cfb<0x1)throw new _0x48b1a1('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x59ff4d(),this['balloonPanelView']=new _0x4d7726(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x1f8743 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1f8743);this['listenTo'](this['_allConnectedUsers'],'add',(_0x23b60f,_0x2bdc32)=>{this['_handleUserAdd'](_0x2bdc32);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x443804,_0x49319c)=>{this['_handleUserRemove'](_0x49319c);});}['_createView'](){const _0x34f573=this['context'],_0x475242=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x17af5f=this['balloonPanelView'];if(!_0x349322(_0x34f573['config']['get']('presenceList.container')))throw new _0x48b1a1('presencelist-missing-container',this);return _0x475242['counterView']['bind']('usersCount')['to'](this),_0x475242['bind']('isCollapsed')['to'](this,'usersCount',_0x48ed45=>{const {collapseAt:_0x4a8e56}=_0x34f573['config']['get']('presenceList'),_0x1b7f9b=_0x48ed45>=_0x4a8e56;if(_0x1b7f9b&&!_0x475242['inlineListView']['items']['find'](_0x5c9ba5=>_0x5c9ba5 instanceof y)){const _0x3b221b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x3b221b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x475242['inlineListView']['items']['add'](_0x475242['counterView']);}return _0x1b7f9b||this['hideDropdown'](),_0x1b7f9b;}),_0x475242['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x5066aa=>{const _0x1d99c3=_0x34f573['config']['get']('presenceList'),_0x330f03=new _(_0x34f573['locale'],_0x5066aa,!!_0x1d99c3['onClick']);return _0x330f03['bind']('hasTooltip')['to'](_0x475242,'isCollapsed',_0x46c36b=>!_0x46c36b),_0x330f03['bind']('isFocusable')['to'](_0x475242,'isCollapsed',_0x40496c=>!_0x40496c),_0x1d99c3['onClick']&&this['listenTo'](_0x330f03,'execute',()=>{this['view']['isCollapsed']||_0x1d99c3['onClick'](_0x5066aa,_0x330f03['element']);}),_0x330f03;}),this['listenTo'](_0x475242['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x475242['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x475242['inlineListView']['keystrokes']['set']('Enter',(_0x453303,_0x58d6fc)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x58d6fc());}),_0x475242['render'](),_0x17af5f['render'](),_0x57079e({'emitter':_0x475242,'activator':()=>_0x17af5f['isVisible'],'contextElements':[_0x17af5f['element'],_0x475242['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x34f573['config']['get']('presenceList.container')['appendChild'](_0x475242['element']),this['_bodyCollection']=new _0x4dede1(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x475242;}['_handleUserAdd'](_0x3213f9){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3213f9['isMe'])return;const _0x28480c=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x28480c-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4c74a5=_0x3213f9['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3213f9,_0x4c74a5);}['_handleUserRemove'](_0x37a827){this['usersCount']--;const {collapseAt:_0x1d62f9}=this['context']['config']['get']('presenceList'),_0x59274e=this['usersCount']>=_0x1d62f9;if(this['currentDisplayedUsers']['get'](_0x37a827['id']))this['currentDisplayedUsers']['remove'](_0x37a827['id']);else{if(_0x59274e&&this['currentDisplayedUsers']['length']+0x1===_0x1d62f9-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x59274e?0x1:0x0)<this['usersCount']){for(const _0x1f70a3 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1f70a3['id'])&&(this['currentDisplayedUsers']['add'](_0x1f70a3,Math['min'](this['currentDisplayedUsers']['length']-(_0x59274e?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x59274e?0x1:0x0)===_0x1d62f9-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x7d246f=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x7d246f['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0xd3030c}=this['presenceDropdownView'];_0xd3030c['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3b6034=>{if(!_0x7d246f['displayMe']&&_0x3b6034['isMe'])return null;const _0x5ea328=new P(this['context']['locale'],_0x3b6034,!!_0x7d246f['onClick']);return _0x7d246f['onClick']&&this['listenTo'](_0x5ea328,'execute',()=>{_0x7d246f['onClick'](_0x3b6034,_0x5ea328['element']);}),_0x5ea328;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0xd3030c['focus'](),_0xd3030c['checkIfScrollable']();const _0x474a29=(_0x5665e0,_0x445672)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x445672();};_0xd3030c['keystrokes']['set']('Esc',_0x474a29),_0xd3030c['keystrokes']['set']('Shift+Tab',_0x474a29),_0xd3030c['keystrokes']['set']('Tab',(_0x4c878f,_0x594c4e)=>{!function(_0xe325a9){const _0x285726=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x53996b=>_0x53996b+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3d518f=[...document['body']['querySelectorAll'](_0x285726)]['filter'](_0x1b7a8e=>_0x1b7a8e===document['activeElement']||_0x1b7a8e['offsetWidth']+_0x1b7a8e['offsetHeight']>0x0)['sort']((_0xa37c8c,_0x44c50b)=>(_0xa37c8c['tabIndex']||0x0)-(_0x44c50b['tabIndex']||0x0)),_0xbf12aa=_0x3d518f['indexOf'](_0xe325a9),_0xd4950=_0x3d518f[(_0xbf12aa+0x1)%_0x3d518f['length']];_0xd4950&&_0xd4950['focus']();}(this['view']['element']),this['hideDropdown'](),_0x594c4e();}),_0xd3030c['focusTracker']['add'](this['view']['element']),_0xd3030c['focusTracker']['on']('change:isFocused',(_0x2e8195,_0x3cbe6d,_0x1a0c9c)=>{_0x1a0c9c||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class gt extends _0x5eed8d{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway,C as _RtcPresenceDropdownListView,pt as _RtcPresenceDropdownListWrapperView,k as _RtcPresenceListView};
23
+ import{ContextPlugin as _0x29ab63,Plugin as _0x516461,PendingActions as _0x30d298,Context as _0x1b02df}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x59b76d,CKEditorError as _0xac8d7f,Collection as _0xedfe61,global as _0x5a5cb2,version as nt,uid as _0x32f4d4,KeystrokeHandler as _0x38c104}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4548d6,View as _0x178204,ListView as _0x79bd65,ListItemView as et,LabelView as it,BalloonPanelView as _0x2fe979,clickOutsideHandler as _0x5cda66,BodyCollection as _0xea0b6d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x498e06,History as _0x4eedc5,NoOperation as _0x3bc5d4,InsertOperation as _0xb92ff2,MarkerOperation as _0x3056ac,RootAttributeOperation as _0x599c8f,transformOperationSets as _0x5418fa,OperationFactory as _0x51f99f}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x132d53,CollaborativeEditingService as _0x145a9c,User as ct,CommentsService as _0x4ebf34,TrackChangesService as _0x4ce9d2,RevisionHistoryService as _0x5cc90d,EditorService as _0x10ae17}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x530760,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xcad2c5}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x4cf03f}from'es-toolkit/compat';class n extends _0x29ab63{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4548d6];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x220550){super(_0x220550),this['set']('state',_0x132d53['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x59b76d())();}['init'](){const _0x37109b=this['context'],_0x4b4785=_0x37109b['plugins']['get']('CloudServices'),_0x223027=_0x37109b['plugins']['get'](_0x4548d6);if(!_0x4b4785['token'])throw new _0xac8d7f('websocketgateway-missing-token',this);if(!_0x4b4785['webSocketUrl'])throw new _0xac8d7f('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),n['WebSocketGateway']['connect'](_0x4b4785['token'],_0x4b4785['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x579db5=>{if(this['connection']=_0x579db5,this['bind']('state')['to'](_0x579db5,'state',this,'_isBrowserOffline',(_0x426661,_0x50bbde)=>('connected'!==_0x426661&&(this['_shouldPluginsReconnect']=!0x0),_0x50bbde||_0x426661!==_0x132d53['CONNECTED']?_0x132d53['DISCONNECTED']:this['state']==_0x132d53['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x132d53['CONNECTING']):_0x132d53['CONNECTED'])),this['connection']['on']('error',(_0x40d9d9,_0x5764d9)=>{if('limitExceeded'!==_0x5764d9['code'])throw console['error'](_0x5764d9),new _0xac8d7f('cloudservices-init',null,{'originalError':_0x5764d9});_0x223027['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'});}),!_0x579db5['me'])return new Promise(_0x538b85=>_0x579db5['on']('change:me',_0x538b85));})['catch'](_0x459883=>{throw console['error'](_0x459883),new _0xac8d7f('cloudservices-init',null,{'originalError':_0x459883});});}['addToReconnectionStack'](_0xfae40e){if('function'!=typeof _0xfae40e['reconnect'])throw new _0xac8d7f('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0xfae40e))throw new _0xac8d7f('websocketgateway-plugin-already-registered',this,{'name':_0xfae40e['constructor']['pluginName']});this['_reconnectionStack']['add'](_0xfae40e);}['removeFromReconnectionStack'](_0x4cdabc){this['_reconnectionStack']['delete'](_0x4cdabc);}['isInReconnectionStack'](_0x263425){return this['_reconnectionStack']['has'](_0x263425);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x456720=>_0x456720['reconnect']())))['then'](()=>this['state']=_0x132d53['CONNECTED'])['catch'](_0x51030e=>{throw console['error'](_0x51030e),new _0xac8d7f('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x132d53['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x29ab63{['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[n,_0x530760];}constructor(_0x2613fb){super(_0x2613fb),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0xedfe61(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x530760);}['init'](){const _0x886ae1=this['context']['plugins']['get'](n);this['listenTo'](_0x886ae1,'change:state',(_0x44fba8,_0x5060d6,_0x51af0e)=>{if('connected'!==_0x51af0e)this['channelSessions']['forEach'](_0x272d9d=>_0x272d9d['clear']()),this['channelConnectedUsers']['forEach'](_0x9c3855=>_0x9c3855['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x40b40b,_0x2262f5]of this['_registeredSessions'])for(const _0x2cfaf4 of _0x2262f5)this['_handleSessionAdd'](_0x40b40b,_0x2cfaf4);}}),this['_createUser'](_0x886ae1['connection']['me'],!0x0);}['register'](_0x5b82dd,_0x4b414f){if(this['_registeredSessions']['has'](_0x5b82dd))throw new _0xac8d7f('sessions-register-already-registered',null,{'channelId':_0x5b82dd});this['_registeredSessions']['set'](_0x5b82dd,_0x4b414f),this['channelSessions']['set'](_0x5b82dd,new _0xedfe61()),this['channelConnectedUsers']['set'](_0x5b82dd,new _0xedfe61()),this['listenTo'](_0x4b414f,'add',(_0x161b3d,_0x13e60d)=>this['_handleSessionAdd'](_0x5b82dd,_0x13e60d)),this['listenTo'](_0x4b414f,'remove',(_0x2c8ea2,_0x130925)=>this['_handleSessionRemove'](_0x5b82dd,_0x130925));for(const _0x1c5c36 of _0x4b414f)this['_handleSessionAdd'](_0x5b82dd,_0x1c5c36);}['unregister'](_0x248ef8){if(!this['_registeredSessions']['has'](_0x248ef8))throw new _0xac8d7f('sessions-unregister-not-exist',null,{'channelId':_0x248ef8});const _0x6c2344=this['_registeredSessions']['get'](_0x248ef8);this['stopListening'](_0x6c2344);for(const _0x19ebb6 of _0x6c2344)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x248ef8,_0x19ebb6);this['_registeredSessions']['delete'](_0x248ef8),this['channelSessions']['delete'](_0x248ef8),this['channelConnectedUsers']['delete'](_0x248ef8);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x511471){for(const _0xaa690a of this['channelSessions']['values']())for(const _0x2135fe of _0xaa690a)if(_0x2135fe['id']===_0x511471)return _0x2135fe['user'];}['getUserSessions'](_0xa4d5ad,_0x32c91c){const _0x28807c=_0x32c91c?[this['channelSessions']['get'](_0x32c91c)]:this['channelSessions']['values'](),_0x222635=new Set();for(const _0xf93006 of _0x28807c)for(const _0x3cbd60 of _0xf93006)_0x3cbd60['user']['id']===_0xa4d5ad['id']&&_0x222635['add'](_0x3cbd60['id']);return _0x222635;}['getUserRole'](_0x57b12d){for(const _0x46e229 of this['channelSessions']['values']())for(const _0x5cb718 of _0x46e229)if(_0x5cb718['user']===_0x57b12d)return _0x5cb718['role'];}['_handleSessionAdd'](_0x55d0b3,_0x39bf23){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1c6ba1=_0x39bf23['user'],_0x42f008=this['_users']['getUser'](_0x1c6ba1['id'])||this['_createUser'](_0x1c6ba1),_0x2250ee=Object['assign']({},_0x39bf23,{'user':_0x42f008});this['channelSessions']['get'](_0x55d0b3)['add'](_0x2250ee);const _0x30711b=this['channelConnectedUsers']['get'](_0x55d0b3);_0x30711b['has'](_0x42f008['id'])||_0x30711b['add'](_0x42f008),this['allConnectedUsers']['has'](_0x42f008['id'])||this['allConnectedUsers']['add'](_0x42f008,_0x42f008['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x55d0b3,{'channelId':_0x55d0b3,'session':_0x2250ee});}['_handleSessionRemove'](_0x5a7342,_0x4cde94){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x100a16=this['channelConnectedUsers']['get'](_0x5a7342),_0x3da3ac=_0x4cde94['user'];_0x3da3ac['id']&&(this['channelSessions']['get'](_0x5a7342)['remove'](_0x4cde94['id']),_0x100a16['has'](_0x3da3ac['id'])&&!this['getUserSessions'](_0x3da3ac,_0x5a7342)['size']&&_0x100a16['remove'](_0x3da3ac['id']),this['allConnectedUsers']['get'](_0x3da3ac['id'])&&!this['getUserSessions'](_0x3da3ac)['size']&&this['allConnectedUsers']['remove'](_0x3da3ac['id']));}['_createUser'](_0x26c0f0,_0x1b3d15){const _0x65dfe3=this['_users']['addUser'](_0x26c0f0);return _0x1b3d15&&this['_users']['defineMe'](_0x26c0f0['id']),_0x65dfe3['orderNumber']=this['_uniqueUsersCount']++,_0x65dfe3;}}class $ extends _0x516461{['_domEmitter']=new(_0x59b76d())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x13e568=this['editor'],_0x5acce8=_0x13e568['plugins']['get'](i);_0x13e568['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1d5033,{writer:_0x8a2b28})=>function(_0x213209,_0x4416a3,_0x426aea,_0x2a27d9){const _0x3f6682=_0x213209['markerName']['split'](':')[0x2],_0x10bf9d=_0x426aea['getUserBySessionId'](_0x3f6682);if(!_0x10bf9d||_0x3f6682===_0x426aea['mySessionId'])return;if(!_0x2a27d9['model']['schema']['checkChild'](_0x213209['markerRange']['start'],'$text'))return;const _0x5f3c7c={'class':'ck-user__marker\x20'+_0x10bf9d['color']['getMarkerClass'](),'data-name':_0x10bf9d['name'],'data-session-id':_0x3f6682},_0x21ab62=_0x2a27d9['model']['markers']['get'](_0x213209['markerName']),_0x13cd6b=_0x21ab62['getStart'](),_0x20c697=_0x13cd6b['nodeAfter'],_0x439a16=_0x2a27d9['model']['schema'];if(_0x20c697&&_0x439a16['isObject'](_0x20c697)&&_0x439a16['isInline'](_0x20c697)&&!_0x2a27d9['model']['markers']['get']('user:range:'+_0x3f6682)['getRange']()['isCollapsed'])return;const _0x15b94c=_0x13cd6b['parent'];return _0x2a27d9['model']['schema']['isLimit'](_0x15b94c)&&!_0x2a27d9['model']['hasContent'](_0x15b94c)&&(_0x5f3c7c['contenteditable']=!0x1),function(_0x17b020,_0x187c02,_0x511f10){const _0x238bf9=_0x17b020['createUIElement']('span',_0x187c02);return _0x17b020['setCustomProperty']('userPositionMarker',!0x0,_0x238bf9),_0x238bf9['render']=function(_0x38ec89){const _0xb0fd05=this['toDomElement'](_0x38ec89),_0x366cfb=document['createElement']('span');return _0x366cfb['classList']['add']('ck-user__marker-tooltip'),_0x366cfb['setAttribute']('contenteditable','false'),_0x366cfb['setAttribute']('spellcheck','false'),_0x366cfb['textContent']=_0x511f10['name'],_0xb0fd05['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x366cfb['outerHTML']+'⁠',_0xb0fd05['addEventListener']('mouseenter',()=>{_0xb0fd05['classList']['add']('ck-user__marker_hovered');}),_0xb0fd05['addEventListener']('mouseleave',()=>{_0xb0fd05['classList']['remove']('ck-user__marker_hovered');}),_0xb0fd05;},_0x238bf9['isSimilar']=function(_0x493c75){return!(!this['getCustomProperty']('userPositionMarker')||!_0x493c75['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x493c75['getAttribute']('data-session-id'));},_0x238bf9;}(_0x4416a3,_0x5f3c7c,_0x10bf9d);}(_0x1d5033,_0x8a2b28,_0x5acce8,_0x13e568)}),_0x13e568['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1452ac=>function(_0x3d3bf1,_0x56d833){const _0x1d4b63=_0x3d3bf1['markerName']['split'](':')[0x2];if(_0x1d4b63===_0x56d833['mySessionId'])return null;const _0x219f14=_0x56d833['getUserBySessionId'](_0x1d4b63);if(!_0x219f14)return{'id':_0x1d4b63,'classes':[]};return{'id':_0x1d4b63,'classes':['ck-user__selection',_0x219f14['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x1d4b63},'priority':0x7d0+_0x219f14['orderNumber']};}(_0x1452ac,_0x5acce8)}),function(_0x73f5b9){const _0x3177e3=_0x73f5b9['model'],_0x28df70=new Map(),_0x324b9f=_0x73f5b9['plugins']['get'](i);_0x3177e3['markers']['on']('update:user:range',(_0x899249,_0x89b1d0,_0x348a79,_0x382869)=>{if(!_0x382869&&_0x28df70['get'](_0x89b1d0['name']))return _0x28df70['get'](_0x89b1d0['name'])['detach'](),void _0x28df70['delete'](_0x89b1d0['name']);const _0x3a3c89=_0x89b1d0['name']['split'](':')[0x2];if(_0x3a3c89===_0x324b9f['mySessionId'])return;const _0x2b3be4='user:position:'+_0x3a3c89;_0x3177e3['markers']['has'](_0x2b3be4)&&_0x73f5b9['editing']['reconvertMarker'](_0x2b3be4),_0x89b1d0['on']('change:range',(_0x5e7021,_0x4c39d3,_0x3ebebf)=>{if('$graveyard'!=_0x4c39d3['root']['rootName']&&'$graveyard'==_0x89b1d0['getRange']()['root']['rootName']&&!_0x28df70['has'](_0x89b1d0['name'])){const _0x3bfcd3=_0x3177e3['schema']['getNearestSelectionRange'](_0x3ebebf['deletionPosition']);if(_0x3bfcd3){const _0xda78d1=_0x498e06['fromRange'](_0x3bfcd3);_0x28df70['set'](_0x89b1d0['name'],_0xda78d1),_0xda78d1['on']('change:range',(_0x5587ff,_0xf40a20,_0xb23199)=>{if('$graveyard'==_0xda78d1['root']['rootName']){const _0x5d7f2b=_0x3177e3['schema']['getNearestSelectionRange'](_0xb23199['deletionPosition']);_0x5d7f2b?(_0xda78d1['start']=_0x5d7f2b['start'],_0xda78d1['end']=_0x5d7f2b['end']):(_0x28df70['delete'](_0x89b1d0['name']),_0xda78d1['detach']());}});}}});}),_0x3177e3['document']['on']('change',()=>{_0x28df70['size']>0x0&&_0x3177e3['enqueueChange']({'isUndoable':!0x1},_0x4b7963=>{for(const [_0x1509cc,_0x3c6771]of _0x28df70)'$graveyard'==_0x3177e3['markers']['get'](_0x1509cc)['getRange']()['root']['rootName']&&(te(_0x1509cc['split'](':')[0x2],_0x3c6771['toRange'](),_0x3177e3,_0x4b7963),_0x3c6771['detach']());_0x28df70['clear']();});});}(_0x13e568),this['_domEmitter']['listenTo'](_0x5a5cb2['document'],'keydown',(_0x2b36ba,{key:_0x5d2a34})=>{'Escape'===_0x5d2a34&&function(_0x4eb8b1){_0x4eb8b1['editing']['view']['change'](_0x315493=>{for(const _0x28c055 of _0x4eb8b1['model']['markers']){if(!_0x28c055['name']['startsWith']('user:position'))continue;const _0x243d2f=_0x4eb8b1['editing']['mapper']['markerNameToElements'](_0x28c055['name']);if(_0x243d2f){for(const _0x5edaaf of _0x243d2f)_0x315493['removeClass']('ck-user__marker_hovered',_0x5edaaf);}}});}(_0x13e568);},{'useCapture':!0x0});}['afterInit'](){const _0xf0f286=this['editor'],_0x1987ff=_0xf0f286['commands']['get']('undo');_0x1987ff&&_0xf0f286['model']['on']('applyOperation',(_0x19bd9a,_0x29677d)=>{const _0x46212d=_0x29677d[0x0];if(!_0x46212d['isDocumentOperation'])return;if('marker'!=_0x46212d['type']||!_0x46212d['name']['startsWith']('user:'))return;const _0x256ad6=_0x46212d['batch'];_0x1987ff['_createdBatches']['has'](_0x256ad6)&&(_0x46212d['newRange']=_0x46212d['oldRange']?_0xf0f286['model']['createRange'](_0x46212d['oldRange']['start'],_0x46212d['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x4984f7=this['editor'],_0x4950d0=_0x4984f7['model']['document'],_0x4f672b=_0x4984f7['plugins']['get'](i);_0x4984f7['model']['enqueueChange']({'isUndoable':!0x1},_0xef689d=>{const _0x29d029='user:range:'+_0x4f672b['mySessionId'],_0x52157f='user:position:'+_0x4f672b['mySessionId'],_0x42b603=_0x4984f7['model']['markers']['has'](_0x29d029);_0x4984f7['editing']['view']['hasDomSelection']?te(_0x4f672b['mySessionId'],_0x4950d0['selection']['getFirstRange'](),_0x4984f7['model'],_0xef689d):_0x42b603&&(_0xef689d['removeMarker'](_0x29d029),_0xef689d['removeMarker'](_0x52157f));});}}function te(_0x5e6bad,_0x1f5d90,_0x344fb6,_0x2fdddb){const _0x580e47='user:range:'+_0x5e6bad,_0x5121bb='user:position:'+_0x5e6bad,_0x4bba18=_0x1f5d90['getContainedElement']();let _0x1f1c9a=_0x1f5d90['start'];if(_0x4bba18&&_0x4bba18['is']('element','tableCell')){const _0x310e83=function(_0xe0d27,_0x51063b){for(const _0x590805 of _0xe0d27['getPositions']())if(_0x51063b['schema']['checkChild'](_0x590805,'$text'))return _0x590805;}(_0x1f5d90,_0x344fb6);_0x310e83&&(_0x1f1c9a=_0x310e83,_0x1f5d90=_0x2fdddb['createRange'](_0x1f1c9a));}const _0x29b9c6=_0x2fdddb['createRange'](_0x1f1c9a);_0x344fb6['markers']['has'](_0x580e47)?(_0x2fdddb['updateMarker'](_0x580e47,{'range':_0x1f5d90}),_0x2fdddb['updateMarker'](_0x5121bb,{'range':_0x29b9c6})):(_0x2fdddb['addMarker'](_0x580e47,{'range':_0x1f5d90,'usingOperation':!0x0}),_0x2fdddb['addMarker'](_0x5121bb,{'range':_0x29b9c6,'usingOperation':!0x0}));}function K(_0x3cceb4,_0x2fda97,_0x53ed0e){const _0x4ada04=_0x3cceb4['t'],t=_0x3cceb4['t'];switch(_0x2fda97){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 _0x4ada04({'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'},_0x53ed0e);default:return'';}}let X=0x1;class l extends _0x516461{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x145a9c)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,$,_0x30d298,_0x530760,_0x4548d6];}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 _0x19bfd5=this['serverHistory']['getOperations']();for(let _0x57351e=_0x19bfd5['length']-0x1;_0x57351e>=0x0;_0x57351e--){const _0x4f5ec8=_0x19bfd5[_0x57351e];if(!this['_disconnectionOperations']['has'](_0x4f5ec8))return _0x4f5ec8['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x5043c){if(super(_0x5043c),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x4eedc5(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0xac8d7f('collaboration-missing-channelid',this);const _0x5942fa=_0x5043c['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x5942fa,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xcad2c5(),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 tt(this['_disconnectionOperations']);}['init'](){const _0xed43c7=this['editor'],_0x9895e7=_0xed43c7['plugins']['get'](_0x530760),_0xb2c499=_0xed43c7['plugins']['get'](n);this['listenTo'](_0x9895e7,'getOperationAuthor',(_0x2c3f4b,_0x153d8a)=>{const _0x1e16e6=_0x153d8a[0x0];_0x1e16e6['_authorId']&&(_0x2c3f4b['return']=_0x9895e7['getUser'](_0x1e16e6['_authorId']),_0x2c3f4b['stop']()),null===_0x1e16e6['_authorId']&&(_0x2c3f4b['return']=null,_0x2c3f4b['stop']());},{'priority':'high'}),this['listenTo'](_0xed43c7['model']['document']['selection'],'change:range',(_0x3218ba,_0x546cf6)=>{_0x546cf6['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xed43c7['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xed43c7['model']['on']('applyOperation',(_0x34c181,_0x1339e7)=>{const _0x96de0f=_0x1339e7[0x0];_0x96de0f['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x96de0f),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0xb2c499,'state',this,'_hasSynchronizationProblem',(_0x4931af,_0x2e1c39)=>'connected'===_0x4931af&&!_0x2e1c39),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xed43c7['disableReadOnlyMode']('rtc-offline'):_0xed43c7['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xed43c7['disableReadOnlyMode']('rtc-offline'):_0xed43c7['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x466cea=this['editor']['plugins']['get'](i),_0x150f9b=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x466cea['unregister'](this['_channelId']);const _0x221c35=await this['_service']['reconnect'](_0x150f9b['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x221c35)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4fdc1c=await this['_service']['getConnectedSessions']();_0x466cea['register'](this['_channelId'],_0x4fdc1c),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xde2930){if(function(_0x1f8e6f){return'404'===_0x1f8e6f['code'];}(_0xde2930)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3c212e){return'409'===_0x3c212e['code'];}(_0xde2930)){const _0x28626a=K(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'](_0x28626a);}else{if(!(_0xde2930 instanceof Y))throw _0xde2930;this['_handleReconnectionError']();}}}}['destroy'](){const _0x6bfcea=this['editor']['plugins']['get'](n),_0xd472af=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0xd472af['channelSessions']['has'](this['_channelId'])&&_0xd472af['unregister'](this['_channelId']),_0x6bfcea['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x3e77d2){if(this['sessionId']!==_0x3e77d2['sessionId']&&this['_lastSyncedOperationId']!==_0x3e77d2['lastOperationId'])throw new Y();return this['sessionId']=_0x3e77d2['sessionId'],this['_handleServerResponse']([],{..._0x3e77d2,'wereChangesApplied':!0x1,'data':_0x3e77d2['data']},'reconnect');}async['_connectService'](_0x8cfa17,_0x20a94e=!0x1){const {connection:_0x1ca6ac}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1ca6ac,this['_channelId'])['then'](_0x225bd3=>this['_initSessionsHandling'](_0x225bd3))['catch'](_0x46b4d5=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x46b4d5);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x51e553,_0x3ceff0)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3ceff0);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x4376fe=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x8cfa17);this['_isPendingUpdate']=!0x0;const _0x574021=await this['_service']['connect'](_0x1ca6ac,this['_compressOperations'](_0x8cfa17),_0x4376fe);if(this['sessionId']=_0x574021['sessionId'],_0x20a94e){if(!_0x574021['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x574021['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x8cfa17,_0x574021,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x574021,_0x8cfa17);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4cb953=this['editor']['plugins']['get'](i),_0x4a6f6f=this['editor']['plugins']['get']($),_0x121430=_0x4cb953['channelSessions']['get'](this['_channelId']);_0x121430&&_0x121430['length']>0x1?_0x4a6f6f['createUserMarkerOperations']():this['listenTo'](_0x4cb953,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4cb953['channelSessions']['get'](this['_channelId'])['length']&&_0x4a6f6f['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x271fea,_0x2a04dc,_0x865892,_0x52838c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2a04dc){const _0x4de098=this['_decompressOperations'](_0x865892,_0x52838c);await this['_fetchMissingUsers'](_0x4de098),this['_handleExternalOperations'](_0x4de098,_0x2a04dc,_0x865892['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x46bbb5}=this['editor'];let _0x159a22;try{_0x159a22=await this['_service']['getDocumentDetails']();}catch{const _0xe84172=K(_0x46bbb5,'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'](_0xe84172);}const _0x799339=_0x159a22['currentDocumentSession']||_0x159a22['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x799339['lastOperationId']){const _0xa57491=K(_0x46bbb5,'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'](_0xa57491);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x2d798c){const _0x3c29c3=this['editor']['plugins']['get'](i);this['listenTo'](_0x3c29c3,'sessionAdd:'+this['_channelId'],(_0x163418,{session:_0x5373d9})=>{if(_0x5373d9['id']===_0x3c29c3['mySessionId']){_0x163418['off']();const _0x126174=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x541c79=_0x5373d9['permissions'];_0x126174&&_0x126174['isEnabled']&&(_0x541c79=_0x541c79['filter'](_0x4d4e80=>'document:write'!==_0x4d4e80)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x541c79,this['_channelId']);}}),_0x3c29c3['register'](this['_channelId'],_0x2d798c);}['_initThrowingOnDataSet'](){const _0x5487b2=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x9bb4e7)=>{if(!_0x9bb4e7[_0x9bb4e7['length']-0x1]['suppressErrorInCollaboration'])throw new _0xac8d7f('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5487b2['apply'](this['editor']['data'],_0x9bb4e7);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x443ab4,[_0xe5bb88])=>{if(this['_document']['version'])throw new _0xac8d7f('realtimecollaborationclient-init-document-already-initialized',this);_0x443ab4['stop'](),this['_setPendingAction']();const _0x436e3a=this['editor']['config']['get']('rootsAttributes'),_0x55c78a=this['_getOperationsFromInitData'](_0xe5bb88,_0x436e3a);0x0==_0x55c78a['length']&&_0x55c78a['push'](new _0x3bc5d4(0x0)),_0x443ab4['return']=this['_connectService'](_0x55c78a)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x549468=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x549468))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3a3e30,[_0x544202,_0x87677e])=>{_0x3a3e30['stop']();const _0x4acca5=this['editor']['model']['document']['getRoot'](_0x544202);if(!this['_knownRootNames']['has'](_0x544202)){const _0x194b50=_0x87677e&&_0x87677e['data']?_0x87677e['data']:'',_0x44f843=_0x87677e&&_0x87677e['attributes']?_0x87677e['attributes']:{};await this['_loadRoot'](_0x544202,_0x194b50,_0x44f843);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4acca5['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4acca5);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x4d2195){const _0x3205a9=this['editor']['plugins']['get'](_0x530760),{connection:_0x47b654}=this['editor']['plugins']['get'](n),_0x200b87=new Set();for(const _0x468788 of _0x4d2195){const _0x39951b=_0x468788['_authorId'];_0x39951b&&!_0x3205a9['getUser'](_0x39951b)&&_0x200b87['add'](_0x39951b);}if(0x0===_0x200b87['size'])return;const _0x4ff0bd=await ct['getMany'](_0x47b654,Array['from'](_0x200b87));for(const _0x4c886a of _0x4ff0bd)_0x3205a9['getUser'](_0x4c886a['id'])||_0x3205a9['addUser'](_0x4c886a);}['_getOperationsFromInitData'](_0x5798e1,_0x1646e5={}){const _0x519421=this['editor']['model'],_0x1a1ce3=[];let _0x1a915f=0x0;const _0x2bdeed='string'==typeof _0x5798e1?{'main':_0x5798e1}:_0x5798e1;for(const _0x115c3d of Object['keys'](_0x2bdeed)){if(!this['_document']['roots']['has'](_0x115c3d))throw new _0xac8d7f('realtimecollaborationclient-init-non-existent-root',this);const _0x111f6f=this['editor']['data']['parse'](_0x2bdeed[_0x115c3d]),_0x144713=this['_document']['getRoot'](_0x115c3d),_0x3dc1f7=new _0xb92ff2(_0x519421['createPositionAt'](_0x144713,0x0),_0x111f6f,_0x1a915f++);_0x1a1ce3['push'](_0x3dc1f7);for(const [_0x2fc413,_0x5e103e]of _0x111f6f['markers']){const _0x21be0e=_0x519421['createRange'](_0x519421['createPositionFromPath'](_0x144713,_0x5e103e['start']['path']['slice']()),_0x519421['createPositionFromPath'](_0x144713,_0x5e103e['end']['path']['slice']())),_0x174812=new _0x3056ac(_0x2fc413,null,_0x21be0e,_0x519421['markers'],!0x0,_0x1a915f++);_0x1a1ce3['push'](_0x174812);}}if(_0x1646e5)for(const [_0x49dccb,_0x39753d]of Object['entries'](_0x1646e5)){const _0x11d69f=_0x519421['document']['getRoot'](_0x49dccb);if(!_0x11d69f)throw new _0xac8d7f('multi-root-editor-root-attributes-no-root',null);for(const [_0x2117c2,_0x1ef482]of Object['entries'](_0x39753d))if(null!==_0x1ef482){const _0x5cd75d=new _0x599c8f(_0x11d69f,_0x2117c2,null,_0x1ef482,_0x1a915f++);_0x1a1ce3['push'](_0x5cd75d);}}return _0x1a1ce3;}async['_loadRoot'](_0x55bc44,_0x1bdbdd,_0x2b3b0a){this['_getOperationsFromInitData']({[_0x55bc44]:_0x1bdbdd},{[_0x55bc44]:_0x2b3b0a})['forEach']((_0x2bfc81,_0x58add3)=>{_0x2bfc81['baseVersion']=this['_document']['version']+_0x58add3,_0x2bfc81['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2bfc81);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5c3928,_0x4fa61c){let _0x1b61f4;this['_offset']=_0x5c3928['offset'];const _0x1390a3=_0x5c3928['wereChangesApplied']&&!_0x5c3928['initData'],_0x5858d4=_0x1390a3?0x0:_0x5c3928['data']['baseVersion'];if(_0x4fa61c['forEach'](_0xbfc21e=>{_0xbfc21e['_isInit']=!0x0,_0xbfc21e['createdAt']=_0x5c3928['sessionCreatedAt'],_0xbfc21e['_authorId']=null;}),_0x1390a3)_0x1b61f4=_0x4fa61c,this['_applyOperationsSet'](_0x1b61f4,_0x1390a3);else{if(_0x5c3928['initData']){const _0x32d7a7=this['_getOperationsFromInitData'](_0x5c3928['initData']);this['_document']['history']['version']=-_0x32d7a7['length'],_0x32d7a7['forEach'](_0x28c98d=>{_0x28c98d['baseVersion']-=_0x32d7a7['length'],_0x28c98d['createdAt']=_0x5c3928['sessionCreatedAt'],_0x28c98d['_isInit']=!0x0,_0x28c98d['_authorId']=null;}),this['_applyOperationsSet'](_0x32d7a7,!0x0),this['serverHistory']['version']=-_0x32d7a7['length']+this['_offset'],this['_updateServerHistory'](_0x32d7a7);}this['_document']['history']['version']=_0x5858d4,_0x1b61f4=this['_decompressOperations'](_0x5c3928['data'],_0x5c3928['metadata']),await this['_fetchMissingUsers'](_0x1b61f4),this['_applyOperationsSet'](_0x1b61f4,_0x1390a3);}_0x5c3928['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1b61f4,_0x5c3928['lastOperationId']),this['_lastSyncedOperationId']=_0x5c3928['lastOperationId']),this['serverHistory']['version']=_0x5858d4+this['_offset'],this['_updateServerHistory'](_0x1b61f4),_0x4fa61c['filter'](_0x4281a8=>{const _0x5a11d0=this['_getAffectedRoot'](_0x4281a8);return _0x5a11d0&&!this['_knownRootNames']['has'](_0x5a11d0);})['forEach']((_0xa56f6c,_0x3ae341)=>{_0xa56f6c['baseVersion']=this['_document']['version']+_0x3ae341,this['_saveOperationInBuffer'](_0xa56f6c);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x27ae0f,_0x16e278){const _0x8c4881=_0x16e278&&_0x16e278['message'];if(_0x8c4881&&_0x8c4881['startsWith']('realtimecollaborationclient'))throw _0x16e278;const _0x201ada=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x201ada['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0xac8d7f(_0x27ae0f,this['editor'],_0x8c4881?{'originalError':_0x8c4881}:void 0x0);}['_saveOperationInBuffer'](_0x447267){this['_knownOperations']['has'](_0x447267)||(this['_knownOperations']['add'](_0x447267),this['_bufferedOperations']['push'](_0x447267),this['_pendingAction']||'marker'==_0x447267['type']&&!_0x447267['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5506a2=!0x1){!_0x5506a2&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x8e6d8a=>{_0x8e6d8a&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x23dfee=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xc6931c){return _0xc6931c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xc6931c['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xc6931c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x23dfee)||this['_crash'](_0x23dfee['message'],_0x23dfee);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x45dc61=>{this['on']('change:_isPendingUpdate',()=>{_0x45dc61();});});}async['_sendBufferedOperations'](){const _0x1656bb=this['editor']['plugins']['get']($);if(this['_shouldSendSelectionUpdate']()&&(_0x1656bb['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xe57be2=[...this['_bufferedOperations']];for(const _0x1cf6ef of _0xe57be2)_0x1cf6ef['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1cf6ef);const _0x1c18e8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xe57be2),_0x2da9f3=X++,_0x37c86a=this['_compressOperations'](_0xe57be2),_0xff7843=await this['_service']['sendOperations'](_0x37c86a,_0x37c86a['baseVersion'],_0x1c18e8);try{return await this['_handleServerResponse'](_0xe57be2,_0xff7843,_0x2da9f3);}catch(_0x26f1d){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x26f1d);}}async['_handleServerResponse'](_0x5b72f2,_0x35478f,_0x1a0142){if('error'in _0x35478f)throw _0x35478f['error'];let _0x134a91=!0x1;if(_0x35478f['wereChangesApplied']){_0x35478f['lastOperationId']&&(this['_lastSyncedOperationId']=_0x35478f['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x31e2ad=>!_0x5b72f2['includes'](_0x31e2ad));for(const _0x5d73ec of _0x5b72f2)_0x5d73ec['createdAt']='lastOperationAcceptedAt'in _0x35478f&&_0x35478f['lastOperationAcceptedAt']||void 0x0;Z(_0x5b72f2,_0x35478f['version']-_0x5b72f2['length']),this['_updateServerHistory'](_0x5b72f2);const _0x4445a2=_0x5b72f2['filter'](_0x3ae9d2=>{if(!_0x3ae9d2['_isInit'])return!0x1;const _0x46ac62=this['_getAffectedRoot'](_0x3ae9d2);return _0x46ac62&&!this['_knownRootNames']['has'](_0x46ac62);});Z(_0x4445a2,this['_document']['version']),this['_applyOperationsSet'](_0x4445a2),_0x134a91=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5c48ab=this['_decompressOperations'](_0x35478f['data'],_0x35478f['metadata'])['filter'](_0x5ec287=>_0x5ec287['baseVersion']>=this['_lastServerVersion']);_0x5c48ab['forEach'](_0x4fda45=>this['_addKnownRoot'](_0x4fda45)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xa9170f=>!_0xa9170f['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xa9170f))),this['_bufferedOperations']['length']&&Z(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5c48ab),_0x134a91=this['_handleExternalOperations'](_0x5c48ab,_0x35478f['version'],_0x35478f['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x134a91?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x108420,_0x4781d3,_0x4bb5fb){try{const _0x35f68b={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x37d862,operationsB:_0x1734c4,originalOperations:_0x2e6d65}=_0x5418fa(_0x108420,this['_bufferedOperations'],_0x35f68b);Z(_0x37d862,this['_document']['version']),Z(_0x1734c4,_0x4781d3);for(const _0x44080d of _0x37d862){const _0xa0197a=_0x2e6d65['get'](_0x44080d);_0x44080d['_authorId']=_0xa0197a?_0xa0197a['_authorId']:null;}_0x4bb5fb&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x108420,_0x4bb5fb),this['_lastSyncedOperationId']=_0x4bb5fb),this['_bufferedOperations']=[..._0x1734c4],this['_applyOperationsSet'](_0x37d862),this['_updateServerHistory'](_0x108420);}catch(_0xdb8d7c){return console['error'](_0xdb8d7c),!0x1;}return!0x0;}['_applyOperationsSet'](_0x6a3617,_0x56e5a8=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4442f8=>{for(const _0x71d374 of _0x6a3617)this['_knownOperations']['add'](_0x71d374),this['_addKnownRoot'](_0x71d374),_0x4442f8['batch']['addOperation'](_0x71d374),this['editor']['model']['applyOperation'](_0x71d374);});}['_addKnownRoot'](_0x15ba7a){const _0x28ce77=this['_getAffectedRoot'](_0x15ba7a);_0x28ce77&&this['_knownRootNames']['add'](_0x28ce77);}['_getAffectedRoot'](_0x151471){let _0xb7a20c,_0x1d4253;switch(_0x151471['type']){case'insert':_0xb7a20c=_0x151471['position']['root'];break;case'marker':if(_0x1d4253=_0x151471['newRange'],!_0x1d4253)return null;_0xb7a20c=_0x1d4253['root'];break;case'addRootAttribute':_0xb7a20c=_0x151471['root'];break;case'addRoot':_0xb7a20c=_0x151471['affectedSelectable'];break;case'move':_0xb7a20c=_0x151471['targetPosition']['root'];break;default:return null;}return _0xb7a20c['rootName'];}['_updateServerHistory'](_0x5dd1a3){_0x5dd1a3['forEach'](_0x4f1a9b=>{const _0x4e7c9e=_0x4f1a9b['clone']();_0x4e7c9e['_authorId']=_0x4f1a9b['_authorId'],_0x4e7c9e['_isInit']=!!_0x4f1a9b['_isInit'],_0x4e7c9e['createdAt']=_0x4f1a9b['createdAt'],_0x4e7c9e['baseVersion']+=this['_offset'],_0x4f1a9b['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4e7c9e),this['serverHistory']['addOperation'](_0x4e7c9e);});}['_handleReconnectionError'](_0x42022b){const _0x1338f6=this['editor']['plugins']['get']('Notification'),_0x1e0186=this['editor']['locale'];_0x42022b||(_0x42022b=K(_0x1e0186,'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.')),_0x1338f6['showWarning'](_0x42022b,{'title':K(_0x1e0186,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x30d298)['add'](K(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x30d298)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x50981d){const _0x5d6336=_0x50981d['map'](_0xf4ca41=>_0xf4ca41['toJSON']());return this['_compressor']['compress'](_0x5d6336);}['_decompressOperations'](_0x1979fb,_0x4c9e24){return this['_compressor']['decompress'](_0x1979fb)['map']((_0x4c394e,_0x2e6b92)=>{const _0x44cf78='init'==_0x4c9e24[_0x2e6b92]['type'];if('InsertOperation'==_0x4c394e['__className']){const _0x8a7047=_0x4c394e['position']['root'];!this['_document']['getRoot'](_0x8a7047)&&(this['_document']['createRoot']('$root',_0x8a7047)['_isAttached']=!0x1);}const _0xd9c3dc=_0x51f99f['fromJSON'](_0x4c394e,this['_document']);return _0xd9c3dc['wasUndone']=_0x4c394e['wasUndone'],_0xd9c3dc['_isInit']=_0x44cf78,_0xd9c3dc['_authorId']=_0x44cf78?null:_0x4c9e24[_0x2e6b92]['userId'],_0xd9c3dc['_isDisconnection']='cs:removeUser'===_0x4c9e24[_0x2e6b92]['type'],_0xd9c3dc['createdAt']=_0x4c9e24[_0x2e6b92]['createdAt'],_0xd9c3dc;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x52d4c0=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x52d4c0&&_0x52d4c0['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Y extends Error{}function Z(_0x39f4d7,_0x35d7de){for(const _0x439f98 of _0x39f4d7)_0x439f98['baseVersion']=_0x35d7de++;}class tt{['_ignoredOperations'];['_operationToId'];constructor(_0x4a70eb){this['_ignoredOperations']=_0x4a70eb,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x541606){let _0x5a19e7=_0x541606['length'];for(;_0x5a19e7--;){const _0x4f21a6=_0x541606[_0x5a19e7];if(!this['_ignoredOperations']['has'](_0x4f21a6)){if(!this['_operationToId']['has'](_0x4f21a6)){const _0x3bdf6f=_0x32f4d4()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4f21a6,_0x3bdf6f);}return this['_operationToId']['get'](_0x4f21a6);}}}['setIdForTheLastOperation'](_0xf6fd7e,_0x37b07f){if(!_0x37b07f)return;let _0x200388=_0xf6fd7e['length'];for(;_0x200388--;){const _0x1c171b=_0xf6fd7e[_0x200388];this['_ignoredOperations']['has'](_0x1c171b)||this['_operationToId']['set'](_0x1c171b,_0x37b07f);}}}class a extends _0x516461{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x29ab63{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x4ebf34)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x530760];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x8e8426){super(_0x8e8426),this['_services']=new Map();}async['init'](){const _0x23f851=this['context'],_0xf615d=_0x23f851['plugins']['get']('CommentsRepository');if(_0x23f851['plugins']['get'](n)['addToReconnectionStack'](this),_0xf615d['adapter']={'addCommentThread':async({channelId:_0x3b88c0,threadId:_0x34a453,comments:_0x3326f4,resolvedAt:_0x12dfec,resolvedBy:_0x8d524c,context:_0x599c58,attributes:_0x30211c})=>{const _0x41f338=await this['_getService'](_0x3b88c0)['addCommentThread']({'commentThreadId':_0x34a453,'comments':_0x3326f4['map'](_0x241018=>function(_0x486e86,_0x159a14,_0x3182b9){return{'commentThreadId':_0x3182b9,'commentId':_0x486e86['commentId'],'userId':_0x486e86['authorId'],'content':_0x486e86['content'],'documentId':_0x159a14,'createdAt':_0x486e86['createdAt'],'attributes':_0x486e86['attributes']||{}};}(_0x241018,_0x3b88c0,_0x34a453)),'resolvedAt':_0x12dfec,'resolvedBy':_0x8d524c,'context':_0x599c58,'attributes':_0x30211c})['catch'](at);return{'threadId':_0x41f338['commentThreadId'],'comments':_0x41f338['comments']};},'getCommentThread':async({channelId:_0x3197b1,threadId:_0x702a75})=>{const _0x20ca39=await this['_getService'](_0x3197b1)['getCommentThread'](_0x702a75)['catch'](at);return _0x20ca39['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x20ca39]),{'threadId':_0x20ca39['commentThreadId'],'comments':_0x20ca39['comments']['map'](p),'context':_0x20ca39['context'],'resolvedAt':_0x20ca39['resolvedAt'],'resolvedBy':_0x20ca39['resolvedBy'],'attributes':_0x20ca39['attributes']||{}});},'updateCommentThread':async({channelId:_0xac5b30,threadId:_0x128a78,context:_0x3014c3,unlinkedAt:_0x3c7a57,attributes:_0x25f164})=>this['_getService'](_0xac5b30)['updateCommentThread']({'commentThreadId':_0x128a78,'context':_0x3014c3,'attributes':_0x25f164,'unlinkedAt':_0x3c7a57})['catch'](v)['catch'](at),'resolveCommentThread':async({channelId:_0x2a3d16,threadId:_0x500330})=>{const _0x27ce85=await this['_getService'](_0x2a3d16)['resolveCommentThread'](_0x500330)['catch'](v)['catch'](at);return{'threadId':_0x27ce85['commentThreadId'],'resolvedAt':_0x27ce85['resolvedAt'],'resolvedBy':_0x27ce85['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2dd8ea,threadId:_0x1c779a})=>this['_getService'](_0x2dd8ea)['reopenCommentThread'](_0x1c779a)['catch'](v)['catch'](at),'removeCommentThread':({channelId:_0x30e153,threadId:_0x183d5d})=>this['_getService'](_0x30e153)['removeCommentThread'](_0x183d5d)['catch'](v)['catch'](at),'addComment':({channelId:_0x2a0ee3,threadId:_0x382063,commentId:_0x7a4db3,content:_0x29e723,attributes:_0x1da831})=>this['_getService'](_0x2a0ee3)['addComment'](_0x382063,_0x7a4db3,_0x29e723,_0x1da831)['catch'](at),'updateComment':({channelId:_0x3aa421,threadId:_0x2813e8,commentId:_0x1832c9,content:_0x5a7eb5,attributes:_0x28da3b})=>this['_getService'](_0x3aa421)['updateComment'](_0x2813e8,_0x1832c9,_0x5a7eb5,_0x28da3b)['catch'](v)['catch'](at),'removeComment':({channelId:_0x546b9b,threadId:_0x34a00e,commentId:_0x170a0c})=>this['_getService'](_0x546b9b)['removeComment'](_0x34a00e,_0x170a0c)['catch'](v)['catch'](at)},_0x23f851 instanceof _0x1b02df){const _0x918e81=_0x23f851['config']['get']('collaboration.channelId'),_0x47305b=_0x23f851['plugins']['get'](i);await this['_setUpService'](_0x918e81);const _0x9e8d4b=await this['_services']['get'](_0x918e81)['getConnectedSessions']();this['listenTo'](_0x47305b,'sessionAdd:'+_0x918e81,(_0x37804f,{session:_0x50184b})=>{_0x50184b['id']===_0x47305b['mySessionId']&&(_0x37804f['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x50184b['permissions'],_0x918e81));}),_0x47305b['register'](_0x918e81,_0x9e8d4b);}}async['_setUpService'](_0x434d50){if(this['_services']['has'](_0x434d50))throw new _0xac8d7f('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x434d50});const _0x56dedd=this['context']['plugins']['get']('CommentsRepository'),_0x86aef6=new s['CommentsService'](_0x434d50);this['_services']['set'](_0x434d50,_0x86aef6),this['listenTo'](_0x86aef6,'commentThreadAdded',(_0x26a14f,_0x3d30cc)=>{const {commentThreadId:_0x5339e3,documentId:_0x15ccc0,context:_0x4d915e,attributes:_0x396eda,resolvedAt:_0x20665d,resolvedBy:_0xd76198,comments:_0xc5e50f}=_0x3d30cc;_0x56dedd['getCommentThread'](_0x5339e3)||_0x56dedd['addCommentThread']({'threadId':_0x5339e3,'channelId':_0x15ccc0,'comments':_0xc5e50f?_0xc5e50f['map'](p):[],'context':_0x4d915e,'attributes':_0x396eda,'resolvedAt':_0x20665d,'resolvedBy':_0xd76198,'isFromAdapter':!0x0});}),this['listenTo'](_0x86aef6,'commentThreadUpdated',(_0xaa4361,{commentThreadId:_0x746d9d,documentId:_0x1c928a,context:_0x1ada50,unlinkedAt:_0x45f723,attributes:_0x660921})=>{_0x56dedd['getCommentThread'](_0x746d9d)&&_0x56dedd['updateCommentThread']({'threadId':_0x746d9d,'channelId':_0x1c928a,'context':_0x1ada50,'unlinkedAt':_0x45f723,'attributes':_0x660921,'isFromAdapter':!0x0});}),this['listenTo'](_0x86aef6,'commentThreadResolved',(_0x1c9a01,{commentThreadId:_0x39942b,resolvedBy:_0x5cdc2b,resolvedAt:_0x265ef7})=>{const _0x1f9002=_0x56dedd['getCommentThread'](_0x39942b);_0x1f9002&&_0x1f9002['resolve']({'resolvedBy':_0x5cdc2b,'resolvedAt':_0x265ef7,'isFromAdapter':!0x0});}),this['listenTo'](_0x86aef6,'commentThreadReopened',(_0x21b3c2,{commentThreadId:_0x351643})=>{const _0x357dde=_0x56dedd['getCommentThread'](_0x351643);_0x357dde&&_0x357dde['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x86aef6,'commentThreadRemoved',(_0x2944ec,{commentThreadId:_0x28cd2a})=>{const _0x14e3ec=_0x56dedd['getCommentThread'](_0x28cd2a);_0x14e3ec&&_0x14e3ec['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x86aef6,'commentAdded',(_0x455de2,_0x55c64e)=>{const _0x45c809=_0x55c64e['commentThreadId'],_0x4c2222=_0x56dedd['getCommentThread'](_0x45c809);_0x4c2222&&_0x4c2222['addComment']({...p(_0x55c64e),'isFromAdapter':!0x0});}),this['listenTo'](_0x86aef6,'commentUpdated',(_0x1b28d1,{commentThreadId:_0xf7202f,commentId:_0x221c6f,content:_0x45c4f6,attributes:_0x2463cd})=>{const _0x46eaa2=_0x56dedd['getCommentThread'](_0xf7202f);if(_0x46eaa2){const _0x54d96e=_0x46eaa2['getComment'](_0x221c6f);_0x54d96e&&_0x54d96e['update']({'content':_0x45c4f6,'attributes':_0x2463cd,'isFromAdapter':!0x0});}}),this['listenTo'](_0x86aef6,'commentRemoved',(_0x55bdbd,{commentThreadId:_0x251695,commentId:_0x211714})=>{const _0x19e1e8=_0x56dedd['getCommentThread'](_0x251695);if(_0x19e1e8){const _0x579e85=_0x19e1e8['getComment'](_0x211714);_0x579e85&&_0x579e85['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x434d50);}['destroy'](){if(this['context']instanceof _0x1b02df){const _0x42f8e9=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x42f8e9);}}['_terminateService'](_0x4a6b53){if(!this['_services']['has'](_0x4a6b53))throw new _0xac8d7f('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4a6b53});this['_getService'](_0x4a6b53)['disconnect'](),this['_services']['delete'](_0x4a6b53);}async['reconnect'](){for(const _0x66b0a of this['_services']['keys']())await this['_connectService'](_0x66b0a);if(this['context']instanceof _0x1b02df){const _0x1543b4=this['context']['config']['get']('collaboration.channelId'),_0xbdf212=this['context']['plugins']['get'](i);_0xbdf212['unregister'](_0x1543b4);const _0x3f1e1d=await this['_services']['get'](_0x1543b4)['getConnectedSessions']();_0xbdf212['register'](_0x1543b4,_0x3f1e1d);}}async['_connectService'](_0x4c7225){const {connection:_0x29e1fc}=this['context']['plugins']['get'](n),_0x49dcd8=this['context']['plugins']['get']('CommentsRepository'),_0x515a82=this['_services']['get'](_0x4c7225),_0x4744cb=await _0x515a82['connect'](_0x29e1fc);await this['_fetchMissingUsersForThreads'](_0x4744cb);const _0x38fa0f=new Set(Array['from'](_0x49dcd8['getCommentThreads']({'channelId':_0x4c7225}),_0x2a6636=>_0x2a6636['id']));for(const _0x13d466 of _0x4744cb)_0x13d466['deletedAt']||_0x38fa0f['delete'](_0x13d466['commentThreadId']);for(const _0x240b5c of _0x38fa0f)_0x49dcd8['getCommentThread'](_0x240b5c)['remove']({'isFromAdapter':!0x0});for(const _0x3fd3b3 of _0x4744cb){let _0x376e0b=_0x49dcd8['getCommentThread'](_0x3fd3b3['commentThreadId']);const {commentThreadId:_0x11ea5d,context:_0xefbbab,attributes:_0x3efe57,resolvedBy:_0x1e7b05,resolvedAt:_0x1a84fb,unlinkedAt:_0x5e0097,deletedAt:_0x27a942}=_0x3fd3b3;if(_0x27a942)continue;_0x376e0b||(_0x376e0b=_0x49dcd8['addCommentThread']({'channelId':_0x4c7225,'threadId':_0x11ea5d,'context':_0xefbbab,'attributes':_0x3efe57||{},'resolvedBy':_0x1e7b05,'resolvedAt':_0x1a84fb,'unlinkedAt':_0x5e0097,'isFromAdapter':!0x0}));const _0x254845=new Set(Array['from'](_0x376e0b['comments'],_0x1d10a5=>_0x1d10a5['id']));for(const _0x1232a7 of _0x3fd3b3['comments'])_0x254845['delete'](_0x1232a7['commentId']);for(const _0x5474b8 of _0x254845)_0x376e0b['getComment'](_0x5474b8)['remove']({'isFromAdapter':!0x0});for(const _0x201168 of _0x3fd3b3['comments']){const _0x4e0e85=_0x376e0b['getComment'](_0x201168['commentId']);_0x4e0e85?_0x4e0e85['content']!==_0x201168['content']&&_0x4e0e85['update']({'content':_0x201168['content'],'isFromAdapter':!0x0}):_0x376e0b['addComment'](Object['assign'](p(_0x201168),{'isFromAdapter':!0x0}));}}}['_getService'](_0x114ab3){if(!this['_services']['has'](_0x114ab3))throw new _0xac8d7f('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x114ab3});return this['_services']['get'](_0x114ab3);}async['_fetchMissingUsersForThreads'](_0x249bcb){const _0x570781=this['context']['plugins']['get'](_0x530760),{connection:_0x576ca4}=this['context']['plugins']['get'](n),_0x3c5231=new Set();for(const {resolvedBy:_0x31288d,comments:_0x2f7026}of _0x249bcb){_0x31288d&&!_0x570781['getUser'](_0x31288d)&&_0x3c5231['add'](_0x31288d);for(const {userId:_0x4d8358}of _0x2f7026)_0x570781['getUser'](_0x4d8358)||_0x3c5231['add'](_0x4d8358);}if(0x0===_0x3c5231['size'])return;const _0x50d7a5=await ct['getMany'](_0x576ca4,Array['from'](_0x3c5231));for(const _0x4b07f2 of _0x50d7a5)_0x570781['getUser'](_0x4b07f2['id'])||_0x570781['addUser'](_0x4b07f2);}}async function v(_0x447615){if('404'!==_0x447615['code'])throw _0x447615;}function at(_0x3e8cff){if((_0x2db8d7=_0x3e8cff)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2db8d7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2db8d7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2db8d7;throw _0x3e8cff;}function p(_0x1e5029){return{'threadId':_0x1e5029['commentThreadId'],'commentId':_0x1e5029['commentId'],'content':_0x1e5029['content'],'createdAt':_0x1e5029['createdAt'],'authorId':_0x1e5029['userId'],'attributes':_0x1e5029['attributes']||{}};}class m extends _0x516461{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x4ce9d2)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa8e204){super(_0xa8e204);const _0x409ee4=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x409ee4);}['init'](){const _0x5bf2df=this['editor']['plugins']['get'](n),_0x10fa03=this['editor']['plugins']['get']('TrackChangesEditing');return _0x10fa03['adapter']={'getSuggestion':async _0x1a99aa=>{await this['_waitForServiceReady']();const _0x58f9d4=await this['_trackChangesService']['get'](_0x1a99aa)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x58f9d4]),_0x58f9d4;},'addSuggestion':async({id:_0x2899cd,type:_0x827093,data:_0x1d7bed,originalSuggestionId:_0x1233aa,attributes:_0x1e422})=>{await this['_waitForServiceReady']();const _0x3265ca={'id':_0x2899cd,'type':_0x827093,'data':_0x1d7bed,'originalSuggestionId':_0x1233aa,'attributes':_0x1e422},_0xb09c7d=await this['_trackChangesService']['add'](_0x2899cd,_0x827093,_0x1d7bed,_0x1233aa,_0x1e422)['catch'](_0x5de2e6=>{if(ht(_0x5de2e6))return new Promise(_0x13edab=>{this['_bufferedRequests']['set'](_0x2899cd,{'resolve':_0x13edab,'suggestionData':_0x3265ca});});throw _0x5de2e6;});return this['_bufferedRequests']['delete'](_0x2899cd),_0xb09c7d;},'updateSuggestion':async(_0xc27ee8,_0x21a6da)=>{if(await this['_waitForServiceReady'](),'open'!==_0x21a6da['state'])return this['_trackChangesService']['update'](_0xc27ee8,_0x21a6da)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x3bea76,_0x57a842)=>{_0x10fa03['hasSuggestion'](_0x57a842['id'])&&(_0x10fa03['getSuggestion'](_0x57a842['id'])['attributes']=_0x57a842['attributes']);}),this['_trackChangesService']['connect'](_0x5bf2df['connection'])['then'](_0x7e884b=>(_0x5bf2df['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x7e884b)['then'](()=>{for(const _0x481ffc of _0x7e884b){_0x10fa03['addSuggestionData'](_0x481ffc)['_saved']=!0x0;}})));}async['reconnect'](){const _0x167499=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x42ac2e}=this['editor']['plugins']['get'](n),_0x3f9e28=await this['_trackChangesService']['connect'](_0x42ac2e);await this['_fetchMissingUsersForThreads'](_0x3f9e28);for(const {suggestionData:_0x228afe,resolve:_0x30c273}of this['_bufferedRequests']['values']()){let _0x53602a=_0x3f9e28['find'](_0x13859d=>_0x13859d['id']===_0x228afe['id']);_0x53602a||(_0x53602a=await this['_trackChangesService']['add'](_0x228afe['id'],_0x228afe['type'],_0x228afe['data'],_0x228afe['originalSuggestionId'])),_0x30c273(_0x53602a);}for(const _0x48c132 of _0x3f9e28)_0x167499['hasSuggestion'](_0x48c132['id'])||_0x167499['addSuggestionData'](_0x48c132);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2f7464=>{this['listenTo'](this['_trackChangesService'],'connected',_0x5477dd=>{_0x5477dd['off'](),_0x2f7464();});});}async['_fetchMissingUsersForThreads'](_0x43aa29){const _0x1f997e=this['editor']['plugins']['get'](_0x530760),{connection:_0xe432fd}=this['editor']['plugins']['get'](n),_0xd5eeb9=new Set();for(const {authorId:_0x3a2389}of _0x43aa29)_0x1f997e['getUser'](_0x3a2389)||_0xd5eeb9['add'](_0x3a2389);if(0x0===_0xd5eeb9['size'])return;const _0x30eaf3=await ct['getMany'](_0xe432fd,Array['from'](_0xd5eeb9));for(const _0x2eca07 of _0x30eaf3)_0x1f997e['getUser'](_0x2eca07['id'])||_0x1f997e['addUser'](_0x2eca07);}}function A(_0x23935d){if(ht(_0x23935d))return new Promise(()=>{});throw _0x23935d;}function ht(_0x147f23){return _0x147f23['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x147f23['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x516461{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x296c4e=this['editor']['plugins']['get'](n),_0x20c98c=this['editor']['plugins']['get']('CommentsEditing'),_0x3f93ca=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x296c4e,'change:state',(_0x3654e9,_0x37e85a,_0xa1ce52)=>{_0x20c98c['isThreadsLoadingPaused']='connected'!==_0xa1ce52;});}),this['listenTo'](_0x296c4e,'change:state',(_0x460512,_0x282d1a,_0x1ea0c6)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1ea0c6);}),_0x3f93ca['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x516461{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x516461{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x5cc90d)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x530760];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11bdd1){super(_0x11bdd1);const _0x33cda0=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x33cda0);}async['init'](){const _0x114f65=this['editor']['plugins']['get'](l),_0x4833f9=_0x114f65['serverHistory'],_0x4d253a=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x4833f9,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x114f65['sessionId']});const _0x256a2a=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x3e2318=await _0x10ae17['isBundleUploaded'](_0x4d253a['connection'],_0x256a2a);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3d8c01})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3d8c01)),'updateRevisions':async _0x5eb1b9=>{await this['_waitForServiceReady']();const _0x3fdfec=this['_revisionTracker']['currentRevision'];if(_0x3e2318&&0x1===_0x5eb1b9['length']&&_0x5eb1b9[0x0]['id']===_0x3fdfec['id'])return _0x5eb1b9;for(const _0x667fe5 of _0x5eb1b9)_0x667fe5['id']===_0x3fdfec['id']&&(_0x667fe5['isEmptyCurrent']=_0x667fe5['fromVersion']===_0x667fe5['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x5eb1b9,this['_lastRequestId'])['then'](_0x3b9039=>(this['_lastRequestId']=_0x3b9039,_0x5eb1b9))['catch'](_0xdd561b=>{if(M(_0xdd561b)||'400'===_0xdd561b['code']&&void 0x0!==_0xdd561b['data']['wrongRequestId']){for(const _0x15d106 of _0x5eb1b9){!this['_revisionTracker']['repository']['getRevision'](_0x15d106['id'])||this['_revisionTracker']['_bufferUpdate'](_0x15d106['id'],_0x15d106,!0x1);}if(M(_0xdd561b))throw _0xdd561b;return _0x5eb1b9;}throw _0xdd561b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x21c751,{revisionsData:_0x170f58,requestId:_0x16225c})=>{Math['max'](..._0x170f58['map'](_0x5b5b0a=>_0x5b5b0a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x170f58,_0x16225c);}):this['_handleRevisionsUpdate'](_0x170f58,_0x16225c);});const {revisions:_0x452bb8,requestId:_0x4f2658}=await this['_revisionHistoryService']['connect'](_0x4d253a['connection']);_0x4d253a['addToReconnectionStack'](this),this['_lastRequestId']=_0x4f2658,await this['_fetchMissingUsers'](_0x452bb8);for(const _0x3dc97c of _0x452bb8)this['_revisionTracker']['addRevisionData'](_0x3dc97c);this['listenTo'](_0x114f65,'change:_isConnected',(_0x2564ff,_0x2a156d,_0xe76d37)=>{_0xe76d37&&(this['_oldOffset']=_0x114f65['_offset'],_0x2564ff['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4d253a,'state',_0x2b36bb=>_0x2b36bb===_0x132d53['CONNECTED']);}async['reconnect'](){const _0x5ed36b=this['editor']['plugins']['get'](n),_0x4877bf=this['editor']['plugins']['get'](l),_0x1a2967=async()=>{const _0x4fd1a9=this['_revisionTracker']['currentRevision'],_0x230370=_0x4fd1a9['id'],_0x41ebd2=_0x230370!==_0x4877bf['sessionId'];if(_0x41ebd2){const _0x2ed7ff=_0x4877bf['_offset']-this['_oldOffset'],_0xc960cd=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x4fd1a9['toVersion']+_0x2ed7ff!==_0xc960cd){const _0xf5d291=_0x4fd1a9['fromVersion']+_0x2ed7ff,_0x3e7312=this['editor']['plugins']['get'](_0x530760),_0x3e7c3e=this['_revisionTracker']['buildRevisionData']({'revision':_0x4fd1a9,'from':_0xf5d291,'to':_0xc960cd});_0x3e7c3e['id']=_0x4fd1a9['id'];const _0x31fe3b=_0x3e7c3e['authorsIds']['map'](_0x82000d=>_0x3e7312['getUser'](_0x82000d));_0x4fd1a9['_update']({..._0x3e7c3e,'authors':_0x31fe3b},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4fd1a9['id'],_0x3e7c3e,!0x0);}this['_revisionTracker']['_startingVersion']=_0xc960cd,(_0x4fd1a9['toVersion']===_0x4fd1a9['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x230370)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x230370),this['_revisionTracker']['_createCurrentRevision'](_0xc960cd));}const {revisions:_0x319597,requestId:_0x43ad39}=await this['_revisionHistoryService']['reconnect'](_0x5ed36b['connection'],this['_lastRequestId']);_0x41ebd2&&_0x319597['length']>0x0?_0x4877bf['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x319597),this['_handleRevisionsUpdate'](_0x319597,_0x43ad39),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4877bf['_isConnected']?_0x1a2967():new Promise((_0x1ad6f8,_0x2c84c2)=>{_0x4877bf['once']('change:_isConnected',()=>{_0x1a2967()['then'](_0x1ad6f8)['catch'](_0x2c84c2);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x506ba3=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3879e9=>{_0x3879e9['off'](),_0x506ba3();});});}['_getLatestVersionFromServerOperations'](){const _0x18c2c4=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2b7456 of _0x18c2c4)if('marker'!==_0x2b7456['type']||_0x2b7456['affectsData'])return _0x2b7456['baseVersion']+0x1;}['_getLatestVersion'](){const _0x102e50=this['editor']['plugins']['get'](l);return new Promise(_0x494668=>{_0x102e50['_isPendingUpdate']?_0x102e50['once']('change:_isPendingUpdate',()=>{_0x494668(this['_getLatestVersionFromServerOperations']());}):_0x494668(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x105c47,_0x9baf0a){const _0x1dd48d=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x9baf0a;for(const _0x410040 of _0x105c47){const _0x2c3a75=_0x1dd48d['getRevision'](_0x410040['id']);if(_0x2c3a75){if((_0x410040['fromVersion']||_0x410040['toVersion'])&&(_0x410040['diffData']=null),_0x2c3a75===this['_revisionTracker']['currentRevision']){const _0xe16a9a=Math['max'](_0x2c3a75['toVersion'],_0x410040['toVersion']),_0x49029d=Math['max'](_0x2c3a75['fromVersion'],_0x410040['fromVersion']);let _0x38a096;_0x2c3a75['toVersion']===_0x410040['toVersion']&&_0x2c3a75['fromVersion']===_0x410040['fromVersion']?(_0x38a096=!0x0,this['_preventResendingRevisionData'](_0x410040)):_0x410040['toVersion']===_0xe16a9a&&_0x410040['fromVersion']===_0x49029d?_0x38a096=!0x1:(_0x2c3a75['toVersion']===_0xe16a9a&&_0x2c3a75['fromVersion']===_0x49029d||this['_fixRevision']({'revision':_0x2c3a75,'from':_0x49029d,'to':_0xe16a9a}),_0x38a096=!0x0),_0x38a096&&(delete _0x410040['fromVersion'],delete _0x410040['toVersion'],delete _0x410040['diffData'],delete _0x410040['createdAt'],delete _0x410040['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x410040),this['_preventResendingRevisionData'](_0x410040);}else this['_revisionTracker']['addRevisionData'](_0x410040);}const _0x166fb8=_0x1dd48d['getRevisions']();_0x166fb8['reverse']();for(let _0x467673=0x0;_0x467673<_0x166fb8['length']-0x1;_0x467673++){const _0x1ebf6a=_0x166fb8[_0x467673],_0x51ce9c=_0x166fb8[_0x467673+0x1];if(_0x1ebf6a['fromVersion']<_0x51ce9c['toVersion']){const _0xec0f5b=_0x51ce9c['toVersion'],_0x1290f8=Math['max'](_0xec0f5b,_0x1ebf6a['toVersion']);this['_fixRevision']({'revision':_0x1ebf6a,'from':_0xec0f5b,'to':_0x1290f8});}}}['_fixRevision']({revision:_0x2c73c8,from:_0x54ac6e,to:_0x31d4fd}={}){const _0x529b26=this['editor']['plugins']['get'](_0x530760),_0x563368=this['_revisionTracker']['buildRevisionData']({'revision':_0x2c73c8,'from':_0x54ac6e,'to':_0x31d4fd});_0x563368['authors']=_0x563368['authorsIds']['map'](_0xcb4bc6=>_0x529b26['getUser'](_0xcb4bc6)),_0x2c73c8['_update'](_0x563368);}['_preventResendingRevisionData'](_0x1b2066){const _0x1369f0={};_0x1369f0['id']=_0x1b2066['id'];for(const _0x411e23 of Object['keys'](_0x1b2066))'id'!==_0x411e23&&(_0x1369f0[_0x411e23]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1369f0['id'],_0x1369f0,!0x0);}async['_fetchMissingUsers'](_0x21f923){const _0x404687=this['editor']['plugins']['get'](_0x530760),{connection:_0x23d5b4}=this['editor']['plugins']['get'](n),_0x559495=new Set();for(const _0x39f9df of _0x21f923){for(const _0x244cf1 of _0x39f9df['authorsIds'])_0x9eef98(_0x244cf1);_0x39f9df['creatorId']&&_0x9eef98(_0x39f9df['creatorId']);}if(0x0===_0x559495['size'])return;const _0x43195d=await ct['getMany'](_0x23d5b4,Array['from'](_0x559495));for(const _0x37292a of _0x43195d)_0x404687['getUser'](_0x37292a['id'])||_0x404687['addUser'](_0x37292a);function _0x9eef98(_0x599dcd){_0x404687['getUser'](_0x599dcd)||_0x559495['add'](_0x599dcd);}}}function M(_0x4fde3d){return _0x4fde3d['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4fde3d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4fde3d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x516461{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x178204{['_collapseAt'];constructor(_0x48fce7,_0x5b06d3=0x6){super(_0x48fce7);const _0x243004=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x5b06d3,this['bind']('isHidden')['to'](this,'usersCount',_0x46f91c=>_0x46f91c<_0x5b06d3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x243004['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':_0x243004['to']('usersCount',_0x2dfd4b=>'+'+(_0x2dfd4b-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x178204{['items'];['keystrokes'];constructor(_0xc9dafa){super(_0xc9dafa);const _0x122b5a=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x38c104(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x122b5a['if']('hasPopup'),'aria-expanded':_0x122b5a['to']('isExpanded',_0x1b98d6=>this['hasPopup']&&String(_0x1b98d6)),'aria-label':_0x122b5a['to']('hasPopup',_0x5d9ec6=>K(_0xc9dafa,_0x5d9ec6?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x122b5a['to']('hasPopup',_0x2a6648=>!!_0x2a6648&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x122b5a['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x122b5a['to'](_0x18df36=>{const _0x599361=_0x18df36,_0x17a806=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4a6dc9=document['querySelector']('.ck-balloon-panel_with-arrow');_0x17a806?.['contains'](_0x599361['relatedTarget'])||_0x4a6dc9?.['contains'](_0x599361['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x441e2,_0x50c5fd,_0x548e4d)=>{this['element']&&(_0x548e4d?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class k extends _0x178204{['counterView'];['inlineListView'];constructor(_0x52bdec,_0x1bb28a=0x6){super(_0x52bdec);const _0x34598d=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0x1bb28a),this['inlineListView']=new is(_0x52bdec),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x6913de of this['inlineListView']['items'])_0x6913de['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',_0x34598d['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x178204{['listWrapperView'];constructor(_0x41aabc,_0x5c712c){super(_0x41aabc);const _0x47c055=this['bindTemplate'];this['listWrapperView']=new ut(_0x41aabc,_0x5c712c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':K(_0x41aabc,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x47c055['to'](_0x1ff079=>{const _0x12c70e=_0x1ff079,_0x31bf67=document['querySelector']('.ck-presence-list__list'),_0x7d39c5=document['querySelector']('.ck-balloon-panel_with-arrow');_0x31bf67?.['contains'](_0x12c70e['relatedTarget'])||_0x7d39c5?.['contains'](_0x12c70e['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x79bd65{constructor(_0x9a8435,_0x58b0e2){super(_0x9a8435);const _0x16b4a7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x58b0e2?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x16b4a7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x16b4a7['to']('role'),'aria-label':_0x16b4a7['to']('ariaLabel'),'aria-labelledby':_0x16b4a7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x5a5cb2['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3e4d27=this['element'];_0x3e4d27&&(this['_isScrollable']=Math['max'](_0x3e4d27['scrollHeight'],_0x3e4d27['clientHeight'])>0.8*window['innerHeight']);}}class P extends et{['userView'];constructor(_0x2da7d5,_0x2a15d6,_0x13f884){super(_0x2da7d5);const _0x4dcb4b=this['bindTemplate'];this['userView']=new st(_0x2da7d5,_0x2a15d6);const _0x152ab3={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x2a15d6['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x2a15d6['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2a15d6['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x13f884&&(_0x152ab3['tag']='button',_0x152ab3['on']={'click':_0x4dcb4b['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x152ab3);}['focus'](){this['element']['focus']();}}class _ extends _0x178204{['userView'];['markerView'];constructor(_0xa4114b,_0xf52fbf,_0x4c1ec2){super(_0xa4114b);const _0x978344=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0xa4114b,_0xf52fbf),this['markerView']=new ot(_0xa4114b,_0xf52fbf);const _0x1d31c5=new it(_0xa4114b);_0x1d31c5['template']['tag']='span',_0x1d31c5['text']=_0xf52fbf['name'];const _0x344879={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x978344['to']('isFocusable',_0x33c62b=>!!_0x33c62b&&0x0),'aria-labelledby':_0x1d31c5['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x978344['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x978344['to']('hasTooltip',_0x29543e=>!_0x29543e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1d31c5]};_0x4c1ec2&&(_0x344879['tag']='button',_0x344879['on']={'click':_0x978344['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x344879);}}class ot extends _0x178204{constructor(_0x4a932a,_0x117786){super(_0x4a932a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x117786['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x29ab63{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5752d0){super(_0x5752d0),this['context']['config']['define']('presenceList',U);const _0xac9eb7=_0x5752d0['config']['get']('presenceList.collapseAt');if('number'!=typeof _0xac9eb7)throw new _0xac8d7f('presencelist-collapseat-invalid-format',this);if(_0xac9eb7<0x1)throw new _0xac8d7f('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0xedfe61(),this['balloonPanelView']=new _0x2fe979(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x8104b0 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x8104b0);this['listenTo'](this['_allConnectedUsers'],'add',(_0x24be72,_0x46f1fd)=>{this['_handleUserAdd'](_0x46f1fd);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2418dd,_0x1feda2)=>{this['_handleUserRemove'](_0x1feda2);});}['_createView'](){const _0xdd368c=this['context'],_0x26dac3=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x576d7c=this['balloonPanelView'];if(!_0x4cf03f(_0xdd368c['config']['get']('presenceList.container')))throw new _0xac8d7f('presencelist-missing-container',this);return _0x26dac3['counterView']['bind']('usersCount')['to'](this),_0x26dac3['bind']('isCollapsed')['to'](this,'usersCount',_0x17b28e=>{const {collapseAt:_0x5549c5}=_0xdd368c['config']['get']('presenceList'),_0x20ef7d=_0x17b28e>=_0x5549c5;if(_0x20ef7d&&!_0x26dac3['inlineListView']['items']['find'](_0x2373f1=>_0x2373f1 instanceof y)){const _0x53ed67=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x53ed67&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x26dac3['inlineListView']['items']['add'](_0x26dac3['counterView']);}return _0x20ef7d||this['hideDropdown'](),_0x20ef7d;}),_0x26dac3['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x3ca925=>{const _0x2467b4=_0xdd368c['config']['get']('presenceList'),_0x4330f8=new _(_0xdd368c['locale'],_0x3ca925,!!_0x2467b4['onClick']);return _0x4330f8['bind']('hasTooltip')['to'](_0x26dac3,'isCollapsed',_0x340efc=>!_0x340efc),_0x4330f8['bind']('isFocusable')['to'](_0x26dac3,'isCollapsed',_0x430653=>!_0x430653),_0x2467b4['onClick']&&this['listenTo'](_0x4330f8,'execute',()=>{this['view']['isCollapsed']||_0x2467b4['onClick'](_0x3ca925,_0x4330f8['element']);}),_0x4330f8;}),this['listenTo'](_0x26dac3['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x26dac3['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x26dac3['inlineListView']['keystrokes']['set']('Enter',(_0x124c30,_0x50983d)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x50983d());}),_0x26dac3['render'](),_0x576d7c['render'](),_0x5cda66({'emitter':_0x26dac3,'activator':()=>_0x576d7c['isVisible'],'contextElements':[_0x576d7c['element'],_0x26dac3['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xdd368c['config']['get']('presenceList.container')['appendChild'](_0x26dac3['element']),this['_bodyCollection']=new _0xea0b6d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x26dac3;}['_handleUserAdd'](_0x4699cd){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x4699cd['isMe'])return;const _0xcf91a=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0xcf91a-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x3dba14=_0x4699cd['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x4699cd,_0x3dba14);}['_handleUserRemove'](_0x43559){this['usersCount']--;const {collapseAt:_0x58ca80}=this['context']['config']['get']('presenceList'),_0xe5faf4=this['usersCount']>=_0x58ca80;if(this['currentDisplayedUsers']['get'](_0x43559['id']))this['currentDisplayedUsers']['remove'](_0x43559['id']);else{if(_0xe5faf4&&this['currentDisplayedUsers']['length']+0x1===_0x58ca80-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0xe5faf4?0x1:0x0)<this['usersCount']){for(const _0x1922f0 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1922f0['id'])&&(this['currentDisplayedUsers']['add'](_0x1922f0,Math['min'](this['currentDisplayedUsers']['length']-(_0xe5faf4?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0xe5faf4?0x1:0x0)===_0x58ca80-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4c8a3c=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x4c8a3c['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1f9ae9}=this['presenceDropdownView'];_0x1f9ae9['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x22438d=>{if(!_0x4c8a3c['displayMe']&&_0x22438d['isMe'])return null;const _0x27ee47=new P(this['context']['locale'],_0x22438d,!!_0x4c8a3c['onClick']);return _0x4c8a3c['onClick']&&this['listenTo'](_0x27ee47,'execute',()=>{_0x4c8a3c['onClick'](_0x22438d,_0x27ee47['element']);}),_0x27ee47;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1f9ae9['focus'](),_0x1f9ae9['checkIfScrollable']();const _0x34a6a8=(_0xb52bed,_0x5a093a)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x5a093a();};_0x1f9ae9['keystrokes']['set']('Esc',_0x34a6a8),_0x1f9ae9['keystrokes']['set']('Shift+Tab',_0x34a6a8),_0x1f9ae9['keystrokes']['set']('Tab',(_0x264068,_0x428800)=>{!function(_0x54cedc){const _0x3986c4=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4518df=>_0x4518df+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3bbe66=[...document['body']['querySelectorAll'](_0x3986c4)]['filter'](_0x51e4c6=>_0x51e4c6===document['activeElement']||_0x51e4c6['offsetWidth']+_0x51e4c6['offsetHeight']>0x0)['sort']((_0x4f37c8,_0x39ad53)=>(_0x4f37c8['tabIndex']||0x0)-(_0x39ad53['tabIndex']||0x0)),_0x172264=_0x3bbe66['indexOf'](_0x54cedc),_0x2b2fc0=_0x3bbe66[(_0x172264+0x1)%_0x3bbe66['length']];_0x2b2fc0&&_0x2b2fc0['focus']();}(this['view']['element']),this['hideDropdown'](),_0x428800();}),_0x1f9ae9['focusTracker']['add'](this['view']['element']),_0x1f9ae9['focusTracker']['on']('change:isFocused',(_0x373e2a,_0x458bbe,_0xa8e420)=>{_0xa8e420||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0x29ab63{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','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.':'','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.':''},'getPluralForm':_0x5e2348=>0x1!=_0x5e2348}};
23
+ export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','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.':'','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.':''},'getPluralForm':_0x3a897d=>0x1!=_0x3a897d}};