@ckeditor/ckeditor5-real-time-collaboration 44.0.0-alpha.2 → 44.0.0-alpha.3

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 (168) 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/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +9 -9
  148. package/src/common-translations.js +1 -1
  149. package/src/index.js +1 -1
  150. package/src/presencelist/presencelistui.js +1 -1
  151. package/src/presencelist/view/presencecounterview.js +1 -1
  152. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  153. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  154. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  155. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  156. package/src/presencelist/view/presencelistview.js +1 -1
  157. package/src/presencelist.js +1 -1
  158. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  159. package/src/realtimecollaborativecomments.js +1 -1
  160. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  161. package/src/realtimecollaborativeediting/sessions.js +1 -1
  162. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  163. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  164. package/src/realtimecollaborativeediting.js +1 -1
  165. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  166. package/src/realtimecollaborativerevisionhistory.js +1 -1
  167. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  168. 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 _0x5a8039,Plugin as _0x2f4ec7,PendingActions as _0x19630d,Context as _0x4f9ef2}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x33bf11,CKEditorError as _0x4bb820,Collection as _0x3fd87a,global as _0x11ae4d,version as nt,uid as _0x1076e1,KeystrokeHandler as _0x5393f7}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1b3b0a,View as _0x4a36b3,ListView as _0x5b5e13,ListItemView as rt,LabelView as ot,BalloonPanelView as _0xd0549f,clickOutsideHandler as _0x17dab6,BodyCollection as _0x24f1cb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x12c917,NoOperation as _0x27ffb8,InsertOperation as _0x3709a8,MarkerOperation as _0x164bdb,RootAttributeOperation as _0x257d74,transformSets as _0x583353,OperationFactory as _0x3e5cf4}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x42944f,CollaborativeEditingService as _0x205cab,User as dt,CommentsService as _0x507313,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x5e51ff,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x5808a4}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x77664d}from'lodash-es';class c extends _0x5a8039{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1b3b0a];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ed359){super(_0x3ed359),this['set']('state',_0x42944f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x33bf11);}['init'](){const _0x1e7b3f=this['context'],_0x2e4ce=_0x1e7b3f['plugins']['get']('CloudServices'),_0x5c77a3=_0x1e7b3f['plugins']['get'](_0x1b3b0a);if(!_0x2e4ce['token'])throw new _0x4bb820('websocketgateway-missing-token',this);if(!_0x2e4ce['webSocketUrl'])throw new _0x4bb820('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x2e4ce['token'],_0x2e4ce['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3351fd=>{if(this['connection']=_0x3351fd,this['bind']('state')['to'](_0x3351fd,'state',this,'_isBrowserOffline',(_0x954908,_0x2ce732)=>('connected'!==_0x954908&&(this['_shouldPluginsReconnect']=!0x0),_0x2ce732||_0x954908!==_0x42944f['CONNECTED']?_0x42944f['DISCONNECTED']:this['state']==_0x42944f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x42944f['CONNECTING']):_0x42944f['CONNECTED'])),this['connection']['on']('error',(_0x18b483,_0xf8d3e9)=>{if('limitExceeded'!==_0xf8d3e9['code'])throw console['error'](_0xf8d3e9),new _0x4bb820('cloudservices-init',null,{'originalError':_0xf8d3e9});_0x5c77a3['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'});}),!_0x3351fd['me'])return new Promise(_0xa91353=>_0x3351fd['on']('change:me',_0xa91353));})['catch'](_0x33c635=>{throw console['error'](_0x33c635),new _0x4bb820('cloudservices-init',null,{'originalError':_0x33c635});});}['addToReconnectionStack'](_0x30ef69){if('function'!=typeof _0x30ef69['reconnect'])throw new _0x4bb820('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x30ef69))throw new _0x4bb820('websocketgateway-plugin-already-registered',this,{'name':_0x30ef69['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x30ef69);}['removeFromReconnectionStack'](_0xc0bbc9){this['_reconnectionStack']['delete'](_0xc0bbc9);}['isInReconnectionStack'](_0x3537a2){return this['_reconnectionStack']['has'](_0x3537a2);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2d1782=>_0x2d1782['reconnect']())))['then'](()=>this['state']=_0x42944f['CONNECTED'])['catch'](_0x221cb7=>{throw console['error'](_0x221cb7),new _0x4bb820('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x42944f['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x5a8039{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x5e51ff];}constructor(_0x1e63ce){super(_0x1e63ce),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3fd87a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5e51ff);}['init'](){const _0x319f9b=this['context']['plugins']['get'](c);this['listenTo'](_0x319f9b,'change:state',(_0x42227d,_0x40f1c3,_0x4688de)=>{if('connected'!==_0x4688de)this['channelSessions']['forEach'](_0x55c838=>_0x55c838['clear']()),this['channelConnectedUsers']['forEach'](_0x3d872c=>_0x3d872c['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2253fd,_0x3d75ff]of this['_registeredSessions'])for(const _0x1a8d6a of _0x3d75ff)this['_handleSessionAdd'](_0x2253fd,_0x1a8d6a);}}),this['_createUser'](_0x319f9b['connection']['me'],!0x0);}['register'](_0x2aa87c,_0x5491d3){if(this['_registeredSessions']['has'](_0x2aa87c))throw new _0x4bb820('sessions-register-already-registered',null,{'channelId':_0x2aa87c});this['_registeredSessions']['set'](_0x2aa87c,_0x5491d3),this['channelSessions']['set'](_0x2aa87c,new _0x3fd87a()),this['channelConnectedUsers']['set'](_0x2aa87c,new _0x3fd87a()),this['listenTo'](_0x5491d3,'add',(_0x56fd44,_0x427eaf)=>this['_handleSessionAdd'](_0x2aa87c,_0x427eaf)),this['listenTo'](_0x5491d3,'remove',(_0x346b37,_0x191340)=>this['_handleSessionRemove'](_0x2aa87c,_0x191340));for(const _0x39d4d0 of _0x5491d3)this['_handleSessionAdd'](_0x2aa87c,_0x39d4d0);}['unregister'](_0x21b7df){if(!this['_registeredSessions']['has'](_0x21b7df))throw new _0x4bb820('sessions-unregister-not-exist',null,{'channelId':_0x21b7df});const _0x406445=this['_registeredSessions']['get'](_0x21b7df);this['stopListening'](_0x406445);for(const _0xc95e25 of _0x406445)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x21b7df,_0xc95e25);this['_registeredSessions']['delete'](_0x21b7df),this['channelSessions']['delete'](_0x21b7df),this['channelConnectedUsers']['delete'](_0x21b7df);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x259340){for(const _0x210236 of this['channelSessions']['values']())for(const _0x435d2b of _0x210236)if(_0x435d2b['id']===_0x259340)return _0x435d2b['user'];}['getUserSessions'](_0x3c7157,_0xd5186d){const _0x5009d0=_0xd5186d?[this['channelSessions']['get'](_0xd5186d)]:this['channelSessions']['values'](),_0xb590e0=new Set();for(const _0x3bed1b of _0x5009d0)for(const _0x23cd42 of _0x3bed1b)_0x23cd42['user']['id']===_0x3c7157['id']&&_0xb590e0['add'](_0x23cd42['id']);return _0xb590e0;}['getUserRole'](_0x530106){for(const _0xbc6067 of this['channelSessions']['values']())for(const _0x178bdc of _0xbc6067)if(_0x178bdc['user']===_0x530106)return _0x178bdc['role'];}['_handleSessionAdd'](_0x38976d,_0x46439a){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x4670dc=_0x46439a['user'],_0x3ceba6=this['_users']['getUser'](_0x4670dc['id'])||this['_createUser'](_0x4670dc),_0x2a7d68=Object['assign']({},_0x46439a,{'user':_0x3ceba6});this['channelSessions']['get'](_0x38976d)['add'](_0x2a7d68);const _0x530fdc=this['channelConnectedUsers']['get'](_0x38976d);_0x530fdc['has'](_0x3ceba6['id'])||_0x530fdc['add'](_0x3ceba6),this['allConnectedUsers']['has'](_0x3ceba6['id'])||this['allConnectedUsers']['add'](_0x3ceba6,_0x3ceba6['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x38976d,{'channelId':_0x38976d,'session':_0x2a7d68});}['_handleSessionRemove'](_0x295aaa,_0x11d75f){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x450913=this['channelConnectedUsers']['get'](_0x295aaa),_0x575264=_0x11d75f['user'];_0x575264['id']&&(this['channelSessions']['get'](_0x295aaa)['remove'](_0x11d75f['id']),_0x450913['has'](_0x575264['id'])&&!this['getUserSessions'](_0x575264,_0x295aaa)['size']&&_0x450913['remove'](_0x575264['id']),this['allConnectedUsers']['get'](_0x575264['id'])&&!this['getUserSessions'](_0x575264)['size']&&this['allConnectedUsers']['remove'](_0x575264['id']));}['_createUser'](_0x599fb8,_0x553130){const _0x1ac7da=this['_users']['addUser'](_0x599fb8);return _0x553130&&this['_users']['defineMe'](_0x599fb8['id']),_0x1ac7da['orderNumber']=this['_uniqueUsersCount']++,_0x1ac7da;}}class H extends _0x2f4ec7{['_domEmitter']=new(_0x33bf11())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x73e655=this['editor'],_0x231eba=_0x73e655['plugins']['get'](i);_0x73e655['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0xef0520,{writer:_0x23430e})=>function(_0x3bd82f,_0x33ba68,_0x25615c,_0x321784){const _0xaff47b=_0x3bd82f['markerName']['split'](':')[0x2],_0x5b6dce=_0x25615c['getUserBySessionId'](_0xaff47b);if(!_0x5b6dce||_0xaff47b===_0x25615c['mySessionId'])return;if(!_0x321784['model']['schema']['checkChild'](_0x3bd82f['markerRange']['start'],'$text'))return;const _0x4f4776={'class':'ck-user__marker\x20'+_0x5b6dce['color']['getMarkerClass'](),'data-name':_0x5b6dce['name'],'data-session-id':_0xaff47b},_0x3b2990=_0x321784['model']['markers']['get'](_0x3bd82f['markerName']),_0x2ec786=_0x3b2990['getStart'](),_0x3dd034=_0x2ec786['nodeAfter'],_0x11b5fe=_0x321784['model']['schema'];if(_0x3dd034&&_0x11b5fe['isObject'](_0x3dd034)&&_0x11b5fe['isInline'](_0x3dd034)&&!_0x321784['model']['markers']['get']('user:range:'+_0xaff47b)['getRange']()['isCollapsed'])return;const _0x219612=_0x2ec786['parent'];return _0x321784['model']['schema']['isLimit'](_0x219612)&&!_0x321784['model']['hasContent'](_0x219612)&&(_0x4f4776['contenteditable']=!0x1),function(_0xffe653,_0x1b90da,_0x131009){const _0x5deec3=_0xffe653['createUIElement']('span',_0x1b90da);return _0xffe653['setCustomProperty']('userPositionMarker',!0x0,_0x5deec3),_0x5deec3['render']=function(_0x54edf8){const _0x5bbc5c=this['toDomElement'](_0x54edf8);return _0x5bbc5c['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x131009['name']+'</span>⁠',_0x5bbc5c['addEventListener']('mouseenter',()=>{_0x5bbc5c['classList']['add']('ck-user__marker_hovered');}),_0x5bbc5c['addEventListener']('mouseleave',()=>{_0x5bbc5c['classList']['remove']('ck-user__marker_hovered');}),_0x5bbc5c;},_0x5deec3['isSimilar']=function(_0x4ab138){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4ab138['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4ab138['getAttribute']('data-session-id'));},_0x5deec3;}(_0x33ba68,_0x4f4776,_0x5b6dce);}(_0xef0520,_0x23430e,_0x231eba,_0x73e655)}),_0x73e655['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x33ddc5=>function(_0x4e88bf,_0x57b973){const _0xd58adb=_0x4e88bf['markerName']['split'](':')[0x2];if(_0xd58adb===_0x57b973['mySessionId'])return null;const _0x74be4b=_0x57b973['getUserBySessionId'](_0xd58adb);if(!_0x74be4b)return{'id':_0xd58adb,'classes':[]};return{'id':_0xd58adb,'classes':['ck-user__selection',_0x74be4b['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xd58adb},'priority':0x7d0+_0x74be4b['orderNumber']};}(_0x33ddc5,_0x231eba)}),function(_0x5226f1){const _0x46a892=_0x5226f1['model'],_0x3d4cc2=new Map(),_0xa41186=_0x5226f1['plugins']['get'](i);_0x46a892['markers']['on']('update:user:range',(_0x43b49b,_0x4dea60,_0x364448,_0xad3492)=>{if(!_0xad3492&&_0x3d4cc2['get'](_0x4dea60['name']))return _0x3d4cc2['get'](_0x4dea60['name'])['detach'](),void _0x3d4cc2['delete'](_0x4dea60['name']);const _0x16b9ac=_0x4dea60['name']['split'](':')[0x2];if(_0x16b9ac===_0xa41186['mySessionId'])return;const _0x13ccb6='user:position:'+_0x16b9ac;_0x46a892['markers']['has'](_0x13ccb6)&&_0x5226f1['editing']['reconvertMarker'](_0x13ccb6),_0x4dea60['on']('change:range',(_0x59cf83,_0x35f592,_0x142615)=>{if('$graveyard'!=_0x35f592['root']['rootName']&&'$graveyard'==_0x4dea60['getRange']()['root']['rootName']&&!_0x3d4cc2['has'](_0x4dea60['name'])){const _0x114105=_0x46a892['schema']['getNearestSelectionRange'](_0x142615['deletionPosition']);if(_0x114105){const _0xbd262a=ht['fromRange'](_0x114105);_0x3d4cc2['set'](_0x4dea60['name'],_0xbd262a),_0xbd262a['on']('change:range',(_0x425836,_0x3c23ab,_0x462b73)=>{if('$graveyard'==_0xbd262a['root']['rootName']){const _0x2d5467=_0x46a892['schema']['getNearestSelectionRange'](_0x462b73['deletionPosition']);_0x2d5467?(_0xbd262a['start']=_0x2d5467['start'],_0xbd262a['end']=_0x2d5467['end']):(_0x3d4cc2['delete'](_0x4dea60['name']),_0xbd262a['detach']());}});}}});}),_0x46a892['document']['on']('change',()=>{_0x3d4cc2['size']>0x0&&_0x46a892['enqueueChange']({'isUndoable':!0x1},_0x9377b3=>{for(const [_0x5dad32,_0x2994f6]of _0x3d4cc2)'$graveyard'==_0x46a892['markers']['get'](_0x5dad32)['getRange']()['root']['rootName']&&(re(_0x5dad32['split'](':')[0x2],_0x2994f6['toRange'](),_0x46a892,_0x9377b3),_0x2994f6['detach']());_0x3d4cc2['clear']();});});}(_0x73e655),this['_domEmitter']['listenTo'](_0x11ae4d['document'],'keydown',(_0x3e5539,{key:_0x45318b})=>{'Escape'===_0x45318b&&function(_0x203153){_0x203153['editing']['view']['change'](_0x54fa98=>{for(const _0x5b725d of _0x203153['model']['markers']){if(!_0x5b725d['name']['startsWith']('user:position'))continue;const _0x4b316c=_0x203153['editing']['mapper']['markerNameToElements'](_0x5b725d['name']);if(_0x4b316c){for(const _0x3a1576 of _0x4b316c)_0x54fa98['removeClass']('ck-user__marker_hovered',_0x3a1576);}}});}(_0x73e655);},{'useCapture':!0x0});}['afterInit'](){const _0x555cfd=this['editor'],_0x2fb068=_0x555cfd['commands']['get']('undo');_0x2fb068&&_0x555cfd['model']['on']('applyOperation',(_0x4dc8c6,_0x3aeee2)=>{const _0x835707=_0x3aeee2[0x0];if('marker'!=_0x835707['type']||!_0x835707['name']['startsWith']('user:'))return;const _0x59c8b=_0x835707['batch'];_0x2fb068['_createdBatches']['has'](_0x59c8b)&&(_0x835707['newRange']=_0x835707['oldRange']?_0x555cfd['model']['createRange'](_0x835707['oldRange']['start'],_0x835707['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x109a3d=this['editor'],_0x4571af=_0x109a3d['model']['document'],_0x2fcd6c=_0x109a3d['plugins']['get'](i);_0x109a3d['model']['enqueueChange']({'isUndoable':!0x1},_0x3c9f07=>{const _0x49ef9b='user:range:'+_0x2fcd6c['mySessionId'],_0x49d32c='user:position:'+_0x2fcd6c['mySessionId'],_0x10757a=_0x109a3d['model']['markers']['has'](_0x49ef9b);_0x109a3d['editing']['view']['hasDomSelection']?re(_0x2fcd6c['mySessionId'],_0x4571af['selection']['getFirstRange'](),_0x109a3d['model'],_0x3c9f07):_0x10757a&&(_0x3c9f07['removeMarker'](_0x49ef9b),_0x3c9f07['removeMarker'](_0x49d32c));});}}function re(_0x157219,_0x1811dd,_0x564db1,_0x48813a){const _0x33cd1f='user:range:'+_0x157219,_0x470833='user:position:'+_0x157219,_0x13a812=_0x1811dd['getContainedElement']();let _0x5aeb2e=_0x1811dd['start'];_0x13a812&&_0x13a812['is']('element','tableCell')&&(_0x5aeb2e=function(_0xecd0b5,_0x89fc2f){for(const _0x3da43a of _0xecd0b5['getPositions']())if(_0x89fc2f['schema']['checkChild'](_0x3da43a,'$text'))return _0x3da43a;}(_0x1811dd,_0x564db1),_0x1811dd=_0x48813a['createRange'](_0x5aeb2e));const _0x4c5f66=_0x48813a['createRange'](_0x5aeb2e);_0x564db1['markers']['has'](_0x33cd1f)?(_0x48813a['updateMarker'](_0x33cd1f,{'range':_0x1811dd}),_0x48813a['updateMarker'](_0x470833,{'range':_0x4c5f66})):(_0x48813a['addMarker'](_0x33cd1f,{'range':_0x1811dd,'usingOperation':!0x0}),_0x48813a['addMarker'](_0x470833,{'range':_0x4c5f66,'usingOperation':!0x0}));}function q(_0x583af6,_0x337ff6,_0x1c7c06){const _0x12b68b=_0x583af6['t'],t=_0x583af6['t'];switch(_0x337ff6){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 _0x12b68b({'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'},_0x1c7c06);default:return'';}}let K=0x1;class l extends _0x2f4ec7{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x205cab)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,H,_0x19630d,_0x5e51ff,_0x1b3b0a];}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 _0x5ebbb6=this['serverHistory']['getOperations']();for(let _0x401991=_0x5ebbb6['length']-0x1;_0x401991>=0x0;_0x401991--){const _0xc11cfb=_0x5ebbb6[_0x401991];if(!this['_disconnectionOperations']['has'](_0xc11cfb))return _0xc11cfb['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x499522){if(super(_0x499522),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x12c917(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x4bb820('collaboration-missing-channelid',this);const _0x85eeb8=_0x499522['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x85eeb8,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x5808a4(),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 X(this['_disconnectionOperations']);}['init'](){const _0x8b245b=this['editor'],_0xc08767=_0x8b245b['plugins']['get'](_0x5e51ff),_0x5bda34=_0x8b245b['plugins']['get'](c);this['listenTo'](_0xc08767,'getOperationAuthor',(_0x1622bf,_0x5c301a)=>{const _0x1aa6f1=_0x5c301a[0x0];_0x1aa6f1['_authorId']&&(_0x1622bf['return']=_0xc08767['getUser'](_0x1aa6f1['_authorId']),_0x1622bf['stop']()),null===_0x1aa6f1['_authorId']&&(_0x1622bf['return']=null,_0x1622bf['stop']());},{'priority':'high'}),this['listenTo'](_0x8b245b['model']['document']['selection'],'change:range',(_0xd4f0f9,_0x510dd4)=>{_0x510dd4['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x8b245b['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x8b245b['model']['on']('applyOperation',(_0x3386cb,_0x2559d3)=>{const _0x53aa73=_0x2559d3[0x0];_0x53aa73['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x53aa73),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5bda34,'state',this,'_hasSynchronizationProblem',(_0x39f9a7,_0x57595f)=>'connected'===_0x39f9a7&&!_0x57595f),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x8b245b['disableReadOnlyMode']('rtc-offline'):_0x8b245b['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x8b245b['disableReadOnlyMode']('rtc-offline'):_0x8b245b['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x16f32f=this['editor']['plugins']['get'](i),_0x8431a5=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x16f32f['unregister'](this['_channelId']);const _0x20dd21=await this['_service']['reconnect'](_0x8431a5['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x20dd21)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x51ee5a=await this['_service']['getConnectedSessions']();_0x16f32f['register'](this['_channelId'],_0x51ee5a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x5e1873){if(function(_0x1a4295){return'404'===_0x1a4295['code'];}(_0x5e1873)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1967fa){return'409'===_0x1967fa['code'];}(_0x5e1873)){const _0x49c7c9=q(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'](_0x49c7c9);}else{if(!(_0x5e1873 instanceof J))throw _0x5e1873;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1608a7=this['editor']['plugins']['get'](c),_0x2aabab=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2aabab['channelSessions']['has'](this['_channelId'])&&_0x2aabab['unregister'](this['_channelId']),_0x1608a7['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4f4eed){if(this['sessionId']!==_0x4f4eed['sessionId']&&this['_lastSyncedOperationId']!==_0x4f4eed['lastOperationId'])throw new J();return this['sessionId']=_0x4f4eed['sessionId'],this['_handleServerResponse']([],{..._0x4f4eed,'wereChangesApplied':!0x1,'data':_0x4f4eed['data']},'reconnect');}async['_connectService'](_0x5ad166,_0x2ac486=!0x1){const {connection:_0x35e5fa}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x35e5fa,this['_channelId'])['then'](_0x4143ed=>this['_initSessionsHandling'](_0x4143ed))['catch'](_0x4ee191=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4ee191);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x219295,_0x4ffe0c)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x4ffe0c);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x4dea94=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5ad166);this['_isPendingUpdate']=!0x0;const _0x4f4fde=await this['_service']['connect'](_0x35e5fa,this['_compressOperations'](_0x5ad166),_0x4dea94);if(this['sessionId']=_0x4f4fde['sessionId'],_0x2ac486){if(!_0x4f4fde['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x4f4fde['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5ad166,_0x4f4fde,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x4f4fde,_0x5ad166);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x35124f=this['editor']['plugins']['get'](i),_0x3c527c=this['editor']['plugins']['get'](H),_0x293e41=_0x35124f['channelSessions']['get'](this['_channelId']);_0x293e41&&_0x293e41['length']>0x1?_0x3c527c['createUserMarkerOperations']():this['listenTo'](_0x35124f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x35124f['channelSessions']['get'](this['_channelId'])['length']&&_0x3c527c['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x46215d,_0x537d67,_0x52ed15,_0x1337af){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x537d67){const _0x4f8cdf=this['_decompressOperations'](_0x52ed15,_0x1337af);await this['_fetchMissingUsers'](_0x4f8cdf),this['_handleExternalOperations'](_0x4f8cdf,_0x537d67,_0x52ed15['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x37de5e}=this['editor'];let _0x426c44;try{_0x426c44=await this['_service']['getDocumentDetails']();}catch(_0x3f72f2){const _0x1d3961=q(_0x37de5e,'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'](_0x1d3961);}const _0x4d0d81=_0x426c44['currentDocumentSession']||_0x426c44['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x4d0d81['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x7a610=q(_0x37de5e,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x7a610);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x2c9a90){const _0x25dd1a=this['editor']['plugins']['get'](i);this['listenTo'](_0x25dd1a,'sessionAdd:'+this['_channelId'],(_0x29d721,{session:_0x34e7bc})=>{if(_0x34e7bc['id']===_0x25dd1a['mySessionId']){_0x29d721['off']();const _0x595a54=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x259d80=_0x34e7bc['permissions'];_0x595a54&&_0x595a54['isEnabled']&&(_0x259d80=_0x259d80['filter'](_0x3b5ab1=>'document:write'!==_0x3b5ab1)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x259d80,this['_channelId']);}}),_0x25dd1a['register'](this['_channelId'],_0x2c9a90);}['_initThrowingOnDataSet'](){const _0x328cec=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2bb345)=>{if(!_0x2bb345[_0x2bb345['length']-0x1]['suppressErrorInCollaboration'])throw new _0x4bb820('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x328cec['apply'](this['editor']['data'],_0x2bb345);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x46fcfe,[_0x277f20])=>{if(this['_document']['version'])throw new _0x4bb820('realtimecollaborationclient-init-document-already-initialized',this);_0x46fcfe['stop'](),this['_setPendingAction']();const _0x458618=this['editor']['config']['get']('rootsAttributes'),_0x114223=this['_getOperationsFromInitData'](_0x277f20,_0x458618);0x0==_0x114223['length']&&_0x114223['push'](new _0x27ffb8(0x0)),_0x46fcfe['return']=this['_connectService'](_0x114223)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x595c69=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x595c69))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x18d6c5,[_0x5990c7,_0x54e1c3])=>{_0x18d6c5['stop']();const _0x189642=this['editor']['model']['document']['getRoot'](_0x5990c7);if(!this['_knownRootNames']['has'](_0x5990c7)){const _0x2bd678=_0x54e1c3&&_0x54e1c3['data']?_0x54e1c3['data']:'',_0x1fb309=_0x54e1c3&&_0x54e1c3['attributes']?_0x54e1c3['attributes']:{};await this['_loadRoot'](_0x5990c7,_0x2bd678,_0x1fb309);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x189642['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x189642);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x134426){const _0x5b9647=this['editor']['plugins']['get'](_0x5e51ff),{connection:_0x135831}=this['editor']['plugins']['get'](c),_0x1e32b3=new Set();for(const _0x494b06 of _0x134426){const _0xc7d676=_0x494b06['_authorId'];_0xc7d676&&!_0x5b9647['getUser'](_0xc7d676)&&_0x1e32b3['add'](_0xc7d676);}if(0x0===_0x1e32b3['size'])return;const _0x5433ad=await dt['getMany'](_0x135831,Array['from'](_0x1e32b3));for(const _0x493705 of _0x5433ad)_0x5b9647['getUser'](_0x493705['id'])||_0x5b9647['addUser'](_0x493705);}['_getOperationsFromInitData'](_0x5bb1bb,_0x5c6b42={}){const _0x4a6b17=this['editor']['model'],_0x4f4842=[];let _0x43bcbf=0x0;const _0x31ffd1='string'==typeof _0x5bb1bb?{'main':_0x5bb1bb}:_0x5bb1bb;for(const _0x5eb0f0 of Object['keys'](_0x31ffd1)){if(!this['_document']['roots']['has'](_0x5eb0f0))throw new _0x4bb820('realtimecollaborationclient-init-non-existent-root',this);const _0x3cd4e2=this['editor']['data']['parse'](_0x31ffd1[_0x5eb0f0]),_0x5c91ef=this['_document']['getRoot'](_0x5eb0f0),_0x439271=new _0x3709a8(_0x4a6b17['createPositionAt'](_0x5c91ef,0x0),_0x3cd4e2,_0x43bcbf++);_0x4f4842['push'](_0x439271);for(const [_0x430f6a,_0x2c7e53]of _0x3cd4e2['markers']){const _0xe8c0f=_0x4a6b17['createRange'](_0x4a6b17['createPositionFromPath'](_0x5c91ef,_0x2c7e53['start']['path']['slice']()),_0x4a6b17['createPositionFromPath'](_0x5c91ef,_0x2c7e53['end']['path']['slice']())),_0x2a012e=new _0x164bdb(_0x430f6a,null,_0xe8c0f,_0x4a6b17['markers'],!0x0,_0x43bcbf++);_0x4f4842['push'](_0x2a012e);}}if(_0x5c6b42)for(const [_0x1d5e06,_0x1ddcce]of Object['entries'](_0x5c6b42)){const _0x43e170=_0x4a6b17['document']['getRoot'](_0x1d5e06);if(!_0x43e170)throw new _0x4bb820('multi-root-editor-root-attributes-no-root',null);for(const [_0x1a392b,_0xce9008]of Object['entries'](_0x1ddcce))if(null!==_0xce9008){const _0x116fac=new _0x257d74(_0x43e170,_0x1a392b,null,_0xce9008,_0x43bcbf++);_0x4f4842['push'](_0x116fac);}}return _0x4f4842;}async['_loadRoot'](_0x5cfa0d,_0x5d1449,_0xcc645){this['_getOperationsFromInitData']({[_0x5cfa0d]:_0x5d1449},{[_0x5cfa0d]:_0xcc645})['forEach']((_0x34ebb6,_0x19d843)=>{_0x34ebb6['baseVersion']=this['_document']['version']+_0x19d843,_0x34ebb6['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x34ebb6);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x10e056,_0x4e51b8){let _0x2cf2ca;this['_offset']=_0x10e056['offset'];const _0x289c12=_0x10e056['wereChangesApplied']&&!_0x10e056['initData'],_0x16b8b6=_0x289c12?0x0:_0x10e056['data']['baseVersion'];if(_0x4e51b8['forEach'](_0x5d5274=>{_0x5d5274['_isInit']=!0x0,_0x5d5274['createdAt']=_0x10e056['sessionCreatedAt'],_0x5d5274['_authorId']=null;}),_0x289c12)_0x2cf2ca=_0x4e51b8,this['_applyOperationsSet'](_0x2cf2ca,_0x289c12);else{if(_0x10e056['initData']){const _0x31aefc=this['_getOperationsFromInitData'](_0x10e056['initData']);this['_document']['history']['version']=-_0x31aefc['length'],_0x31aefc['forEach'](_0x284cc7=>{_0x284cc7['baseVersion']-=_0x31aefc['length'],_0x284cc7['createdAt']=_0x10e056['sessionCreatedAt'],_0x284cc7['_isInit']=!0x0,_0x284cc7['_authorId']=null;}),this['_applyOperationsSet'](_0x31aefc,!0x0),this['serverHistory']['version']=-_0x31aefc['length']+this['_offset'],this['_updateServerHistory'](_0x31aefc);}this['_document']['history']['version']=_0x16b8b6,_0x2cf2ca=this['_decompressOperations'](_0x10e056['data'],_0x10e056['metadata']),await this['_fetchMissingUsers'](_0x2cf2ca),this['_applyOperationsSet'](_0x2cf2ca,_0x289c12);}_0x10e056['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2cf2ca,_0x10e056['lastOperationId']),this['_lastSyncedOperationId']=_0x10e056['lastOperationId']),this['serverHistory']['version']=_0x16b8b6+this['_offset'],this['_updateServerHistory'](_0x2cf2ca),_0x4e51b8['filter'](_0x3ced9e=>{const _0x2f7c19=this['_getAffectedRoot'](_0x3ced9e);return _0x2f7c19&&!this['_knownRootNames']['has'](_0x2f7c19);})['forEach']((_0x36af0f,_0x556a27)=>{_0x36af0f['baseVersion']=this['_document']['version']+_0x556a27,this['_saveOperationInBuffer'](_0x36af0f);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2f0b59,_0x39c7d8,_0x11af1f){throw this['_isPendingUpdate']=!0x0,_0x39c7d8&&console['error'](_0x39c7d8),_0x11af1f&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x4bb820(_0x2f0b59,this['editor']);}['_saveOperationInBuffer'](_0x5ac183){this['_knownOperations']['has'](_0x5ac183)||(this['_knownOperations']['add'](_0x5ac183),this['_bufferedOperations']['push'](_0x5ac183),this['_pendingAction']||'marker'==_0x5ac183['type']&&!_0x5ac183['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x28b6e9=!0x1){!_0x28b6e9&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4c747f=>{_0x4c747f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3cd2f7=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x136e54){return _0x136e54['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x136e54['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x136e54['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3cd2f7)||this['_crash'](_0x3cd2f7['message'],_0x3cd2f7,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x244498=>{this['on']('change:_isPendingUpdate',()=>{_0x244498();});});}async['_sendBufferedOperations'](){const _0x305b47=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x305b47['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x46607c=[...this['_bufferedOperations']];for(const _0x29b241 of _0x46607c)_0x29b241['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x29b241);const _0x4ab5b9=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x46607c),_0x89bc5c=K++,_0x1051da=this['_compressOperations'](_0x46607c),_0x344e58=await this['_service']['sendOperations'](_0x1051da,_0x1051da['baseVersion'],_0x4ab5b9);try{return await this['_handleServerResponse'](_0x46607c,_0x344e58,_0x89bc5c);}catch(_0x5c888c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5c888c);}}async['_handleServerResponse'](_0x1f092f,_0x529dc4,_0x8b1007){if('error'in _0x529dc4)throw _0x529dc4['error'];let _0x5d1264=!0x1;if(_0x529dc4['wereChangesApplied']){_0x529dc4['lastOperationId']&&(this['_lastSyncedOperationId']=_0x529dc4['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x57f3f0=>!_0x1f092f['includes'](_0x57f3f0));for(const _0x2c9046 of _0x1f092f)_0x2c9046['createdAt']='lastOperationAcceptedAt'in _0x529dc4&&_0x529dc4['lastOperationAcceptedAt']||void 0x0;Q(_0x1f092f,_0x529dc4['version']-_0x1f092f['length']),this['_updateServerHistory'](_0x1f092f);const _0x13d2ff=_0x1f092f['filter'](_0x377015=>{if(!_0x377015['_isInit'])return!0x1;const _0xa18f9f=this['_getAffectedRoot'](_0x377015);return _0xa18f9f&&!this['_knownRootNames']['has'](_0xa18f9f);});Q(_0x13d2ff,this['_document']['version']),this['_applyOperationsSet'](_0x13d2ff),_0x5d1264=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x398c16=this['_decompressOperations'](_0x529dc4['data'],_0x529dc4['metadata'])['filter'](_0x27e296=>_0x27e296['baseVersion']>=this['_lastServerVersion']);_0x398c16['forEach'](_0x5680be=>this['_addKnownRoot'](_0x5680be)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3c37e1=>!_0x3c37e1['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3c37e1))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x398c16),_0x5d1264=this['_handleExternalOperations'](_0x398c16,_0x529dc4['version'],_0x529dc4['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5d1264?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2da746,_0x2437b4,_0x1e0ebf){try{const _0x115725={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x34b322,operationsB:_0x589da4,originalOperations:_0x32e1ba}=_0x583353(_0x2da746,this['_bufferedOperations'],_0x115725);Q(_0x34b322,this['_document']['version']),Q(_0x589da4,_0x2437b4);for(const _0x338eca of _0x34b322){const _0x82af41=_0x32e1ba['get'](_0x338eca);_0x338eca['_authorId']=_0x82af41?_0x82af41['_authorId']:null;}_0x1e0ebf&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2da746,_0x1e0ebf),this['_lastSyncedOperationId']=_0x1e0ebf),this['_bufferedOperations']=[..._0x589da4],this['_applyOperationsSet'](_0x34b322),this['_updateServerHistory'](_0x2da746);}catch(_0x4b4f65){return console['error'](_0x4b4f65),!0x1;}return!0x0;}['_applyOperationsSet'](_0x9fd829,_0x190de7=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4b7f96=>{for(const _0x4111df of _0x9fd829)this['_knownOperations']['add'](_0x4111df),this['_addKnownRoot'](_0x4111df),_0x4b7f96['batch']['addOperation'](_0x4111df),this['editor']['model']['applyOperation'](_0x4111df);});}['_addKnownRoot'](_0x4f1598){const _0x2422b8=this['_getAffectedRoot'](_0x4f1598);_0x2422b8&&this['_knownRootNames']['add'](_0x2422b8);}['_getAffectedRoot'](_0x268b10){let _0x4a8fd5,_0x1cdd9c;switch(_0x268b10['type']){case'insert':_0x4a8fd5=_0x268b10['position']['root'];break;case'marker':if(_0x1cdd9c=_0x268b10['newRange'],!_0x1cdd9c)return null;_0x4a8fd5=_0x1cdd9c['root'];break;case'addRootAttribute':_0x4a8fd5=_0x268b10['root'];break;case'addRoot':_0x4a8fd5=_0x268b10['affectedSelectable'];break;case'move':_0x4a8fd5=_0x268b10['targetPosition']['root'];break;default:return null;}return _0x4a8fd5['rootName'];}['_updateServerHistory'](_0x462c45){_0x462c45['forEach'](_0x370751=>{const _0x2c893d=_0x370751['clone']();_0x2c893d['_authorId']=_0x370751['_authorId'],_0x2c893d['_isInit']=!!_0x370751['_isInit'],_0x2c893d['createdAt']=_0x370751['createdAt'],_0x2c893d['baseVersion']+=this['_offset'],_0x370751['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x2c893d),this['serverHistory']['addOperation'](_0x2c893d);});}['_handleReconnectionError'](_0x3f9052){const _0x5bb337=this['editor']['plugins']['get']('Notification'),_0x58881e=this['editor']['locale'];_0x3f9052||(_0x3f9052=q(_0x58881e,'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.')),_0x5bb337['showWarning'](_0x3f9052,{'title':q(_0x58881e,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x19630d)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x19630d)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x277c31){const _0x5ac04e=_0x277c31['map'](_0x2c7818=>_0x2c7818['toJSON']());return this['_compressor']['compress'](_0x5ac04e);}['_decompressOperations'](_0x562b67,_0x215866){return this['_compressor']['decompress'](_0x562b67)['map']((_0x43927d,_0x1b0db1)=>{const _0x34425c='init'==_0x215866[_0x1b0db1]['type'];if('InsertOperation'==_0x43927d['__className']){const _0x458186=_0x43927d['position']['root'];!this['_document']['getRoot'](_0x458186)&&(this['_document']['createRoot']('$root',_0x458186)['_isAttached']=!0x1);}const _0x32f7f7=_0x3e5cf4['fromJSON'](_0x43927d,this['_document']);return _0x32f7f7['wasUndone']=_0x43927d['wasUndone'],_0x32f7f7['_isInit']=_0x34425c,_0x32f7f7['_authorId']=_0x34425c?null:_0x215866[_0x1b0db1]['userId'],_0x32f7f7['_isDisconnection']='cs:removeUser'===_0x215866[_0x1b0db1]['type'],_0x32f7f7['createdAt']=_0x215866[_0x1b0db1]['createdAt'],_0x32f7f7;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x416517=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x416517&&_0x416517['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x482d0c,_0x1d4d7d){for(const _0xa391e1 of _0x482d0c)_0xa391e1['baseVersion']=_0x1d4d7d++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x198192){this['_ignoredOperations']=_0x198192,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4b3b37){let _0x12c1ac=_0x4b3b37['length'];for(;_0x12c1ac--;){const _0x1d13bf=_0x4b3b37[_0x12c1ac];if(!this['_ignoredOperations']['has'](_0x1d13bf)){if(!this['_operationToId']['has'](_0x1d13bf)){const _0x204001=_0x1076e1()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1d13bf,_0x204001);}return this['_operationToId']['get'](_0x1d13bf);}}}['setIdForTheLastOperation'](_0x18af57,_0x3efcbe){if(!_0x3efcbe)return;let _0x39ff42=_0x18af57['length'];for(;_0x39ff42--;){const _0x290972=_0x18af57[_0x39ff42];this['_ignoredOperations']['has'](_0x290972)||this['_operationToId']['set'](_0x290972,_0x3efcbe);}}}class n extends _0x2f4ec7{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x5a8039{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x507313)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x5e51ff];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1fd16d){super(_0x1fd16d),this['_services']=new Map();}async['init'](){const _0x470a8e=this['context'],_0x393a68=_0x470a8e['plugins']['get']('CommentsRepository');if(_0x470a8e['plugins']['get'](c)['addToReconnectionStack'](this),_0x393a68['adapter']={'addCommentThread':async({channelId:_0x2b5e15,threadId:_0x3ea87d,comments:_0xe96397,resolvedAt:_0x14c5ea,resolvedBy:_0x44e694,context:_0x1c133d,attributes:_0x1246a2})=>{const _0x303e28=await this['_getService'](_0x2b5e15)['addCommentThread']({'commentThreadId':_0x3ea87d,'comments':_0xe96397['map'](_0x6fb6d4=>function(_0xb52649,_0x2eb0f9,_0x148bde){return{'commentThreadId':_0x148bde,'commentId':_0xb52649['commentId'],'userId':_0xb52649['authorId'],'content':_0xb52649['content'],'documentId':_0x2eb0f9,'createdAt':_0xb52649['createdAt'],'attributes':_0xb52649['attributes']||{}};}(_0x6fb6d4,_0x2b5e15,_0x3ea87d)),'resolvedAt':_0x14c5ea,'resolvedBy':_0x44e694,'context':_0x1c133d,'attributes':_0x1246a2})['catch'](ut);return{'threadId':_0x303e28['commentThreadId'],'comments':_0x303e28['comments']};},'getCommentThread':async({channelId:_0x282cdf,threadId:_0x50696f})=>{const _0x369ed9=await this['_getService'](_0x282cdf)['getCommentThread'](_0x50696f)['catch'](ut);return _0x369ed9['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x369ed9]),{'threadId':_0x369ed9['commentThreadId'],'comments':_0x369ed9['comments']['map'](b),'context':_0x369ed9['context'],'resolvedAt':_0x369ed9['resolvedAt'],'resolvedBy':_0x369ed9['resolvedBy'],'attributes':_0x369ed9['attributes']||{}});},'updateCommentThread':async({channelId:_0x1e3d90,threadId:_0x112f43,context:_0x426caf,unlinkedAt:_0x1ec8f4,attributes:_0x567601})=>this['_getService'](_0x1e3d90)['updateCommentThread']({'commentThreadId':_0x112f43,'context':_0x426caf,'attributes':_0x567601,'unlinkedAt':_0x1ec8f4})['catch'](y)['catch'](ut),'resolveCommentThread':async({channelId:_0x5c1ce9,threadId:_0x3a2207})=>{const _0xf976c1=await this['_getService'](_0x5c1ce9)['resolveCommentThread'](_0x3a2207)['catch'](y)['catch'](ut);return{'threadId':_0xf976c1['commentThreadId'],'resolvedAt':_0xf976c1['resolvedAt'],'resolvedBy':_0xf976c1['resolvedBy']};},'reopenCommentThread':async({channelId:_0x4e5dd5,threadId:_0x292496})=>this['_getService'](_0x4e5dd5)['reopenCommentThread'](_0x292496)['catch'](y)['catch'](ut),'removeCommentThread':({channelId:_0x3a27aa,threadId:_0x8de907})=>this['_getService'](_0x3a27aa)['removeCommentThread'](_0x8de907)['catch'](y)['catch'](ut),'addComment':({channelId:_0x3dbef0,threadId:_0x2bb618,commentId:_0x25aacc,content:_0xdaf414,attributes:_0x68e5c8})=>this['_getService'](_0x3dbef0)['addComment'](_0x2bb618,_0x25aacc,_0xdaf414,_0x68e5c8)['catch'](ut),'updateComment':({channelId:_0x300241,threadId:_0x330629,commentId:_0x24e4c8,content:_0x160bb1,attributes:_0x46355b})=>this['_getService'](_0x300241)['updateComment'](_0x330629,_0x24e4c8,_0x160bb1,_0x46355b)['catch'](y)['catch'](ut),'removeComment':({channelId:_0xf2fe30,threadId:_0x18b006,commentId:_0x47745e})=>this['_getService'](_0xf2fe30)['removeComment'](_0x18b006,_0x47745e)['catch'](y)['catch'](ut)},_0x470a8e instanceof _0x4f9ef2){const _0x2ab058=_0x470a8e['config']['get']('collaboration.channelId'),_0x3e84c9=_0x470a8e['plugins']['get'](i);await this['_setUpService'](_0x2ab058);const _0x457c98=await this['_services']['get'](_0x2ab058)['getConnectedSessions']();this['listenTo'](_0x3e84c9,'sessionAdd:'+_0x2ab058,(_0xc1415c,{session:_0x2b9ca0})=>{_0x2b9ca0['id']===_0x3e84c9['mySessionId']&&(_0xc1415c['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2b9ca0['permissions'],_0x2ab058));}),_0x3e84c9['register'](_0x2ab058,_0x457c98);}}async['_setUpService'](_0x452715){if(this['_services']['has'](_0x452715))throw new _0x4bb820('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x452715});const _0x1cb15d=this['context']['plugins']['get']('CommentsRepository'),_0x32f8ee=new a['CommentsService'](_0x452715);this['_services']['set'](_0x452715,_0x32f8ee),this['listenTo'](_0x32f8ee,'commentThreadAdded',(_0x445f9d,_0x163fa2)=>{const {commentThreadId:_0x2c0989,documentId:_0x52b53e,context:_0x2328f5,attributes:_0x2f58a5,resolvedAt:_0xf88d58,resolvedBy:_0x2ba311,comments:_0x205106}=_0x163fa2;_0x1cb15d['getCommentThread'](_0x2c0989)||_0x1cb15d['addCommentThread']({'threadId':_0x2c0989,'channelId':_0x52b53e,'comments':_0x205106?_0x205106['map'](b):[],'context':_0x2328f5,'attributes':_0x2f58a5,'resolvedAt':_0xf88d58,'resolvedBy':_0x2ba311,'isFromAdapter':!0x0});}),this['listenTo'](_0x32f8ee,'commentThreadUpdated',(_0x390b09,{commentThreadId:_0x5a367e,documentId:_0x888d50,context:_0x239e70,unlinkedAt:_0xdf6b15,attributes:_0xe5437f})=>{_0x1cb15d['getCommentThread'](_0x5a367e)&&_0x1cb15d['updateCommentThread']({'threadId':_0x5a367e,'channelId':_0x888d50,'context':_0x239e70,'unlinkedAt':_0xdf6b15,'attributes':_0xe5437f,'isFromAdapter':!0x0});}),this['listenTo'](_0x32f8ee,'commentThreadResolved',(_0x21d95a,{commentThreadId:_0x2b7108,resolvedBy:_0x13cb74,resolvedAt:_0xf9915c})=>{const _0x2d8b1e=_0x1cb15d['getCommentThread'](_0x2b7108);_0x2d8b1e&&_0x2d8b1e['resolve']({'resolvedBy':_0x13cb74,'resolvedAt':_0xf9915c,'isFromAdapter':!0x0});}),this['listenTo'](_0x32f8ee,'commentThreadReopened',(_0x1e091a,{commentThreadId:_0x1ff159})=>{const _0x19aba4=_0x1cb15d['getCommentThread'](_0x1ff159);_0x19aba4&&_0x19aba4['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x32f8ee,'commentThreadRemoved',(_0x2f4a77,{commentThreadId:_0x5a6c5c})=>{const _0x11887b=_0x1cb15d['getCommentThread'](_0x5a6c5c);_0x11887b&&_0x11887b['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x32f8ee,'commentAdded',(_0x569bf0,_0x4241d7)=>{const _0x1284e5=_0x4241d7['commentThreadId'],_0x5b4fae=_0x1cb15d['getCommentThread'](_0x1284e5);_0x5b4fae&&_0x5b4fae['addComment']({...b(_0x4241d7),'isFromAdapter':!0x0});}),this['listenTo'](_0x32f8ee,'commentUpdated',(_0x1ccf54,{commentThreadId:_0x36033c,commentId:_0x40da70,content:_0x4f3931,attributes:_0x322237})=>{const _0x2e3592=_0x1cb15d['getCommentThread'](_0x36033c);if(_0x2e3592){const _0x3a3abc=_0x2e3592['getComment'](_0x40da70);_0x3a3abc&&_0x3a3abc['update']({'content':_0x4f3931,'attributes':_0x322237,'isFromAdapter':!0x0});}}),this['listenTo'](_0x32f8ee,'commentRemoved',(_0x449d8e,{commentThreadId:_0x21681d,commentId:_0x810607})=>{const _0x342d7c=_0x1cb15d['getCommentThread'](_0x21681d);if(_0x342d7c){const _0x2c10db=_0x342d7c['getComment'](_0x810607);_0x2c10db&&_0x2c10db['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x452715);}['destroy'](){if(this['context']instanceof _0x4f9ef2){const _0x1f9599=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x1f9599);}}['_terminateService'](_0x39e888){if(!this['_services']['has'](_0x39e888))throw new _0x4bb820('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x39e888});this['_getService'](_0x39e888)['disconnect'](),this['_services']['delete'](_0x39e888);}async['reconnect'](){for(const _0x53513a of this['_services']['keys']())await this['_connectService'](_0x53513a);if(this['context']instanceof _0x4f9ef2){const _0x135803=this['context']['config']['get']('collaboration.channelId'),_0x3df634=this['context']['plugins']['get'](i);_0x3df634['unregister'](_0x135803);const _0xffdd60=await this['_services']['get'](_0x135803)['getConnectedSessions']();_0x3df634['register'](_0x135803,_0xffdd60);}}async['_connectService'](_0x979723){const {connection:_0x17b8c6}=this['context']['plugins']['get'](c),_0x529440=this['context']['plugins']['get']('CommentsRepository'),_0x4d6152=this['_services']['get'](_0x979723),_0x197a16=await _0x4d6152['connect'](_0x17b8c6);await this['_fetchMissingUsersForThreads'](_0x197a16);const _0x49d5db=new Set(Array['from'](_0x529440['getCommentThreads']({'channelId':_0x979723}),_0x319f48=>_0x319f48['id']));for(const _0x4fb326 of _0x197a16)_0x4fb326['deletedAt']||_0x49d5db['delete'](_0x4fb326['commentThreadId']);for(const _0x2c8bbc of _0x49d5db)_0x529440['getCommentThread'](_0x2c8bbc)['remove']({'isFromAdapter':!0x0});for(const _0x4e21d6 of _0x197a16){let _0x3b9099=_0x529440['getCommentThread'](_0x4e21d6['commentThreadId']);const {commentThreadId:_0x4af3c6,context:_0x395bb0,attributes:_0x176029,resolvedBy:_0x28ef9f,resolvedAt:_0x26ff0d,unlinkedAt:_0x5cdf58,deletedAt:_0xcbf5e2}=_0x4e21d6;if(_0xcbf5e2)continue;_0x3b9099||(_0x3b9099=_0x529440['addCommentThread']({'channelId':_0x979723,'threadId':_0x4af3c6,'context':_0x395bb0,'attributes':_0x176029||{},'resolvedBy':_0x28ef9f,'resolvedAt':_0x26ff0d,'unlinkedAt':_0x5cdf58,'isFromAdapter':!0x0}));const _0xe03b89=new Set(Array['from'](_0x3b9099['comments'],_0x3383cb=>_0x3383cb['id']));for(const _0x4a26b0 of _0x4e21d6['comments'])_0xe03b89['delete'](_0x4a26b0['commentId']);for(const _0x34897c of _0xe03b89)_0x3b9099['getComment'](_0x34897c)['remove']({'isFromAdapter':!0x0});for(const _0x1dc840 of _0x4e21d6['comments']){const _0x4730bf=_0x3b9099['getComment'](_0x1dc840['commentId']);_0x4730bf?_0x4730bf['content']!==_0x1dc840['content']&&_0x4730bf['update']({'content':_0x1dc840['content'],'isFromAdapter':!0x0}):_0x3b9099['addComment'](Object['assign'](b(_0x1dc840),{'isFromAdapter':!0x0}));}}}['_getService'](_0x14d5f1){if(!this['_services']['has'](_0x14d5f1))throw new _0x4bb820('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x14d5f1});return this['_services']['get'](_0x14d5f1);}async['_fetchMissingUsersForThreads'](_0x23d6ba){const _0xdbd6b2=this['context']['plugins']['get'](_0x5e51ff),{connection:_0x3f540b}=this['context']['plugins']['get'](c),_0x14054a=new Set();for(const {resolvedBy:_0x49f305,comments:_0x33a8c9}of _0x23d6ba){_0x49f305&&!_0xdbd6b2['getUser'](_0x49f305)&&_0x14054a['add'](_0x49f305);for(const {userId:_0x2dcc13}of _0x33a8c9)_0xdbd6b2['getUser'](_0x2dcc13)||_0x14054a['add'](_0x2dcc13);}if(0x0===_0x14054a['size'])return;const _0x953ef9=await dt['getMany'](_0x3f540b,Array['from'](_0x14054a));for(const _0x2db98f of _0x953ef9)_0xdbd6b2['getUser'](_0x2db98f['id'])||_0xdbd6b2['addUser'](_0x2db98f);}}async function y(_0x49e612){if('404'!==_0x49e612['code'])throw _0x49e612;}function ut(_0xa15a01){if((_0x21fc15=_0xa15a01)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x21fc15['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x21fc15['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x21fc15;throw _0xa15a01;}function b(_0x3017b6){return{'threadId':_0x3017b6['commentThreadId'],'commentId':_0x3017b6['commentId'],'content':_0x3017b6['content'],'createdAt':_0x3017b6['createdAt'],'authorId':_0x3017b6['userId'],'attributes':_0x3017b6['attributes']||{}};}class f extends _0x2f4ec7{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x247d85){super(_0x247d85);const _0x2c3e91=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x2c3e91);}['init'](){const _0x2ff439=this['editor']['plugins']['get'](c),_0x3fe073=this['editor']['plugins']['get']('TrackChangesEditing');return _0x3fe073['adapter']={'getSuggestion':async _0x3d74f4=>{await this['_waitForServiceReady']();const _0x5196a3=await this['_trackChangesService']['get'](_0x3d74f4)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x5196a3]),_0x5196a3;},'addSuggestion':async({id:_0x374ff6,type:_0x9a3506,data:_0x534ae,originalSuggestionId:_0x296531,attributes:_0x474479})=>{await this['_waitForServiceReady']();const _0x285db9={'id':_0x374ff6,'type':_0x9a3506,'data':_0x534ae,'originalSuggestionId':_0x296531,'attributes':_0x474479},_0x3f9bc3=await this['_trackChangesService']['add'](_0x374ff6,_0x9a3506,_0x534ae,_0x296531,_0x474479)['catch'](_0x3ae227=>{if(ft(_0x3ae227))return new Promise(_0x554ce3=>{this['_bufferedRequests']['set'](_0x374ff6,{'resolve':_0x554ce3,'suggestionData':_0x285db9});});throw _0x3ae227;});return this['_bufferedRequests']['delete'](_0x374ff6),_0x3f9bc3;},'updateSuggestion':async(_0xb6326a,_0x16b4e2)=>{if(await this['_waitForServiceReady'](),'open'!==_0x16b4e2['state'])return this['_trackChangesService']['update'](_0xb6326a,_0x16b4e2)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x28e296,_0x5f8ba3)=>{_0x3fe073['hasSuggestion'](_0x5f8ba3['id'])&&(_0x3fe073['getSuggestion'](_0x5f8ba3['id'])['attributes']=_0x5f8ba3['attributes']);}),this['_trackChangesService']['connect'](_0x2ff439['connection'])['then'](_0x41d57b=>(_0x2ff439['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x41d57b)['then'](()=>{for(const _0x58cbe3 of _0x41d57b){_0x3fe073['addSuggestionData'](_0x58cbe3)['_saved']=!0x0;}})));}async['reconnect'](){const _0x7740da=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x58d1ef}=this['editor']['plugins']['get'](c),_0x48679b=await this['_trackChangesService']['connect'](_0x58d1ef);await this['_fetchMissingUsersForThreads'](_0x48679b);for(const {suggestionData:_0x524450,resolve:_0x190252}of this['_bufferedRequests']['values']()){let _0x23106d=_0x48679b['find'](_0x2436d7=>_0x2436d7['id']===_0x524450['id']);_0x23106d||(_0x23106d=await this['_trackChangesService']['add'](_0x524450['id'],_0x524450['type'],_0x524450['data'],_0x524450['originalSuggestionId'])),_0x190252(_0x23106d);}for(const _0x40588e of _0x48679b)_0x7740da['hasSuggestion'](_0x40588e['id'])||_0x7740da['addSuggestionData'](_0x40588e);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x495aba=>{this['listenTo'](this['_trackChangesService'],'connected',_0x372354=>{_0x372354['off'](),_0x495aba();});});}async['_fetchMissingUsersForThreads'](_0xfefa33){const _0x5c4118=this['editor']['plugins']['get'](_0x5e51ff),{connection:_0x214175}=this['editor']['plugins']['get'](c),_0xa0412b=new Set();for(const {authorId:_0x30071e}of _0xfefa33)_0x5c4118['getUser'](_0x30071e)||_0xa0412b['add'](_0x30071e);if(0x0===_0xa0412b['size'])return;const _0x27d24e=await dt['getMany'](_0x214175,Array['from'](_0xa0412b));for(const _0x144e5a of _0x27d24e)_0x5c4118['getUser'](_0x144e5a['id'])||_0x5c4118['addUser'](_0x144e5a);}}function w(_0x494234){if(ft(_0x494234))return new Promise(()=>{});throw _0x494234;}function ft(_0x55821f){return _0x55821f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x55821f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x2f4ec7{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2df85b=this['editor']['plugins']['get'](c),_0x50a757=this['editor']['plugins']['get']('CommentsEditing'),_0x14bd3f=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2df85b,'change:state',(_0x1d193a,_0x46fa81,_0x36d658)=>{_0x50a757['isThreadsLoadingPaused']='connected'!==_0x36d658;});}),this['listenTo'](_0x2df85b,'change:state',(_0x34c388,_0x455f4a,_0x16d284)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x16d284);}),_0x14bd3f['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x2f4ec7{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x2f4ec7{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x5e51ff];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x22d6fa){super(_0x22d6fa);const _0x1298d9=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x1298d9);}async['init'](){const _0x23a5be=this['editor']['plugins']['get'](l),_0x386f3c=_0x23a5be['serverHistory'],_0x1cfd29=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x386f3c,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x23a5be['sessionId']});const _0x3ed48f=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x53aed7=await tt['isBundleUploaded'](_0x1cfd29['connection'],_0x3ed48f);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x33bef9})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x33bef9)),'updateRevisions':async _0x113ce6=>{await this['_waitForServiceReady']();const _0xb743d0=this['_revisionTracker']['currentRevision'];if(_0x53aed7&&0x1===_0x113ce6['length']&&_0x113ce6[0x0]['id']===_0xb743d0['id'])return _0x113ce6;for(const _0x2df726 of _0x113ce6)_0x2df726['id']===_0xb743d0['id']&&(_0x2df726['isEmptyCurrent']=_0x2df726['fromVersion']===_0x2df726['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x113ce6,this['_lastRequestId'])['then'](_0x171727=>(this['_lastRequestId']=_0x171727,_0x113ce6))['catch'](_0x5d9432=>{if(st(_0x5d9432)||'400'===_0x5d9432['code']&&void 0x0!==_0x5d9432['data']['wrongRequestId']){for(const _0x151a63 of _0x113ce6){!this['_revisionTracker']['repository']['getRevision'](_0x151a63['id'])||this['_revisionTracker']['_bufferUpdate'](_0x151a63['id'],_0x151a63,!0x1);}if(st(_0x5d9432))throw _0x5d9432;return _0x113ce6;}throw _0x5d9432;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xebe53f,{revisionsData:_0x1d2304,requestId:_0x4f8c0b})=>{Math['max'](..._0x1d2304['map'](_0x713f29=>_0x713f29['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1d2304,_0x4f8c0b);}):this['_handleRevisionsUpdate'](_0x1d2304,_0x4f8c0b);});const {revisions:_0x4efedd,requestId:_0x381946}=await this['_revisionHistoryService']['connect'](_0x1cfd29['connection']);_0x1cfd29['addToReconnectionStack'](this),this['_lastRequestId']=_0x381946,await this['_fetchMissingUsers'](_0x4efedd);for(const _0x5e00f7 of _0x4efedd)this['_revisionTracker']['addRevisionData'](_0x5e00f7);this['listenTo'](_0x23a5be,'change:_isConnected',(_0x2fa337,_0x1b3f38,_0xe0668)=>{_0xe0668&&(this['_oldOffset']=_0x23a5be['_offset'],_0x2fa337['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x1cfd29,'state',_0x2397c8=>_0x2397c8===_0x42944f['CONNECTED']);}async['reconnect'](){const _0x277534=this['editor']['plugins']['get'](c),_0x150eb9=this['editor']['plugins']['get'](l),_0x54ab0a=async()=>{const _0x52a5d6=this['_revisionTracker']['currentRevision'],_0xe4b2fc=_0x52a5d6['id'],_0x389108=_0xe4b2fc!==_0x150eb9['sessionId'];if(_0x389108){const _0x555f53=_0x150eb9['_offset']-this['_oldOffset'],_0x2978e8=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x52a5d6['toVersion']+_0x555f53!==_0x2978e8){const _0x27bd81=_0x52a5d6['fromVersion']+_0x555f53,_0x8907d0=this['editor']['plugins']['get'](_0x5e51ff),_0x209563=this['_revisionTracker']['buildRevisionData']({'revision':_0x52a5d6,'from':_0x27bd81,'to':_0x2978e8});_0x209563['id']=_0x52a5d6['id'];const _0x15e418=_0x209563['authorsIds']['map'](_0x2db170=>_0x8907d0['getUser'](_0x2db170));_0x52a5d6['_update']({..._0x209563,'authors':_0x15e418},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x52a5d6['id'],_0x209563,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2978e8,(_0x52a5d6['toVersion']===_0x52a5d6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xe4b2fc)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xe4b2fc),this['_revisionTracker']['_createCurrentRevision'](_0x2978e8));}const {revisions:_0x19d144,requestId:_0x14b21f}=await this['_revisionHistoryService']['reconnect'](_0x277534['connection'],this['_lastRequestId']);_0x389108&&_0x19d144['length']>0x0?_0x150eb9['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x19d144),this['_handleRevisionsUpdate'](_0x19d144,_0x14b21f),this['_revisionTracker']['sendBufferedUpdates']());};return _0x150eb9['_isConnected']?_0x54ab0a():new Promise((_0x1fd695,_0x332b44)=>{_0x150eb9['once']('change:_isConnected',()=>{_0x54ab0a()['then'](_0x1fd695)['catch'](_0x332b44);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x39b1a0=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x40e236=>{_0x40e236['off'](),_0x39b1a0();});});}['_getLatestVersionFromServerOperations'](){const _0x3f08b0=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x5eb32a of _0x3f08b0)if('marker'!==_0x5eb32a['type']||_0x5eb32a['affectsData'])return _0x5eb32a['baseVersion']+0x1;}['_getLatestVersion'](){const _0x812ed7=this['editor']['plugins']['get'](l);return new Promise(_0x1a18b5=>{_0x812ed7['_isPendingUpdate']?_0x812ed7['once']('change:_isPendingUpdate',()=>{_0x1a18b5(this['_getLatestVersionFromServerOperations']());}):_0x1a18b5(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0xa9dee6,_0x429d5c){const _0x57844e=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x429d5c;for(const _0x2cc27d of _0xa9dee6){const _0x4693e6=_0x57844e['getRevision'](_0x2cc27d['id']);if(_0x4693e6){if((_0x2cc27d['fromVersion']||_0x2cc27d['toVersion'])&&(_0x2cc27d['diffData']=null),_0x4693e6===this['_revisionTracker']['currentRevision']){const _0x1bb018=Math['max'](_0x4693e6['toVersion'],_0x2cc27d['toVersion']),_0x57f084=Math['max'](_0x4693e6['fromVersion'],_0x2cc27d['fromVersion']);let _0x6eb1d2;_0x4693e6['toVersion']===_0x2cc27d['toVersion']&&_0x4693e6['fromVersion']===_0x2cc27d['fromVersion']?(_0x6eb1d2=!0x0,this['_preventResendingRevisionData'](_0x2cc27d)):_0x2cc27d['toVersion']===_0x1bb018&&_0x2cc27d['fromVersion']===_0x57f084?_0x6eb1d2=!0x1:(_0x4693e6['toVersion']===_0x1bb018&&_0x4693e6['fromVersion']===_0x57f084||this['_fixRevision']({'revision':_0x4693e6,'from':_0x57f084,'to':_0x1bb018}),_0x6eb1d2=!0x0),_0x6eb1d2&&(delete _0x2cc27d['fromVersion'],delete _0x2cc27d['toVersion'],delete _0x2cc27d['diffData'],delete _0x2cc27d['createdAt'],delete _0x2cc27d['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2cc27d),this['_preventResendingRevisionData'](_0x2cc27d);}else this['_revisionTracker']['addRevisionData'](_0x2cc27d);}const _0x45ed48=_0x57844e['getRevisions']();_0x45ed48['reverse']();for(let _0x594521=0x0;_0x594521<_0x45ed48['length']-0x1;_0x594521++){const _0x12f033=_0x45ed48[_0x594521],_0x2ce9f1=_0x45ed48[_0x594521+0x1];if(_0x12f033['fromVersion']<_0x2ce9f1['toVersion']){const _0x74f36e=_0x2ce9f1['toVersion'],_0x185c3c=Math['max'](_0x74f36e,_0x12f033['toVersion']);this['_fixRevision']({'revision':_0x12f033,'from':_0x74f36e,'to':_0x185c3c});}}}['_fixRevision']({revision:_0x43a217,from:_0x2de269,to:_0x5907df}={}){const _0x3b40ac=this['editor']['plugins']['get'](_0x5e51ff),_0x53907d=this['_revisionTracker']['buildRevisionData']({'revision':_0x43a217,'from':_0x2de269,'to':_0x5907df});_0x53907d['authors']=_0x53907d['authorsIds']['map'](_0x45d85b=>_0x3b40ac['getUser'](_0x45d85b)),_0x43a217['_update'](_0x53907d);}['_preventResendingRevisionData'](_0x512cff){const _0xb48dd6={};_0xb48dd6['id']=_0x512cff['id'];for(const _0xccb03f of Object['keys'](_0x512cff))'id'!==_0xccb03f&&(_0xb48dd6[_0xccb03f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xb48dd6['id'],_0xb48dd6,!0x0);}async['_fetchMissingUsers'](_0x201bb7){const _0x44a9c8=this['editor']['plugins']['get'](_0x5e51ff),{connection:_0x4cda27}=this['editor']['plugins']['get'](c),_0x2ffa8e=new Set();for(const _0x5c3135 of _0x201bb7){for(const _0x18a413 of _0x5c3135['authorsIds'])_0x4fbe5d(_0x18a413);_0x5c3135['creatorId']&&_0x4fbe5d(_0x5c3135['creatorId']);}if(0x0===_0x2ffa8e['size'])return;const _0x5dca43=await dt['getMany'](_0x4cda27,Array['from'](_0x2ffa8e));for(const _0x27a04f of _0x5dca43)_0x44a9c8['getUser'](_0x27a04f['id'])||_0x44a9c8['addUser'](_0x27a04f);function _0x4fbe5d(_0x5d5d6a){_0x44a9c8['getUser'](_0x5d5d6a)||_0x2ffa8e['add'](_0x5d5d6a);}}}function st(_0x51e0d8){return _0x51e0d8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x51e0d8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x51e0d8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x2f4ec7{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x4a36b3{constructor(_0x509190){super(_0x509190);const _0x5e99f1=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x5e99f1['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x5e99f1['to']('usersCount',_0x53da39=>q(_0x509190,'CONNECTED_USERS',_0x53da39))}]});}}class es extends _0x4a36b3{['items'];['keystrokes'];constructor(_0x26f530){super(_0x26f530);const _0x401480=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5393f7(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x401480['if']('hasPopup'),'aria-expanded':_0x401480['to']('isExpanded',_0x51be11=>this['hasPopup']&&String(_0x51be11)),'aria-label':_0x401480['to']('hasPopup',_0x42d3cf=>q(_0x26f530,_0x42d3cf?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x401480['to']('hasPopup',_0x3c9cd6=>!!_0x3c9cd6&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x401480['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x584dae,_0xb9e711,_0x42cc5d)=>{this['element']&&(_0x42cc5d?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 _ extends _0x4a36b3{['counterView'];['inlineListView'];constructor(_0x417ee4){super(_0x417ee4);const _0x20c9ed=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x417ee4),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x1c659c of this['inlineListView']['items'])_0x1c659c['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',_0x20c9ed['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class M extends _0x4a36b3{['listWrapperView'];constructor(_0x2c5f36,_0x2a3e0f){super(_0x2c5f36),this['listWrapperView']=new mt(_0x2c5f36,_0x2a3e0f),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x2c5f36,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x5b5e13{constructor(_0x5310aa,_0x3abe44){super(_0x5310aa);const _0x3fccd7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x3abe44?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3fccd7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3fccd7['to']('role'),'aria-label':_0x3fccd7['to']('ariaLabel'),'aria-labelledby':_0x3fccd7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x11ae4d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x501575=this['element'];_0x501575&&(this['_isScrollable']=Math['max'](_0x501575['scrollHeight'],_0x501575['clientHeight'])>0.8*window['innerHeight']);}}class E extends rt{['userView'];constructor(_0x1845dd,_0x1c69dd,_0x870c9a){super(_0x1845dd);const _0x4bd903=this['bindTemplate'];this['userView']=new ct(_0x1845dd,_0x1c69dd);const _0x2d655e={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x1c69dd['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x1c69dd['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1c69dd['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x870c9a&&(_0x2d655e['tag']='button',_0x2d655e['on']={'click':_0x4bd903['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2d655e);}['focus'](){this['element']['focus']();}}class T extends _0x4a36b3{['userView'];['markerView'];constructor(_0x27b1b3,_0xcecb0d,_0x12eb16){super(_0x27b1b3);const _0x38a948=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x27b1b3,_0xcecb0d),this['markerView']=new at(_0x27b1b3,_0xcecb0d);const _0x124d6f=new ot(_0x27b1b3);_0x124d6f['template']['tag']='span',_0x124d6f['text']=_0xcecb0d['name'];const _0x2cfbba={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x38a948['to']('isFocusable',_0x31906a=>!!_0x31906a&&0x0),'aria-labelledby':_0x124d6f['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x38a948['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x38a948['to']('hasTooltip',_0x25d187=>!_0x25d187),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x124d6f]};_0x12eb16&&(_0x2cfbba['tag']='button',_0x2cfbba['on']={'click':_0x38a948['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2cfbba);}}class at extends _0x4a36b3{constructor(_0x5cf8c3,_0x3823af){super(_0x5cf8c3),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3823af['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const D={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x5a8039{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x10e118){super(_0x10e118),this['context']['config']['define']('presenceList',D);const _0x328456=_0x10e118['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x328456)throw new _0x4bb820('presencelist-collapseat-invalid-format',this);if(_0x328456<0x1)throw new _0x4bb820('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3fd87a(),this['balloonPanelView']=new _0xd0549f(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4ea7f5 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4ea7f5);this['listenTo'](this['_allConnectedUsers'],'add',(_0x17b3f4,_0x3281db)=>{this['_handleUserAdd'](_0x3281db);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x289237,_0x2115f4)=>{this['_handleUserRemove'](_0x2115f4);});}['_createView'](){const _0x42cd9c=this['context'],_0x425af9=new _(this['context']['locale']),_0x40ffe5=this['balloonPanelView'];if(!_0x77664d(_0x42cd9c['config']['get']('presenceList.container')))throw new _0x4bb820('presencelist-missing-container',this);return _0x425af9['counterView']['bind']('usersCount')['to'](this),_0x425af9['bind']('isCollapsed')['to'](this,'usersCount',_0x14a05b=>{const {collapseAt:_0x12da3b,displayMe:_0x65b443}=_0x42cd9c['config']['get']('presenceList'),_0x46f9d5=_0x14a05b>=_0x12da3b;return _0x425af9['counterView']['isHidden']=!(0x1==_0x14a05b&&_0x65b443||_0x46f9d5),_0x46f9d5||this['hideDropdown'](),_0x46f9d5;}),_0x425af9['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x9a4c0e=>{const _0x2cad8e=_0x42cd9c['config']['get']('presenceList'),_0x103f40=new T(_0x42cd9c['locale'],_0x9a4c0e,!!_0x2cad8e['onClick']);return _0x103f40['bind']('hasTooltip')['to'](_0x425af9,'isCollapsed',_0x15f385=>!_0x15f385),_0x103f40['bind']('isFocusable')['to'](_0x425af9,'isCollapsed',_0x439acd=>!_0x439acd),_0x2cad8e['onClick']&&this['listenTo'](_0x103f40,'execute',()=>{this['view']['isCollapsed']||_0x2cad8e['onClick'](_0x9a4c0e,_0x103f40['element']);}),_0x103f40;}),this['listenTo'](_0x425af9['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x425af9['inlineListView']['keystrokes']['set']('Enter',(_0x371b61,_0x483ab0)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x483ab0());}),_0x425af9['render'](),_0x40ffe5['render'](),_0x17dab6({'emitter':_0x425af9,'activator':()=>_0x40ffe5['isVisible'],'contextElements':[_0x40ffe5['element'],_0x425af9['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x42cd9c['config']['get']('presenceList.container')['appendChild'](_0x425af9['element']),this['_bodyCollection']=new _0x24f1cb(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x425af9;}['_handleUserAdd'](_0x30bbfe){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x30bbfe['isMe'])return;const _0x2c6191=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x2c6191&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x1094aa=_0x30bbfe['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x30bbfe,_0x1094aa);}['_handleUserRemove'](_0x24ebcf){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x24ebcf['id'])&&(this['currentDisplayedUsers']['remove'](_0x24ebcf['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x3f4e0f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x3f4e0f['id']))return void this['currentDisplayedUsers']['add'](_0x3f4e0f,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x10742c=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new M(this['context']['locale'],!!_0x10742c['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x279614}=this['presenceDropdownView'];_0x279614['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3f08d7=>{if(!_0x10742c['displayMe']&&_0x3f08d7['isMe'])return null;const _0xee9584=new E(this['context']['locale'],_0x3f08d7,!!_0x10742c['onClick']);return _0x10742c['onClick']&&this['listenTo'](_0xee9584,'execute',()=>{_0x10742c['onClick'](_0x3f08d7,_0xee9584['element']);}),_0xee9584;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x279614['focus'](),_0x279614['checkIfScrollable']();const _0x4723a2=(_0x13045d,_0x3cf56f)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3cf56f();};_0x279614['keystrokes']['set']('Esc',_0x4723a2),_0x279614['keystrokes']['set']('Shift+Tab',_0x4723a2),_0x279614['keystrokes']['set']('Tab',(_0x17b77a,_0x3d1855)=>{!function(_0x2f177f){const _0x4731d9=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4841f3=>_0x4841f3+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x26866d=[...document['body']['querySelectorAll'](_0x4731d9)]['filter'](_0x38f9fb=>_0x38f9fb===document['activeElement']||_0x38f9fb['offsetWidth']+_0x38f9fb['offsetHeight']>0x0)['sort']((_0x4deb64,_0x3da990)=>(_0x4deb64['tabIndex']||0x0)-(_0x3da990['tabIndex']||0x0)),_0x99bef8=_0x26866d['indexOf'](_0x2f177f),_0x155336=_0x26866d[(_0x99bef8+0x1)%_0x26866d['length']];_0x155336&&_0x155336['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3d1855();}),_0x279614['focusTracker']['add'](this['view']['element']),_0x279614['focusTracker']['on']('change:isFocused',(_0x5cdacd,_0x12805a,_0x23751d)=>{_0x23751d||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x5a8039{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
23
+ import{ContextPlugin as _0x33c810,Plugin as _0x3f4d49,PendingActions as _0x10beba,Context as _0x26029e}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x4373d2,CKEditorError as _0x445b33,Collection as _0x22757d,global as _0x32c2cf,version as ht,uid as _0x4ed8fa,KeystrokeHandler as _0x7f95c8}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x372dc3,View as _0x1feba2,ListView as _0x330cb3,ListItemView as ct,LabelView as pt,BalloonPanelView as _0x2f79e0,clickOutsideHandler as _0x54d43d,BodyCollection as _0xa840b1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ut,History as _0x348473,NoOperation as _0x16d190,InsertOperation as _0x433f38,MarkerOperation as _0x5d3424,RootAttributeOperation as _0x424e5e,transformSets as _0x1ccee5,OperationFactory as _0x32a5e5}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ft,WEB_SOCKET_GATEWAY_STATES as _0x5f0dfb,CollaborativeEditingService as _0x511f2a,User as mt,CommentsService as _0x349097,TrackChangesService as at,RevisionHistoryService as rt,EditorService as ot}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x187697,UserView as lt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x490905}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x533984}from'lodash-es';class c extends _0x33c810{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x372dc3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12c2cf){super(_0x12c2cf),this['set']('state',_0x5f0dfb['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4373d2);}['init'](){const _0x34a7df=this['context'],_0x34e49a=_0x34a7df['plugins']['get']('CloudServices'),_0x4cfe6b=_0x34a7df['plugins']['get'](_0x372dc3);if(!_0x34e49a['token'])throw new _0x445b33('websocketgateway-missing-token',this);if(!_0x34e49a['webSocketUrl'])throw new _0x445b33('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x34e49a['token'],_0x34e49a['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x1dd0ab=>{if(this['connection']=_0x1dd0ab,this['bind']('state')['to'](_0x1dd0ab,'state',this,'_isBrowserOffline',(_0x3ccb0e,_0x5aef3f)=>('connected'!==_0x3ccb0e&&(this['_shouldPluginsReconnect']=!0x0),_0x5aef3f||_0x3ccb0e!==_0x5f0dfb['CONNECTED']?_0x5f0dfb['DISCONNECTED']:this['state']==_0x5f0dfb['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x5f0dfb['CONNECTING']):_0x5f0dfb['CONNECTED'])),this['connection']['on']('error',(_0x5ef104,_0x316c19)=>{if('limitExceeded'!==_0x316c19['code'])throw console['error'](_0x316c19),new _0x445b33('cloudservices-init',null,{'originalError':_0x316c19});_0x4cfe6b['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'});}),!_0x1dd0ab['me'])return new Promise(_0x2b30d1=>_0x1dd0ab['on']('change:me',_0x2b30d1));})['catch'](_0x213764=>{throw console['error'](_0x213764),new _0x445b33('cloudservices-init',null,{'originalError':_0x213764});});}['addToReconnectionStack'](_0x1fdb00){if('function'!=typeof _0x1fdb00['reconnect'])throw new _0x445b33('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1fdb00))throw new _0x445b33('websocketgateway-plugin-already-registered',this,{'name':_0x1fdb00['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1fdb00);}['removeFromReconnectionStack'](_0x24e957){this['_reconnectionStack']['delete'](_0x24e957);}['isInReconnectionStack'](_0x196ea4){return this['_reconnectionStack']['has'](_0x196ea4);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x3e68a0=>_0x3e68a0['reconnect']())))['then'](()=>this['state']=_0x5f0dfb['CONNECTED'])['catch'](_0x4b2067=>{throw console['error'](_0x4b2067),new _0x445b33('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x5f0dfb['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x33c810{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x187697];}constructor(_0x408757){super(_0x408757),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x22757d(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x187697);}['init'](){const _0x481a4e=this['context']['plugins']['get'](c);this['listenTo'](_0x481a4e,'change:state',(_0x226191,_0x2073c0,_0x3a719e)=>{if('connected'!==_0x3a719e)this['channelSessions']['forEach'](_0x53ce8f=>_0x53ce8f['clear']()),this['channelConnectedUsers']['forEach'](_0x528480=>_0x528480['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x10d4ab,_0x213ccc]of this['_registeredSessions'])for(const _0x4a9a3a of _0x213ccc)this['_handleSessionAdd'](_0x10d4ab,_0x4a9a3a);}}),this['_createUser'](_0x481a4e['connection']['me'],!0x0);}['register'](_0x16deeb,_0x5a041b){if(this['_registeredSessions']['has'](_0x16deeb))throw new _0x445b33('sessions-register-already-registered',null,{'channelId':_0x16deeb});this['_registeredSessions']['set'](_0x16deeb,_0x5a041b),this['channelSessions']['set'](_0x16deeb,new _0x22757d()),this['channelConnectedUsers']['set'](_0x16deeb,new _0x22757d()),this['listenTo'](_0x5a041b,'add',(_0x18c37f,_0xa73ee8)=>this['_handleSessionAdd'](_0x16deeb,_0xa73ee8)),this['listenTo'](_0x5a041b,'remove',(_0x5c8423,_0x5f3c1d)=>this['_handleSessionRemove'](_0x16deeb,_0x5f3c1d));for(const _0xadeae3 of _0x5a041b)this['_handleSessionAdd'](_0x16deeb,_0xadeae3);}['unregister'](_0x58e457){if(!this['_registeredSessions']['has'](_0x58e457))throw new _0x445b33('sessions-unregister-not-exist',null,{'channelId':_0x58e457});const _0x414bd4=this['_registeredSessions']['get'](_0x58e457);this['stopListening'](_0x414bd4);for(const _0x463725 of _0x414bd4)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x58e457,_0x463725);this['_registeredSessions']['delete'](_0x58e457),this['channelSessions']['delete'](_0x58e457),this['channelConnectedUsers']['delete'](_0x58e457);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4ad3c1){for(const _0x153dd0 of this['channelSessions']['values']())for(const _0x540fde of _0x153dd0)if(_0x540fde['id']===_0x4ad3c1)return _0x540fde['user'];}['getUserSessions'](_0x1818ba,_0x21cd43){const _0x178165=_0x21cd43?[this['channelSessions']['get'](_0x21cd43)]:this['channelSessions']['values'](),_0x566012=new Set();for(const _0x25e737 of _0x178165)for(const _0x2b45e9 of _0x25e737)_0x2b45e9['user']['id']===_0x1818ba['id']&&_0x566012['add'](_0x2b45e9['id']);return _0x566012;}['getUserRole'](_0x278e56){for(const _0x53e35d of this['channelSessions']['values']())for(const _0x2c843b of _0x53e35d)if(_0x2c843b['user']===_0x278e56)return _0x2c843b['role'];}['_handleSessionAdd'](_0x206306,_0x1f6837){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x173369=_0x1f6837['user'],_0xb5904=this['_users']['getUser'](_0x173369['id'])||this['_createUser'](_0x173369),_0x2b78c4=Object['assign']({},_0x1f6837,{'user':_0xb5904});this['channelSessions']['get'](_0x206306)['add'](_0x2b78c4);const _0x1b8f25=this['channelConnectedUsers']['get'](_0x206306);_0x1b8f25['has'](_0xb5904['id'])||_0x1b8f25['add'](_0xb5904),this['allConnectedUsers']['has'](_0xb5904['id'])||this['allConnectedUsers']['add'](_0xb5904,_0xb5904['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x206306,{'channelId':_0x206306,'session':_0x2b78c4});}['_handleSessionRemove'](_0x365981,_0x395655){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x347486=this['channelConnectedUsers']['get'](_0x365981),_0x4702d6=_0x395655['user'];_0x4702d6['id']&&(this['channelSessions']['get'](_0x365981)['remove'](_0x395655['id']),_0x347486['has'](_0x4702d6['id'])&&!this['getUserSessions'](_0x4702d6,_0x365981)['size']&&_0x347486['remove'](_0x4702d6['id']),this['allConnectedUsers']['get'](_0x4702d6['id'])&&!this['getUserSessions'](_0x4702d6)['size']&&this['allConnectedUsers']['remove'](_0x4702d6['id']));}['_createUser'](_0x23c252,_0x321459){const _0x2102f0=this['_users']['addUser'](_0x23c252);return _0x321459&&this['_users']['defineMe'](_0x23c252['id']),_0x2102f0['orderNumber']=this['_uniqueUsersCount']++,_0x2102f0;}}class N extends _0x3f4d49{['_domEmitter']=new(_0x4373d2())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xf31d87=this['editor'],_0x28527e=_0xf31d87['plugins']['get'](i);_0xf31d87['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5ae8ca,{writer:_0x1d4051})=>function(_0x4d5000,_0x421f7a,_0x16c4a3,_0xcbd678){const _0x5424b4=_0x4d5000['markerName']['split'](':')[0x2],_0x326328=_0x16c4a3['getUserBySessionId'](_0x5424b4);if(!_0x326328||_0x5424b4===_0x16c4a3['mySessionId'])return;if(!_0xcbd678['model']['schema']['checkChild'](_0x4d5000['markerRange']['start'],'$text'))return;const _0x513613={'class':'ck-user__marker\x20'+_0x326328['color']['getMarkerClass'](),'data-name':_0x326328['name'],'data-session-id':_0x5424b4},_0x49c222=_0xcbd678['model']['markers']['get'](_0x4d5000['markerName']),_0x186c4a=_0x49c222['getStart'](),_0x26e192=_0x186c4a['nodeAfter'],_0x1a1e39=_0xcbd678['model']['schema'];if(_0x26e192&&_0x1a1e39['isObject'](_0x26e192)&&_0x1a1e39['isInline'](_0x26e192)&&!_0xcbd678['model']['markers']['get']('user:range:'+_0x5424b4)['getRange']()['isCollapsed'])return;const _0x4cb638=_0x186c4a['parent'];return _0xcbd678['model']['schema']['isLimit'](_0x4cb638)&&!_0xcbd678['model']['hasContent'](_0x4cb638)&&(_0x513613['contenteditable']=!0x1),function(_0x31cda3,_0x3cbb21,_0x359cc0){const _0x53b031=_0x31cda3['createUIElement']('span',_0x3cbb21);return _0x31cda3['setCustomProperty']('userPositionMarker',!0x0,_0x53b031),_0x53b031['render']=function(_0x599921){const _0x1f731d=this['toDomElement'](_0x599921);return _0x1f731d['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x359cc0['name']+'</span>⁠',_0x1f731d['addEventListener']('mouseenter',()=>{_0x1f731d['classList']['add']('ck-user__marker_hovered');}),_0x1f731d['addEventListener']('mouseleave',()=>{_0x1f731d['classList']['remove']('ck-user__marker_hovered');}),_0x1f731d;},_0x53b031['isSimilar']=function(_0x153f39){return!(!this['getCustomProperty']('userPositionMarker')||!_0x153f39['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x153f39['getAttribute']('data-session-id'));},_0x53b031;}(_0x421f7a,_0x513613,_0x326328);}(_0x5ae8ca,_0x1d4051,_0x28527e,_0xf31d87)}),_0xf31d87['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4a5e39=>function(_0xceab08,_0x436a95){const _0x3307bc=_0xceab08['markerName']['split'](':')[0x2];if(_0x3307bc===_0x436a95['mySessionId'])return null;const _0x9cfe2c=_0x436a95['getUserBySessionId'](_0x3307bc);if(!_0x9cfe2c)return{'id':_0x3307bc,'classes':[]};return{'id':_0x3307bc,'classes':['ck-user__selection',_0x9cfe2c['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3307bc},'priority':0x7d0+_0x9cfe2c['orderNumber']};}(_0x4a5e39,_0x28527e)}),function(_0x3b402f){const _0x4e0379=_0x3b402f['model'],_0x4a28e3=new Map(),_0x469280=_0x3b402f['plugins']['get'](i);_0x4e0379['markers']['on']('update:user:range',(_0x5d20b6,_0x39797b,_0x110d12,_0x4bd7e1)=>{if(!_0x4bd7e1&&_0x4a28e3['get'](_0x39797b['name']))return _0x4a28e3['get'](_0x39797b['name'])['detach'](),void _0x4a28e3['delete'](_0x39797b['name']);const _0x36e3cf=_0x39797b['name']['split'](':')[0x2];if(_0x36e3cf===_0x469280['mySessionId'])return;const _0x480af='user:position:'+_0x36e3cf;_0x4e0379['markers']['has'](_0x480af)&&_0x3b402f['editing']['reconvertMarker'](_0x480af),_0x39797b['on']('change:range',(_0x4ab2da,_0x211516,_0x145649)=>{if('$graveyard'!=_0x211516['root']['rootName']&&'$graveyard'==_0x39797b['getRange']()['root']['rootName']&&!_0x4a28e3['has'](_0x39797b['name'])){const _0x5bab85=_0x4e0379['schema']['getNearestSelectionRange'](_0x145649['deletionPosition']);if(_0x5bab85){const _0x40c371=ut['fromRange'](_0x5bab85);_0x4a28e3['set'](_0x39797b['name'],_0x40c371),_0x40c371['on']('change:range',(_0x2cb002,_0xdc5314,_0x5da2a9)=>{if('$graveyard'==_0x40c371['root']['rootName']){const _0x35cccd=_0x4e0379['schema']['getNearestSelectionRange'](_0x5da2a9['deletionPosition']);_0x35cccd?(_0x40c371['start']=_0x35cccd['start'],_0x40c371['end']=_0x35cccd['end']):(_0x4a28e3['delete'](_0x39797b['name']),_0x40c371['detach']());}});}}});}),_0x4e0379['document']['on']('change',()=>{_0x4a28e3['size']>0x0&&_0x4e0379['enqueueChange']({'isUndoable':!0x1},_0x15443a=>{for(const [_0x3b8a15,_0x36f4b0]of _0x4a28e3)'$graveyard'==_0x4e0379['markers']['get'](_0x3b8a15)['getRange']()['root']['rootName']&&(G(_0x3b8a15['split'](':')[0x2],_0x36f4b0['toRange'](),_0x4e0379,_0x15443a),_0x36f4b0['detach']());_0x4a28e3['clear']();});});}(_0xf31d87),this['_domEmitter']['listenTo'](_0x32c2cf['document'],'keydown',(_0x338f61,{key:_0x4c2b8b})=>{'Escape'===_0x4c2b8b&&function(_0x18c05f){_0x18c05f['editing']['view']['change'](_0x213736=>{for(const _0x3befe2 of _0x18c05f['model']['markers']){if(!_0x3befe2['name']['startsWith']('user:position'))continue;const _0x48b253=_0x18c05f['editing']['mapper']['markerNameToElements'](_0x3befe2['name']);if(_0x48b253){for(const _0x2e4421 of _0x48b253)_0x213736['removeClass']('ck-user__marker_hovered',_0x2e4421);}}});}(_0xf31d87);},{'useCapture':!0x0});}['afterInit'](){const _0x42c8d7=this['editor'],_0x501f9a=_0x42c8d7['commands']['get']('undo');_0x501f9a&&_0x42c8d7['model']['on']('applyOperation',(_0x5f275d,_0x3b233c)=>{const _0x2caa89=_0x3b233c[0x0];if('marker'!=_0x2caa89['type']||!_0x2caa89['name']['startsWith']('user:'))return;const _0x25b14b=_0x2caa89['batch'];_0x501f9a['_createdBatches']['has'](_0x25b14b)&&(_0x2caa89['newRange']=_0x2caa89['oldRange']?_0x42c8d7['model']['createRange'](_0x2caa89['oldRange']['start'],_0x2caa89['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x2c779a=this['editor'],_0x30056d=_0x2c779a['model']['document'],_0x2f29d6=_0x2c779a['plugins']['get'](i);_0x2c779a['model']['enqueueChange']({'isUndoable':!0x1},_0x35b7b3=>{const _0x46bc32='user:range:'+_0x2f29d6['mySessionId'],_0x423568='user:position:'+_0x2f29d6['mySessionId'],_0xb54ae7=_0x2c779a['model']['markers']['has'](_0x46bc32);_0x2c779a['editing']['view']['hasDomSelection']?G(_0x2f29d6['mySessionId'],_0x30056d['selection']['getFirstRange'](),_0x2c779a['model'],_0x35b7b3):_0xb54ae7&&(_0x35b7b3['removeMarker'](_0x46bc32),_0x35b7b3['removeMarker'](_0x423568));});}}function G(_0x214825,_0x3ddce4,_0x423dac,_0x24761a){const _0x3ec48a='user:range:'+_0x214825,_0x3b5372='user:position:'+_0x214825,_0x770762=_0x3ddce4['getContainedElement']();let _0x55ba8f=_0x3ddce4['start'];_0x770762&&_0x770762['is']('element','tableCell')&&(_0x55ba8f=function(_0x5dd6f6,_0x42b43c){for(const _0x4a9f5f of _0x5dd6f6['getPositions']())if(_0x42b43c['schema']['checkChild'](_0x4a9f5f,'$text'))return _0x4a9f5f;}(_0x3ddce4,_0x423dac),_0x3ddce4=_0x24761a['createRange'](_0x55ba8f));const _0x5d33d9=_0x24761a['createRange'](_0x55ba8f);_0x423dac['markers']['has'](_0x3ec48a)?(_0x24761a['updateMarker'](_0x3ec48a,{'range':_0x3ddce4}),_0x24761a['updateMarker'](_0x3b5372,{'range':_0x5d33d9})):(_0x24761a['addMarker'](_0x3ec48a,{'range':_0x3ddce4,'usingOperation':!0x0}),_0x24761a['addMarker'](_0x3b5372,{'range':_0x5d33d9,'usingOperation':!0x0}));}function E(_0x5988a2,_0xa1a781,_0x2ad916){const _0x234adc=_0x5988a2['t'],t=_0x5988a2['t'];switch(_0xa1a781){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 _0x234adc({'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'},_0x2ad916);default:return'';}}let M=0x1;class l extends _0x3f4d49{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x511f2a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,N,_0x10beba,_0x187697,_0x372dc3];}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 _0x3801b5=this['serverHistory']['getOperations']();for(let _0x3671cc=_0x3801b5['length']-0x1;_0x3671cc>=0x0;_0x3671cc--){const _0x4afc12=_0x3801b5[_0x3671cc];if(!this['_disconnectionOperations']['has'](_0x4afc12))return _0x4afc12['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x24ed03){if(super(_0x24ed03),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x348473(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x445b33('collaboration-missing-channelid',this);const _0x4e0b95=_0x24ed03['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x4e0b95,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x490905(),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 W(this['_disconnectionOperations']);}['init'](){const _0x575168=this['editor'],_0x5840dd=_0x575168['plugins']['get'](_0x187697),_0x56deb5=_0x575168['plugins']['get'](c);this['listenTo'](_0x5840dd,'getOperationAuthor',(_0x59e9f7,_0x287bb8)=>{const _0x9d012f=_0x287bb8[0x0];_0x9d012f['_authorId']&&(_0x59e9f7['return']=_0x5840dd['getUser'](_0x9d012f['_authorId']),_0x59e9f7['stop']()),null===_0x9d012f['_authorId']&&(_0x59e9f7['return']=null,_0x59e9f7['stop']());},{'priority':'high'}),this['listenTo'](_0x575168['model']['document']['selection'],'change:range',(_0x1d2d14,_0x35f8e3)=>{_0x35f8e3['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x575168['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x575168['model']['on']('applyOperation',(_0x49a3c7,_0x226014)=>{const _0x513b89=_0x226014[0x0];_0x513b89['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x513b89),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x56deb5,'state',this,'_hasSynchronizationProblem',(_0x1b2b7a,_0x125a48)=>'connected'===_0x1b2b7a&&!_0x125a48),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x575168['disableReadOnlyMode']('rtc-offline'):_0x575168['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x575168['disableReadOnlyMode']('rtc-offline'):_0x575168['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x30fedb=this['editor']['plugins']['get'](i),_0x7d7219=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x30fedb['unregister'](this['_channelId']);const _0x340d0b=await this['_service']['reconnect'](_0x7d7219['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x340d0b)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x232ac8=await this['_service']['getConnectedSessions']();_0x30fedb['register'](this['_channelId'],_0x232ac8),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xb2a810){if(function(_0x5ab23c){return'404'===_0x5ab23c['code'];}(_0xb2a810)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0xa76a1){return'409'===_0xa76a1['code'];}(_0xb2a810)){const _0x1cd00b=E(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'](_0x1cd00b);}else{if(!(_0xb2a810 instanceof z))throw _0xb2a810;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2ac4be=this['editor']['plugins']['get'](c),_0x12fbc3=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x12fbc3['channelSessions']['has'](this['_channelId'])&&_0x12fbc3['unregister'](this['_channelId']),_0x2ac4be['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x31177a){if(this['sessionId']!==_0x31177a['sessionId']&&this['_lastSyncedOperationId']!==_0x31177a['lastOperationId'])throw new z();return this['sessionId']=_0x31177a['sessionId'],this['_handleServerResponse']([],{..._0x31177a,'wereChangesApplied':!0x1,'data':_0x31177a['data']},'reconnect');}async['_connectService'](_0xea8eb2,_0x17d670=!0x1){const {connection:_0x5e3713}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x5e3713,this['_channelId'])['then'](_0x5b7433=>this['_initSessionsHandling'](_0x5b7433))['catch'](_0x36ea7f=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x36ea7f);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3e3c8b,_0x429e33)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x429e33);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x10f86d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xea8eb2);this['_isPendingUpdate']=!0x0;const _0x31225c=await this['_service']['connect'](_0x5e3713,this['_compressOperations'](_0xea8eb2),_0x10f86d);if(this['sessionId']=_0x31225c['sessionId'],_0x17d670){if(!_0x31225c['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x31225c['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0xea8eb2,_0x31225c,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x31225c,_0xea8eb2);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x5830b8=this['editor']['plugins']['get'](i),_0x1680c5=this['editor']['plugins']['get'](N),_0x2ffc40=_0x5830b8['channelSessions']['get'](this['_channelId']);_0x2ffc40&&_0x2ffc40['length']>0x1?_0x1680c5['createUserMarkerOperations']():this['listenTo'](_0x5830b8,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x5830b8['channelSessions']['get'](this['_channelId'])['length']&&_0x1680c5['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x352996,_0x5c9b0c,_0x5f5703,_0x5ca21b){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x5c9b0c){const _0x1143e4=this['_decompressOperations'](_0x5f5703,_0x5ca21b);await this['_fetchMissingUsers'](_0x1143e4),this['_handleExternalOperations'](_0x1143e4,_0x5c9b0c,_0x5f5703['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1f2268}=this['editor'];let _0x465bbb;try{_0x465bbb=await this['_service']['getDocumentDetails']();}catch(_0x10c6c3){const _0x45cba6=E(_0x1f2268,'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'](_0x45cba6);}const _0x360755=_0x465bbb['currentDocumentSession']||_0x465bbb['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x360755['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0xfe9ceb=E(_0x1f2268,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0xfe9ceb);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x52f0a3){const _0xbd9cc9=this['editor']['plugins']['get'](i);this['listenTo'](_0xbd9cc9,'sessionAdd:'+this['_channelId'],(_0x4ae399,{session:_0x5db579})=>{if(_0x5db579['id']===_0xbd9cc9['mySessionId']){_0x4ae399['off']();const _0x2b5f48=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3355d3=_0x5db579['permissions'];_0x2b5f48&&_0x2b5f48['isEnabled']&&(_0x3355d3=_0x3355d3['filter'](_0x40809d=>'document:write'!==_0x40809d)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3355d3,this['_channelId']);}}),_0xbd9cc9['register'](this['_channelId'],_0x52f0a3);}['_initThrowingOnDataSet'](){const _0x34b83a=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5d5ce8)=>{if(!_0x5d5ce8[_0x5d5ce8['length']-0x1]['suppressErrorInCollaboration'])throw new _0x445b33('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x34b83a['apply'](this['editor']['data'],_0x5d5ce8);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x361821,[_0x4f9cef])=>{if(this['_document']['version'])throw new _0x445b33('realtimecollaborationclient-init-document-already-initialized',this);_0x361821['stop'](),this['_setPendingAction']();const _0xcb105f=this['editor']['config']['get']('rootsAttributes'),_0x30b3ae=this['_getOperationsFromInitData'](_0x4f9cef,_0xcb105f);0x0==_0x30b3ae['length']&&_0x30b3ae['push'](new _0x16d190(0x0)),_0x361821['return']=this['_connectService'](_0x30b3ae)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x129738=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x129738))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1dd08c,[_0x18371e,_0x8c02ba])=>{_0x1dd08c['stop']();const _0x2a1df8=this['editor']['model']['document']['getRoot'](_0x18371e);if(!this['_knownRootNames']['has'](_0x18371e)){const _0x2de833=_0x8c02ba&&_0x8c02ba['data']?_0x8c02ba['data']:'',_0x3fcfdf=_0x8c02ba&&_0x8c02ba['attributes']?_0x8c02ba['attributes']:{};await this['_loadRoot'](_0x18371e,_0x2de833,_0x3fcfdf);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x2a1df8['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x2a1df8);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1cb7f0){const _0x5af19c=this['editor']['plugins']['get'](_0x187697),{connection:_0x556220}=this['editor']['plugins']['get'](c),_0x2a759e=new Set();for(const _0x7482f of _0x1cb7f0){const _0x52bb5f=_0x7482f['_authorId'];_0x52bb5f&&!_0x5af19c['getUser'](_0x52bb5f)&&_0x2a759e['add'](_0x52bb5f);}if(0x0===_0x2a759e['size'])return;const _0x4de754=await mt['getMany'](_0x556220,Array['from'](_0x2a759e));for(const _0x3e2673 of _0x4de754)_0x5af19c['getUser'](_0x3e2673['id'])||_0x5af19c['addUser'](_0x3e2673);}['_getOperationsFromInitData'](_0x3eae95,_0x45de56={}){const _0x1931da=this['editor']['model'],_0x46ea85=[];let _0x24d970=0x0;const _0xe2edf0='string'==typeof _0x3eae95?{'main':_0x3eae95}:_0x3eae95;for(const _0x5d8732 of Object['keys'](_0xe2edf0)){if(!this['_document']['roots']['has'](_0x5d8732))throw new _0x445b33('realtimecollaborationclient-init-non-existent-root',this);const _0x6b6a69=this['editor']['data']['parse'](_0xe2edf0[_0x5d8732]),_0x3895f1=this['_document']['getRoot'](_0x5d8732),_0x6aead6=new _0x433f38(_0x1931da['createPositionAt'](_0x3895f1,0x0),_0x6b6a69,_0x24d970++);_0x46ea85['push'](_0x6aead6);for(const [_0xe638d,_0xed8764]of _0x6b6a69['markers']){const _0x11767a=_0x1931da['createRange'](_0x1931da['createPositionFromPath'](_0x3895f1,_0xed8764['start']['path']['slice']()),_0x1931da['createPositionFromPath'](_0x3895f1,_0xed8764['end']['path']['slice']())),_0x34dc26=new _0x5d3424(_0xe638d,null,_0x11767a,_0x1931da['markers'],!0x0,_0x24d970++);_0x46ea85['push'](_0x34dc26);}}if(_0x45de56)for(const [_0x1fc801,_0x477afe]of Object['entries'](_0x45de56)){const _0x39bd3e=_0x1931da['document']['getRoot'](_0x1fc801);if(!_0x39bd3e)throw new _0x445b33('multi-root-editor-root-attributes-no-root',null);for(const [_0x578642,_0x48aace]of Object['entries'](_0x477afe))if(null!==_0x48aace){const _0x5f5a33=new _0x424e5e(_0x39bd3e,_0x578642,null,_0x48aace,_0x24d970++);_0x46ea85['push'](_0x5f5a33);}}return _0x46ea85;}async['_loadRoot'](_0xf04728,_0x493c5f,_0x236a7f){this['_getOperationsFromInitData']({[_0xf04728]:_0x493c5f},{[_0xf04728]:_0x236a7f})['forEach']((_0x2893bb,_0x128a9a)=>{_0x2893bb['baseVersion']=this['_document']['version']+_0x128a9a,_0x2893bb['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2893bb);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1133a7,_0x5ae867){let _0x22c907;this['_offset']=_0x1133a7['offset'];const _0x2fe4e8=_0x1133a7['wereChangesApplied']&&!_0x1133a7['initData'],_0x14c42f=_0x2fe4e8?0x0:_0x1133a7['data']['baseVersion'];if(_0x5ae867['forEach'](_0x231e40=>{_0x231e40['_isInit']=!0x0,_0x231e40['createdAt']=_0x1133a7['sessionCreatedAt'],_0x231e40['_authorId']=null;}),_0x2fe4e8)_0x22c907=_0x5ae867,this['_applyOperationsSet'](_0x22c907,_0x2fe4e8);else{if(_0x1133a7['initData']){const _0x94d29e=this['_getOperationsFromInitData'](_0x1133a7['initData']);this['_document']['history']['version']=-_0x94d29e['length'],_0x94d29e['forEach'](_0x47fdc1=>{_0x47fdc1['baseVersion']-=_0x94d29e['length'],_0x47fdc1['createdAt']=_0x1133a7['sessionCreatedAt'],_0x47fdc1['_isInit']=!0x0,_0x47fdc1['_authorId']=null;}),this['_applyOperationsSet'](_0x94d29e,!0x0),this['serverHistory']['version']=-_0x94d29e['length']+this['_offset'],this['_updateServerHistory'](_0x94d29e);}this['_document']['history']['version']=_0x14c42f,_0x22c907=this['_decompressOperations'](_0x1133a7['data'],_0x1133a7['metadata']),await this['_fetchMissingUsers'](_0x22c907),this['_applyOperationsSet'](_0x22c907,_0x2fe4e8);}_0x1133a7['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x22c907,_0x1133a7['lastOperationId']),this['_lastSyncedOperationId']=_0x1133a7['lastOperationId']),this['serverHistory']['version']=_0x14c42f+this['_offset'],this['_updateServerHistory'](_0x22c907),_0x5ae867['filter'](_0x36321f=>{const _0x5d407d=this['_getAffectedRoot'](_0x36321f);return _0x5d407d&&!this['_knownRootNames']['has'](_0x5d407d);})['forEach']((_0x4f1b45,_0x389521)=>{_0x4f1b45['baseVersion']=this['_document']['version']+_0x389521,this['_saveOperationInBuffer'](_0x4f1b45);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2ebaaf,_0x166be6,_0x57ec23){throw this['_isPendingUpdate']=!0x0,_0x166be6&&console['error'](_0x166be6),_0x57ec23&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x445b33(_0x2ebaaf,this['editor']);}['_saveOperationInBuffer'](_0x27028b){this['_knownOperations']['has'](_0x27028b)||(this['_knownOperations']['add'](_0x27028b),this['_bufferedOperations']['push'](_0x27028b),this['_pendingAction']||'marker'==_0x27028b['type']&&!_0x27028b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xbf0498=!0x1){!_0xbf0498&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x216e0c=>{_0x216e0c&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x19499c=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2b19fa){return _0x2b19fa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2b19fa['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2b19fa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x19499c)||this['_crash'](_0x19499c['message'],_0x19499c,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x4a988a=>{this['on']('change:_isPendingUpdate',()=>{_0x4a988a();});});}async['_sendBufferedOperations'](){const _0x274644=this['editor']['plugins']['get'](N);if(this['_shouldSendSelectionUpdate']()&&(_0x274644['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x47a9f2=[...this['_bufferedOperations']];for(const _0x360c70 of _0x47a9f2)_0x360c70['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x360c70);const _0x363274=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x47a9f2),_0x2f04ea=M++,_0x3a57b6=this['_compressOperations'](_0x47a9f2),_0x5acffc=await this['_service']['sendOperations'](_0x3a57b6,_0x3a57b6['baseVersion'],_0x363274);try{return await this['_handleServerResponse'](_0x47a9f2,_0x5acffc,_0x2f04ea);}catch(_0x1ef9d){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1ef9d);}}async['_handleServerResponse'](_0x511a35,_0x197bac,_0xa3458f){if('error'in _0x197bac)throw _0x197bac['error'];let _0x2c9d9c=!0x1;if(_0x197bac['wereChangesApplied']){_0x197bac['lastOperationId']&&(this['_lastSyncedOperationId']=_0x197bac['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x57db12=>!_0x511a35['includes'](_0x57db12));for(const _0x29a726 of _0x511a35)_0x29a726['createdAt']='lastOperationAcceptedAt'in _0x197bac&&_0x197bac['lastOperationAcceptedAt']||void 0x0;V(_0x511a35,_0x197bac['version']-_0x511a35['length']),this['_updateServerHistory'](_0x511a35);const _0x2ce9e1=_0x511a35['filter'](_0x357d49=>{if(!_0x357d49['_isInit'])return!0x1;const _0x36dbfb=this['_getAffectedRoot'](_0x357d49);return _0x36dbfb&&!this['_knownRootNames']['has'](_0x36dbfb);});V(_0x2ce9e1,this['_document']['version']),this['_applyOperationsSet'](_0x2ce9e1),_0x2c9d9c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x46701a=this['_decompressOperations'](_0x197bac['data'],_0x197bac['metadata'])['filter'](_0x6ea5a3=>_0x6ea5a3['baseVersion']>=this['_lastServerVersion']);_0x46701a['forEach'](_0x2f5029=>this['_addKnownRoot'](_0x2f5029)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4c3317=>!_0x4c3317['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4c3317))),this['_bufferedOperations']['length']&&V(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x46701a),_0x2c9d9c=this['_handleExternalOperations'](_0x46701a,_0x197bac['version'],_0x197bac['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x2c9d9c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5d84f5,_0x548666,_0x18131a){try{const _0x10fe06={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x52b8c9,operationsB:_0x3a7c0b,originalOperations:_0x436cdb}=_0x1ccee5(_0x5d84f5,this['_bufferedOperations'],_0x10fe06);V(_0x52b8c9,this['_document']['version']),V(_0x3a7c0b,_0x548666);for(const _0x3bf6cc of _0x52b8c9){const _0x380d82=_0x436cdb['get'](_0x3bf6cc);_0x3bf6cc['_authorId']=_0x380d82?_0x380d82['_authorId']:null;}_0x18131a&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5d84f5,_0x18131a),this['_lastSyncedOperationId']=_0x18131a),this['_bufferedOperations']=[..._0x3a7c0b],this['_applyOperationsSet'](_0x52b8c9),this['_updateServerHistory'](_0x5d84f5);}catch(_0xb4cb62){return console['error'](_0xb4cb62),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3240fd,_0x2768b6=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5cb931=>{for(const _0x23ade6 of _0x3240fd)this['_knownOperations']['add'](_0x23ade6),this['_addKnownRoot'](_0x23ade6),_0x5cb931['batch']['addOperation'](_0x23ade6),this['editor']['model']['applyOperation'](_0x23ade6);});}['_addKnownRoot'](_0x43ae68){const _0x11dabc=this['_getAffectedRoot'](_0x43ae68);_0x11dabc&&this['_knownRootNames']['add'](_0x11dabc);}['_getAffectedRoot'](_0x109c45){let _0x4842bb,_0x30c775;switch(_0x109c45['type']){case'insert':_0x4842bb=_0x109c45['position']['root'];break;case'marker':if(_0x30c775=_0x109c45['newRange'],!_0x30c775)return null;_0x4842bb=_0x30c775['root'];break;case'addRootAttribute':_0x4842bb=_0x109c45['root'];break;case'addRoot':_0x4842bb=_0x109c45['affectedSelectable'];break;case'move':_0x4842bb=_0x109c45['targetPosition']['root'];break;default:return null;}return _0x4842bb['rootName'];}['_updateServerHistory'](_0x2208ca){_0x2208ca['forEach'](_0x2f6273=>{const _0x43810e=_0x2f6273['clone']();_0x43810e['_authorId']=_0x2f6273['_authorId'],_0x43810e['_isInit']=!!_0x2f6273['_isInit'],_0x43810e['createdAt']=_0x2f6273['createdAt'],_0x43810e['baseVersion']+=this['_offset'],_0x2f6273['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x43810e),this['serverHistory']['addOperation'](_0x43810e);});}['_handleReconnectionError'](_0x5be42a){const _0x7e1e6e=this['editor']['plugins']['get']('Notification'),_0x3fcd5b=this['editor']['locale'];_0x5be42a||(_0x5be42a=E(_0x3fcd5b,'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.')),_0x7e1e6e['showWarning'](_0x5be42a,{'title':E(_0x3fcd5b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x10beba)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x10beba)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2cea3d){const _0x430a3d=_0x2cea3d['map'](_0x3ea08f=>_0x3ea08f['toJSON']());return this['_compressor']['compress'](_0x430a3d);}['_decompressOperations'](_0x33f42d,_0x5bd9cf){return this['_compressor']['decompress'](_0x33f42d)['map']((_0x26ddc8,_0x5550bd)=>{const _0x2cc6db='init'==_0x5bd9cf[_0x5550bd]['type'];if('InsertOperation'==_0x26ddc8['__className']){const _0x308a86=_0x26ddc8['position']['root'];!this['_document']['getRoot'](_0x308a86)&&(this['_document']['createRoot']('$root',_0x308a86)['_isAttached']=!0x1);}const _0xf5da04=_0x32a5e5['fromJSON'](_0x26ddc8,this['_document']);return _0xf5da04['wasUndone']=_0x26ddc8['wasUndone'],_0xf5da04['_isInit']=_0x2cc6db,_0xf5da04['_authorId']=_0x2cc6db?null:_0x5bd9cf[_0x5550bd]['userId'],_0xf5da04['_isDisconnection']='cs:removeUser'===_0x5bd9cf[_0x5550bd]['type'],_0xf5da04['createdAt']=_0x5bd9cf[_0x5550bd]['createdAt'],_0xf5da04;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4d49c6=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4d49c6&&_0x4d49c6['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class z extends Error{}function V(_0x5e2a61,_0x16eb98){for(const _0x4be506 of _0x5e2a61)_0x4be506['baseVersion']=_0x16eb98++;}class W{['_ignoredOperations'];['_operationToId'];constructor(_0x1031a1){this['_ignoredOperations']=_0x1031a1,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4aeadb){let _0x3312b4=_0x4aeadb['length'];for(;_0x3312b4--;){const _0x34e420=_0x4aeadb[_0x3312b4];if(!this['_ignoredOperations']['has'](_0x34e420)){if(!this['_operationToId']['has'](_0x34e420)){const _0x402982=_0x4ed8fa()['slice'](0x1,0x12);this['_operationToId']['set'](_0x34e420,_0x402982);}return this['_operationToId']['get'](_0x34e420);}}}['setIdForTheLastOperation'](_0x41829b,_0x578945){if(!_0x578945)return;let _0x260ed7=_0x41829b['length'];for(;_0x260ed7--;){const _0x574e0b=_0x41829b[_0x260ed7];this['_ignoredOperations']['has'](_0x574e0b)||this['_operationToId']['set'](_0x574e0b,_0x578945);}}}class n extends _0x3f4d49{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x33c810{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x349097)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x187697];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29bca3){super(_0x29bca3),this['_services']=new Map();}async['init'](){const _0x3468c5=this['context'],_0x2aea4a=_0x3468c5['plugins']['get']('CommentsRepository');if(_0x3468c5['plugins']['get'](c)['addToReconnectionStack'](this),_0x2aea4a['adapter']={'addCommentThread':async({channelId:_0x2d8983,threadId:_0x4474a8,comments:_0x1a9edc,resolvedAt:_0x524d37,resolvedBy:_0x5eac24,context:_0x58e04b,attributes:_0x5d4306})=>{const _0x1ca5fe=await this['_getService'](_0x2d8983)['addCommentThread']({'commentThreadId':_0x4474a8,'comments':_0x1a9edc['map'](_0x272a50=>function(_0x2750f9,_0x57d736,_0x21fb22){return{'commentThreadId':_0x21fb22,'commentId':_0x2750f9['commentId'],'userId':_0x2750f9['authorId'],'content':_0x2750f9['content'],'documentId':_0x57d736,'createdAt':_0x2750f9['createdAt'],'attributes':_0x2750f9['attributes']||{}};}(_0x272a50,_0x2d8983,_0x4474a8)),'resolvedAt':_0x524d37,'resolvedBy':_0x5eac24,'context':_0x58e04b,'attributes':_0x5d4306})['catch'](gt);return{'threadId':_0x1ca5fe['commentThreadId'],'comments':_0x1ca5fe['comments']};},'getCommentThread':async({channelId:_0x974e00,threadId:_0x475edb})=>{const _0x269f40=await this['_getService'](_0x974e00)['getCommentThread'](_0x475edb)['catch'](gt);return _0x269f40['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x269f40]),{'threadId':_0x269f40['commentThreadId'],'comments':_0x269f40['comments']['map'](b),'context':_0x269f40['context'],'resolvedAt':_0x269f40['resolvedAt'],'resolvedBy':_0x269f40['resolvedBy'],'attributes':_0x269f40['attributes']||{}});},'updateCommentThread':async({channelId:_0x294ac5,threadId:_0x358b72,context:_0x30294b,unlinkedAt:_0x6c24c7,attributes:_0x58f682})=>this['_getService'](_0x294ac5)['updateCommentThread']({'commentThreadId':_0x358b72,'context':_0x30294b,'attributes':_0x58f682,'unlinkedAt':_0x6c24c7})['catch'](y)['catch'](gt),'resolveCommentThread':async({channelId:_0x47d720,threadId:_0x1597d0})=>{const _0x2ad4df=await this['_getService'](_0x47d720)['resolveCommentThread'](_0x1597d0)['catch'](y)['catch'](gt);return{'threadId':_0x2ad4df['commentThreadId'],'resolvedAt':_0x2ad4df['resolvedAt'],'resolvedBy':_0x2ad4df['resolvedBy']};},'reopenCommentThread':async({channelId:_0x168ede,threadId:_0x3cbef0})=>this['_getService'](_0x168ede)['reopenCommentThread'](_0x3cbef0)['catch'](y)['catch'](gt),'removeCommentThread':({channelId:_0x5e316a,threadId:_0x2bfa9e})=>this['_getService'](_0x5e316a)['removeCommentThread'](_0x2bfa9e)['catch'](y)['catch'](gt),'addComment':({channelId:_0x29703d,threadId:_0x2dbc35,commentId:_0x28413f,content:_0x43fc70,attributes:_0x598246})=>this['_getService'](_0x29703d)['addComment'](_0x2dbc35,_0x28413f,_0x43fc70,_0x598246)['catch'](gt),'updateComment':({channelId:_0xeaa31a,threadId:_0x519c13,commentId:_0x5a7788,content:_0xb6f484,attributes:_0x846101})=>this['_getService'](_0xeaa31a)['updateComment'](_0x519c13,_0x5a7788,_0xb6f484,_0x846101)['catch'](y)['catch'](gt),'removeComment':({channelId:_0x291d56,threadId:_0x131675,commentId:_0x4d3da4})=>this['_getService'](_0x291d56)['removeComment'](_0x131675,_0x4d3da4)['catch'](y)['catch'](gt)},_0x3468c5 instanceof _0x26029e){const _0x2bf310=_0x3468c5['config']['get']('collaboration.channelId'),_0x27e7b0=_0x3468c5['plugins']['get'](i);await this['_setUpService'](_0x2bf310);const _0x131f74=await this['_services']['get'](_0x2bf310)['getConnectedSessions']();this['listenTo'](_0x27e7b0,'sessionAdd:'+_0x2bf310,(_0x1235e5,{session:_0x538d3d})=>{_0x538d3d['id']===_0x27e7b0['mySessionId']&&(_0x1235e5['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x538d3d['permissions'],_0x2bf310));}),_0x27e7b0['register'](_0x2bf310,_0x131f74);}}async['_setUpService'](_0xff0562){if(this['_services']['has'](_0xff0562))throw new _0x445b33('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xff0562});const _0x424e17=this['context']['plugins']['get']('CommentsRepository'),_0x45a2d9=new a['CommentsService'](_0xff0562);this['_services']['set'](_0xff0562,_0x45a2d9),this['listenTo'](_0x45a2d9,'commentThreadAdded',(_0x2a30ed,_0x3f6526)=>{const {commentThreadId:_0x5d90fc,documentId:_0x202f0e,context:_0x203704,attributes:_0x298fe4,resolvedAt:_0x5abf9d,resolvedBy:_0x277375,comments:_0x24ddb6}=_0x3f6526;_0x424e17['getCommentThread'](_0x5d90fc)||_0x424e17['addCommentThread']({'threadId':_0x5d90fc,'channelId':_0x202f0e,'comments':_0x24ddb6?_0x24ddb6['map'](b):[],'context':_0x203704,'attributes':_0x298fe4,'resolvedAt':_0x5abf9d,'resolvedBy':_0x277375,'isFromAdapter':!0x0});}),this['listenTo'](_0x45a2d9,'commentThreadUpdated',(_0x345010,{commentThreadId:_0x22453c,documentId:_0x14bca9,context:_0x4b0237,unlinkedAt:_0x2efeab,attributes:_0x596c38})=>{_0x424e17['getCommentThread'](_0x22453c)&&_0x424e17['updateCommentThread']({'threadId':_0x22453c,'channelId':_0x14bca9,'context':_0x4b0237,'unlinkedAt':_0x2efeab,'attributes':_0x596c38,'isFromAdapter':!0x0});}),this['listenTo'](_0x45a2d9,'commentThreadResolved',(_0x2e74fa,{commentThreadId:_0xc044a3,resolvedBy:_0x338bd3,resolvedAt:_0x29b4f4})=>{const _0x285161=_0x424e17['getCommentThread'](_0xc044a3);_0x285161&&_0x285161['resolve']({'resolvedBy':_0x338bd3,'resolvedAt':_0x29b4f4,'isFromAdapter':!0x0});}),this['listenTo'](_0x45a2d9,'commentThreadReopened',(_0x19693b,{commentThreadId:_0x112fb8})=>{const _0x3b54ea=_0x424e17['getCommentThread'](_0x112fb8);_0x3b54ea&&_0x3b54ea['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x45a2d9,'commentThreadRemoved',(_0x5dfa9f,{commentThreadId:_0x420ee2})=>{const _0x19d469=_0x424e17['getCommentThread'](_0x420ee2);_0x19d469&&_0x19d469['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x45a2d9,'commentAdded',(_0x3ae4cc,_0x448ee0)=>{const _0x5fe888=_0x448ee0['commentThreadId'],_0x4cadcd=_0x424e17['getCommentThread'](_0x5fe888);_0x4cadcd&&_0x4cadcd['addComment']({...b(_0x448ee0),'isFromAdapter':!0x0});}),this['listenTo'](_0x45a2d9,'commentUpdated',(_0x37de1f,{commentThreadId:_0x1cdc55,commentId:_0x426681,content:_0x2b7912,attributes:_0x4778fa})=>{const _0x2eefa0=_0x424e17['getCommentThread'](_0x1cdc55);if(_0x2eefa0){const _0x3fadf6=_0x2eefa0['getComment'](_0x426681);_0x3fadf6&&_0x3fadf6['update']({'content':_0x2b7912,'attributes':_0x4778fa,'isFromAdapter':!0x0});}}),this['listenTo'](_0x45a2d9,'commentRemoved',(_0x5d9621,{commentThreadId:_0x38d332,commentId:_0x2a330c})=>{const _0x5abb8e=_0x424e17['getCommentThread'](_0x38d332);if(_0x5abb8e){const _0x1717af=_0x5abb8e['getComment'](_0x2a330c);_0x1717af&&_0x1717af['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xff0562);}['destroy'](){if(this['context']instanceof _0x26029e){const _0x447950=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x447950);}}['_terminateService'](_0x121d2e){if(!this['_services']['has'](_0x121d2e))throw new _0x445b33('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x121d2e});this['_getService'](_0x121d2e)['disconnect'](),this['_services']['delete'](_0x121d2e);}async['reconnect'](){for(const _0x1a1eb0 of this['_services']['keys']())await this['_connectService'](_0x1a1eb0);if(this['context']instanceof _0x26029e){const _0x3a93ef=this['context']['config']['get']('collaboration.channelId'),_0x486c88=this['context']['plugins']['get'](i);_0x486c88['unregister'](_0x3a93ef);const _0x565409=await this['_services']['get'](_0x3a93ef)['getConnectedSessions']();_0x486c88['register'](_0x3a93ef,_0x565409);}}async['_connectService'](_0x18a645){const {connection:_0x20922e}=this['context']['plugins']['get'](c),_0xc05440=this['context']['plugins']['get']('CommentsRepository'),_0x2730a3=this['_services']['get'](_0x18a645),_0x196b7f=await _0x2730a3['connect'](_0x20922e);await this['_fetchMissingUsersForThreads'](_0x196b7f);const _0x3fcd24=new Set(Array['from'](_0xc05440['getCommentThreads']({'channelId':_0x18a645}),_0x4f13e2=>_0x4f13e2['id']));for(const _0x1d4c67 of _0x196b7f)_0x1d4c67['deletedAt']||_0x3fcd24['delete'](_0x1d4c67['commentThreadId']);for(const _0x9c6283 of _0x3fcd24)_0xc05440['getCommentThread'](_0x9c6283)['remove']({'isFromAdapter':!0x0});for(const _0x2ea892 of _0x196b7f){let _0x39a099=_0xc05440['getCommentThread'](_0x2ea892['commentThreadId']);const {commentThreadId:_0x424c9c,context:_0x22a0dc,attributes:_0x8d02b3,resolvedBy:_0x515f75,resolvedAt:_0x4269c6,unlinkedAt:_0x155d83,deletedAt:_0x33c9ef}=_0x2ea892;if(_0x33c9ef)continue;_0x39a099||(_0x39a099=_0xc05440['addCommentThread']({'channelId':_0x18a645,'threadId':_0x424c9c,'context':_0x22a0dc,'attributes':_0x8d02b3||{},'resolvedBy':_0x515f75,'resolvedAt':_0x4269c6,'unlinkedAt':_0x155d83,'isFromAdapter':!0x0}));const _0x4be671=new Set(Array['from'](_0x39a099['comments'],_0x2ae205=>_0x2ae205['id']));for(const _0x577aa4 of _0x2ea892['comments'])_0x4be671['delete'](_0x577aa4['commentId']);for(const _0x171b5c of _0x4be671)_0x39a099['getComment'](_0x171b5c)['remove']({'isFromAdapter':!0x0});for(const _0x23c215 of _0x2ea892['comments']){const _0x3bc191=_0x39a099['getComment'](_0x23c215['commentId']);_0x3bc191?_0x3bc191['content']!==_0x23c215['content']&&_0x3bc191['update']({'content':_0x23c215['content'],'isFromAdapter':!0x0}):_0x39a099['addComment'](Object['assign'](b(_0x23c215),{'isFromAdapter':!0x0}));}}}['_getService'](_0x4bee6d){if(!this['_services']['has'](_0x4bee6d))throw new _0x445b33('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4bee6d});return this['_services']['get'](_0x4bee6d);}async['_fetchMissingUsersForThreads'](_0x462267){const _0xe01140=this['context']['plugins']['get'](_0x187697),{connection:_0x11a770}=this['context']['plugins']['get'](c),_0xdeabf2=new Set();for(const {resolvedBy:_0x3ca1e8,comments:_0x1f1337}of _0x462267){_0x3ca1e8&&!_0xe01140['getUser'](_0x3ca1e8)&&_0xdeabf2['add'](_0x3ca1e8);for(const {userId:_0x4a9f1d}of _0x1f1337)_0xe01140['getUser'](_0x4a9f1d)||_0xdeabf2['add'](_0x4a9f1d);}if(0x0===_0xdeabf2['size'])return;const _0x281351=await mt['getMany'](_0x11a770,Array['from'](_0xdeabf2));for(const _0xa5ba5f of _0x281351)_0xe01140['getUser'](_0xa5ba5f['id'])||_0xe01140['addUser'](_0xa5ba5f);}}async function y(_0x49f15c){if('404'!==_0x49f15c['code'])throw _0x49f15c;}function gt(_0x33ad12){if((_0x146323=_0x33ad12)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x146323['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x146323['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x146323;throw _0x33ad12;}function b(_0xa41e46){return{'threadId':_0xa41e46['commentThreadId'],'commentId':_0xa41e46['commentId'],'content':_0xa41e46['content'],'createdAt':_0xa41e46['createdAt'],'authorId':_0xa41e46['userId'],'attributes':_0xa41e46['attributes']||{}};}class f extends _0x3f4d49{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49706d){super(_0x49706d);const _0x10b3c4=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x10b3c4);}['init'](){const _0x38a8a9=this['editor']['plugins']['get'](c),_0x432dbb=this['editor']['plugins']['get']('TrackChangesEditing');return _0x432dbb['adapter']={'getSuggestion':async _0x2d6292=>{await this['_waitForServiceReady']();const _0x2b77d1=await this['_trackChangesService']['get'](_0x2d6292)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x2b77d1]),_0x2b77d1;},'addSuggestion':async({id:_0x56e16c,type:_0x1ed950,data:_0x115399,originalSuggestionId:_0x1f5927,attributes:_0x551774})=>{await this['_waitForServiceReady']();const _0x40f9a0={'id':_0x56e16c,'type':_0x1ed950,'data':_0x115399,'originalSuggestionId':_0x1f5927,'attributes':_0x551774},_0x1f0c0c=await this['_trackChangesService']['add'](_0x56e16c,_0x1ed950,_0x115399,_0x1f5927,_0x551774)['catch'](_0x328f5d=>{if(wt(_0x328f5d))return new Promise(_0x35cdcd=>{this['_bufferedRequests']['set'](_0x56e16c,{'resolve':_0x35cdcd,'suggestionData':_0x40f9a0});});throw _0x328f5d;});return this['_bufferedRequests']['delete'](_0x56e16c),_0x1f0c0c;},'updateSuggestion':async(_0x4ac23a,_0x789e73)=>{if(await this['_waitForServiceReady'](),'open'!==_0x789e73['state'])return this['_trackChangesService']['update'](_0x4ac23a,_0x789e73)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x38fa72,_0x354a64)=>{_0x432dbb['hasSuggestion'](_0x354a64['id'])&&(_0x432dbb['getSuggestion'](_0x354a64['id'])['attributes']=_0x354a64['attributes']);}),this['_trackChangesService']['connect'](_0x38a8a9['connection'])['then'](_0x1d9c92=>(_0x38a8a9['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1d9c92)['then'](()=>{for(const _0x1d29d2 of _0x1d9c92){_0x432dbb['addSuggestionData'](_0x1d29d2)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5b0430=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x4de236}=this['editor']['plugins']['get'](c),_0x13e9d5=await this['_trackChangesService']['connect'](_0x4de236);await this['_fetchMissingUsersForThreads'](_0x13e9d5);for(const {suggestionData:_0x50dab7,resolve:_0x397022}of this['_bufferedRequests']['values']()){let _0x15aedf=_0x13e9d5['find'](_0x179fa1=>_0x179fa1['id']===_0x50dab7['id']);_0x15aedf||(_0x15aedf=await this['_trackChangesService']['add'](_0x50dab7['id'],_0x50dab7['type'],_0x50dab7['data'],_0x50dab7['originalSuggestionId'])),_0x397022(_0x15aedf);}for(const _0x25e482 of _0x13e9d5)_0x5b0430['hasSuggestion'](_0x25e482['id'])||_0x5b0430['addSuggestionData'](_0x25e482);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2a7c79=>{this['listenTo'](this['_trackChangesService'],'connected',_0xe3be0=>{_0xe3be0['off'](),_0x2a7c79();});});}async['_fetchMissingUsersForThreads'](_0x436644){const _0x306ebe=this['editor']['plugins']['get'](_0x187697),{connection:_0x17dfa5}=this['editor']['plugins']['get'](c),_0x118ff7=new Set();for(const {authorId:_0xec8be7}of _0x436644)_0x306ebe['getUser'](_0xec8be7)||_0x118ff7['add'](_0xec8be7);if(0x0===_0x118ff7['size'])return;const _0x2ab200=await mt['getMany'](_0x17dfa5,Array['from'](_0x118ff7));for(const _0x255a2f of _0x2ab200)_0x306ebe['getUser'](_0x255a2f['id'])||_0x306ebe['addUser'](_0x255a2f);}}function w(_0x59ba5f){if(wt(_0x59ba5f))return new Promise(()=>{});throw _0x59ba5f;}function wt(_0x28e0c8){return _0x28e0c8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x28e0c8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x3f4d49{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2d4fc1=this['editor']['plugins']['get'](c),_0x2c9121=this['editor']['plugins']['get']('CommentsEditing'),_0x11ba2c=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2d4fc1,'change:state',(_0x22e100,_0x130db9,_0x106ef3)=>{_0x2c9121['isThreadsLoadingPaused']='connected'!==_0x106ef3;});}),this['listenTo'](_0x2d4fc1,'change:state',(_0x249d03,_0x197a86,_0xad742f)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xad742f);}),_0x11ba2c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x3f4d49{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x3f4d49{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>rt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x187697];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31153e){super(_0x31153e);const _0x4d88d5=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x4d88d5);}async['init'](){const _0x34b353=this['editor']['plugins']['get'](l),_0x5531cb=_0x34b353['serverHistory'],_0x17235a=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x5531cb,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x34b353['sessionId']});const _0xefed89=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x580e17=await ot['isBundleUploaded'](_0x17235a['connection'],_0xefed89);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x57b9b3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x57b9b3)),'updateRevisions':async _0x1d9c5d=>{await this['_waitForServiceReady']();const _0x5f238c=this['_revisionTracker']['currentRevision'];if(_0x580e17&&0x1===_0x1d9c5d['length']&&_0x1d9c5d[0x0]['id']===_0x5f238c['id'])return _0x1d9c5d;for(const _0x537e39 of _0x1d9c5d)_0x537e39['id']===_0x5f238c['id']&&(_0x537e39['isEmptyCurrent']=_0x537e39['fromVersion']===_0x537e39['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x1d9c5d,this['_lastRequestId'])['then'](_0x122f1c=>(this['_lastRequestId']=_0x122f1c,_0x1d9c5d))['catch'](_0xe18aec=>{if(nt(_0xe18aec)||'400'===_0xe18aec['code']&&void 0x0!==_0xe18aec['data']['wrongRequestId']){for(const _0x201495 of _0x1d9c5d){!this['_revisionTracker']['repository']['getRevision'](_0x201495['id'])||this['_revisionTracker']['_bufferUpdate'](_0x201495['id'],_0x201495,!0x1);}if(nt(_0xe18aec))throw _0xe18aec;return _0x1d9c5d;}throw _0xe18aec;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x323aee,{revisionsData:_0x3a6cea,requestId:_0xd5a491})=>{Math['max'](..._0x3a6cea['map'](_0x3e230f=>_0x3e230f['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3a6cea,_0xd5a491);}):this['_handleRevisionsUpdate'](_0x3a6cea,_0xd5a491);});const {revisions:_0xf8a30d,requestId:_0x429f03}=await this['_revisionHistoryService']['connect'](_0x17235a['connection']);_0x17235a['addToReconnectionStack'](this),this['_lastRequestId']=_0x429f03,await this['_fetchMissingUsers'](_0xf8a30d);for(const _0x4b4748 of _0xf8a30d)this['_revisionTracker']['addRevisionData'](_0x4b4748);this['listenTo'](_0x34b353,'change:_isConnected',(_0x3e608a,_0x463c03,_0x32934c)=>{_0x32934c&&(this['_oldOffset']=_0x34b353['_offset'],_0x3e608a['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x17235a,'state',_0x3db41b=>_0x3db41b===_0x5f0dfb['CONNECTED']);}async['reconnect'](){const _0x19637f=this['editor']['plugins']['get'](c),_0x520067=this['editor']['plugins']['get'](l),_0x262820=async()=>{const _0x25d54b=this['_revisionTracker']['currentRevision'],_0x199f7e=_0x25d54b['id'],_0x23307b=_0x199f7e!==_0x520067['sessionId'];if(_0x23307b){const _0x33a2e6=_0x520067['_offset']-this['_oldOffset'],_0x133aec=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x25d54b['toVersion']+_0x33a2e6!==_0x133aec){const _0x48886d=_0x25d54b['fromVersion']+_0x33a2e6,_0x4ee7e5=this['editor']['plugins']['get'](_0x187697),_0x2eec6b=this['_revisionTracker']['buildRevisionData']({'revision':_0x25d54b,'from':_0x48886d,'to':_0x133aec});_0x2eec6b['id']=_0x25d54b['id'];const _0x1d2ec6=_0x2eec6b['authorsIds']['map'](_0x2ae225=>_0x4ee7e5['getUser'](_0x2ae225));_0x25d54b['_update']({..._0x2eec6b,'authors':_0x1d2ec6},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x25d54b['id'],_0x2eec6b,!0x0);}this['_revisionTracker']['_startingVersion']=_0x133aec,(_0x25d54b['toVersion']===_0x25d54b['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x199f7e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x199f7e),this['_revisionTracker']['_createCurrentRevision'](_0x133aec));}const {revisions:_0x12d078,requestId:_0x3ba24d}=await this['_revisionHistoryService']['reconnect'](_0x19637f['connection'],this['_lastRequestId']);_0x23307b&&_0x12d078['length']>0x0?_0x520067['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x12d078),this['_handleRevisionsUpdate'](_0x12d078,_0x3ba24d),this['_revisionTracker']['sendBufferedUpdates']());};return _0x520067['_isConnected']?_0x262820():new Promise((_0x7698a3,_0x33b4ac)=>{_0x520067['once']('change:_isConnected',()=>{_0x262820()['then'](_0x7698a3)['catch'](_0x33b4ac);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x38ef74=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x19820b=>{_0x19820b['off'](),_0x38ef74();});});}['_getLatestVersionFromServerOperations'](){const _0x2f3edd=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1ea450 of _0x2f3edd)if('marker'!==_0x1ea450['type']||_0x1ea450['affectsData'])return _0x1ea450['baseVersion']+0x1;}['_getLatestVersion'](){const _0xcbcc56=this['editor']['plugins']['get'](l);return new Promise(_0x36648e=>{_0xcbcc56['_isPendingUpdate']?_0xcbcc56['once']('change:_isPendingUpdate',()=>{_0x36648e(this['_getLatestVersionFromServerOperations']());}):_0x36648e(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x23ceb3,_0x41eb2b){const _0x1da92e=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x41eb2b;for(const _0x7b8b75 of _0x23ceb3){const _0x259d58=_0x1da92e['getRevision'](_0x7b8b75['id']);if(_0x259d58){if((_0x7b8b75['fromVersion']||_0x7b8b75['toVersion'])&&(_0x7b8b75['diffData']=null),_0x259d58===this['_revisionTracker']['currentRevision']){const _0x57d4a5=Math['max'](_0x259d58['toVersion'],_0x7b8b75['toVersion']),_0x2adc9d=Math['max'](_0x259d58['fromVersion'],_0x7b8b75['fromVersion']);let _0x2c41ee;_0x259d58['toVersion']===_0x7b8b75['toVersion']&&_0x259d58['fromVersion']===_0x7b8b75['fromVersion']?(_0x2c41ee=!0x0,this['_preventResendingRevisionData'](_0x7b8b75)):_0x7b8b75['toVersion']===_0x57d4a5&&_0x7b8b75['fromVersion']===_0x2adc9d?_0x2c41ee=!0x1:(_0x259d58['toVersion']===_0x57d4a5&&_0x259d58['fromVersion']===_0x2adc9d||this['_fixRevision']({'revision':_0x259d58,'from':_0x2adc9d,'to':_0x57d4a5}),_0x2c41ee=!0x0),_0x2c41ee&&(delete _0x7b8b75['fromVersion'],delete _0x7b8b75['toVersion'],delete _0x7b8b75['diffData'],delete _0x7b8b75['createdAt'],delete _0x7b8b75['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x7b8b75),this['_preventResendingRevisionData'](_0x7b8b75);}else this['_revisionTracker']['addRevisionData'](_0x7b8b75);}const _0x112af2=_0x1da92e['getRevisions']();_0x112af2['reverse']();for(let _0x26e24a=0x0;_0x26e24a<_0x112af2['length']-0x1;_0x26e24a++){const _0x2a2f08=_0x112af2[_0x26e24a],_0x2b7051=_0x112af2[_0x26e24a+0x1];if(_0x2a2f08['fromVersion']<_0x2b7051['toVersion']){const _0x5d4706=_0x2b7051['toVersion'],_0xeff63=Math['max'](_0x5d4706,_0x2a2f08['toVersion']);this['_fixRevision']({'revision':_0x2a2f08,'from':_0x5d4706,'to':_0xeff63});}}}['_fixRevision']({revision:_0x4800f2,from:_0x3adb5c,to:_0x2926ec}={}){const _0x16dbc0=this['editor']['plugins']['get'](_0x187697),_0xb956bc=this['_revisionTracker']['buildRevisionData']({'revision':_0x4800f2,'from':_0x3adb5c,'to':_0x2926ec});_0xb956bc['authors']=_0xb956bc['authorsIds']['map'](_0x3aeba9=>_0x16dbc0['getUser'](_0x3aeba9)),_0x4800f2['_update'](_0xb956bc);}['_preventResendingRevisionData'](_0x319383){const _0x4e47b1={};_0x4e47b1['id']=_0x319383['id'];for(const _0x24d6b7 of Object['keys'](_0x319383))'id'!==_0x24d6b7&&(_0x4e47b1[_0x24d6b7]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4e47b1['id'],_0x4e47b1,!0x0);}async['_fetchMissingUsers'](_0x2ce47f){const _0x4ddabe=this['editor']['plugins']['get'](_0x187697),{connection:_0xd87ca4}=this['editor']['plugins']['get'](c),_0x5e3546=new Set();for(const _0x2fe5c8 of _0x2ce47f){for(const _0x18630e of _0x2fe5c8['authorsIds'])_0x54c13e(_0x18630e);_0x2fe5c8['creatorId']&&_0x54c13e(_0x2fe5c8['creatorId']);}if(0x0===_0x5e3546['size'])return;const _0xe83178=await mt['getMany'](_0xd87ca4,Array['from'](_0x5e3546));for(const _0x4f6e15 of _0xe83178)_0x4ddabe['getUser'](_0x4f6e15['id'])||_0x4ddabe['addUser'](_0x4f6e15);function _0x54c13e(_0x2432f1){_0x4ddabe['getUser'](_0x2432f1)||_0x5e3546['add'](_0x2432f1);}}}function nt(_0xab069d){return _0xab069d['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0xab069d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xab069d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x3f4d49{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x1feba2{constructor(_0x377de5){super(_0x377de5);const _0x4ed38d=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x4ed38d['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x4ed38d['to']('usersCount',_0x374f78=>E(_0x377de5,'CONNECTED_USERS',_0x374f78))}]});}}class es extends _0x1feba2{['items'];['keystrokes'];constructor(_0x69e123){super(_0x69e123);const _0x33e232=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x7f95c8(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x33e232['if']('hasPopup'),'aria-expanded':_0x33e232['to']('isExpanded',_0x49260f=>this['hasPopup']&&String(_0x49260f)),'aria-label':_0x33e232['to']('hasPopup',_0x2a1c26=>E(_0x69e123,_0x2a1c26?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x33e232['to']('hasPopup',_0x2078c1=>!!_0x2078c1&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x33e232['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x5466ff,_0x2246ae,_0x10160c)=>{this['element']&&(_0x10160c?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class Z extends _0x1feba2{['counterView'];['inlineListView'];constructor(_0x5ecb22){super(_0x5ecb22);const _0x4c2d11=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x5ecb22),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x215675 of this['inlineListView']['items'])_0x215675['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',_0x4c2d11['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class tt extends _0x1feba2{['listWrapperView'];constructor(_0x19491e,_0x2547cf){super(_0x19491e),this['listWrapperView']=new vt(_0x19491e,_0x2547cf),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x19491e,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x330cb3{constructor(_0x3c7f74,_0x50ef01){super(_0x3c7f74);const _0x480389=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x50ef01?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x480389['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x480389['to']('role'),'aria-label':_0x480389['to']('ariaLabel'),'aria-labelledby':_0x480389['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x32c2cf['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x125ccd=this['element'];_0x125ccd&&(this['_isScrollable']=Math['max'](_0x125ccd['scrollHeight'],_0x125ccd['clientHeight'])>0.8*window['innerHeight']);}}class st extends ct{['userView'];constructor(_0x572cdd,_0xf7357,_0x6f1142){super(_0x572cdd);const _0x16c2dd=this['bindTemplate'];this['userView']=new lt(_0x572cdd,_0xf7357);const _0x1133f7={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xf7357['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xf7357['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xf7357['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x6f1142&&(_0x1133f7['tag']='button',_0x1133f7['on']={'click':_0x16c2dd['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1133f7);}['focus'](){this['element']['focus']();}}class it extends _0x1feba2{['userView'];['markerView'];constructor(_0x1ff4b0,_0x5381fd,_0x38ac44){super(_0x1ff4b0);const _0x1c759a=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new lt(_0x1ff4b0,_0x5381fd),this['markerView']=new dt(_0x1ff4b0,_0x5381fd);const _0x560c21=new pt(_0x1ff4b0);_0x560c21['template']['tag']='span',_0x560c21['text']=_0x5381fd['name'];const _0x50f14c={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1c759a['to']('isFocusable',_0x16ad9b=>!!_0x16ad9b&&0x0),'aria-labelledby':_0x560c21['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1c759a['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1c759a['to']('hasTooltip',_0x6ab446=>!_0x6ab446),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x560c21]};_0x38ac44&&(_0x50f14c['tag']='button',_0x50f14c['on']={'click':_0x1c759a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x50f14c);}}class dt extends _0x1feba2{constructor(_0x1e8587,_0x88e95){super(_0x1e8587),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x88e95['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const et={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x33c810{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x3258c2){super(_0x3258c2),this['context']['config']['define']('presenceList',et);const _0x2724ae=_0x3258c2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2724ae)throw new _0x445b33('presencelist-collapseat-invalid-format',this);if(_0x2724ae<0x1)throw new _0x445b33('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x22757d(),this['balloonPanelView']=new _0x2f79e0(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x356df6 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x356df6);this['listenTo'](this['_allConnectedUsers'],'add',(_0x42cd10,_0x1f34a1)=>{this['_handleUserAdd'](_0x1f34a1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x13a8bd,_0x1be6ee)=>{this['_handleUserRemove'](_0x1be6ee);});}['_createView'](){const _0x85dc7=this['context'],_0xc1335e=new Z(this['context']['locale']),_0x1cab6a=this['balloonPanelView'];if(!_0x533984(_0x85dc7['config']['get']('presenceList.container')))throw new _0x445b33('presencelist-missing-container',this);return _0xc1335e['counterView']['bind']('usersCount')['to'](this),_0xc1335e['bind']('isCollapsed')['to'](this,'usersCount',_0x39b974=>{const {collapseAt:_0x743773,displayMe:_0x5246d7}=_0x85dc7['config']['get']('presenceList'),_0x1ee9bc=_0x39b974>=_0x743773;return _0xc1335e['counterView']['isHidden']=!(0x1==_0x39b974&&_0x5246d7||_0x1ee9bc),_0x1ee9bc||this['hideDropdown'](),_0x1ee9bc;}),_0xc1335e['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x3f6b96=>{const _0x545244=_0x85dc7['config']['get']('presenceList'),_0x247a57=new it(_0x85dc7['locale'],_0x3f6b96,!!_0x545244['onClick']);return _0x247a57['bind']('hasTooltip')['to'](_0xc1335e,'isCollapsed',_0x5c497c=>!_0x5c497c),_0x247a57['bind']('isFocusable')['to'](_0xc1335e,'isCollapsed',_0x5dcbc2=>!_0x5dcbc2),_0x545244['onClick']&&this['listenTo'](_0x247a57,'execute',()=>{this['view']['isCollapsed']||_0x545244['onClick'](_0x3f6b96,_0x247a57['element']);}),_0x247a57;}),this['listenTo'](_0xc1335e['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0xc1335e['inlineListView']['keystrokes']['set']('Enter',(_0x1aa826,_0x590ac6)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x590ac6());}),_0xc1335e['render'](),_0x1cab6a['render'](),_0x54d43d({'emitter':_0xc1335e,'activator':()=>_0x1cab6a['isVisible'],'contextElements':[_0x1cab6a['element'],_0xc1335e['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x85dc7['config']['get']('presenceList.container')['appendChild'](_0xc1335e['element']),this['_bodyCollection']=new _0xa840b1(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xc1335e;}['_handleUserAdd'](_0x14a437){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x14a437['isMe'])return;const _0x2b8fba=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x2b8fba&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x890c88=_0x14a437['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x14a437,_0x890c88);}['_handleUserRemove'](_0x2df865){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x2df865['id'])&&(this['currentDisplayedUsers']['remove'](_0x2df865['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x37a331 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x37a331['id']))return void this['currentDisplayedUsers']['add'](_0x37a331,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x39ca18=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new tt(this['context']['locale'],!!_0x39ca18['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x419be8}=this['presenceDropdownView'];_0x419be8['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x20447d=>{if(!_0x39ca18['displayMe']&&_0x20447d['isMe'])return null;const _0x1acb4e=new st(this['context']['locale'],_0x20447d,!!_0x39ca18['onClick']);return _0x39ca18['onClick']&&this['listenTo'](_0x1acb4e,'execute',()=>{_0x39ca18['onClick'](_0x20447d,_0x1acb4e['element']);}),_0x1acb4e;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x419be8['focus'](),_0x419be8['checkIfScrollable']();const _0x13fd5d=(_0x5c4629,_0xc74e2f)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0xc74e2f();};_0x419be8['keystrokes']['set']('Esc',_0x13fd5d),_0x419be8['keystrokes']['set']('Shift+Tab',_0x13fd5d),_0x419be8['keystrokes']['set']('Tab',(_0xf99d5d,_0x5dce49)=>{!function(_0x2be9c0){const _0x41402e=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4bab34=>_0x4bab34+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3d6091=[...document['body']['querySelectorAll'](_0x41402e)]['filter'](_0x18ae13=>_0x18ae13===document['activeElement']||_0x18ae13['offsetWidth']+_0x18ae13['offsetHeight']>0x0)['sort']((_0x36a32a,_0x4f4cbf)=>(_0x36a32a['tabIndex']||0x0)-(_0x4f4cbf['tabIndex']||0x0)),_0xbfbc0b=_0x3d6091['indexOf'](_0x2be9c0),_0x1e209c=_0x3d6091[(_0xbfbc0b+0x1)%_0x3d6091['length']];_0x1e209c&&_0x1e209c['focus']();}(this['view']['element']),this['hideDropdown'](),_0x5dce49();}),_0x419be8['focusTracker']['add'](this['view']['element']),_0x419be8['focusTracker']['on']('change:isFocused',(_0x3dbb4e,_0x2806d2,_0xf600a4)=>{_0xf600a4||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x33c810{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
@@ -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':_0x101a1d=>0x1!=_0x101a1d}};
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':_0x4da334=>0x1!=_0x4da334}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x322691=>{const {af:{dictionary:_0x3c198e,getPluralForm:_0x13d030}}={'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':_0x43d0de=>0x1!=_0x43d0de}};_0x322691['af']||={'dictionary':{},'getPluralForm':null},_0x322691['af']['dictionary']=Object['assign'](_0x322691['af']['dictionary'],_0x3c198e),_0x322691['af']['getPluralForm']=_0x13d030;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x3c4750=>{const {af:{dictionary:_0x27e003,getPluralForm:_0x687554}}={'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':_0x35e6ff=>0x1!=_0x35e6ff}};_0x3c4750['af']||={'dictionary':{},'getPluralForm':null},_0x3c4750['af']['dictionary']=Object['assign'](_0x3c4750['af']['dictionary'],_0x27e003),_0x3c4750['af']['getPluralForm']=_0x687554;})(window['CKEDITOR_TRANSLATIONS']||={});