@ckeditor/ckeditor5-real-time-collaboration 47.0.0-alpha.1 → 47.0.0-alpha.2

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 (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. 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 _0x4ac1ff,Plugin as _0x160203,PendingActions as _0x52720a,Context as _0x11ac81}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x46c868,CKEditorError as _0x18bf15,Collection as _0x410c43,global as _0x3deb78,version as nt,uid as _0x3bb5a9,KeystrokeHandler as _0x13a22f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4610c4,View as _0x56bb97,ListView as _0x3c678d,ListItemView as et,LabelView as it,BalloonPanelView as _0x398ac4,clickOutsideHandler as _0x196e8e,BodyCollection as _0x5280fe}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x93d8bd,History as _0x24ea1e,NoOperation as _0x4bdc51,InsertOperation as _0x78ae33,MarkerOperation as _0x273597,RootAttributeOperation as _0x487d54,transformOperationSets as _0x234499,OperationFactory as _0x13ad1b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x46f1ff,CollaborativeEditingService as _0x49395a,User as ct,CommentsService as _0x9e5482,TrackChangesService as tt,RevisionHistoryService as _0x31a884,EditorService as _0x431abb}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1d7a86,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x55c2ea}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x339925}from'es-toolkit/compat';class n extends _0x4ac1ff{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4610c4];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19e899){super(_0x19e899),this['set']('state',_0x46f1ff['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x46c868())();}['init'](){const _0x1bf02a=this['context'],_0x2d83a7=_0x1bf02a['plugins']['get']('CloudServices'),_0x25801a=_0x1bf02a['plugins']['get'](_0x4610c4);if(!_0x2d83a7['token'])throw new _0x18bf15('websocketgateway-missing-token',this);if(!_0x2d83a7['webSocketUrl'])throw new _0x18bf15('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x2d83a7['token'],_0x2d83a7['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4a3539=>{if(this['connection']=_0x4a3539,this['bind']('state')['to'](_0x4a3539,'state',this,'_isBrowserOffline',(_0xb2cd06,_0x5e80e6)=>('connected'!==_0xb2cd06&&(this['_shouldPluginsReconnect']=!0x0),_0x5e80e6||_0xb2cd06!==_0x46f1ff['CONNECTED']?_0x46f1ff['DISCONNECTED']:this['state']==_0x46f1ff['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x46f1ff['CONNECTING']):_0x46f1ff['CONNECTED'])),this['connection']['on']('error',(_0x25eaaf,_0x461167)=>{if('limitExceeded'!==_0x461167['code'])throw console['error'](_0x461167),new _0x18bf15('cloudservices-init',null,{'originalError':_0x461167});_0x25801a['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'});}),!_0x4a3539['me'])return new Promise(_0x9976c2=>_0x4a3539['on']('change:me',_0x9976c2));})['catch'](_0xdb63d9=>{throw console['error'](_0xdb63d9),new _0x18bf15('cloudservices-init',null,{'originalError':_0xdb63d9});});}['addToReconnectionStack'](_0x328b81){if('function'!=typeof _0x328b81['reconnect'])throw new _0x18bf15('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x328b81))throw new _0x18bf15('websocketgateway-plugin-already-registered',this,{'name':_0x328b81['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x328b81);}['removeFromReconnectionStack'](_0x27560e){this['_reconnectionStack']['delete'](_0x27560e);}['isInReconnectionStack'](_0x7f520){return this['_reconnectionStack']['has'](_0x7f520);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x21e0bb=>_0x21e0bb['reconnect']())))['then'](()=>this['state']=_0x46f1ff['CONNECTED'])['catch'](_0x529c49=>{throw console['error'](_0x529c49),new _0x18bf15('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x46f1ff['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x4ac1ff{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x1d7a86];}constructor(_0x1ba1e5){super(_0x1ba1e5),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x410c43(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d7a86);}['init'](){const _0x52d989=this['context']['plugins']['get'](n);this['listenTo'](_0x52d989,'change:state',(_0x54bb8e,_0x46f421,_0x2c0c1f)=>{if('connected'!==_0x2c0c1f)this['channelSessions']['forEach'](_0xd3e557=>_0xd3e557['clear']()),this['channelConnectedUsers']['forEach'](_0x303183=>_0x303183['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2d9aa0,_0x10e7cc]of this['_registeredSessions'])for(const _0xb90447 of _0x10e7cc)this['_handleSessionAdd'](_0x2d9aa0,_0xb90447);}}),this['_createUser'](_0x52d989['connection']['me'],!0x0);}['register'](_0x20cbb5,_0x20935d){if(this['_registeredSessions']['has'](_0x20cbb5))throw new _0x18bf15('sessions-register-already-registered',null,{'channelId':_0x20cbb5});this['_registeredSessions']['set'](_0x20cbb5,_0x20935d),this['channelSessions']['set'](_0x20cbb5,new _0x410c43()),this['channelConnectedUsers']['set'](_0x20cbb5,new _0x410c43()),this['listenTo'](_0x20935d,'add',(_0x172925,_0x5efae3)=>this['_handleSessionAdd'](_0x20cbb5,_0x5efae3)),this['listenTo'](_0x20935d,'remove',(_0x26628e,_0xdad811)=>this['_handleSessionRemove'](_0x20cbb5,_0xdad811));for(const _0x2bb59c of _0x20935d)this['_handleSessionAdd'](_0x20cbb5,_0x2bb59c);}['unregister'](_0x58913c){if(!this['_registeredSessions']['has'](_0x58913c))throw new _0x18bf15('sessions-unregister-not-exist',null,{'channelId':_0x58913c});const _0x37d7ca=this['_registeredSessions']['get'](_0x58913c);this['stopListening'](_0x37d7ca);for(const _0x47b537 of _0x37d7ca)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x58913c,_0x47b537);this['_registeredSessions']['delete'](_0x58913c),this['channelSessions']['delete'](_0x58913c),this['channelConnectedUsers']['delete'](_0x58913c);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x76545e){for(const _0x1b090e of this['channelSessions']['values']())for(const _0x41b2e5 of _0x1b090e)if(_0x41b2e5['id']===_0x76545e)return _0x41b2e5['user'];}['getUserSessions'](_0x3f91c5,_0x576b7e){const _0x6368c9=_0x576b7e?[this['channelSessions']['get'](_0x576b7e)]:this['channelSessions']['values'](),_0x40072e=new Set();for(const _0xcd510c of _0x6368c9)for(const _0x1df1da of _0xcd510c)_0x1df1da['user']['id']===_0x3f91c5['id']&&_0x40072e['add'](_0x1df1da['id']);return _0x40072e;}['getUserRole'](_0x17bf02){for(const _0x38b53e of this['channelSessions']['values']())for(const _0x201ba4 of _0x38b53e)if(_0x201ba4['user']===_0x17bf02)return _0x201ba4['role'];}['_handleSessionAdd'](_0x1679bd,_0x538b7f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x19e8a6=_0x538b7f['user'],_0x33933e=this['_users']['getUser'](_0x19e8a6['id'])||this['_createUser'](_0x19e8a6),_0x4c453f=Object['assign']({},_0x538b7f,{'user':_0x33933e});if(this['channelSessions']['get'](_0x1679bd)['add'](_0x4c453f),!_0x19e8a6['hiddenInPresenceList']){const _0x5bfd0b=this['channelConnectedUsers']['get'](_0x1679bd);_0x5bfd0b['has'](_0x33933e['id'])||_0x5bfd0b['add'](_0x33933e),this['allConnectedUsers']['has'](_0x33933e['id'])||_0x19e8a6['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x33933e,_0x33933e['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1679bd,{'channelId':_0x1679bd,'session':_0x4c453f});}['_handleSessionRemove'](_0x5c81a6,_0x2dbe3e){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1b1e52=this['channelConnectedUsers']['get'](_0x5c81a6),_0x8f1da2=_0x2dbe3e['user'];_0x8f1da2['id']&&(this['channelSessions']['get'](_0x5c81a6)['remove'](_0x2dbe3e['id']),_0x1b1e52['has'](_0x8f1da2['id'])&&!this['getUserSessions'](_0x8f1da2,_0x5c81a6)['size']&&_0x1b1e52['remove'](_0x8f1da2['id']),this['allConnectedUsers']['get'](_0x8f1da2['id'])&&!this['getUserSessions'](_0x8f1da2)['size']&&this['allConnectedUsers']['remove'](_0x8f1da2['id']));}['_createUser'](_0x5d029e,_0x3b30fc){const _0x2d2422=this['_users']['addUser'](_0x5d029e);return _0x3b30fc&&this['_users']['defineMe'](_0x5d029e['id']),_0x2d2422['orderNumber']=this['_uniqueUsersCount']++,_0x2d2422;}}class G extends _0x160203{['_domEmitter']=new(_0x46c868())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd72876=this['editor'],_0x4dd1bc=_0xd72876['plugins']['get'](i);_0xd72876['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3b8640,{writer:_0x2c0d46})=>function(_0x4a7a3d,_0x183aa1,_0x289323,_0x14b987){const _0x6f0588=_0x4a7a3d['markerName']['split'](':')[0x2],_0x3a0310=_0x289323['getUserBySessionId'](_0x6f0588);if(!_0x3a0310||_0x6f0588===_0x289323['mySessionId'])return;if(!_0x14b987['model']['schema']['checkChild'](_0x4a7a3d['markerRange']['start'],'$text'))return;const _0x20dbc6={'class':'ck-user__marker\x20'+_0x3a0310['color']['getMarkerClass'](),'data-name':_0x3a0310['name'],'data-session-id':_0x6f0588},_0x16b4e8=_0x14b987['model']['markers']['get'](_0x4a7a3d['markerName']),_0x2a3503=_0x16b4e8['getStart'](),_0x22aff8=_0x2a3503['nodeAfter'],_0x39a07b=_0x14b987['model']['schema'];if(_0x22aff8&&_0x39a07b['isObject'](_0x22aff8)&&_0x39a07b['isInline'](_0x22aff8)&&!_0x14b987['model']['markers']['get']('user:range:'+_0x6f0588)['getRange']()['isCollapsed'])return;const _0x7cf737=_0x2a3503['parent'];return _0x14b987['model']['schema']['isLimit'](_0x7cf737)&&!_0x14b987['model']['hasContent'](_0x7cf737)&&(_0x20dbc6['contenteditable']=!0x1),function(_0x4ea818,_0x204c37,_0x53d3b0){const _0x17d31a=_0x4ea818['createUIElement']('span',_0x204c37);return _0x4ea818['setCustomProperty']('userPositionMarker',!0x0,_0x17d31a),_0x17d31a['render']=function(_0x2e20c0){const _0x3efbdd=this['toDomElement'](_0x2e20c0),_0x479340=document['createElement']('span');return _0x479340['classList']['add']('ck-user__marker-tooltip'),_0x479340['setAttribute']('contenteditable','false'),_0x479340['setAttribute']('spellcheck','false'),_0x479340['textContent']=_0x53d3b0['name'],_0x3efbdd['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x479340['outerHTML']+'⁠',_0x3efbdd['addEventListener']('mouseenter',()=>{_0x3efbdd['classList']['add']('ck-user__marker_hovered');}),_0x3efbdd['addEventListener']('mouseleave',()=>{_0x3efbdd['classList']['remove']('ck-user__marker_hovered');}),_0x3efbdd;},_0x17d31a['isSimilar']=function(_0x3a4a8b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3a4a8b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3a4a8b['getAttribute']('data-session-id'));},_0x17d31a;}(_0x183aa1,_0x20dbc6,_0x3a0310);}(_0x3b8640,_0x2c0d46,_0x4dd1bc,_0xd72876)}),_0xd72876['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x7cbacd=>function(_0x41eacf,_0x3d7f78){const _0x365682=_0x41eacf['markerName']['split'](':')[0x2];if(_0x365682===_0x3d7f78['mySessionId'])return null;const _0x1587c1=_0x3d7f78['getUserBySessionId'](_0x365682);if(!_0x1587c1)return{'id':_0x365682,'classes':[]};return{'id':_0x365682,'classes':['ck-user__selection',_0x1587c1['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x365682},'priority':0x7d0+_0x1587c1['orderNumber']};}(_0x7cbacd,_0x4dd1bc)}),function(_0x5b85e3){const _0x4c76b2=_0x5b85e3['model'],_0x522722=new Map(),_0x3839a6=_0x5b85e3['plugins']['get'](i);_0x4c76b2['markers']['on']('update:user:range',(_0x23d038,_0x43ce3b,_0x2ac261,_0x4dce50)=>{if(!_0x4dce50&&_0x522722['get'](_0x43ce3b['name']))return _0x522722['get'](_0x43ce3b['name'])['detach'](),void _0x522722['delete'](_0x43ce3b['name']);const _0x5287a6=_0x43ce3b['name']['split'](':')[0x2];if(_0x5287a6===_0x3839a6['mySessionId'])return;const _0x27ad58='user:position:'+_0x5287a6;_0x4c76b2['markers']['has'](_0x27ad58)&&_0x5b85e3['editing']['reconvertMarker'](_0x27ad58),_0x43ce3b['on']('change:range',(_0x180736,_0x10c221,_0x6a8164)=>{if('$graveyard'!=_0x10c221['root']['rootName']&&'$graveyard'==_0x43ce3b['getRange']()['root']['rootName']&&!_0x522722['has'](_0x43ce3b['name'])){const _0x4f8f6e=_0x4c76b2['schema']['getNearestSelectionRange'](_0x6a8164['deletionPosition']);if(_0x4f8f6e){const _0x42117d=_0x93d8bd['fromRange'](_0x4f8f6e);_0x522722['set'](_0x43ce3b['name'],_0x42117d),_0x42117d['on']('change:range',(_0x47a96b,_0xe578dc,_0x56f10e)=>{if('$graveyard'==_0x42117d['root']['rootName']){const _0x2acecf=_0x4c76b2['schema']['getNearestSelectionRange'](_0x56f10e['deletionPosition']);_0x2acecf?(_0x42117d['start']=_0x2acecf['start'],_0x42117d['end']=_0x2acecf['end']):(_0x522722['delete'](_0x43ce3b['name']),_0x42117d['detach']());}});}}});}),_0x4c76b2['document']['on']('change',()=>{_0x522722['size']>0x0&&_0x4c76b2['enqueueChange']({'isUndoable':!0x1},_0x6090b1=>{for(const [_0x4a4a8a,_0x34c902]of _0x522722)'$graveyard'==_0x4c76b2['markers']['get'](_0x4a4a8a)['getRange']()['root']['rootName']&&(te(_0x4a4a8a['split'](':')[0x2],_0x34c902['toRange'](),_0x4c76b2,_0x6090b1),_0x34c902['detach']());_0x522722['clear']();});});}(_0xd72876),this['_domEmitter']['listenTo'](_0x3deb78['document'],'keydown',(_0x553104,{key:_0x3f79a0})=>{'Escape'===_0x3f79a0&&function(_0x21be04){_0x21be04['editing']['view']['change'](_0x317bdd=>{for(const _0x53b9b4 of _0x21be04['model']['markers']){if(!_0x53b9b4['name']['startsWith']('user:position'))continue;const _0x279684=_0x21be04['editing']['mapper']['markerNameToElements'](_0x53b9b4['name']);if(_0x279684){for(const _0x1318d7 of _0x279684)_0x317bdd['removeClass']('ck-user__marker_hovered',_0x1318d7);}}});}(_0xd72876);},{'useCapture':!0x0});}['afterInit'](){const _0x4c285f=this['editor'],_0x2fa292=_0x4c285f['commands']['get']('undo');_0x2fa292&&_0x4c285f['model']['on']('applyOperation',(_0x5e2ba2,_0x6dfde2)=>{const _0x3945c4=_0x6dfde2[0x0];if(!_0x3945c4['isDocumentOperation'])return;if('marker'!=_0x3945c4['type']||!_0x3945c4['name']['startsWith']('user:'))return;const _0x201577=_0x3945c4['batch'];_0x2fa292['_createdBatches']['has'](_0x201577)&&(_0x3945c4['newRange']=_0x3945c4['oldRange']?_0x4c285f['model']['createRange'](_0x3945c4['oldRange']['start'],_0x3945c4['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x290f5e=this['editor'],_0x3e59ad=_0x290f5e['model']['document'],_0x3f4459=_0x290f5e['plugins']['get'](i);_0x290f5e['model']['enqueueChange']({'isUndoable':!0x1},_0x44f264=>{const _0x547fc4='user:range:'+_0x3f4459['mySessionId'],_0x418940='user:position:'+_0x3f4459['mySessionId'],_0x6d1202=_0x290f5e['model']['markers']['has'](_0x547fc4);_0x290f5e['editing']['view']['hasDomSelection']?te(_0x3f4459['mySessionId'],_0x3e59ad['selection']['getFirstRange'](),_0x290f5e['model'],_0x44f264):_0x6d1202&&(_0x44f264['removeMarker'](_0x547fc4),_0x44f264['removeMarker'](_0x418940));});}}function te(_0x1cdaa9,_0x39e9ab,_0x297912,_0x153187){const _0x520c7d='user:range:'+_0x1cdaa9,_0x1016b2='user:position:'+_0x1cdaa9,_0x11910d=_0x39e9ab['getContainedElement']();let _0x5ede45=_0x39e9ab['start'];if(_0x11910d&&_0x11910d['is']('element','tableCell')){const _0xe53420=function(_0x49bdfe,_0x58574a){for(const _0x507d52 of _0x49bdfe['getPositions']())if(_0x58574a['schema']['checkChild'](_0x507d52,'$text'))return _0x507d52;}(_0x39e9ab,_0x297912);_0xe53420&&(_0x5ede45=_0xe53420,_0x39e9ab=_0x153187['createRange'](_0x5ede45));}const _0x4dbceb=_0x153187['createRange'](_0x5ede45);_0x297912['markers']['has'](_0x520c7d)?(_0x153187['updateMarker'](_0x520c7d,{'range':_0x39e9ab}),_0x153187['updateMarker'](_0x1016b2,{'range':_0x4dbceb})):(_0x153187['addMarker'](_0x520c7d,{'range':_0x39e9ab,'usingOperation':!0x0}),_0x153187['addMarker'](_0x1016b2,{'range':_0x4dbceb,'usingOperation':!0x0}));}function $(_0x4b9f69,_0x52ca78,_0x103e3b){const _0x50109b=_0x4b9f69['t'],t=_0x4b9f69['t'];switch(_0x52ca78){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 _0x50109b({'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'},_0x103e3b);default:return'';}}let Q=0x1;class l extends _0x160203{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x49395a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x52720a,_0x1d7a86,_0x4610c4];}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 _0x3690c8=this['serverHistory']['getOperations']();for(let _0x402626=_0x3690c8['length']-0x1;_0x402626>=0x0;_0x402626--){const _0x4bff16=_0x3690c8[_0x402626];if(!this['_disconnectionOperations']['has'](_0x4bff16))return _0x4bff16['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x19ce88){if(super(_0x19ce88),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x24ea1e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x18bf15('collaboration-missing-channelid',this);const _0x14fed1=_0x19ce88['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x14fed1,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x55c2ea(),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 Z(this['_disconnectionOperations']);}['init'](){const _0x5c7bc9=this['editor'],_0x434c85=_0x5c7bc9['plugins']['get'](_0x1d7a86),_0x3210f1=_0x5c7bc9['plugins']['get'](n);this['listenTo'](_0x434c85,'getOperationAuthor',(_0x4ef6fb,_0x39d5e2)=>{const _0x3dd497=_0x39d5e2[0x0];_0x3dd497['_authorId']&&(_0x4ef6fb['return']=_0x434c85['getUser'](_0x3dd497['_authorId']),_0x4ef6fb['stop']()),null===_0x3dd497['_authorId']&&(_0x4ef6fb['return']=null,_0x4ef6fb['stop']());},{'priority':'high'}),this['listenTo'](_0x5c7bc9['model']['document']['selection'],'change:range',(_0x5dd121,_0x45c520)=>{_0x45c520['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x5c7bc9['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x5c7bc9['model']['on']('applyOperation',(_0xf7eb4,_0x20465c)=>{const _0x4fb07d=_0x20465c[0x0];_0x4fb07d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4fb07d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3210f1,'state',this,'_hasSynchronizationProblem',(_0x16799b,_0x3525d3)=>'connected'===_0x16799b&&!_0x3525d3),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x5c7bc9['disableReadOnlyMode']('rtc-offline'):_0x5c7bc9['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x5c7bc9['disableReadOnlyMode']('rtc-offline'):_0x5c7bc9['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4a0a2e=this['editor']['plugins']['get'](i),_0x5266c1=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4a0a2e['unregister'](this['_channelId']);const _0x1b182d=await this['_service']['reconnect'](_0x5266c1['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1b182d)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2351dd=await this['_service']['getConnectedSessions']();_0x4a0a2e['register'](this['_channelId'],_0x2351dd),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x93d7ec){if(function(_0x2daeb9){return'404'===_0x2daeb9['code'];}(_0x93d7ec)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x13b06f){return'409'===_0x13b06f['code'];}(_0x93d7ec)){const _0x38e8cd=$(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'](_0x38e8cd);}else{if(!(_0x93d7ec instanceof X))throw _0x93d7ec;this['_handleReconnectionError']();}}}}['destroy'](){const _0x14fdf1=this['editor']['plugins']['get'](n),_0x18b233=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x18b233['channelSessions']['has'](this['_channelId'])&&_0x18b233['unregister'](this['_channelId']),_0x14fdf1['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x10eeb6){if(this['sessionId']!==_0x10eeb6['sessionId']&&this['_lastSyncedOperationId']!==_0x10eeb6['lastOperationId'])throw new X();return this['sessionId']=_0x10eeb6['sessionId'],this['_handleServerResponse']([],{..._0x10eeb6,'wereChangesApplied':!0x1,'data':_0x10eeb6['data']},'reconnect');}async['_connectService'](_0x5b3cd9,_0x3f9c4d=!0x1){const {connection:_0x2b2874}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x2b2874,this['_channelId'])['then'](_0x3073cb=>this['_initSessionsHandling'](_0x3073cb))['catch'](_0xc3aa1a=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0xc3aa1a);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5b2729,_0x363177)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x363177);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x18aac1=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5b3cd9);this['_isPendingUpdate']=!0x0;const _0x6d4863=await this['_service']['connect'](_0x2b2874,this['_compressOperations'](_0x5b3cd9),_0x18aac1);if(this['sessionId']=_0x6d4863['sessionId'],_0x3f9c4d){if(!_0x6d4863['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x6d4863['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5b3cd9,_0x6d4863,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x6d4863,_0x5b3cd9);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1cac9f=this['editor']['plugins']['get'](i),_0x4b9819=this['editor']['plugins']['get'](G),_0x3dd5a9=_0x1cac9f['channelSessions']['get'](this['_channelId']);_0x3dd5a9&&_0x3dd5a9['length']>0x1?_0x4b9819['createUserMarkerOperations']():this['listenTo'](_0x1cac9f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1cac9f['channelSessions']['get'](this['_channelId'])['length']&&_0x4b9819['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2924d5,_0x580ba5,_0x74b097,_0xd2ac2b){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x580ba5){const _0x3213e6=this['_decompressOperations'](_0x74b097,_0xd2ac2b);await this['_fetchMissingUsers'](_0x3213e6),this['_handleExternalOperations'](_0x3213e6,_0x580ba5,_0x74b097['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1919c0}=this['editor'];let _0x2d6422;try{_0x2d6422=await this['_service']['getDocumentDetails']();}catch{const _0x34de8b=$(_0x1919c0,'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'](_0x34de8b);}const _0x46d842=_0x2d6422['currentDocumentSession']||_0x2d6422['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x46d842['lastOperationId']){const _0x3825b4=$(_0x1919c0,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x3825b4);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x239975){const _0x1b7b23=this['editor']['plugins']['get'](i);this['listenTo'](_0x1b7b23,'sessionAdd:'+this['_channelId'],(_0x1efd7e,{session:_0x4c0348})=>{if(_0x4c0348['id']===_0x1b7b23['mySessionId']){_0x1efd7e['off']();const _0x2f9142=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x25c7ae=_0x4c0348['permissions'];_0x2f9142&&_0x2f9142['isEnabled']&&(_0x25c7ae=_0x25c7ae['filter'](_0xb0a7f=>'document:write'!==_0xb0a7f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x25c7ae,this['_channelId']);}}),_0x1b7b23['register'](this['_channelId'],_0x239975);}['_initThrowingOnDataSet'](){const _0x246417=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xf452e3)=>{if(!_0xf452e3[_0xf452e3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x18bf15('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x246417['apply'](this['editor']['data'],_0xf452e3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1522c5,[_0x2f35f5])=>{if(this['_document']['version'])throw new _0x18bf15('realtimecollaborationclient-init-document-already-initialized',this);_0x1522c5['stop'](),this['_setPendingAction']();const _0x5243e8=this['editor']['config']['get']('rootsAttributes'),_0x5263b1=this['_getOperationsFromInitData'](_0x2f35f5,_0x5243e8);0x0==_0x5263b1['length']&&_0x5263b1['push'](new _0x4bdc51(0x0)),_0x1522c5['return']=this['_connectService'](_0x5263b1)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x376282=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x376282))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3304c1,[_0x303550,_0x12b928])=>{_0x3304c1['stop']();const _0x474437=this['editor']['model']['document']['getRoot'](_0x303550);if(!this['_knownRootNames']['has'](_0x303550)){const _0x1a8df8=_0x12b928&&_0x12b928['data']?_0x12b928['data']:'',_0x4ae713=_0x12b928&&_0x12b928['attributes']?_0x12b928['attributes']:{};await this['_loadRoot'](_0x303550,_0x1a8df8,_0x4ae713);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x474437['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x474437);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x288d82){const _0x51dc3e=this['editor']['plugins']['get'](_0x1d7a86),{connection:_0x282265}=this['editor']['plugins']['get'](n),_0x2dcf44=new Set();for(const _0x55b0ad of _0x288d82){const _0x37f311=_0x55b0ad['_authorId'];_0x37f311&&!_0x51dc3e['getUser'](_0x37f311)&&_0x2dcf44['add'](_0x37f311);}if(0x0===_0x2dcf44['size'])return;const _0x3574e4=await ct['getMany'](_0x282265,Array['from'](_0x2dcf44));for(const _0x4166e6 of _0x3574e4)_0x51dc3e['getUser'](_0x4166e6['id'])||_0x51dc3e['addUser'](_0x4166e6);}['_getOperationsFromInitData'](_0x3b17be,_0x15e112={}){const _0x11e28a=this['editor']['model'],_0x43fe8d=[];let _0xd451b6=0x0;const _0x540f03='string'==typeof _0x3b17be?{'main':_0x3b17be}:_0x3b17be;for(const _0x4abc66 of Object['keys'](_0x540f03)){if(!this['_document']['roots']['has'](_0x4abc66))throw new _0x18bf15('realtimecollaborationclient-init-non-existent-root',this);const _0x4d188c=this['editor']['data']['parse'](_0x540f03[_0x4abc66]),_0x425beb=this['_document']['getRoot'](_0x4abc66),_0x4ded61=new _0x78ae33(_0x11e28a['createPositionAt'](_0x425beb,0x0),_0x4d188c,_0xd451b6++);_0x43fe8d['push'](_0x4ded61);for(const [_0x1e03d5,_0x25d534]of _0x4d188c['markers']){const _0x2ea999=_0x11e28a['createRange'](_0x11e28a['createPositionFromPath'](_0x425beb,_0x25d534['start']['path']['slice']()),_0x11e28a['createPositionFromPath'](_0x425beb,_0x25d534['end']['path']['slice']())),_0x2cb435=new _0x273597(_0x1e03d5,null,_0x2ea999,_0x11e28a['markers'],!0x0,_0xd451b6++);_0x43fe8d['push'](_0x2cb435);}}if(_0x15e112)for(const [_0x52c2de,_0x115f87]of Object['entries'](_0x15e112)){const _0x20676e=_0x11e28a['document']['getRoot'](_0x52c2de);if(!_0x20676e)throw new _0x18bf15('multi-root-editor-root-attributes-no-root',null);for(const [_0x5e5328,_0x30a16b]of Object['entries'](_0x115f87))if(null!==_0x30a16b){const _0x3de1d9=new _0x487d54(_0x20676e,_0x5e5328,null,_0x30a16b,_0xd451b6++);_0x43fe8d['push'](_0x3de1d9);}}return _0x43fe8d;}async['_loadRoot'](_0x32b2f1,_0x54fd0e,_0x1011eb){this['_getOperationsFromInitData']({[_0x32b2f1]:_0x54fd0e},{[_0x32b2f1]:_0x1011eb})['forEach']((_0x58e422,_0x39d432)=>{_0x58e422['baseVersion']=this['_document']['version']+_0x39d432,_0x58e422['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x58e422);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x360453,_0x5cdb02){let _0x38437a;this['_offset']=_0x360453['offset'];const _0x51fd23=_0x360453['wereChangesApplied']&&!_0x360453['initData'],_0x156d89=_0x51fd23?0x0:_0x360453['data']['baseVersion'];if(_0x5cdb02['forEach'](_0x598ad8=>{_0x598ad8['_isInit']=!0x0,_0x598ad8['createdAt']=_0x360453['sessionCreatedAt'],_0x598ad8['_authorId']=null;}),_0x51fd23)_0x38437a=_0x5cdb02,this['_applyOperationsSet'](_0x38437a,_0x51fd23);else{if(_0x360453['initData']){const _0x31b8ba=this['_getOperationsFromInitData'](_0x360453['initData']);this['_document']['history']['version']=-_0x31b8ba['length'],_0x31b8ba['forEach'](_0x8cf51e=>{_0x8cf51e['baseVersion']-=_0x31b8ba['length'],_0x8cf51e['createdAt']=_0x360453['sessionCreatedAt'],_0x8cf51e['_isInit']=!0x0,_0x8cf51e['_authorId']=null;}),this['_applyOperationsSet'](_0x31b8ba,!0x0),this['serverHistory']['version']=-_0x31b8ba['length']+this['_offset'],this['_updateServerHistory'](_0x31b8ba);}this['_document']['history']['version']=_0x156d89,_0x38437a=this['_decompressOperations'](_0x360453['data'],_0x360453['metadata']),await this['_fetchMissingUsers'](_0x38437a),this['_applyOperationsSet'](_0x38437a,_0x51fd23);}_0x360453['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x38437a,_0x360453['lastOperationId']),this['_lastSyncedOperationId']=_0x360453['lastOperationId']),this['serverHistory']['version']=_0x156d89+this['_offset'],this['_updateServerHistory'](_0x38437a),_0x5cdb02['filter'](_0x2f0f24=>{const _0x476d38=this['_getAffectedRoot'](_0x2f0f24);return _0x476d38&&!this['_knownRootNames']['has'](_0x476d38);})['forEach']((_0x3afff9,_0x4e095f)=>{_0x3afff9['baseVersion']=this['_document']['version']+_0x4e095f,this['_saveOperationInBuffer'](_0x3afff9);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4e0c99,_0x1f1bc7){const _0x5ae4bf=_0x1f1bc7&&_0x1f1bc7['message'];if(_0x5ae4bf&&_0x5ae4bf['startsWith']('realtimecollaborationclient'))throw _0x1f1bc7;const _0x1c4891=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x1c4891['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x18bf15(_0x4e0c99,this['editor'],_0x5ae4bf?{'originalError':_0x5ae4bf}:void 0x0);}['_saveOperationInBuffer'](_0x2fde7e){this['_knownOperations']['has'](_0x2fde7e)||(this['_knownOperations']['add'](_0x2fde7e),this['_bufferedOperations']['push'](_0x2fde7e),this['_pendingAction']||'marker'==_0x2fde7e['type']&&!_0x2fde7e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x447d31=!0x1){!_0x447d31&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1eee18=>{_0x1eee18&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x88abcd=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x248c80){return _0x248c80['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x248c80['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x248c80['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x88abcd)||this['_crash'](_0x88abcd['message'],_0x88abcd);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5ea9bc=>{this['on']('change:_isPendingUpdate',()=>{_0x5ea9bc();});});}async['_sendBufferedOperations'](){const _0x4920e4=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x4920e4['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x256a84=[...this['_bufferedOperations']];for(const _0x2124f8 of _0x256a84)_0x2124f8['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2124f8);const _0x1bab80=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x256a84),_0x32513e=Q++,_0x424c51=this['_compressOperations'](_0x256a84),_0x3033e7=await this['_service']['sendOperations'](_0x424c51,_0x424c51['baseVersion'],_0x1bab80);try{return await this['_handleServerResponse'](_0x256a84,_0x3033e7,_0x32513e);}catch(_0x1a11ed){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1a11ed);}}async['_handleServerResponse'](_0x887b73,_0x195089,_0x40502d){if('error'in _0x195089)throw _0x195089['error'];let _0x848f8a=!0x1;if(_0x195089['wereChangesApplied']){_0x195089['lastOperationId']&&(this['_lastSyncedOperationId']=_0x195089['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2e2824=>!_0x887b73['includes'](_0x2e2824));for(const _0x223c01 of _0x887b73)_0x223c01['createdAt']='lastOperationAcceptedAt'in _0x195089&&_0x195089['lastOperationAcceptedAt']||void 0x0;Y(_0x887b73,_0x195089['version']-_0x887b73['length']),this['_updateServerHistory'](_0x887b73);const _0x458e22=_0x887b73['filter'](_0x2d3f2c=>{if(!_0x2d3f2c['_isInit'])return!0x1;const _0x911215=this['_getAffectedRoot'](_0x2d3f2c);return _0x911215&&!this['_knownRootNames']['has'](_0x911215);});Y(_0x458e22,this['_document']['version']),this['_applyOperationsSet'](_0x458e22),_0x848f8a=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5731c2=this['_decompressOperations'](_0x195089['data'],_0x195089['metadata'])['filter'](_0x576268=>_0x576268['baseVersion']>=this['_lastServerVersion']);_0x5731c2['forEach'](_0x5e2959=>this['_addKnownRoot'](_0x5e2959)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4e9f37=>!_0x4e9f37['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4e9f37))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5731c2),_0x848f8a=this['_handleExternalOperations'](_0x5731c2,_0x195089['version'],_0x195089['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x848f8a?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0xca580e,_0x3d6504,_0x51bd6f){try{const _0xa9b0dd={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x51325e,operationsB:_0xc30488,originalOperations:_0x2f9d32}=_0x234499(_0xca580e,this['_bufferedOperations'],_0xa9b0dd);Y(_0x51325e,this['_document']['version']),Y(_0xc30488,_0x3d6504);for(const _0xccb38c of _0x51325e){const _0xba41e2=_0x2f9d32['get'](_0xccb38c);_0xccb38c['_authorId']=_0xba41e2?_0xba41e2['_authorId']:null;}_0x51bd6f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xca580e,_0x51bd6f),this['_lastSyncedOperationId']=_0x51bd6f),this['_bufferedOperations']=[..._0xc30488],this['_applyOperationsSet'](_0x51325e),this['_updateServerHistory'](_0xca580e);}catch(_0x591749){return console['error'](_0x591749),!0x1;}return!0x0;}['_applyOperationsSet'](_0x364632,_0x109174=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x580c50=>{for(const _0x4e3bb9 of _0x364632)this['_knownOperations']['add'](_0x4e3bb9),this['_addKnownRoot'](_0x4e3bb9),_0x580c50['batch']['addOperation'](_0x4e3bb9),this['editor']['model']['applyOperation'](_0x4e3bb9);});}['_addKnownRoot'](_0x231e29){const _0x2fbb6d=this['_getAffectedRoot'](_0x231e29);_0x2fbb6d&&this['_knownRootNames']['add'](_0x2fbb6d);}['_getAffectedRoot'](_0x3a2e69){let _0x34e8fe,_0x16636e;switch(_0x3a2e69['type']){case'insert':_0x34e8fe=_0x3a2e69['position']['root'];break;case'marker':if(_0x16636e=_0x3a2e69['newRange'],!_0x16636e)return null;_0x34e8fe=_0x16636e['root'];break;case'addRootAttribute':_0x34e8fe=_0x3a2e69['root'];break;case'addRoot':_0x34e8fe=_0x3a2e69['affectedSelectable'];break;case'move':_0x34e8fe=_0x3a2e69['targetPosition']['root'];break;default:return null;}return _0x34e8fe['rootName'];}['_updateServerHistory'](_0x21070c){_0x21070c['forEach'](_0x3b401f=>{const _0x3b53d7=_0x3b401f['clone']();_0x3b53d7['_authorId']=_0x3b401f['_authorId'],_0x3b53d7['_isInit']=!!_0x3b401f['_isInit'],_0x3b53d7['createdAt']=_0x3b401f['createdAt'],_0x3b53d7['baseVersion']+=this['_offset'],_0x3b401f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3b53d7),this['serverHistory']['addOperation'](_0x3b53d7);});}['_handleReconnectionError'](_0x1687f8){const _0x1ce4a0=this['editor']['plugins']['get']('Notification'),_0x2e76ad=this['editor']['locale'];_0x1687f8||(_0x1687f8=$(_0x2e76ad,'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.')),_0x1ce4a0['showWarning'](_0x1687f8,{'title':$(_0x2e76ad,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x52720a)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x52720a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xe75acf){const _0x1de4b3=_0xe75acf['map'](_0x4777c4=>_0x4777c4['toJSON']());return this['_compressor']['compress'](_0x1de4b3);}['_decompressOperations'](_0x2083bf,_0x3311d8){return this['_compressor']['decompress'](_0x2083bf)['map']((_0x52599f,_0x19634c)=>{const _0x2a8bc7='init'==_0x3311d8[_0x19634c]['type'];if('InsertOperation'==_0x52599f['__className']){const _0x1fbdd7=_0x52599f['position']['root'];!this['_document']['getRoot'](_0x1fbdd7)&&(this['_document']['createRoot']('$root',_0x1fbdd7)['_isAttached']=!0x1);}const _0x1d590e=_0x13ad1b['fromJSON'](_0x52599f,this['_document']);return _0x1d590e['wasUndone']=_0x52599f['wasUndone'],_0x1d590e['_isInit']=_0x2a8bc7,_0x1d590e['_authorId']=_0x2a8bc7?null:_0x3311d8[_0x19634c]['userId'],_0x1d590e['_isDisconnection']='cs:removeUser'===_0x3311d8[_0x19634c]['type'],_0x1d590e['createdAt']=_0x3311d8[_0x19634c]['createdAt'],_0x1d590e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3ab3d4=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3ab3d4&&_0x3ab3d4['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x89d104,_0x5ad60f){for(const _0x58834d of _0x89d104)_0x58834d['baseVersion']=_0x5ad60f++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0x36ce36){this['_ignoredOperations']=_0x36ce36,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x430b52){let _0x459bc2=_0x430b52['length'];for(;_0x459bc2--;){const _0x358561=_0x430b52[_0x459bc2];if(!this['_ignoredOperations']['has'](_0x358561)){if(!this['_operationToId']['has'](_0x358561)){const _0x1d1989=_0x3bb5a9()['slice'](0x1,0x12);this['_operationToId']['set'](_0x358561,_0x1d1989);}return this['_operationToId']['get'](_0x358561);}}}['setIdForTheLastOperation'](_0x22ffac,_0x58d64b){if(!_0x58d64b)return;let _0x3078ec=_0x22ffac['length'];for(;_0x3078ec--;){const _0x5dabda=_0x22ffac[_0x3078ec];this['_ignoredOperations']['has'](_0x5dabda)||this['_operationToId']['set'](_0x5dabda,_0x58d64b);}}}class a extends _0x160203{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x4ac1ff{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x9e5482)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x1d7a86];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x368531){super(_0x368531),this['_services']=new Map();}async['init'](){const _0xddb6f8=this['context'],_0x41a735=_0xddb6f8['plugins']['get']('CommentsRepository');if(_0xddb6f8['plugins']['get'](n)['addToReconnectionStack'](this),_0x41a735['adapter']={'addCommentThread':async({channelId:_0x53fae9,threadId:_0x4a33db,comments:_0x40b9f8,resolvedAt:_0x304b3b,resolvedBy:_0x3494eb,context:_0x5624bf,attributes:_0x13175c})=>{const _0x4568ee=await this['_getService'](_0x53fae9)['addCommentThread']({'commentThreadId':_0x4a33db,'comments':_0x40b9f8['map'](_0x1b45bf=>function(_0x11b5e1,_0x536d35,_0x2348e3){return{'commentThreadId':_0x2348e3,'commentId':_0x11b5e1['commentId'],'userId':_0x11b5e1['authorId'],'content':_0x11b5e1['content'],'documentId':_0x536d35,'createdAt':_0x11b5e1['createdAt'],'attributes':_0x11b5e1['attributes']||{}};}(_0x1b45bf,_0x53fae9,_0x4a33db)),'resolvedAt':_0x304b3b,'resolvedBy':_0x3494eb,'context':_0x5624bf,'attributes':_0x13175c})['catch'](at);return{'threadId':_0x4568ee['commentThreadId'],'comments':_0x4568ee['comments']};},'getCommentThread':async({channelId:_0x2cd4bf,threadId:_0x55c464})=>{const _0x23080c=await this['_getService'](_0x2cd4bf)['getCommentThread'](_0x55c464)['catch'](F)['catch'](at);return _0x23080c?_0x23080c['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x23080c]),{'threadId':_0x23080c['commentThreadId'],'comments':_0x23080c['comments']['map'](P),'context':_0x23080c['context'],'resolvedAt':_0x23080c['resolvedAt'],'resolvedBy':_0x23080c['resolvedBy'],'attributes':_0x23080c['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x479b50,threadId:_0x4b7a3f,context:_0x42b33f,unlinkedAt:_0x23fb96,attributes:_0xc98d1f})=>this['_getService'](_0x479b50)['updateCommentThread']({'commentThreadId':_0x4b7a3f,'context':_0x42b33f,'attributes':_0xc98d1f,'unlinkedAt':_0x23fb96})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x3d75f3,threadId:_0x3485d2})=>{const _0x256d04=await this['_getService'](_0x3d75f3)['resolveCommentThread'](_0x3485d2)['catch'](F)['catch'](at);return{'threadId':_0x256d04['commentThreadId'],'resolvedAt':_0x256d04['resolvedAt'],'resolvedBy':_0x256d04['resolvedBy']};},'reopenCommentThread':async({channelId:_0x1dad70,threadId:_0x1b7698})=>this['_getService'](_0x1dad70)['reopenCommentThread'](_0x1b7698)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x23faa6,threadId:_0x657a0})=>this['_getService'](_0x23faa6)['removeCommentThread'](_0x657a0)['catch'](F)['catch'](at),'addComment':({channelId:_0x373179,threadId:_0x2feadb,commentId:_0x480e74,content:_0x4200fd,attributes:_0x1032b6})=>this['_getService'](_0x373179)['addComment'](_0x2feadb,_0x480e74,_0x4200fd,_0x1032b6)['catch'](at),'updateComment':({channelId:_0x31dddb,threadId:_0x56f202,commentId:_0x2b9ac4,content:_0x53a402,attributes:_0x31fa91})=>this['_getService'](_0x31dddb)['updateComment'](_0x56f202,_0x2b9ac4,_0x53a402,_0x31fa91)['catch'](F)['catch'](at),'removeComment':({channelId:_0x1fc4db,threadId:_0x4964ee,commentId:_0x294ad2})=>this['_getService'](_0x1fc4db)['removeComment'](_0x4964ee,_0x294ad2)['catch'](F)['catch'](at)},_0xddb6f8 instanceof _0x11ac81){const _0x4f3585=_0xddb6f8['config']['get']('collaboration.channelId'),_0x32ae0a=_0xddb6f8['plugins']['get'](i);await this['_setUpService'](_0x4f3585);const _0x4dbaed=await this['_services']['get'](_0x4f3585)['getConnectedSessions']();this['listenTo'](_0x32ae0a,'sessionAdd:'+_0x4f3585,(_0x5e03fd,{session:_0x2a5849})=>{_0x2a5849['id']===_0x32ae0a['mySessionId']&&(_0x5e03fd['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2a5849['permissions'],_0x4f3585));}),_0x32ae0a['register'](_0x4f3585,_0x4dbaed);}}async['_setUpService'](_0x205f8b){if(this['_services']['has'](_0x205f8b))throw new _0x18bf15('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x205f8b});const _0x1cdfb7=this['context']['plugins']['get']('CommentsRepository'),_0x53297a=new s['CommentsService'](_0x205f8b);this['_services']['set'](_0x205f8b,_0x53297a),this['listenTo'](_0x53297a,'commentThreadAdded',(_0x5c6f78,_0x5937e5)=>{const {commentThreadId:_0xfb81b5,documentId:_0x54eeef,context:_0x2f80b8,attributes:_0x98e2eb,resolvedAt:_0x1502e4,resolvedBy:_0x308f9a,comments:_0x3c20c2}=_0x5937e5;_0x1cdfb7['getCommentThread'](_0xfb81b5)||_0x1cdfb7['addCommentThread']({'threadId':_0xfb81b5,'channelId':_0x54eeef,'comments':_0x3c20c2?_0x3c20c2['map'](P):[],'context':_0x2f80b8,'attributes':_0x98e2eb,'resolvedAt':_0x1502e4,'resolvedBy':_0x308f9a,'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadUpdated',(_0x292db3,{commentThreadId:_0x3a7dae,documentId:_0x370c29,context:_0x10832c,unlinkedAt:_0x5584e1,attributes:_0x2fd99d})=>{_0x1cdfb7['getCommentThread'](_0x3a7dae)&&_0x1cdfb7['updateCommentThread']({'threadId':_0x3a7dae,'channelId':_0x370c29,'context':_0x10832c,'unlinkedAt':_0x5584e1,'attributes':_0x2fd99d,'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadResolved',(_0x549ff7,{commentThreadId:_0x49a9a3,resolvedBy:_0x360c08,resolvedAt:_0x1af1f0})=>{const _0x14981f=_0x1cdfb7['getCommentThread'](_0x49a9a3);_0x14981f&&_0x14981f['resolve']({'resolvedBy':_0x360c08,'resolvedAt':_0x1af1f0,'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadReopened',(_0x78b655,{commentThreadId:_0x90f482})=>{const _0x2b19c5=_0x1cdfb7['getCommentThread'](_0x90f482);_0x2b19c5&&_0x2b19c5['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadRemoved',(_0x425b63,{commentThreadId:_0x205f39})=>{const _0x555f69=_0x1cdfb7['getCommentThread'](_0x205f39);_0x555f69&&_0x555f69['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentAdded',(_0x2a8436,_0x1a2f31)=>{const _0x4d5d76=_0x1a2f31['commentThreadId'],_0x1a6e5f=_0x1cdfb7['getCommentThread'](_0x4d5d76);_0x1a6e5f&&_0x1a6e5f['addComment']({...P(_0x1a2f31),'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentUpdated',(_0x20e17c,{commentThreadId:_0x620413,commentId:_0x39dc7e,content:_0x1e9323,attributes:_0x271246})=>{const _0x1c0c15=_0x1cdfb7['getCommentThread'](_0x620413);if(_0x1c0c15){const _0x3b9943=_0x1c0c15['getComment'](_0x39dc7e);_0x3b9943&&_0x3b9943['update']({'content':_0x1e9323,'attributes':_0x271246,'isFromAdapter':!0x0});}}),this['listenTo'](_0x53297a,'commentRemoved',(_0x2a899a,{commentThreadId:_0x5b35f4,commentId:_0x5993f9})=>{const _0x11b3ae=_0x1cdfb7['getCommentThread'](_0x5b35f4);if(_0x11b3ae){const _0x12fafa=_0x11b3ae['getComment'](_0x5993f9);_0x12fafa&&_0x12fafa['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x205f8b);}['destroy'](){if(this['context']instanceof _0x11ac81){const _0x4a2a37=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4a2a37);}}['_terminateService'](_0x4e23b9){if(!this['_services']['has'](_0x4e23b9))throw new _0x18bf15('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4e23b9});this['_getService'](_0x4e23b9)['disconnect'](),this['_services']['delete'](_0x4e23b9);}async['reconnect'](){for(const _0x166cb0 of this['_services']['keys']())await this['_connectService'](_0x166cb0);if(this['context']instanceof _0x11ac81){const _0x3d8557=this['context']['config']['get']('collaboration.channelId'),_0x4c62a0=this['context']['plugins']['get'](i);_0x4c62a0['unregister'](_0x3d8557);const _0x4d69a0=await this['_services']['get'](_0x3d8557)['getConnectedSessions']();_0x4c62a0['register'](_0x3d8557,_0x4d69a0);}}async['_connectService'](_0x2afa0b){const {connection:_0x1c0b63}=this['context']['plugins']['get'](n),_0x3e30c3=this['context']['plugins']['get']('CommentsRepository'),_0x3478d3=this['_services']['get'](_0x2afa0b),_0x4073b1=await _0x3478d3['connect'](_0x1c0b63);await this['_fetchMissingUsersForThreads'](_0x4073b1);const _0x5bc8d3=new Set(Array['from'](_0x3e30c3['getCommentThreads']({'channelId':_0x2afa0b}),_0x2d5481=>_0x2d5481['id']));for(const _0x25b6ce of _0x4073b1)_0x25b6ce['deletedAt']||_0x5bc8d3['delete'](_0x25b6ce['commentThreadId']);for(const _0x2de1b7 of _0x5bc8d3)_0x3e30c3['getCommentThread'](_0x2de1b7)['remove']({'isFromAdapter':!0x0});for(const _0x63d6bb of _0x4073b1){let _0x55e5f2=_0x3e30c3['getCommentThread'](_0x63d6bb['commentThreadId']);const {commentThreadId:_0x5a8ea5,context:_0x542b00,attributes:_0x4715ff,resolvedBy:_0x36fbd1,resolvedAt:_0x367fb6,unlinkedAt:_0x3ced01,deletedAt:_0x537eb1}=_0x63d6bb;if(_0x537eb1)continue;_0x55e5f2||(_0x55e5f2=_0x3e30c3['addCommentThread']({'channelId':_0x2afa0b,'threadId':_0x5a8ea5,'context':_0x542b00,'attributes':_0x4715ff||{},'resolvedBy':_0x36fbd1,'resolvedAt':_0x367fb6,'unlinkedAt':_0x3ced01,'isFromAdapter':!0x0}));const _0x551d73=new Set(Array['from'](_0x55e5f2['comments'],_0xb497c4=>_0xb497c4['id']));for(const _0xbf273e of _0x63d6bb['comments'])_0x551d73['delete'](_0xbf273e['commentId']);for(const _0x40038c of _0x551d73)_0x55e5f2['getComment'](_0x40038c)['remove']({'isFromAdapter':!0x0});for(const _0x57418a of _0x63d6bb['comments']){const _0x5679c6=_0x55e5f2['getComment'](_0x57418a['commentId']);_0x5679c6?_0x5679c6['content']!==_0x57418a['content']&&_0x5679c6['update']({'content':_0x57418a['content'],'isFromAdapter':!0x0}):_0x55e5f2['addComment'](Object['assign'](P(_0x57418a),{'isFromAdapter':!0x0}));}}}['_getService'](_0x2f455a){if(!this['_services']['has'](_0x2f455a))throw new _0x18bf15('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2f455a});return this['_services']['get'](_0x2f455a);}async['_fetchMissingUsersForThreads'](_0x36fa9c){const _0x236d07=this['context']['plugins']['get'](_0x1d7a86),{connection:_0x2db4d9}=this['context']['plugins']['get'](n),_0x19ad62=new Set();for(const {resolvedBy:_0x4a903e,comments:_0x4b5e66}of _0x36fa9c){_0x4a903e&&!_0x236d07['getUser'](_0x4a903e)&&_0x19ad62['add'](_0x4a903e);for(const {userId:_0x3c38ef}of _0x4b5e66)_0x236d07['getUser'](_0x3c38ef)||_0x19ad62['add'](_0x3c38ef);}if(0x0===_0x19ad62['size'])return;const _0x25f5fc=await ct['getMany'](_0x2db4d9,Array['from'](_0x19ad62));for(const _0x49be0e of _0x25f5fc)_0x236d07['getUser'](_0x49be0e['id'])||_0x236d07['addUser'](_0x49be0e);}}async function F(_0x4514dd){if('404'!==_0x4514dd['code'])throw _0x4514dd;}function at(_0x375dbf){if((_0x2e2757=_0x375dbf)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2e2757['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2e2757['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2e2757;throw _0x375dbf;}function P(_0xea7029){return{'threadId':_0xea7029['commentThreadId'],'commentId':_0xea7029['commentId'],'content':_0xea7029['content'],'createdAt':_0xea7029['createdAt'],'authorId':_0xea7029['userId'],'attributes':_0xea7029['attributes']||{}};}class m extends _0x160203{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55da34){super(_0x55da34);const _0x56b955=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x56b955);}['init'](){const _0x5a82cc=this['editor']['plugins']['get'](n),_0x4ca0b1=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4ca0b1['adapter']={'getSuggestion':async _0x33519c=>{await this['_waitForServiceReady']();const _0x53c664=await this['_trackChangesService']['get'](_0x33519c)['catch'](B);return await this['_fetchMissingUsersForThreads']([_0x53c664]),_0x53c664;},'addSuggestion':async({id:_0x4f064c,type:_0x70e1a4,data:_0x29248f,originalSuggestionId:_0x1005fe,attributes:_0x1ea3ad})=>{await this['_waitForServiceReady']();const _0x5b59ef={'id':_0x4f064c,'type':_0x70e1a4,'data':_0x29248f,'originalSuggestionId':_0x1005fe,'attributes':_0x1ea3ad},_0x1bb2f4=await this['_trackChangesService']['add'](_0x4f064c,_0x70e1a4,_0x29248f,_0x1005fe,_0x1ea3ad)['catch'](_0x446cc6=>{if(ht(_0x446cc6))return new Promise(_0x546ee2=>{this['_bufferedRequests']['set'](_0x4f064c,{'resolve':_0x546ee2,'suggestionData':_0x5b59ef});});throw _0x446cc6;});return this['_bufferedRequests']['delete'](_0x4f064c),_0x1bb2f4;},'updateSuggestion':async(_0x1e5e53,_0x4b7581)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4b7581['state'])return this['_trackChangesService']['update'](_0x1e5e53,_0x4b7581)['catch'](B);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x349711,_0xd8b5be)=>{_0x4ca0b1['hasSuggestion'](_0xd8b5be['id'])&&(_0x4ca0b1['getSuggestion'](_0xd8b5be['id'])['attributes']=_0xd8b5be['attributes']);}),this['_trackChangesService']['connect'](_0x5a82cc['connection'])['then'](_0x35eb3d=>(_0x5a82cc['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x35eb3d)['then'](()=>{for(const _0x2be3eb of _0x35eb3d){_0x4ca0b1['addSuggestionData'](_0x2be3eb)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1e10cc=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1f191e}=this['editor']['plugins']['get'](n),_0x5758fc=await this['_trackChangesService']['connect'](_0x1f191e);await this['_fetchMissingUsersForThreads'](_0x5758fc);for(const {suggestionData:_0x26f9f8,resolve:_0x2a8043}of this['_bufferedRequests']['values']()){let _0x40179f=_0x5758fc['find'](_0x8112dc=>_0x8112dc['id']===_0x26f9f8['id']);_0x40179f||(_0x40179f=await this['_trackChangesService']['add'](_0x26f9f8['id'],_0x26f9f8['type'],_0x26f9f8['data'],_0x26f9f8['originalSuggestionId'])),_0x2a8043(_0x40179f);}for(const _0x2f47a1 of _0x5758fc)_0x1e10cc['hasSuggestion'](_0x2f47a1['id'])||_0x1e10cc['addSuggestionData'](_0x2f47a1);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x4285ac=>{this['listenTo'](this['_trackChangesService'],'connected',_0xde4e0b=>{_0xde4e0b['off'](),_0x4285ac();});});}async['_fetchMissingUsersForThreads'](_0x3c3350){const _0x39159f=this['editor']['plugins']['get'](_0x1d7a86),{connection:_0x3f3b52}=this['editor']['plugins']['get'](n),_0x506389=new Set();for(const {authorId:_0x219af7}of _0x3c3350)_0x39159f['getUser'](_0x219af7)||_0x506389['add'](_0x219af7);if(0x0===_0x506389['size'])return;const _0x3e4ab5=await ct['getMany'](_0x3f3b52,Array['from'](_0x506389));for(const _0x2a7c52 of _0x3e4ab5)_0x39159f['getUser'](_0x2a7c52['id'])||_0x39159f['addUser'](_0x2a7c52);}}function B(_0x49f3c2){if(ht(_0x49f3c2))return new Promise(()=>{});throw _0x49f3c2;}function ht(_0x19fd9a){return _0x19fd9a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x19fd9a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x160203{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x520732=this['editor']['plugins']['get'](n),_0x6c3f60=this['editor']['plugins']['get']('CommentsEditing'),_0x54288a=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x520732,'change:state',(_0x592cb5,_0x11fd84,_0x17359f)=>{_0x6c3f60['isThreadsLoadingPaused']='connected'!==_0x17359f;});}),this['listenTo'](_0x520732,'change:state',(_0x3aa03e,_0x2ef1f4,_0x26f2a6)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x26f2a6);}),_0x54288a['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x160203{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x160203{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x31a884)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x1d7a86];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x289f27){super(_0x289f27);const _0x576b76=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x576b76);}async['init'](){const _0x5cb238=this['editor']['plugins']['get'](l),_0x3af6aa=_0x5cb238['serverHistory'],_0x4860b2=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x3af6aa,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5cb238['sessionId']});const _0x2a5a41=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0xd6c89e=await _0x431abb['isBundleUploaded'](_0x4860b2['connection'],_0x2a5a41);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3670d2})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3670d2)),'updateRevisions':async _0x236283=>{await this['_waitForServiceReady']();const _0x644b31=this['_revisionTracker']['currentRevision'];if(_0xd6c89e&&0x1===_0x236283['length']&&_0x236283[0x0]['id']===_0x644b31['id'])return _0x236283;for(const _0x4fe53b of _0x236283)_0x4fe53b['id']===_0x644b31['id']&&(_0x4fe53b['isEmptyCurrent']=_0x4fe53b['fromVersion']===_0x4fe53b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x236283,this['_lastRequestId'])['then'](_0xa1b26a=>(this['_lastRequestId']=_0xa1b26a,_0x236283))['catch'](_0x27ed5a=>{if(I(_0x27ed5a)||'400'===_0x27ed5a['code']&&void 0x0!==_0x27ed5a['data']['wrongRequestId']){for(const _0x238de4 of _0x236283){!this['_revisionTracker']['repository']['getRevision'](_0x238de4['id'])||this['_revisionTracker']['_bufferUpdate'](_0x238de4['id'],_0x238de4,!0x1);}if(I(_0x27ed5a))throw _0x27ed5a;return _0x236283;}throw _0x27ed5a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4146f0,{revisionsData:_0x2243d0,requestId:_0x21bd5b})=>{Math['max'](..._0x2243d0['map'](_0x2da9d8=>_0x2da9d8['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2243d0,_0x21bd5b);}):this['_handleRevisionsUpdate'](_0x2243d0,_0x21bd5b);});const {revisions:_0x3bd3a5,requestId:_0x2dd973}=await this['_revisionHistoryService']['connect'](_0x4860b2['connection']);_0x4860b2['addToReconnectionStack'](this),this['_lastRequestId']=_0x2dd973,await this['_fetchMissingUsers'](_0x3bd3a5);for(const _0x3ce85b of _0x3bd3a5)this['_revisionTracker']['addRevisionData'](_0x3ce85b);this['listenTo'](_0x5cb238,'change:_isConnected',(_0x5cb7da,_0x3993e8,_0xe65e6a)=>{_0xe65e6a&&(this['_oldOffset']=_0x5cb238['_offset'],_0x5cb7da['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4860b2,'state',_0x5e57f0=>_0x5e57f0===_0x46f1ff['CONNECTED']);}async['reconnect'](){const _0x5ce044=this['editor']['plugins']['get'](n),_0x45cb89=this['editor']['plugins']['get'](l),_0x56bc6a=async()=>{const _0x27a5bb=this['_revisionTracker']['currentRevision'],_0x188c9b=_0x27a5bb['id'],_0xe46d23=_0x188c9b!==_0x45cb89['sessionId'];if(_0xe46d23){const _0x8893f4=_0x45cb89['_offset']-this['_oldOffset'],_0x147de3=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x27a5bb['toVersion']+_0x8893f4!==_0x147de3){const _0x2ef377=_0x27a5bb['fromVersion']+_0x8893f4,_0x23ed7c=this['editor']['plugins']['get'](_0x1d7a86),_0x135e09=this['_revisionTracker']['buildRevisionData']({'revision':_0x27a5bb,'from':_0x2ef377,'to':_0x147de3});_0x135e09['id']=_0x27a5bb['id'];const _0x5389af=_0x135e09['authorsIds']['map'](_0x237a79=>_0x23ed7c['getUser'](_0x237a79));_0x27a5bb['_update']({..._0x135e09,'authors':_0x5389af},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x27a5bb['id'],_0x135e09,!0x0);}this['_revisionTracker']['_startingVersion']=_0x147de3,(_0x27a5bb['toVersion']===_0x27a5bb['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x188c9b)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x188c9b),this['_revisionTracker']['_createCurrentRevision'](_0x147de3));}const {revisions:_0x318ea2,requestId:_0xe4cad1}=await this['_revisionHistoryService']['reconnect'](_0x5ce044['connection'],this['_lastRequestId']);_0xe46d23&&_0x318ea2['length']>0x0?_0x45cb89['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x318ea2),this['_handleRevisionsUpdate'](_0x318ea2,_0xe4cad1),this['_revisionTracker']['sendBufferedUpdates']());};return _0x45cb89['_isConnected']?_0x56bc6a():new Promise((_0x39077b,_0x5418fd)=>{_0x45cb89['once']('change:_isConnected',()=>{_0x56bc6a()['then'](_0x39077b)['catch'](_0x5418fd);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3d335d=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x49d6a9=>{_0x49d6a9['off'](),_0x3d335d();});});}['_getLatestVersionFromServerOperations'](){const _0x161d6c=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2fa19d of _0x161d6c)if('marker'!==_0x2fa19d['type']||_0x2fa19d['affectsData'])return _0x2fa19d['baseVersion']+0x1;}['_getLatestVersion'](){const _0x54d880=this['editor']['plugins']['get'](l);return new Promise(_0x2fa020=>{_0x54d880['_isPendingUpdate']?_0x54d880['once']('change:_isPendingUpdate',()=>{_0x2fa020(this['_getLatestVersionFromServerOperations']());}):_0x2fa020(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5758ac,_0x57a11e){const _0x278b66=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x57a11e;for(const _0x4ea32e of _0x5758ac){const _0x25707c=_0x278b66['getRevision'](_0x4ea32e['id']);if(_0x25707c){if((_0x4ea32e['fromVersion']||_0x4ea32e['toVersion'])&&(_0x4ea32e['diffData']=null),_0x25707c===this['_revisionTracker']['currentRevision']){const _0x31ab34=Math['max'](_0x25707c['toVersion'],_0x4ea32e['toVersion']),_0x39012b=Math['max'](_0x25707c['fromVersion'],_0x4ea32e['fromVersion']);let _0x2cdc4e;_0x25707c['toVersion']===_0x4ea32e['toVersion']&&_0x25707c['fromVersion']===_0x4ea32e['fromVersion']?(_0x2cdc4e=!0x0,this['_preventResendingRevisionData'](_0x4ea32e)):_0x4ea32e['toVersion']===_0x31ab34&&_0x4ea32e['fromVersion']===_0x39012b?_0x2cdc4e=!0x1:(_0x25707c['toVersion']===_0x31ab34&&_0x25707c['fromVersion']===_0x39012b||this['_fixRevision']({'revision':_0x25707c,'from':_0x39012b,'to':_0x31ab34}),_0x2cdc4e=!0x0),_0x2cdc4e&&(delete _0x4ea32e['fromVersion'],delete _0x4ea32e['toVersion'],delete _0x4ea32e['diffData'],delete _0x4ea32e['createdAt'],delete _0x4ea32e['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4ea32e),this['_preventResendingRevisionData'](_0x4ea32e);}else this['_revisionTracker']['addRevisionData'](_0x4ea32e);}const _0x401a4b=_0x278b66['getRevisions']();_0x401a4b['reverse']();for(let _0x1fdc89=0x0;_0x1fdc89<_0x401a4b['length']-0x1;_0x1fdc89++){const _0x2dc837=_0x401a4b[_0x1fdc89],_0x2c8bac=_0x401a4b[_0x1fdc89+0x1];if(_0x2dc837['fromVersion']<_0x2c8bac['toVersion']){const _0x5e5fde=_0x2c8bac['toVersion'],_0x592514=Math['max'](_0x5e5fde,_0x2dc837['toVersion']);this['_fixRevision']({'revision':_0x2dc837,'from':_0x5e5fde,'to':_0x592514});}}}['_fixRevision']({revision:_0x924ff,from:_0x22ece5,to:_0x3a935d}={}){const _0x113637=this['editor']['plugins']['get'](_0x1d7a86),_0x4897e8=this['_revisionTracker']['buildRevisionData']({'revision':_0x924ff,'from':_0x22ece5,'to':_0x3a935d});_0x4897e8['authors']=_0x4897e8['authorsIds']['map'](_0x2007ec=>_0x113637['getUser'](_0x2007ec)),_0x924ff['_update'](_0x4897e8);}['_preventResendingRevisionData'](_0x120b3b){const _0x1f18c6={};_0x1f18c6['id']=_0x120b3b['id'];for(const _0x300680 of Object['keys'](_0x120b3b))'id'!==_0x300680&&(_0x1f18c6[_0x300680]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1f18c6['id'],_0x1f18c6,!0x0);}async['_fetchMissingUsers'](_0x34a1aa){const _0x36080f=this['editor']['plugins']['get'](_0x1d7a86),{connection:_0x12f1f6}=this['editor']['plugins']['get'](n),_0x168155=new Set();for(const _0x301d36 of _0x34a1aa){for(const _0x14f2bf of _0x301d36['authorsIds'])_0x5cf8ac(_0x14f2bf);_0x301d36['creatorId']&&_0x5cf8ac(_0x301d36['creatorId']);}if(0x0===_0x168155['size'])return;const _0xa431d=await ct['getMany'](_0x12f1f6,Array['from'](_0x168155));for(const _0x239919 of _0xa431d)_0x36080f['getUser'](_0x239919['id'])||_0x36080f['addUser'](_0x239919);function _0x5cf8ac(_0x4318de){_0x36080f['getUser'](_0x4318de)||_0x168155['add'](_0x4318de);}}}function I(_0x37510f){return _0x37510f['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x37510f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x37510f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x160203{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x56bb97{['_collapseAt'];constructor(_0x592a71,_0x1f841f=0x6){super(_0x592a71);const _0x3a8006=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1f841f,this['bind']('isHidden')['to'](this,'usersCount',_0x548009=>_0x548009<_0x1f841f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3a8006['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x3a8006['to']('usersCount',_0x38c5f9=>'+'+(_0x38c5f9-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x56bb97{['items'];['keystrokes'];constructor(_0x485b7b){super(_0x485b7b);const _0x44d419=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x13a22f(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x44d419['if']('hasPopup'),'aria-expanded':_0x44d419['to']('isExpanded',_0x351616=>this['hasPopup']&&String(_0x351616)),'aria-label':_0x44d419['to']('hasPopup',_0x3a9114=>$(_0x485b7b,_0x3a9114?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x44d419['to']('hasPopup',_0x2afd30=>!!_0x2afd30&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x44d419['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x44d419['to'](_0x31bd80=>{const _0x1e7ff7=_0x31bd80,_0x4672e9=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4d8e30=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4672e9?.['contains'](_0x1e7ff7['relatedTarget'])||_0x4d8e30?.['contains'](_0x1e7ff7['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x5db902,_0x516904,_0x3e72fd)=>{this['element']&&(_0x3e72fd?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 v extends _0x56bb97{['counterView'];['inlineListView'];constructor(_0x18fa03,_0x4355c4=0x6){super(_0x18fa03);const _0x593e12=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x4355c4),this['inlineListView']=new is(_0x18fa03),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2ffc71 of this['inlineListView']['items'])_0x2ffc71['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',_0x593e12['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x56bb97{['listWrapperView'];constructor(_0x476b02,_0x5a39cd){super(_0x476b02);const _0x2e88ec=this['bindTemplate'];this['listWrapperView']=new ut(_0x476b02,_0x5a39cd),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x476b02,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x2e88ec['to'](_0x3f344d=>{const _0x4b24a9=_0x3f344d,_0x386b35=document['querySelector']('.ck-presence-list__list'),_0x3e406a=document['querySelector']('.ck-balloon-panel_with-arrow');_0x386b35?.['contains'](_0x4b24a9['relatedTarget'])||_0x3e406a?.['contains'](_0x4b24a9['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x3c678d{constructor(_0x548fd8,_0x785841){super(_0x548fd8);const _0x3bda3c=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x785841?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3bda3c['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3bda3c['to']('role'),'aria-label':_0x3bda3c['to']('ariaLabel'),'aria-labelledby':_0x3bda3c['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3deb78['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5b850f=this['element'];_0x5b850f&&(this['_isScrollable']=Math['max'](_0x5b850f['scrollHeight'],_0x5b850f['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0xcec225,_0x434c5f,_0xd67785){super(_0xcec225);const _0x21da83=this['bindTemplate'];this['userView']=new st(_0xcec225,_0x434c5f);const _0x48ce7d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x434c5f['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x434c5f['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x434c5f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xd67785&&(_0x48ce7d['tag']='button',_0x48ce7d['on']={'click':_0x21da83['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x48ce7d);}['focus'](){this['element']['focus']();}}class A extends _0x56bb97{['userView'];['markerView'];constructor(_0x54f6fb,_0x4f7ad3,_0xafc729){super(_0x54f6fb);const _0x104001=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x54f6fb,_0x4f7ad3),this['markerView']=new ot(_0x54f6fb,_0x4f7ad3);const _0x54fc95=new it(_0x54f6fb);_0x54fc95['template']['tag']='span',_0x54fc95['text']=_0x4f7ad3['name'];const _0x25b5fe={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x104001['to']('isFocusable',_0x1315ef=>!!_0x1315ef&&0x0),'aria-labelledby':_0x54fc95['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x104001['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x104001['to']('hasTooltip',_0x1fc5a6=>!_0x1fc5a6),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x54fc95]};_0xafc729&&(_0x25b5fe['tag']='button',_0x25b5fe['on']={'click':_0x104001['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x25b5fe);}}class ot extends _0x56bb97{constructor(_0x5ac035,_0x4e1223){super(_0x5ac035),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4e1223['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x4ac1ff{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30241b){super(_0x30241b),this['context']['config']['define']('presenceList',x);const _0x3e7b51=_0x30241b['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3e7b51)throw new _0x18bf15('presencelist-collapseat-invalid-format',this);if(_0x3e7b51<0x1)throw new _0x18bf15('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x410c43(),this['balloonPanelView']=new _0x398ac4(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x20b052 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x20b052);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4a61ae,_0x3bbacd)=>{this['_handleUserAdd'](_0x3bbacd);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x14eb2d,_0x433cdc)=>{this['_handleUserRemove'](_0x433cdc);});}['_createView'](){const _0x287900=this['context'],_0x8031a2=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x11959d=this['balloonPanelView'];if(!_0x339925(_0x287900['config']['get']('presenceList.container')))throw new _0x18bf15('presencelist-missing-container',this);return _0x8031a2['counterView']['bind']('usersCount')['to'](this),_0x8031a2['bind']('isCollapsed')['to'](this,'usersCount',_0x3b9b79=>{const {collapseAt:_0x17ba23}=_0x287900['config']['get']('presenceList'),_0x1dd233=_0x3b9b79>=_0x17ba23;if(_0x1dd233&&!_0x8031a2['inlineListView']['items']['find'](_0xc06b22=>_0xc06b22 instanceof b)){const _0x9040b2=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x9040b2&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x8031a2['inlineListView']['items']['add'](_0x8031a2['counterView']);}return _0x1dd233||this['hideDropdown'](),_0x1dd233;}),_0x8031a2['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x43b174=>{const _0x4fef71=_0x287900['config']['get']('presenceList'),_0x2e6554=new A(_0x287900['locale'],_0x43b174,!!_0x4fef71['onClick']);return _0x2e6554['bind']('hasTooltip')['to'](_0x8031a2,'isCollapsed',_0x467362=>!_0x467362),_0x2e6554['bind']('isFocusable')['to'](_0x8031a2,'isCollapsed',_0x1abb37=>!_0x1abb37),_0x4fef71['onClick']&&this['listenTo'](_0x2e6554,'execute',()=>{this['view']['isCollapsed']||_0x4fef71['onClick'](_0x43b174,_0x2e6554['element']);}),_0x2e6554;}),this['listenTo'](_0x8031a2['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x8031a2['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x8031a2['inlineListView']['keystrokes']['set']('Enter',(_0x2525f2,_0x2737b3)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2737b3());}),_0x8031a2['render'](),_0x11959d['render'](),_0x196e8e({'emitter':_0x8031a2,'activator':()=>_0x11959d['isVisible'],'contextElements':[_0x11959d['element'],_0x8031a2['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x287900['config']['get']('presenceList.container')['appendChild'](_0x8031a2['element']),this['_bodyCollection']=new _0x5280fe(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x8031a2;}['_handleUserAdd'](_0x393cff){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x393cff['isMe'])return;const _0x1ae168=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x1ae168-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x90d4ef=_0x393cff['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x393cff,_0x90d4ef);}['_handleUserRemove'](_0x50b988){this['usersCount']--;const {collapseAt:_0x19961a}=this['context']['config']['get']('presenceList'),_0x1f83e9=this['usersCount']>=_0x19961a;if(this['currentDisplayedUsers']['get'](_0x50b988['id']))this['currentDisplayedUsers']['remove'](_0x50b988['id']);else{if(_0x1f83e9&&this['currentDisplayedUsers']['length']+0x1===_0x19961a-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1f83e9?0x1:0x0)<this['usersCount']){for(const _0x5a313f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5a313f['id'])&&(this['currentDisplayedUsers']['add'](_0x5a313f,Math['min'](this['currentDisplayedUsers']['length']-(_0x1f83e9?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1f83e9?0x1:0x0)===_0x19961a-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x23e952=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x23e952['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x21535c}=this['presenceDropdownView'];_0x21535c['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4e30e9=>{if(!_0x23e952['displayMe']&&_0x4e30e9['isMe'])return null;const _0x23d1d5=new j(this['context']['locale'],_0x4e30e9,!!_0x23e952['onClick']);return _0x23e952['onClick']&&this['listenTo'](_0x23d1d5,'execute',()=>{_0x23e952['onClick'](_0x4e30e9,_0x23d1d5['element']);}),_0x23d1d5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x21535c['focus'](),_0x21535c['checkIfScrollable']();const _0x27e5c9=(_0x3093ec,_0x48fc2d)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x48fc2d();};_0x21535c['keystrokes']['set']('Esc',_0x27e5c9),_0x21535c['keystrokes']['set']('Shift+Tab',_0x27e5c9),_0x21535c['keystrokes']['set']('Tab',(_0x3d1b29,_0x1cc033)=>{!function(_0x30ce00){const _0x178c8d=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x186113=>_0x186113+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x604663=[...document['body']['querySelectorAll'](_0x178c8d)]['filter'](_0x4a5aa8=>_0x4a5aa8===document['activeElement']||_0x4a5aa8['offsetWidth']+_0x4a5aa8['offsetHeight']>0x0)['sort']((_0x3cf6c8,_0x38c42c)=>(_0x3cf6c8['tabIndex']||0x0)-(_0x38c42c['tabIndex']||0x0)),_0x5b6b1d=_0x604663['indexOf'](_0x30ce00),_0x4c8392=_0x604663[(_0x5b6b1d+0x1)%_0x604663['length']];_0x4c8392&&_0x4c8392['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1cc033();}),_0x21535c['focusTracker']['add'](this['view']['element']),_0x21535c['focusTracker']['on']('change:isFocused',(_0x3eb92b,_0x5dbe0d,_0x59f1af)=>{_0x59f1af||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0x4ac1ff{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x29f1b4,Plugin as _0x2490b2,PendingActions as _0x28f4c3,Context as _0x625951}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x11a01f,CKEditorError as _0x5a1e76,Collection as _0x4487ac,global as _0x5ee5cc,version as nt,uid as _0x431570,KeystrokeHandler as _0x2211c5}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4b11cd,View as _0xa55d2c,ListView as _0x1e16aa,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x4bbc8a,clickOutsideHandler as _0x5b9ca2,BodyCollection as _0x417e44}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x226a09,History as _0x2d298e,NoOperation as _0xe87577,InsertOperation as _0x35919c,MarkerOperation as _0x521527,RootAttributeOperation as _0x138648,transformOperationSets as _0x45fa73,OperationFactory as _0x43bf62}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x32a1bc,User as lt,CommentsService as _0x50e3a7,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x25284e,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1744e1}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x548adc}from'es-toolkit/compat';class n extends _0x29f1b4{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4b11cd];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x160405){super(_0x160405),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x11a01f())();}['init'](){const _0x2b4d1d=this['context'],_0x36bea9=_0x2b4d1d['plugins']['get']('CloudServices'),_0x47c76b=_0x2b4d1d['plugins']['get'](_0x4b11cd);if(!_0x36bea9['token'])throw new _0x5a1e76('websocketgateway-missing-token',this);if(!_0x36bea9['webSocketUrl'])throw new _0x5a1e76('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x36bea9['token'],_0x36bea9['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2aee61=>{if(this['connection']=_0x2aee61,this['bind']('state')['to'](_0x2aee61,'state',this,'_isBrowserOffline',(_0x2e5365,_0x109b7c)=>('connected'!==_0x2e5365&&(this['_shouldPluginsReconnect']=!0x0),_0x109b7c||_0x2e5365!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x2a605f,_0x145a54)=>{if('limitExceeded'!==_0x145a54['code'])throw console['error'](_0x145a54),new _0x5a1e76('cloudservices-init',null,{'originalError':_0x145a54});_0x47c76b['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'});}),!_0x2aee61['me'])return new Promise(_0x3012ba=>_0x2aee61['on']('change:me',_0x3012ba));})['catch'](_0x3f83da=>{throw console['error'](_0x3f83da),new _0x5a1e76('cloudservices-init',null,{'originalError':_0x3f83da});});}['addToReconnectionStack'](_0x307608){if('function'!=typeof _0x307608['reconnect'])throw new _0x5a1e76('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x307608))throw new _0x5a1e76('websocketgateway-plugin-already-registered',this,{'name':_0x307608['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x307608);}['removeFromReconnectionStack'](_0x157b2d){this['_reconnectionStack']['delete'](_0x157b2d);}['isInReconnectionStack'](_0x1d9d8d){return this['_reconnectionStack']['has'](_0x1d9d8d);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x16d16f=>_0x16d16f['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x1bc583=>{throw console['error'](_0x1bc583),new _0x5a1e76('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x29f1b4{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x25284e];}constructor(_0x4087b5){super(_0x4087b5),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4487ac(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x25284e);}['init'](){const _0x5420b1=this['context']['plugins']['get'](n);this['listenTo'](_0x5420b1,'change:state',(_0x3a7e7,_0x36ea51,_0x369b10)=>{if('connected'!==_0x369b10)this['channelSessions']['forEach'](_0x288c19=>_0x288c19['clear']()),this['channelConnectedUsers']['forEach'](_0x495cc9=>_0x495cc9['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3cc513,_0x10c884]of this['_registeredSessions'])for(const _0x33e74d of _0x10c884)this['_handleSessionAdd'](_0x3cc513,_0x33e74d);}}),this['_createUser'](_0x5420b1['connection']['me'],!0x0);}['register'](_0x3ad099,_0x1a5428){if(this['_registeredSessions']['has'](_0x3ad099))throw new _0x5a1e76('sessions-register-already-registered',null,{'channelId':_0x3ad099});this['_registeredSessions']['set'](_0x3ad099,_0x1a5428),this['channelSessions']['set'](_0x3ad099,new _0x4487ac()),this['channelConnectedUsers']['set'](_0x3ad099,new _0x4487ac()),this['listenTo'](_0x1a5428,'add',(_0x58a8ad,_0x1f9320)=>this['_handleSessionAdd'](_0x3ad099,_0x1f9320)),this['listenTo'](_0x1a5428,'remove',(_0x333415,_0x2213e5)=>this['_handleSessionRemove'](_0x3ad099,_0x2213e5));for(const _0x48392a of _0x1a5428)this['_handleSessionAdd'](_0x3ad099,_0x48392a);}['unregister'](_0x1e0b6f){if(!this['_registeredSessions']['has'](_0x1e0b6f))throw new _0x5a1e76('sessions-unregister-not-exist',null,{'channelId':_0x1e0b6f});const _0x43729d=this['_registeredSessions']['get'](_0x1e0b6f);this['stopListening'](_0x43729d);for(const _0x14560c of _0x43729d)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x1e0b6f,_0x14560c);this['_registeredSessions']['delete'](_0x1e0b6f),this['channelSessions']['delete'](_0x1e0b6f),this['channelConnectedUsers']['delete'](_0x1e0b6f);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x5e9775){for(const _0x31081a of this['channelSessions']['values']())for(const _0x411417 of _0x31081a)if(_0x411417['id']===_0x5e9775)return _0x411417['user'];}['getUserSessions'](_0x5abe3b,_0x229f2d){const _0xa92a49=_0x229f2d?[this['channelSessions']['get'](_0x229f2d)]:this['channelSessions']['values'](),_0x4cefb3=new Set();for(const _0x7fb0e9 of _0xa92a49)for(const _0x56fa2e of _0x7fb0e9)_0x56fa2e['user']['id']===_0x5abe3b['id']&&_0x4cefb3['add'](_0x56fa2e['id']);return _0x4cefb3;}['getUserRole'](_0x298e84){for(const _0x5d9a87 of this['channelSessions']['values']())for(const _0x5bf393 of _0x5d9a87)if(_0x5bf393['user']===_0x298e84)return _0x5bf393['role'];}['_handleSessionAdd'](_0x3462cb,_0x541e38){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x140ad6=_0x541e38['user'],_0x4d4ea2=this['_users']['getUser'](_0x140ad6['id'])||this['_createUser'](_0x140ad6),_0x448b33=Object['assign']({},_0x541e38,{'user':_0x4d4ea2});if(this['channelSessions']['get'](_0x3462cb)['add'](_0x448b33),!_0x140ad6['hiddenInPresenceList']){const _0x57e6e4=this['channelConnectedUsers']['get'](_0x3462cb);_0x57e6e4['has'](_0x4d4ea2['id'])||_0x57e6e4['add'](_0x4d4ea2),this['allConnectedUsers']['has'](_0x4d4ea2['id'])||_0x140ad6['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x4d4ea2,_0x4d4ea2['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x3462cb,{'channelId':_0x3462cb,'session':_0x448b33});}['_handleSessionRemove'](_0x3f402d,_0x585669){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x230dea=this['channelConnectedUsers']['get'](_0x3f402d),_0x2441b6=_0x585669['user'];_0x2441b6['id']&&(this['channelSessions']['get'](_0x3f402d)['remove'](_0x585669['id']),_0x230dea['has'](_0x2441b6['id'])&&!this['getUserSessions'](_0x2441b6,_0x3f402d)['size']&&_0x230dea['remove'](_0x2441b6['id']),this['allConnectedUsers']['get'](_0x2441b6['id'])&&!this['getUserSessions'](_0x2441b6)['size']&&this['allConnectedUsers']['remove'](_0x2441b6['id']));}['_createUser'](_0x5d7d36,_0x49c2a6){const _0x90c13b=this['_users']['addUser'](_0x5d7d36);return _0x49c2a6&&this['_users']['defineMe'](_0x5d7d36['id']),_0x90c13b['orderNumber']=this['_uniqueUsersCount']++,_0x90c13b;}}class V extends _0x2490b2{['_domEmitter']=new(_0x11a01f())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x544064=this['editor'],_0xc3cb4a=_0x544064['plugins']['get'](i);_0x544064['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x52f633,{writer:_0xdd6967})=>function(_0x3dcb08,_0x3a5549,_0x4dea36,_0x5b40f8){const _0x549888=_0x3dcb08['markerName']['split'](':')[0x2],_0x28a450=_0x4dea36['getUserBySessionId'](_0x549888);if(!_0x28a450||_0x549888===_0x4dea36['mySessionId'])return;if(!_0x5b40f8['model']['schema']['checkChild'](_0x3dcb08['markerRange']['start'],'$text'))return;const _0x27fa70={'class':'ck-user__marker\x20'+_0x28a450['color']['getMarkerClass'](),'data-name':_0x28a450['name'],'data-session-id':_0x549888},_0x5ee600=_0x5b40f8['model']['markers']['get'](_0x3dcb08['markerName']),_0x4567fe=_0x5ee600['getStart'](),_0x48fa8b=_0x4567fe['nodeAfter'],_0x2a94cd=_0x5b40f8['model']['schema'];if(_0x48fa8b&&_0x2a94cd['isObject'](_0x48fa8b)&&_0x2a94cd['isInline'](_0x48fa8b)&&!_0x5b40f8['model']['markers']['get']('user:range:'+_0x549888)['getRange']()['isCollapsed'])return;const _0x1d2aa9=_0x4567fe['parent'];return _0x5b40f8['model']['schema']['isLimit'](_0x1d2aa9)&&!_0x5b40f8['model']['hasContent'](_0x1d2aa9)&&(_0x27fa70['contenteditable']=!0x1),function(_0x5fe22c,_0xb852ed,_0x3423a7){const _0xb6a10f=_0x5fe22c['createUIElement']('span',_0xb852ed);return _0x5fe22c['setCustomProperty']('userPositionMarker',!0x0,_0xb6a10f),_0xb6a10f['render']=function(_0x3f2ba5){const _0x43c8a7=this['toDomElement'](_0x3f2ba5),_0x368685=document['createElement']('span');return _0x368685['classList']['add']('ck-user__marker-tooltip'),_0x368685['setAttribute']('contenteditable','false'),_0x368685['setAttribute']('spellcheck','false'),_0x368685['textContent']=_0x3423a7['name'],_0x43c8a7['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x368685['outerHTML']+'⁠',_0x43c8a7['addEventListener']('mouseenter',()=>{_0x43c8a7['classList']['add']('ck-user__marker_hovered');}),_0x43c8a7['addEventListener']('mouseleave',()=>{_0x43c8a7['classList']['remove']('ck-user__marker_hovered');}),_0x43c8a7;},_0xb6a10f['isSimilar']=function(_0x5af8c5){return!(!this['getCustomProperty']('userPositionMarker')||!_0x5af8c5['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x5af8c5['getAttribute']('data-session-id'));},_0xb6a10f;}(_0x3a5549,_0x27fa70,_0x28a450);}(_0x52f633,_0xdd6967,_0xc3cb4a,_0x544064)}),_0x544064['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5c6a12=>function(_0x1dcb66,_0x3ab033){const _0x26781c=_0x1dcb66['markerName']['split'](':')[0x2];if(_0x26781c===_0x3ab033['mySessionId'])return null;const _0x5aeede=_0x3ab033['getUserBySessionId'](_0x26781c);if(!_0x5aeede)return{'id':_0x26781c,'classes':[]};return{'id':_0x26781c,'classes':['ck-user__selection',_0x5aeede['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x26781c},'priority':0x7d0+_0x5aeede['orderNumber']};}(_0x5c6a12,_0xc3cb4a)}),function(_0x2ce29b){const _0x547f00=_0x2ce29b['model'],_0x2da779=new Map(),_0x515528=_0x2ce29b['plugins']['get'](i);_0x547f00['markers']['on']('update:user:range',(_0x21f787,_0x28554f,_0x28eba6,_0xbb3608)=>{if(!_0xbb3608&&_0x2da779['get'](_0x28554f['name']))return _0x2da779['get'](_0x28554f['name'])['detach'](),void _0x2da779['delete'](_0x28554f['name']);const _0x271a2f=_0x28554f['name']['split'](':')[0x2];if(_0x271a2f===_0x515528['mySessionId'])return;const _0x18c690='user:position:'+_0x271a2f;_0x547f00['markers']['has'](_0x18c690)&&_0x2ce29b['editing']['reconvertMarker'](_0x18c690),_0x28554f['on']('change:range',(_0x44ffc7,_0x10643e,_0x2ba7bb)=>{if('$graveyard'!=_0x10643e['root']['rootName']&&'$graveyard'==_0x28554f['getRange']()['root']['rootName']&&!_0x2da779['has'](_0x28554f['name'])){const _0x1dbecd=_0x547f00['schema']['getNearestSelectionRange'](_0x2ba7bb['deletionPosition']);if(_0x1dbecd){const _0x4e6870=_0x226a09['fromRange'](_0x1dbecd);_0x2da779['set'](_0x28554f['name'],_0x4e6870),_0x4e6870['on']('change:range',(_0x24b656,_0x57eaf9,_0x587a48)=>{if('$graveyard'==_0x4e6870['root']['rootName']){const _0x47b6ca=_0x547f00['schema']['getNearestSelectionRange'](_0x587a48['deletionPosition']);_0x47b6ca?(_0x4e6870['start']=_0x47b6ca['start'],_0x4e6870['end']=_0x47b6ca['end']):(_0x2da779['delete'](_0x28554f['name']),_0x4e6870['detach']());}});}}});}),_0x547f00['document']['on']('change',()=>{_0x2da779['size']>0x0&&_0x547f00['enqueueChange']({'isUndoable':!0x1},_0x58dc99=>{for(const [_0x439d7c,_0x54b79d]of _0x2da779)'$graveyard'==_0x547f00['markers']['get'](_0x439d7c)['getRange']()['root']['rootName']&&(Z(_0x439d7c['split'](':')[0x2],_0x54b79d['toRange'](),_0x547f00,_0x58dc99),_0x54b79d['detach']());_0x2da779['clear']();});});}(_0x544064),this['_domEmitter']['listenTo'](_0x5ee5cc['document'],'keydown',(_0x12d091,{key:_0x5bc322})=>{'Escape'===_0x5bc322&&function(_0x45a15d){_0x45a15d['editing']['view']['change'](_0x53453f=>{for(const _0x254aaf of _0x45a15d['model']['markers']){if(!_0x254aaf['name']['startsWith']('user:position'))continue;const _0x23c579=_0x45a15d['editing']['mapper']['markerNameToElements'](_0x254aaf['name']);if(_0x23c579){for(const _0x12781e of _0x23c579)_0x53453f['removeClass']('ck-user__marker_hovered',_0x12781e);}}});}(_0x544064);},{'useCapture':!0x0});}['afterInit'](){const _0x1b2d74=this['editor'],_0x2ab458=_0x1b2d74['commands']['get']('undo');_0x2ab458&&_0x1b2d74['model']['on']('applyOperation',(_0x437a07,_0x5c4c7c)=>{const _0x45942f=_0x5c4c7c[0x0];if(!_0x45942f['isDocumentOperation'])return;if('marker'!=_0x45942f['type']||!_0x45942f['name']['startsWith']('user:'))return;const _0x8ec565=_0x45942f['batch'];_0x2ab458['_createdBatches']['has'](_0x8ec565)&&(_0x45942f['newRange']=_0x45942f['oldRange']?_0x1b2d74['model']['createRange'](_0x45942f['oldRange']['start'],_0x45942f['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3c9eff=this['editor'],_0x54e566=_0x3c9eff['model']['document'],_0x838e8c=_0x3c9eff['plugins']['get'](i);_0x3c9eff['model']['enqueueChange']({'isUndoable':!0x1},_0x30607b=>{const _0x17a13c='user:range:'+_0x838e8c['mySessionId'],_0x253da2='user:position:'+_0x838e8c['mySessionId'],_0x146558=_0x3c9eff['model']['markers']['has'](_0x17a13c);_0x3c9eff['editing']['view']['hasDomSelection']?Z(_0x838e8c['mySessionId'],_0x54e566['selection']['getFirstRange'](),_0x3c9eff['model'],_0x30607b):_0x146558&&(_0x30607b['removeMarker'](_0x17a13c),_0x30607b['removeMarker'](_0x253da2));});}}function Z(_0x4f5c5f,_0x40d031,_0x52933f,_0x2c7599){const _0x2ff81b='user:range:'+_0x4f5c5f,_0x5ead12='user:position:'+_0x4f5c5f,_0x1bd542=_0x40d031['getContainedElement']();let _0x27c069=_0x40d031['start'];if(_0x1bd542&&_0x1bd542['is']('element','tableCell')){const _0x699032=function(_0x5387dc,_0x212735){for(const _0x2d7d73 of _0x5387dc['getPositions']())if(_0x212735['schema']['checkChild'](_0x2d7d73,'$text'))return _0x2d7d73;}(_0x40d031,_0x52933f);_0x699032&&(_0x27c069=_0x699032,_0x40d031=_0x2c7599['createRange'](_0x27c069));}const _0xb69f69=_0x2c7599['createRange'](_0x27c069);_0x52933f['markers']['has'](_0x2ff81b)?(_0x2c7599['updateMarker'](_0x2ff81b,{'range':_0x40d031}),_0x2c7599['updateMarker'](_0x5ead12,{'range':_0xb69f69})):(_0x2c7599['addMarker'](_0x2ff81b,{'range':_0x40d031,'usingOperation':!0x0}),_0x2c7599['addMarker'](_0x5ead12,{'range':_0xb69f69,'usingOperation':!0x0}));}function W(_0x189376,_0x2f8d8b,_0x5b3743){const _0x1dd03f=_0x189376['t'],t=_0x189376['t'];switch(_0x2f8d8b){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 _0x1dd03f({'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'},_0x5b3743);default:return'';}}let G=0x1;class l extends _0x2490b2{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x32a1bc)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,V,_0x28f4c3,_0x25284e,_0x4b11cd];}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 _0x34304d=this['serverHistory']['getOperations']();for(let _0x4f340c=_0x34304d['length']-0x1;_0x4f340c>=0x0;_0x4f340c--){const _0x469856=_0x34304d[_0x4f340c];if(!this['_disconnectionOperations']['has'](_0x469856))return _0x469856['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x4634b9){if(super(_0x4634b9),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2d298e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x5a1e76('collaboration-missing-channelid',this);const _0x624b22=_0x4634b9['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x624b22,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1744e1(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new J(this['_disconnectionOperations']);}['init'](){const _0x418888=this['editor'],_0x60dc32=_0x418888['plugins']['get'](_0x25284e),_0x4c17e6=_0x418888['plugins']['get'](n);this['listenTo'](_0x60dc32,'getOperationAuthor',(_0x7fc73d,_0x57ed71)=>{const _0x12559c=_0x57ed71[0x0];_0x12559c['_authorId']&&(_0x7fc73d['return']=_0x60dc32['getUser'](_0x12559c['_authorId']),_0x7fc73d['stop']()),null===_0x12559c['_authorId']&&(_0x7fc73d['return']=null,_0x7fc73d['stop']());},{'priority':'high'}),this['listenTo'](_0x418888['model']['document']['selection'],'change:range',(_0x13617d,_0x36677b)=>{_0x36677b['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x418888['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x418888['model']['on']('applyOperation',(_0x558ab7,_0x32c79a)=>{const _0x422fcb=_0x32c79a[0x0];_0x422fcb['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x422fcb),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4c17e6,'state',this,'_hasSynchronizationProblem',(_0x4451e7,_0x3dd2d6)=>'connected'===_0x4451e7&&!_0x3dd2d6),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x418888['disableReadOnlyMode']('rtc-offline'):_0x418888['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x418888['disableReadOnlyMode']('rtc-offline'):_0x418888['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1d67c4=this['editor']['plugins']['get'](i),_0x2b7b34=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1d67c4['unregister'](this['_channelId']);const _0x54a6ab=await this['_service']['reconnect'](_0x2b7b34['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x54a6ab)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x43862a=await this['_service']['getConnectedSessions']();_0x1d67c4['register'](this['_channelId'],_0x43862a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x97fb9d){if(function(_0x116b2c){return'404'===_0x116b2c['code'];}(_0x97fb9d)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2ac29e){return'409'===_0x2ac29e['code'];}(_0x97fb9d)){const _0x376d7c=W(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x376d7c);}else{if(!(_0x97fb9d instanceof $))throw _0x97fb9d;this['_handleReconnectionError']();}}}}['destroy'](){const _0xe83a44=this['editor']['plugins']['get'](n),_0x4e24a8=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4e24a8['channelSessions']['has'](this['_channelId'])&&_0x4e24a8['unregister'](this['_channelId']),_0xe83a44['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x9a5f67){if(this['sessionId']!==_0x9a5f67['sessionId']&&this['_lastSyncedOperationId']!==_0x9a5f67['lastOperationId'])throw new $();return this['sessionId']=_0x9a5f67['sessionId'],this['_handleServerResponse']([],{..._0x9a5f67,'wereChangesApplied':!0x1,'data':_0x9a5f67['data']},'reconnect');}async['_connectService'](_0x1c3d8f,_0xa2692d=!0x1){const {connection:_0x53e6f5}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x53e6f5,this['_channelId'])['then'](_0x3d9d53=>this['_initSessionsHandling'](_0x3d9d53))['catch'](_0x2de070=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x2de070);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3b4d9b,_0x42f181)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x42f181);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xb157d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1c3d8f);this['_isPendingUpdate']=!0x0;const _0x132506=await this['_service']['connect'](_0x53e6f5,this['_compressOperations'](_0x1c3d8f),_0xb157d);if(this['sessionId']=_0x132506['sessionId'],_0xa2692d){if(!_0x132506['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x132506['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1c3d8f,_0x132506,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x132506,_0x1c3d8f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xd101e7=this['editor']['plugins']['get'](i),_0x33ad2a=this['editor']['plugins']['get'](V),_0x553fc6=_0xd101e7['channelSessions']['get'](this['_channelId']);_0x553fc6&&_0x553fc6['length']>0x1?_0x33ad2a['createUserMarkerOperations']():this['listenTo'](_0xd101e7,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xd101e7['channelSessions']['get'](this['_channelId'])['length']&&_0x33ad2a['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0xe90ad5,_0x455923,_0x21f716,_0x53e076){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x455923){const _0x52c522=this['_decompressOperations'](_0x21f716,_0x53e076);await this['_fetchMissingUsers'](_0x52c522),this['_handleExternalOperations'](_0x52c522,_0x455923,_0x21f716['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x83a386}=this['editor'];let _0x3a0c87;try{_0x3a0c87=await this['_service']['getDocumentDetails']();}catch{const _0x1e61e1=W(_0x83a386,'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'](_0x1e61e1);}const _0x5df2ab=_0x3a0c87['currentDocumentSession']||_0x3a0c87['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5df2ab['lastOperationId']){const _0x5e10fb=W(_0x83a386,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x5e10fb);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xd2e14c){const _0x1134da=this['editor']['plugins']['get'](i);this['listenTo'](_0x1134da,'sessionAdd:'+this['_channelId'],(_0x45b763,{session:_0x482eea})=>{if(_0x482eea['id']===_0x1134da['mySessionId']){_0x45b763['off']();const _0x456e59=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x32635c=_0x482eea['permissions'];_0x456e59&&_0x456e59['isEnabled']&&(_0x32635c=_0x32635c['filter'](_0x5d4a5e=>'document:write'!==_0x5d4a5e)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x32635c,this['_channelId']);}}),_0x1134da['register'](this['_channelId'],_0xd2e14c);}['_initThrowingOnDataSet'](){const _0x23f2e5=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x496b9a)=>{if(!_0x496b9a[_0x496b9a['length']-0x1]['suppressErrorInCollaboration'])throw new _0x5a1e76('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x23f2e5['apply'](this['editor']['data'],_0x496b9a);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x322e98,[_0x356a6c])=>{if(this['_document']['version'])throw new _0x5a1e76('realtimecollaborationclient-init-document-already-initialized',this);_0x322e98['stop'](),this['_setPendingAction']();const _0xdf4faf=this['editor']['config']['get']('rootsAttributes'),_0x56eb7a=this['_getOperationsFromInitData'](_0x356a6c,_0xdf4faf);0x0==_0x56eb7a['length']&&_0x56eb7a['push'](new _0xe87577(0x0)),_0x322e98['return']=this['_connectService'](_0x56eb7a)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x17e8ae=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x17e8ae))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x274e68,[_0x1759e3,_0x3ce8e1])=>{_0x274e68['stop']();const _0x4589b1=this['editor']['model']['document']['getRoot'](_0x1759e3);if(!this['_knownRootNames']['has'](_0x1759e3)){const _0x577c58=_0x3ce8e1&&_0x3ce8e1['data']?_0x3ce8e1['data']:'',_0x2d042f=_0x3ce8e1&&_0x3ce8e1['attributes']?_0x3ce8e1['attributes']:{};await this['_loadRoot'](_0x1759e3,_0x577c58,_0x2d042f);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4589b1['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4589b1);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x11e371){const _0x56db53=this['editor']['plugins']['get'](_0x25284e),{connection:_0x182f44}=this['editor']['plugins']['get'](n),_0x20bf4e=new Set();for(const _0x43f314 of _0x11e371){const _0x1c6547=_0x43f314['_authorId'];_0x1c6547&&!_0x56db53['getUser'](_0x1c6547)&&_0x20bf4e['add'](_0x1c6547);}if(0x0===_0x20bf4e['size'])return;const _0x37cc04=await lt['getMany'](_0x182f44,Array['from'](_0x20bf4e));for(const _0x3329bb of _0x37cc04)_0x56db53['getUser'](_0x3329bb['id'])||_0x56db53['addUser'](_0x3329bb);}['_getOperationsFromInitData'](_0x26941c,_0x4caafb={}){const _0x4b4af1=this['editor']['model'],_0x3b3eab=[];let _0x1524e1=0x0;const _0x3dd495='string'==typeof _0x26941c?{'main':_0x26941c}:_0x26941c;for(const _0x2a469d of Object['keys'](_0x3dd495)){if(!this['_document']['roots']['has'](_0x2a469d))throw new _0x5a1e76('realtimecollaborationclient-init-non-existent-root',this);const _0x1d41f6=this['editor']['data']['parse'](_0x3dd495[_0x2a469d]),_0x3f4685=this['_document']['getRoot'](_0x2a469d),_0x109fe7=new _0x35919c(_0x4b4af1['createPositionAt'](_0x3f4685,0x0),_0x1d41f6,_0x1524e1++);_0x3b3eab['push'](_0x109fe7);for(const [_0x25ed5b,_0x2eb8af]of _0x1d41f6['markers']){const _0x5332ea=_0x4b4af1['createRange'](_0x4b4af1['createPositionFromPath'](_0x3f4685,_0x2eb8af['start']['path']['slice']()),_0x4b4af1['createPositionFromPath'](_0x3f4685,_0x2eb8af['end']['path']['slice']())),_0x326b0d=new _0x521527(_0x25ed5b,null,_0x5332ea,_0x4b4af1['markers'],!0x0,_0x1524e1++);_0x3b3eab['push'](_0x326b0d);}}if(_0x4caafb)for(const [_0xb06842,_0x2b0f1c]of Object['entries'](_0x4caafb)){const _0x597b45=_0x4b4af1['document']['getRoot'](_0xb06842);if(!_0x597b45)throw new _0x5a1e76('multi-root-editor-root-attributes-no-root',null);for(const [_0x19839d,_0x3c810e]of Object['entries'](_0x2b0f1c))if(null!==_0x3c810e){const _0x2a651c=new _0x138648(_0x597b45,_0x19839d,null,_0x3c810e,_0x1524e1++);_0x3b3eab['push'](_0x2a651c);}}return _0x3b3eab;}async['_loadRoot'](_0x34b19f,_0x512a9c,_0x410ffa){this['_getOperationsFromInitData']({[_0x34b19f]:_0x512a9c},{[_0x34b19f]:_0x410ffa})['forEach']((_0x3488c7,_0x4cd6e9)=>{_0x3488c7['baseVersion']=this['_document']['version']+_0x4cd6e9,_0x3488c7['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x3488c7);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0xb5bcff,_0x3d912a){let _0x154ed7;this['_offset']=_0xb5bcff['offset'];const _0x28d231=_0xb5bcff['wereChangesApplied']&&!_0xb5bcff['initData'],_0x462bf1=_0x28d231?0x0:_0xb5bcff['data']['baseVersion'];if(_0x3d912a['forEach'](_0x4307cd=>{_0x4307cd['_isInit']=!0x0,_0x4307cd['createdAt']=_0xb5bcff['sessionCreatedAt'],_0x4307cd['_authorId']=null;}),_0x28d231)_0x154ed7=_0x3d912a,this['_applyOperationsSet'](_0x154ed7,_0x28d231);else{if(_0xb5bcff['initData']){const _0x45ff5f=this['_getOperationsFromInitData'](_0xb5bcff['initData']);this['_document']['history']['version']=-_0x45ff5f['length'],_0x45ff5f['forEach'](_0xf46b7d=>{_0xf46b7d['baseVersion']-=_0x45ff5f['length'],_0xf46b7d['createdAt']=_0xb5bcff['sessionCreatedAt'],_0xf46b7d['_isInit']=!0x0,_0xf46b7d['_authorId']=null;}),this['_applyOperationsSet'](_0x45ff5f,!0x0),this['serverHistory']['version']=-_0x45ff5f['length']+this['_offset'],this['_updateServerHistory'](_0x45ff5f);}this['_document']['history']['version']=_0x462bf1,_0x154ed7=this['_decompressOperations'](_0xb5bcff['data'],_0xb5bcff['metadata']),await this['_fetchMissingUsers'](_0x154ed7),this['_applyOperationsSet'](_0x154ed7,_0x28d231);}_0xb5bcff['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x154ed7,_0xb5bcff['lastOperationId']),this['_lastSyncedOperationId']=_0xb5bcff['lastOperationId']),this['serverHistory']['version']=_0x462bf1+this['_offset'],this['_updateServerHistory'](_0x154ed7),_0x3d912a['filter'](_0x41702d=>{const _0x455ce8=this['_getAffectedRoot'](_0x41702d);return _0x455ce8&&!this['_knownRootNames']['has'](_0x455ce8);})['forEach']((_0xd2f04b,_0x5918a6)=>{_0xd2f04b['baseVersion']=this['_document']['version']+_0x5918a6,this['_saveOperationInBuffer'](_0xd2f04b);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x571532,_0x334bd1){const _0x245f74=_0x334bd1&&_0x334bd1['message'];if(_0x245f74&&_0x245f74['startsWith']('realtimecollaborationclient'))throw _0x334bd1;const _0x185301=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x185301['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x5a1e76(_0x571532,this['editor'],_0x245f74?{'originalError':_0x245f74}:void 0x0);}['_saveOperationInBuffer'](_0x3f4f1e){this['_knownOperations']['has'](_0x3f4f1e)||(this['_knownOperations']['add'](_0x3f4f1e),this['_bufferedOperations']['push'](_0x3f4f1e),this['_pendingAction']||'marker'==_0x3f4f1e['type']&&!_0x3f4f1e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3e11e6=!0x1){!_0x3e11e6&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4af90e=>{_0x4af90e&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x135377=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1e1150){return _0x1e1150['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1e1150['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1e1150['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x135377)||this['_crash'](_0x135377['message'],_0x135377);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x55c80b=>{this['on']('change:_isPendingUpdate',()=>{_0x55c80b();});});}async['_sendBufferedOperations'](){const _0x23835b=this['editor']['plugins']['get'](V);if(this['_shouldSendSelectionUpdate']()&&(_0x23835b['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xff693c=[...this['_bufferedOperations']];for(const _0x3fb4f5 of _0xff693c)_0x3fb4f5['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3fb4f5);const _0x25441b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xff693c),_0x1f86c8=G++,_0x2e5d69=this['_compressOperations'](_0xff693c),_0x3a0ff8=await this['_service']['sendOperations'](_0x2e5d69,_0x2e5d69['baseVersion'],_0x25441b);try{return await this['_handleServerResponse'](_0xff693c,_0x3a0ff8,_0x1f86c8);}catch(_0x1ed003){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1ed003);}}async['_handleServerResponse'](_0x44c32c,_0x29bd58,_0x828598){if('error'in _0x29bd58)throw _0x29bd58['error'];let _0x5ec6c3=!0x1;if(_0x29bd58['wereChangesApplied']){_0x29bd58['lastOperationId']&&(this['_lastSyncedOperationId']=_0x29bd58['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x512879=>!_0x44c32c['includes'](_0x512879));for(const _0x15530b of _0x44c32c)_0x15530b['createdAt']='lastOperationAcceptedAt'in _0x29bd58&&_0x29bd58['lastOperationAcceptedAt']||void 0x0;K(_0x44c32c,_0x29bd58['version']-_0x44c32c['length']),this['_updateServerHistory'](_0x44c32c);const _0x1a2ebe=_0x44c32c['filter'](_0x53bf76=>{if(!_0x53bf76['_isInit'])return!0x1;const _0x3acd43=this['_getAffectedRoot'](_0x53bf76);return _0x3acd43&&!this['_knownRootNames']['has'](_0x3acd43);});K(_0x1a2ebe,this['_document']['version']),this['_applyOperationsSet'](_0x1a2ebe),_0x5ec6c3=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1bd22f=this['_decompressOperations'](_0x29bd58['data'],_0x29bd58['metadata'])['filter'](_0x5d2189=>_0x5d2189['baseVersion']>=this['_lastServerVersion']);_0x1bd22f['forEach'](_0x4202a2=>this['_addKnownRoot'](_0x4202a2)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3ab858=>!_0x3ab858['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3ab858))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1bd22f),_0x5ec6c3=this['_handleExternalOperations'](_0x1bd22f,_0x29bd58['version'],_0x29bd58['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5ec6c3?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x364a44,_0x10957f,_0x1931ef){try{const _0x39c8df={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5c6c2f,operationsB:_0x49272a,originalOperations:_0x42d2ee}=_0x45fa73(_0x364a44,this['_bufferedOperations'],_0x39c8df);K(_0x5c6c2f,this['_document']['version']),K(_0x49272a,_0x10957f);for(const _0x17639e of _0x5c6c2f){const _0x34e8e4=_0x42d2ee['get'](_0x17639e);_0x17639e['_authorId']=_0x34e8e4?_0x34e8e4['_authorId']:null;}_0x1931ef&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x364a44,_0x1931ef),this['_lastSyncedOperationId']=_0x1931ef),this['_bufferedOperations']=[..._0x49272a],this['_applyOperationsSet'](_0x5c6c2f),this['_updateServerHistory'](_0x364a44);}catch(_0x3dbb4c){return console['error'](_0x3dbb4c),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5eb7ed,_0x5ccb8b=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4e5c07=>{for(const _0x5350c8 of _0x5eb7ed)this['_knownOperations']['add'](_0x5350c8),this['_addKnownRoot'](_0x5350c8),_0x4e5c07['batch']['addOperation'](_0x5350c8),this['editor']['model']['applyOperation'](_0x5350c8);});}['_addKnownRoot'](_0x39da27){const _0xe810e=this['_getAffectedRoot'](_0x39da27);_0xe810e&&this['_knownRootNames']['add'](_0xe810e);}['_getAffectedRoot'](_0x28ad87){let _0x22d979,_0x4aede5;switch(_0x28ad87['type']){case'insert':_0x22d979=_0x28ad87['position']['root'];break;case'marker':if(_0x4aede5=_0x28ad87['newRange'],!_0x4aede5)return null;_0x22d979=_0x4aede5['root'];break;case'addRootAttribute':_0x22d979=_0x28ad87['root'];break;case'addRoot':_0x22d979=_0x28ad87['affectedSelectable'];break;case'move':_0x22d979=_0x28ad87['targetPosition']['root'];break;default:return null;}return _0x22d979['rootName'];}['_updateServerHistory'](_0x1f8a19){_0x1f8a19['forEach'](_0x32c901=>{const _0x15fdd3=_0x32c901['clone']();_0x15fdd3['_authorId']=_0x32c901['_authorId'],_0x15fdd3['_isInit']=!!_0x32c901['_isInit'],_0x15fdd3['createdAt']=_0x32c901['createdAt'],_0x15fdd3['baseVersion']+=this['_offset'],_0x32c901['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x15fdd3),this['serverHistory']['addOperation'](_0x15fdd3);});}['_handleReconnectionError'](_0x459a79){const _0x31e32a=this['editor']['plugins']['get']('Notification'),_0x165745=this['editor']['locale'];_0x459a79||(_0x459a79=W(_0x165745,'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.')),_0x31e32a['showWarning'](_0x459a79,{'title':W(_0x165745,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x28f4c3)['add'](W(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x28f4c3)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x51578d){const _0x1538be=_0x51578d['map'](_0x58816e=>_0x58816e['toJSON']());return this['_compressor']['compress'](_0x1538be);}['_decompressOperations'](_0x106169,_0x18e343){return this['_compressor']['decompress'](_0x106169)['map']((_0x18fd12,_0x290fdc)=>{const _0x452365='init'==_0x18e343[_0x290fdc]['type'];if('InsertOperation'==_0x18fd12['__className']){const _0x5f0207=_0x18fd12['position']['root'];!this['_document']['getRoot'](_0x5f0207)&&(this['_document']['createRoot']('$root',_0x5f0207)['_isAttached']=!0x1);}const _0xb6e32e=_0x43bf62['fromJSON'](_0x18fd12,this['_document']);return _0xb6e32e['wasUndone']=_0x18fd12['wasUndone'],_0xb6e32e['_isInit']=_0x452365,_0xb6e32e['_authorId']=_0x452365?null:_0x18e343[_0x290fdc]['userId'],_0xb6e32e['_isDisconnection']='cs:removeUser'===_0x18e343[_0x290fdc]['type'],_0xb6e32e['createdAt']=_0x18e343[_0x290fdc]['createdAt'],_0xb6e32e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3bf8dc=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3bf8dc&&_0x3bf8dc['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0xf50e00,_0x42c2da){for(const _0x52abe7 of _0xf50e00)_0x52abe7['baseVersion']=_0x42c2da++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x1a6c69){this['_ignoredOperations']=_0x1a6c69,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xc465){let _0x333a8a=_0xc465['length'];for(;_0x333a8a--;){const _0x1e731e=_0xc465[_0x333a8a];if(!this['_ignoredOperations']['has'](_0x1e731e)){if(!this['_operationToId']['has'](_0x1e731e)){const _0x272713=_0x431570()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1e731e,_0x272713);}return this['_operationToId']['get'](_0x1e731e);}}}['setIdForTheLastOperation'](_0x43fe51,_0x20fcc6){if(!_0x20fcc6)return;let _0x2896f1=_0x43fe51['length'];for(;_0x2896f1--;){const _0x18436e=_0x43fe51[_0x2896f1];this['_ignoredOperations']['has'](_0x18436e)||this['_operationToId']['set'](_0x18436e,_0x20fcc6);}}}class a extends _0x2490b2{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x29f1b4{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x50e3a7)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x25284e];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xab47a3){super(_0xab47a3),this['_services']=new Map();}async['init'](){const _0xebd5f4=this['context'],_0x2a33fb=_0xebd5f4['plugins']['get']('CommentsRepository');if(_0xebd5f4['plugins']['get'](n)['addToReconnectionStack'](this),_0x2a33fb['adapter']={'addCommentThread':async({channelId:_0x396924,threadId:_0x4ae03b,comments:_0x54bf7f,resolvedAt:_0x67cd4d,resolvedBy:_0x2b5428,context:_0x24b6a8,attributes:_0x4de775})=>{const _0x3e5e39=await this['_getService'](_0x396924)['addCommentThread']({'commentThreadId':_0x4ae03b,'comments':_0x54bf7f['map'](_0x578000=>function(_0x1cee40,_0x5d41fd,_0xfdb6a6){return{'commentThreadId':_0xfdb6a6,'commentId':_0x1cee40['commentId'],'userId':_0x1cee40['authorId'],'content':_0x1cee40['content'],'documentId':_0x5d41fd,'createdAt':_0x1cee40['createdAt'],'attributes':_0x1cee40['attributes']||{}};}(_0x578000,_0x396924,_0x4ae03b)),'resolvedAt':_0x67cd4d,'resolvedBy':_0x2b5428,'context':_0x24b6a8,'attributes':_0x4de775})['catch'](dt);return{'threadId':_0x3e5e39['commentThreadId'],'comments':_0x3e5e39['comments']};},'getCommentThread':async({channelId:_0x2201ef,threadId:_0x5f57d1})=>{const _0x2e2b9e=await this['_getService'](_0x2201ef)['getCommentThread'](_0x5f57d1)['catch'](f)['catch'](dt);return _0x2e2b9e?_0x2e2b9e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2e2b9e]),{'threadId':_0x2e2b9e['commentThreadId'],'comments':_0x2e2b9e['comments']['map'](p),'context':_0x2e2b9e['context'],'resolvedAt':_0x2e2b9e['resolvedAt'],'resolvedBy':_0x2e2b9e['resolvedBy'],'attributes':_0x2e2b9e['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3d5717,threadId:_0x5d80f6,context:_0x1f6ffa,unlinkedAt:_0x9cf515,attributes:_0x14bcdf})=>this['_getService'](_0x3d5717)['updateCommentThread']({'commentThreadId':_0x5d80f6,'context':_0x1f6ffa,'attributes':_0x14bcdf,'unlinkedAt':_0x9cf515})['catch'](f)['catch'](dt),'resolveCommentThread':async({channelId:_0x21248b,threadId:_0x3ae723})=>{const _0x180521=await this['_getService'](_0x21248b)['resolveCommentThread'](_0x3ae723)['catch'](f)['catch'](dt);return{'threadId':_0x180521['commentThreadId'],'resolvedAt':_0x180521['resolvedAt'],'resolvedBy':_0x180521['resolvedBy']};},'reopenCommentThread':async({channelId:_0x5f203c,threadId:_0x496856})=>this['_getService'](_0x5f203c)['reopenCommentThread'](_0x496856)['catch'](f)['catch'](dt),'removeCommentThread':({channelId:_0x1b938d,threadId:_0x548436})=>this['_getService'](_0x1b938d)['removeCommentThread'](_0x548436)['catch'](f)['catch'](dt),'addComment':({channelId:_0x5bde89,threadId:_0xe97b5a,commentId:_0x5bc546,content:_0x2c4018,attributes:_0x1453bb})=>this['_getService'](_0x5bde89)['addComment'](_0xe97b5a,_0x5bc546,_0x2c4018,_0x1453bb)['catch'](dt),'updateComment':({channelId:_0x3473aa,threadId:_0x2c10a2,commentId:_0x1244e6,content:_0x38832f,attributes:_0x269c45})=>this['_getService'](_0x3473aa)['updateComment'](_0x2c10a2,_0x1244e6,_0x38832f,_0x269c45)['catch'](f)['catch'](dt),'removeComment':({channelId:_0x257d5c,threadId:_0x2ef801,commentId:_0x55e127})=>this['_getService'](_0x257d5c)['removeComment'](_0x2ef801,_0x55e127)['catch'](f)['catch'](dt)},_0xebd5f4 instanceof _0x625951){const _0x1067fa=_0xebd5f4['config']['get']('collaboration.channelId'),_0x432b57=_0xebd5f4['plugins']['get'](i);await this['_setUpService'](_0x1067fa);const _0x5a44d6=await this['_services']['get'](_0x1067fa)['getConnectedSessions']();this['listenTo'](_0x432b57,'sessionAdd:'+_0x1067fa,(_0x38b531,{session:_0x5f4898})=>{_0x5f4898['id']===_0x432b57['mySessionId']&&(_0x38b531['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x5f4898['permissions'],_0x1067fa));}),_0x432b57['register'](_0x1067fa,_0x5a44d6);}}async['_setUpService'](_0x33fbbc){if(this['_services']['has'](_0x33fbbc))throw new _0x5a1e76('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x33fbbc});const _0x5fc7d3=this['context']['plugins']['get']('CommentsRepository'),_0x36e0e3=new s['CommentsService'](_0x33fbbc);this['_services']['set'](_0x33fbbc,_0x36e0e3),this['listenTo'](_0x36e0e3,'commentThreadAdded',(_0x256ab7,_0x52a628)=>{const {commentThreadId:_0x28b8b0,documentId:_0x1f7bd5,context:_0x23dda2,attributes:_0x3af864,resolvedAt:_0x3d3fa4,resolvedBy:_0xa44b63,comments:_0x3871e7}=_0x52a628;_0x5fc7d3['getCommentThread'](_0x28b8b0)||_0x5fc7d3['addCommentThread']({'threadId':_0x28b8b0,'channelId':_0x1f7bd5,'comments':_0x3871e7?_0x3871e7['map'](p):[],'context':_0x23dda2,'attributes':_0x3af864,'resolvedAt':_0x3d3fa4,'resolvedBy':_0xa44b63,'isFromAdapter':!0x0});}),this['listenTo'](_0x36e0e3,'commentThreadUpdated',(_0x34c8e1,{commentThreadId:_0x516415,documentId:_0x28b9e1,context:_0x2a9a6d,unlinkedAt:_0x2d731b,attributes:_0x443ae1})=>{_0x5fc7d3['getCommentThread'](_0x516415)&&_0x5fc7d3['updateCommentThread']({'threadId':_0x516415,'channelId':_0x28b9e1,'context':_0x2a9a6d,'unlinkedAt':_0x2d731b,'attributes':_0x443ae1,'isFromAdapter':!0x0});}),this['listenTo'](_0x36e0e3,'commentThreadResolved',(_0x2323e3,{commentThreadId:_0x353ca7,resolvedBy:_0x413ef2,resolvedAt:_0x51d7fb})=>{const _0x1423c2=_0x5fc7d3['getCommentThread'](_0x353ca7);_0x1423c2&&_0x1423c2['resolve']({'resolvedBy':_0x413ef2,'resolvedAt':_0x51d7fb,'isFromAdapter':!0x0});}),this['listenTo'](_0x36e0e3,'commentThreadReopened',(_0x176b5c,{commentThreadId:_0x3bb44b})=>{const _0x396705=_0x5fc7d3['getCommentThread'](_0x3bb44b);_0x396705&&_0x396705['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x36e0e3,'commentThreadRemoved',(_0x101f29,{commentThreadId:_0x1e4ef5})=>{const _0x570af7=_0x5fc7d3['getCommentThread'](_0x1e4ef5);_0x570af7&&_0x570af7['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x36e0e3,'commentAdded',(_0x12b95b,_0x1722df)=>{const _0x25affb=_0x1722df['commentThreadId'],_0x1c9b56=_0x5fc7d3['getCommentThread'](_0x25affb);_0x1c9b56&&_0x1c9b56['addComment']({...p(_0x1722df),'isFromAdapter':!0x0});}),this['listenTo'](_0x36e0e3,'commentUpdated',(_0x430c32,{commentThreadId:_0xa23b1b,commentId:_0x153a92,content:_0x4de97f,attributes:_0x2dd61b})=>{const _0x9204f4=_0x5fc7d3['getCommentThread'](_0xa23b1b);if(_0x9204f4){const _0x2780dc=_0x9204f4['getComment'](_0x153a92);_0x2780dc&&_0x2780dc['update']({'content':_0x4de97f,'attributes':_0x2dd61b,'isFromAdapter':!0x0});}}),this['listenTo'](_0x36e0e3,'commentRemoved',(_0x21a40c,{commentThreadId:_0x30fbf2,commentId:_0x249e91})=>{const _0x165bea=_0x5fc7d3['getCommentThread'](_0x30fbf2);if(_0x165bea){const _0x8c3d34=_0x165bea['getComment'](_0x249e91);_0x8c3d34&&_0x8c3d34['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x33fbbc);}['destroy'](){if(this['context']instanceof _0x625951){const _0x1e7ed9=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x1e7ed9);}}['_terminateService'](_0xa11f6){if(!this['_services']['has'](_0xa11f6))throw new _0x5a1e76('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0xa11f6});this['_getService'](_0xa11f6)['disconnect'](),this['_services']['delete'](_0xa11f6);}async['reconnect'](){for(const _0x1e63a2 of this['_services']['keys']())await this['_connectService'](_0x1e63a2);if(this['context']instanceof _0x625951){const _0x1d66e1=this['context']['config']['get']('collaboration.channelId'),_0x8b022b=this['context']['plugins']['get'](i);_0x8b022b['unregister'](_0x1d66e1);const _0x2a0082=await this['_services']['get'](_0x1d66e1)['getConnectedSessions']();_0x8b022b['register'](_0x1d66e1,_0x2a0082);}}async['_connectService'](_0x114f6c){const {connection:_0x335f18}=this['context']['plugins']['get'](n),_0x26aefb=this['context']['plugins']['get']('CommentsRepository'),_0x259d02=this['_services']['get'](_0x114f6c),_0x26b224=await _0x259d02['connect'](_0x335f18);await this['_fetchMissingUsersForThreads'](_0x26b224);const _0x315da6=new Set(Array['from'](_0x26aefb['getCommentThreads']({'channelId':_0x114f6c}),_0x552b6e=>_0x552b6e['id']));for(const _0x6bbb01 of _0x26b224)_0x6bbb01['deletedAt']||_0x315da6['delete'](_0x6bbb01['commentThreadId']);for(const _0x264ed5 of _0x315da6)_0x26aefb['getCommentThread'](_0x264ed5)['remove']({'isFromAdapter':!0x0});for(const _0x3e02d9 of _0x26b224){let _0x30c0bd=_0x26aefb['getCommentThread'](_0x3e02d9['commentThreadId']);const {commentThreadId:_0x5685e1,context:_0xa6f85b,attributes:_0x53fa27,resolvedBy:_0x345f77,resolvedAt:_0x4fa574,unlinkedAt:_0x14a3bb,deletedAt:_0x38c4a9}=_0x3e02d9;if(_0x38c4a9)continue;_0x30c0bd||(_0x30c0bd=_0x26aefb['addCommentThread']({'channelId':_0x114f6c,'threadId':_0x5685e1,'context':_0xa6f85b,'attributes':_0x53fa27||{},'resolvedBy':_0x345f77,'resolvedAt':_0x4fa574,'unlinkedAt':_0x14a3bb,'isFromAdapter':!0x0}));const _0x5abc81=new Set(Array['from'](_0x30c0bd['comments'],_0x1ce353=>_0x1ce353['id']));for(const _0x2e2cb1 of _0x3e02d9['comments'])_0x5abc81['delete'](_0x2e2cb1['commentId']);for(const _0x354e95 of _0x5abc81)_0x30c0bd['getComment'](_0x354e95)['remove']({'isFromAdapter':!0x0});for(const _0x52b032 of _0x3e02d9['comments']){const _0x3eae72=_0x30c0bd['getComment'](_0x52b032['commentId']);_0x3eae72?_0x3eae72['content']!==_0x52b032['content']&&_0x3eae72['update']({'content':_0x52b032['content'],'isFromAdapter':!0x0}):_0x30c0bd['addComment'](Object['assign'](p(_0x52b032),{'isFromAdapter':!0x0}));}}}['_getService'](_0x35004c){if(!this['_services']['has'](_0x35004c))throw new _0x5a1e76('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x35004c});return this['_services']['get'](_0x35004c);}async['_fetchMissingUsersForThreads'](_0x521d17){const _0x3a3ddb=this['context']['plugins']['get'](_0x25284e),{connection:_0x49752b}=this['context']['plugins']['get'](n),_0x2e5441=new Set();for(const {resolvedBy:_0x354073,comments:_0xece121}of _0x521d17){_0x354073&&!_0x3a3ddb['getUser'](_0x354073)&&_0x2e5441['add'](_0x354073);for(const {userId:_0x369ed1}of _0xece121)_0x3a3ddb['getUser'](_0x369ed1)||_0x2e5441['add'](_0x369ed1);}if(0x0===_0x2e5441['size'])return;const _0x2864b1=await lt['getMany'](_0x49752b,Array['from'](_0x2e5441));for(const _0x3b631b of _0x2864b1)_0x3a3ddb['getUser'](_0x3b631b['id'])||_0x3a3ddb['addUser'](_0x3b631b);}}async function f(_0x59fd57){if('404'!==_0x59fd57['code'])throw _0x59fd57;}function dt(_0x5e41b4){if((_0x518ad3=_0x5e41b4)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x518ad3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x518ad3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x518ad3;throw _0x5e41b4;}function p(_0x2e79c6){return{'threadId':_0x2e79c6['commentThreadId'],'commentId':_0x2e79c6['commentId'],'content':_0x2e79c6['content'],'createdAt':_0x2e79c6['createdAt'],'authorId':_0x2e79c6['userId'],'attributes':_0x2e79c6['attributes']||{}};}class m extends _0x2490b2{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46f6a3){super(_0x46f6a3);const _0x24dc4b=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x24dc4b);}['init'](){const _0x372068=this['editor']['plugins']['get'](n),_0x433ae3=this['editor']['plugins']['get']('TrackChangesEditing');return _0x433ae3['adapter']={'getSuggestion':async _0x320544=>{await this['_waitForServiceReady']();const _0x2ca7a1=await this['_trackChangesService']['get'](_0x320544)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x2ca7a1]),_0x2ca7a1;},'addSuggestion':async({id:_0xf7cd9a,type:_0x3e74a3,data:_0x1e2b71,originalSuggestionId:_0x5f4861,attributes:_0xee30b8})=>{await this['_waitForServiceReady']();const _0x20825b={'id':_0xf7cd9a,'type':_0x3e74a3,'data':_0x1e2b71,'originalSuggestionId':_0x5f4861,'attributes':_0xee30b8},_0x27782e=await this['_trackChangesService']['add'](_0xf7cd9a,_0x3e74a3,_0x1e2b71,_0x5f4861,_0xee30b8)['catch'](_0x4d3bd2=>{if(ut(_0x4d3bd2))return new Promise(_0x432806=>{this['_bufferedRequests']['set'](_0xf7cd9a,{'resolve':_0x432806,'suggestionData':_0x20825b});});throw _0x4d3bd2;});return this['_bufferedRequests']['delete'](_0xf7cd9a),_0x27782e;},'updateSuggestion':async(_0x573590,_0x202e32)=>{if(await this['_waitForServiceReady'](),'open'!==_0x202e32['state'])return this['_trackChangesService']['update'](_0x573590,_0x202e32)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x503076,_0x450f0b)=>{_0x433ae3['hasSuggestion'](_0x450f0b['id'])&&(_0x433ae3['getSuggestion'](_0x450f0b['id'])['attributes']=_0x450f0b['attributes']);}),this['_trackChangesService']['connect'](_0x372068['connection'])['then'](_0x2ef356=>(_0x372068['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2ef356)['then'](()=>{for(const _0xfbbc70 of _0x2ef356){_0x433ae3['addSuggestionData'](_0xfbbc70)['_saved']=!0x0;}})));}async['reconnect'](){const _0x14e2fd=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x55d11d}=this['editor']['plugins']['get'](n),_0x4ebd63=await this['_trackChangesService']['connect'](_0x55d11d);await this['_fetchMissingUsersForThreads'](_0x4ebd63);for(const {suggestionData:_0x4ef830,resolve:_0x125b31}of this['_bufferedRequests']['values']()){let _0x2e286b=_0x4ebd63['find'](_0x3e382e=>_0x3e382e['id']===_0x4ef830['id']);_0x2e286b||(_0x2e286b=await this['_trackChangesService']['add'](_0x4ef830['id'],_0x4ef830['type'],_0x4ef830['data'],_0x4ef830['originalSuggestionId'])),_0x125b31(_0x2e286b);}for(const _0x497ee5 of _0x4ebd63)_0x14e2fd['hasSuggestion'](_0x497ee5['id'])||_0x14e2fd['addSuggestionData'](_0x497ee5);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x56067f=>{this['listenTo'](this['_trackChangesService'],'connected',_0x54efed=>{_0x54efed['off'](),_0x56067f();});});}async['_fetchMissingUsersForThreads'](_0x1c77fa){const _0xe00771=this['editor']['plugins']['get'](_0x25284e),{connection:_0x5ed698}=this['editor']['plugins']['get'](n),_0x2faab=new Set();for(const {authorId:_0x36f071}of _0x1c77fa)_0xe00771['getUser'](_0x36f071)||_0x2faab['add'](_0x36f071);if(0x0===_0x2faab['size'])return;const _0x8e3b49=await lt['getMany'](_0x5ed698,Array['from'](_0x2faab));for(const _0x28c3ff of _0x8e3b49)_0xe00771['getUser'](_0x28c3ff['id'])||_0xe00771['addUser'](_0x28c3ff);}}function A(_0x166bf0){if(ut(_0x166bf0))return new Promise(()=>{});throw _0x166bf0;}function ut(_0x47221d){return _0x47221d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x47221d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x2490b2{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1d506b=this['editor']['plugins']['get'](n),_0x3cc56e=this['editor']['plugins']['get']('CommentsEditing'),_0x208fca=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x1d506b,'change:state',(_0x4972d7,_0x223960,_0x5181c6)=>{_0x3cc56e['isThreadsLoadingPaused']='connected'!==_0x5181c6;});}),this['listenTo'](_0x1d506b,'change:state',(_0x568c98,_0x5c5036,_0xdc0cc2)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xdc0cc2);}),_0x208fca['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x2490b2{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x2490b2{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x25284e];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x23224c){super(_0x23224c);const _0x43866a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x43866a);}async['init'](){const _0x36474c=this['editor']['plugins']['get'](l),_0x42ec0c=_0x36474c['serverHistory'],_0x5c3c20=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x42ec0c,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x36474c['sessionId']});const _0x354066=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x32cd4b=await tt['isBundleUploaded'](_0x5c3c20['connection'],_0x354066);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x521391})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x521391)),'updateRevisions':async _0x30c408=>{await this['_waitForServiceReady']();const _0x8bb68c=this['_revisionTracker']['currentRevision'];if(_0x32cd4b&&0x1===_0x30c408['length']&&_0x30c408[0x0]['id']===_0x8bb68c['id'])return _0x30c408;for(const _0x336942 of _0x30c408)_0x336942['id']===_0x8bb68c['id']&&(_0x336942['isEmptyCurrent']=_0x336942['fromVersion']===_0x336942['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x30c408,this['_lastRequestId'])['then'](_0x1cb001=>(this['_lastRequestId']=_0x1cb001,_0x30c408))['catch'](_0x3fb1d8=>{if(st(_0x3fb1d8)||'400'===_0x3fb1d8['code']&&void 0x0!==_0x3fb1d8['data']['wrongRequestId']){for(const _0x4daa6c of _0x30c408){!this['_revisionTracker']['repository']['getRevision'](_0x4daa6c['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4daa6c['id'],_0x4daa6c,!0x1);}if(st(_0x3fb1d8))throw _0x3fb1d8;return _0x30c408;}throw _0x3fb1d8;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3bd256,{revisionsData:_0x596253,requestId:_0xfdc7b7})=>{Math['max'](..._0x596253['map'](_0x5af1f8=>_0x5af1f8['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x596253,_0xfdc7b7);}):this['_handleRevisionsUpdate'](_0x596253,_0xfdc7b7);});const {revisions:_0x4da686,requestId:_0x186b6f}=await this['_revisionHistoryService']['connect'](_0x5c3c20['connection']);_0x5c3c20['addToReconnectionStack'](this),this['_lastRequestId']=_0x186b6f,await this['_fetchMissingUsers'](_0x4da686);for(const _0x1615f4 of _0x4da686)this['_revisionTracker']['addRevisionData'](_0x1615f4);this['listenTo'](_0x36474c,'change:_isConnected',(_0x48a9d9,_0x3c6209,_0x4a413c)=>{_0x4a413c&&(this['_oldOffset']=_0x36474c['_offset'],_0x48a9d9['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5c3c20,'state',_0x46b341=>_0x46b341===te['CONNECTED']);}async['reconnect'](){const _0x35c42f=this['editor']['plugins']['get'](n),_0x4a0ae6=this['editor']['plugins']['get'](l),_0x3ee7e9=async()=>{const _0x439c42=this['_revisionTracker']['currentRevision'],_0xecc613=_0x439c42['id'],_0x562e0e=_0xecc613!==_0x4a0ae6['sessionId'];if(_0x562e0e){const _0x52a75e=_0x4a0ae6['_offset']-this['_oldOffset'],_0x3b20ff=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x439c42['toVersion']+_0x52a75e!==_0x3b20ff){const _0x119c21=_0x439c42['fromVersion']+_0x52a75e,_0x573724=this['editor']['plugins']['get'](_0x25284e),_0x658e7d=this['_revisionTracker']['buildRevisionData']({'revision':_0x439c42,'from':_0x119c21,'to':_0x3b20ff});_0x658e7d['id']=_0x439c42['id'];const _0x40abff=_0x658e7d['authorsIds']['map'](_0x38008d=>_0x573724['getUser'](_0x38008d));_0x439c42['_update']({..._0x658e7d,'authors':_0x40abff},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x439c42['id'],_0x658e7d,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3b20ff,(_0x439c42['toVersion']===_0x439c42['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xecc613)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xecc613),this['_revisionTracker']['_createCurrentRevision'](_0x3b20ff));}const {revisions:_0x2a0501,requestId:_0x505526}=await this['_revisionHistoryService']['reconnect'](_0x35c42f['connection'],this['_lastRequestId']);_0x562e0e&&_0x2a0501['length']>0x0?_0x4a0ae6['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x2a0501),this['_handleRevisionsUpdate'](_0x2a0501,_0x505526),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4a0ae6['_isConnected']?_0x3ee7e9():new Promise((_0xc1692,_0x4c05d4)=>{_0x4a0ae6['once']('change:_isConnected',()=>{_0x3ee7e9()['then'](_0xc1692)['catch'](_0x4c05d4);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x315408=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x34ad4a=>{_0x34ad4a['off'](),_0x315408();});});}['_getLatestVersionFromServerOperations'](){const _0x27f15d=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1258f3 of _0x27f15d)if('marker'!==_0x1258f3['type']||_0x1258f3['affectsData'])return _0x1258f3['baseVersion']+0x1;}['_getLatestVersion'](){const _0x431c89=this['editor']['plugins']['get'](l);return new Promise(_0x478ac9=>{_0x431c89['_isPendingUpdate']?_0x431c89['once']('change:_isPendingUpdate',()=>{_0x478ac9(this['_getLatestVersionFromServerOperations']());}):_0x478ac9(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4de6b7,_0x1a06a0){const _0x15cf92=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x1a06a0;for(const _0x1e486b of _0x4de6b7){const _0x4ea553=_0x15cf92['getRevision'](_0x1e486b['id']);if(_0x4ea553){if((_0x1e486b['fromVersion']||_0x1e486b['toVersion'])&&(_0x1e486b['diffData']=null),_0x4ea553===this['_revisionTracker']['currentRevision']){const _0xc00f94=Math['max'](_0x4ea553['toVersion'],_0x1e486b['toVersion']),_0x3acfe8=Math['max'](_0x4ea553['fromVersion'],_0x1e486b['fromVersion']);let _0x28fb60;_0x4ea553['toVersion']===_0x1e486b['toVersion']&&_0x4ea553['fromVersion']===_0x1e486b['fromVersion']?(_0x28fb60=!0x0,this['_preventResendingRevisionData'](_0x1e486b)):_0x1e486b['toVersion']===_0xc00f94&&_0x1e486b['fromVersion']===_0x3acfe8?_0x28fb60=!0x1:(_0x4ea553['toVersion']===_0xc00f94&&_0x4ea553['fromVersion']===_0x3acfe8||this['_fixRevision']({'revision':_0x4ea553,'from':_0x3acfe8,'to':_0xc00f94}),_0x28fb60=!0x0),_0x28fb60&&(delete _0x1e486b['fromVersion'],delete _0x1e486b['toVersion'],delete _0x1e486b['diffData'],delete _0x1e486b['createdAt'],delete _0x1e486b['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1e486b),this['_preventResendingRevisionData'](_0x1e486b);}else this['_revisionTracker']['addRevisionData'](_0x1e486b);}const _0x53f42b=_0x15cf92['getRevisions']();_0x53f42b['reverse']();for(let _0x12807c=0x0;_0x12807c<_0x53f42b['length']-0x1;_0x12807c++){const _0x5b3965=_0x53f42b[_0x12807c],_0xbf9d29=_0x53f42b[_0x12807c+0x1];if(_0x5b3965['fromVersion']<_0xbf9d29['toVersion']){const _0x3eb533=_0xbf9d29['toVersion'],_0x3e9fc7=Math['max'](_0x3eb533,_0x5b3965['toVersion']);this['_fixRevision']({'revision':_0x5b3965,'from':_0x3eb533,'to':_0x3e9fc7});}}}['_fixRevision']({revision:_0x486257,from:_0xf295f1,to:_0x1f12c4}={}){const _0x23c601=this['editor']['plugins']['get'](_0x25284e),_0x12bcac=this['_revisionTracker']['buildRevisionData']({'revision':_0x486257,'from':_0xf295f1,'to':_0x1f12c4});_0x12bcac['authors']=_0x12bcac['authorsIds']['map'](_0x47826b=>_0x23c601['getUser'](_0x47826b)),_0x486257['_update'](_0x12bcac);}['_preventResendingRevisionData'](_0x116fe0){const _0x35cbf9={};_0x35cbf9['id']=_0x116fe0['id'];for(const _0x4f1b50 of Object['keys'](_0x116fe0))'id'!==_0x4f1b50&&(_0x35cbf9[_0x4f1b50]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x35cbf9['id'],_0x35cbf9,!0x0);}async['_fetchMissingUsers'](_0x591fed){const _0x2d6895=this['editor']['plugins']['get'](_0x25284e),{connection:_0x504c32}=this['editor']['plugins']['get'](n),_0x5b0f0d=new Set();for(const _0x4493ea of _0x591fed){for(const _0x5402e4 of _0x4493ea['authorsIds'])_0x190bab(_0x5402e4);_0x4493ea['creatorId']&&_0x190bab(_0x4493ea['creatorId']);}if(0x0===_0x5b0f0d['size'])return;const _0x49cb15=await lt['getMany'](_0x504c32,Array['from'](_0x5b0f0d));for(const _0x1ed8e3 of _0x49cb15)_0x2d6895['getUser'](_0x1ed8e3['id'])||_0x2d6895['addUser'](_0x1ed8e3);function _0x190bab(_0x49704d){_0x2d6895['getUser'](_0x49704d)||_0x5b0f0d['add'](_0x49704d);}}}function st(_0x29b616){return _0x29b616['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x29b616['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x29b616['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x2490b2{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0xa55d2c{['_collapseAt'];constructor(_0x1df6ca,_0x58d6d0=0x6){super(_0x1df6ca);const _0x251ed3=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x58d6d0,this['bind']('isHidden')['to'](this,'usersCount',_0x698abf=>_0x698abf<_0x58d6d0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x251ed3['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x251ed3['to']('usersCount',_0x2104a7=>'+'+(_0x2104a7-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0xa55d2c{['items'];['keystrokes'];constructor(_0x250b9c){super(_0x250b9c);const _0x24c69c=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2211c5(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x24c69c['if']('hasPopup'),'aria-expanded':_0x24c69c['to']('isExpanded',_0xd3b687=>this['hasPopup']&&String(_0xd3b687)),'aria-label':_0x24c69c['to']('hasPopup',_0x21cb7e=>W(_0x250b9c,_0x21cb7e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x24c69c['to']('hasPopup',_0x4cf4ae=>!!_0x4cf4ae&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x24c69c['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x24c69c['to'](_0x2cbd2b=>{const _0x193e6c=_0x2cbd2b,_0x329358=document['querySelector']('.ck-presence-list__dropdown-list'),_0xaf333f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x329358?.['contains'](_0x193e6c['relatedTarget'])||_0xaf333f?.['contains'](_0x193e6c['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x14dca7,_0x448fe3,_0x37999a)=>{this['element']&&(_0x37999a?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class k extends _0xa55d2c{['counterView'];['inlineListView'];constructor(_0x22f7c7,_0xe1316=0x6){super(_0x22f7c7);const _0x23ca98=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0xe1316),this['inlineListView']=new is(_0x22f7c7),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xdd1aa9 of this['inlineListView']['items'])_0xdd1aa9['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',_0x23ca98['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0xa55d2c{['listWrapperView'];constructor(_0x416147,_0x17c75c){super(_0x416147);const _0x5e650e=this['bindTemplate'];this['listWrapperView']=new pt(_0x416147,_0x17c75c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':W(_0x416147,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5e650e['to'](_0x4b85c6=>{const _0x57a2df=_0x4b85c6,_0x415cdb=document['querySelector']('.ck-presence-list__list'),_0x98e6a5=document['querySelector']('.ck-balloon-panel_with-arrow');_0x415cdb?.['contains'](_0x57a2df['relatedTarget'])||_0x98e6a5?.['contains'](_0x57a2df['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x1e16aa{constructor(_0x5aa710,_0x2ebf06){super(_0x5aa710);const _0x165230=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2ebf06?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x165230['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x165230['to']('role'),'aria-label':_0x165230['to']('ariaLabel'),'aria-labelledby':_0x165230['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x5ee5cc['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x361d11=this['element'];_0x361d11&&(this['_isScrollable']=Math['max'](_0x361d11['scrollHeight'],_0x361d11['clientHeight'])>0.8*window['innerHeight']);}}class P extends rt{['userView'];constructor(_0x121866,_0x318114,_0x4ffe41){super(_0x121866);const _0x4a3a0d=this['bindTemplate'];this['userView']=new ct(_0x121866,_0x318114);const _0xfdca50={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x318114['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x318114['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x318114['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4ffe41&&(_0xfdca50['tag']='button',_0xfdca50['on']={'click':_0x4a3a0d['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xfdca50);}['focus'](){this['element']['focus']();}}class _ extends _0xa55d2c{['userView'];['markerView'];constructor(_0xaa8f,_0x367fc6,_0x43595b){super(_0xaa8f);const _0x277cfb=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xaa8f,_0x367fc6),this['markerView']=new at(_0xaa8f,_0x367fc6);const _0x1c8a89=new ot(_0xaa8f);_0x1c8a89['template']['tag']='span',_0x1c8a89['text']=_0x367fc6['name'];const _0x4ebf00={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x277cfb['to']('isFocusable',_0x21d6f8=>!!_0x21d6f8&&0x0),'aria-labelledby':_0x1c8a89['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x277cfb['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x277cfb['to']('hasTooltip',_0x37b272=>!_0x37b272),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1c8a89]};_0x43595b&&(_0x4ebf00['tag']='button',_0x4ebf00['on']={'click':_0x277cfb['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4ebf00);}}class at extends _0xa55d2c{constructor(_0x24cf59,_0x5cacf3){super(_0x24cf59),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5cacf3['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x29f1b4{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x150ea2){super(_0x150ea2),this['context']['config']['define']('presenceList',U);const _0x399f69=_0x150ea2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x399f69)throw new _0x5a1e76('presencelist-collapseat-invalid-format',this);if(_0x399f69<0x1)throw new _0x5a1e76('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4487ac(),this['balloonPanelView']=new _0x4bbc8a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x1697fd of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1697fd);this['listenTo'](this['_allConnectedUsers'],'add',(_0x3421d3,_0x5a51c1)=>{this['_handleUserAdd'](_0x5a51c1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x262b94,_0x1aece9)=>{this['_handleUserRemove'](_0x1aece9);});}['_createView'](){const _0x20e6c1=this['context'],_0x17b6bf=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3ee452=this['balloonPanelView'];if(!_0x548adc(_0x20e6c1['config']['get']('presenceList.container')))throw new _0x5a1e76('presencelist-missing-container',this);return _0x17b6bf['counterView']['bind']('usersCount')['to'](this),_0x17b6bf['bind']('isCollapsed')['to'](this,'usersCount',_0x3ed95e=>{const {collapseAt:_0x47d35c}=_0x20e6c1['config']['get']('presenceList'),_0x1cf9aa=_0x3ed95e>=_0x47d35c;if(_0x1cf9aa&&!_0x17b6bf['inlineListView']['items']['find'](_0x38cbcf=>_0x38cbcf instanceof y)){const _0xb51475=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xb51475&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x17b6bf['inlineListView']['items']['add'](_0x17b6bf['counterView']);}return _0x1cf9aa||this['hideDropdown'](),_0x1cf9aa;}),_0x17b6bf['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x5f01e2=>{const _0x282e08=_0x20e6c1['config']['get']('presenceList'),_0x268da3=new _(_0x20e6c1['locale'],_0x5f01e2,!!_0x282e08['onClick']);return _0x268da3['bind']('hasTooltip')['to'](_0x17b6bf,'isCollapsed',_0x54ba6f=>!_0x54ba6f),_0x268da3['bind']('isFocusable')['to'](_0x17b6bf,'isCollapsed',_0x503faf=>!_0x503faf),_0x282e08['onClick']&&this['listenTo'](_0x268da3,'execute',()=>{this['view']['isCollapsed']||_0x282e08['onClick'](_0x5f01e2,_0x268da3['element']);}),_0x268da3;}),this['listenTo'](_0x17b6bf['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x17b6bf['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x17b6bf['inlineListView']['keystrokes']['set']('Enter',(_0x310693,_0x499789)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x499789());}),_0x17b6bf['render'](),_0x3ee452['render'](),_0x5b9ca2({'emitter':_0x17b6bf,'activator':()=>_0x3ee452['isVisible'],'contextElements':[_0x3ee452['element'],_0x17b6bf['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x20e6c1['config']['get']('presenceList.container')['appendChild'](_0x17b6bf['element']),this['_bodyCollection']=new _0x417e44(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x17b6bf;}['_handleUserAdd'](_0x583499){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x583499['isMe'])return;const _0x4d471d=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x4d471d-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xd70e20=_0x583499['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x583499,_0xd70e20);}['_handleUserRemove'](_0xbcc04a){this['usersCount']--;const {collapseAt:_0x39184d}=this['context']['config']['get']('presenceList'),_0x2b4ecc=this['usersCount']>=_0x39184d;if(this['currentDisplayedUsers']['get'](_0xbcc04a['id']))this['currentDisplayedUsers']['remove'](_0xbcc04a['id']);else{if(_0x2b4ecc&&this['currentDisplayedUsers']['length']+0x1===_0x39184d-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x2b4ecc?0x1:0x0)<this['usersCount']){for(const _0x11cf90 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x11cf90['id'])&&(this['currentDisplayedUsers']['add'](_0x11cf90,Math['min'](this['currentDisplayedUsers']['length']-(_0x2b4ecc?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x2b4ecc?0x1:0x0)===_0x39184d-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x198590=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x198590['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x4d50a8}=this['presenceDropdownView'];_0x4d50a8['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x319b56=>{if(!_0x198590['displayMe']&&_0x319b56['isMe'])return null;const _0x15fefd=new P(this['context']['locale'],_0x319b56,!!_0x198590['onClick']);return _0x198590['onClick']&&this['listenTo'](_0x15fefd,'execute',()=>{_0x198590['onClick'](_0x319b56,_0x15fefd['element']);}),_0x15fefd;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x4d50a8['focus'](),_0x4d50a8['checkIfScrollable']();const _0x2532d4=(_0x22fe9a,_0x52ea30)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x52ea30();};_0x4d50a8['keystrokes']['set']('Esc',_0x2532d4),_0x4d50a8['keystrokes']['set']('Shift+Tab',_0x2532d4),_0x4d50a8['keystrokes']['set']('Tab',(_0xc0c62a,_0x3290eb)=>{!function(_0x215328){const _0x7a3d05=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x12f569=>_0x12f569+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x153ec1=[...document['body']['querySelectorAll'](_0x7a3d05)]['filter'](_0x377c71=>_0x377c71===document['activeElement']||_0x377c71['offsetWidth']+_0x377c71['offsetHeight']>0x0)['sort']((_0x120f48,_0xe827bc)=>(_0x120f48['tabIndex']||0x0)-(_0xe827bc['tabIndex']||0x0)),_0x35474a=_0x153ec1['indexOf'](_0x215328),_0x37c380=_0x153ec1[(_0x35474a+0x1)%_0x153ec1['length']];_0x37c380&&_0x37c380['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3290eb();}),_0x4d50a8['focusTracker']['add'](this['view']['element']),_0x4d50a8['focusTracker']['on']('change:isFocused',(_0x3383fb,_0x13be3e,_0x1c2a98)=>{_0x1c2a98||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class gt extends _0x29f1b4{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -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':_0x2c506d=>0x1!=_0x2c506d}};
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':_0x40e77f=>0x1!=_0x40e77f}};