@ckeditor/ckeditor5-real-time-collaboration 47.7.2 → 47.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +2 -2
  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 +15 -15
  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 _0x4067ea,Plugin as _0x1e5d58,PendingActions as _0x5a7c8a,Context as _0x2e2ce6}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x9de3d6,CKEditorError as _0x3a9443,Collection as _0x36276b,global as _0x19a405,version as nt,uid as _0x36f6e1,KeystrokeHandler as _0x745df6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x529457,View as _0x4bb216,ListView as _0x3e031c,ListItemView as st,LabelView as at,BalloonPanelView as _0x2a3eb9,clickOutsideHandler as _0x56d96c,BodyCollection as _0x20e53c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x1d7bba,History as _0x5e4bad,NoOperation as _0x2546a3,InsertOperation as _0x543630,MarkerOperation as _0x49f499,RootAttributeOperation as _0x15a55f,transformOperationSets as _0x5cbfc9,OperationFactory as _0x1c848c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ct,WEB_SOCKET_GATEWAY_STATES as _0x3d1e25,CollaborativeEditingService as _0x4e90ee,User as ht,CommentsService as _0x5409e7,TrackChangesService as it,RevisionHistoryService as _0x5df08f,EditorService as _0xd9b4ec}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x52815c,UserView as rt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x20e1aa}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x15409c}from'es-toolkit/compat';class n extends _0x4067ea{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ct)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x529457];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x542bf0){super(_0x542bf0),this['set']('state',_0x3d1e25['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x9de3d6())();}['init'](){const _0x1c1466=this['context'],_0x267924=_0x1c1466['plugins']['get']('CloudServices'),_0x515dc8=_0x1c1466['plugins']['get'](_0x529457);if(!_0x267924['token'])throw new _0x3a9443('websocketgateway-missing-token',this);if(!_0x267924['webSocketUrl'])throw new _0x3a9443('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'](_0x267924['token'],_0x267924['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x16f026=>{if(this['connection']=_0x16f026,this['bind']('state')['to'](_0x16f026,'state',this,'_isBrowserOffline',(_0x56900a,_0x3177af)=>('connected'!==_0x56900a&&(this['_shouldPluginsReconnect']=!0x0),_0x3177af||_0x56900a!==_0x3d1e25['CONNECTED']?_0x3d1e25['DISCONNECTED']:this['state']==_0x3d1e25['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3d1e25['CONNECTING']):_0x3d1e25['CONNECTED'])),this['connection']['on']('error',(_0x580c1b,_0x5a466c)=>{if('limitExceeded'!==_0x5a466c['code'])throw console['error'](_0x5a466c),new _0x3a9443('cloudservices-init',null,{'originalError':_0x5a466c});_0x515dc8['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'});}),!_0x16f026['me'])return new Promise(_0x318735=>_0x16f026['on']('change:me',_0x318735));})['catch'](_0x535197=>{throw console['error'](_0x535197),new _0x3a9443('cloudservices-init',null,{'originalError':_0x535197});});}['addToReconnectionStack'](_0x2ece9d){if('function'!=typeof _0x2ece9d['reconnect'])throw new _0x3a9443('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x2ece9d))throw new _0x3a9443('websocketgateway-plugin-already-registered',this,{'name':_0x2ece9d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x2ece9d);}['removeFromReconnectionStack'](_0x272840){this['_reconnectionStack']['delete'](_0x272840);}['isInReconnectionStack'](_0x58ef87){return this['_reconnectionStack']['has'](_0x58ef87);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x226439=>_0x226439['reconnect']())))['then'](()=>this['state']=_0x3d1e25['CONNECTED'])['catch'](_0x250ae0=>{throw console['error'](_0x250ae0),new _0x3a9443('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3d1e25['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x4067ea{['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,_0x52815c];}constructor(_0x1b192f){super(_0x1b192f),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x36276b(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x52815c);}['init'](){const _0x1e0424=this['context']['plugins']['get'](n);this['listenTo'](_0x1e0424,'change:state',(_0xbb87e3,_0x5808bf,_0x29a966)=>{if('connected'!==_0x29a966)this['channelSessions']['forEach'](_0x21fcad=>_0x21fcad['clear']()),this['channelConnectedUsers']['forEach'](_0x4fcf90=>_0x4fcf90['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x358ca8,_0x3d1d4b]of this['_registeredSessions'])for(const _0x24c3a5 of _0x3d1d4b)this['_handleSessionAdd'](_0x358ca8,_0x24c3a5);}}),this['_createUser'](_0x1e0424['connection']['me'],!0x0);}['register'](_0x292ecd,_0x126cda){if(this['_registeredSessions']['has'](_0x292ecd))throw new _0x3a9443('sessions-register-already-registered',null,{'channelId':_0x292ecd});this['_registeredSessions']['set'](_0x292ecd,_0x126cda),this['channelSessions']['set'](_0x292ecd,new _0x36276b()),this['channelConnectedUsers']['set'](_0x292ecd,new _0x36276b()),this['listenTo'](_0x126cda,'add',(_0x417762,_0x4fd045)=>this['_handleSessionAdd'](_0x292ecd,_0x4fd045)),this['listenTo'](_0x126cda,'remove',(_0x1f12d1,_0x3407fc)=>this['_handleSessionRemove'](_0x292ecd,_0x3407fc));for(const _0x5bab84 of _0x126cda)this['_handleSessionAdd'](_0x292ecd,_0x5bab84);}['unregister'](_0x271124){if(!this['_registeredSessions']['has'](_0x271124))throw new _0x3a9443('sessions-unregister-not-exist',null,{'channelId':_0x271124});const _0x37aff5=this['_registeredSessions']['get'](_0x271124);this['stopListening'](_0x37aff5);for(const _0x32f724 of _0x37aff5)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x271124,_0x32f724);this['_registeredSessions']['delete'](_0x271124),this['channelSessions']['delete'](_0x271124),this['channelConnectedUsers']['delete'](_0x271124);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x64267b){for(const _0x20b31f of this['channelSessions']['values']())for(const _0x9fa30c of _0x20b31f)if(_0x9fa30c['id']===_0x64267b)return _0x9fa30c['user'];}['getUserSessions'](_0x3e1c26,_0x52d250){const _0x5b46d5=_0x52d250?[this['channelSessions']['get'](_0x52d250)]:this['channelSessions']['values'](),_0x1655ba=new Set();for(const _0x1b8fb5 of _0x5b46d5)for(const _0x39ebb0 of _0x1b8fb5)_0x39ebb0['user']['id']===_0x3e1c26['id']&&_0x1655ba['add'](_0x39ebb0['id']);return _0x1655ba;}['getUserRole'](_0x41c342){for(const _0x6268da of this['channelSessions']['values']())for(const _0x4ebae3 of _0x6268da)if(_0x4ebae3['user']===_0x41c342)return _0x4ebae3['role'];}['_handleSessionAdd'](_0x492aa1,_0x2d0812){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3de37a=_0x2d0812['user'],_0x18b28f=this['_users']['getUser'](_0x3de37a['id'])||this['_createUser'](_0x3de37a),_0x58041e=Object['assign']({},_0x2d0812,{'user':_0x18b28f});if(this['channelSessions']['get'](_0x492aa1)['add'](_0x58041e),!_0x3de37a['hiddenInPresenceList']){const _0x1ce21e=this['channelConnectedUsers']['get'](_0x492aa1);_0x1ce21e['has'](_0x18b28f['id'])||_0x1ce21e['add'](_0x18b28f),this['allConnectedUsers']['has'](_0x18b28f['id'])||_0x3de37a['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x18b28f,_0x18b28f['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x492aa1,{'channelId':_0x492aa1,'session':_0x58041e});}['_handleSessionRemove'](_0x4c959d,_0x537b49){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x22e527=this['channelConnectedUsers']['get'](_0x4c959d),_0x293332=_0x537b49['user'];_0x293332['id']&&(this['channelSessions']['get'](_0x4c959d)['remove'](_0x537b49['id']),_0x22e527['has'](_0x293332['id'])&&!this['getUserSessions'](_0x293332,_0x4c959d)['size']&&_0x22e527['remove'](_0x293332['id']),this['allConnectedUsers']['get'](_0x293332['id'])&&!this['getUserSessions'](_0x293332)['size']&&this['allConnectedUsers']['remove'](_0x293332['id']));}['_createUser'](_0x5adabb,_0x311438){const _0x503701=this['_users']['addUser'](_0x5adabb);return _0x311438&&this['_users']['defineMe'](_0x5adabb['id']),_0x503701['orderNumber']=this['_uniqueUsersCount']++,_0x503701;}}class z extends _0x1e5d58{['_domEmitter']=new(_0x9de3d6())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x317318=this['editor'],_0xd8dbef=_0x317318['plugins']['get'](i);_0x317318['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x9ef1c5,{writer:_0x24f68d})=>function(_0x41a19c,_0x2dfcea,_0x29ee1a,_0x6eaad){const _0x2b07c4=_0x41a19c['markerName']['split'](':')[0x2],_0x4b4b20=_0x29ee1a['getUserBySessionId'](_0x2b07c4);if(!_0x4b4b20||_0x2b07c4===_0x29ee1a['mySessionId'])return;if(!_0x6eaad['model']['schema']['checkChild'](_0x41a19c['markerRange']['start'],'$text'))return;const _0x139636={'class':'ck-user__marker\x20'+_0x4b4b20['color']['getMarkerClass'](),'data-name':_0x4b4b20['name'],'data-session-id':_0x2b07c4},_0x1f8f6d=_0x6eaad['model']['markers']['get'](_0x41a19c['markerName']),_0x51715b=_0x1f8f6d['getStart'](),_0x25831e=_0x51715b['nodeAfter'],_0x414ee7=_0x6eaad['model']['schema'];if(_0x25831e&&_0x414ee7['isObject'](_0x25831e)&&_0x414ee7['isInline'](_0x25831e)&&!_0x6eaad['model']['markers']['get']('user:range:'+_0x2b07c4)['getRange']()['isCollapsed'])return;const _0x358f8b=_0x51715b['parent'];return _0x6eaad['model']['schema']['isLimit'](_0x358f8b)&&!_0x6eaad['model']['hasContent'](_0x358f8b)&&(_0x139636['contenteditable']=!0x1),function(_0x4de50c,_0x464e62,_0x430ab){const _0x3a4321=_0x4de50c['createUIElement']('span',_0x464e62);return _0x4de50c['setCustomProperty']('userPositionMarker',!0x0,_0x3a4321),_0x3a4321['render']=function(_0x1ebc29){const _0x25c328=this['toDomElement'](_0x1ebc29),_0x4d2420=document['createElement']('span');return _0x4d2420['classList']['add']('ck-user__marker-tooltip'),_0x4d2420['setAttribute']('contenteditable','false'),_0x4d2420['setAttribute']('spellcheck','false'),_0x4d2420['textContent']=_0x430ab['name'],_0x25c328['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x4d2420['outerHTML']+'⁠',_0x25c328['addEventListener']('mouseenter',()=>{_0x25c328['classList']['add']('ck-user__marker_hovered');}),_0x25c328['addEventListener']('mouseleave',()=>{_0x25c328['classList']['remove']('ck-user__marker_hovered');}),_0x25c328;},_0x3a4321['isSimilar']=function(_0x62d181){return!(!this['getCustomProperty']('userPositionMarker')||!_0x62d181['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x62d181['getAttribute']('data-session-id'));},_0x3a4321;}(_0x2dfcea,_0x139636,_0x4b4b20);}(_0x9ef1c5,_0x24f68d,_0xd8dbef,_0x317318)}),_0x317318['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x560850=>function(_0xf16640,_0x251ab4){const _0xda280b=_0xf16640['markerName']['split'](':')[0x2];if(_0xda280b===_0x251ab4['mySessionId'])return null;const _0x2789fa=_0x251ab4['getUserBySessionId'](_0xda280b);if(!_0x2789fa)return{'id':_0xda280b,'classes':[]};return{'id':_0xda280b,'classes':['ck-user__selection',_0x2789fa['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xda280b},'priority':0x7d0+_0x2789fa['orderNumber']};}(_0x560850,_0xd8dbef)}),function(_0x5ac737){const _0x47eb82=_0x5ac737['model'],_0x3429c7=new Map(),_0x588c80=_0x5ac737['plugins']['get'](i);_0x47eb82['markers']['on']('update:user:range',(_0x27e51a,_0x4d6c15,_0x14ae60,_0x3d402e)=>{if(!_0x3d402e&&_0x3429c7['get'](_0x4d6c15['name']))return _0x3429c7['get'](_0x4d6c15['name'])['detach'](),void _0x3429c7['delete'](_0x4d6c15['name']);const _0x47c46f=_0x4d6c15['name']['split'](':')[0x2];if(_0x47c46f===_0x588c80['mySessionId'])return;const _0x3feca6='user:position:'+_0x47c46f;_0x47eb82['markers']['has'](_0x3feca6)&&_0x5ac737['editing']['reconvertMarker'](_0x3feca6),_0x4d6c15['on']('change:range',(_0x1c9a7e,_0x51d58b,_0x4581ac)=>{if('$graveyard'!=_0x51d58b['root']['rootName']&&'$graveyard'==_0x4d6c15['getRange']()['root']['rootName']&&!_0x3429c7['has'](_0x4d6c15['name'])){const _0x22dc71=_0x47eb82['schema']['getNearestSelectionRange'](_0x4581ac['deletionPosition']);if(_0x22dc71){const _0x4bf1ef=_0x1d7bba['fromRange'](_0x22dc71);_0x3429c7['set'](_0x4d6c15['name'],_0x4bf1ef),_0x4bf1ef['on']('change:range',(_0x4d640d,_0x172339,_0x34e5fd)=>{if('$graveyard'==_0x4bf1ef['root']['rootName']){const _0x207cd5=_0x47eb82['schema']['getNearestSelectionRange'](_0x34e5fd['deletionPosition']);_0x207cd5?(_0x4bf1ef['start']=_0x207cd5['start'],_0x4bf1ef['end']=_0x207cd5['end']):(_0x3429c7['delete'](_0x4d6c15['name']),_0x4bf1ef['detach']());}});}}});}),_0x47eb82['document']['on']('change',()=>{_0x3429c7['size']>0x0&&_0x47eb82['enqueueChange']({'isUndoable':!0x1},_0x520bbd=>{for(const [_0x501bf0,_0x3a538c]of _0x3429c7)'$graveyard'==_0x47eb82['markers']['get'](_0x501bf0)['getRange']()['root']['rootName']&&(Q(_0x501bf0['split'](':')[0x2],_0x3a538c['toRange'](),_0x47eb82,_0x520bbd),_0x3a538c['detach']());_0x3429c7['clear']();});});}(_0x317318),this['_domEmitter']['listenTo'](_0x19a405['document'],'keydown',(_0x5844d4,{key:_0x2056ac})=>{'Escape'===_0x2056ac&&function(_0x1d486e){_0x1d486e['editing']['view']['change'](_0x5ef634=>{for(const _0x2ecf80 of _0x1d486e['model']['markers']){if(!_0x2ecf80['name']['startsWith']('user:position'))continue;const _0x44269a=_0x1d486e['editing']['mapper']['markerNameToElements'](_0x2ecf80['name']);if(_0x44269a){for(const _0x467e61 of _0x44269a)_0x5ef634['removeClass']('ck-user__marker_hovered',_0x467e61);}}});}(_0x317318);},{'useCapture':!0x0});}['afterInit'](){const _0x492ef9=this['editor'],_0x15183e=_0x492ef9['commands']['get']('undo');_0x15183e&&_0x492ef9['model']['on']('applyOperation',(_0x5850ce,_0x4e55ca)=>{const _0x912c42=_0x4e55ca[0x0];if(!_0x912c42['isDocumentOperation'])return;if('marker'!=_0x912c42['type']||!_0x912c42['name']['startsWith']('user:'))return;const _0x3a81dc=_0x912c42['batch'];_0x15183e['_createdBatches']['has'](_0x3a81dc)&&(_0x912c42['newRange']=_0x912c42['oldRange']?_0x492ef9['model']['createRange'](_0x912c42['oldRange']['start'],_0x912c42['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x5da213=this['editor'],_0x3ed0a5=_0x5da213['model']['document'],_0x5736eb=_0x5da213['plugins']['get'](i);_0x5da213['model']['enqueueChange']({'isUndoable':!0x1},_0x25cd73=>{const _0x3830bb='user:range:'+_0x5736eb['mySessionId'],_0x37a038='user:position:'+_0x5736eb['mySessionId'],_0x354d2e=_0x5da213['model']['markers']['has'](_0x3830bb);_0x5da213['editing']['view']['hasDomSelection']?Q(_0x5736eb['mySessionId'],_0x3ed0a5['selection']['getFirstRange'](),_0x5da213['model'],_0x25cd73):_0x354d2e&&(_0x25cd73['removeMarker'](_0x3830bb),_0x25cd73['removeMarker'](_0x37a038));});}}function Q(_0x5715ee,_0x10a03c,_0x5d2fcb,_0xa9dadf){const _0x516d1f='user:range:'+_0x5715ee,_0x3f4737='user:position:'+_0x5715ee,_0x480e19=_0x10a03c['getContainedElement']();let _0x5db0d1=_0x10a03c['start'];if(_0x480e19&&_0x480e19['is']('element','tableCell')){const _0x24b213=function(_0x2f794a,_0x800835){for(const _0x3c7db6 of _0x2f794a['getPositions']())if(_0x800835['schema']['checkChild'](_0x3c7db6,'$text'))return _0x3c7db6;}(_0x10a03c,_0x5d2fcb);_0x24b213&&(_0x5db0d1=_0x24b213,_0x10a03c=_0xa9dadf['createRange'](_0x5db0d1));}const _0x575409=_0xa9dadf['createRange'](_0x5db0d1);_0x5d2fcb['markers']['has'](_0x516d1f)?(_0xa9dadf['updateMarker'](_0x516d1f,{'range':_0x10a03c}),_0xa9dadf['updateMarker'](_0x3f4737,{'range':_0x575409})):(_0xa9dadf['addMarker'](_0x516d1f,{'range':_0x10a03c,'usingOperation':!0x0}),_0xa9dadf['addMarker'](_0x3f4737,{'range':_0x575409,'usingOperation':!0x0}));}function V(_0x4ede6b,_0x56be7e,_0x386937){const _0x547919=_0x4ede6b['t'],t=_0x4ede6b['t'];switch(_0x56be7e){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 _0x547919({'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'},_0x386937);default:return'';}}let q=0x1;class l extends _0x1e5d58{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x4e90ee)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,z,_0x5a7c8a,_0x52815c,_0x529457];}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 _0x3b8993=this['serverHistory']['getOperations']();for(let _0x177d6e=_0x3b8993['length']-0x1;_0x177d6e>=0x0;_0x177d6e--){const _0x59f814=_0x3b8993[_0x177d6e];if(!this['_disconnectionOperations']['has'](_0x59f814))return _0x59f814['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2576e5){if(super(_0x2576e5),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5e4bad(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3a9443('collaboration-missing-channelid',this);const _0x50fc68=_0x2576e5['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x50fc68,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x20e1aa(),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 OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x1ebe20=this['editor'],_0x4ba413=_0x1ebe20['plugins']['get'](_0x52815c),_0x5ae507=_0x1ebe20['plugins']['get'](n);this['listenTo'](_0x4ba413,'getOperationAuthor',(_0x579b2e,_0x5b5a63)=>{const _0x27e52a=_0x5b5a63[0x0];_0x27e52a['_authorId']&&(_0x579b2e['return']=_0x4ba413['getUser'](_0x27e52a['_authorId']),_0x579b2e['stop']()),null===_0x27e52a['_authorId']&&(_0x579b2e['return']=null,_0x579b2e['stop']());},{'priority':'high'}),this['listenTo'](_0x1ebe20['model']['document']['selection'],'change:range',(_0x46ccd2,_0x4a2de1)=>{_0x4a2de1['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1ebe20['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1ebe20['model']['on']('applyOperation',(_0x4cc979,_0x571a82)=>{const _0x507c5d=_0x571a82[0x0];_0x507c5d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x507c5d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5ae507,'state',this,'_hasSynchronizationProblem',(_0x583d3f,_0x5bb0f1)=>'connected'===_0x583d3f&&!_0x5bb0f1),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1ebe20['disableReadOnlyMode']('rtc-offline'):_0x1ebe20['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1ebe20['disableReadOnlyMode']('rtc-offline'):_0x1ebe20['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4eedaa=this['editor']['plugins']['get'](i),_0x5b2cd4=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4eedaa['unregister'](this['_channelId']);const _0xadb81c=await this['_service']['reconnect'](_0x5b2cd4['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0xadb81c)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3170d0=await this['_service']['getConnectedSessions']();_0x4eedaa['register'](this['_channelId'],_0x3170d0),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x531250){if(function(_0x3537e1){return'404'===_0x3537e1['code'];}(_0x531250)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5477f0){return'409'===_0x5477f0['code'];}(_0x531250)){const _0x50772a=V(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'](_0x50772a);}else{if(!(_0x531250 instanceof ReconnectionError))throw _0x531250;this['_handleReconnectionError']();}}}}['destroy'](){const _0x14c35a=this['editor']['plugins']['get'](n),_0x48b3c6=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x48b3c6['channelSessions']['has'](this['_channelId'])&&_0x48b3c6['unregister'](this['_channelId']),_0x14c35a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x25b259){if(this['sessionId']!==_0x25b259['sessionId']&&this['_lastSyncedOperationId']!==_0x25b259['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x25b259['sessionId'],this['_handleServerResponse']([],{..._0x25b259,'wereChangesApplied':!0x1,'data':_0x25b259['data']},'reconnect');}async['_connectService'](_0x2bd98c,_0x18ad12=!0x1){const {connection:_0x255099}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x255099,this['_channelId'])['then'](_0x5a42bc=>this['_initSessionsHandling'](_0x5a42bc))['catch'](_0x5de325=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5de325);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4d14c0,_0x19ea48)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x19ea48);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x21a10c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2bd98c);this['_isPendingUpdate']=!0x0;const _0x549ed0=await this['_service']['connect'](_0x255099,this['_compressOperations'](_0x2bd98c),_0x21a10c);if(this['sessionId']=_0x549ed0['sessionId'],_0x18ad12){if(!_0x549ed0['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x549ed0['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2bd98c,_0x549ed0,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x549ed0,_0x2bd98c);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x583e1a=this['editor']['plugins']['get'](i),_0x1d6a86=this['editor']['plugins']['get'](z),_0x595a3c=_0x583e1a['channelSessions']['get'](this['_channelId']);_0x595a3c&&_0x595a3c['length']>0x1?_0x1d6a86['createUserMarkerOperations']():this['listenTo'](_0x583e1a,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x583e1a['channelSessions']['get'](this['_channelId'])['length']&&_0x1d6a86['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x19242b,_0x337542,_0x6bebc1,_0x1704dd){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x337542){const _0x3310fe=this['_decompressOperations'](_0x6bebc1,_0x1704dd);await this['_fetchMissingUsers'](_0x3310fe),this['_handleExternalOperations'](_0x3310fe,_0x337542,_0x6bebc1['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x519571}=this['editor'];let _0x402036;try{_0x402036=await this['_service']['getDocumentDetails']();}catch{const _0x4f6712=V(_0x519571,'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'](_0x4f6712);}const _0x5367fe=_0x402036['currentDocumentSession']||_0x402036['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5367fe['lastOperationId']){const _0x56c553=V(_0x519571,'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'](_0x56c553);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xde3909){const _0xabb3e3=this['editor']['plugins']['get'](i);this['listenTo'](_0xabb3e3,'sessionAdd:'+this['_channelId'],(_0x3717e0,{session:_0x8f56ad})=>{if(_0x8f56ad['id']===_0xabb3e3['mySessionId']){_0x3717e0['off']();const _0x1b9be3=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4fd702=_0x8f56ad['permissions'];_0x1b9be3&&_0x1b9be3['isEnabled']&&(_0x4fd702=_0x4fd702['filter'](_0x148a3c=>'document:write'!==_0x148a3c)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4fd702,this['_channelId']);}}),_0xabb3e3['register'](this['_channelId'],_0xde3909);}['_initThrowingOnDataSet'](){const _0x36725e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x352993)=>{if(!_0x352993[_0x352993['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3a9443('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x36725e['apply'](this['editor']['data'],_0x352993);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4ec234,[_0x214f36])=>{if(this['_document']['version'])throw new _0x3a9443('realtimecollaborationclient-init-document-already-initialized',this);_0x4ec234['stop'](),this['_setPendingAction']();const _0x2e38ad=this['editor']['config']['get']('rootsAttributes'),_0x15b9f0=this['_getOperationsFromInitData'](_0x214f36,_0x2e38ad);0x0==_0x15b9f0['length']&&_0x15b9f0['push'](new _0x2546a3(0x0)),_0x4ec234['return']=this['_connectService'](_0x15b9f0)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x546ad8=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x546ad8))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x57587a,[_0x5e395c,_0x220428])=>{_0x57587a['stop']();const _0x5af114=this['editor']['model']['document']['getRoot'](_0x5e395c);if(!this['_knownRootNames']['has'](_0x5e395c)){const _0x122d3d=_0x220428&&_0x220428['data']?_0x220428['data']:'',_0x327d8a=_0x220428&&_0x220428['attributes']?_0x220428['attributes']:{};await this['_loadRoot'](_0x5e395c,_0x122d3d,_0x327d8a);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x5af114['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x5af114);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x103cb1){const _0x28162d=this['editor']['plugins']['get'](_0x52815c),{connection:_0x12892e}=this['editor']['plugins']['get'](n),_0x1c6b5c=new Set();for(const _0x4a037a of _0x103cb1){const _0xec7c92=_0x4a037a['_authorId'];_0xec7c92&&!_0x28162d['getUser'](_0xec7c92)&&_0x1c6b5c['add'](_0xec7c92);}if(0x0===_0x1c6b5c['size'])return;const _0x449f6a=await ht['getMany'](_0x12892e,Array['from'](_0x1c6b5c));for(const _0x3f9889 of _0x449f6a)_0x28162d['getUser'](_0x3f9889['id'])||_0x28162d['addUser'](_0x3f9889);}['_getOperationsFromInitData'](_0x46003b,_0x420977={}){const _0x45dd63=this['editor']['model'],_0x210ab8=[];let _0x1fffce=0x0;const _0xb92397='string'==typeof _0x46003b?{'main':_0x46003b}:_0x46003b;for(const _0x1869b2 of Object['keys'](_0xb92397)){if(!this['_document']['roots']['has'](_0x1869b2))throw new _0x3a9443('realtimecollaborationclient-init-non-existent-root',this);const _0x3ee0cc=this['editor']['data']['parse'](_0xb92397[_0x1869b2]),_0xc501a9=this['_document']['getRoot'](_0x1869b2),_0x4267f0=new _0x543630(_0x45dd63['createPositionAt'](_0xc501a9,0x0),_0x3ee0cc,_0x1fffce++);_0x210ab8['push'](_0x4267f0);for(const [_0x180c14,_0x99b986]of _0x3ee0cc['markers']){const _0x31d8a8=_0x45dd63['createRange'](_0x45dd63['createPositionFromPath'](_0xc501a9,_0x99b986['start']['path']['slice']()),_0x45dd63['createPositionFromPath'](_0xc501a9,_0x99b986['end']['path']['slice']())),_0x251d33=new _0x49f499(_0x180c14,null,_0x31d8a8,_0x45dd63['markers'],!0x0,_0x1fffce++);_0x210ab8['push'](_0x251d33);}}if(_0x420977)for(const [_0x512e2f,_0x543d3c]of Object['entries'](_0x420977)){const _0x425148=_0x45dd63['document']['getRoot'](_0x512e2f);if(!_0x425148)throw new _0x3a9443('multi-root-editor-root-attributes-no-root',null);for(const [_0x5a3847,_0x138149]of Object['entries'](_0x543d3c))if(null!==_0x138149){const _0x26ba39=new _0x15a55f(_0x425148,_0x5a3847,null,_0x138149,_0x1fffce++);_0x210ab8['push'](_0x26ba39);}}return _0x210ab8;}async['_loadRoot'](_0x5bc957,_0x1ffb1b,_0x12528c){this['_getOperationsFromInitData']({[_0x5bc957]:_0x1ffb1b},{[_0x5bc957]:_0x12528c})['forEach']((_0x243694,_0xb2f129)=>{_0x243694['baseVersion']=this['_document']['version']+_0xb2f129,_0x243694['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x243694);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x246082,_0x18115d){let _0x3243b1;this['_offset']=_0x246082['offset'];const _0x209d6f=_0x246082['wereChangesApplied']&&!_0x246082['initData'],_0x511b98=_0x209d6f?0x0:_0x246082['data']['baseVersion'];if(_0x18115d['forEach'](_0x1279eb=>{_0x1279eb['_isInit']=!0x0,_0x1279eb['createdAt']=_0x246082['sessionCreatedAt'],_0x1279eb['_authorId']=null;}),_0x209d6f)_0x3243b1=_0x18115d,this['_applyOperationsSet'](_0x3243b1,_0x209d6f);else{if(_0x246082['initData']){const _0x481aff=this['_getOperationsFromInitData'](_0x246082['initData']);this['_document']['history']['version']=-_0x481aff['length'],_0x481aff['forEach'](_0x50eee2=>{_0x50eee2['baseVersion']-=_0x481aff['length'],_0x50eee2['createdAt']=_0x246082['sessionCreatedAt'],_0x50eee2['_isInit']=!0x0,_0x50eee2['_authorId']=null;}),this['_applyOperationsSet'](_0x481aff,!0x0),this['serverHistory']['version']=-_0x481aff['length']+this['_offset'],this['_updateServerHistory'](_0x481aff);}this['_document']['history']['version']=_0x511b98,_0x3243b1=this['_decompressOperations'](_0x246082['data'],_0x246082['metadata']),await this['_fetchMissingUsers'](_0x3243b1),this['_applyOperationsSet'](_0x3243b1,_0x209d6f);}_0x246082['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3243b1,_0x246082['lastOperationId']),this['_lastSyncedOperationId']=_0x246082['lastOperationId']),this['serverHistory']['version']=_0x511b98+this['_offset'],this['_updateServerHistory'](_0x3243b1),_0x18115d['filter'](_0x5c532c=>{const _0x444941=this['_getAffectedRoot'](_0x5c532c);return _0x444941&&!this['_knownRootNames']['has'](_0x444941);})['forEach']((_0x22ea32,_0x163145)=>{_0x22ea32['baseVersion']=this['_document']['version']+_0x163145,this['_saveOperationInBuffer'](_0x22ea32);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4e2971,_0x3d7d0a){const _0x31e6f4=_0x3d7d0a&&_0x3d7d0a['message'];if(_0x31e6f4&&_0x31e6f4['startsWith']('realtimecollaborationclient'))throw _0x3d7d0a;const _0x545fd2=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x545fd2['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3a9443(_0x4e2971,this['editor'],_0x31e6f4?{'originalError':_0x31e6f4}:void 0x0);}['_saveOperationInBuffer'](_0x429fc8){this['_knownOperations']['has'](_0x429fc8)||(this['_knownOperations']['add'](_0x429fc8),this['_bufferedOperations']['push'](_0x429fc8),this['_pendingAction']||'marker'==_0x429fc8['type']&&!_0x429fc8['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x15cb21=!0x1){!_0x15cb21&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xc30689=>{_0xc30689&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x35a9d2=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3becfe){return _0x3becfe['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3becfe['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3becfe['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x35a9d2)||this['_crash'](_0x35a9d2['message'],_0x35a9d2);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x3cdf8b=>{this['on']('change:_isPendingUpdate',()=>{_0x3cdf8b();});});}async['_sendBufferedOperations'](){const _0x5ef11f=this['editor']['plugins']['get'](z);if(this['_shouldSendSelectionUpdate']()&&(_0x5ef11f['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3a265b=[...this['_bufferedOperations']];for(const _0x57e03c of _0x3a265b)_0x57e03c['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x57e03c);const _0x38d765=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3a265b),_0x2f52fd=q++,_0x4754c6=this['_compressOperations'](_0x3a265b),_0x3e72e4=await this['_service']['sendOperations'](_0x4754c6,_0x4754c6['baseVersion'],_0x38d765);try{return await this['_handleServerResponse'](_0x3a265b,_0x3e72e4,_0x2f52fd);}catch(_0x4305f2){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4305f2);}}async['_handleServerResponse'](_0x130e41,_0x351cf6,_0x20df22){if('error'in _0x351cf6)throw _0x351cf6['error'];let _0x567cba=!0x1;if(_0x351cf6['wereChangesApplied']){_0x351cf6['lastOperationId']&&(this['_lastSyncedOperationId']=_0x351cf6['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x58e5ce=>!_0x130e41['includes'](_0x58e5ce));for(const _0x11c840 of _0x130e41)_0x11c840['createdAt']='lastOperationAcceptedAt'in _0x351cf6&&_0x351cf6['lastOperationAcceptedAt']||void 0x0;G(_0x130e41,_0x351cf6['version']-_0x130e41['length']),this['_updateServerHistory'](_0x130e41);const _0x381d4b=_0x130e41['filter'](_0x263d61=>{if(!_0x263d61['_isInit'])return!0x1;const _0x389b44=this['_getAffectedRoot'](_0x263d61);return _0x389b44&&!this['_knownRootNames']['has'](_0x389b44);});G(_0x381d4b,this['_document']['version']),this['_applyOperationsSet'](_0x381d4b),_0x567cba=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x518bbe=this['_decompressOperations'](_0x351cf6['data'],_0x351cf6['metadata'])['filter'](_0x25f3ff=>_0x25f3ff['baseVersion']>=this['_lastServerVersion']);_0x518bbe['forEach'](_0x351207=>this['_addKnownRoot'](_0x351207)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3eb65c=>!_0x3eb65c['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3eb65c))),this['_bufferedOperations']['length']&&G(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x518bbe),_0x567cba=this['_handleExternalOperations'](_0x518bbe,_0x351cf6['version'],_0x351cf6['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x567cba?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3d9805,_0xb82fd4,_0x186975){try{const _0x20f3a1={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1f7659,operationsB:_0x49e60d,originalOperations:_0x31dcfb}=_0x5cbfc9(_0x3d9805,this['_bufferedOperations'],_0x20f3a1);G(_0x1f7659,this['_document']['version']),G(_0x49e60d,_0xb82fd4);for(const _0x2ea8f3 of _0x1f7659){const _0x4198ad=_0x31dcfb['get'](_0x2ea8f3);_0x2ea8f3['_authorId']=_0x4198ad?_0x4198ad['_authorId']:null;}_0x186975&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3d9805,_0x186975),this['_lastSyncedOperationId']=_0x186975),this['_bufferedOperations']=[..._0x49e60d],this['_applyOperationsSet'](_0x1f7659),this['_updateServerHistory'](_0x3d9805);}catch(_0x46c8b4){return console['error'](_0x46c8b4),!0x1;}return!0x0;}['_applyOperationsSet'](_0x242978,_0x11085c=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x141c66=>{for(const _0x516b82 of _0x242978)this['_knownOperations']['add'](_0x516b82),this['_addKnownRoot'](_0x516b82),_0x141c66['batch']['addOperation'](_0x516b82),this['editor']['model']['applyOperation'](_0x516b82);});}['_addKnownRoot'](_0x3f9390){const _0x590bd6=this['_getAffectedRoot'](_0x3f9390);_0x590bd6&&this['_knownRootNames']['add'](_0x590bd6);}['_getAffectedRoot'](_0x28a63f){let _0x2a37c3,_0x120461;switch(_0x28a63f['type']){case'insert':_0x2a37c3=_0x28a63f['position']['root'];break;case'marker':if(_0x120461=_0x28a63f['newRange'],!_0x120461)return null;_0x2a37c3=_0x120461['root'];break;case'addRootAttribute':_0x2a37c3=_0x28a63f['root'];break;case'addRoot':_0x2a37c3=_0x28a63f['affectedSelectable'];break;case'move':_0x2a37c3=_0x28a63f['targetPosition']['root'];break;default:return null;}return _0x2a37c3['rootName'];}['_updateServerHistory'](_0x4ee202){_0x4ee202['forEach'](_0x309614=>{const _0x4eeda7=_0x309614['clone']();_0x4eeda7['_authorId']=_0x309614['_authorId'],_0x4eeda7['_isInit']=!!_0x309614['_isInit'],_0x4eeda7['createdAt']=_0x309614['createdAt'],_0x4eeda7['baseVersion']+=this['_offset'],_0x309614['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4eeda7),this['serverHistory']['addOperation'](_0x4eeda7);});}['_handleReconnectionError'](_0x39f6cf){const _0x2f8018=this['editor']['plugins']['get']('Notification'),_0x4fb6b4=this['editor']['locale'];_0x39f6cf||(_0x39f6cf=V(_0x4fb6b4,'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.')),_0x2f8018['showWarning'](_0x39f6cf,{'title':V(_0x4fb6b4,'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'](_0x5a7c8a)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5a7c8a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5e9537){const _0x3004dc=_0x5e9537['map'](_0x429f44=>_0x429f44['toJSON']());return this['_compressor']['compress'](_0x3004dc);}['_decompressOperations'](_0x5e5cc8,_0xc41365){return this['_compressor']['decompress'](_0x5e5cc8)['map']((_0x3adc95,_0x19a7e1)=>{const _0x1be1b5='init'==_0xc41365[_0x19a7e1]['type'];if('InsertOperation'==_0x3adc95['__className']){const _0x26b29e=_0x3adc95['position']['root'];!this['_document']['getRoot'](_0x26b29e)&&(this['_document']['createRoot']('$root',_0x26b29e)['_isAttached']=!0x1);}const _0x4cc327=_0x1c848c['fromJSON'](_0x3adc95,this['_document']);return _0x4cc327['wasUndone']=_0x3adc95['wasUndone'],_0x4cc327['_isInit']=_0x1be1b5,_0x4cc327['_authorId']=_0x1be1b5?null:_0xc41365[_0x19a7e1]['userId'],_0x4cc327['_isDisconnection']='cs:removeUser'===_0xc41365[_0x19a7e1]['type'],_0x4cc327['createdAt']=_0xc41365[_0x19a7e1]['createdAt'],_0x4cc327;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3b25f8=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3b25f8&&_0x3b25f8['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function G(_0x5bdf7c,_0x2dbce7){for(const _0x1dd89f of _0x5bdf7c)_0x1dd89f['baseVersion']=_0x2dbce7++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x1a19f7){this['_ignoredOperations']=_0x1a19f7,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2af1d2){let _0x1843f5=_0x2af1d2['length'];for(;_0x1843f5--;){const _0x50bc8c=_0x2af1d2[_0x1843f5];if(!this['_ignoredOperations']['has'](_0x50bc8c)){if(!this['_operationToId']['has'](_0x50bc8c)){const _0x26fd09=_0x36f6e1()['slice'](0x1,0x12);this['_operationToId']['set'](_0x50bc8c,_0x26fd09);}return this['_operationToId']['get'](_0x50bc8c);}}}['setIdForTheLastOperation'](_0x10fa16,_0x64b05f){if(!_0x64b05f)return;let _0x3670cb=_0x10fa16['length'];for(;_0x3670cb--;){const _0x2c1497=_0x10fa16[_0x3670cb];this['_ignoredOperations']['has'](_0x2c1497)||this['_operationToId']['set'](_0x2c1497,_0x64b05f);}}}class a extends _0x1e5d58{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x4067ea{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x5409e7)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x52815c];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5efc17){super(_0x5efc17),this['_services']=new Map();}async['init'](){const _0x196f17=this['context'],_0x6988ab=_0x196f17['plugins']['get']('CommentsRepository');if(_0x196f17['plugins']['get'](n)['addToReconnectionStack'](this),_0x6988ab['adapter']={'addCommentThread':async({channelId:_0x4a3f28,threadId:_0x30f9f3,comments:_0x12d9a9,resolvedAt:_0x63e635,resolvedBy:_0x295988,context:_0x1d4ea0,attributes:_0x5e8fd7})=>{const _0x248a98=await this['_getService'](_0x4a3f28)['addCommentThread']({'commentThreadId':_0x30f9f3,'comments':_0x12d9a9['map'](_0x5de561=>function(_0x356425,_0x3e31a3,_0x144e7a){return{'commentThreadId':_0x144e7a,'commentId':_0x356425['commentId'],'userId':_0x356425['authorId'],'content':_0x356425['content'],'documentId':_0x3e31a3,'createdAt':_0x356425['createdAt'],'attributes':_0x356425['attributes']||{}};}(_0x5de561,_0x4a3f28,_0x30f9f3)),'resolvedAt':_0x63e635,'resolvedBy':_0x295988,'context':_0x1d4ea0,'attributes':_0x5e8fd7})['catch'](lt);return{'threadId':_0x248a98['commentThreadId'],'comments':_0x248a98['comments']};},'getCommentThread':async({channelId:_0x581aa9,threadId:_0x1820d0})=>{const _0xa8b227=await this['_getService'](_0x581aa9)['getCommentThread'](_0x1820d0)['catch'](tt)['catch'](lt);return _0xa8b227?_0xa8b227['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0xa8b227]),{'threadId':_0xa8b227['commentThreadId'],'comments':_0xa8b227['comments']['map'](ot),'context':_0xa8b227['context'],'resolvedAt':_0xa8b227['resolvedAt'],'resolvedBy':_0xa8b227['resolvedBy'],'attributes':_0xa8b227['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3febb9,threadId:_0x16aff4,context:_0xc85c56,unlinkedAt:_0x40ed56,attributes:_0x5ac4b7})=>this['_getService'](_0x3febb9)['updateCommentThread']({'commentThreadId':_0x16aff4,'context':_0xc85c56,'attributes':_0x5ac4b7,'unlinkedAt':_0x40ed56})['catch'](tt)['catch'](lt),'resolveCommentThread':async({channelId:_0x5caa6a,threadId:_0xc08e45})=>{const _0x1a45df=await this['_getService'](_0x5caa6a)['resolveCommentThread'](_0xc08e45)['catch'](tt)['catch'](lt);return{'threadId':_0x1a45df['commentThreadId'],'resolvedAt':_0x1a45df['resolvedAt'],'resolvedBy':_0x1a45df['resolvedBy']};},'reopenCommentThread':async({channelId:_0x58c831,threadId:_0x2d762a})=>this['_getService'](_0x58c831)['reopenCommentThread'](_0x2d762a)['catch'](tt)['catch'](lt),'removeCommentThread':({channelId:_0x1a8e10,threadId:_0x396bcf})=>this['_getService'](_0x1a8e10)['removeCommentThread'](_0x396bcf)['catch'](tt)['catch'](lt),'addComment':({channelId:_0x5a5717,threadId:_0x4e8e55,commentId:_0x2e6817,content:_0x2739d1,attributes:_0x366541})=>this['_getService'](_0x5a5717)['addComment'](_0x4e8e55,_0x2e6817,_0x2739d1,_0x366541)['catch'](lt),'updateComment':({channelId:_0x20147a,threadId:_0x4d0917,commentId:_0x3ab782,content:_0x1cacd6,attributes:_0x33c74b})=>this['_getService'](_0x20147a)['updateComment'](_0x4d0917,_0x3ab782,_0x1cacd6,_0x33c74b)['catch'](tt)['catch'](lt),'removeComment':({channelId:_0x11d95f,threadId:_0x533ee5,commentId:_0x31a60e})=>this['_getService'](_0x11d95f)['removeComment'](_0x533ee5,_0x31a60e)['catch'](tt)['catch'](lt)},_0x196f17 instanceof _0x2e2ce6){const _0x1f8ec9=_0x196f17['config']['get']('collaboration.channelId'),_0x24d243=_0x196f17['plugins']['get'](i);await this['_setUpService'](_0x1f8ec9);const _0x139f19=await this['_services']['get'](_0x1f8ec9)['getConnectedSessions']();this['listenTo'](_0x24d243,'sessionAdd:'+_0x1f8ec9,(_0x3e09ab,{session:_0x951c83})=>{_0x951c83['id']===_0x24d243['mySessionId']&&(_0x3e09ab['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x951c83['permissions'],_0x1f8ec9));}),_0x24d243['register'](_0x1f8ec9,_0x139f19);}}async['_setUpService'](_0x28d1dd){if(this['_services']['has'](_0x28d1dd))throw new _0x3a9443('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x28d1dd});const _0x59eb88=this['context']['plugins']['get']('CommentsRepository'),_0x35856a=new s['CommentsService'](_0x28d1dd);this['_services']['set'](_0x28d1dd,_0x35856a),this['listenTo'](_0x35856a,'commentThreadAdded',(_0x1a0ca0,_0x1a4e27)=>{const {commentThreadId:_0x5b252e,documentId:_0x254a88,context:_0x3e49cc,attributes:_0x5bf64c,resolvedAt:_0x4f03c7,resolvedBy:_0x4cedb1,comments:_0x38d408}=_0x1a4e27;_0x59eb88['getCommentThread'](_0x5b252e)||_0x59eb88['addCommentThread']({'threadId':_0x5b252e,'channelId':_0x254a88,'comments':_0x38d408?_0x38d408['map'](ot):[],'context':_0x3e49cc,'attributes':_0x5bf64c,'resolvedAt':_0x4f03c7,'resolvedBy':_0x4cedb1,'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadUpdated',(_0x3b758e,{commentThreadId:_0x23b51b,documentId:_0x33ef7a,context:_0x480422,unlinkedAt:_0x49dbab,attributes:_0xa8f5aa})=>{_0x59eb88['getCommentThread'](_0x23b51b)&&_0x59eb88['updateCommentThread']({'threadId':_0x23b51b,'channelId':_0x33ef7a,'context':_0x480422,'unlinkedAt':_0x49dbab,'attributes':_0xa8f5aa,'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadResolved',(_0x23880d,{commentThreadId:_0x4d2d15,resolvedBy:_0x436991,resolvedAt:_0x2e5178})=>{const _0x1eaede=_0x59eb88['getCommentThread'](_0x4d2d15);_0x1eaede&&_0x1eaede['resolve']({'resolvedBy':_0x436991,'resolvedAt':_0x2e5178,'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadReopened',(_0x10ffe3,{commentThreadId:_0x124679})=>{const _0x2680c9=_0x59eb88['getCommentThread'](_0x124679);_0x2680c9&&_0x2680c9['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadRemoved',(_0x214211,{commentThreadId:_0x171dff})=>{const _0x140cf7=_0x59eb88['getCommentThread'](_0x171dff);_0x140cf7&&_0x140cf7['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentAdded',(_0x5c3f34,_0x1c6573)=>{const _0x3cda74=_0x1c6573['commentThreadId'],_0x23c4bb=_0x59eb88['getCommentThread'](_0x3cda74);_0x23c4bb&&_0x23c4bb['addComment']({...ot(_0x1c6573),'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentUpdated',(_0x14c774,{commentThreadId:_0x42105a,commentId:_0x172cbf,content:_0x32931d,attributes:_0x21b050})=>{const _0x3fdac8=_0x59eb88['getCommentThread'](_0x42105a);if(_0x3fdac8){const _0x1e267f=_0x3fdac8['getComment'](_0x172cbf);_0x1e267f&&_0x1e267f['update']({'content':_0x32931d,'attributes':_0x21b050,'isFromAdapter':!0x0});}}),this['listenTo'](_0x35856a,'commentRemoved',(_0x2c10c6,{commentThreadId:_0x120e84,commentId:_0x419694})=>{const _0x514295=_0x59eb88['getCommentThread'](_0x120e84);if(_0x514295){const _0x73250a=_0x514295['getComment'](_0x419694);_0x73250a&&_0x73250a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x28d1dd);}['destroy'](){if(this['context']instanceof _0x2e2ce6){const _0x492096=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x492096);}}['_terminateService'](_0x35faac){if(!this['_services']['has'](_0x35faac))throw new _0x3a9443('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x35faac});this['_getService'](_0x35faac)['disconnect'](),this['_services']['delete'](_0x35faac);}async['reconnect'](){for(const _0x381093 of this['_services']['keys']())await this['_connectService'](_0x381093);if(this['context']instanceof _0x2e2ce6){const _0x4a25d0=this['context']['config']['get']('collaboration.channelId'),_0x5823c5=this['context']['plugins']['get'](i);_0x5823c5['unregister'](_0x4a25d0);const _0x403a05=await this['_services']['get'](_0x4a25d0)['getConnectedSessions']();_0x5823c5['register'](_0x4a25d0,_0x403a05);}}async['_connectService'](_0x2337c1){const {connection:_0x2eeec3}=this['context']['plugins']['get'](n),_0x289301=this['context']['plugins']['get']('CommentsRepository'),_0x467be9=this['_services']['get'](_0x2337c1),_0x2d5d7c=await _0x467be9['connect'](_0x2eeec3);await this['_fetchMissingUsersForThreads'](_0x2d5d7c);const _0x422d83=new Set(Array['from'](_0x289301['getCommentThreads']({'channelId':_0x2337c1}),_0x141600=>_0x141600['id']));for(const _0x453ca5 of _0x2d5d7c)_0x453ca5['deletedAt']||_0x422d83['delete'](_0x453ca5['commentThreadId']);for(const _0x38ebb6 of _0x422d83)_0x289301['getCommentThread'](_0x38ebb6)['remove']({'isFromAdapter':!0x0});for(const _0x1b47f9 of _0x2d5d7c){let _0x4dddd1=_0x289301['getCommentThread'](_0x1b47f9['commentThreadId']);const {commentThreadId:_0x59d9d8,context:_0x125493,attributes:_0x278300,resolvedBy:_0x4f5dce,resolvedAt:_0x16df85,unlinkedAt:_0x19d5d2,deletedAt:_0x2e5e39}=_0x1b47f9;if(_0x2e5e39)continue;_0x4dddd1||(_0x4dddd1=_0x289301['addCommentThread']({'channelId':_0x2337c1,'threadId':_0x59d9d8,'context':_0x125493,'attributes':_0x278300||{},'resolvedBy':_0x4f5dce,'resolvedAt':_0x16df85,'unlinkedAt':_0x19d5d2,'isFromAdapter':!0x0}));const _0x1c498a=new Set(Array['from'](_0x4dddd1['comments'],_0x21370b=>_0x21370b['id']));for(const _0x220e92 of _0x1b47f9['comments'])_0x1c498a['delete'](_0x220e92['commentId']);for(const _0x3263e2 of _0x1c498a)_0x4dddd1['getComment'](_0x3263e2)['remove']({'isFromAdapter':!0x0});for(const _0xb97983 of _0x1b47f9['comments']){const _0x394726=_0x4dddd1['getComment'](_0xb97983['commentId']);_0x394726?_0x394726['content']!==_0xb97983['content']&&_0x394726['update']({'content':_0xb97983['content'],'isFromAdapter':!0x0}):_0x4dddd1['addComment'](Object['assign'](ot(_0xb97983),{'isFromAdapter':!0x0}));}}}['_getService'](_0xafcb2c){if(!this['_services']['has'](_0xafcb2c))throw new _0x3a9443('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xafcb2c});return this['_services']['get'](_0xafcb2c);}async['_fetchMissingUsersForThreads'](_0x4439da){const _0x4d8a3f=this['context']['plugins']['get'](_0x52815c),{connection:_0x29a421}=this['context']['plugins']['get'](n),_0x5dcb3e=new Set();for(const {resolvedBy:_0x1bb9b1,comments:_0x121a56}of _0x4439da){_0x1bb9b1&&!_0x4d8a3f['getUser'](_0x1bb9b1)&&_0x5dcb3e['add'](_0x1bb9b1);for(const {userId:_0x436b9a}of _0x121a56)_0x4d8a3f['getUser'](_0x436b9a)||_0x5dcb3e['add'](_0x436b9a);}if(0x0===_0x5dcb3e['size'])return;const _0x563325=await ht['getMany'](_0x29a421,Array['from'](_0x5dcb3e));for(const _0x51d19f of _0x563325)_0x4d8a3f['getUser'](_0x51d19f['id'])||_0x4d8a3f['addUser'](_0x51d19f);}}async function tt(_0x27aabb){if('404'!==_0x27aabb['code'])throw _0x27aabb;}function lt(_0x46aad4){if((_0x5eba66=_0x46aad4)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5eba66['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5eba66['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5eba66;throw _0x46aad4;}function ot(_0x1fcb29){return{'threadId':_0x1fcb29['commentThreadId'],'commentId':_0x1fcb29['commentId'],'content':_0x1fcb29['content'],'createdAt':_0x1fcb29['createdAt'],'authorId':_0x1fcb29['userId'],'attributes':_0x1fcb29['attributes']||{}};}class m extends _0x1e5d58{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>it)());['_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(_0x3c0af8){super(_0x3c0af8);const _0x28119e=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x28119e);}['init'](){const _0xa6a855=this['editor']['plugins']['get'](n),_0x13d327=this['editor']['plugins']['get']('TrackChangesEditing');return _0x13d327['adapter']={'getSuggestion':async _0x10ecd5=>{await this['_waitForServiceReady']();const _0x391c5f=await this['_trackChangesService']['get'](_0x10ecd5)['catch'](et);return await this['_fetchMissingUsersForThreads']([_0x391c5f]),_0x391c5f;},'addSuggestion':async({id:_0x4724a8,type:_0x213340,data:_0xae4b2d,originalSuggestionId:_0x48501d,attributes:_0x30ef1d})=>{await this['_waitForServiceReady']();const _0x308a68={'id':_0x4724a8,'type':_0x213340,'data':_0xae4b2d,'originalSuggestionId':_0x48501d,'attributes':_0x30ef1d},_0x5ed5ca=await this['_trackChangesService']['add'](_0x4724a8,_0x213340,_0xae4b2d,_0x48501d,_0x30ef1d)['catch'](_0x3f1e6b=>{if(dt(_0x3f1e6b))return new Promise(_0x2875ba=>{this['_bufferedRequests']['set'](_0x4724a8,{'resolve':_0x2875ba,'suggestionData':_0x308a68});});throw _0x3f1e6b;});return this['_bufferedRequests']['delete'](_0x4724a8),_0x5ed5ca;},'updateSuggestion':async(_0xe70309,_0x136fe1)=>{if(await this['_waitForServiceReady'](),'open'!==_0x136fe1['state'])return this['_trackChangesService']['update'](_0xe70309,_0x136fe1)['catch'](et);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1b63f,_0x574186)=>{_0x13d327['hasSuggestion'](_0x574186['id'])&&(_0x13d327['getSuggestion'](_0x574186['id'])['attributes']=_0x574186['attributes']);}),this['_trackChangesService']['connect'](_0xa6a855['connection'])['then'](_0x5a6047=>(_0xa6a855['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x5a6047)['then'](()=>{for(const _0x3704cc of _0x5a6047){_0x13d327['addSuggestionData'](_0x3704cc)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1fe348=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1f49a8}=this['editor']['plugins']['get'](n),_0x5b7411=await this['_trackChangesService']['connect'](_0x1f49a8);await this['_fetchMissingUsersForThreads'](_0x5b7411);for(const {suggestionData:_0x222ad1,resolve:_0x4dcba7}of this['_bufferedRequests']['values']()){let _0x4063ac=_0x5b7411['find'](_0x219428=>_0x219428['id']===_0x222ad1['id']);_0x4063ac||(_0x4063ac=await this['_trackChangesService']['add'](_0x222ad1['id'],_0x222ad1['type'],_0x222ad1['data'],_0x222ad1['originalSuggestionId'])),_0x4dcba7(_0x4063ac);}for(const _0x3df0d7 of _0x5b7411)_0x1fe348['hasSuggestion'](_0x3df0d7['id'])||_0x1fe348['addSuggestionData'](_0x3df0d7);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x20cd26=>{this['listenTo'](this['_trackChangesService'],'connected',_0x1b8f33=>{_0x1b8f33['off'](),_0x20cd26();});});}async['_fetchMissingUsersForThreads'](_0x2f2bdf){const _0x1337d6=this['editor']['plugins']['get'](_0x52815c),{connection:_0x158cc2}=this['editor']['plugins']['get'](n),_0x4e2d1f=new Set();for(const {authorId:_0x4197f8}of _0x2f2bdf)_0x1337d6['getUser'](_0x4197f8)||_0x4e2d1f['add'](_0x4197f8);if(0x0===_0x4e2d1f['size'])return;const _0xc1ef21=await ht['getMany'](_0x158cc2,Array['from'](_0x4e2d1f));for(const _0x16b050 of _0xc1ef21)_0x1337d6['getUser'](_0x16b050['id'])||_0x1337d6['addUser'](_0x16b050);}}function et(_0x414d20){if(dt(_0x414d20))return new Promise(()=>{});throw _0x414d20;}function dt(_0x2c683e){return _0x2c683e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2c683e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1e5d58{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 _0x5af2de=this['editor']['plugins']['get'](n),_0x25cfc8=this['editor']['plugins']['get']('CommentsEditing'),_0x11412c=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x5af2de,'change:state',(_0x56183d,_0x649f6,_0x5ccd39)=>{_0x25cfc8['isThreadsLoadingPaused']='connected'!==_0x5ccd39;});}),this['listenTo'](_0x5af2de,'change:state',(_0x345ce9,_0x66ed41,_0x1a6939)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1a6939);}),_0x11412c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class RealTimeCollaborativeTrackChanges extends _0x1e5d58{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 _0x1e5d58{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x5df08f)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x52815c];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41a37b){super(_0x41a37b);const _0x2af571=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x2af571);}async['init'](){const _0x5b2d41=this['editor']['plugins']['get'](l),_0xfb03e5=_0x5b2d41['serverHistory'],_0x5ef1e6=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xfb03e5,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5b2d41['sessionId']});const _0x1c47f7=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x1c5433=await _0xd9b4ec['isBundleUploaded'](_0x5ef1e6['connection'],_0x1c47f7);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x13833a})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x13833a)),'updateRevisions':async _0x339036=>{await this['_waitForServiceReady']();const _0x700033=this['_revisionTracker']['currentRevision'];if(_0x1c5433&&0x1===_0x339036['length']&&_0x339036[0x0]['id']===_0x700033['id'])return _0x339036;for(const _0x2ad05f of _0x339036)_0x2ad05f['id']===_0x700033['id']&&(_0x2ad05f['isEmptyCurrent']=_0x2ad05f['fromVersion']===_0x2ad05f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x339036,this['_lastRequestId'])['then'](_0x512da3=>(this['_lastRequestId']=_0x512da3,_0x339036))['catch'](_0x14aab8=>{if(I(_0x14aab8)||'400'===_0x14aab8['code']&&void 0x0!==_0x14aab8['data']['wrongRequestId']){for(const _0x1bf2fd of _0x339036){!this['_revisionTracker']['repository']['getRevision'](_0x1bf2fd['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1bf2fd['id'],_0x1bf2fd,!0x1);}if(I(_0x14aab8))throw _0x14aab8;return _0x339036;}throw _0x14aab8;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1b13d7,{revisionsData:_0x1b277f,requestId:_0x9b6fff})=>{Math['max'](..._0x1b277f['map'](_0x2290d4=>_0x2290d4['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1b277f,_0x9b6fff);}):this['_handleRevisionsUpdate'](_0x1b277f,_0x9b6fff);});const {revisions:_0x28a499,requestId:_0x1c16b0}=await this['_revisionHistoryService']['connect'](_0x5ef1e6['connection']);_0x5ef1e6['addToReconnectionStack'](this),this['_lastRequestId']=_0x1c16b0,await this['_fetchMissingUsers'](_0x28a499);for(const _0x539852 of _0x28a499)this['_revisionTracker']['addRevisionData'](_0x539852);this['listenTo'](_0x5b2d41,'change:_isConnected',(_0x2b4aae,_0x53384e,_0x555b07)=>{_0x555b07&&(this['_oldOffset']=_0x5b2d41['_offset'],_0x2b4aae['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5ef1e6,'state',_0x4d104f=>_0x4d104f===_0x3d1e25['CONNECTED']);}async['reconnect'](){const _0x34d9d9=this['editor']['plugins']['get'](n),_0x43d42e=this['editor']['plugins']['get'](l),_0x1052a=async()=>{const _0x534bc8=this['_revisionTracker']['currentRevision'],_0x50ba16=_0x534bc8['id'],_0x10a14a=_0x50ba16!==_0x43d42e['sessionId'];if(_0x10a14a){const _0xebc072=_0x43d42e['_offset']-this['_oldOffset'],_0x5e2b98=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x534bc8['toVersion']+_0xebc072!==_0x5e2b98){const _0x592926=_0x534bc8['fromVersion']+_0xebc072,_0x1305a3=this['editor']['plugins']['get'](_0x52815c),_0x4fe56a=this['_revisionTracker']['buildRevisionData']({'revision':_0x534bc8,'from':_0x592926,'to':_0x5e2b98});_0x4fe56a['id']=_0x534bc8['id'];const _0x45f1b4=_0x4fe56a['authorsIds']['map'](_0x2c289e=>_0x1305a3['getUser'](_0x2c289e));_0x534bc8['_update']({..._0x4fe56a,'authors':_0x45f1b4},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x534bc8['id'],_0x4fe56a,!0x0);}this['_revisionTracker']['_startingVersion']=_0x5e2b98,(_0x534bc8['toVersion']===_0x534bc8['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x50ba16)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x50ba16),this['_revisionTracker']['_createCurrentRevision'](_0x5e2b98));}const {revisions:_0x38185b,requestId:_0x35d818}=await this['_revisionHistoryService']['reconnect'](_0x34d9d9['connection'],this['_lastRequestId']);_0x10a14a&&_0x38185b['length']>0x0?_0x43d42e['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x38185b),this['_handleRevisionsUpdate'](_0x38185b,_0x35d818),this['_revisionTracker']['sendBufferedUpdates']());};return _0x43d42e['_isConnected']?_0x1052a():new Promise((_0x3bd418,_0x2465e4)=>{_0x43d42e['once']('change:_isConnected',()=>{_0x1052a()['then'](_0x3bd418)['catch'](_0x2465e4);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x244278=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x46ec70=>{_0x46ec70['off'](),_0x244278();});});}['_getLatestVersionFromServerOperations'](){const _0x458a82=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x295d5b of _0x458a82)if('marker'!==_0x295d5b['type']||_0x295d5b['affectsData'])return _0x295d5b['baseVersion']+0x1;}['_getLatestVersion'](){const _0x3cf938=this['editor']['plugins']['get'](l);return new Promise(_0x172d3f=>{_0x3cf938['_isPendingUpdate']?_0x3cf938['once']('change:_isPendingUpdate',()=>{_0x172d3f(this['_getLatestVersionFromServerOperations']());}):_0x172d3f(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x15df7f,_0x407c98){const _0x57ceee=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x407c98;for(const _0xeca1a5 of _0x15df7f){const _0x45cd96=_0x57ceee['getRevision'](_0xeca1a5['id']);if(_0x45cd96){if((_0xeca1a5['fromVersion']||_0xeca1a5['toVersion'])&&(_0xeca1a5['diffData']=null),_0x45cd96===this['_revisionTracker']['currentRevision']){const _0x176970=Math['max'](_0x45cd96['toVersion'],_0xeca1a5['toVersion']),_0x26d7f7=Math['max'](_0x45cd96['fromVersion'],_0xeca1a5['fromVersion']);let _0x2aa3d8;_0x45cd96['toVersion']===_0xeca1a5['toVersion']&&_0x45cd96['fromVersion']===_0xeca1a5['fromVersion']?(_0x2aa3d8=!0x0,this['_preventResendingRevisionData'](_0xeca1a5)):_0xeca1a5['toVersion']===_0x176970&&_0xeca1a5['fromVersion']===_0x26d7f7?_0x2aa3d8=!0x1:(_0x45cd96['toVersion']===_0x176970&&_0x45cd96['fromVersion']===_0x26d7f7||this['_fixRevision']({'revision':_0x45cd96,'from':_0x26d7f7,'to':_0x176970}),_0x2aa3d8=!0x0),_0x2aa3d8&&(delete _0xeca1a5['fromVersion'],delete _0xeca1a5['toVersion'],delete _0xeca1a5['diffData'],delete _0xeca1a5['createdAt'],delete _0xeca1a5['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xeca1a5),this['_preventResendingRevisionData'](_0xeca1a5);}else this['_revisionTracker']['addRevisionData'](_0xeca1a5);}const _0xfd943f=_0x57ceee['getRevisions']();_0xfd943f['reverse']();for(let _0x21e45a=0x0;_0x21e45a<_0xfd943f['length']-0x1;_0x21e45a++){const _0x1213ca=_0xfd943f[_0x21e45a],_0xabef84=_0xfd943f[_0x21e45a+0x1];if(_0x1213ca['fromVersion']<_0xabef84['toVersion']){const _0x27fca9=_0xabef84['toVersion'],_0x29af58=Math['max'](_0x27fca9,_0x1213ca['toVersion']);this['_fixRevision']({'revision':_0x1213ca,'from':_0x27fca9,'to':_0x29af58});}}}['_fixRevision']({revision:_0x55e63b,from:_0x30bf42,to:_0x3ae3b2}={}){const _0x3be028=this['editor']['plugins']['get'](_0x52815c),_0x37cf26=this['_revisionTracker']['buildRevisionData']({'revision':_0x55e63b,'from':_0x30bf42,'to':_0x3ae3b2});_0x37cf26['authors']=_0x37cf26['authorsIds']['map'](_0x5c21a3=>_0x3be028['getUser'](_0x5c21a3)),_0x55e63b['_update'](_0x37cf26);}['_preventResendingRevisionData'](_0x499208){const _0xe251ef={};_0xe251ef['id']=_0x499208['id'];for(const _0x21d29a of Object['keys'](_0x499208))'id'!==_0x21d29a&&(_0xe251ef[_0x21d29a]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xe251ef['id'],_0xe251ef,!0x0);}async['_fetchMissingUsers'](_0x192472){const _0x4479e7=this['editor']['plugins']['get'](_0x52815c),{connection:_0x3a9f1a}=this['editor']['plugins']['get'](n),_0x50b418=new Set();for(const _0x24b901 of _0x192472){for(const _0x3171b5 of _0x24b901['authorsIds'])_0x1ca72a(_0x3171b5);_0x24b901['creatorId']&&_0x1ca72a(_0x24b901['creatorId']);}if(0x0===_0x50b418['size'])return;const _0x21df72=await ht['getMany'](_0x3a9f1a,Array['from'](_0x50b418));for(const _0x20e008 of _0x21df72)_0x4479e7['getUser'](_0x20e008['id'])||_0x4479e7['addUser'](_0x20e008);function _0x1ca72a(_0x39c5d2){_0x4479e7['getUser'](_0x39c5d2)||_0x50b418['add'](_0x39c5d2);}}}function I(_0x655675){return _0x655675['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x655675['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x655675['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x1e5d58{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 _0x4bb216{['_collapseAt'];constructor(_0x3921b0,_0x2150dd=0x6){super(_0x3921b0);const _0x5ee958=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x2150dd,this['bind']('isHidden')['to'](this,'usersCount',_0xb39fc3=>_0xb39fc3<_0x2150dd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5ee958['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':_0x5ee958['to']('usersCount',_0x5dc172=>'+'+(_0x5dc172-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x4bb216{['items'];['keystrokes'];constructor(_0x10006c){super(_0x10006c);const _0x5be2e1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x745df6(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5be2e1['if']('hasPopup'),'aria-expanded':_0x5be2e1['to']('isExpanded',_0x4a77b8=>this['hasPopup']&&String(_0x4a77b8)),'aria-label':_0x5be2e1['to']('hasPopup',_0x324a5b=>V(_0x10006c,_0x324a5b?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5be2e1['to']('hasPopup',_0x585ec2=>!!_0x585ec2&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5be2e1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5be2e1['to'](_0x3dd659=>{const _0x244ac0=_0x3dd659,_0x11d293=document['querySelector']('.ck-presence-list__dropdown-list'),_0x344182=document['querySelector']('.ck-balloon-panel_with-arrow');_0x11d293?.['contains'](_0x244ac0['relatedTarget'])||_0x344182?.['contains'](_0x244ac0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x291064,_0xaa83b0,_0x3a4bdc)=>{this['element']&&(_0x3a4bdc?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 _0x4bb216{['counterView'];['inlineListView'];constructor(_0x14dc85,_0x1b440c=0x6){super(_0x14dc85);const _0x3357e9=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x1b440c),this['inlineListView']=new is(_0x14dc85),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4fd228 of this['inlineListView']['items'])_0x4fd228['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',_0x3357e9['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x4bb216{['listWrapperView'];constructor(_0x3799e1,_0x3af22c){super(_0x3799e1);const _0x34e1c7=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3799e1,_0x3af22c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x3799e1,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x34e1c7['to'](_0x1fe0eb=>{const _0x4ac30f=_0x1fe0eb,_0x549de7=document['querySelector']('.ck-presence-list__list'),_0x4e457f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x549de7?.['contains'](_0x4ac30f['relatedTarget'])||_0x4e457f?.['contains'](_0x4ac30f['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x3e031c{constructor(_0x2f343d,_0x713886){super(_0x2f343d);const _0x1a54b7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x713886?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1a54b7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1a54b7['to']('role'),'aria-label':_0x1a54b7['to']('ariaLabel'),'aria-labelledby':_0x1a54b7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x19a405['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xe202d8=this['element'];_0xe202d8&&(this['_isScrollable']=Math['max'](_0xe202d8['scrollHeight'],_0xe202d8['clientHeight'])>0.8*window['innerHeight']);}}class j extends st{['userView'];constructor(_0xfef18e,_0x25e8bd,_0x5220b3){super(_0xfef18e);const _0x3e4f1a=this['bindTemplate'];this['userView']=new rt(_0xfef18e,_0x25e8bd);const _0x29fcdc={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x25e8bd['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x25e8bd['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x25e8bd['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5220b3&&(_0x29fcdc['tag']='button',_0x29fcdc['on']={'click':_0x3e4f1a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x29fcdc);}['focus'](){this['element']['focus']();}}class A extends _0x4bb216{['userView'];['markerView'];constructor(_0x5e8dcc,_0x298255,_0x5a54ef){super(_0x5e8dcc);const _0x509eed=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new rt(_0x5e8dcc,_0x298255),this['markerView']=new MarkerView(_0x5e8dcc,_0x298255);const _0x2094e2=new at(_0x5e8dcc);_0x2094e2['template']['tag']='span',_0x2094e2['text']=_0x298255['name'];const _0x2ba590={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x509eed['to']('isFocusable',_0x5ecb35=>!!_0x5ecb35&&0x0),'aria-labelledby':_0x2094e2['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x509eed['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x509eed['to']('hasTooltip',_0x54bd92=>!_0x54bd92),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2094e2]};_0x5a54ef&&(_0x2ba590['tag']='button',_0x2ba590['on']={'click':_0x509eed['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2ba590);}}class MarkerView extends _0x4bb216{constructor(_0x107ea1,_0x1460ee){super(_0x107ea1),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1460ee['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x4067ea{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f7afa){super(_0x4f7afa),this['context']['config']['define']('presenceList',x);const _0x57ab9c=_0x4f7afa['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x57ab9c)throw new _0x3a9443('presencelist-collapseat-invalid-format',this);if(_0x57ab9c<0x1)throw new _0x3a9443('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x36276b(),this['balloonPanelView']=new _0x2a3eb9(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x51f50c of this['_allConnectedUsers'])this['_handleUserAdd'](_0x51f50c);this['listenTo'](this['_allConnectedUsers'],'add',(_0x12230a,_0x3ba06c)=>{this['_handleUserAdd'](_0x3ba06c);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x573364,_0x15591c)=>{this['_handleUserRemove'](_0x15591c);});}['_createView'](){const _0x55d8da=this['context'],_0x3c9571=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4cc98e=this['balloonPanelView'];if(!_0x15409c(_0x55d8da['config']['get']('presenceList.container')))throw new _0x3a9443('presencelist-missing-container',this);return _0x3c9571['counterView']['bind']('usersCount')['to'](this),_0x3c9571['bind']('isCollapsed')['to'](this,'usersCount',_0x40521f=>{const {collapseAt:_0x10df78}=_0x55d8da['config']['get']('presenceList'),_0x108697=_0x40521f>=_0x10df78;if(_0x108697&&!_0x3c9571['inlineListView']['items']['find'](_0x19dccb=>_0x19dccb instanceof b)){const _0x36d047=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x36d047&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3c9571['inlineListView']['items']['add'](_0x3c9571['counterView']);}return _0x108697||this['hideDropdown'](),_0x108697;}),_0x3c9571['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x31e043=>{const _0x59a278=_0x55d8da['config']['get']('presenceList'),_0x56fdc5=new A(_0x55d8da['locale'],_0x31e043,!!_0x59a278['onClick']);return _0x56fdc5['bind']('hasTooltip')['to'](_0x3c9571,'isCollapsed',_0x5965f8=>!_0x5965f8),_0x56fdc5['bind']('isFocusable')['to'](_0x3c9571,'isCollapsed',_0x2ccf46=>!_0x2ccf46),_0x59a278['onClick']&&this['listenTo'](_0x56fdc5,'execute',()=>{this['view']['isCollapsed']||_0x59a278['onClick'](_0x31e043,_0x56fdc5['element']);}),_0x56fdc5;}),this['listenTo'](_0x3c9571['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3c9571['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3c9571['inlineListView']['keystrokes']['set']('Enter',(_0x1a3788,_0x994ec9)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x994ec9());}),_0x3c9571['render'](),_0x4cc98e['render'](),_0x56d96c({'emitter':_0x3c9571,'activator':()=>_0x4cc98e['isVisible'],'contextElements':[_0x4cc98e['element'],_0x3c9571['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x55d8da['config']['get']('presenceList.container')['appendChild'](_0x3c9571['element']),this['_bodyCollection']=new _0x20e53c(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3c9571;}['_handleUserAdd'](_0x2df788){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2df788['isMe'])return;const _0x22ebae=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x22ebae-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x941984=_0x2df788['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2df788,_0x941984);}['_handleUserRemove'](_0x51a8da){this['usersCount']--;const {collapseAt:_0x2d431c}=this['context']['config']['get']('presenceList'),_0x306308=this['usersCount']>=_0x2d431c;if(this['currentDisplayedUsers']['get'](_0x51a8da['id']))this['currentDisplayedUsers']['remove'](_0x51a8da['id']);else{if(_0x306308&&this['currentDisplayedUsers']['length']+0x1===_0x2d431c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x306308?0x1:0x0)<this['usersCount']){for(const _0x4cb044 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4cb044['id'])&&(this['currentDisplayedUsers']['add'](_0x4cb044,Math['min'](this['currentDisplayedUsers']['length']-(_0x306308?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x306308?0x1:0x0)===_0x2d431c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3afe1a=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x3afe1a['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x36d716}=this['presenceDropdownView'];_0x36d716['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5a8a81=>{if(!_0x3afe1a['displayMe']&&_0x5a8a81['isMe'])return null;const _0x523236=new j(this['context']['locale'],_0x5a8a81,!!_0x3afe1a['onClick']);return _0x3afe1a['onClick']&&this['listenTo'](_0x523236,'execute',()=>{_0x3afe1a['onClick'](_0x5a8a81,_0x523236['element']);}),_0x523236;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x36d716['focus'](),_0x36d716['checkIfScrollable']();const _0x258a54=(_0x20b710,_0x2383d7)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2383d7();};_0x36d716['keystrokes']['set']('Esc',_0x258a54),_0x36d716['keystrokes']['set']('Shift+Tab',_0x258a54),_0x36d716['keystrokes']['set']('Tab',(_0x39893c,_0x198265)=>{!function(_0x1902f2){const _0xce2e23=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xc1add8=>_0xc1add8+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xf1cf59=[...document['body']['querySelectorAll'](_0xce2e23)]['filter'](_0x3b2eb6=>_0x3b2eb6===document['activeElement']||_0x3b2eb6['offsetWidth']+_0x3b2eb6['offsetHeight']>0x0)['sort']((_0x32b23c,_0x178b47)=>(_0x32b23c['tabIndex']||0x0)-(_0x178b47['tabIndex']||0x0)),_0x3b85c4=_0xf1cf59['indexOf'](_0x1902f2),_0x57c773=_0xf1cf59[(_0x3b85c4+0x1)%_0xf1cf59['length']];_0x57c773&&_0x57c773['focus']();}(this['view']['element']),this['hideDropdown'](),_0x198265();}),_0x36d716['focusTracker']['add'](this['view']['element']),_0x36d716['focusTracker']['on']('change:isFocused',(_0x42122e,_0x1e087b,_0x4b0cd7)=>{_0x4b0cd7||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 PresenceList extends _0x4067ea{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,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x57ac80,Plugin as _0x38ec35,PendingActions as _0x40cd9a,Context as _0xaf36e6}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x47e8bf,CKEditorError as _0x533522,Collection as _0x5510de,global as _0x3be0ca,version as nt,uid as _0x404c20,KeystrokeHandler as _0x4b7810}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1764ff,View as _0x422411,ListView as _0x462fd8,ListItemView as st,LabelView as at,BalloonPanelView as _0x21eb1a,clickOutsideHandler as _0x32589f,BodyCollection as _0x272992}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x151155,History as _0x41fb4f,NoOperation as _0x5f0d00,InsertOperation as _0x43fa61,MarkerOperation as _0x596344,RootAttributeOperation as _0x5c298c,transformOperationSets as _0x3f9ccd,OperationFactory as _0x327378}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ct,WEB_SOCKET_GATEWAY_STATES as _0x207676,CollaborativeEditingService as _0x46b370,User as ht,CommentsService as _0x1e0da1,TrackChangesService as it,RevisionHistoryService as _0x1b1037,EditorService as _0x3eecac}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x14383d,UserView as rt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xb0c797}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x5b9bb3}from'es-toolkit/compat';class n extends _0x57ac80{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ct)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1764ff];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ea4bc){super(_0x4ea4bc),this['set']('state',_0x207676['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x47e8bf())();}['init'](){const _0x31a5e8=this['context'],_0x19d571=_0x31a5e8['plugins']['get']('CloudServices'),_0x1fa388=_0x31a5e8['plugins']['get'](_0x1764ff);if(!_0x19d571['token'])throw new _0x533522('websocketgateway-missing-token',this);if(!_0x19d571['webSocketUrl'])throw new _0x533522('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'](_0x19d571['token'],_0x19d571['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x326c79=>{if(this['connection']=_0x326c79,this['bind']('state')['to'](_0x326c79,'state',this,'_isBrowserOffline',(_0x49581a,_0x24a136)=>('connected'!==_0x49581a&&(this['_shouldPluginsReconnect']=!0x0),_0x24a136||_0x49581a!==_0x207676['CONNECTED']?_0x207676['DISCONNECTED']:this['state']==_0x207676['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x207676['CONNECTING']):_0x207676['CONNECTED'])),this['connection']['on']('error',(_0x37308b,_0x29fc62)=>{if('limitExceeded'!==_0x29fc62['code'])throw console['error'](_0x29fc62),new _0x533522('cloudservices-init',null,{'originalError':_0x29fc62});_0x1fa388['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'});}),!_0x326c79['me'])return new Promise(_0x5b91f8=>_0x326c79['on']('change:me',_0x5b91f8));})['catch'](_0x424412=>{throw console['error'](_0x424412),new _0x533522('cloudservices-init',null,{'originalError':_0x424412});});}['addToReconnectionStack'](_0x58d860){if('function'!=typeof _0x58d860['reconnect'])throw new _0x533522('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x58d860))throw new _0x533522('websocketgateway-plugin-already-registered',this,{'name':_0x58d860['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x58d860);}['removeFromReconnectionStack'](_0x8ff7a2){this['_reconnectionStack']['delete'](_0x8ff7a2);}['isInReconnectionStack'](_0x6d3060){return this['_reconnectionStack']['has'](_0x6d3060);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x17122d=>_0x17122d['reconnect']())))['then'](()=>this['state']=_0x207676['CONNECTED'])['catch'](_0x5b22d7=>{throw console['error'](_0x5b22d7),new _0x533522('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x207676['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x57ac80{['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,_0x14383d];}constructor(_0x17b5a2){super(_0x17b5a2),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5510de(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x14383d);}['init'](){const _0x2b06f8=this['context']['plugins']['get'](n);this['listenTo'](_0x2b06f8,'change:state',(_0x2ba0ce,_0x5e4472,_0x5d7d9b)=>{if('connected'!==_0x5d7d9b)this['channelSessions']['forEach'](_0x1204b3=>_0x1204b3['clear']()),this['channelConnectedUsers']['forEach'](_0x546915=>_0x546915['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2cde34,_0xb45071]of this['_registeredSessions'])for(const _0x108e67 of _0xb45071)this['_handleSessionAdd'](_0x2cde34,_0x108e67);}}),this['_createUser'](_0x2b06f8['connection']['me'],!0x0);}['register'](_0x38bae8,_0x13b398){if(this['_registeredSessions']['has'](_0x38bae8))throw new _0x533522('sessions-register-already-registered',null,{'channelId':_0x38bae8});this['_registeredSessions']['set'](_0x38bae8,_0x13b398),this['channelSessions']['set'](_0x38bae8,new _0x5510de()),this['channelConnectedUsers']['set'](_0x38bae8,new _0x5510de()),this['listenTo'](_0x13b398,'add',(_0x1d43ee,_0x17c361)=>this['_handleSessionAdd'](_0x38bae8,_0x17c361)),this['listenTo'](_0x13b398,'remove',(_0x5bfdb4,_0x26bfa9)=>this['_handleSessionRemove'](_0x38bae8,_0x26bfa9));for(const _0x34f531 of _0x13b398)this['_handleSessionAdd'](_0x38bae8,_0x34f531);}['unregister'](_0x33fa18){if(!this['_registeredSessions']['has'](_0x33fa18))throw new _0x533522('sessions-unregister-not-exist',null,{'channelId':_0x33fa18});const _0x58bba6=this['_registeredSessions']['get'](_0x33fa18);this['stopListening'](_0x58bba6);for(const _0x5a8b90 of _0x58bba6)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x33fa18,_0x5a8b90);this['_registeredSessions']['delete'](_0x33fa18),this['channelSessions']['delete'](_0x33fa18),this['channelConnectedUsers']['delete'](_0x33fa18);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x342023){for(const _0x166cdc of this['channelSessions']['values']())for(const _0x3c1bcc of _0x166cdc)if(_0x3c1bcc['id']===_0x342023)return _0x3c1bcc['user'];}['getUserSessions'](_0x267164,_0x53db15){const _0x56c6e7=_0x53db15?[this['channelSessions']['get'](_0x53db15)]:this['channelSessions']['values'](),_0xa002df=new Set();for(const _0x15bc74 of _0x56c6e7)for(const _0x2a1363 of _0x15bc74)_0x2a1363['user']['id']===_0x267164['id']&&_0xa002df['add'](_0x2a1363['id']);return _0xa002df;}['getUserRole'](_0x53a904){for(const _0x2ca419 of this['channelSessions']['values']())for(const _0x445d6d of _0x2ca419)if(_0x445d6d['user']===_0x53a904)return _0x445d6d['role'];}['_handleSessionAdd'](_0x249e07,_0x28758f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1e322a=_0x28758f['user'],_0x5e4ddf=this['_users']['getUser'](_0x1e322a['id'])||this['_createUser'](_0x1e322a),_0x5bb888=Object['assign']({},_0x28758f,{'user':_0x5e4ddf});if(this['channelSessions']['get'](_0x249e07)['add'](_0x5bb888),!_0x1e322a['hiddenInPresenceList']){const _0x5c4489=this['channelConnectedUsers']['get'](_0x249e07);_0x5c4489['has'](_0x5e4ddf['id'])||_0x5c4489['add'](_0x5e4ddf),this['allConnectedUsers']['has'](_0x5e4ddf['id'])||_0x1e322a['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x5e4ddf,_0x5e4ddf['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x249e07,{'channelId':_0x249e07,'session':_0x5bb888});}['_handleSessionRemove'](_0x10decd,_0x38734f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1512bc=this['channelConnectedUsers']['get'](_0x10decd),_0x52225c=_0x38734f['user'];_0x52225c['id']&&(this['channelSessions']['get'](_0x10decd)['remove'](_0x38734f['id']),_0x1512bc['has'](_0x52225c['id'])&&!this['getUserSessions'](_0x52225c,_0x10decd)['size']&&_0x1512bc['remove'](_0x52225c['id']),this['allConnectedUsers']['get'](_0x52225c['id'])&&!this['getUserSessions'](_0x52225c)['size']&&this['allConnectedUsers']['remove'](_0x52225c['id']));}['_createUser'](_0x185dc4,_0xe49257){const _0x6bc89e=this['_users']['addUser'](_0x185dc4);return _0xe49257&&this['_users']['defineMe'](_0x185dc4['id']),_0x6bc89e['orderNumber']=this['_uniqueUsersCount']++,_0x6bc89e;}}class k extends _0x38ec35{['_domEmitter']=new(_0x47e8bf())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xb36323=this['editor'],_0x39b7e9=_0xb36323['plugins']['get'](i);_0xb36323['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x49d342,{writer:_0x18a363})=>function(_0x4a4f3f,_0x411df7,_0x500f00,_0x5f119){const _0x3f8c3e=_0x4a4f3f['markerName']['split'](':')[0x2],_0x59532c=_0x500f00['getUserBySessionId'](_0x3f8c3e);if(!_0x59532c||_0x3f8c3e===_0x500f00['mySessionId'])return;if(!_0x5f119['model']['schema']['checkChild'](_0x4a4f3f['markerRange']['start'],'$text'))return;const _0x4280ba={'class':'ck-user__marker\x20'+_0x59532c['color']['getMarkerClass'](),'data-name':_0x59532c['name'],'data-session-id':_0x3f8c3e},_0x166b2=_0x5f119['model']['markers']['get'](_0x4a4f3f['markerName']),_0x31167c=_0x166b2['getStart'](),_0x4eedda=_0x31167c['nodeAfter'],_0x529ff5=_0x5f119['model']['schema'];if(_0x4eedda&&_0x529ff5['isObject'](_0x4eedda)&&_0x529ff5['isInline'](_0x4eedda)&&!_0x5f119['model']['markers']['get']('user:range:'+_0x3f8c3e)['getRange']()['isCollapsed'])return;const _0x4da7c0=_0x31167c['parent'];return _0x5f119['model']['schema']['isLimit'](_0x4da7c0)&&!_0x5f119['model']['hasContent'](_0x4da7c0)&&(_0x4280ba['contenteditable']=!0x1),function(_0x1eb7c9,_0x198e08,_0x2cbe7e){const _0x21bf0a=_0x1eb7c9['createUIElement']('span',_0x198e08);return _0x1eb7c9['setCustomProperty']('userPositionMarker',!0x0,_0x21bf0a),_0x21bf0a['render']=function(_0x172367){const _0x32f834=this['toDomElement'](_0x172367),_0x145aa1=document['createElement']('span');return _0x145aa1['classList']['add']('ck-user__marker-tooltip'),_0x145aa1['setAttribute']('contenteditable','false'),_0x145aa1['setAttribute']('spellcheck','false'),_0x145aa1['textContent']=_0x2cbe7e['name'],_0x32f834['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x145aa1['outerHTML']+'⁠',_0x32f834['addEventListener']('mouseenter',()=>{_0x32f834['classList']['add']('ck-user__marker_hovered');}),_0x32f834['addEventListener']('mouseleave',()=>{_0x32f834['classList']['remove']('ck-user__marker_hovered');}),_0x32f834;},_0x21bf0a['isSimilar']=function(_0x43d9ca){return!(!this['getCustomProperty']('userPositionMarker')||!_0x43d9ca['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x43d9ca['getAttribute']('data-session-id'));},_0x21bf0a;}(_0x411df7,_0x4280ba,_0x59532c);}(_0x49d342,_0x18a363,_0x39b7e9,_0xb36323)}),_0xb36323['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5cd897=>function(_0xac4523,_0x241802){const _0x21be76=_0xac4523['markerName']['split'](':')[0x2];if(_0x21be76===_0x241802['mySessionId'])return null;const _0x3bfe02=_0x241802['getUserBySessionId'](_0x21be76);if(!_0x3bfe02)return{'id':_0x21be76,'classes':[]};return{'id':_0x21be76,'classes':['ck-user__selection',_0x3bfe02['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x21be76},'priority':0x7d0+_0x3bfe02['orderNumber']};}(_0x5cd897,_0x39b7e9)}),function(_0x11f68f){const _0x343435=_0x11f68f['model'],_0x2a0854=new Map(),_0x334029=_0x11f68f['plugins']['get'](i);_0x343435['markers']['on']('update:user:range',(_0x8ec179,_0x13e0f7,_0x756ef1,_0x3a0bea)=>{if(!_0x3a0bea&&_0x2a0854['get'](_0x13e0f7['name']))return _0x2a0854['get'](_0x13e0f7['name'])['detach'](),void _0x2a0854['delete'](_0x13e0f7['name']);const _0xefa6a4=_0x13e0f7['name']['split'](':')[0x2];if(_0xefa6a4===_0x334029['mySessionId'])return;const _0x2ef644='user:position:'+_0xefa6a4;_0x343435['markers']['has'](_0x2ef644)&&_0x11f68f['editing']['reconvertMarker'](_0x2ef644),_0x13e0f7['on']('change:range',(_0x5406b1,_0x363ae7,_0x38cfb5)=>{if('$graveyard'!=_0x363ae7['root']['rootName']&&'$graveyard'==_0x13e0f7['getRange']()['root']['rootName']&&!_0x2a0854['has'](_0x13e0f7['name'])){const _0x519567=_0x343435['schema']['getNearestSelectionRange'](_0x38cfb5['deletionPosition']);if(_0x519567){const _0x9a818f=_0x151155['fromRange'](_0x519567);_0x2a0854['set'](_0x13e0f7['name'],_0x9a818f),_0x9a818f['on']('change:range',(_0x3f2aa4,_0x264216,_0x5f08eb)=>{if('$graveyard'==_0x9a818f['root']['rootName']){const _0x194d27=_0x343435['schema']['getNearestSelectionRange'](_0x5f08eb['deletionPosition']);_0x194d27?(_0x9a818f['start']=_0x194d27['start'],_0x9a818f['end']=_0x194d27['end']):(_0x2a0854['delete'](_0x13e0f7['name']),_0x9a818f['detach']());}});}}});}),_0x343435['document']['on']('change',()=>{_0x2a0854['size']>0x0&&_0x343435['enqueueChange']({'isUndoable':!0x1},_0x2b2f5e=>{for(const [_0x42b0da,_0x2e5847]of _0x2a0854)'$graveyard'==_0x343435['markers']['get'](_0x42b0da)['getRange']()['root']['rootName']&&(x(_0x42b0da['split'](':')[0x2],_0x2e5847['toRange'](),_0x343435,_0x2b2f5e),_0x2e5847['detach']());_0x2a0854['clear']();});});}(_0xb36323),this['_domEmitter']['listenTo'](_0x3be0ca['document'],'keydown',(_0xda8123,{key:_0x5a2860})=>{'Escape'===_0x5a2860&&function(_0x5bfc2b){_0x5bfc2b['editing']['view']['change'](_0xc7697b=>{for(const _0x4d7718 of _0x5bfc2b['model']['markers']){if(!_0x4d7718['name']['startsWith']('user:position'))continue;const _0x1dbeea=_0x5bfc2b['editing']['mapper']['markerNameToElements'](_0x4d7718['name']);if(_0x1dbeea){for(const _0x353fbc of _0x1dbeea)_0xc7697b['removeClass']('ck-user__marker_hovered',_0x353fbc);}}});}(_0xb36323);},{'useCapture':!0x0});}['afterInit'](){const _0x529f8d=this['editor'],_0x47322d=_0x529f8d['commands']['get']('undo');_0x47322d&&_0x529f8d['model']['on']('applyOperation',(_0x131466,_0x3be613)=>{const _0x3edcf0=_0x3be613[0x0];if(!_0x3edcf0['isDocumentOperation'])return;if('marker'!=_0x3edcf0['type']||!_0x3edcf0['name']['startsWith']('user:'))return;const _0x21d1af=_0x3edcf0['batch'];_0x47322d['_createdBatches']['has'](_0x21d1af)&&(_0x3edcf0['newRange']=_0x3edcf0['oldRange']?_0x529f8d['model']['createRange'](_0x3edcf0['oldRange']['start'],_0x3edcf0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x55f4ee=this['editor'],_0x418e13=_0x55f4ee['model']['document'],_0x1dc636=_0x55f4ee['plugins']['get'](i);_0x55f4ee['model']['enqueueChange']({'isUndoable':!0x1},_0x5484d8=>{const _0x3ab9f0='user:range:'+_0x1dc636['mySessionId'],_0x117623='user:position:'+_0x1dc636['mySessionId'],_0x1ed0c8=_0x55f4ee['model']['markers']['has'](_0x3ab9f0);_0x55f4ee['editing']['view']['hasDomSelection']?x(_0x1dc636['mySessionId'],_0x418e13['selection']['getFirstRange'](),_0x55f4ee['model'],_0x5484d8):_0x1ed0c8&&(_0x5484d8['removeMarker'](_0x3ab9f0),_0x5484d8['removeMarker'](_0x117623));});}}function x(_0xb4c816,_0x5396fe,_0x333436,_0x41d789){const _0x381da8='user:range:'+_0xb4c816,_0x861d1f='user:position:'+_0xb4c816,_0x20ab22=_0x5396fe['getContainedElement']();let _0x385cc3=_0x5396fe['start'];if(_0x20ab22&&_0x20ab22['is']('element','tableCell')){const _0x5a2e8c=function(_0x14476f,_0x4d516a){for(const _0x4db255 of _0x14476f['getPositions']())if(_0x4d516a['schema']['checkChild'](_0x4db255,'$text'))return _0x4db255;}(_0x5396fe,_0x333436);_0x5a2e8c&&(_0x385cc3=_0x5a2e8c,_0x5396fe=_0x41d789['createRange'](_0x385cc3));}const _0x6b184f=_0x41d789['createRange'](_0x385cc3);_0x333436['markers']['has'](_0x381da8)?(_0x41d789['updateMarker'](_0x381da8,{'range':_0x5396fe}),_0x41d789['updateMarker'](_0x861d1f,{'range':_0x6b184f})):(_0x41d789['addMarker'](_0x381da8,{'range':_0x5396fe,'usingOperation':!0x0}),_0x41d789['addMarker'](_0x861d1f,{'range':_0x6b184f,'usingOperation':!0x0}));}function R(_0x1aa0e5,_0x4d112e,_0x555b7a){const _0x5f3972=_0x1aa0e5['t'],t=_0x1aa0e5['t'];switch(_0x4d112e){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 _0x5f3972({'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'},_0x555b7a);default:return'';}}let j=0x1;class l extends _0x38ec35{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x46b370)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,k,_0x40cd9a,_0x14383d,_0x1764ff];}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 _0x112e0d=this['serverHistory']['getOperations']();for(let _0x5575fd=_0x112e0d['length']-0x1;_0x5575fd>=0x0;_0x5575fd--){const _0x8c4251=_0x112e0d[_0x5575fd];if(!this['_disconnectionOperations']['has'](_0x8c4251))return _0x8c4251['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x28bed0){if(super(_0x28bed0),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x41fb4f(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x533522('collaboration-missing-channelid',this);const _0x2998d4=_0x28bed0['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x2998d4,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xb0c797(),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 OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x2e3841=this['editor'],_0x4b06e4=_0x2e3841['plugins']['get'](_0x14383d),_0x14ace6=_0x2e3841['plugins']['get'](n);this['listenTo'](_0x4b06e4,'getOperationAuthor',(_0x3b261d,_0x59447f)=>{const _0x25b695=_0x59447f[0x0];_0x25b695['_authorId']&&(_0x3b261d['return']=_0x4b06e4['getUser'](_0x25b695['_authorId']),_0x3b261d['stop']()),null===_0x25b695['_authorId']&&(_0x3b261d['return']=null,_0x3b261d['stop']());},{'priority':'high'}),this['listenTo'](_0x2e3841['model']['document']['selection'],'change:range',(_0x1942e3,_0x3c91ea)=>{_0x3c91ea['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x2e3841['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x2e3841['model']['on']('applyOperation',(_0x74dbdd,_0x3912f0)=>{const _0x560e0d=_0x3912f0[0x0];_0x560e0d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x560e0d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x14ace6,'state',this,'_hasSynchronizationProblem',(_0x3f8d9f,_0x144e87)=>'connected'===_0x3f8d9f&&!_0x144e87),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x2e3841['disableReadOnlyMode']('rtc-offline'):_0x2e3841['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x2e3841['disableReadOnlyMode']('rtc-offline'):_0x2e3841['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5ceac2=this['editor']['plugins']['get'](i),_0x58d5f8=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x5ceac2['unregister'](this['_channelId']);const _0x1b7c0e=await this['_service']['reconnect'](_0x58d5f8['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1b7c0e)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2092f3=await this['_service']['getConnectedSessions']();_0x5ceac2['register'](this['_channelId'],_0x2092f3),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2e6793){if(function(_0x32afa1){return'404'===_0x32afa1['code'];}(_0x2e6793)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3cc451){return'409'===_0x3cc451['code'];}(_0x2e6793)){const _0xad9452=R(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'](_0xad9452);}else{if(!(_0x2e6793 instanceof ReconnectionError))throw _0x2e6793;this['_handleReconnectionError']();}}}}['destroy'](){const _0x61c27e=this['editor']['plugins']['get'](n),_0x2fbc6c=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2fbc6c['channelSessions']['has'](this['_channelId'])&&_0x2fbc6c['unregister'](this['_channelId']),_0x61c27e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5d3087){if(this['sessionId']!==_0x5d3087['sessionId']&&this['_lastSyncedOperationId']!==_0x5d3087['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x5d3087['sessionId'],this['_handleServerResponse']([],{..._0x5d3087,'wereChangesApplied':!0x1,'data':_0x5d3087['data']},'reconnect');}async['_connectService'](_0x727a59,_0x4ed546=!0x1){const {connection:_0x4836}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x4836,this['_channelId'])['then'](_0x4178ad=>this['_initSessionsHandling'](_0x4178ad))['catch'](_0x47e125=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x47e125);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3241de,_0x3a79a2)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3a79a2);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x618b9d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x727a59);this['_isPendingUpdate']=!0x0;const _0x37cf61=await this['_service']['connect'](_0x4836,this['_compressOperations'](_0x727a59),_0x618b9d);if(this['sessionId']=_0x37cf61['sessionId'],_0x4ed546){if(!_0x37cf61['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x37cf61['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x727a59,_0x37cf61,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x37cf61,_0x727a59);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4a1755=this['editor']['plugins']['get'](i),_0x11d7ab=this['editor']['plugins']['get'](k),_0x404fa3=_0x4a1755['channelSessions']['get'](this['_channelId']);_0x404fa3&&_0x404fa3['length']>0x1?_0x11d7ab['createUserMarkerOperations']():this['listenTo'](_0x4a1755,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4a1755['channelSessions']['get'](this['_channelId'])['length']&&_0x11d7ab['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x5bd086,_0x43170c,_0x4e1a52,_0x20c333){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x43170c){const _0x1f97ef=this['_decompressOperations'](_0x4e1a52,_0x20c333);await this['_fetchMissingUsers'](_0x1f97ef),this['_handleExternalOperations'](_0x1f97ef,_0x43170c,_0x4e1a52['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0xb87d22}=this['editor'];let _0x56fa8a;try{_0x56fa8a=await this['_service']['getDocumentDetails']();}catch{const _0x5bba55=R(_0xb87d22,'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'](_0x5bba55);}const _0x40cd8e=_0x56fa8a['currentDocumentSession']||_0x56fa8a['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x40cd8e['lastOperationId']){const _0x4e2c3a=R(_0xb87d22,'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'](_0x4e2c3a);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x1d73ff){const _0x34ce57=this['editor']['plugins']['get'](i);this['listenTo'](_0x34ce57,'sessionAdd:'+this['_channelId'],(_0x1a6447,{session:_0x30c255})=>{if(_0x30c255['id']===_0x34ce57['mySessionId']){_0x1a6447['off']();const _0x30cce9=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x50f240=_0x30c255['permissions'];_0x30cce9&&_0x30cce9['isEnabled']&&(_0x50f240=_0x50f240['filter'](_0x1703d3=>'document:write'!==_0x1703d3)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x50f240,this['_channelId']);}}),_0x34ce57['register'](this['_channelId'],_0x1d73ff);}['_initThrowingOnDataSet'](){const _0x5ed38e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2e49c3)=>{if(!_0x2e49c3[_0x2e49c3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x533522('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5ed38e['apply'](this['editor']['data'],_0x2e49c3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x19a078,[_0xda7361])=>{if(this['_document']['version'])throw new _0x533522('realtimecollaborationclient-init-document-already-initialized',this);_0x19a078['stop'](),this['_setPendingAction']();const _0x2b9437=this['editor']['config']['get']('rootsAttributes'),_0x42fee0=this['_getOperationsFromInitData'](_0xda7361,_0x2b9437);0x0==_0x42fee0['length']&&_0x42fee0['push'](new _0x5f0d00(0x0)),_0x19a078['return']=this['_connectService'](_0x42fee0)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4098ab=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4098ab))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x57bf4b,[_0x39946a,_0x4f6dda])=>{_0x57bf4b['stop']();const _0x171a6f=this['editor']['model']['document']['getRoot'](_0x39946a);if(!this['_knownRootNames']['has'](_0x39946a)){const _0x2ec0c4=_0x4f6dda&&_0x4f6dda['data']?_0x4f6dda['data']:'',_0x5eeee8=_0x4f6dda&&_0x4f6dda['attributes']?_0x4f6dda['attributes']:{};await this['_loadRoot'](_0x39946a,_0x2ec0c4,_0x5eeee8);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x171a6f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x171a6f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x41e10d){const _0xeba898=this['editor']['plugins']['get'](_0x14383d),{connection:_0x1aaf5c}=this['editor']['plugins']['get'](n),_0x56a9e9=new Set();for(const _0x11bcb5 of _0x41e10d){const _0x47d472=_0x11bcb5['_authorId'];_0x47d472&&!_0xeba898['getUser'](_0x47d472)&&_0x56a9e9['add'](_0x47d472);}if(0x0===_0x56a9e9['size'])return;const _0x187ff7=await ht['getMany'](_0x1aaf5c,Array['from'](_0x56a9e9));for(const _0x3165dd of _0x187ff7)_0xeba898['getUser'](_0x3165dd['id'])||_0xeba898['addUser'](_0x3165dd);}['_getOperationsFromInitData'](_0x4165d5,_0x11f751={}){const _0x5dce9e=this['editor']['model'],_0x61fefa=[];let _0x1088e6=0x0;const _0x567ed5='string'==typeof _0x4165d5?{'main':_0x4165d5}:_0x4165d5;for(const _0x382603 of Object['keys'](_0x567ed5)){if(!this['_document']['roots']['has'](_0x382603))throw new _0x533522('realtimecollaborationclient-init-non-existent-root',this);const _0x1fbda9=this['editor']['data']['parse'](_0x567ed5[_0x382603]),_0x26126f=this['_document']['getRoot'](_0x382603),_0x5b1dda=new _0x43fa61(_0x5dce9e['createPositionAt'](_0x26126f,0x0),_0x1fbda9,_0x1088e6++);_0x61fefa['push'](_0x5b1dda);for(const [_0x23e7cb,_0x481035]of _0x1fbda9['markers']){const _0x2a9742=_0x5dce9e['createRange'](_0x5dce9e['createPositionFromPath'](_0x26126f,_0x481035['start']['path']['slice']()),_0x5dce9e['createPositionFromPath'](_0x26126f,_0x481035['end']['path']['slice']())),_0x5297f8=new _0x596344(_0x23e7cb,null,_0x2a9742,_0x5dce9e['markers'],!0x0,_0x1088e6++);_0x61fefa['push'](_0x5297f8);}}if(_0x11f751)for(const [_0x8288ba,_0x1a883d]of Object['entries'](_0x11f751)){const _0x33b86d=_0x5dce9e['document']['getRoot'](_0x8288ba);if(!_0x33b86d)throw new _0x533522('multi-root-editor-root-attributes-no-root',null);for(const [_0x474890,_0x5d7040]of Object['entries'](_0x1a883d))if(null!==_0x5d7040){const _0x2d9550=new _0x5c298c(_0x33b86d,_0x474890,null,_0x5d7040,_0x1088e6++);_0x61fefa['push'](_0x2d9550);}}return _0x61fefa;}async['_loadRoot'](_0x142caa,_0x39f344,_0x147c81){this['_getOperationsFromInitData']({[_0x142caa]:_0x39f344},{[_0x142caa]:_0x147c81})['forEach']((_0x9b105d,_0x12ab50)=>{_0x9b105d['baseVersion']=this['_document']['version']+_0x12ab50,_0x9b105d['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x9b105d);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x503c6c,_0x2eb7f0){let _0x4ccd66;this['_offset']=_0x503c6c['offset'];const _0x1b5e36=_0x503c6c['wereChangesApplied']&&!_0x503c6c['initData'],_0x15f036=_0x1b5e36?0x0:_0x503c6c['data']['baseVersion'];if(_0x2eb7f0['forEach'](_0x493ecb=>{_0x493ecb['_isInit']=!0x0,_0x493ecb['createdAt']=_0x503c6c['sessionCreatedAt'],_0x493ecb['_authorId']=null;}),_0x1b5e36)_0x4ccd66=_0x2eb7f0,this['_applyOperationsSet'](_0x4ccd66,_0x1b5e36);else{if(_0x503c6c['initData']){const _0x53479e=this['_getOperationsFromInitData'](_0x503c6c['initData']);this['_document']['history']['version']=-_0x53479e['length'],_0x53479e['forEach'](_0x3b3399=>{_0x3b3399['baseVersion']-=_0x53479e['length'],_0x3b3399['createdAt']=_0x503c6c['sessionCreatedAt'],_0x3b3399['_isInit']=!0x0,_0x3b3399['_authorId']=null;}),this['_applyOperationsSet'](_0x53479e,!0x0),this['serverHistory']['version']=-_0x53479e['length']+this['_offset'],this['_updateServerHistory'](_0x53479e);}this['_document']['history']['version']=_0x15f036,_0x4ccd66=this['_decompressOperations'](_0x503c6c['data'],_0x503c6c['metadata']),await this['_fetchMissingUsers'](_0x4ccd66),this['_applyOperationsSet'](_0x4ccd66,_0x1b5e36);}_0x503c6c['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4ccd66,_0x503c6c['lastOperationId']),this['_lastSyncedOperationId']=_0x503c6c['lastOperationId']),this['serverHistory']['version']=_0x15f036+this['_offset'],this['_updateServerHistory'](_0x4ccd66),_0x2eb7f0['filter'](_0x40947d=>{const _0x3370c4=this['_getAffectedRoot'](_0x40947d);return _0x3370c4&&!this['_knownRootNames']['has'](_0x3370c4);})['forEach']((_0x5ca292,_0x3c2a34)=>{_0x5ca292['baseVersion']=this['_document']['version']+_0x3c2a34,this['_saveOperationInBuffer'](_0x5ca292);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x6abf9f,_0x4d91fa){const _0x1bee65=_0x4d91fa&&_0x4d91fa['message'];if(_0x1bee65&&_0x1bee65['startsWith']('realtimecollaborationclient'))throw _0x4d91fa;const _0xf74f8=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0xf74f8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x533522(_0x6abf9f,this['editor'],_0x1bee65?{'originalError':_0x1bee65}:void 0x0);}['_saveOperationInBuffer'](_0xf9a21e){this['_knownOperations']['has'](_0xf9a21e)||(this['_knownOperations']['add'](_0xf9a21e),this['_bufferedOperations']['push'](_0xf9a21e),this['_pendingAction']||'marker'==_0xf9a21e['type']&&!_0xf9a21e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x14e10b=!0x1){!_0x14e10b&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x347d10=>{_0x347d10&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x5b1086=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x203d37){return _0x203d37['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x203d37['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x203d37['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x5b1086)||this['_crash'](_0x5b1086['message'],_0x5b1086);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2c01ec=>{this['on']('change:_isPendingUpdate',()=>{_0x2c01ec();});});}async['_sendBufferedOperations'](){const _0x2b6fc0=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x2b6fc0['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x349339=[...this['_bufferedOperations']];for(const _0xf7dee3 of _0x349339)_0xf7dee3['wasUndone']=this['_document']['history']['isUndoneOperation'](_0xf7dee3);const _0x4c723b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x349339),_0x1e0601=j++,_0x41aa32=this['_compressOperations'](_0x349339),_0x53c59f=await this['_service']['sendOperations'](_0x41aa32,_0x41aa32['baseVersion'],_0x4c723b);try{return await this['_handleServerResponse'](_0x349339,_0x53c59f,_0x1e0601);}catch(_0x3f2cd3){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3f2cd3);}}async['_handleServerResponse'](_0x1c3f55,_0x262f01,_0x2e6bcf){if('error'in _0x262f01)throw _0x262f01['error'];let _0x1608e1=!0x1;if(_0x262f01['wereChangesApplied']){_0x262f01['lastOperationId']&&(this['_lastSyncedOperationId']=_0x262f01['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3a1885=>!_0x1c3f55['includes'](_0x3a1885));for(const _0x51e4b9 of _0x1c3f55)_0x51e4b9['createdAt']='lastOperationAcceptedAt'in _0x262f01&&_0x262f01['lastOperationAcceptedAt']||void 0x0;D(_0x1c3f55,_0x262f01['version']-_0x1c3f55['length']),this['_updateServerHistory'](_0x1c3f55);const _0x187c62=_0x1c3f55['filter'](_0x25352b=>{if(!_0x25352b['_isInit'])return!0x1;const _0x651e17=this['_getAffectedRoot'](_0x25352b);return _0x651e17&&!this['_knownRootNames']['has'](_0x651e17);});D(_0x187c62,this['_document']['version']),this['_applyOperationsSet'](_0x187c62),_0x1608e1=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xfed8f5=this['_decompressOperations'](_0x262f01['data'],_0x262f01['metadata'])['filter'](_0x4ead6b=>_0x4ead6b['baseVersion']>=this['_lastServerVersion']);_0xfed8f5['forEach'](_0x40df96=>this['_addKnownRoot'](_0x40df96)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3c590f=>!_0x3c590f['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3c590f))),this['_bufferedOperations']['length']&&D(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xfed8f5),_0x1608e1=this['_handleExternalOperations'](_0xfed8f5,_0x262f01['version'],_0x262f01['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1608e1?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x283619,_0x43a213,_0x5956ea){try{const _0x498ae2={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x455089,operationsB:_0x685b68,originalOperations:_0x51384c}=_0x3f9ccd(_0x283619,this['_bufferedOperations'],_0x498ae2);D(_0x455089,this['_document']['version']),D(_0x685b68,_0x43a213);for(const _0x36573f of _0x455089){const _0x2c5ff4=_0x51384c['get'](_0x36573f);_0x36573f['_authorId']=_0x2c5ff4?_0x2c5ff4['_authorId']:null;}_0x5956ea&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x283619,_0x5956ea),this['_lastSyncedOperationId']=_0x5956ea),this['_bufferedOperations']=[..._0x685b68],this['_applyOperationsSet'](_0x455089),this['_updateServerHistory'](_0x283619);}catch(_0x33ff98){return console['error'](_0x33ff98),!0x1;}return!0x0;}['_applyOperationsSet'](_0x517f9a,_0x32e92d=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x23ce79=>{for(const _0x26b536 of _0x517f9a)this['_knownOperations']['add'](_0x26b536),this['_addKnownRoot'](_0x26b536),_0x23ce79['batch']['addOperation'](_0x26b536),this['editor']['model']['applyOperation'](_0x26b536);});}['_addKnownRoot'](_0x18812a){const _0x3bda36=this['_getAffectedRoot'](_0x18812a);_0x3bda36&&this['_knownRootNames']['add'](_0x3bda36);}['_getAffectedRoot'](_0x1f9f0d){let _0x4894ac,_0xdebdac;switch(_0x1f9f0d['type']){case'insert':_0x4894ac=_0x1f9f0d['position']['root'];break;case'marker':if(_0xdebdac=_0x1f9f0d['newRange'],!_0xdebdac)return null;_0x4894ac=_0xdebdac['root'];break;case'addRootAttribute':_0x4894ac=_0x1f9f0d['root'];break;case'addRoot':_0x4894ac=_0x1f9f0d['affectedSelectable'];break;case'move':_0x4894ac=_0x1f9f0d['targetPosition']['root'];break;default:return null;}return _0x4894ac['rootName'];}['_updateServerHistory'](_0x3d99af){_0x3d99af['forEach'](_0x2b57cb=>{const _0x4bee53=_0x2b57cb['clone']();_0x4bee53['_authorId']=_0x2b57cb['_authorId'],_0x4bee53['_isInit']=!!_0x2b57cb['_isInit'],_0x4bee53['createdAt']=_0x2b57cb['createdAt'],_0x4bee53['baseVersion']+=this['_offset'],_0x2b57cb['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4bee53),this['serverHistory']['addOperation'](_0x4bee53);});}['_handleReconnectionError'](_0x39b5d6){const _0x4d0ca3=this['editor']['plugins']['get']('Notification'),_0x43965b=this['editor']['locale'];_0x39b5d6||(_0x39b5d6=R(_0x43965b,'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.')),_0x4d0ca3['showWarning'](_0x39b5d6,{'title':R(_0x43965b,'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'](_0x40cd9a)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x40cd9a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x208e78){const _0x50f136=_0x208e78['map'](_0x3d23e9=>_0x3d23e9['toJSON']());return this['_compressor']['compress'](_0x50f136);}['_decompressOperations'](_0x4ae516,_0x475d33){return this['_compressor']['decompress'](_0x4ae516)['map']((_0x5da784,_0x20eb3f)=>{const _0x44fb63='init'==_0x475d33[_0x20eb3f]['type'];if('InsertOperation'==_0x5da784['__className']){const _0x293167=_0x5da784['position']['root'];!this['_document']['getRoot'](_0x293167)&&(this['_document']['createRoot']('$root',_0x293167)['_isAttached']=!0x1);}const _0x28882f=_0x327378['fromJSON'](_0x5da784,this['_document']);return _0x28882f['wasUndone']=_0x5da784['wasUndone'],_0x28882f['_isInit']=_0x44fb63,_0x28882f['_authorId']=_0x44fb63?null:_0x475d33[_0x20eb3f]['userId'],_0x28882f['_isDisconnection']='cs:removeUser'===_0x475d33[_0x20eb3f]['type'],_0x28882f['createdAt']=_0x475d33[_0x20eb3f]['createdAt'],_0x28882f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2a0015=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2a0015&&_0x2a0015['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function D(_0x455edd,_0x271bf0){for(const _0x5bca4d of _0x455edd)_0x5bca4d['baseVersion']=_0x271bf0++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x2cb0a4){this['_ignoredOperations']=_0x2cb0a4,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x501d92){let _0x169220=_0x501d92['length'];for(;_0x169220--;){const _0x2f5191=_0x501d92[_0x169220];if(!this['_ignoredOperations']['has'](_0x2f5191)){if(!this['_operationToId']['has'](_0x2f5191)){const _0x4ccf9e=_0x404c20()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2f5191,_0x4ccf9e);}return this['_operationToId']['get'](_0x2f5191);}}}['setIdForTheLastOperation'](_0x5e7e5d,_0x58a4fc){if(!_0x58a4fc)return;let _0x22802=_0x5e7e5d['length'];for(;_0x22802--;){const _0x4a0e06=_0x5e7e5d[_0x22802];this['_ignoredOperations']['has'](_0x4a0e06)||this['_operationToId']['set'](_0x4a0e06,_0x58a4fc);}}}class a extends _0x38ec35{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x57ac80{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x1e0da1)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x14383d];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2159a3){super(_0x2159a3),this['_services']=new Map();}async['init'](){const _0x59e0e2=this['context'],_0x12fb4e=_0x59e0e2['plugins']['get']('CommentsRepository');if(_0x59e0e2['plugins']['get'](n)['addToReconnectionStack'](this),_0x12fb4e['adapter']={'addCommentThread':async({channelId:_0xc821c4,threadId:_0x48b835,comments:_0x680b6e,resolvedAt:_0x291d7f,resolvedBy:_0x5e9a6b,context:_0x555c33,attributes:_0x2b7970})=>{const _0x41a8d2=await this['_getService'](_0xc821c4)['addCommentThread']({'commentThreadId':_0x48b835,'comments':_0x680b6e['map'](_0x3bb846=>function(_0x2819bc,_0x1bcaf8,_0xd6631e){return{'commentThreadId':_0xd6631e,'commentId':_0x2819bc['commentId'],'userId':_0x2819bc['authorId'],'content':_0x2819bc['content'],'documentId':_0x1bcaf8,'createdAt':_0x2819bc['createdAt'],'attributes':_0x2819bc['attributes']||{}};}(_0x3bb846,_0xc821c4,_0x48b835)),'resolvedAt':_0x291d7f,'resolvedBy':_0x5e9a6b,'context':_0x555c33,'attributes':_0x2b7970})['catch'](lt);return{'threadId':_0x41a8d2['commentThreadId'],'comments':_0x41a8d2['comments']};},'getCommentThread':async({channelId:_0x2eb857,threadId:_0x24828e})=>{const _0x835a91=await this['_getService'](_0x2eb857)['getCommentThread'](_0x24828e)['catch'](tt)['catch'](lt);return _0x835a91?_0x835a91['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x835a91]),{'threadId':_0x835a91['commentThreadId'],'comments':_0x835a91['comments']['map'](ot),'context':_0x835a91['context'],'resolvedAt':_0x835a91['resolvedAt'],'resolvedBy':_0x835a91['resolvedBy'],'attributes':_0x835a91['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x564f4a,threadId:_0x235cf3,context:_0x5a1f24,unlinkedAt:_0x24d272,attributes:_0x8f798a})=>this['_getService'](_0x564f4a)['updateCommentThread']({'commentThreadId':_0x235cf3,'context':_0x5a1f24,'attributes':_0x8f798a,'unlinkedAt':_0x24d272})['catch'](tt)['catch'](lt),'resolveCommentThread':async({channelId:_0x72a05e,threadId:_0x26a9a8})=>{const _0x556e61=await this['_getService'](_0x72a05e)['resolveCommentThread'](_0x26a9a8)['catch'](tt)['catch'](lt);return{'threadId':_0x556e61['commentThreadId'],'resolvedAt':_0x556e61['resolvedAt'],'resolvedBy':_0x556e61['resolvedBy']};},'reopenCommentThread':async({channelId:_0xfd3697,threadId:_0x5c343f})=>this['_getService'](_0xfd3697)['reopenCommentThread'](_0x5c343f)['catch'](tt)['catch'](lt),'removeCommentThread':({channelId:_0x194c1e,threadId:_0x4e08b2})=>this['_getService'](_0x194c1e)['removeCommentThread'](_0x4e08b2)['catch'](tt)['catch'](lt),'addComment':({channelId:_0x223f30,threadId:_0x42dadf,commentId:_0x2e211b,content:_0x13b952,attributes:_0x34d9db})=>this['_getService'](_0x223f30)['addComment'](_0x42dadf,_0x2e211b,_0x13b952,_0x34d9db)['catch'](lt),'updateComment':({channelId:_0x1a3354,threadId:_0x294b55,commentId:_0x5a8f56,content:_0x21f5c9,attributes:_0x5b97be})=>this['_getService'](_0x1a3354)['updateComment'](_0x294b55,_0x5a8f56,_0x21f5c9,_0x5b97be)['catch'](tt)['catch'](lt),'removeComment':({channelId:_0x2dd463,threadId:_0x5834b1,commentId:_0x5b3951})=>this['_getService'](_0x2dd463)['removeComment'](_0x5834b1,_0x5b3951)['catch'](tt)['catch'](lt)},_0x59e0e2 instanceof _0xaf36e6){const _0x57e0ba=_0x59e0e2['config']['get']('collaboration.channelId'),_0x32a795=_0x59e0e2['plugins']['get'](i);await this['_setUpService'](_0x57e0ba);const _0x1e4769=await this['_services']['get'](_0x57e0ba)['getConnectedSessions']();this['listenTo'](_0x32a795,'sessionAdd:'+_0x57e0ba,(_0x53f4fe,{session:_0x3e64ad})=>{_0x3e64ad['id']===_0x32a795['mySessionId']&&(_0x53f4fe['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3e64ad['permissions'],_0x57e0ba));}),_0x32a795['register'](_0x57e0ba,_0x1e4769);}}async['_setUpService'](_0x206481){if(this['_services']['has'](_0x206481))throw new _0x533522('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x206481});const _0x4ce775=this['context']['plugins']['get']('CommentsRepository'),_0x39e30a=new s['CommentsService'](_0x206481);this['_services']['set'](_0x206481,_0x39e30a),this['listenTo'](_0x39e30a,'commentThreadAdded',(_0x2c6b47,_0x552e13)=>{const {commentThreadId:_0x2cad33,documentId:_0x502712,context:_0x18baf8,attributes:_0x3c988a,resolvedAt:_0x12b35b,resolvedBy:_0xb6dbc3,comments:_0x59ab46}=_0x552e13;_0x4ce775['getCommentThread'](_0x2cad33)||_0x4ce775['addCommentThread']({'threadId':_0x2cad33,'channelId':_0x502712,'comments':_0x59ab46?_0x59ab46['map'](ot):[],'context':_0x18baf8,'attributes':_0x3c988a,'resolvedAt':_0x12b35b,'resolvedBy':_0xb6dbc3,'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadUpdated',(_0x201460,{commentThreadId:_0x4551ec,documentId:_0x62b936,context:_0x4e3c0e,unlinkedAt:_0x1a1008,attributes:_0x33dd74})=>{_0x4ce775['getCommentThread'](_0x4551ec)&&_0x4ce775['updateCommentThread']({'threadId':_0x4551ec,'channelId':_0x62b936,'context':_0x4e3c0e,'unlinkedAt':_0x1a1008,'attributes':_0x33dd74,'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadResolved',(_0x3c9ddc,{commentThreadId:_0xd23732,resolvedBy:_0xd3bb0f,resolvedAt:_0x49dd60})=>{const _0x11ebad=_0x4ce775['getCommentThread'](_0xd23732);_0x11ebad&&_0x11ebad['resolve']({'resolvedBy':_0xd3bb0f,'resolvedAt':_0x49dd60,'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadReopened',(_0x303ae0,{commentThreadId:_0x48155c})=>{const _0x24b9a0=_0x4ce775['getCommentThread'](_0x48155c);_0x24b9a0&&_0x24b9a0['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadRemoved',(_0x251c42,{commentThreadId:_0x5aad9a})=>{const _0xca6fa0=_0x4ce775['getCommentThread'](_0x5aad9a);_0xca6fa0&&_0xca6fa0['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentAdded',(_0x3230d7,_0x548302)=>{const _0x1eab55=_0x548302['commentThreadId'],_0xb89b46=_0x4ce775['getCommentThread'](_0x1eab55);_0xb89b46&&_0xb89b46['addComment']({...ot(_0x548302),'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentUpdated',(_0x256940,{commentThreadId:_0x538555,commentId:_0x5db5e3,content:_0xaf75a6,attributes:_0x3c427d})=>{const _0x3ef030=_0x4ce775['getCommentThread'](_0x538555);if(_0x3ef030){const _0x575d11=_0x3ef030['getComment'](_0x5db5e3);_0x575d11&&_0x575d11['update']({'content':_0xaf75a6,'attributes':_0x3c427d,'isFromAdapter':!0x0});}}),this['listenTo'](_0x39e30a,'commentRemoved',(_0x439185,{commentThreadId:_0x547245,commentId:_0x1e6dff})=>{const _0x3f5e5b=_0x4ce775['getCommentThread'](_0x547245);if(_0x3f5e5b){const _0x4c7574=_0x3f5e5b['getComment'](_0x1e6dff);_0x4c7574&&_0x4c7574['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x206481);}['destroy'](){if(this['context']instanceof _0xaf36e6){const _0x51ab22=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x51ab22);}}['_terminateService'](_0x1c527e){if(!this['_services']['has'](_0x1c527e))throw new _0x533522('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1c527e});this['_getService'](_0x1c527e)['disconnect'](),this['_services']['delete'](_0x1c527e);}async['reconnect'](){for(const _0x136fb0 of this['_services']['keys']())await this['_connectService'](_0x136fb0);if(this['context']instanceof _0xaf36e6){const _0x506ac=this['context']['config']['get']('collaboration.channelId'),_0x9131bd=this['context']['plugins']['get'](i);_0x9131bd['unregister'](_0x506ac);const _0x39171f=await this['_services']['get'](_0x506ac)['getConnectedSessions']();_0x9131bd['register'](_0x506ac,_0x39171f);}}async['_connectService'](_0x2db7c9){const {connection:_0x3be3c7}=this['context']['plugins']['get'](n),_0x4eb9ad=this['context']['plugins']['get']('CommentsRepository'),_0x109602=this['_services']['get'](_0x2db7c9),_0x3125fa=await _0x109602['connect'](_0x3be3c7);await this['_fetchMissingUsersForThreads'](_0x3125fa);const _0x1d1dc8=new Set(Array['from'](_0x4eb9ad['getCommentThreads']({'channelId':_0x2db7c9}),_0x15b330=>_0x15b330['id']));for(const _0x2f803d of _0x3125fa)_0x2f803d['deletedAt']||_0x1d1dc8['delete'](_0x2f803d['commentThreadId']);for(const _0x4dd47a of _0x1d1dc8)_0x4eb9ad['getCommentThread'](_0x4dd47a)['remove']({'isFromAdapter':!0x0});for(const _0x24fdd4 of _0x3125fa){let _0x1e0408=_0x4eb9ad['getCommentThread'](_0x24fdd4['commentThreadId']);const {commentThreadId:_0x23bd9f,context:_0x2a60da,attributes:_0x4a473a,resolvedBy:_0x32c061,resolvedAt:_0x16392e,unlinkedAt:_0x26aa2c,deletedAt:_0x5bf652}=_0x24fdd4;if(_0x5bf652)continue;_0x1e0408||(_0x1e0408=_0x4eb9ad['addCommentThread']({'channelId':_0x2db7c9,'threadId':_0x23bd9f,'context':_0x2a60da,'attributes':_0x4a473a||{},'resolvedBy':_0x32c061,'resolvedAt':_0x16392e,'unlinkedAt':_0x26aa2c,'isFromAdapter':!0x0}));const _0x23e723=new Set(Array['from'](_0x1e0408['comments'],_0x5102f6=>_0x5102f6['id']));for(const _0x29ec75 of _0x24fdd4['comments'])_0x23e723['delete'](_0x29ec75['commentId']);for(const _0x4fe1a1 of _0x23e723)_0x1e0408['getComment'](_0x4fe1a1)['remove']({'isFromAdapter':!0x0});for(const _0xaaf948 of _0x24fdd4['comments']){const _0x1304b6=_0x1e0408['getComment'](_0xaaf948['commentId']);_0x1304b6?_0x1304b6['content']!==_0xaaf948['content']&&_0x1304b6['update']({'content':_0xaaf948['content'],'isFromAdapter':!0x0}):_0x1e0408['addComment'](Object['assign'](ot(_0xaaf948),{'isFromAdapter':!0x0}));}}}['_getService'](_0xd03367){if(!this['_services']['has'](_0xd03367))throw new _0x533522('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xd03367});return this['_services']['get'](_0xd03367);}async['_fetchMissingUsersForThreads'](_0x141c90){const _0xb828d3=this['context']['plugins']['get'](_0x14383d),{connection:_0x1974cf}=this['context']['plugins']['get'](n),_0x2c9292=new Set();for(const {resolvedBy:_0x19767c,comments:_0x5cd7f6}of _0x141c90){_0x19767c&&!_0xb828d3['getUser'](_0x19767c)&&_0x2c9292['add'](_0x19767c);for(const {userId:_0x5cfa4c}of _0x5cd7f6)_0xb828d3['getUser'](_0x5cfa4c)||_0x2c9292['add'](_0x5cfa4c);}if(0x0===_0x2c9292['size'])return;const _0x48d07b=await ht['getMany'](_0x1974cf,Array['from'](_0x2c9292));for(const _0x2410d0 of _0x48d07b)_0xb828d3['getUser'](_0x2410d0['id'])||_0xb828d3['addUser'](_0x2410d0);}}async function tt(_0x331e30){if('404'!==_0x331e30['code'])throw _0x331e30;}function lt(_0x13dae1){if((_0x15b791=_0x13dae1)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x15b791['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x15b791['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x15b791;throw _0x13dae1;}function ot(_0x412d33){return{'threadId':_0x412d33['commentThreadId'],'commentId':_0x412d33['commentId'],'content':_0x412d33['content'],'createdAt':_0x412d33['createdAt'],'authorId':_0x412d33['userId'],'attributes':_0x412d33['attributes']||{}};}class m extends _0x38ec35{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>it)());['_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(_0x4c8875){super(_0x4c8875);const _0x160f70=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x160f70);}['init'](){const _0xb8ce67=this['editor']['plugins']['get'](n),_0xdcdfd=this['editor']['plugins']['get']('TrackChangesEditing');return _0xdcdfd['adapter']={'getSuggestion':async _0x2e5da7=>{await this['_waitForServiceReady']();const _0x59f9c4=await this['_trackChangesService']['get'](_0x2e5da7)['catch'](et);return await this['_fetchMissingUsersForThreads']([_0x59f9c4]),_0x59f9c4;},'addSuggestion':async({id:_0x2d2267,type:_0x502054,data:_0x9774d0,originalSuggestionId:_0x238f01,attributes:_0x137016})=>{await this['_waitForServiceReady']();const _0x2d508f={'id':_0x2d2267,'type':_0x502054,'data':_0x9774d0,'originalSuggestionId':_0x238f01,'attributes':_0x137016},_0x1aa081=await this['_trackChangesService']['add'](_0x2d2267,_0x502054,_0x9774d0,_0x238f01,_0x137016)['catch'](_0x4db040=>{if(dt(_0x4db040))return new Promise(_0x39ba06=>{this['_bufferedRequests']['set'](_0x2d2267,{'resolve':_0x39ba06,'suggestionData':_0x2d508f});});throw _0x4db040;});return this['_bufferedRequests']['delete'](_0x2d2267),_0x1aa081;},'updateSuggestion':async(_0x103d40,_0x227096)=>{if(await this['_waitForServiceReady'](),'open'!==_0x227096['state'])return this['_trackChangesService']['update'](_0x103d40,_0x227096)['catch'](et);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1061d0,_0x4ac4ff)=>{_0xdcdfd['hasSuggestion'](_0x4ac4ff['id'])&&(_0xdcdfd['getSuggestion'](_0x4ac4ff['id'])['attributes']=_0x4ac4ff['attributes']);}),this['_trackChangesService']['connect'](_0xb8ce67['connection'])['then'](_0x31223d=>(_0xb8ce67['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x31223d)['then'](()=>{for(const _0x1057b1 of _0x31223d){_0xdcdfd['addSuggestionData'](_0x1057b1)['_saved']=!0x0;}})));}async['reconnect'](){const _0xb46e43=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x28d24c}=this['editor']['plugins']['get'](n),_0x7ad195=await this['_trackChangesService']['connect'](_0x28d24c);await this['_fetchMissingUsersForThreads'](_0x7ad195);for(const {suggestionData:_0x315a57,resolve:_0xbbf854}of this['_bufferedRequests']['values']()){let _0x8d6bcd=_0x7ad195['find'](_0x2658cd=>_0x2658cd['id']===_0x315a57['id']);_0x8d6bcd||(_0x8d6bcd=await this['_trackChangesService']['add'](_0x315a57['id'],_0x315a57['type'],_0x315a57['data'],_0x315a57['originalSuggestionId'])),_0xbbf854(_0x8d6bcd);}for(const _0x42beb6 of _0x7ad195)_0xb46e43['hasSuggestion'](_0x42beb6['id'])||_0xb46e43['addSuggestionData'](_0x42beb6);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x42e07c=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3df8ce=>{_0x3df8ce['off'](),_0x42e07c();});});}async['_fetchMissingUsersForThreads'](_0x182da4){const _0x4b6a2f=this['editor']['plugins']['get'](_0x14383d),{connection:_0x4447ec}=this['editor']['plugins']['get'](n),_0x47c286=new Set();for(const {authorId:_0x365743}of _0x182da4)_0x4b6a2f['getUser'](_0x365743)||_0x47c286['add'](_0x365743);if(0x0===_0x47c286['size'])return;const _0x145534=await ht['getMany'](_0x4447ec,Array['from'](_0x47c286));for(const _0x4fa9e2 of _0x145534)_0x4b6a2f['getUser'](_0x4fa9e2['id'])||_0x4b6a2f['addUser'](_0x4fa9e2);}}function et(_0x3708e5){if(dt(_0x3708e5))return new Promise(()=>{});throw _0x3708e5;}function dt(_0x1b132f){return _0x1b132f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1b132f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x38ec35{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 _0x318d10=this['editor']['plugins']['get'](n),_0x4c5d7d=this['editor']['plugins']['get']('CommentsEditing'),_0x1ab1e3=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x318d10,'change:state',(_0x230fa1,_0x5afbe0,_0x531597)=>{_0x4c5d7d['isThreadsLoadingPaused']='connected'!==_0x531597;});}),this['listenTo'](_0x318d10,'change:state',(_0x18de2e,_0x287efb,_0x582ebe)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x582ebe);}),_0x1ab1e3['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class RealTimeCollaborativeTrackChanges extends _0x38ec35{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 _0x38ec35{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x1b1037)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x14383d];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4962bb){super(_0x4962bb);const _0x411ed7=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x411ed7);}async['init'](){const _0x29d6b8=this['editor']['plugins']['get'](l),_0x1efd95=_0x29d6b8['serverHistory'],_0x35e7b4=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x1efd95,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x29d6b8['sessionId']});const _0x518ee4=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x302edf=await _0x3eecac['isBundleUploaded'](_0x35e7b4['connection'],_0x518ee4);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x131b0d})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x131b0d)),'updateRevisions':async _0x7ad703=>{await this['_waitForServiceReady']();const _0x49d60e=this['_revisionTracker']['currentRevision'];if(_0x302edf&&0x1===_0x7ad703['length']&&_0x7ad703[0x0]['id']===_0x49d60e['id'])return _0x7ad703;for(const _0x5e8f3f of _0x7ad703)_0x5e8f3f['id']===_0x49d60e['id']&&(_0x5e8f3f['isEmptyCurrent']=_0x5e8f3f['fromVersion']===_0x5e8f3f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x7ad703,this['_lastRequestId'])['then'](_0x1df29c=>(this['_lastRequestId']=_0x1df29c,_0x7ad703))['catch'](_0x35437a=>{if(V(_0x35437a)||'400'===_0x35437a['code']&&void 0x0!==_0x35437a['data']['wrongRequestId']){for(const _0x419f28 of _0x7ad703){!this['_revisionTracker']['repository']['getRevision'](_0x419f28['id'])||this['_revisionTracker']['_bufferUpdate'](_0x419f28['id'],_0x419f28,!0x1);}if(V(_0x35437a))throw _0x35437a;return _0x7ad703;}throw _0x35437a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4905dc,{revisionsData:_0x3eb8d8,requestId:_0xe16d44})=>{Math['max'](..._0x3eb8d8['map'](_0x5b4666=>_0x5b4666['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3eb8d8,_0xe16d44);}):this['_handleRevisionsUpdate'](_0x3eb8d8,_0xe16d44);});const {revisions:_0x26c800,requestId:_0x13da6c}=await this['_revisionHistoryService']['connect'](_0x35e7b4['connection']);_0x35e7b4['addToReconnectionStack'](this),this['_lastRequestId']=_0x13da6c,await this['_fetchMissingUsers'](_0x26c800);for(const _0x4da523 of _0x26c800)this['_revisionTracker']['addRevisionData'](_0x4da523);this['listenTo'](_0x29d6b8,'change:_isConnected',(_0x52f773,_0x56c403,_0x2c85a4)=>{_0x2c85a4&&(this['_oldOffset']=_0x29d6b8['_offset'],_0x52f773['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x35e7b4,'state',_0x4cdd56=>_0x4cdd56===_0x207676['CONNECTED']);}async['reconnect'](){const _0x54d0b3=this['editor']['plugins']['get'](n),_0xbe566e=this['editor']['plugins']['get'](l),_0x298a22=async()=>{const _0x99eb89=this['_revisionTracker']['currentRevision'],_0x14d980=_0x99eb89['id'],_0x4ac747=_0x14d980!==_0xbe566e['sessionId'];if(_0x4ac747){const _0x2fb4b2=_0xbe566e['_offset']-this['_oldOffset'],_0x29b83b=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x99eb89['toVersion']+_0x2fb4b2!==_0x29b83b){const _0x5b2c55=_0x99eb89['fromVersion']+_0x2fb4b2,_0x89560a=this['editor']['plugins']['get'](_0x14383d),_0x2b92f5=this['_revisionTracker']['buildRevisionData']({'revision':_0x99eb89,'from':_0x5b2c55,'to':_0x29b83b});_0x2b92f5['id']=_0x99eb89['id'];const _0xd553d5=_0x2b92f5['authorsIds']['map'](_0x1fbb52=>_0x89560a['getUser'](_0x1fbb52));_0x99eb89['_update']({..._0x2b92f5,'authors':_0xd553d5},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x99eb89['id'],_0x2b92f5,!0x0);}this['_revisionTracker']['_startingVersion']=_0x29b83b,(_0x99eb89['toVersion']===_0x99eb89['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x14d980)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x14d980),this['_revisionTracker']['_createCurrentRevision'](_0x29b83b));}const {revisions:_0x278acc,requestId:_0x394ed8}=await this['_revisionHistoryService']['reconnect'](_0x54d0b3['connection'],this['_lastRequestId']);_0x4ac747&&_0x278acc['length']>0x0?_0xbe566e['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x278acc),this['_handleRevisionsUpdate'](_0x278acc,_0x394ed8),this['_revisionTracker']['sendBufferedUpdates']());};return _0xbe566e['_isConnected']?_0x298a22():new Promise((_0x4f9e59,_0x87e05)=>{_0xbe566e['once']('change:_isConnected',()=>{_0x298a22()['then'](_0x4f9e59)['catch'](_0x87e05);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x67ba50=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3cb3bd=>{_0x3cb3bd['off'](),_0x67ba50();});});}['_getLatestVersionFromServerOperations'](){const _0x4916e6=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x157055 of _0x4916e6)if('marker'!==_0x157055['type']||_0x157055['affectsData'])return _0x157055['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5df0ea=this['editor']['plugins']['get'](l);return new Promise(_0x7444d2=>{_0x5df0ea['_isPendingUpdate']?_0x5df0ea['once']('change:_isPendingUpdate',()=>{_0x7444d2(this['_getLatestVersionFromServerOperations']());}):_0x7444d2(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x375b96,_0x3d2edf){const _0x5afd40=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3d2edf;for(const _0x5683a8 of _0x375b96){const _0x24cc7d=_0x5afd40['getRevision'](_0x5683a8['id']);if(_0x24cc7d){if((_0x5683a8['fromVersion']||_0x5683a8['toVersion'])&&(_0x5683a8['diffData']=null),_0x24cc7d===this['_revisionTracker']['currentRevision']){const _0x429411=Math['max'](_0x24cc7d['toVersion'],_0x5683a8['toVersion']),_0x1d3b03=Math['max'](_0x24cc7d['fromVersion'],_0x5683a8['fromVersion']);let _0x143c47;_0x24cc7d['toVersion']===_0x5683a8['toVersion']&&_0x24cc7d['fromVersion']===_0x5683a8['fromVersion']?(_0x143c47=!0x0,this['_preventResendingRevisionData'](_0x5683a8)):_0x5683a8['toVersion']===_0x429411&&_0x5683a8['fromVersion']===_0x1d3b03?_0x143c47=!0x1:(_0x24cc7d['toVersion']===_0x429411&&_0x24cc7d['fromVersion']===_0x1d3b03||this['_fixRevision']({'revision':_0x24cc7d,'from':_0x1d3b03,'to':_0x429411}),_0x143c47=!0x0),_0x143c47&&(delete _0x5683a8['fromVersion'],delete _0x5683a8['toVersion'],delete _0x5683a8['diffData'],delete _0x5683a8['createdAt'],delete _0x5683a8['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x5683a8),this['_preventResendingRevisionData'](_0x5683a8);}else this['_revisionTracker']['addRevisionData'](_0x5683a8);}const _0x3c9a59=_0x5afd40['getRevisions']();_0x3c9a59['reverse']();for(let _0x4ae714=0x0;_0x4ae714<_0x3c9a59['length']-0x1;_0x4ae714++){const _0xb45451=_0x3c9a59[_0x4ae714],_0x3ba652=_0x3c9a59[_0x4ae714+0x1];if(_0xb45451['fromVersion']<_0x3ba652['toVersion']){const _0x534239=_0x3ba652['toVersion'],_0x521ed6=Math['max'](_0x534239,_0xb45451['toVersion']);this['_fixRevision']({'revision':_0xb45451,'from':_0x534239,'to':_0x521ed6});}}}['_fixRevision']({revision:_0x24751c,from:_0xf32546,to:_0xa10870}={}){const _0x4f4452=this['editor']['plugins']['get'](_0x14383d),_0x21543c=this['_revisionTracker']['buildRevisionData']({'revision':_0x24751c,'from':_0xf32546,'to':_0xa10870});_0x21543c['authors']=_0x21543c['authorsIds']['map'](_0x1e5c9b=>_0x4f4452['getUser'](_0x1e5c9b)),_0x24751c['_update'](_0x21543c);}['_preventResendingRevisionData'](_0x1b8b89){const _0x5d18f3={};_0x5d18f3['id']=_0x1b8b89['id'];for(const _0x579cbe of Object['keys'](_0x1b8b89))'id'!==_0x579cbe&&(_0x5d18f3[_0x579cbe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5d18f3['id'],_0x5d18f3,!0x0);}async['_fetchMissingUsers'](_0x4b9d84){const _0x42d2ee=this['editor']['plugins']['get'](_0x14383d),{connection:_0x142750}=this['editor']['plugins']['get'](n),_0x37fc7d=new Set();for(const _0x167407 of _0x4b9d84){for(const _0x1ea203 of _0x167407['authorsIds'])_0x24970b(_0x1ea203);_0x167407['creatorId']&&_0x24970b(_0x167407['creatorId']);}if(0x0===_0x37fc7d['size'])return;const _0x392f0f=await ht['getMany'](_0x142750,Array['from'](_0x37fc7d));for(const _0x49c00a of _0x392f0f)_0x42d2ee['getUser'](_0x49c00a['id'])||_0x42d2ee['addUser'](_0x49c00a);function _0x24970b(_0x17c7cf){_0x42d2ee['getUser'](_0x17c7cf)||_0x37fc7d['add'](_0x17c7cf);}}}function V(_0x440a22){return _0x440a22['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x440a22['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x440a22['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x38ec35{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 _0x422411{['_collapseAt'];constructor(_0x4b6937,_0x10b85f=0x6){super(_0x4b6937);const _0x28b059=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x10b85f,this['bind']('isHidden')['to'](this,'usersCount',_0x594ce5=>_0x594ce5<_0x10b85f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x28b059['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':_0x28b059['to']('usersCount',_0x1f5d4f=>'+'+(_0x1f5d4f-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x422411{['items'];['keystrokes'];constructor(_0x3476c0){super(_0x3476c0);const _0xf5571=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4b7810(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0xf5571['if']('hasPopup'),'aria-expanded':_0xf5571['to']('isExpanded',_0x49f3f3=>this['hasPopup']&&String(_0x49f3f3)),'aria-label':_0xf5571['to']('hasPopup',_0x5ea2cc=>R(_0x3476c0,_0x5ea2cc?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0xf5571['to']('hasPopup',_0x2ec318=>!!_0x2ec318&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0xf5571['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0xf5571['to'](_0x1149c2=>{const _0x40ae94=_0x1149c2,_0x2e2c3c=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4469d2=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2e2c3c?.['contains'](_0x40ae94['relatedTarget'])||_0x4469d2?.['contains'](_0x40ae94['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3e021c,_0x324e52,_0x6de396)=>{this['element']&&(_0x6de396?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class z extends _0x422411{['counterView'];['inlineListView'];constructor(_0x3938c4,_0x499062=0x6){super(_0x3938c4);const _0x250579=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new B(this['locale'],_0x499062),this['inlineListView']=new is(_0x3938c4),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x51fd36 of this['inlineListView']['items'])_0x51fd36['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',_0x250579['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class J extends _0x422411{['listWrapperView'];constructor(_0x14451b,_0x11d5a5){super(_0x14451b);const _0x4efc48=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x14451b,_0x11d5a5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0x14451b,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x4efc48['to'](_0x1b8a6d=>{const _0x43126c=_0x1b8a6d,_0x34f587=document['querySelector']('.ck-presence-list__list'),_0x52b994=document['querySelector']('.ck-balloon-panel_with-arrow');_0x34f587?.['contains'](_0x43126c['relatedTarget'])||_0x52b994?.['contains'](_0x43126c['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x462fd8{constructor(_0x1a8ba2,_0x312ea8){super(_0x1a8ba2);const _0x35dba6=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x312ea8?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x35dba6['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x35dba6['to']('role'),'aria-label':_0x35dba6['to']('ariaLabel'),'aria-labelledby':_0x35dba6['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3be0ca['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x32c1dd=this['element'];_0x32c1dd&&(this['_isScrollable']=Math['max'](_0x32c1dd['scrollHeight'],_0x32c1dd['clientHeight'])>0.8*window['innerHeight']);}}class K extends st{['userView'];constructor(_0x153273,_0x3c7fbf,_0x401228){super(_0x153273);const _0x3dba76=this['bindTemplate'];this['userView']=new rt(_0x153273,_0x3c7fbf);const _0x59c840={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x3c7fbf['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x3c7fbf['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3c7fbf['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x401228&&(_0x59c840['tag']='button',_0x59c840['on']={'click':_0x3dba76['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x59c840);}['focus'](){this['element']['focus']();}}class Q extends _0x422411{['userView'];['markerView'];constructor(_0x47646a,_0x383fb1,_0xcd190b){super(_0x47646a);const _0x26f448=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new rt(_0x47646a,_0x383fb1),this['markerView']=new MarkerView(_0x47646a,_0x383fb1);const _0x4f4329=new at(_0x47646a);_0x4f4329['template']['tag']='span',_0x4f4329['text']=_0x383fb1['name'];const _0x47d768={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x26f448['to']('isFocusable',_0x587fa9=>!!_0x587fa9&&0x0),'aria-labelledby':_0x4f4329['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x26f448['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x26f448['to']('hasTooltip',_0x3c3489=>!_0x3c3489),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4f4329]};_0xcd190b&&(_0x47d768['tag']='button',_0x47d768['on']={'click':_0x26f448['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x47d768);}}class MarkerView extends _0x422411{constructor(_0x18402e,_0x4f895c){super(_0x18402e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4f895c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const X={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x57ac80{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x37c5e2){super(_0x37c5e2),this['context']['config']['define']('presenceList',X);const _0x35f7e4=_0x37c5e2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x35f7e4)throw new _0x533522('presencelist-collapseat-invalid-format',this);if(_0x35f7e4<0x1)throw new _0x533522('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5510de(),this['balloonPanelView']=new _0x21eb1a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x440468 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x440468);this['listenTo'](this['_allConnectedUsers'],'add',(_0x472297,_0xc41ff5)=>{this['_handleUserAdd'](_0xc41ff5);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5ac3b2,_0x1552fd)=>{this['_handleUserRemove'](_0x1552fd);});}['_createView'](){const _0x53ca01=this['context'],_0x1850ab=new z(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xe8efa=this['balloonPanelView'];if(!_0x5b9bb3(_0x53ca01['config']['get']('presenceList.container')))throw new _0x533522('presencelist-missing-container',this);return _0x1850ab['counterView']['bind']('usersCount')['to'](this),_0x1850ab['bind']('isCollapsed')['to'](this,'usersCount',_0x4ae286=>{const {collapseAt:_0x1cf2e3}=_0x53ca01['config']['get']('presenceList'),_0x1c661e=_0x4ae286>=_0x1cf2e3;if(_0x1c661e&&!_0x1850ab['inlineListView']['items']['find'](_0x1ab609=>_0x1ab609 instanceof B)){const _0x264e00=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x264e00&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x1850ab['inlineListView']['items']['add'](_0x1850ab['counterView']);}return _0x1c661e||this['hideDropdown'](),_0x1c661e;}),_0x1850ab['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x37e96c=>{const _0x23778c=_0x53ca01['config']['get']('presenceList'),_0x402d1c=new Q(_0x53ca01['locale'],_0x37e96c,!!_0x23778c['onClick']);return _0x402d1c['bind']('hasTooltip')['to'](_0x1850ab,'isCollapsed',_0x265010=>!_0x265010),_0x402d1c['bind']('isFocusable')['to'](_0x1850ab,'isCollapsed',_0x49e4c8=>!_0x49e4c8),_0x23778c['onClick']&&this['listenTo'](_0x402d1c,'execute',()=>{this['view']['isCollapsed']||_0x23778c['onClick'](_0x37e96c,_0x402d1c['element']);}),_0x402d1c;}),this['listenTo'](_0x1850ab['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x1850ab['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x1850ab['inlineListView']['keystrokes']['set']('Enter',(_0x5e4c72,_0x33f12c)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x33f12c());}),_0x1850ab['render'](),_0xe8efa['render'](),_0x32589f({'emitter':_0x1850ab,'activator':()=>_0xe8efa['isVisible'],'contextElements':[_0xe8efa['element'],_0x1850ab['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x53ca01['config']['get']('presenceList.container')['appendChild'](_0x1850ab['element']),this['_bodyCollection']=new _0x272992(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x1850ab;}['_handleUserAdd'](_0x95f052){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x95f052['isMe'])return;const _0x28a5e2=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x28a5e2-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x5df605=_0x95f052['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x95f052,_0x5df605);}['_handleUserRemove'](_0x235aa3){this['usersCount']--;const {collapseAt:_0x3f3f6e}=this['context']['config']['get']('presenceList'),_0x154daa=this['usersCount']>=_0x3f3f6e;if(this['currentDisplayedUsers']['get'](_0x235aa3['id']))this['currentDisplayedUsers']['remove'](_0x235aa3['id']);else{if(_0x154daa&&this['currentDisplayedUsers']['length']+0x1===_0x3f3f6e-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x154daa?0x1:0x0)<this['usersCount']){for(const _0x2a7ea0 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x2a7ea0['id'])&&(this['currentDisplayedUsers']['add'](_0x2a7ea0,Math['min'](this['currentDisplayedUsers']['length']-(_0x154daa?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x154daa?0x1:0x0)===_0x3f3f6e-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x276fef=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new J(this['context']['locale'],!!_0x276fef['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x202021}=this['presenceDropdownView'];_0x202021['items']['bindTo'](this['_allConnectedUsers'])['using'](_0xc012d7=>{if(!_0x276fef['displayMe']&&_0xc012d7['isMe'])return null;const _0x3bd835=new K(this['context']['locale'],_0xc012d7,!!_0x276fef['onClick']);return _0x276fef['onClick']&&this['listenTo'](_0x3bd835,'execute',()=>{_0x276fef['onClick'](_0xc012d7,_0x3bd835['element']);}),_0x3bd835;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x202021['focus'](),_0x202021['checkIfScrollable']();const _0x292f07=(_0x4844d0,_0x59ea25)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x59ea25();};_0x202021['keystrokes']['set']('Esc',_0x292f07),_0x202021['keystrokes']['set']('Shift+Tab',_0x292f07),_0x202021['keystrokes']['set']('Tab',(_0x59edc4,_0x2fb99d)=>{!function(_0x1a937d){const _0x5b7cef=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x5dbb19=>_0x5dbb19+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x35d515=[...document['body']['querySelectorAll'](_0x5b7cef)]['filter'](_0x5aba77=>_0x5aba77===document['activeElement']||_0x5aba77['offsetWidth']+_0x5aba77['offsetHeight']>0x0)['sort']((_0x2a5064,_0x281f05)=>(_0x2a5064['tabIndex']||0x0)-(_0x281f05['tabIndex']||0x0)),_0x48d9f1=_0x35d515['indexOf'](_0x1a937d),_0x24ace9=_0x35d515[(_0x48d9f1+0x1)%_0x35d515['length']];_0x24ace9&&_0x24ace9['focus']();}(this['view']['element']),this['hideDropdown'](),_0x2fb99d();}),_0x202021['focusTracker']['add'](this['view']['element']),_0x202021['focusTracker']['on']('change:isFocused',(_0x423361,_0x1d63c1,_0x3f4dc1)=>{_0x3f4dc1||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 PresenceList extends _0x57ac80{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,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,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':_0x30392a=>0x1!=_0x30392a}};
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':_0x1ea514=>0x1!=_0x1ea514}};