@ckeditor/ckeditor5-real-time-collaboration 47.7.5-alpha.0 → 47.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x6f804a,Plugin as _0x25b979,PendingActions as _0x235b6b,Context as _0x506ccb}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x2dbd2e,CKEditorError as _0xb4ae54,Collection as _0x247fc3,global as _0x57f3d3,version as nt,uid as _0x525198,KeystrokeHandler as _0x5360be}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3e1d7c,View as _0x1c3372,ListView as _0x4de888,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x146574,clickOutsideHandler as _0x144a34,BodyCollection as _0x5c43da}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x59bb9f,History as _0x49c641,NoOperation as _0x566909,InsertOperation as _0x4dfc76,MarkerOperation as _0x7b3172,RootAttributeOperation as _0x3b01b0,transformOperationSets as _0x3283fc,OperationFactory as _0x2f9f6e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as at,WEB_SOCKET_GATEWAY_STATES as _0x36321a,CollaborativeEditingService as _0x21cc40,User as ht,CommentsService as _0x3a26f5,TrackChangesService as _0x1035fa,RevisionHistoryService as _0x16dd6a,EditorService as _0x25c22d}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x4fba0e,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x504bc6}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x245a67}from'es-toolkit/compat';class n extends _0x6f804a{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3e1d7c];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb23052){super(_0xb23052),this['set']('state',_0x36321a['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2dbd2e())();}['init'](){const _0x145201=this['context'],_0x1857a9=_0x145201['plugins']['get']('CloudServices'),_0x854bd4=_0x145201['plugins']['get'](_0x3e1d7c);if(!_0x1857a9['token'])throw new _0xb4ae54('websocketgateway-missing-token',this);if(!_0x1857a9['webSocketUrl'])throw new _0xb4ae54('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'](_0x1857a9['token'],_0x1857a9['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5134aa=>{if(this['connection']=_0x5134aa,this['bind']('state')['to'](_0x5134aa,'state',this,'_isBrowserOffline',(_0x3da22f,_0x54ba08)=>('connected'!==_0x3da22f&&(this['_shouldPluginsReconnect']=!0x0),_0x54ba08||_0x3da22f!==_0x36321a['CONNECTED']?_0x36321a['DISCONNECTED']:this['state']==_0x36321a['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x36321a['CONNECTING']):_0x36321a['CONNECTED'])),this['connection']['on']('error',(_0x3084f0,_0x38c974)=>{if('limitExceeded'!==_0x38c974['code'])throw console['error'](_0x38c974),new _0xb4ae54('cloudservices-init',null,{'originalError':_0x38c974});_0x854bd4['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'});}),!_0x5134aa['me'])return new Promise(_0x3e48a0=>_0x5134aa['on']('change:me',_0x3e48a0));})['catch'](_0xc1c03b=>{throw console['error'](_0xc1c03b),new _0xb4ae54('cloudservices-init',null,{'originalError':_0xc1c03b});});}['addToReconnectionStack'](_0x5b7927){if('function'!=typeof _0x5b7927['reconnect'])throw new _0xb4ae54('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5b7927))throw new _0xb4ae54('websocketgateway-plugin-already-registered',this,{'name':_0x5b7927['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5b7927);}['removeFromReconnectionStack'](_0x1ac1ac){this['_reconnectionStack']['delete'](_0x1ac1ac);}['isInReconnectionStack'](_0x103f81){return this['_reconnectionStack']['has'](_0x103f81);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x495a72=>_0x495a72['reconnect']())))['then'](()=>this['state']=_0x36321a['CONNECTED'])['catch'](_0x182ae8=>{throw console['error'](_0x182ae8),new _0xb4ae54('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x36321a['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x6f804a{['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,_0x4fba0e];}constructor(_0x50ebb1){super(_0x50ebb1),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x247fc3(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4fba0e);}['init'](){const _0x278446=this['context']['plugins']['get'](n);this['listenTo'](_0x278446,'change:state',(_0xf474e9,_0x1412e9,_0x14a3bf)=>{if('connected'!==_0x14a3bf)this['channelSessions']['forEach'](_0x346632=>_0x346632['clear']()),this['channelConnectedUsers']['forEach'](_0x206cd6=>_0x206cd6['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x23792b,_0x13acf1]of this['_registeredSessions'])for(const _0x55121d of _0x13acf1)this['_handleSessionAdd'](_0x23792b,_0x55121d);}}),this['_createUser'](_0x278446['connection']['me'],!0x0);}['register'](_0x550fd9,_0x37d088){if(this['_registeredSessions']['has'](_0x550fd9))throw new _0xb4ae54('sessions-register-already-registered',null,{'channelId':_0x550fd9});this['_registeredSessions']['set'](_0x550fd9,_0x37d088),this['channelSessions']['set'](_0x550fd9,new _0x247fc3()),this['channelConnectedUsers']['set'](_0x550fd9,new _0x247fc3()),this['listenTo'](_0x37d088,'add',(_0x3963d2,_0x221931)=>this['_handleSessionAdd'](_0x550fd9,_0x221931)),this['listenTo'](_0x37d088,'remove',(_0xc44466,_0x3640a4)=>this['_handleSessionRemove'](_0x550fd9,_0x3640a4));for(const _0x2ca5a5 of _0x37d088)this['_handleSessionAdd'](_0x550fd9,_0x2ca5a5);}['unregister'](_0x11fc63){if(!this['_registeredSessions']['has'](_0x11fc63))throw new _0xb4ae54('sessions-unregister-not-exist',null,{'channelId':_0x11fc63});const _0x1944cd=this['_registeredSessions']['get'](_0x11fc63);this['stopListening'](_0x1944cd);for(const _0xce34fb of _0x1944cd)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x11fc63,_0xce34fb);this['_registeredSessions']['delete'](_0x11fc63),this['channelSessions']['delete'](_0x11fc63),this['channelConnectedUsers']['delete'](_0x11fc63);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x3ca925){for(const _0x3ffab3 of this['channelSessions']['values']())for(const _0xac68cc of _0x3ffab3)if(_0xac68cc['id']===_0x3ca925)return _0xac68cc['user'];}['getUserSessions'](_0x2dbb8e,_0x553a00){const _0x41e212=_0x553a00?[this['channelSessions']['get'](_0x553a00)]:this['channelSessions']['values'](),_0x26fc40=new Set();for(const _0x28d43a of _0x41e212)for(const _0x9fee79 of _0x28d43a)_0x9fee79['user']['id']===_0x2dbb8e['id']&&_0x26fc40['add'](_0x9fee79['id']);return _0x26fc40;}['getUserRole'](_0x557a0c){for(const _0x5598ef of this['channelSessions']['values']())for(const _0x351c1e of _0x5598ef)if(_0x351c1e['user']===_0x557a0c)return _0x351c1e['role'];}['_handleSessionAdd'](_0x51ba5f,_0x4afe19){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4bff60=_0x4afe19['user'],_0x3f480f=this['_users']['getUser'](_0x4bff60['id'])||this['_createUser'](_0x4bff60),_0x204f30=Object['assign']({},_0x4afe19,{'user':_0x3f480f});if(this['channelSessions']['get'](_0x51ba5f)['add'](_0x204f30),!_0x4bff60['hiddenInPresenceList']){const _0x284e30=this['channelConnectedUsers']['get'](_0x51ba5f);_0x284e30['has'](_0x3f480f['id'])||_0x284e30['add'](_0x3f480f),this['allConnectedUsers']['has'](_0x3f480f['id'])||_0x4bff60['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x3f480f,_0x3f480f['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x51ba5f,{'channelId':_0x51ba5f,'session':_0x204f30});}['_handleSessionRemove'](_0x2c0a90,_0x323c43){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x529989=this['channelConnectedUsers']['get'](_0x2c0a90),_0x108d78=_0x323c43['user'];_0x108d78['id']&&(this['channelSessions']['get'](_0x2c0a90)['remove'](_0x323c43['id']),_0x529989['has'](_0x108d78['id'])&&!this['getUserSessions'](_0x108d78,_0x2c0a90)['size']&&_0x529989['remove'](_0x108d78['id']),this['allConnectedUsers']['get'](_0x108d78['id'])&&!this['getUserSessions'](_0x108d78)['size']&&this['allConnectedUsers']['remove'](_0x108d78['id']));}['_createUser'](_0x2373a0,_0xa3572){const _0xff6cda=this['_users']['addUser'](_0x2373a0);return _0xa3572&&this['_users']['defineMe'](_0x2373a0['id']),_0xff6cda['orderNumber']=this['_uniqueUsersCount']++,_0xff6cda;}}class N extends _0x25b979{['_domEmitter']=new(_0x2dbd2e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3e01d0=this['editor'],_0xb19470=_0x3e01d0['plugins']['get'](i);_0x3e01d0['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3c62d4,{writer:_0x39fea8})=>function(_0xd435bb,_0x45e02f,_0x26ac71,_0x472f6d){const _0x1a8827=_0xd435bb['markerName']['split'](':')[0x2],_0x12dd32=_0x26ac71['getUserBySessionId'](_0x1a8827);if(!_0x12dd32||_0x1a8827===_0x26ac71['mySessionId'])return;if(!_0x472f6d['model']['schema']['checkChild'](_0xd435bb['markerRange']['start'],'$text'))return;const _0x5653aa={'class':'ck-user__marker\x20'+_0x12dd32['color']['getMarkerClass'](),'data-name':_0x12dd32['name'],'data-session-id':_0x1a8827},_0x10cef2=_0x472f6d['model']['markers']['get'](_0xd435bb['markerName']),_0x520ac1=_0x10cef2['getStart'](),_0x3116e1=_0x520ac1['nodeAfter'],_0x16caef=_0x472f6d['model']['schema'];if(_0x3116e1&&_0x16caef['isObject'](_0x3116e1)&&_0x16caef['isInline'](_0x3116e1)&&!_0x472f6d['model']['markers']['get']('user:range:'+_0x1a8827)['getRange']()['isCollapsed'])return;const _0x4fba67=_0x520ac1['parent'];return _0x472f6d['model']['schema']['isLimit'](_0x4fba67)&&!_0x472f6d['model']['hasContent'](_0x4fba67)&&(_0x5653aa['contenteditable']=!0x1),function(_0x236131,_0x5ea949,_0x3dfe47){const _0x1f5f46=_0x236131['createUIElement']('span',_0x5ea949);return _0x236131['setCustomProperty']('userPositionMarker',!0x0,_0x1f5f46),_0x1f5f46['render']=function(_0x266e41){const _0x9b3418=this['toDomElement'](_0x266e41),_0x1ec3ed=document['createElement']('span');return _0x1ec3ed['classList']['add']('ck-user__marker-tooltip'),_0x1ec3ed['setAttribute']('contenteditable','false'),_0x1ec3ed['setAttribute']('spellcheck','false'),_0x1ec3ed['textContent']=_0x3dfe47['name'],_0x9b3418['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x1ec3ed['outerHTML']+'⁠',_0x9b3418['addEventListener']('mouseenter',()=>{_0x9b3418['classList']['add']('ck-user__marker_hovered');}),_0x9b3418['addEventListener']('mouseleave',()=>{_0x9b3418['classList']['remove']('ck-user__marker_hovered');}),_0x9b3418;},_0x1f5f46['isSimilar']=function(_0x1e9d22){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1e9d22['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1e9d22['getAttribute']('data-session-id'));},_0x1f5f46;}(_0x45e02f,_0x5653aa,_0x12dd32);}(_0x3c62d4,_0x39fea8,_0xb19470,_0x3e01d0)}),_0x3e01d0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xddbd27=>function(_0x29d85b,_0x1f39eb){const _0x82bdb7=_0x29d85b['markerName']['split'](':')[0x2];if(_0x82bdb7===_0x1f39eb['mySessionId'])return null;const _0x485ed0=_0x1f39eb['getUserBySessionId'](_0x82bdb7);if(!_0x485ed0)return{'id':_0x82bdb7,'classes':[]};return{'id':_0x82bdb7,'classes':['ck-user__selection',_0x485ed0['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x82bdb7},'priority':0x7d0+_0x485ed0['orderNumber']};}(_0xddbd27,_0xb19470)}),function(_0x91ff2c){const _0x32a3e2=_0x91ff2c['model'],_0x431652=new Map(),_0x33f71f=_0x91ff2c['plugins']['get'](i);_0x32a3e2['markers']['on']('update:user:range',(_0x2f953d,_0x18d6ad,_0x197dff,_0x27b530)=>{if(!_0x27b530&&_0x431652['get'](_0x18d6ad['name']))return _0x431652['get'](_0x18d6ad['name'])['detach'](),void _0x431652['delete'](_0x18d6ad['name']);const _0x26afcf=_0x18d6ad['name']['split'](':')[0x2];if(_0x26afcf===_0x33f71f['mySessionId'])return;const _0xfbeefb='user:position:'+_0x26afcf;_0x32a3e2['markers']['has'](_0xfbeefb)&&_0x91ff2c['editing']['reconvertMarker'](_0xfbeefb),_0x18d6ad['on']('change:range',(_0x3fa395,_0x5cbf91,_0xa733c0)=>{if('$graveyard'!=_0x5cbf91['root']['rootName']&&'$graveyard'==_0x18d6ad['getRange']()['root']['rootName']&&!_0x431652['has'](_0x18d6ad['name'])){const _0x31e4a4=_0x32a3e2['schema']['getNearestSelectionRange'](_0xa733c0['deletionPosition']);if(_0x31e4a4){const _0x47e4e8=_0x59bb9f['fromRange'](_0x31e4a4);_0x431652['set'](_0x18d6ad['name'],_0x47e4e8),_0x47e4e8['on']('change:range',(_0x3c647b,_0x44db0,_0x5545f1)=>{if('$graveyard'==_0x47e4e8['root']['rootName']){const _0x26a344=_0x32a3e2['schema']['getNearestSelectionRange'](_0x5545f1['deletionPosition']);_0x26a344?(_0x47e4e8['start']=_0x26a344['start'],_0x47e4e8['end']=_0x26a344['end']):(_0x431652['delete'](_0x18d6ad['name']),_0x47e4e8['detach']());}});}}});}),_0x32a3e2['document']['on']('change',()=>{_0x431652['size']>0x0&&_0x32a3e2['enqueueChange']({'isUndoable':!0x1},_0x3316ea=>{for(const [_0x359703,_0x1dd5e2]of _0x431652)'$graveyard'==_0x32a3e2['markers']['get'](_0x359703)['getRange']()['root']['rootName']&&(J(_0x359703['split'](':')[0x2],_0x1dd5e2['toRange'](),_0x32a3e2,_0x3316ea),_0x1dd5e2['detach']());_0x431652['clear']();});});}(_0x3e01d0),this['_domEmitter']['listenTo'](_0x57f3d3['document'],'keydown',(_0x36e32a,{key:_0x56010c})=>{'Escape'===_0x56010c&&function(_0x5dca6d){_0x5dca6d['editing']['view']['change'](_0x4b47a7=>{for(const _0x4cf76d of _0x5dca6d['model']['markers']){if(!_0x4cf76d['name']['startsWith']('user:position'))continue;const _0x41140c=_0x5dca6d['editing']['mapper']['markerNameToElements'](_0x4cf76d['name']);if(_0x41140c){for(const _0x349a8a of _0x41140c)_0x4b47a7['removeClass']('ck-user__marker_hovered',_0x349a8a);}}});}(_0x3e01d0);},{'useCapture':!0x0});}['afterInit'](){const _0x259daf=this['editor'],_0x3bb581=_0x259daf['commands']['get']('undo');_0x3bb581&&_0x259daf['model']['on']('applyOperation',(_0x592e87,_0x1132d3)=>{const _0x2e8e67=_0x1132d3[0x0];if(!_0x2e8e67['isDocumentOperation'])return;if('marker'!=_0x2e8e67['type']||!_0x2e8e67['name']['startsWith']('user:'))return;const _0x16baab=_0x2e8e67['batch'];_0x3bb581['_createdBatches']['has'](_0x16baab)&&(_0x2e8e67['newRange']=_0x2e8e67['oldRange']?_0x259daf['model']['createRange'](_0x2e8e67['oldRange']['start'],_0x2e8e67['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x17ad26=this['editor'],_0x31be4a=_0x17ad26['model']['document'],_0x4813db=_0x17ad26['plugins']['get'](i);_0x17ad26['model']['enqueueChange']({'isUndoable':!0x1},_0x209d3b=>{const _0x5eb139='user:range:'+_0x4813db['mySessionId'],_0x56377e='user:position:'+_0x4813db['mySessionId'],_0x1f220a=_0x17ad26['model']['markers']['has'](_0x5eb139);_0x17ad26['editing']['view']['hasDomSelection']?J(_0x4813db['mySessionId'],_0x31be4a['selection']['getFirstRange'](),_0x17ad26['model'],_0x209d3b):_0x1f220a&&(_0x209d3b['removeMarker'](_0x5eb139),_0x209d3b['removeMarker'](_0x56377e));});}}function J(_0x131c55,_0x2f8199,_0x11f359,_0x4da829){const _0xe6a6a1='user:range:'+_0x131c55,_0x5d5ff3='user:position:'+_0x131c55,_0x176f18=_0x2f8199['getContainedElement']();let _0x422bcc=_0x2f8199['start'];if(_0x176f18&&_0x176f18['is']('element','tableCell')){const _0x5612a7=function(_0x3a09d1,_0x37232b){for(const _0x198ccc of _0x3a09d1['getPositions']())if(_0x37232b['schema']['checkChild'](_0x198ccc,'$text'))return _0x198ccc;}(_0x2f8199,_0x11f359);_0x5612a7&&(_0x422bcc=_0x5612a7,_0x2f8199=_0x4da829['createRange'](_0x422bcc));}const _0x5180e0=_0x4da829['createRange'](_0x422bcc);_0x11f359['markers']['has'](_0xe6a6a1)?(_0x4da829['updateMarker'](_0xe6a6a1,{'range':_0x2f8199}),_0x4da829['updateMarker'](_0x5d5ff3,{'range':_0x5180e0})):(_0x4da829['addMarker'](_0xe6a6a1,{'range':_0x2f8199,'usingOperation':!0x0}),_0x4da829['addMarker'](_0x5d5ff3,{'range':_0x5180e0,'usingOperation':!0x0}));}function B(_0x4ddb1f,_0x4b2f6d,_0x147b33){const _0x3f4958=_0x4ddb1f['t'],t=_0x4ddb1f['t'];switch(_0x4b2f6d){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 _0x3f4958({'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'},_0x147b33);default:return'';}}let z=0x1;class l extends _0x25b979{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x21cc40)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,N,_0x235b6b,_0x4fba0e,_0x3e1d7c];}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 _0x345825=this['serverHistory']['getOperations']();for(let _0x3b158=_0x345825['length']-0x1;_0x3b158>=0x0;_0x3b158--){const _0x2f547a=_0x345825[_0x3b158];if(!this['_disconnectionOperations']['has'](_0x2f547a))return _0x2f547a['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3b9df9){if(super(_0x3b9df9),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x49c641(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0xb4ae54('collaboration-missing-channelid',this);const _0xaaadf6=_0x3b9df9['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xaaadf6,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x504bc6(),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 _0x540954=this['editor'],_0x17f4b4=_0x540954['plugins']['get'](_0x4fba0e),_0x18d655=_0x540954['plugins']['get'](n);this['listenTo'](_0x17f4b4,'getOperationAuthor',(_0x509fe0,_0x1fcae7)=>{const _0x14bda3=_0x1fcae7[0x0];_0x14bda3['_authorId']&&(_0x509fe0['return']=_0x17f4b4['getUser'](_0x14bda3['_authorId']),_0x509fe0['stop']()),null===_0x14bda3['_authorId']&&(_0x509fe0['return']=null,_0x509fe0['stop']());},{'priority':'high'}),this['listenTo'](_0x540954['model']['document']['selection'],'change:range',(_0x59fc11,_0x5c3aaf)=>{_0x5c3aaf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x540954['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x540954['model']['on']('applyOperation',(_0x1b818b,_0x5ceee2)=>{const _0x3d1b42=_0x5ceee2[0x0];_0x3d1b42['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x3d1b42),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x18d655,'state',this,'_hasSynchronizationProblem',(_0x1c23e3,_0x18096c)=>'connected'===_0x1c23e3&&!_0x18096c),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x540954['disableReadOnlyMode']('rtc-offline'):_0x540954['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x540954['disableReadOnlyMode']('rtc-offline'):_0x540954['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1e595e=this['editor']['plugins']['get'](i),_0x16d362=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1e595e['unregister'](this['_channelId']);const _0x5f4cd8=await this['_service']['reconnect'](_0x16d362['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5f4cd8)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x152cf2=await this['_service']['getConnectedSessions']();_0x1e595e['register'](this['_channelId'],_0x152cf2),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x3ac4bb){if(function(_0x10f1e2){return'404'===_0x10f1e2['code'];}(_0x3ac4bb)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5dca9c){return'409'===_0x5dca9c['code'];}(_0x3ac4bb)){const _0x46fae2=B(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'](_0x46fae2);}else{if(!(_0x3ac4bb instanceof ReconnectionError))throw _0x3ac4bb;this['_handleReconnectionError']();}}}}['destroy'](){const _0x677b6=this['editor']['plugins']['get'](n),_0x205e60=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x205e60['channelSessions']['has'](this['_channelId'])&&_0x205e60['unregister'](this['_channelId']),_0x677b6['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1b0e59){if(this['sessionId']!==_0x1b0e59['sessionId']&&this['_lastSyncedOperationId']!==_0x1b0e59['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x1b0e59['sessionId'],this['_handleServerResponse']([],{..._0x1b0e59,'wereChangesApplied':!0x1,'data':_0x1b0e59['data']},'reconnect');}async['_connectService'](_0x357ee7,_0x30ab1d=!0x1){const {connection:_0x46e7ad}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x46e7ad,this['_channelId'])['then'](_0x3f99d7=>this['_initSessionsHandling'](_0x3f99d7))['catch'](_0x23a8dd=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x23a8dd);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xeaf0d2,_0xb35574)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xb35574);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xeb945c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x357ee7);this['_isPendingUpdate']=!0x0;const _0x572731=await this['_service']['connect'](_0x46e7ad,this['_compressOperations'](_0x357ee7),_0xeb945c);if(this['sessionId']=_0x572731['sessionId'],_0x30ab1d){if(!_0x572731['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x572731['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x357ee7,_0x572731,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x572731,_0x357ee7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3a3c00=this['editor']['plugins']['get'](i),_0x1fd868=this['editor']['plugins']['get'](N),_0x359073=_0x3a3c00['channelSessions']['get'](this['_channelId']);_0x359073&&_0x359073['length']>0x1?_0x1fd868['createUserMarkerOperations']():this['listenTo'](_0x3a3c00,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3a3c00['channelSessions']['get'](this['_channelId'])['length']&&_0x1fd868['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x51a602,_0x40cfb4,_0x31973d,_0xfeb6bb){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x40cfb4){const _0x5172c2=this['_decompressOperations'](_0x31973d,_0xfeb6bb);await this['_fetchMissingUsers'](_0x5172c2),this['_handleExternalOperations'](_0x5172c2,_0x40cfb4,_0x31973d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x49a3f2}=this['editor'];let _0x57305f;try{_0x57305f=await this['_service']['getDocumentDetails']();}catch{const _0xb93821=B(_0x49a3f2,'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'](_0xb93821);}const _0x5220dc=_0x57305f['currentDocumentSession']||_0x57305f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5220dc['lastOperationId']){const _0x5129ec=B(_0x49a3f2,'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'](_0x5129ec);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x57f56a){const _0x58ba57=this['editor']['plugins']['get'](i);this['listenTo'](_0x58ba57,'sessionAdd:'+this['_channelId'],(_0x4e22a1,{session:_0x562630})=>{if(_0x562630['id']===_0x58ba57['mySessionId']){_0x4e22a1['off']();const _0x2bac27=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0xe1587e=_0x562630['permissions'];_0x2bac27&&_0x2bac27['isEnabled']&&(_0xe1587e=_0xe1587e['filter'](_0x222c50=>'document:write'!==_0x222c50)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0xe1587e,this['_channelId']);}}),_0x58ba57['register'](this['_channelId'],_0x57f56a);}['_initThrowingOnDataSet'](){const _0x49dd77=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4ef11e)=>{if(!_0x4ef11e[_0x4ef11e['length']-0x1]['suppressErrorInCollaboration'])throw new _0xb4ae54('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x49dd77['apply'](this['editor']['data'],_0x4ef11e);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4795ff,[_0x41d118])=>{if(this['_document']['version'])throw new _0xb4ae54('realtimecollaborationclient-init-document-already-initialized',this);_0x4795ff['stop'](),this['_setPendingAction']();const _0x3ca150=this['editor']['config']['get']('rootsAttributes'),_0x2162e7=this['_getOperationsFromInitData'](_0x41d118,_0x3ca150);0x0==_0x2162e7['length']&&_0x2162e7['push'](new _0x566909(0x0)),_0x4795ff['return']=this['_connectService'](_0x2162e7)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x46b213=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x46b213))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3e4d76,[_0x3e1168,_0x326e2])=>{_0x3e4d76['stop']();const _0x26f291=this['editor']['model']['document']['getRoot'](_0x3e1168);if(!this['_knownRootNames']['has'](_0x3e1168)){const _0x171efd=_0x326e2&&_0x326e2['data']?_0x326e2['data']:'',_0x147379=_0x326e2&&_0x326e2['attributes']?_0x326e2['attributes']:{};await this['_loadRoot'](_0x3e1168,_0x171efd,_0x147379);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x26f291['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x26f291);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x14d1e6){const _0xe3652b=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x407c24}=this['editor']['plugins']['get'](n),_0x17c24e=new Set();for(const _0x5084a of _0x14d1e6){const _0x87008d=_0x5084a['_authorId'];_0x87008d&&!_0xe3652b['getUser'](_0x87008d)&&_0x17c24e['add'](_0x87008d);}if(0x0===_0x17c24e['size'])return;const _0x47ab62=await ht['getMany'](_0x407c24,Array['from'](_0x17c24e));for(const _0x2f7865 of _0x47ab62)_0xe3652b['getUser'](_0x2f7865['id'])||_0xe3652b['addUser'](_0x2f7865);}['_getOperationsFromInitData'](_0x2c5438,_0x249893={}){const _0x37ed97=this['editor']['model'],_0x661660=[];let _0x33ab38=0x0;const _0x4e3895='string'==typeof _0x2c5438?{'main':_0x2c5438}:_0x2c5438;for(const _0x19d887 of Object['keys'](_0x4e3895)){if(!this['_document']['roots']['has'](_0x19d887))throw new _0xb4ae54('realtimecollaborationclient-init-non-existent-root',this);const _0x3b470c=this['editor']['data']['parse'](_0x4e3895[_0x19d887]),_0x14869b=this['_document']['getRoot'](_0x19d887),_0x45c20a=new _0x4dfc76(_0x37ed97['createPositionAt'](_0x14869b,0x0),_0x3b470c,_0x33ab38++);_0x661660['push'](_0x45c20a);for(const [_0x4718a8,_0xc03d36]of _0x3b470c['markers']){const _0x1627a7=_0x37ed97['createRange'](_0x37ed97['createPositionFromPath'](_0x14869b,_0xc03d36['start']['path']['slice']()),_0x37ed97['createPositionFromPath'](_0x14869b,_0xc03d36['end']['path']['slice']())),_0x24c85e=new _0x7b3172(_0x4718a8,null,_0x1627a7,_0x37ed97['markers'],!0x0,_0x33ab38++);_0x661660['push'](_0x24c85e);}}if(_0x249893)for(const [_0xb91e5f,_0x4ec710]of Object['entries'](_0x249893)){const _0x2a90b6=_0x37ed97['document']['getRoot'](_0xb91e5f);if(!_0x2a90b6)throw new _0xb4ae54('multi-root-editor-root-attributes-no-root',null);for(const [_0x23d38e,_0x3df3c1]of Object['entries'](_0x4ec710))if(null!==_0x3df3c1){const _0x12be2b=new _0x3b01b0(_0x2a90b6,_0x23d38e,null,_0x3df3c1,_0x33ab38++);_0x661660['push'](_0x12be2b);}}return _0x661660;}async['_loadRoot'](_0x56b140,_0x3333a4,_0x49fe52){this['_getOperationsFromInitData']({[_0x56b140]:_0x3333a4},{[_0x56b140]:_0x49fe52})['forEach']((_0x4fac65,_0x44ae69)=>{_0x4fac65['baseVersion']=this['_document']['version']+_0x44ae69,_0x4fac65['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x4fac65);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5e9e49,_0x2be744){let _0x5f1ca7;this['_offset']=_0x5e9e49['offset'];const _0x1e82ea=_0x5e9e49['wereChangesApplied']&&!_0x5e9e49['initData'],_0x522d99=_0x1e82ea?0x0:_0x5e9e49['data']['baseVersion'];if(_0x2be744['forEach'](_0x47efb2=>{_0x47efb2['_isInit']=!0x0,_0x47efb2['createdAt']=_0x5e9e49['sessionCreatedAt'],_0x47efb2['_authorId']=null;}),_0x1e82ea)_0x5f1ca7=_0x2be744,this['_applyOperationsSet'](_0x5f1ca7,_0x1e82ea);else{if(_0x5e9e49['initData']){const _0x83b04d=this['_getOperationsFromInitData'](_0x5e9e49['initData']);this['_document']['history']['version']=-_0x83b04d['length'],_0x83b04d['forEach'](_0x567481=>{_0x567481['baseVersion']-=_0x83b04d['length'],_0x567481['createdAt']=_0x5e9e49['sessionCreatedAt'],_0x567481['_isInit']=!0x0,_0x567481['_authorId']=null;}),this['_applyOperationsSet'](_0x83b04d,!0x0),this['serverHistory']['version']=-_0x83b04d['length']+this['_offset'],this['_updateServerHistory'](_0x83b04d);}this['_document']['history']['version']=_0x522d99,_0x5f1ca7=this['_decompressOperations'](_0x5e9e49['data'],_0x5e9e49['metadata']),await this['_fetchMissingUsers'](_0x5f1ca7),this['_applyOperationsSet'](_0x5f1ca7,_0x1e82ea);}_0x5e9e49['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5f1ca7,_0x5e9e49['lastOperationId']),this['_lastSyncedOperationId']=_0x5e9e49['lastOperationId']),this['serverHistory']['version']=_0x522d99+this['_offset'],this['_updateServerHistory'](_0x5f1ca7),_0x2be744['filter'](_0x26f2fa=>{const _0x2aa8ab=this['_getAffectedRoot'](_0x26f2fa);return _0x2aa8ab&&!this['_knownRootNames']['has'](_0x2aa8ab);})['forEach']((_0x1f5590,_0x5e6e0f)=>{_0x1f5590['baseVersion']=this['_document']['version']+_0x5e6e0f,this['_saveOperationInBuffer'](_0x1f5590);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x313452,_0x381fdb){const _0x4ebf80=_0x381fdb&&_0x381fdb['message'];if(_0x4ebf80&&_0x4ebf80['startsWith']('realtimecollaborationclient'))throw _0x381fdb;const _0x219db1=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x219db1['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0xb4ae54(_0x313452,this['editor'],_0x4ebf80?{'originalError':_0x4ebf80}:void 0x0);}['_saveOperationInBuffer'](_0x57738b){this['_knownOperations']['has'](_0x57738b)||(this['_knownOperations']['add'](_0x57738b),this['_bufferedOperations']['push'](_0x57738b),this['_pendingAction']||'marker'==_0x57738b['type']&&!_0x57738b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x493a4f=!0x1){!_0x493a4f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4629ca=>{_0x4629ca&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x335304=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3a861f){return _0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x335304)||this['_crash'](_0x335304['message'],_0x335304);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x55f140=>{this['on']('change:_isPendingUpdate',()=>{_0x55f140();});});}async['_sendBufferedOperations'](){const _0x305385=this['editor']['plugins']['get'](N);if(this['_shouldSendSelectionUpdate']()&&(_0x305385['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5f22b4=[...this['_bufferedOperations']];for(const _0x5e33cb of _0x5f22b4)_0x5e33cb['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5e33cb);const _0x4c1e80=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5f22b4),_0x50ab91=z++,_0x2d7e4c=this['_compressOperations'](_0x5f22b4),_0x5f3b27=await this['_service']['sendOperations'](_0x2d7e4c,_0x2d7e4c['baseVersion'],_0x4c1e80);try{return await this['_handleServerResponse'](_0x5f22b4,_0x5f3b27,_0x50ab91);}catch(_0x368908){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x368908);}}async['_handleServerResponse'](_0xeeee15,_0x485877,_0x4e4c4a){if('error'in _0x485877)throw _0x485877['error'];let _0x149003=!0x1;if(_0x485877['wereChangesApplied']){_0x485877['lastOperationId']&&(this['_lastSyncedOperationId']=_0x485877['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x189afd=>!_0xeeee15['includes'](_0x189afd));for(const _0x234286 of _0xeeee15)_0x234286['createdAt']='lastOperationAcceptedAt'in _0x485877&&_0x485877['lastOperationAcceptedAt']||void 0x0;H(_0xeeee15,_0x485877['version']-_0xeeee15['length']),this['_updateServerHistory'](_0xeeee15);const _0x5bdcc7=_0xeeee15['filter'](_0xbeff4f=>{if(!_0xbeff4f['_isInit'])return!0x1;const _0x51471b=this['_getAffectedRoot'](_0xbeff4f);return _0x51471b&&!this['_knownRootNames']['has'](_0x51471b);});H(_0x5bdcc7,this['_document']['version']),this['_applyOperationsSet'](_0x5bdcc7),_0x149003=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3af6f6=this['_decompressOperations'](_0x485877['data'],_0x485877['metadata'])['filter'](_0x222ee5=>_0x222ee5['baseVersion']>=this['_lastServerVersion']);_0x3af6f6['forEach'](_0x584b2c=>this['_addKnownRoot'](_0x584b2c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xf520d8=>!_0xf520d8['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xf520d8))),this['_bufferedOperations']['length']&&H(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3af6f6),_0x149003=this['_handleExternalOperations'](_0x3af6f6,_0x485877['version'],_0x485877['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x149003?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x37a5ba,_0x251df1,_0x7c83c2){try{const _0x3f9f14={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x98152c,operationsB:_0x1e634c,originalOperations:_0x3fa4ad}=_0x3283fc(_0x37a5ba,this['_bufferedOperations'],_0x3f9f14);H(_0x98152c,this['_document']['version']),H(_0x1e634c,_0x251df1);for(const _0x2124b9 of _0x98152c){const _0x43a760=_0x3fa4ad['get'](_0x2124b9);_0x2124b9['_authorId']=_0x43a760?_0x43a760['_authorId']:null;}_0x7c83c2&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x37a5ba,_0x7c83c2),this['_lastSyncedOperationId']=_0x7c83c2),this['_bufferedOperations']=[..._0x1e634c],this['_applyOperationsSet'](_0x98152c),this['_updateServerHistory'](_0x37a5ba);}catch(_0x7b0030){return console['error'](_0x7b0030),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1aea17,_0x4f4a8f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3c1316=>{for(const _0x46cebf of _0x1aea17)this['_knownOperations']['add'](_0x46cebf),this['_addKnownRoot'](_0x46cebf),_0x3c1316['batch']['addOperation'](_0x46cebf),this['editor']['model']['applyOperation'](_0x46cebf);});}['_addKnownRoot'](_0x279e95){const _0x3417c=this['_getAffectedRoot'](_0x279e95);_0x3417c&&this['_knownRootNames']['add'](_0x3417c);}['_getAffectedRoot'](_0x1b912b){let _0x317df4,_0x1b9ef9;switch(_0x1b912b['type']){case'insert':_0x317df4=_0x1b912b['position']['root'];break;case'marker':if(_0x1b9ef9=_0x1b912b['newRange'],!_0x1b9ef9)return null;_0x317df4=_0x1b9ef9['root'];break;case'addRootAttribute':_0x317df4=_0x1b912b['root'];break;case'addRoot':_0x317df4=_0x1b912b['affectedSelectable'];break;case'move':_0x317df4=_0x1b912b['targetPosition']['root'];break;default:return null;}return _0x317df4['rootName'];}['_updateServerHistory'](_0x5df474){_0x5df474['forEach'](_0x45a6f6=>{const _0xc0fb25=_0x45a6f6['clone']();_0xc0fb25['_authorId']=_0x45a6f6['_authorId'],_0xc0fb25['_isInit']=!!_0x45a6f6['_isInit'],_0xc0fb25['createdAt']=_0x45a6f6['createdAt'],_0xc0fb25['baseVersion']+=this['_offset'],_0x45a6f6['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xc0fb25),this['serverHistory']['addOperation'](_0xc0fb25);});}['_handleReconnectionError'](_0x5f306f){const _0x58a2ed=this['editor']['plugins']['get']('Notification'),_0x2a63fa=this['editor']['locale'];_0x5f306f||(_0x5f306f=B(_0x2a63fa,'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.')),_0x58a2ed['showWarning'](_0x5f306f,{'title':B(_0x2a63fa,'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'](_0x235b6b)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x235b6b)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2d5c58){const _0x51b171=_0x2d5c58['map'](_0x10941c=>_0x10941c['toJSON']());return this['_compressor']['compress'](_0x51b171);}['_decompressOperations'](_0x35f415,_0x359214){return this['_compressor']['decompress'](_0x35f415)['map']((_0x2e67f2,_0x23d322)=>{const _0x5d6196='init'==_0x359214[_0x23d322]['type'];if('InsertOperation'==_0x2e67f2['__className']){const _0x19b85c=_0x2e67f2['position']['root'];!this['_document']['getRoot'](_0x19b85c)&&(this['_document']['createRoot']('$root',_0x19b85c)['_isAttached']=!0x1);}const _0x1b518c=_0x2f9f6e['fromJSON'](_0x2e67f2,this['_document']);return _0x1b518c['wasUndone']=_0x2e67f2['wasUndone'],_0x1b518c['_isInit']=_0x5d6196,_0x1b518c['_authorId']=_0x5d6196?null:_0x359214[_0x23d322]['userId'],_0x1b518c['_isDisconnection']='cs:removeUser'===_0x359214[_0x23d322]['type'],_0x1b518c['createdAt']=_0x359214[_0x23d322]['createdAt'],_0x1b518c;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x7a3f18=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x7a3f18&&_0x7a3f18['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function H(_0x2ebd14,_0x26e98b){for(const _0x35d48e of _0x2ebd14)_0x35d48e['baseVersion']=_0x26e98b++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x59ec0a){this['_ignoredOperations']=_0x59ec0a,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x258177){let _0x41014a=_0x258177['length'];for(;_0x41014a--;){const _0xa60319=_0x258177[_0x41014a];if(!this['_ignoredOperations']['has'](_0xa60319)){if(!this['_operationToId']['has'](_0xa60319)){const _0x2ce520=_0x525198()['slice'](0x1,0x12);this['_operationToId']['set'](_0xa60319,_0x2ce520);}return this['_operationToId']['get'](_0xa60319);}}}['setIdForTheLastOperation'](_0x37e157,_0xacf77c){if(!_0xacf77c)return;let _0x4faaa5=_0x37e157['length'];for(;_0x4faaa5--;){const _0x3f1180=_0x37e157[_0x4faaa5];this['_ignoredOperations']['has'](_0x3f1180)||this['_operationToId']['set'](_0x3f1180,_0xacf77c);}}}class a extends _0x25b979{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x6f804a{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x3a26f5)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x4fba0e];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x221e66){super(_0x221e66),this['_services']=new Map();}async['init'](){const _0x37e86a=this['context'],_0x203228=_0x37e86a['plugins']['get']('CommentsRepository');if(_0x37e86a['plugins']['get'](n)['addToReconnectionStack'](this),_0x203228['adapter']={'addCommentThread':async({channelId:_0x396b0c,threadId:_0x42ac52,comments:_0x2113a4,resolvedAt:_0x389818,resolvedBy:_0x44f9ea,context:_0xa39db3,attributes:_0x9afce8})=>{const _0x13d852=await this['_getService'](_0x396b0c)['addCommentThread']({'commentThreadId':_0x42ac52,'comments':_0x2113a4['map'](_0x576995=>function(_0x5014f4,_0x393d4b,_0x1dbd06){return{'commentThreadId':_0x1dbd06,'commentId':_0x5014f4['commentId'],'userId':_0x5014f4['authorId'],'content':_0x5014f4['content'],'documentId':_0x393d4b,'createdAt':_0x5014f4['createdAt'],'attributes':_0x5014f4['attributes']||{}};}(_0x576995,_0x396b0c,_0x42ac52)),'resolvedAt':_0x389818,'resolvedBy':_0x44f9ea,'context':_0xa39db3,'attributes':_0x9afce8})['catch'](lt);return{'threadId':_0x13d852['commentThreadId'],'comments':_0x13d852['comments']};},'getCommentThread':async({channelId:_0x54d7e6,threadId:_0xcef519})=>{const _0x2c8fe7=await this['_getService'](_0x54d7e6)['getCommentThread'](_0xcef519)['catch'](f)['catch'](lt);return _0x2c8fe7?_0x2c8fe7['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2c8fe7]),{'threadId':_0x2c8fe7['commentThreadId'],'comments':_0x2c8fe7['comments']['map'](p),'context':_0x2c8fe7['context'],'resolvedAt':_0x2c8fe7['resolvedAt'],'resolvedBy':_0x2c8fe7['resolvedBy'],'attributes':_0x2c8fe7['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x24be81,threadId:_0x184c17,context:_0x28eea9,unlinkedAt:_0x1426f2,attributes:_0x21fdf0})=>this['_getService'](_0x24be81)['updateCommentThread']({'commentThreadId':_0x184c17,'context':_0x28eea9,'attributes':_0x21fdf0,'unlinkedAt':_0x1426f2})['catch'](f)['catch'](lt),'resolveCommentThread':async({channelId:_0x587672,threadId:_0x57b12e})=>{const _0x2a546f=await this['_getService'](_0x587672)['resolveCommentThread'](_0x57b12e)['catch'](f)['catch'](lt);return{'threadId':_0x2a546f['commentThreadId'],'resolvedAt':_0x2a546f['resolvedAt'],'resolvedBy':_0x2a546f['resolvedBy']};},'reopenCommentThread':async({channelId:_0x233cb0,threadId:_0x16dd60})=>this['_getService'](_0x233cb0)['reopenCommentThread'](_0x16dd60)['catch'](f)['catch'](lt),'removeCommentThread':({channelId:_0x3d23f8,threadId:_0x9e332b})=>this['_getService'](_0x3d23f8)['removeCommentThread'](_0x9e332b)['catch'](f)['catch'](lt),'addComment':({channelId:_0x3d071c,threadId:_0x1ad221,commentId:_0x24028f,content:_0x12810d,attributes:_0xafd23})=>this['_getService'](_0x3d071c)['addComment'](_0x1ad221,_0x24028f,_0x12810d,_0xafd23)['catch'](lt),'updateComment':({channelId:_0x22bdc0,threadId:_0x210e64,commentId:_0xe78022,content:_0x2f1e5d,attributes:_0x16291d})=>this['_getService'](_0x22bdc0)['updateComment'](_0x210e64,_0xe78022,_0x2f1e5d,_0x16291d)['catch'](f)['catch'](lt),'removeComment':({channelId:_0x548745,threadId:_0x4e7bc5,commentId:_0x108129})=>this['_getService'](_0x548745)['removeComment'](_0x4e7bc5,_0x108129)['catch'](f)['catch'](lt)},_0x37e86a instanceof _0x506ccb){const _0x3349cd=_0x37e86a['config']['get']('collaboration.channelId'),_0x34bb37=_0x37e86a['plugins']['get'](i);await this['_setUpService'](_0x3349cd);const _0x4ccf96=await this['_services']['get'](_0x3349cd)['getConnectedSessions']();this['listenTo'](_0x34bb37,'sessionAdd:'+_0x3349cd,(_0x481fd5,{session:_0x24b635})=>{_0x24b635['id']===_0x34bb37['mySessionId']&&(_0x481fd5['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x24b635['permissions'],_0x3349cd));}),_0x34bb37['register'](_0x3349cd,_0x4ccf96);}}async['_setUpService'](_0xa63e35){if(this['_services']['has'](_0xa63e35))throw new _0xb4ae54('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xa63e35});const _0x43830e=this['context']['plugins']['get']('CommentsRepository'),_0x3d7838=new s['CommentsService'](_0xa63e35);this['_services']['set'](_0xa63e35,_0x3d7838),this['listenTo'](_0x3d7838,'commentThreadAdded',(_0x7d70bc,_0x22d4c7)=>{const {commentThreadId:_0x2aeeb0,documentId:_0x625929,context:_0x527c7b,attributes:_0x4c9275,resolvedAt:_0x1ff0fe,resolvedBy:_0x1ad205,comments:_0x19600b}=_0x22d4c7;_0x43830e['getCommentThread'](_0x2aeeb0)||_0x43830e['addCommentThread']({'threadId':_0x2aeeb0,'channelId':_0x625929,'comments':_0x19600b?_0x19600b['map'](p):[],'context':_0x527c7b,'attributes':_0x4c9275,'resolvedAt':_0x1ff0fe,'resolvedBy':_0x1ad205,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadUpdated',(_0x1c6d3d,{commentThreadId:_0x7d6762,documentId:_0x907741,context:_0x42d5d0,unlinkedAt:_0x344e54,attributes:_0xb11611})=>{_0x43830e['getCommentThread'](_0x7d6762)&&_0x43830e['updateCommentThread']({'threadId':_0x7d6762,'channelId':_0x907741,'context':_0x42d5d0,'unlinkedAt':_0x344e54,'attributes':_0xb11611,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadResolved',(_0x183dd9,{commentThreadId:_0x4c07cb,resolvedBy:_0x3e9e14,resolvedAt:_0x12e5f0})=>{const _0x45bb89=_0x43830e['getCommentThread'](_0x4c07cb);_0x45bb89&&_0x45bb89['resolve']({'resolvedBy':_0x3e9e14,'resolvedAt':_0x12e5f0,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadReopened',(_0xa1363a,{commentThreadId:_0x4cdd81})=>{const _0x560714=_0x43830e['getCommentThread'](_0x4cdd81);_0x560714&&_0x560714['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadRemoved',(_0x3899aa,{commentThreadId:_0x4764ae})=>{const _0x47b0cc=_0x43830e['getCommentThread'](_0x4764ae);_0x47b0cc&&_0x47b0cc['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentAdded',(_0x3f85c5,_0x330168)=>{const _0x37f7ab=_0x330168['commentThreadId'],_0x3db75a=_0x43830e['getCommentThread'](_0x37f7ab);_0x3db75a&&_0x3db75a['addComment']({...p(_0x330168),'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentUpdated',(_0x403fca,{commentThreadId:_0x1120d4,commentId:_0x146fe5,content:_0x411193,attributes:_0x2b0e50})=>{const _0x32c085=_0x43830e['getCommentThread'](_0x1120d4);if(_0x32c085){const _0x5d4b1e=_0x32c085['getComment'](_0x146fe5);_0x5d4b1e&&_0x5d4b1e['update']({'content':_0x411193,'attributes':_0x2b0e50,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3d7838,'commentRemoved',(_0x2055cc,{commentThreadId:_0x345dbc,commentId:_0xa899d8})=>{const _0x4de994=_0x43830e['getCommentThread'](_0x345dbc);if(_0x4de994){const _0x133ddd=_0x4de994['getComment'](_0xa899d8);_0x133ddd&&_0x133ddd['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xa63e35);}['destroy'](){if(this['context']instanceof _0x506ccb){const _0x12636c=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x12636c);}}['_terminateService'](_0x97c675){if(!this['_services']['has'](_0x97c675))throw new _0xb4ae54('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x97c675});this['_getService'](_0x97c675)['disconnect'](),this['_services']['delete'](_0x97c675);}async['reconnect'](){for(const _0x304da5 of this['_services']['keys']())await this['_connectService'](_0x304da5);if(this['context']instanceof _0x506ccb){const _0x2b7fae=this['context']['config']['get']('collaboration.channelId'),_0x575866=this['context']['plugins']['get'](i);_0x575866['unregister'](_0x2b7fae);const _0x30e47c=await this['_services']['get'](_0x2b7fae)['getConnectedSessions']();_0x575866['register'](_0x2b7fae,_0x30e47c);}}async['_connectService'](_0x1e2675){const {connection:_0x3c7838}=this['context']['plugins']['get'](n),_0x1ccce8=this['context']['plugins']['get']('CommentsRepository'),_0x1e185e=this['_services']['get'](_0x1e2675),_0x50e894=await _0x1e185e['connect'](_0x3c7838);await this['_fetchMissingUsersForThreads'](_0x50e894);const _0x22b7ce=new Set(Array['from'](_0x1ccce8['getCommentThreads']({'channelId':_0x1e2675}),_0x2f62ba=>_0x2f62ba['id']));for(const _0xb51728 of _0x50e894)_0xb51728['deletedAt']||_0x22b7ce['delete'](_0xb51728['commentThreadId']);for(const _0x5bfdf3 of _0x22b7ce)_0x1ccce8['getCommentThread'](_0x5bfdf3)['remove']({'isFromAdapter':!0x0});for(const _0xfa3b56 of _0x50e894){let _0x4f6abe=_0x1ccce8['getCommentThread'](_0xfa3b56['commentThreadId']);const {commentThreadId:_0x6e241d,context:_0x234307,attributes:_0x1e8d55,resolvedBy:_0x496c3d,resolvedAt:_0x3d7bc6,unlinkedAt:_0x19d69a,deletedAt:_0x5d775e}=_0xfa3b56;if(_0x5d775e)continue;_0x4f6abe||(_0x4f6abe=_0x1ccce8['addCommentThread']({'channelId':_0x1e2675,'threadId':_0x6e241d,'context':_0x234307,'attributes':_0x1e8d55||{},'resolvedBy':_0x496c3d,'resolvedAt':_0x3d7bc6,'unlinkedAt':_0x19d69a,'isFromAdapter':!0x0}));const _0x24f30d=new Set(Array['from'](_0x4f6abe['comments'],_0x56e736=>_0x56e736['id']));for(const _0x277802 of _0xfa3b56['comments'])_0x24f30d['delete'](_0x277802['commentId']);for(const _0x33b219 of _0x24f30d)_0x4f6abe['getComment'](_0x33b219)['remove']({'isFromAdapter':!0x0});for(const _0xe80118 of _0xfa3b56['comments']){const _0x40d03a=_0x4f6abe['getComment'](_0xe80118['commentId']);_0x40d03a?_0x40d03a['content']!==_0xe80118['content']&&_0x40d03a['update']({'content':_0xe80118['content'],'isFromAdapter':!0x0}):_0x4f6abe['addComment'](Object['assign'](p(_0xe80118),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1721c4){if(!this['_services']['has'](_0x1721c4))throw new _0xb4ae54('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1721c4});return this['_services']['get'](_0x1721c4);}async['_fetchMissingUsersForThreads'](_0x2000fb){const _0x5e24b0=this['context']['plugins']['get'](_0x4fba0e),{connection:_0x5b2fe6}=this['context']['plugins']['get'](n),_0x2d035b=new Set();for(const {resolvedBy:_0x3e34a4,comments:_0x53ff3e}of _0x2000fb){_0x3e34a4&&!_0x5e24b0['getUser'](_0x3e34a4)&&_0x2d035b['add'](_0x3e34a4);for(const {userId:_0xd1b7a4}of _0x53ff3e)_0x5e24b0['getUser'](_0xd1b7a4)||_0x2d035b['add'](_0xd1b7a4);}if(0x0===_0x2d035b['size'])return;const _0x2051a1=await ht['getMany'](_0x5b2fe6,Array['from'](_0x2d035b));for(const _0x16894f of _0x2051a1)_0x5e24b0['getUser'](_0x16894f['id'])||_0x5e24b0['addUser'](_0x16894f);}}async function f(_0x4fb759){if('404'!==_0x4fb759['code'])throw _0x4fb759;}function lt(_0x4715f7){if((_0x1f6911=_0x4715f7)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1f6911['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1f6911['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1f6911;throw _0x4715f7;}function p(_0x5bbe51){return{'threadId':_0x5bbe51['commentThreadId'],'commentId':_0x5bbe51['commentId'],'content':_0x5bbe51['content'],'createdAt':_0x5bbe51['createdAt'],'authorId':_0x5bbe51['userId'],'attributes':_0x5bbe51['attributes']||{}};}class m extends _0x25b979{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>_0x1035fa)());['_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(_0x17852b){super(_0x17852b);const _0x4ba712=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4ba712);}['init'](){const _0xd58ac7=this['editor']['plugins']['get'](n),_0x2533a3=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2533a3['adapter']={'getSuggestion':async _0x18708f=>{await this['_waitForServiceReady']();const _0x4bff16=await this['_trackChangesService']['get'](_0x18708f)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x4bff16]),_0x4bff16;},'addSuggestion':async({id:_0x4dcfa6,type:_0xf26695,data:_0x4b6945,originalSuggestionId:_0x385244,attributes:_0x3da32d})=>{await this['_waitForServiceReady']();const _0x3d346d={'id':_0x4dcfa6,'type':_0xf26695,'data':_0x4b6945,'originalSuggestionId':_0x385244,'attributes':_0x3da32d},_0x58eccc=await this['_trackChangesService']['add'](_0x4dcfa6,_0xf26695,_0x4b6945,_0x385244,_0x3da32d)['catch'](_0x2fb464=>{if(dt(_0x2fb464))return new Promise(_0x2b56a7=>{this['_bufferedRequests']['set'](_0x4dcfa6,{'resolve':_0x2b56a7,'suggestionData':_0x3d346d});});throw _0x2fb464;});return this['_bufferedRequests']['delete'](_0x4dcfa6),_0x58eccc;},'updateSuggestion':async(_0x4a651d,_0x10d2ab)=>{if(await this['_waitForServiceReady'](),'open'!==_0x10d2ab['state'])return this['_trackChangesService']['update'](_0x4a651d,_0x10d2ab)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x12c1bb,_0x1375b0)=>{_0x2533a3['hasSuggestion'](_0x1375b0['id'])&&(_0x2533a3['getSuggestion'](_0x1375b0['id'])['attributes']=_0x1375b0['attributes']);}),this['_trackChangesService']['connect'](_0xd58ac7['connection'])['then'](_0x8073f7=>(_0xd58ac7['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x8073f7)['then'](()=>{for(const _0x289f65 of _0x8073f7){_0x2533a3['addSuggestionData'](_0x289f65)['_saved']=!0x0;}})));}async['reconnect'](){const _0x438db8=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3537f4}=this['editor']['plugins']['get'](n),_0x264a7d=await this['_trackChangesService']['connect'](_0x3537f4);await this['_fetchMissingUsersForThreads'](_0x264a7d);for(const {suggestionData:_0x550a83,resolve:_0x25ec99}of this['_bufferedRequests']['values']()){let _0x690eb7=_0x264a7d['find'](_0x5a6d89=>_0x5a6d89['id']===_0x550a83['id']);_0x690eb7||(_0x690eb7=await this['_trackChangesService']['add'](_0x550a83['id'],_0x550a83['type'],_0x550a83['data'],_0x550a83['originalSuggestionId'])),_0x25ec99(_0x690eb7);}for(const _0x5b4a6c of _0x264a7d)_0x438db8['hasSuggestion'](_0x5b4a6c['id'])||_0x438db8['addSuggestionData'](_0x5b4a6c);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x5d4afb=>{this['listenTo'](this['_trackChangesService'],'connected',_0x40e1a4=>{_0x40e1a4['off'](),_0x5d4afb();});});}async['_fetchMissingUsersForThreads'](_0x533990){const _0x83b023=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x9b6a82}=this['editor']['plugins']['get'](n),_0x51f5ab=new Set();for(const {authorId:_0x32bcee}of _0x533990)_0x83b023['getUser'](_0x32bcee)||_0x51f5ab['add'](_0x32bcee);if(0x0===_0x51f5ab['size'])return;const _0x527d48=await ht['getMany'](_0x9b6a82,Array['from'](_0x51f5ab));for(const _0x29f68f of _0x527d48)_0x83b023['getUser'](_0x29f68f['id'])||_0x83b023['addUser'](_0x29f68f);}}function A(_0x30bb06){if(dt(_0x30bb06))return new Promise(()=>{});throw _0x30bb06;}function dt(_0x802f70){return _0x802f70['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x802f70['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x25b979{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 _0x577f78=this['editor']['plugins']['get'](n),_0x2362a5=this['editor']['plugins']['get']('CommentsEditing'),_0x8b7220=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x577f78,'change:state',(_0x47c22c,_0x56ed14,_0x5f67a5)=>{_0x2362a5['isThreadsLoadingPaused']='connected'!==_0x5f67a5;});}),this['listenTo'](_0x577f78,'change:state',(_0x5fa135,_0x1c57c0,_0x413971)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x413971);}),_0x8b7220['_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 _0x25b979{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 _0x25b979{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x16dd6a)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x4fba0e];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x477479){super(_0x477479);const _0x15bd8f=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x15bd8f);}async['init'](){const _0x39d88a=this['editor']['plugins']['get'](l),_0xe111aa=_0x39d88a['serverHistory'],_0x3b2647=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xe111aa,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x39d88a['sessionId']});const _0x1feb35=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5b349d=await _0x25c22d['isBundleUploaded'](_0x3b2647['connection'],_0x1feb35);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3e87f1})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3e87f1)),'updateRevisions':async _0x204858=>{await this['_waitForServiceReady']();const _0x47bfa9=this['_revisionTracker']['currentRevision'];if(_0x5b349d&&0x1===_0x204858['length']&&_0x204858[0x0]['id']===_0x47bfa9['id'])return _0x204858;for(const _0x1c305b of _0x204858)_0x1c305b['id']===_0x47bfa9['id']&&(_0x1c305b['isEmptyCurrent']=_0x1c305b['fromVersion']===_0x1c305b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x204858,this['_lastRequestId'])['then'](_0x9d8fc9=>(this['_lastRequestId']=_0x9d8fc9,_0x204858))['catch'](_0x36d865=>{if(b(_0x36d865)||'400'===_0x36d865['code']&&void 0x0!==_0x36d865['data']['wrongRequestId']){for(const _0x41e2d0 of _0x204858){!this['_revisionTracker']['repository']['getRevision'](_0x41e2d0['id'])||this['_revisionTracker']['_bufferUpdate'](_0x41e2d0['id'],_0x41e2d0,!0x1);}if(b(_0x36d865))throw _0x36d865;return _0x204858;}throw _0x36d865;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x65f68a,{revisionsData:_0x18c58c,requestId:_0x539926})=>{Math['max'](..._0x18c58c['map'](_0x32a7a7=>_0x32a7a7['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x18c58c,_0x539926);}):this['_handleRevisionsUpdate'](_0x18c58c,_0x539926);});const {revisions:_0x93e961,requestId:_0x502fdf}=await this['_revisionHistoryService']['connect'](_0x3b2647['connection']);_0x3b2647['addToReconnectionStack'](this),this['_lastRequestId']=_0x502fdf,await this['_fetchMissingUsers'](_0x93e961);for(const _0x177c3d of _0x93e961)this['_revisionTracker']['addRevisionData'](_0x177c3d);this['listenTo'](_0x39d88a,'change:_isConnected',(_0x58bb1d,_0x9162d2,_0x1b6dfc)=>{_0x1b6dfc&&(this['_oldOffset']=_0x39d88a['_offset'],_0x58bb1d['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3b2647,'state',_0x67fdc1=>_0x67fdc1===_0x36321a['CONNECTED']);}async['reconnect'](){const _0x280788=this['editor']['plugins']['get'](n),_0x117192=this['editor']['plugins']['get'](l),_0x28f8f7=async()=>{const _0x31d7d6=this['_revisionTracker']['currentRevision'],_0x2d8d85=_0x31d7d6['id'],_0x56b7e7=_0x2d8d85!==_0x117192['sessionId'];if(_0x56b7e7){const _0x5a7b4a=_0x117192['_offset']-this['_oldOffset'],_0x22c727=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x31d7d6['toVersion']+_0x5a7b4a!==_0x22c727){const _0x45a79a=_0x31d7d6['fromVersion']+_0x5a7b4a,_0xb3c4bd=this['editor']['plugins']['get'](_0x4fba0e),_0x168414=this['_revisionTracker']['buildRevisionData']({'revision':_0x31d7d6,'from':_0x45a79a,'to':_0x22c727});_0x168414['id']=_0x31d7d6['id'];const _0x2655c7=_0x168414['authorsIds']['map'](_0x226102=>_0xb3c4bd['getUser'](_0x226102));_0x31d7d6['_update']({..._0x168414,'authors':_0x2655c7},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x31d7d6['id'],_0x168414,!0x0);}this['_revisionTracker']['_startingVersion']=_0x22c727,(_0x31d7d6['toVersion']===_0x31d7d6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2d8d85)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2d8d85),this['_revisionTracker']['_createCurrentRevision'](_0x22c727));}const {revisions:_0x99da9c,requestId:_0x18f9c7}=await this['_revisionHistoryService']['reconnect'](_0x280788['connection'],this['_lastRequestId']);_0x56b7e7&&_0x99da9c['length']>0x0?_0x117192['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x99da9c),this['_handleRevisionsUpdate'](_0x99da9c,_0x18f9c7),this['_revisionTracker']['sendBufferedUpdates']());};return _0x117192['_isConnected']?_0x28f8f7():new Promise((_0x113bf9,_0x5e5a55)=>{_0x117192['once']('change:_isConnected',()=>{_0x28f8f7()['then'](_0x113bf9)['catch'](_0x5e5a55);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0xa89520=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5e8325=>{_0x5e8325['off'](),_0xa89520();});});}['_getLatestVersionFromServerOperations'](){const _0x55ddd9=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x302613 of _0x55ddd9)if('marker'!==_0x302613['type']||_0x302613['affectsData'])return _0x302613['baseVersion']+0x1;}['_getLatestVersion'](){const _0x2cc296=this['editor']['plugins']['get'](l);return new Promise(_0x5314e7=>{_0x2cc296['_isPendingUpdate']?_0x2cc296['once']('change:_isPendingUpdate',()=>{_0x5314e7(this['_getLatestVersionFromServerOperations']());}):_0x5314e7(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x57386c,_0x17c7fc){const _0x400794=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x17c7fc;for(const _0x48d000 of _0x57386c){const _0x21e1bd=_0x400794['getRevision'](_0x48d000['id']);if(_0x21e1bd){if((_0x48d000['fromVersion']||_0x48d000['toVersion'])&&(_0x48d000['diffData']=null),_0x21e1bd===this['_revisionTracker']['currentRevision']){const _0x46b05e=Math['max'](_0x21e1bd['toVersion'],_0x48d000['toVersion']),_0x2d80cc=Math['max'](_0x21e1bd['fromVersion'],_0x48d000['fromVersion']);let _0x5d7028;_0x21e1bd['toVersion']===_0x48d000['toVersion']&&_0x21e1bd['fromVersion']===_0x48d000['fromVersion']?(_0x5d7028=!0x0,this['_preventResendingRevisionData'](_0x48d000)):_0x48d000['toVersion']===_0x46b05e&&_0x48d000['fromVersion']===_0x2d80cc?_0x5d7028=!0x1:(_0x21e1bd['toVersion']===_0x46b05e&&_0x21e1bd['fromVersion']===_0x2d80cc||this['_fixRevision']({'revision':_0x21e1bd,'from':_0x2d80cc,'to':_0x46b05e}),_0x5d7028=!0x0),_0x5d7028&&(delete _0x48d000['fromVersion'],delete _0x48d000['toVersion'],delete _0x48d000['diffData'],delete _0x48d000['createdAt'],delete _0x48d000['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x48d000),this['_preventResendingRevisionData'](_0x48d000);}else this['_revisionTracker']['addRevisionData'](_0x48d000);}const _0x57baaf=_0x400794['getRevisions']();_0x57baaf['reverse']();for(let _0x4344e5=0x0;_0x4344e5<_0x57baaf['length']-0x1;_0x4344e5++){const _0x660bb9=_0x57baaf[_0x4344e5],_0x35cad4=_0x57baaf[_0x4344e5+0x1];if(_0x660bb9['fromVersion']<_0x35cad4['toVersion']){const _0x50483f=_0x35cad4['toVersion'],_0x5740fb=Math['max'](_0x50483f,_0x660bb9['toVersion']);this['_fixRevision']({'revision':_0x660bb9,'from':_0x50483f,'to':_0x5740fb});}}}['_fixRevision']({revision:_0x515260,from:_0x35a6a8,to:_0x1f744e}={}){const _0x901358=this['editor']['plugins']['get'](_0x4fba0e),_0x43fdaf=this['_revisionTracker']['buildRevisionData']({'revision':_0x515260,'from':_0x35a6a8,'to':_0x1f744e});_0x43fdaf['authors']=_0x43fdaf['authorsIds']['map'](_0x25e4fc=>_0x901358['getUser'](_0x25e4fc)),_0x515260['_update'](_0x43fdaf);}['_preventResendingRevisionData'](_0x44e278){const _0x162662={};_0x162662['id']=_0x44e278['id'];for(const _0x4db6fe of Object['keys'](_0x44e278))'id'!==_0x4db6fe&&(_0x162662[_0x4db6fe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x162662['id'],_0x162662,!0x0);}async['_fetchMissingUsers'](_0x35799e){const _0x5071c5=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x82124c}=this['editor']['plugins']['get'](n),_0x68e5dc=new Set();for(const _0x32b4f6 of _0x35799e){for(const _0x169be3 of _0x32b4f6['authorsIds'])_0x17992e(_0x169be3);_0x32b4f6['creatorId']&&_0x17992e(_0x32b4f6['creatorId']);}if(0x0===_0x68e5dc['size'])return;const _0x49218=await ht['getMany'](_0x82124c,Array['from'](_0x68e5dc));for(const _0x388184 of _0x49218)_0x5071c5['getUser'](_0x388184['id'])||_0x5071c5['addUser'](_0x388184);function _0x17992e(_0x2edf8e){_0x5071c5['getUser'](_0x2edf8e)||_0x68e5dc['add'](_0x2edf8e);}}}function b(_0x295dc0){return _0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x25b979{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Z extends _0x1c3372{['_collapseAt'];constructor(_0x4607a5,_0x44cc6c=0x6){super(_0x4607a5);const _0x28527c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x44cc6c,this['bind']('isHidden')['to'](this,'usersCount',_0x17a4c2=>_0x17a4c2<_0x44cc6c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x28527c['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':_0x28527c['to']('usersCount',_0x2db5b2=>'+'+(_0x2db5b2-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x1c3372{['items'];['keystrokes'];constructor(_0x7b63){super(_0x7b63);const _0x5a45c1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5360be(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5a45c1['if']('hasPopup'),'aria-expanded':_0x5a45c1['to']('isExpanded',_0x5bb8b0=>this['hasPopup']&&String(_0x5bb8b0)),'aria-label':_0x5a45c1['to']('hasPopup',_0x58c25e=>B(_0x7b63,_0x58c25e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5a45c1['to']('hasPopup',_0x33df25=>!!_0x33df25&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5a45c1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5a45c1['to'](_0x6cd37=>{const _0x5ea4bc=_0x6cd37,_0x2da6d1=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1107cd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2da6d1?.['contains'](_0x5ea4bc['relatedTarget'])||_0x1107cd?.['contains'](_0x5ea4bc['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x333b88,_0xe63128,_0x32c3a1)=>{this['element']&&(_0x32c3a1?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 Y extends _0x1c3372{['counterView'];['inlineListView'];constructor(_0x8d3b9e,_0x151b8c=0x6){super(_0x8d3b9e);const _0x111f7b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new Z(this['locale'],_0x151b8c),this['inlineListView']=new is(_0x8d3b9e),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x14b91c of this['inlineListView']['items'])_0x14b91c['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',_0x111f7b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class tt extends _0x1c3372{['listWrapperView'];constructor(_0x3711e9,_0x237b33){super(_0x3711e9);const _0x3c4577=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3711e9,_0x237b33),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0x3711e9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x3c4577['to'](_0x10d3d8=>{const _0x1743bb=_0x10d3d8,_0x4434f3=document['querySelector']('.ck-presence-list__list'),_0x395e25=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4434f3?.['contains'](_0x1743bb['relatedTarget'])||_0x395e25?.['contains'](_0x1743bb['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x4de888{constructor(_0x2c5149,_0x182271){super(_0x2c5149);const _0x7a8e13=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x182271?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x7a8e13['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x7a8e13['to']('role'),'aria-label':_0x7a8e13['to']('ariaLabel'),'aria-labelledby':_0x7a8e13['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x57f3d3['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4cd10f=this['element'];_0x4cd10f&&(this['_isScrollable']=Math['max'](_0x4cd10f['scrollHeight'],_0x4cd10f['clientHeight'])>0.8*window['innerHeight']);}}class st extends rt{['userView'];constructor(_0xfd44e4,_0x464d5b,_0x4f093a){super(_0xfd44e4);const _0x47798e=this['bindTemplate'];this['userView']=new ct(_0xfd44e4,_0x464d5b);const _0x246048={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x464d5b['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x464d5b['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x464d5b['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4f093a&&(_0x246048['tag']='button',_0x246048['on']={'click':_0x47798e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x246048);}['focus'](){this['element']['focus']();}}class it extends _0x1c3372{['userView'];['markerView'];constructor(_0x4900f9,_0x11ebe9,_0x56c5fc){super(_0x4900f9);const _0x488512=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x4900f9,_0x11ebe9),this['markerView']=new MarkerView(_0x4900f9,_0x11ebe9);const _0x2cc920=new ot(_0x4900f9);_0x2cc920['template']['tag']='span',_0x2cc920['text']=_0x11ebe9['name'];const _0x12ead6={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x488512['to']('isFocusable',_0xcaed44=>!!_0xcaed44&&0x0),'aria-labelledby':_0x2cc920['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x488512['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x488512['to']('hasTooltip',_0x2b7d71=>!_0x2b7d71),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2cc920]};_0x56c5fc&&(_0x12ead6['tag']='button',_0x12ead6['on']={'click':_0x488512['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x12ead6);}}class MarkerView extends _0x1c3372{constructor(_0x258691,_0x3bf991){super(_0x258691),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3bf991['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const et={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x6f804a{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xad3726){super(_0xad3726),this['context']['config']['define']('presenceList',et);const _0x494f30=_0xad3726['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x494f30)throw new _0xb4ae54('presencelist-collapseat-invalid-format',this);if(_0x494f30<0x1)throw new _0xb4ae54('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x247fc3(),this['balloonPanelView']=new _0x146574(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x2bf566 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x2bf566);this['listenTo'](this['_allConnectedUsers'],'add',(_0x37f636,_0x47e298)=>{this['_handleUserAdd'](_0x47e298);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2efb9b,_0x177acb)=>{this['_handleUserRemove'](_0x177acb);});}['_createView'](){const _0x4a8fce=this['context'],_0x388caa=new Y(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x385da9=this['balloonPanelView'];if(!_0x245a67(_0x4a8fce['config']['get']('presenceList.container')))throw new _0xb4ae54('presencelist-missing-container',this);return _0x388caa['counterView']['bind']('usersCount')['to'](this),_0x388caa['bind']('isCollapsed')['to'](this,'usersCount',_0x14b98c=>{const {collapseAt:_0x314b8a}=_0x4a8fce['config']['get']('presenceList'),_0x1de2d4=_0x14b98c>=_0x314b8a;if(_0x1de2d4&&!_0x388caa['inlineListView']['items']['find'](_0x52ac15=>_0x52ac15 instanceof Z)){const _0x580540=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x580540&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x388caa['inlineListView']['items']['add'](_0x388caa['counterView']);}return _0x1de2d4||this['hideDropdown'](),_0x1de2d4;}),_0x388caa['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x420d31=>{const _0x127a66=_0x4a8fce['config']['get']('presenceList'),_0x714f12=new it(_0x4a8fce['locale'],_0x420d31,!!_0x127a66['onClick']);return _0x714f12['bind']('hasTooltip')['to'](_0x388caa,'isCollapsed',_0x4fd4f7=>!_0x4fd4f7),_0x714f12['bind']('isFocusable')['to'](_0x388caa,'isCollapsed',_0x5c6e72=>!_0x5c6e72),_0x127a66['onClick']&&this['listenTo'](_0x714f12,'execute',()=>{this['view']['isCollapsed']||_0x127a66['onClick'](_0x420d31,_0x714f12['element']);}),_0x714f12;}),this['listenTo'](_0x388caa['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x388caa['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x388caa['inlineListView']['keystrokes']['set']('Enter',(_0x33b79d,_0x3c5329)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3c5329());}),_0x388caa['render'](),_0x385da9['render'](),_0x144a34({'emitter':_0x388caa,'activator':()=>_0x385da9['isVisible'],'contextElements':[_0x385da9['element'],_0x388caa['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4a8fce['config']['get']('presenceList.container')['appendChild'](_0x388caa['element']),this['_bodyCollection']=new _0x5c43da(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x388caa;}['_handleUserAdd'](_0xdbaba){if(!this['context']['config']['get']('presenceList.displayMe')&&_0xdbaba['isMe'])return;const _0x2c59f1=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2c59f1-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4947df=_0xdbaba['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0xdbaba,_0x4947df);}['_handleUserRemove'](_0x4b20f6){this['usersCount']--;const {collapseAt:_0x56e1fc}=this['context']['config']['get']('presenceList'),_0x1fa543=this['usersCount']>=_0x56e1fc;if(this['currentDisplayedUsers']['get'](_0x4b20f6['id']))this['currentDisplayedUsers']['remove'](_0x4b20f6['id']);else{if(_0x1fa543&&this['currentDisplayedUsers']['length']+0x1===_0x56e1fc-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1fa543?0x1:0x0)<this['usersCount']){for(const _0x362447 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x362447['id'])&&(this['currentDisplayedUsers']['add'](_0x362447,Math['min'](this['currentDisplayedUsers']['length']-(_0x1fa543?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1fa543?0x1:0x0)===_0x56e1fc-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x261efe=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new tt(this['context']['locale'],!!_0x261efe['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x25ec65}=this['presenceDropdownView'];_0x25ec65['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x35f8e0=>{if(!_0x261efe['displayMe']&&_0x35f8e0['isMe'])return null;const _0x23c584=new st(this['context']['locale'],_0x35f8e0,!!_0x261efe['onClick']);return _0x261efe['onClick']&&this['listenTo'](_0x23c584,'execute',()=>{_0x261efe['onClick'](_0x35f8e0,_0x23c584['element']);}),_0x23c584;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x25ec65['focus'](),_0x25ec65['checkIfScrollable']();const _0x5500a7=(_0x54e6a4,_0x19a30c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x19a30c();};_0x25ec65['keystrokes']['set']('Esc',_0x5500a7),_0x25ec65['keystrokes']['set']('Shift+Tab',_0x5500a7),_0x25ec65['keystrokes']['set']('Tab',(_0x5834f7,_0x425799)=>{!function(_0x28a6e0){const _0x3459cd=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x32f569=>_0x32f569+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x55005d=[...document['body']['querySelectorAll'](_0x3459cd)]['filter'](_0x59dd5a=>_0x59dd5a===document['activeElement']||_0x59dd5a['offsetWidth']+_0x59dd5a['offsetHeight']>0x0)['sort']((_0x112acf,_0x12544d)=>(_0x112acf['tabIndex']||0x0)-(_0x12544d['tabIndex']||0x0)),_0x5dde6c=_0x55005d['indexOf'](_0x28a6e0),_0x451aac=_0x55005d[(_0x5dde6c+0x1)%_0x55005d['length']];_0x451aac&&_0x451aac['focus']();}(this['view']['element']),this['hideDropdown'](),_0x425799();}),_0x25ec65['focusTracker']['add'](this['view']['element']),_0x25ec65['focusTracker']['on']('change:isFocused',(_0x34302c,_0x15bcbe,_0x54ddc0)=>{_0x54ddc0||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 _0x6f804a{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 _0x102a7b,Plugin as _0x17b805,PendingActions as _0x33cbb5,Context as _0x1c4fa0}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x12d6ac,CKEditorError as _0x332ad6,Collection as _0x8f9c91,global as _0x118f19,version as nt,uid as _0x1bb2ae,KeystrokeHandler as _0x5f3935}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1ba0ff,View as _0x561787,ListView as _0x556b7c,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x34bd64,clickOutsideHandler as _0x3b1e31,BodyCollection as _0x402400}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x3333b7,History as _0x5cc23b,NoOperation as _0x12cea3,InsertOperation as _0x277805,MarkerOperation as _0x40d6ff,RootAttributeOperation as _0x23d727,transformOperationSets as _0x163cfc,OperationFactory as _0x2ad745}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as at,WEB_SOCKET_GATEWAY_STATES as _0x42ae72,CollaborativeEditingService as _0x4ed1bd,User as ht,CommentsService as _0x27047f,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x20df76,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xa4e653}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x544931}from'es-toolkit/compat';class n extends _0x102a7b{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1ba0ff];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44abcf){super(_0x44abcf),this['set']('state',_0x42ae72['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x12d6ac())();}['init'](){const _0x3083d6=this['context'],_0x3a4138=_0x3083d6['plugins']['get']('CloudServices'),_0xc8fc8e=_0x3083d6['plugins']['get'](_0x1ba0ff);if(!_0x3a4138['token'])throw new _0x332ad6('websocketgateway-missing-token',this);if(!_0x3a4138['webSocketUrl'])throw new _0x332ad6('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'](_0x3a4138['token'],_0x3a4138['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2c3c8e=>{if(this['connection']=_0x2c3c8e,this['bind']('state')['to'](_0x2c3c8e,'state',this,'_isBrowserOffline',(_0x35ed8e,_0x52d39d)=>('connected'!==_0x35ed8e&&(this['_shouldPluginsReconnect']=!0x0),_0x52d39d||_0x35ed8e!==_0x42ae72['CONNECTED']?_0x42ae72['DISCONNECTED']:this['state']==_0x42ae72['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x42ae72['CONNECTING']):_0x42ae72['CONNECTED'])),this['connection']['on']('error',(_0x1d0176,_0x1fc873)=>{if('limitExceeded'!==_0x1fc873['code'])throw console['error'](_0x1fc873),new _0x332ad6('cloudservices-init',null,{'originalError':_0x1fc873});_0xc8fc8e['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'});}),!_0x2c3c8e['me'])return new Promise(_0x433bb2=>_0x2c3c8e['on']('change:me',_0x433bb2));})['catch'](_0x1d5eb9=>{throw console['error'](_0x1d5eb9),new _0x332ad6('cloudservices-init',null,{'originalError':_0x1d5eb9});});}['addToReconnectionStack'](_0x4cfeda){if('function'!=typeof _0x4cfeda['reconnect'])throw new _0x332ad6('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4cfeda))throw new _0x332ad6('websocketgateway-plugin-already-registered',this,{'name':_0x4cfeda['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4cfeda);}['removeFromReconnectionStack'](_0x8ff6a9){this['_reconnectionStack']['delete'](_0x8ff6a9);}['isInReconnectionStack'](_0x52a2c9){return this['_reconnectionStack']['has'](_0x52a2c9);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x144438=>_0x144438['reconnect']())))['then'](()=>this['state']=_0x42ae72['CONNECTED'])['catch'](_0x50f140=>{throw console['error'](_0x50f140),new _0x332ad6('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x42ae72['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x102a7b{['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,_0x20df76];}constructor(_0x24fb91){super(_0x24fb91),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x8f9c91(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x20df76);}['init'](){const _0x433f19=this['context']['plugins']['get'](n);this['listenTo'](_0x433f19,'change:state',(_0x354573,_0x49f64a,_0x22fb7d)=>{if('connected'!==_0x22fb7d)this['channelSessions']['forEach'](_0x534eb6=>_0x534eb6['clear']()),this['channelConnectedUsers']['forEach'](_0x4deac2=>_0x4deac2['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x25147e,_0x45c440]of this['_registeredSessions'])for(const _0x5b77f2 of _0x45c440)this['_handleSessionAdd'](_0x25147e,_0x5b77f2);}}),this['_createUser'](_0x433f19['connection']['me'],!0x0);}['register'](_0x2c4761,_0x5224df){if(this['_registeredSessions']['has'](_0x2c4761))throw new _0x332ad6('sessions-register-already-registered',null,{'channelId':_0x2c4761});this['_registeredSessions']['set'](_0x2c4761,_0x5224df),this['channelSessions']['set'](_0x2c4761,new _0x8f9c91()),this['channelConnectedUsers']['set'](_0x2c4761,new _0x8f9c91()),this['listenTo'](_0x5224df,'add',(_0x141d77,_0x413003)=>this['_handleSessionAdd'](_0x2c4761,_0x413003)),this['listenTo'](_0x5224df,'remove',(_0x2645e3,_0x1730f0)=>this['_handleSessionRemove'](_0x2c4761,_0x1730f0));for(const _0x359861 of _0x5224df)this['_handleSessionAdd'](_0x2c4761,_0x359861);}['unregister'](_0x13ffea){if(!this['_registeredSessions']['has'](_0x13ffea))throw new _0x332ad6('sessions-unregister-not-exist',null,{'channelId':_0x13ffea});const _0x3d6f75=this['_registeredSessions']['get'](_0x13ffea);this['stopListening'](_0x3d6f75);for(const _0x2e94b1 of _0x3d6f75)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x13ffea,_0x2e94b1);this['_registeredSessions']['delete'](_0x13ffea),this['channelSessions']['delete'](_0x13ffea),this['channelConnectedUsers']['delete'](_0x13ffea);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x212fe0){for(const _0x4eba9e of this['channelSessions']['values']())for(const _0xb7399 of _0x4eba9e)if(_0xb7399['id']===_0x212fe0)return _0xb7399['user'];}['getUserSessions'](_0x3439bf,_0x1dc1f7){const _0x214a1c=_0x1dc1f7?[this['channelSessions']['get'](_0x1dc1f7)]:this['channelSessions']['values'](),_0x27de08=new Set();for(const _0x509ae2 of _0x214a1c)for(const _0x372a94 of _0x509ae2)_0x372a94['user']['id']===_0x3439bf['id']&&_0x27de08['add'](_0x372a94['id']);return _0x27de08;}['getUserRole'](_0x46f310){for(const _0x40f9cd of this['channelSessions']['values']())for(const _0x28b4ab of _0x40f9cd)if(_0x28b4ab['user']===_0x46f310)return _0x28b4ab['role'];}['_handleSessionAdd'](_0x5d827b,_0x42294c){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x328543=_0x42294c['user'],_0x106de0=this['_users']['getUser'](_0x328543['id'])||this['_createUser'](_0x328543),_0x5697a9=Object['assign']({},_0x42294c,{'user':_0x106de0});if(this['channelSessions']['get'](_0x5d827b)['add'](_0x5697a9),!_0x328543['hiddenInPresenceList']){const _0x14033c=this['channelConnectedUsers']['get'](_0x5d827b);_0x14033c['has'](_0x106de0['id'])||_0x14033c['add'](_0x106de0),this['allConnectedUsers']['has'](_0x106de0['id'])||_0x328543['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x106de0,_0x106de0['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x5d827b,{'channelId':_0x5d827b,'session':_0x5697a9});}['_handleSessionRemove'](_0xfbc546,_0x4e773){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x11d1e7=this['channelConnectedUsers']['get'](_0xfbc546),_0x21357e=_0x4e773['user'];_0x21357e['id']&&(this['channelSessions']['get'](_0xfbc546)['remove'](_0x4e773['id']),_0x11d1e7['has'](_0x21357e['id'])&&!this['getUserSessions'](_0x21357e,_0xfbc546)['size']&&_0x11d1e7['remove'](_0x21357e['id']),this['allConnectedUsers']['get'](_0x21357e['id'])&&!this['getUserSessions'](_0x21357e)['size']&&this['allConnectedUsers']['remove'](_0x21357e['id']));}['_createUser'](_0x34069b,_0x1a8929){const _0x13d3c1=this['_users']['addUser'](_0x34069b);return _0x1a8929&&this['_users']['defineMe'](_0x34069b['id']),_0x13d3c1['orderNumber']=this['_uniqueUsersCount']++,_0x13d3c1;}}class k extends _0x17b805{['_domEmitter']=new(_0x12d6ac())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3e74ff=this['editor'],_0x2650f6=_0x3e74ff['plugins']['get'](i);_0x3e74ff['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5e90d6,{writer:_0x134432})=>function(_0x2af23c,_0x4890c9,_0x55a6d0,_0x44e7ee){const _0x2f6e8f=_0x2af23c['markerName']['split'](':')[0x2],_0x50cd93=_0x55a6d0['getUserBySessionId'](_0x2f6e8f);if(!_0x50cd93||_0x2f6e8f===_0x55a6d0['mySessionId'])return;if(!_0x44e7ee['model']['schema']['checkChild'](_0x2af23c['markerRange']['start'],'$text'))return;const _0x87920f={'class':'ck-user__marker\x20'+_0x50cd93['color']['getMarkerClass'](),'data-name':_0x50cd93['name'],'data-session-id':_0x2f6e8f},_0x492d3c=_0x44e7ee['model']['markers']['get'](_0x2af23c['markerName']),_0xd8a8d6=_0x492d3c['getStart'](),_0x5d3ac0=_0xd8a8d6['nodeAfter'],_0x2cd13b=_0x44e7ee['model']['schema'];if(_0x5d3ac0&&_0x2cd13b['isObject'](_0x5d3ac0)&&_0x2cd13b['isInline'](_0x5d3ac0)&&!_0x44e7ee['model']['markers']['get']('user:range:'+_0x2f6e8f)['getRange']()['isCollapsed'])return;const _0x3081a1=_0xd8a8d6['parent'];return _0x44e7ee['model']['schema']['isLimit'](_0x3081a1)&&!_0x44e7ee['model']['hasContent'](_0x3081a1)&&(_0x87920f['contenteditable']=!0x1),function(_0x3a8e21,_0x3503c9,_0x24a95b){const _0x53344d=_0x3a8e21['createUIElement']('span',_0x3503c9);return _0x3a8e21['setCustomProperty']('userPositionMarker',!0x0,_0x53344d),_0x53344d['render']=function(_0x3ad8f3){const _0x2c505f=this['toDomElement'](_0x3ad8f3),_0x134428=document['createElement']('span');return _0x134428['classList']['add']('ck-user__marker-tooltip'),_0x134428['setAttribute']('contenteditable','false'),_0x134428['setAttribute']('spellcheck','false'),_0x134428['textContent']=_0x24a95b['name'],_0x2c505f['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x134428['outerHTML']+'⁠',_0x2c505f['addEventListener']('mouseenter',()=>{_0x2c505f['classList']['add']('ck-user__marker_hovered');}),_0x2c505f['addEventListener']('mouseleave',()=>{_0x2c505f['classList']['remove']('ck-user__marker_hovered');}),_0x2c505f;},_0x53344d['isSimilar']=function(_0x245bac){return!(!this['getCustomProperty']('userPositionMarker')||!_0x245bac['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x245bac['getAttribute']('data-session-id'));},_0x53344d;}(_0x4890c9,_0x87920f,_0x50cd93);}(_0x5e90d6,_0x134432,_0x2650f6,_0x3e74ff)}),_0x3e74ff['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1f3885=>function(_0x5d31ed,_0x29236e){const _0x499aba=_0x5d31ed['markerName']['split'](':')[0x2];if(_0x499aba===_0x29236e['mySessionId'])return null;const _0x3bb49a=_0x29236e['getUserBySessionId'](_0x499aba);if(!_0x3bb49a)return{'id':_0x499aba,'classes':[]};return{'id':_0x499aba,'classes':['ck-user__selection',_0x3bb49a['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x499aba},'priority':0x7d0+_0x3bb49a['orderNumber']};}(_0x1f3885,_0x2650f6)}),function(_0xa9c76e){const _0x4586d3=_0xa9c76e['model'],_0x3a71f9=new Map(),_0x2f7df6=_0xa9c76e['plugins']['get'](i);_0x4586d3['markers']['on']('update:user:range',(_0x2fb3bd,_0x497b54,_0x5b7b91,_0x29f627)=>{if(!_0x29f627&&_0x3a71f9['get'](_0x497b54['name']))return _0x3a71f9['get'](_0x497b54['name'])['detach'](),void _0x3a71f9['delete'](_0x497b54['name']);const _0x1328df=_0x497b54['name']['split'](':')[0x2];if(_0x1328df===_0x2f7df6['mySessionId'])return;const _0x5538fb='user:position:'+_0x1328df;_0x4586d3['markers']['has'](_0x5538fb)&&_0xa9c76e['editing']['reconvertMarker'](_0x5538fb),_0x497b54['on']('change:range',(_0x2bc8ed,_0x3d5224,_0x9ea547)=>{if('$graveyard'!=_0x3d5224['root']['rootName']&&'$graveyard'==_0x497b54['getRange']()['root']['rootName']&&!_0x3a71f9['has'](_0x497b54['name'])){const _0x881004=_0x4586d3['schema']['getNearestSelectionRange'](_0x9ea547['deletionPosition']);if(_0x881004){const _0x26f85c=_0x3333b7['fromRange'](_0x881004);_0x3a71f9['set'](_0x497b54['name'],_0x26f85c),_0x26f85c['on']('change:range',(_0x512220,_0x2357ed,_0x581f64)=>{if('$graveyard'==_0x26f85c['root']['rootName']){const _0x526e52=_0x4586d3['schema']['getNearestSelectionRange'](_0x581f64['deletionPosition']);_0x526e52?(_0x26f85c['start']=_0x526e52['start'],_0x26f85c['end']=_0x526e52['end']):(_0x3a71f9['delete'](_0x497b54['name']),_0x26f85c['detach']());}});}}});}),_0x4586d3['document']['on']('change',()=>{_0x3a71f9['size']>0x0&&_0x4586d3['enqueueChange']({'isUndoable':!0x1},_0x119d90=>{for(const [_0x4a227c,_0xbe4390]of _0x3a71f9)'$graveyard'==_0x4586d3['markers']['get'](_0x4a227c)['getRange']()['root']['rootName']&&(x(_0x4a227c['split'](':')[0x2],_0xbe4390['toRange'](),_0x4586d3,_0x119d90),_0xbe4390['detach']());_0x3a71f9['clear']();});});}(_0x3e74ff),this['_domEmitter']['listenTo'](_0x118f19['document'],'keydown',(_0x4f8845,{key:_0xf2d280})=>{'Escape'===_0xf2d280&&function(_0x2633d7){_0x2633d7['editing']['view']['change'](_0x17d444=>{for(const _0xd2a909 of _0x2633d7['model']['markers']){if(!_0xd2a909['name']['startsWith']('user:position'))continue;const _0x837034=_0x2633d7['editing']['mapper']['markerNameToElements'](_0xd2a909['name']);if(_0x837034){for(const _0x37ceaa of _0x837034)_0x17d444['removeClass']('ck-user__marker_hovered',_0x37ceaa);}}});}(_0x3e74ff);},{'useCapture':!0x0});}['afterInit'](){const _0x46baa8=this['editor'],_0x57b460=_0x46baa8['commands']['get']('undo');_0x57b460&&_0x46baa8['model']['on']('applyOperation',(_0x475112,_0x5edd91)=>{const _0x1abd34=_0x5edd91[0x0];if(!_0x1abd34['isDocumentOperation'])return;if('marker'!=_0x1abd34['type']||!_0x1abd34['name']['startsWith']('user:'))return;const _0x368a65=_0x1abd34['batch'];_0x57b460['_createdBatches']['has'](_0x368a65)&&(_0x1abd34['newRange']=_0x1abd34['oldRange']?_0x46baa8['model']['createRange'](_0x1abd34['oldRange']['start'],_0x1abd34['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0xf180c4=this['editor'],_0xcd5a99=_0xf180c4['model']['document'],_0x15127e=_0xf180c4['plugins']['get'](i);_0xf180c4['model']['enqueueChange']({'isUndoable':!0x1},_0x3b8fa4=>{const _0x222dbf='user:range:'+_0x15127e['mySessionId'],_0x138096='user:position:'+_0x15127e['mySessionId'],_0x2e8824=_0xf180c4['model']['markers']['has'](_0x222dbf);_0xf180c4['editing']['view']['hasDomSelection']?x(_0x15127e['mySessionId'],_0xcd5a99['selection']['getFirstRange'](),_0xf180c4['model'],_0x3b8fa4):_0x2e8824&&(_0x3b8fa4['removeMarker'](_0x222dbf),_0x3b8fa4['removeMarker'](_0x138096));});}}function x(_0xbff87e,_0xfcfc81,_0x58ccc5,_0x5cd521){const _0x2ea6fd='user:range:'+_0xbff87e,_0x5b804a='user:position:'+_0xbff87e,_0x3062a2=_0xfcfc81['getContainedElement']();let _0xf0394c=_0xfcfc81['start'];if(_0x3062a2&&_0x3062a2['is']('element','tableCell')){const _0x4ffbc8=function(_0x26ece1,_0x1c3867){for(const _0x1e84cf of _0x26ece1['getPositions']())if(_0x1c3867['schema']['checkChild'](_0x1e84cf,'$text'))return _0x1e84cf;}(_0xfcfc81,_0x58ccc5);_0x4ffbc8&&(_0xf0394c=_0x4ffbc8,_0xfcfc81=_0x5cd521['createRange'](_0xf0394c));}const _0x146c06=_0x5cd521['createRange'](_0xf0394c);_0x58ccc5['markers']['has'](_0x2ea6fd)?(_0x5cd521['updateMarker'](_0x2ea6fd,{'range':_0xfcfc81}),_0x5cd521['updateMarker'](_0x5b804a,{'range':_0x146c06})):(_0x5cd521['addMarker'](_0x2ea6fd,{'range':_0xfcfc81,'usingOperation':!0x0}),_0x5cd521['addMarker'](_0x5b804a,{'range':_0x146c06,'usingOperation':!0x0}));}function R(_0x471ea4,_0x20200e,_0x42c52d){const _0x4038b4=_0x471ea4['t'],t=_0x471ea4['t'];switch(_0x20200e){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 _0x4038b4({'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'},_0x42c52d);default:return'';}}let j=0x1;class l extends _0x17b805{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x4ed1bd)());['_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,_0x33cbb5,_0x20df76,_0x1ba0ff];}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 _0x4954fa=this['serverHistory']['getOperations']();for(let _0x3f1742=_0x4954fa['length']-0x1;_0x3f1742>=0x0;_0x3f1742--){const _0x1633c7=_0x4954fa[_0x3f1742];if(!this['_disconnectionOperations']['has'](_0x1633c7))return _0x1633c7['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x548cda){if(super(_0x548cda),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5cc23b(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x332ad6('collaboration-missing-channelid',this);const _0xbdf3da=_0x548cda['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xbdf3da,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xa4e653(),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 _0x4dd44d=this['editor'],_0x2d243b=_0x4dd44d['plugins']['get'](_0x20df76),_0x126010=_0x4dd44d['plugins']['get'](n);this['listenTo'](_0x2d243b,'getOperationAuthor',(_0x1e4cfd,_0x44b3e7)=>{const _0xb80dbc=_0x44b3e7[0x0];_0xb80dbc['_authorId']&&(_0x1e4cfd['return']=_0x2d243b['getUser'](_0xb80dbc['_authorId']),_0x1e4cfd['stop']()),null===_0xb80dbc['_authorId']&&(_0x1e4cfd['return']=null,_0x1e4cfd['stop']());},{'priority':'high'}),this['listenTo'](_0x4dd44d['model']['document']['selection'],'change:range',(_0x55bd02,_0x3d43cf)=>{_0x3d43cf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4dd44d['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4dd44d['model']['on']('applyOperation',(_0x358885,_0x45cdf5)=>{const _0x557c64=_0x45cdf5[0x0];_0x557c64['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x557c64),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x126010,'state',this,'_hasSynchronizationProblem',(_0x125ba1,_0x1e15fc)=>'connected'===_0x125ba1&&!_0x1e15fc),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4dd44d['disableReadOnlyMode']('rtc-offline'):_0x4dd44d['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4dd44d['disableReadOnlyMode']('rtc-offline'):_0x4dd44d['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1151bd=this['editor']['plugins']['get'](i),_0x4eda7a=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1151bd['unregister'](this['_channelId']);const _0x577e12=await this['_service']['reconnect'](_0x4eda7a['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x577e12)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3ba02d=await this['_service']['getConnectedSessions']();_0x1151bd['register'](this['_channelId'],_0x3ba02d),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x27a2a6){if(function(_0xb8b9a){return'404'===_0xb8b9a['code'];}(_0x27a2a6)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x551cbd){return'409'===_0x551cbd['code'];}(_0x27a2a6)){const _0x47992f=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'](_0x47992f);}else{if(!(_0x27a2a6 instanceof ReconnectionError))throw _0x27a2a6;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1667d2=this['editor']['plugins']['get'](n),_0x20dd3a=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x20dd3a['channelSessions']['has'](this['_channelId'])&&_0x20dd3a['unregister'](this['_channelId']),_0x1667d2['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4fb040){if(this['sessionId']!==_0x4fb040['sessionId']&&this['_lastSyncedOperationId']!==_0x4fb040['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x4fb040['sessionId'],this['_handleServerResponse']([],{..._0x4fb040,'wereChangesApplied':!0x1,'data':_0x4fb040['data']},'reconnect');}async['_connectService'](_0x2f0173,_0x556d42=!0x1){const {connection:_0xea7ab}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0xea7ab,this['_channelId'])['then'](_0x3bd1ac=>this['_initSessionsHandling'](_0x3bd1ac))['catch'](_0x2d18b4=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x2d18b4);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x126ed3,_0x1c8156)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1c8156);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x55b0dd=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2f0173);this['_isPendingUpdate']=!0x0;const _0x32f059=await this['_service']['connect'](_0xea7ab,this['_compressOperations'](_0x2f0173),_0x55b0dd);if(this['sessionId']=_0x32f059['sessionId'],_0x556d42){if(!_0x32f059['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x32f059['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2f0173,_0x32f059,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x32f059,_0x2f0173);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x5c02a5=this['editor']['plugins']['get'](i),_0x363bbb=this['editor']['plugins']['get'](k),_0x23be08=_0x5c02a5['channelSessions']['get'](this['_channelId']);_0x23be08&&_0x23be08['length']>0x1?_0x363bbb['createUserMarkerOperations']():this['listenTo'](_0x5c02a5,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x5c02a5['channelSessions']['get'](this['_channelId'])['length']&&_0x363bbb['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2a0798,_0x2b7342,_0x3d1b72,_0x18f62a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2b7342){const _0x53f4b1=this['_decompressOperations'](_0x3d1b72,_0x18f62a);await this['_fetchMissingUsers'](_0x53f4b1),this['_handleExternalOperations'](_0x53f4b1,_0x2b7342,_0x3d1b72['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1f0442}=this['editor'];let _0x59190b;try{_0x59190b=await this['_service']['getDocumentDetails']();}catch{const _0x307bf3=R(_0x1f0442,'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'](_0x307bf3);}const _0x5cbe54=_0x59190b['currentDocumentSession']||_0x59190b['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5cbe54['lastOperationId']){const _0x4acb7d=R(_0x1f0442,'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'](_0x4acb7d);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x5a4847){const _0x2750e1=this['editor']['plugins']['get'](i);this['listenTo'](_0x2750e1,'sessionAdd:'+this['_channelId'],(_0x4350b9,{session:_0x3b03d3})=>{if(_0x3b03d3['id']===_0x2750e1['mySessionId']){_0x4350b9['off']();const _0x4b9ca5=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x247bed=_0x3b03d3['permissions'];_0x4b9ca5&&_0x4b9ca5['isEnabled']&&(_0x247bed=_0x247bed['filter'](_0x10003=>'document:write'!==_0x10003)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x247bed,this['_channelId']);}}),_0x2750e1['register'](this['_channelId'],_0x5a4847);}['_initThrowingOnDataSet'](){const _0x2df05e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xad16e6)=>{if(!_0xad16e6[_0xad16e6['length']-0x1]['suppressErrorInCollaboration'])throw new _0x332ad6('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2df05e['apply'](this['editor']['data'],_0xad16e6);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x5584cb,[_0xb37db8])=>{if(this['_document']['version'])throw new _0x332ad6('realtimecollaborationclient-init-document-already-initialized',this);_0x5584cb['stop'](),this['_setPendingAction']();const _0x3206aa=this['editor']['config']['get']('rootsAttributes'),_0x3ad3e0=this['_getOperationsFromInitData'](_0xb37db8,_0x3206aa);0x0==_0x3ad3e0['length']&&_0x3ad3e0['push'](new _0x12cea3(0x0)),_0x5584cb['return']=this['_connectService'](_0x3ad3e0)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1dda5d=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1dda5d))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1aaea3,[_0x1d722d,_0x58bbfa])=>{_0x1aaea3['stop']();const _0x3f7f2f=this['editor']['model']['document']['getRoot'](_0x1d722d);if(!this['_knownRootNames']['has'](_0x1d722d)){const _0x438809=_0x58bbfa&&_0x58bbfa['data']?_0x58bbfa['data']:'',_0xa5d0f5=_0x58bbfa&&_0x58bbfa['attributes']?_0x58bbfa['attributes']:{};await this['_loadRoot'](_0x1d722d,_0x438809,_0xa5d0f5);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3f7f2f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3f7f2f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2af798){const _0x103e94=this['editor']['plugins']['get'](_0x20df76),{connection:_0x2ac832}=this['editor']['plugins']['get'](n),_0x47b1e6=new Set();for(const _0x14388c of _0x2af798){const _0x32ecb1=_0x14388c['_authorId'];_0x32ecb1&&!_0x103e94['getUser'](_0x32ecb1)&&_0x47b1e6['add'](_0x32ecb1);}if(0x0===_0x47b1e6['size'])return;const _0x3d731c=await ht['getMany'](_0x2ac832,Array['from'](_0x47b1e6));for(const _0x2bb1c3 of _0x3d731c)_0x103e94['getUser'](_0x2bb1c3['id'])||_0x103e94['addUser'](_0x2bb1c3);}['_getOperationsFromInitData'](_0x53216c,_0x1b2d3d={}){const _0x155702=this['editor']['model'],_0x19c14f=[];let _0x24b3f2=0x0;const _0xcd0dc1='string'==typeof _0x53216c?{'main':_0x53216c}:_0x53216c;for(const _0x562266 of Object['keys'](_0xcd0dc1)){if(!this['_document']['roots']['has'](_0x562266))throw new _0x332ad6('realtimecollaborationclient-init-non-existent-root',this);const _0x32b251=this['editor']['data']['parse'](_0xcd0dc1[_0x562266]),_0x533622=this['_document']['getRoot'](_0x562266),_0x13fbca=new _0x277805(_0x155702['createPositionAt'](_0x533622,0x0),_0x32b251,_0x24b3f2++);_0x19c14f['push'](_0x13fbca);for(const [_0x2d1265,_0x64eb04]of _0x32b251['markers']){const _0x7d0e17=_0x155702['createRange'](_0x155702['createPositionFromPath'](_0x533622,_0x64eb04['start']['path']['slice']()),_0x155702['createPositionFromPath'](_0x533622,_0x64eb04['end']['path']['slice']())),_0x5e106=new _0x40d6ff(_0x2d1265,null,_0x7d0e17,_0x155702['markers'],!0x0,_0x24b3f2++);_0x19c14f['push'](_0x5e106);}}if(_0x1b2d3d)for(const [_0x55292a,_0x5b74d5]of Object['entries'](_0x1b2d3d)){const _0x357089=_0x155702['document']['getRoot'](_0x55292a);if(!_0x357089)throw new _0x332ad6('multi-root-editor-root-attributes-no-root',null);for(const [_0x3b8f3e,_0x4b06e3]of Object['entries'](_0x5b74d5))if(null!==_0x4b06e3){const _0x366d95=new _0x23d727(_0x357089,_0x3b8f3e,null,_0x4b06e3,_0x24b3f2++);_0x19c14f['push'](_0x366d95);}}return _0x19c14f;}async['_loadRoot'](_0x1d3a24,_0x4c608d,_0x71dde4){this['_getOperationsFromInitData']({[_0x1d3a24]:_0x4c608d},{[_0x1d3a24]:_0x71dde4})['forEach']((_0x306f98,_0x52cffd)=>{_0x306f98['baseVersion']=this['_document']['version']+_0x52cffd,_0x306f98['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x306f98);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x56bbf6,_0x2212eb){let _0x58e717;this['_offset']=_0x56bbf6['offset'];const _0xa52df6=_0x56bbf6['wereChangesApplied']&&!_0x56bbf6['initData'],_0x37d4d1=_0xa52df6?0x0:_0x56bbf6['data']['baseVersion'];if(_0x2212eb['forEach'](_0x43dfdf=>{_0x43dfdf['_isInit']=!0x0,_0x43dfdf['createdAt']=_0x56bbf6['sessionCreatedAt'],_0x43dfdf['_authorId']=null;}),_0xa52df6)_0x58e717=_0x2212eb,this['_applyOperationsSet'](_0x58e717,_0xa52df6);else{if(_0x56bbf6['initData']){const _0x5a2e34=this['_getOperationsFromInitData'](_0x56bbf6['initData']);this['_document']['history']['version']=-_0x5a2e34['length'],_0x5a2e34['forEach'](_0x4c4547=>{_0x4c4547['baseVersion']-=_0x5a2e34['length'],_0x4c4547['createdAt']=_0x56bbf6['sessionCreatedAt'],_0x4c4547['_isInit']=!0x0,_0x4c4547['_authorId']=null;}),this['_applyOperationsSet'](_0x5a2e34,!0x0),this['serverHistory']['version']=-_0x5a2e34['length']+this['_offset'],this['_updateServerHistory'](_0x5a2e34);}this['_document']['history']['version']=_0x37d4d1,_0x58e717=this['_decompressOperations'](_0x56bbf6['data'],_0x56bbf6['metadata']),await this['_fetchMissingUsers'](_0x58e717),this['_applyOperationsSet'](_0x58e717,_0xa52df6);}_0x56bbf6['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x58e717,_0x56bbf6['lastOperationId']),this['_lastSyncedOperationId']=_0x56bbf6['lastOperationId']),this['serverHistory']['version']=_0x37d4d1+this['_offset'],this['_updateServerHistory'](_0x58e717),_0x2212eb['filter'](_0x4a6f84=>{const _0x31f633=this['_getAffectedRoot'](_0x4a6f84);return _0x31f633&&!this['_knownRootNames']['has'](_0x31f633);})['forEach']((_0x3f3978,_0x97d647)=>{_0x3f3978['baseVersion']=this['_document']['version']+_0x97d647,this['_saveOperationInBuffer'](_0x3f3978);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5a8ca6,_0x75bf23){const _0x3a46d5=_0x75bf23&&_0x75bf23['message'];if(_0x3a46d5&&_0x3a46d5['startsWith']('realtimecollaborationclient'))throw _0x75bf23;const _0x324498=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x324498['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x332ad6(_0x5a8ca6,this['editor'],_0x3a46d5?{'originalError':_0x3a46d5}:void 0x0);}['_saveOperationInBuffer'](_0x399f46){this['_knownOperations']['has'](_0x399f46)||(this['_knownOperations']['add'](_0x399f46),this['_bufferedOperations']['push'](_0x399f46),this['_pendingAction']||'marker'==_0x399f46['type']&&!_0x399f46['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x417bfa=!0x1){!_0x417bfa&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x495de5=>{_0x495de5&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x305037=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x9c7579){return _0x9c7579['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x9c7579['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x9c7579['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x305037)||this['_crash'](_0x305037['message'],_0x305037);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2b620f=>{this['on']('change:_isPendingUpdate',()=>{_0x2b620f();});});}async['_sendBufferedOperations'](){const _0x587617=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x587617['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x474f5e=[...this['_bufferedOperations']];for(const _0x14be25 of _0x474f5e)_0x14be25['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x14be25);const _0x28e5c4=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x474f5e),_0x2fc5e3=j++,_0x5e64fd=this['_compressOperations'](_0x474f5e),_0x25debe=await this['_service']['sendOperations'](_0x5e64fd,_0x5e64fd['baseVersion'],_0x28e5c4);try{return await this['_handleServerResponse'](_0x474f5e,_0x25debe,_0x2fc5e3);}catch(_0x3049a8){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3049a8);}}async['_handleServerResponse'](_0x4d7e60,_0x514558,_0x481669){if('error'in _0x514558)throw _0x514558['error'];let _0x35a779=!0x1;if(_0x514558['wereChangesApplied']){_0x514558['lastOperationId']&&(this['_lastSyncedOperationId']=_0x514558['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2e4b42=>!_0x4d7e60['includes'](_0x2e4b42));for(const _0x100c03 of _0x4d7e60)_0x100c03['createdAt']='lastOperationAcceptedAt'in _0x514558&&_0x514558['lastOperationAcceptedAt']||void 0x0;D(_0x4d7e60,_0x514558['version']-_0x4d7e60['length']),this['_updateServerHistory'](_0x4d7e60);const _0x2286c2=_0x4d7e60['filter'](_0x1801f9=>{if(!_0x1801f9['_isInit'])return!0x1;const _0xe37c15=this['_getAffectedRoot'](_0x1801f9);return _0xe37c15&&!this['_knownRootNames']['has'](_0xe37c15);});D(_0x2286c2,this['_document']['version']),this['_applyOperationsSet'](_0x2286c2),_0x35a779=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xfd10a7=this['_decompressOperations'](_0x514558['data'],_0x514558['metadata'])['filter'](_0x4acc58=>_0x4acc58['baseVersion']>=this['_lastServerVersion']);_0xfd10a7['forEach'](_0x5586b3=>this['_addKnownRoot'](_0x5586b3)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x250729=>!_0x250729['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x250729))),this['_bufferedOperations']['length']&&D(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xfd10a7),_0x35a779=this['_handleExternalOperations'](_0xfd10a7,_0x514558['version'],_0x514558['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x35a779?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x699227,_0x5ea3a2,_0x2e5dd9){try{const _0x504784={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x22e934,operationsB:_0x2a68c4,originalOperations:_0x357223}=_0x163cfc(_0x699227,this['_bufferedOperations'],_0x504784);D(_0x22e934,this['_document']['version']),D(_0x2a68c4,_0x5ea3a2);for(const _0x42af16 of _0x22e934){const _0x473ab8=_0x357223['get'](_0x42af16);_0x42af16['_authorId']=_0x473ab8?_0x473ab8['_authorId']:null;}_0x2e5dd9&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x699227,_0x2e5dd9),this['_lastSyncedOperationId']=_0x2e5dd9),this['_bufferedOperations']=[..._0x2a68c4],this['_applyOperationsSet'](_0x22e934),this['_updateServerHistory'](_0x699227);}catch(_0x5f55c7){return console['error'](_0x5f55c7),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1d0a01,_0x50e08e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5eeaa9=>{for(const _0x96819e of _0x1d0a01)this['_knownOperations']['add'](_0x96819e),this['_addKnownRoot'](_0x96819e),_0x5eeaa9['batch']['addOperation'](_0x96819e),this['editor']['model']['applyOperation'](_0x96819e);});}['_addKnownRoot'](_0x2116fd){const _0x36cb17=this['_getAffectedRoot'](_0x2116fd);_0x36cb17&&this['_knownRootNames']['add'](_0x36cb17);}['_getAffectedRoot'](_0x302501){let _0x4334a1,_0x1f369b;switch(_0x302501['type']){case'insert':_0x4334a1=_0x302501['position']['root'];break;case'marker':if(_0x1f369b=_0x302501['newRange'],!_0x1f369b)return null;_0x4334a1=_0x1f369b['root'];break;case'addRootAttribute':_0x4334a1=_0x302501['root'];break;case'addRoot':_0x4334a1=_0x302501['affectedSelectable'];break;case'move':_0x4334a1=_0x302501['targetPosition']['root'];break;default:return null;}return _0x4334a1['rootName'];}['_updateServerHistory'](_0x19b7bb){_0x19b7bb['forEach'](_0x27fd6f=>{const _0x2919dd=_0x27fd6f['clone']();_0x2919dd['_authorId']=_0x27fd6f['_authorId'],_0x2919dd['_isInit']=!!_0x27fd6f['_isInit'],_0x2919dd['createdAt']=_0x27fd6f['createdAt'],_0x2919dd['baseVersion']+=this['_offset'],_0x27fd6f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x2919dd),this['serverHistory']['addOperation'](_0x2919dd);});}['_handleReconnectionError'](_0x5ac2f1){const _0x492e23=this['editor']['plugins']['get']('Notification'),_0x107cfa=this['editor']['locale'];_0x5ac2f1||(_0x5ac2f1=R(_0x107cfa,'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.')),_0x492e23['showWarning'](_0x5ac2f1,{'title':R(_0x107cfa,'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'](_0x33cbb5)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x33cbb5)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x1397e4){const _0x4f2dea=_0x1397e4['map'](_0x107bfd=>_0x107bfd['toJSON']());return this['_compressor']['compress'](_0x4f2dea);}['_decompressOperations'](_0x3e7034,_0x356244){return this['_compressor']['decompress'](_0x3e7034)['map']((_0xeb627e,_0x25f2fa)=>{const _0x3d1538='init'==_0x356244[_0x25f2fa]['type'];if('InsertOperation'==_0xeb627e['__className']){const _0x29a9fd=_0xeb627e['position']['root'];!this['_document']['getRoot'](_0x29a9fd)&&(this['_document']['createRoot']('$root',_0x29a9fd)['_isAttached']=!0x1);}const _0xe30dd9=_0x2ad745['fromJSON'](_0xeb627e,this['_document']);return _0xe30dd9['wasUndone']=_0xeb627e['wasUndone'],_0xe30dd9['_isInit']=_0x3d1538,_0xe30dd9['_authorId']=_0x3d1538?null:_0x356244[_0x25f2fa]['userId'],_0xe30dd9['_isDisconnection']='cs:removeUser'===_0x356244[_0x25f2fa]['type'],_0xe30dd9['createdAt']=_0x356244[_0x25f2fa]['createdAt'],_0xe30dd9;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2ebfd0=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2ebfd0&&_0x2ebfd0['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function D(_0x3c7fb1,_0x18e8f2){for(const _0x302761 of _0x3c7fb1)_0x302761['baseVersion']=_0x18e8f2++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0xf22001){this['_ignoredOperations']=_0xf22001,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xac1c69){let _0x5a3ac3=_0xac1c69['length'];for(;_0x5a3ac3--;){const _0x1283bb=_0xac1c69[_0x5a3ac3];if(!this['_ignoredOperations']['has'](_0x1283bb)){if(!this['_operationToId']['has'](_0x1283bb)){const _0x4f867d=_0x1bb2ae()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1283bb,_0x4f867d);}return this['_operationToId']['get'](_0x1283bb);}}}['setIdForTheLastOperation'](_0x2bcdf4,_0x1a4bef){if(!_0x1a4bef)return;let _0x9b5b5f=_0x2bcdf4['length'];for(;_0x9b5b5f--;){const _0x25688b=_0x2bcdf4[_0x9b5b5f];this['_ignoredOperations']['has'](_0x25688b)||this['_operationToId']['set'](_0x25688b,_0x1a4bef);}}}class a extends _0x17b805{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x102a7b{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x27047f)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x20df76];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57013f){super(_0x57013f),this['_services']=new Map();}async['init'](){const _0x46ee41=this['context'],_0x4935e4=_0x46ee41['plugins']['get']('CommentsRepository');if(_0x46ee41['plugins']['get'](n)['addToReconnectionStack'](this),_0x4935e4['adapter']={'addCommentThread':async({channelId:_0x592881,threadId:_0xefc483,comments:_0x4f08e6,resolvedAt:_0x362a3b,resolvedBy:_0x429bab,context:_0x10a1b8,attributes:_0x30b3f4})=>{const _0x45bb1b=await this['_getService'](_0x592881)['addCommentThread']({'commentThreadId':_0xefc483,'comments':_0x4f08e6['map'](_0x33d7b0=>function(_0x588107,_0x339f41,_0x37e9c7){return{'commentThreadId':_0x37e9c7,'commentId':_0x588107['commentId'],'userId':_0x588107['authorId'],'content':_0x588107['content'],'documentId':_0x339f41,'createdAt':_0x588107['createdAt'],'attributes':_0x588107['attributes']||{}};}(_0x33d7b0,_0x592881,_0xefc483)),'resolvedAt':_0x362a3b,'resolvedBy':_0x429bab,'context':_0x10a1b8,'attributes':_0x30b3f4})['catch'](lt);return{'threadId':_0x45bb1b['commentThreadId'],'comments':_0x45bb1b['comments']};},'getCommentThread':async({channelId:_0x146d4b,threadId:_0x3023da})=>{const _0x1e95ce=await this['_getService'](_0x146d4b)['getCommentThread'](_0x3023da)['catch'](q)['catch'](lt);return _0x1e95ce?_0x1e95ce['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1e95ce]),{'threadId':_0x1e95ce['commentThreadId'],'comments':_0x1e95ce['comments']['map'](z),'context':_0x1e95ce['context'],'resolvedAt':_0x1e95ce['resolvedAt'],'resolvedBy':_0x1e95ce['resolvedBy'],'attributes':_0x1e95ce['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x21b1df,threadId:_0x241179,context:_0x1f3f8e,unlinkedAt:_0x58b748,attributes:_0x539871})=>this['_getService'](_0x21b1df)['updateCommentThread']({'commentThreadId':_0x241179,'context':_0x1f3f8e,'attributes':_0x539871,'unlinkedAt':_0x58b748})['catch'](q)['catch'](lt),'resolveCommentThread':async({channelId:_0xb07627,threadId:_0x5eb095})=>{const _0x3b30d9=await this['_getService'](_0xb07627)['resolveCommentThread'](_0x5eb095)['catch'](q)['catch'](lt);return{'threadId':_0x3b30d9['commentThreadId'],'resolvedAt':_0x3b30d9['resolvedAt'],'resolvedBy':_0x3b30d9['resolvedBy']};},'reopenCommentThread':async({channelId:_0x25220c,threadId:_0x17f8d8})=>this['_getService'](_0x25220c)['reopenCommentThread'](_0x17f8d8)['catch'](q)['catch'](lt),'removeCommentThread':({channelId:_0x538107,threadId:_0x4da25b})=>this['_getService'](_0x538107)['removeCommentThread'](_0x4da25b)['catch'](q)['catch'](lt),'addComment':({channelId:_0x38a6e4,threadId:_0x203351,commentId:_0x3d1f98,content:_0x520e72,attributes:_0x1bf0ad})=>this['_getService'](_0x38a6e4)['addComment'](_0x203351,_0x3d1f98,_0x520e72,_0x1bf0ad)['catch'](lt),'updateComment':({channelId:_0x36664b,threadId:_0x5b1418,commentId:_0x291685,content:_0x2cbae9,attributes:_0x5d3ee7})=>this['_getService'](_0x36664b)['updateComment'](_0x5b1418,_0x291685,_0x2cbae9,_0x5d3ee7)['catch'](q)['catch'](lt),'removeComment':({channelId:_0xe962a4,threadId:_0x4772c5,commentId:_0x52a8e4})=>this['_getService'](_0xe962a4)['removeComment'](_0x4772c5,_0x52a8e4)['catch'](q)['catch'](lt)},_0x46ee41 instanceof _0x1c4fa0){const _0x191670=_0x46ee41['config']['get']('collaboration.channelId'),_0x2d7557=_0x46ee41['plugins']['get'](i);await this['_setUpService'](_0x191670);const _0x2d660b=await this['_services']['get'](_0x191670)['getConnectedSessions']();this['listenTo'](_0x2d7557,'sessionAdd:'+_0x191670,(_0x441620,{session:_0x2ebd43})=>{_0x2ebd43['id']===_0x2d7557['mySessionId']&&(_0x441620['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2ebd43['permissions'],_0x191670));}),_0x2d7557['register'](_0x191670,_0x2d660b);}}async['_setUpService'](_0x27d295){if(this['_services']['has'](_0x27d295))throw new _0x332ad6('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x27d295});const _0x158a1a=this['context']['plugins']['get']('CommentsRepository'),_0x28fc5c=new s['CommentsService'](_0x27d295);this['_services']['set'](_0x27d295,_0x28fc5c),this['listenTo'](_0x28fc5c,'commentThreadAdded',(_0x413b22,_0x5d2090)=>{const {commentThreadId:_0xc33d0a,documentId:_0xdce2fc,context:_0x2301d3,attributes:_0x2abaff,resolvedAt:_0x35a9c0,resolvedBy:_0x2b6031,comments:_0x16ac61}=_0x5d2090;_0x158a1a['getCommentThread'](_0xc33d0a)||_0x158a1a['addCommentThread']({'threadId':_0xc33d0a,'channelId':_0xdce2fc,'comments':_0x16ac61?_0x16ac61['map'](z):[],'context':_0x2301d3,'attributes':_0x2abaff,'resolvedAt':_0x35a9c0,'resolvedBy':_0x2b6031,'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadUpdated',(_0x3d4e57,{commentThreadId:_0x4e66f1,documentId:_0x6a779b,context:_0x5b4c33,unlinkedAt:_0x4fb9df,attributes:_0x1f1ff0})=>{_0x158a1a['getCommentThread'](_0x4e66f1)&&_0x158a1a['updateCommentThread']({'threadId':_0x4e66f1,'channelId':_0x6a779b,'context':_0x5b4c33,'unlinkedAt':_0x4fb9df,'attributes':_0x1f1ff0,'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadResolved',(_0x491adc,{commentThreadId:_0x5acbc3,resolvedBy:_0x1d6d38,resolvedAt:_0x53fe5b})=>{const _0x4cd54e=_0x158a1a['getCommentThread'](_0x5acbc3);_0x4cd54e&&_0x4cd54e['resolve']({'resolvedBy':_0x1d6d38,'resolvedAt':_0x53fe5b,'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadReopened',(_0xb427e9,{commentThreadId:_0x3469d7})=>{const _0x5c6336=_0x158a1a['getCommentThread'](_0x3469d7);_0x5c6336&&_0x5c6336['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadRemoved',(_0x5e10af,{commentThreadId:_0x15da98})=>{const _0x59c096=_0x158a1a['getCommentThread'](_0x15da98);_0x59c096&&_0x59c096['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentAdded',(_0x1e6a77,_0x3c2e2c)=>{const _0xbb6a1d=_0x3c2e2c['commentThreadId'],_0x44004a=_0x158a1a['getCommentThread'](_0xbb6a1d);_0x44004a&&_0x44004a['addComment']({...z(_0x3c2e2c),'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentUpdated',(_0x3c8f16,{commentThreadId:_0x27002e,commentId:_0x44f483,content:_0xdb2a27,attributes:_0x32c805})=>{const _0x4a9c0a=_0x158a1a['getCommentThread'](_0x27002e);if(_0x4a9c0a){const _0x1e5c4a=_0x4a9c0a['getComment'](_0x44f483);_0x1e5c4a&&_0x1e5c4a['update']({'content':_0xdb2a27,'attributes':_0x32c805,'isFromAdapter':!0x0});}}),this['listenTo'](_0x28fc5c,'commentRemoved',(_0x2efec8,{commentThreadId:_0x36c95f,commentId:_0x3df945})=>{const _0x2d8d0b=_0x158a1a['getCommentThread'](_0x36c95f);if(_0x2d8d0b){const _0x2bf37a=_0x2d8d0b['getComment'](_0x3df945);_0x2bf37a&&_0x2bf37a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x27d295);}['destroy'](){if(this['context']instanceof _0x1c4fa0){const _0x4b7de5=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4b7de5);}}['_terminateService'](_0x396fa6){if(!this['_services']['has'](_0x396fa6))throw new _0x332ad6('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x396fa6});this['_getService'](_0x396fa6)['disconnect'](),this['_services']['delete'](_0x396fa6);}async['reconnect'](){for(const _0x4e0f97 of this['_services']['keys']())await this['_connectService'](_0x4e0f97);if(this['context']instanceof _0x1c4fa0){const _0x8d2e64=this['context']['config']['get']('collaboration.channelId'),_0x44c8eb=this['context']['plugins']['get'](i);_0x44c8eb['unregister'](_0x8d2e64);const _0x27dbe5=await this['_services']['get'](_0x8d2e64)['getConnectedSessions']();_0x44c8eb['register'](_0x8d2e64,_0x27dbe5);}}async['_connectService'](_0x117d63){const {connection:_0x43eb9f}=this['context']['plugins']['get'](n),_0x4c06c3=this['context']['plugins']['get']('CommentsRepository'),_0x5b17a6=this['_services']['get'](_0x117d63),_0x5a942e=await _0x5b17a6['connect'](_0x43eb9f);await this['_fetchMissingUsersForThreads'](_0x5a942e);const _0xec13a9=new Set(Array['from'](_0x4c06c3['getCommentThreads']({'channelId':_0x117d63}),_0x310a4b=>_0x310a4b['id']));for(const _0x2a18d3 of _0x5a942e)_0x2a18d3['deletedAt']||_0xec13a9['delete'](_0x2a18d3['commentThreadId']);for(const _0x429c67 of _0xec13a9)_0x4c06c3['getCommentThread'](_0x429c67)['remove']({'isFromAdapter':!0x0});for(const _0x5371b5 of _0x5a942e){let _0x39c369=_0x4c06c3['getCommentThread'](_0x5371b5['commentThreadId']);const {commentThreadId:_0x670203,context:_0x2e00d3,attributes:_0x3d539f,resolvedBy:_0x1b0ce4,resolvedAt:_0x3bd762,unlinkedAt:_0x12c80d,deletedAt:_0x520c3c}=_0x5371b5;if(_0x520c3c)continue;_0x39c369||(_0x39c369=_0x4c06c3['addCommentThread']({'channelId':_0x117d63,'threadId':_0x670203,'context':_0x2e00d3,'attributes':_0x3d539f||{},'resolvedBy':_0x1b0ce4,'resolvedAt':_0x3bd762,'unlinkedAt':_0x12c80d,'isFromAdapter':!0x0}));const _0x1995de=new Set(Array['from'](_0x39c369['comments'],_0x5a53f0=>_0x5a53f0['id']));for(const _0xa3e88b of _0x5371b5['comments'])_0x1995de['delete'](_0xa3e88b['commentId']);for(const _0x502556 of _0x1995de)_0x39c369['getComment'](_0x502556)['remove']({'isFromAdapter':!0x0});for(const _0xa9d780 of _0x5371b5['comments']){const _0x36f38f=_0x39c369['getComment'](_0xa9d780['commentId']);_0x36f38f?_0x36f38f['content']!==_0xa9d780['content']&&_0x36f38f['update']({'content':_0xa9d780['content'],'isFromAdapter':!0x0}):_0x39c369['addComment'](Object['assign'](z(_0xa9d780),{'isFromAdapter':!0x0}));}}}['_getService'](_0x47717d){if(!this['_services']['has'](_0x47717d))throw new _0x332ad6('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x47717d});return this['_services']['get'](_0x47717d);}async['_fetchMissingUsersForThreads'](_0x548e6f){const _0x49b34b=this['context']['plugins']['get'](_0x20df76),{connection:_0x24ca09}=this['context']['plugins']['get'](n),_0x1e96ac=new Set();for(const {resolvedBy:_0x458add,comments:_0x2424f1}of _0x548e6f){_0x458add&&!_0x49b34b['getUser'](_0x458add)&&_0x1e96ac['add'](_0x458add);for(const {userId:_0xbc0df1}of _0x2424f1)_0x49b34b['getUser'](_0xbc0df1)||_0x1e96ac['add'](_0xbc0df1);}if(0x0===_0x1e96ac['size'])return;const _0x125a2d=await ht['getMany'](_0x24ca09,Array['from'](_0x1e96ac));for(const _0x21aded of _0x125a2d)_0x49b34b['getUser'](_0x21aded['id'])||_0x49b34b['addUser'](_0x21aded);}}async function q(_0xc04ed6){if('404'!==_0xc04ed6['code'])throw _0xc04ed6;}function lt(_0x1ea56b){if((_0x494d04=_0x1ea56b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x494d04['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x494d04['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x494d04;throw _0x1ea56b;}function z(_0x153a72){return{'threadId':_0x153a72['commentThreadId'],'commentId':_0x153a72['commentId'],'content':_0x153a72['content'],'createdAt':_0x153a72['createdAt'],'authorId':_0x153a72['userId'],'attributes':_0x153a72['attributes']||{}};}class m extends _0x17b805{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe5bdca){super(_0xe5bdca);const _0x4c57de=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4c57de);}['init'](){const _0x197b92=this['editor']['plugins']['get'](n),_0x1ff3a4=this['editor']['plugins']['get']('TrackChangesEditing');return _0x1ff3a4['adapter']={'getSuggestion':async _0x33281e=>{await this['_waitForServiceReady']();const _0x48e7c2=await this['_trackChangesService']['get'](_0x33281e)['catch'](N);return await this['_fetchMissingUsersForThreads']([_0x48e7c2]),_0x48e7c2;},'addSuggestion':async({id:_0x4758cf,type:_0x5032c8,data:_0x197417,originalSuggestionId:_0x4d703d,attributes:_0x27c0d2})=>{await this['_waitForServiceReady']();const _0x3a3048={'id':_0x4758cf,'type':_0x5032c8,'data':_0x197417,'originalSuggestionId':_0x4d703d,'attributes':_0x27c0d2},_0x1e8ead=await this['_trackChangesService']['add'](_0x4758cf,_0x5032c8,_0x197417,_0x4d703d,_0x27c0d2)['catch'](_0x2fddb2=>{if(dt(_0x2fddb2))return new Promise(_0x230a28=>{this['_bufferedRequests']['set'](_0x4758cf,{'resolve':_0x230a28,'suggestionData':_0x3a3048});});throw _0x2fddb2;});return this['_bufferedRequests']['delete'](_0x4758cf),_0x1e8ead;},'updateSuggestion':async(_0x579fa2,_0x338142)=>{if(await this['_waitForServiceReady'](),'open'!==_0x338142['state'])return this['_trackChangesService']['update'](_0x579fa2,_0x338142)['catch'](N);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x21dde4,_0x2581f1)=>{_0x1ff3a4['hasSuggestion'](_0x2581f1['id'])&&(_0x1ff3a4['getSuggestion'](_0x2581f1['id'])['attributes']=_0x2581f1['attributes']);}),this['_trackChangesService']['connect'](_0x197b92['connection'])['then'](_0x565394=>(_0x197b92['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x565394)['then'](()=>{for(const _0x3d3140 of _0x565394){_0x1ff3a4['addSuggestionData'](_0x3d3140)['_saved']=!0x0;}})));}async['reconnect'](){const _0x4bfd45=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x53afb3}=this['editor']['plugins']['get'](n),_0x4e1ac6=await this['_trackChangesService']['connect'](_0x53afb3);await this['_fetchMissingUsersForThreads'](_0x4e1ac6);for(const {suggestionData:_0x30372d,resolve:_0x3f1073}of this['_bufferedRequests']['values']()){let _0x263193=_0x4e1ac6['find'](_0xe0500a=>_0xe0500a['id']===_0x30372d['id']);_0x263193||(_0x263193=await this['_trackChangesService']['add'](_0x30372d['id'],_0x30372d['type'],_0x30372d['data'],_0x30372d['originalSuggestionId'])),_0x3f1073(_0x263193);}for(const _0x1de2c2 of _0x4e1ac6)_0x4bfd45['hasSuggestion'](_0x1de2c2['id'])||_0x4bfd45['addSuggestionData'](_0x1de2c2);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x17dceb=>{this['listenTo'](this['_trackChangesService'],'connected',_0x57a7e1=>{_0x57a7e1['off'](),_0x17dceb();});});}async['_fetchMissingUsersForThreads'](_0x2ecfb3){const _0x378056=this['editor']['plugins']['get'](_0x20df76),{connection:_0x3f98b1}=this['editor']['plugins']['get'](n),_0x53add1=new Set();for(const {authorId:_0x35724e}of _0x2ecfb3)_0x378056['getUser'](_0x35724e)||_0x53add1['add'](_0x35724e);if(0x0===_0x53add1['size'])return;const _0x4b0e58=await ht['getMany'](_0x3f98b1,Array['from'](_0x53add1));for(const _0xeb74ae of _0x4b0e58)_0x378056['getUser'](_0xeb74ae['id'])||_0x378056['addUser'](_0xeb74ae);}}function N(_0x8255cf){if(dt(_0x8255cf))return new Promise(()=>{});throw _0x8255cf;}function dt(_0x36b0dd){return _0x36b0dd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x36b0dd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x17b805{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 _0x2f4837=this['editor']['plugins']['get'](n),_0x25c88c=this['editor']['plugins']['get']('CommentsEditing'),_0x388d80=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2f4837,'change:state',(_0x410192,_0x3a8818,_0x2a6264)=>{_0x25c88c['isThreadsLoadingPaused']='connected'!==_0x2a6264;});}),this['listenTo'](_0x2f4837,'change:state',(_0x2a905a,_0x5b851e,_0x2f8f5a)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x2f8f5a);}),_0x388d80['_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 _0x17b805{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 _0x17b805{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x20df76];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45df89){super(_0x45df89);const _0x964d43=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x964d43);}async['init'](){const _0x49aa9b=this['editor']['plugins']['get'](l),_0x1b1145=_0x49aa9b['serverHistory'],_0x3a7253=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x1b1145,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x49aa9b['sessionId']});const _0x50d73d=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x448a43=await tt['isBundleUploaded'](_0x3a7253['connection'],_0x50d73d);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x679a32})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x679a32)),'updateRevisions':async _0x225d12=>{await this['_waitForServiceReady']();const _0x5e59ae=this['_revisionTracker']['currentRevision'];if(_0x448a43&&0x1===_0x225d12['length']&&_0x225d12[0x0]['id']===_0x5e59ae['id'])return _0x225d12;for(const _0x2c10fa of _0x225d12)_0x2c10fa['id']===_0x5e59ae['id']&&(_0x2c10fa['isEmptyCurrent']=_0x2c10fa['fromVersion']===_0x2c10fa['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x225d12,this['_lastRequestId'])['then'](_0x1fae17=>(this['_lastRequestId']=_0x1fae17,_0x225d12))['catch'](_0x5eb71b=>{if(st(_0x5eb71b)||'400'===_0x5eb71b['code']&&void 0x0!==_0x5eb71b['data']['wrongRequestId']){for(const _0x146456 of _0x225d12){!this['_revisionTracker']['repository']['getRevision'](_0x146456['id'])||this['_revisionTracker']['_bufferUpdate'](_0x146456['id'],_0x146456,!0x1);}if(st(_0x5eb71b))throw _0x5eb71b;return _0x225d12;}throw _0x5eb71b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3327e9,{revisionsData:_0x24ffc1,requestId:_0xab65dc})=>{Math['max'](..._0x24ffc1['map'](_0x17c8e2=>_0x17c8e2['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x24ffc1,_0xab65dc);}):this['_handleRevisionsUpdate'](_0x24ffc1,_0xab65dc);});const {revisions:_0x5b13cc,requestId:_0x922f43}=await this['_revisionHistoryService']['connect'](_0x3a7253['connection']);_0x3a7253['addToReconnectionStack'](this),this['_lastRequestId']=_0x922f43,await this['_fetchMissingUsers'](_0x5b13cc);for(const _0x3fbbeb of _0x5b13cc)this['_revisionTracker']['addRevisionData'](_0x3fbbeb);this['listenTo'](_0x49aa9b,'change:_isConnected',(_0x329630,_0x5e9507,_0x4a42a5)=>{_0x4a42a5&&(this['_oldOffset']=_0x49aa9b['_offset'],_0x329630['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3a7253,'state',_0x3bd9e5=>_0x3bd9e5===_0x42ae72['CONNECTED']);}async['reconnect'](){const _0x3ab232=this['editor']['plugins']['get'](n),_0x5899f6=this['editor']['plugins']['get'](l),_0x1b2e19=async()=>{const _0x58f975=this['_revisionTracker']['currentRevision'],_0x5b627f=_0x58f975['id'],_0x332b21=_0x5b627f!==_0x5899f6['sessionId'];if(_0x332b21){const _0x515330=_0x5899f6['_offset']-this['_oldOffset'],_0x595845=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x58f975['toVersion']+_0x515330!==_0x595845){const _0x22f5fc=_0x58f975['fromVersion']+_0x515330,_0x15d1a5=this['editor']['plugins']['get'](_0x20df76),_0x2fac8f=this['_revisionTracker']['buildRevisionData']({'revision':_0x58f975,'from':_0x22f5fc,'to':_0x595845});_0x2fac8f['id']=_0x58f975['id'];const _0x49ef4d=_0x2fac8f['authorsIds']['map'](_0x28717e=>_0x15d1a5['getUser'](_0x28717e));_0x58f975['_update']({..._0x2fac8f,'authors':_0x49ef4d},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x58f975['id'],_0x2fac8f,!0x0);}this['_revisionTracker']['_startingVersion']=_0x595845,(_0x58f975['toVersion']===_0x58f975['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5b627f)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5b627f),this['_revisionTracker']['_createCurrentRevision'](_0x595845));}const {revisions:_0x1d00ec,requestId:_0x130075}=await this['_revisionHistoryService']['reconnect'](_0x3ab232['connection'],this['_lastRequestId']);_0x332b21&&_0x1d00ec['length']>0x0?_0x5899f6['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x1d00ec),this['_handleRevisionsUpdate'](_0x1d00ec,_0x130075),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5899f6['_isConnected']?_0x1b2e19():new Promise((_0x498907,_0x40a1c2)=>{_0x5899f6['once']('change:_isConnected',()=>{_0x1b2e19()['then'](_0x498907)['catch'](_0x40a1c2);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0xef82e2=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5e0cba=>{_0x5e0cba['off'](),_0xef82e2();});});}['_getLatestVersionFromServerOperations'](){const _0x366066=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1aa0ac of _0x366066)if('marker'!==_0x1aa0ac['type']||_0x1aa0ac['affectsData'])return _0x1aa0ac['baseVersion']+0x1;}['_getLatestVersion'](){const _0x10c8d8=this['editor']['plugins']['get'](l);return new Promise(_0x18b4cc=>{_0x10c8d8['_isPendingUpdate']?_0x10c8d8['once']('change:_isPendingUpdate',()=>{_0x18b4cc(this['_getLatestVersionFromServerOperations']());}):_0x18b4cc(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x2684ea,_0xb0a3fd){const _0x6b1711=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xb0a3fd;for(const _0x555599 of _0x2684ea){const _0x36be7a=_0x6b1711['getRevision'](_0x555599['id']);if(_0x36be7a){if((_0x555599['fromVersion']||_0x555599['toVersion'])&&(_0x555599['diffData']=null),_0x36be7a===this['_revisionTracker']['currentRevision']){const _0x47da26=Math['max'](_0x36be7a['toVersion'],_0x555599['toVersion']),_0x3c776d=Math['max'](_0x36be7a['fromVersion'],_0x555599['fromVersion']);let _0x2b6da2;_0x36be7a['toVersion']===_0x555599['toVersion']&&_0x36be7a['fromVersion']===_0x555599['fromVersion']?(_0x2b6da2=!0x0,this['_preventResendingRevisionData'](_0x555599)):_0x555599['toVersion']===_0x47da26&&_0x555599['fromVersion']===_0x3c776d?_0x2b6da2=!0x1:(_0x36be7a['toVersion']===_0x47da26&&_0x36be7a['fromVersion']===_0x3c776d||this['_fixRevision']({'revision':_0x36be7a,'from':_0x3c776d,'to':_0x47da26}),_0x2b6da2=!0x0),_0x2b6da2&&(delete _0x555599['fromVersion'],delete _0x555599['toVersion'],delete _0x555599['diffData'],delete _0x555599['createdAt'],delete _0x555599['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x555599),this['_preventResendingRevisionData'](_0x555599);}else this['_revisionTracker']['addRevisionData'](_0x555599);}const _0x36cee0=_0x6b1711['getRevisions']();_0x36cee0['reverse']();for(let _0x1cde44=0x0;_0x1cde44<_0x36cee0['length']-0x1;_0x1cde44++){const _0x1daa13=_0x36cee0[_0x1cde44],_0x27c61b=_0x36cee0[_0x1cde44+0x1];if(_0x1daa13['fromVersion']<_0x27c61b['toVersion']){const _0x5d773f=_0x27c61b['toVersion'],_0xf593e9=Math['max'](_0x5d773f,_0x1daa13['toVersion']);this['_fixRevision']({'revision':_0x1daa13,'from':_0x5d773f,'to':_0xf593e9});}}}['_fixRevision']({revision:_0x5256b0,from:_0x3d258b,to:_0x3c3be5}={}){const _0x60efe3=this['editor']['plugins']['get'](_0x20df76),_0x556d2c=this['_revisionTracker']['buildRevisionData']({'revision':_0x5256b0,'from':_0x3d258b,'to':_0x3c3be5});_0x556d2c['authors']=_0x556d2c['authorsIds']['map'](_0x2b106d=>_0x60efe3['getUser'](_0x2b106d)),_0x5256b0['_update'](_0x556d2c);}['_preventResendingRevisionData'](_0x2881b7){const _0x232b7f={};_0x232b7f['id']=_0x2881b7['id'];for(const _0x1ab9c9 of Object['keys'](_0x2881b7))'id'!==_0x1ab9c9&&(_0x232b7f[_0x1ab9c9]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x232b7f['id'],_0x232b7f,!0x0);}async['_fetchMissingUsers'](_0x2cf81c){const _0x30ede7=this['editor']['plugins']['get'](_0x20df76),{connection:_0x457d10}=this['editor']['plugins']['get'](n),_0x53208d=new Set();for(const _0x26964e of _0x2cf81c){for(const _0x401033 of _0x26964e['authorsIds'])_0x233060(_0x401033);_0x26964e['creatorId']&&_0x233060(_0x26964e['creatorId']);}if(0x0===_0x53208d['size'])return;const _0x45381a=await ht['getMany'](_0x457d10,Array['from'](_0x53208d));for(const _0x205a54 of _0x45381a)_0x30ede7['getUser'](_0x205a54['id'])||_0x30ede7['addUser'](_0x205a54);function _0x233060(_0x3c3063){_0x30ede7['getUser'](_0x3c3063)||_0x53208d['add'](_0x3c3063);}}}function st(_0x577cfa){return _0x577cfa['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x577cfa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x577cfa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x17b805{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class K extends _0x561787{['_collapseAt'];constructor(_0x2fc3e4,_0x242eee=0x6){super(_0x2fc3e4);const _0x10a42d=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x242eee,this['bind']('isHidden')['to'](this,'usersCount',_0x5dbe5f=>_0x5dbe5f<_0x242eee),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x10a42d['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':_0x10a42d['to']('usersCount',_0x2a5a22=>'+'+(_0x2a5a22-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x561787{['items'];['keystrokes'];constructor(_0x4d681c){super(_0x4d681c);const _0x21c05e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5f3935(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x21c05e['if']('hasPopup'),'aria-expanded':_0x21c05e['to']('isExpanded',_0x25ece7=>this['hasPopup']&&String(_0x25ece7)),'aria-label':_0x21c05e['to']('hasPopup',_0x512870=>R(_0x4d681c,_0x512870?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x21c05e['to']('hasPopup',_0xab87d9=>!!_0xab87d9&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x21c05e['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x21c05e['to'](_0x22b08e=>{const _0x37fbc0=_0x22b08e,_0x56c4d9=document['querySelector']('.ck-presence-list__dropdown-list'),_0x3d9dfd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x56c4d9?.['contains'](_0x37fbc0['relatedTarget'])||_0x3d9dfd?.['contains'](_0x37fbc0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2ad03c,_0x324dc5,_0x12f9db)=>{this['element']&&(_0x12f9db?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 J extends _0x561787{['counterView'];['inlineListView'];constructor(_0x4c1c5f,_0x11ad05=0x6){super(_0x4c1c5f);const _0x3b7806=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new K(this['locale'],_0x11ad05),this['inlineListView']=new is(_0x4c1c5f),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3cdd38 of this['inlineListView']['items'])_0x3cdd38['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',_0x3b7806['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class Q extends _0x561787{['listWrapperView'];constructor(_0x3f96ea,_0x28bca5){super(_0x3f96ea);const _0x12d38f=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3f96ea,_0x28bca5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0x3f96ea,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x12d38f['to'](_0x184177=>{const _0x2573b6=_0x184177,_0x5f002b=document['querySelector']('.ck-presence-list__list'),_0x8a9e57=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5f002b?.['contains'](_0x2573b6['relatedTarget'])||_0x8a9e57?.['contains'](_0x2573b6['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x556b7c{constructor(_0x4ca857,_0x52185e){super(_0x4ca857);const _0x785971=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x52185e?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x785971['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x785971['to']('role'),'aria-label':_0x785971['to']('ariaLabel'),'aria-labelledby':_0x785971['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x118f19['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x28c221=this['element'];_0x28c221&&(this['_isScrollable']=Math['max'](_0x28c221['scrollHeight'],_0x28c221['clientHeight'])>0.8*window['innerHeight']);}}class X extends rt{['userView'];constructor(_0x1da916,_0x627c7a,_0xeaa614){super(_0x1da916);const _0x3fc5c2=this['bindTemplate'];this['userView']=new ct(_0x1da916,_0x627c7a);const _0xd7328a={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x627c7a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x627c7a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x627c7a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xeaa614&&(_0xd7328a['tag']='button',_0xd7328a['on']={'click':_0x3fc5c2['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xd7328a);}['focus'](){this['element']['focus']();}}class Y extends _0x561787{['userView'];['markerView'];constructor(_0x35c53a,_0x18dd86,_0x47c62b){super(_0x35c53a);const _0x50ae52=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x35c53a,_0x18dd86),this['markerView']=new MarkerView(_0x35c53a,_0x18dd86);const _0xbcfec5=new ot(_0x35c53a);_0xbcfec5['template']['tag']='span',_0xbcfec5['text']=_0x18dd86['name'];const _0x519a43={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x50ae52['to']('isFocusable',_0x500e36=>!!_0x500e36&&0x0),'aria-labelledby':_0xbcfec5['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x50ae52['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x50ae52['to']('hasTooltip',_0x130df0=>!_0x130df0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0xbcfec5]};_0x47c62b&&(_0x519a43['tag']='button',_0x519a43['on']={'click':_0x50ae52['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x519a43);}}class MarkerView extends _0x561787{constructor(_0x637e74,_0x1bda55){super(_0x637e74),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1bda55['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const Z={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x102a7b{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51c515){super(_0x51c515),this['context']['config']['define']('presenceList',Z);const _0x22f68f=_0x51c515['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x22f68f)throw new _0x332ad6('presencelist-collapseat-invalid-format',this);if(_0x22f68f<0x1)throw new _0x332ad6('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x8f9c91(),this['balloonPanelView']=new _0x34bd64(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x640ebc of this['_allConnectedUsers'])this['_handleUserAdd'](_0x640ebc);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5768e5,_0x3cf5b0)=>{this['_handleUserAdd'](_0x3cf5b0);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x487ab2,_0x46ddaa)=>{this['_handleUserRemove'](_0x46ddaa);});}['_createView'](){const _0xf4dac0=this['context'],_0x847505=new J(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x44dec8=this['balloonPanelView'];if(!_0x544931(_0xf4dac0['config']['get']('presenceList.container')))throw new _0x332ad6('presencelist-missing-container',this);return _0x847505['counterView']['bind']('usersCount')['to'](this),_0x847505['bind']('isCollapsed')['to'](this,'usersCount',_0x2a9803=>{const {collapseAt:_0x46ba02}=_0xf4dac0['config']['get']('presenceList'),_0x497b18=_0x2a9803>=_0x46ba02;if(_0x497b18&&!_0x847505['inlineListView']['items']['find'](_0x2dbd57=>_0x2dbd57 instanceof K)){const _0x53a1b8=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x53a1b8&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x847505['inlineListView']['items']['add'](_0x847505['counterView']);}return _0x497b18||this['hideDropdown'](),_0x497b18;}),_0x847505['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x588cfe=>{const _0x1fb409=_0xf4dac0['config']['get']('presenceList'),_0x18b0f4=new Y(_0xf4dac0['locale'],_0x588cfe,!!_0x1fb409['onClick']);return _0x18b0f4['bind']('hasTooltip')['to'](_0x847505,'isCollapsed',_0x20127e=>!_0x20127e),_0x18b0f4['bind']('isFocusable')['to'](_0x847505,'isCollapsed',_0x4b419b=>!_0x4b419b),_0x1fb409['onClick']&&this['listenTo'](_0x18b0f4,'execute',()=>{this['view']['isCollapsed']||_0x1fb409['onClick'](_0x588cfe,_0x18b0f4['element']);}),_0x18b0f4;}),this['listenTo'](_0x847505['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x847505['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x847505['inlineListView']['keystrokes']['set']('Enter',(_0x85e4ab,_0x289f0b)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x289f0b());}),_0x847505['render'](),_0x44dec8['render'](),_0x3b1e31({'emitter':_0x847505,'activator':()=>_0x44dec8['isVisible'],'contextElements':[_0x44dec8['element'],_0x847505['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xf4dac0['config']['get']('presenceList.container')['appendChild'](_0x847505['element']),this['_bodyCollection']=new _0x402400(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x847505;}['_handleUserAdd'](_0x1d65cf){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1d65cf['isMe'])return;const _0x5c0e59=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x5c0e59-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x14a363=_0x1d65cf['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1d65cf,_0x14a363);}['_handleUserRemove'](_0x22020c){this['usersCount']--;const {collapseAt:_0x7dde5}=this['context']['config']['get']('presenceList'),_0x29c54f=this['usersCount']>=_0x7dde5;if(this['currentDisplayedUsers']['get'](_0x22020c['id']))this['currentDisplayedUsers']['remove'](_0x22020c['id']);else{if(_0x29c54f&&this['currentDisplayedUsers']['length']+0x1===_0x7dde5-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x29c54f?0x1:0x0)<this['usersCount']){for(const _0xd6e9e8 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0xd6e9e8['id'])&&(this['currentDisplayedUsers']['add'](_0xd6e9e8,Math['min'](this['currentDisplayedUsers']['length']-(_0x29c54f?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x29c54f?0x1:0x0)===_0x7dde5-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x47642d=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Q(this['context']['locale'],!!_0x47642d['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x14118e}=this['presenceDropdownView'];_0x14118e['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x1a72f7=>{if(!_0x47642d['displayMe']&&_0x1a72f7['isMe'])return null;const _0x15ca49=new X(this['context']['locale'],_0x1a72f7,!!_0x47642d['onClick']);return _0x47642d['onClick']&&this['listenTo'](_0x15ca49,'execute',()=>{_0x47642d['onClick'](_0x1a72f7,_0x15ca49['element']);}),_0x15ca49;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x14118e['focus'](),_0x14118e['checkIfScrollable']();const _0x3151ae=(_0x28311b,_0x7301d9)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x7301d9();};_0x14118e['keystrokes']['set']('Esc',_0x3151ae),_0x14118e['keystrokes']['set']('Shift+Tab',_0x3151ae),_0x14118e['keystrokes']['set']('Tab',(_0x1a5198,_0x753df4)=>{!function(_0x2263c1){const _0x325a77=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x17f786=>_0x17f786+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x8eeffe=[...document['body']['querySelectorAll'](_0x325a77)]['filter'](_0x418849=>_0x418849===document['activeElement']||_0x418849['offsetWidth']+_0x418849['offsetHeight']>0x0)['sort']((_0x36f0fd,_0x5c034a)=>(_0x36f0fd['tabIndex']||0x0)-(_0x5c034a['tabIndex']||0x0)),_0x5c835f=_0x8eeffe['indexOf'](_0x2263c1),_0x48b876=_0x8eeffe[(_0x5c835f+0x1)%_0x8eeffe['length']];_0x48b876&&_0x48b876['focus']();}(this['view']['element']),this['hideDropdown'](),_0x753df4();}),_0x14118e['focusTracker']['add'](this['view']['element']),_0x14118e['focusTracker']['on']('change:isFocused',(_0x258f05,_0x5b8b08,_0x4b9b21)=>{_0x4b9b21||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 _0x102a7b{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':_0x11150d=>0x1!=_0x11150d}};
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':_0x48fe99=>0x1!=_0x48fe99}};