@ckeditor/ckeditor5-real-time-collaboration 47.7.0-alpha.2 → 47.7.0-alpha.4

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 _0xcfca57,Plugin as _0x51e259,PendingActions as _0x1ae22e,Context as _0x3caf40}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x13a0a9,CKEditorError as _0x1ad561,Collection as _0xa42536,global as _0x221dd7,version as nt,uid as _0x5511b8,KeystrokeHandler as _0x17f45a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x167205,View as _0x542b5b,ListView as _0x520492,ListItemView as et,LabelView as it,BalloonPanelView as _0x3fcd28,clickOutsideHandler as _0x1ed94d,BodyCollection as _0x388128}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x350b70,History as _0x32383e,NoOperation as _0x4a7e8b,InsertOperation as _0x24f0ec,MarkerOperation as _0x24bac5,RootAttributeOperation as _0x4e97ca,transformOperationSets as _0x59cf95,OperationFactory as _0x5b3bb9}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x32a08a,CollaborativeEditingService as _0x281104,User as ct,CommentsService as _0x4fbe1e,TrackChangesService as tt,RevisionHistoryService as _0x1d98d3,EditorService as _0xa0c2f8}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x566890,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x548b13}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x20cc7f}from'es-toolkit/compat';class n extends _0xcfca57{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x167205];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x56f9e7){super(_0x56f9e7),this['set']('state',_0x32a08a['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x13a0a9())();}['init'](){const _0xe42136=this['context'],_0x521f35=_0xe42136['plugins']['get']('CloudServices'),_0xff3e58=_0xe42136['plugins']['get'](_0x167205);if(!_0x521f35['token'])throw new _0x1ad561('websocketgateway-missing-token',this);if(!_0x521f35['webSocketUrl'])throw new _0x1ad561('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'](_0x521f35['token'],_0x521f35['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x1f3b95=>{if(this['connection']=_0x1f3b95,this['bind']('state')['to'](_0x1f3b95,'state',this,'_isBrowserOffline',(_0x78e139,_0x332d5a)=>('connected'!==_0x78e139&&(this['_shouldPluginsReconnect']=!0x0),_0x332d5a||_0x78e139!==_0x32a08a['CONNECTED']?_0x32a08a['DISCONNECTED']:this['state']==_0x32a08a['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x32a08a['CONNECTING']):_0x32a08a['CONNECTED'])),this['connection']['on']('error',(_0x3fdd7a,_0x2d49d5)=>{if('limitExceeded'!==_0x2d49d5['code'])throw console['error'](_0x2d49d5),new _0x1ad561('cloudservices-init',null,{'originalError':_0x2d49d5});_0xff3e58['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'});}),!_0x1f3b95['me'])return new Promise(_0x554a16=>_0x1f3b95['on']('change:me',_0x554a16));})['catch'](_0x329f43=>{throw console['error'](_0x329f43),new _0x1ad561('cloudservices-init',null,{'originalError':_0x329f43});});}['addToReconnectionStack'](_0x1c7887){if('function'!=typeof _0x1c7887['reconnect'])throw new _0x1ad561('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1c7887))throw new _0x1ad561('websocketgateway-plugin-already-registered',this,{'name':_0x1c7887['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1c7887);}['removeFromReconnectionStack'](_0x55726e){this['_reconnectionStack']['delete'](_0x55726e);}['isInReconnectionStack'](_0x5539ea){return this['_reconnectionStack']['has'](_0x5539ea);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x806f39=>_0x806f39['reconnect']())))['then'](()=>this['state']=_0x32a08a['CONNECTED'])['catch'](_0x514627=>{throw console['error'](_0x514627),new _0x1ad561('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x32a08a['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0xcfca57{['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,_0x566890];}constructor(_0x25f21b){super(_0x25f21b),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0xa42536(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x566890);}['init'](){const _0x54fa09=this['context']['plugins']['get'](n);this['listenTo'](_0x54fa09,'change:state',(_0x36e7e3,_0x531ad3,_0x14d7cf)=>{if('connected'!==_0x14d7cf)this['channelSessions']['forEach'](_0x5930e4=>_0x5930e4['clear']()),this['channelConnectedUsers']['forEach'](_0x3bbb8c=>_0x3bbb8c['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3a522d,_0x56c9ce]of this['_registeredSessions'])for(const _0x2b21d7 of _0x56c9ce)this['_handleSessionAdd'](_0x3a522d,_0x2b21d7);}}),this['_createUser'](_0x54fa09['connection']['me'],!0x0);}['register'](_0x19b4df,_0x5e8555){if(this['_registeredSessions']['has'](_0x19b4df))throw new _0x1ad561('sessions-register-already-registered',null,{'channelId':_0x19b4df});this['_registeredSessions']['set'](_0x19b4df,_0x5e8555),this['channelSessions']['set'](_0x19b4df,new _0xa42536()),this['channelConnectedUsers']['set'](_0x19b4df,new _0xa42536()),this['listenTo'](_0x5e8555,'add',(_0x2e9aaa,_0x115d99)=>this['_handleSessionAdd'](_0x19b4df,_0x115d99)),this['listenTo'](_0x5e8555,'remove',(_0x3e77a,_0x468e54)=>this['_handleSessionRemove'](_0x19b4df,_0x468e54));for(const _0x372b49 of _0x5e8555)this['_handleSessionAdd'](_0x19b4df,_0x372b49);}['unregister'](_0x2aab0d){if(!this['_registeredSessions']['has'](_0x2aab0d))throw new _0x1ad561('sessions-unregister-not-exist',null,{'channelId':_0x2aab0d});const _0x5c4b62=this['_registeredSessions']['get'](_0x2aab0d);this['stopListening'](_0x5c4b62);for(const _0x47bb80 of _0x5c4b62)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x2aab0d,_0x47bb80);this['_registeredSessions']['delete'](_0x2aab0d),this['channelSessions']['delete'](_0x2aab0d),this['channelConnectedUsers']['delete'](_0x2aab0d);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x5628ed){for(const _0x4f8c43 of this['channelSessions']['values']())for(const _0x1ee5ca of _0x4f8c43)if(_0x1ee5ca['id']===_0x5628ed)return _0x1ee5ca['user'];}['getUserSessions'](_0x2ebd6a,_0x1f262d){const _0x1db33f=_0x1f262d?[this['channelSessions']['get'](_0x1f262d)]:this['channelSessions']['values'](),_0xf30eac=new Set();for(const _0x2e64cf of _0x1db33f)for(const _0x5c5eaf of _0x2e64cf)_0x5c5eaf['user']['id']===_0x2ebd6a['id']&&_0xf30eac['add'](_0x5c5eaf['id']);return _0xf30eac;}['getUserRole'](_0x223fa7){for(const _0x3e069b of this['channelSessions']['values']())for(const _0x149be8 of _0x3e069b)if(_0x149be8['user']===_0x223fa7)return _0x149be8['role'];}['_handleSessionAdd'](_0x44694e,_0x5efabd){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x26aa36=_0x5efabd['user'],_0x1656cb=this['_users']['getUser'](_0x26aa36['id'])||this['_createUser'](_0x26aa36),_0x4a0a62=Object['assign']({},_0x5efabd,{'user':_0x1656cb});if(this['channelSessions']['get'](_0x44694e)['add'](_0x4a0a62),!_0x26aa36['hiddenInPresenceList']){const _0xbe9c47=this['channelConnectedUsers']['get'](_0x44694e);_0xbe9c47['has'](_0x1656cb['id'])||_0xbe9c47['add'](_0x1656cb),this['allConnectedUsers']['has'](_0x1656cb['id'])||_0x26aa36['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x1656cb,_0x1656cb['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x44694e,{'channelId':_0x44694e,'session':_0x4a0a62});}['_handleSessionRemove'](_0x4051c4,_0x1ccc4b){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1a6fca=this['channelConnectedUsers']['get'](_0x4051c4),_0x295cf5=_0x1ccc4b['user'];_0x295cf5['id']&&(this['channelSessions']['get'](_0x4051c4)['remove'](_0x1ccc4b['id']),_0x1a6fca['has'](_0x295cf5['id'])&&!this['getUserSessions'](_0x295cf5,_0x4051c4)['size']&&_0x1a6fca['remove'](_0x295cf5['id']),this['allConnectedUsers']['get'](_0x295cf5['id'])&&!this['getUserSessions'](_0x295cf5)['size']&&this['allConnectedUsers']['remove'](_0x295cf5['id']));}['_createUser'](_0x8969a5,_0x2871bc){const _0x1a4c82=this['_users']['addUser'](_0x8969a5);return _0x2871bc&&this['_users']['defineMe'](_0x8969a5['id']),_0x1a4c82['orderNumber']=this['_uniqueUsersCount']++,_0x1a4c82;}}class G extends _0x51e259{['_domEmitter']=new(_0x13a0a9())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1f023f=this['editor'],_0x3ed216=_0x1f023f['plugins']['get'](i);_0x1f023f['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x17ec6d,{writer:_0x20b3a2})=>function(_0x55edec,_0xbc4b9c,_0x3b1a43,_0x4f1865){const _0x43fd38=_0x55edec['markerName']['split'](':')[0x2],_0x4d256a=_0x3b1a43['getUserBySessionId'](_0x43fd38);if(!_0x4d256a||_0x43fd38===_0x3b1a43['mySessionId'])return;if(!_0x4f1865['model']['schema']['checkChild'](_0x55edec['markerRange']['start'],'$text'))return;const _0x3081d2={'class':'ck-user__marker\x20'+_0x4d256a['color']['getMarkerClass'](),'data-name':_0x4d256a['name'],'data-session-id':_0x43fd38},_0x1347be=_0x4f1865['model']['markers']['get'](_0x55edec['markerName']),_0x405f2f=_0x1347be['getStart'](),_0x314fe4=_0x405f2f['nodeAfter'],_0x220554=_0x4f1865['model']['schema'];if(_0x314fe4&&_0x220554['isObject'](_0x314fe4)&&_0x220554['isInline'](_0x314fe4)&&!_0x4f1865['model']['markers']['get']('user:range:'+_0x43fd38)['getRange']()['isCollapsed'])return;const _0x4f8161=_0x405f2f['parent'];return _0x4f1865['model']['schema']['isLimit'](_0x4f8161)&&!_0x4f1865['model']['hasContent'](_0x4f8161)&&(_0x3081d2['contenteditable']=!0x1),function(_0x241d43,_0x5d4077,_0x18ee77){const _0x1ac34e=_0x241d43['createUIElement']('span',_0x5d4077);return _0x241d43['setCustomProperty']('userPositionMarker',!0x0,_0x1ac34e),_0x1ac34e['render']=function(_0x2c7f44){const _0x15ef6d=this['toDomElement'](_0x2c7f44),_0x36d911=document['createElement']('span');return _0x36d911['classList']['add']('ck-user__marker-tooltip'),_0x36d911['setAttribute']('contenteditable','false'),_0x36d911['setAttribute']('spellcheck','false'),_0x36d911['textContent']=_0x18ee77['name'],_0x15ef6d['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x36d911['outerHTML']+'⁠',_0x15ef6d['addEventListener']('mouseenter',()=>{_0x15ef6d['classList']['add']('ck-user__marker_hovered');}),_0x15ef6d['addEventListener']('mouseleave',()=>{_0x15ef6d['classList']['remove']('ck-user__marker_hovered');}),_0x15ef6d;},_0x1ac34e['isSimilar']=function(_0x8e0a39){return!(!this['getCustomProperty']('userPositionMarker')||!_0x8e0a39['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x8e0a39['getAttribute']('data-session-id'));},_0x1ac34e;}(_0xbc4b9c,_0x3081d2,_0x4d256a);}(_0x17ec6d,_0x20b3a2,_0x3ed216,_0x1f023f)}),_0x1f023f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4fd4b5=>function(_0x267be4,_0x526350){const _0x91c0e0=_0x267be4['markerName']['split'](':')[0x2];if(_0x91c0e0===_0x526350['mySessionId'])return null;const _0x22cc37=_0x526350['getUserBySessionId'](_0x91c0e0);if(!_0x22cc37)return{'id':_0x91c0e0,'classes':[]};return{'id':_0x91c0e0,'classes':['ck-user__selection',_0x22cc37['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x91c0e0},'priority':0x7d0+_0x22cc37['orderNumber']};}(_0x4fd4b5,_0x3ed216)}),function(_0x73b69e){const _0x19b98f=_0x73b69e['model'],_0x103586=new Map(),_0xbf567e=_0x73b69e['plugins']['get'](i);_0x19b98f['markers']['on']('update:user:range',(_0x2a87fc,_0x4f1107,_0xc4a2a1,_0x305c77)=>{if(!_0x305c77&&_0x103586['get'](_0x4f1107['name']))return _0x103586['get'](_0x4f1107['name'])['detach'](),void _0x103586['delete'](_0x4f1107['name']);const _0x53bf03=_0x4f1107['name']['split'](':')[0x2];if(_0x53bf03===_0xbf567e['mySessionId'])return;const _0x5f3dae='user:position:'+_0x53bf03;_0x19b98f['markers']['has'](_0x5f3dae)&&_0x73b69e['editing']['reconvertMarker'](_0x5f3dae),_0x4f1107['on']('change:range',(_0x506d49,_0x531cef,_0x176d69)=>{if('$graveyard'!=_0x531cef['root']['rootName']&&'$graveyard'==_0x4f1107['getRange']()['root']['rootName']&&!_0x103586['has'](_0x4f1107['name'])){const _0x54cfd8=_0x19b98f['schema']['getNearestSelectionRange'](_0x176d69['deletionPosition']);if(_0x54cfd8){const _0x1c49c9=_0x350b70['fromRange'](_0x54cfd8);_0x103586['set'](_0x4f1107['name'],_0x1c49c9),_0x1c49c9['on']('change:range',(_0x59cb61,_0x41a2f4,_0x1d9628)=>{if('$graveyard'==_0x1c49c9['root']['rootName']){const _0x24c641=_0x19b98f['schema']['getNearestSelectionRange'](_0x1d9628['deletionPosition']);_0x24c641?(_0x1c49c9['start']=_0x24c641['start'],_0x1c49c9['end']=_0x24c641['end']):(_0x103586['delete'](_0x4f1107['name']),_0x1c49c9['detach']());}});}}});}),_0x19b98f['document']['on']('change',()=>{_0x103586['size']>0x0&&_0x19b98f['enqueueChange']({'isUndoable':!0x1},_0x2813d0=>{for(const [_0x3f0f8c,_0x3bb17d]of _0x103586)'$graveyard'==_0x19b98f['markers']['get'](_0x3f0f8c)['getRange']()['root']['rootName']&&(te(_0x3f0f8c['split'](':')[0x2],_0x3bb17d['toRange'](),_0x19b98f,_0x2813d0),_0x3bb17d['detach']());_0x103586['clear']();});});}(_0x1f023f),this['_domEmitter']['listenTo'](_0x221dd7['document'],'keydown',(_0x83b21d,{key:_0x563e43})=>{'Escape'===_0x563e43&&function(_0x548c85){_0x548c85['editing']['view']['change'](_0x4e3ceb=>{for(const _0x91027 of _0x548c85['model']['markers']){if(!_0x91027['name']['startsWith']('user:position'))continue;const _0x5abcb2=_0x548c85['editing']['mapper']['markerNameToElements'](_0x91027['name']);if(_0x5abcb2){for(const _0x33bd01 of _0x5abcb2)_0x4e3ceb['removeClass']('ck-user__marker_hovered',_0x33bd01);}}});}(_0x1f023f);},{'useCapture':!0x0});}['afterInit'](){const _0x450b0f=this['editor'],_0x26eed3=_0x450b0f['commands']['get']('undo');_0x26eed3&&_0x450b0f['model']['on']('applyOperation',(_0x1ecb1d,_0x4fdee9)=>{const _0x116c7b=_0x4fdee9[0x0];if(!_0x116c7b['isDocumentOperation'])return;if('marker'!=_0x116c7b['type']||!_0x116c7b['name']['startsWith']('user:'))return;const _0x3e6e33=_0x116c7b['batch'];_0x26eed3['_createdBatches']['has'](_0x3e6e33)&&(_0x116c7b['newRange']=_0x116c7b['oldRange']?_0x450b0f['model']['createRange'](_0x116c7b['oldRange']['start'],_0x116c7b['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0xc55a43=this['editor'],_0x5509b8=_0xc55a43['model']['document'],_0x28733a=_0xc55a43['plugins']['get'](i);_0xc55a43['model']['enqueueChange']({'isUndoable':!0x1},_0x29c175=>{const _0x50b655='user:range:'+_0x28733a['mySessionId'],_0x3fda4e='user:position:'+_0x28733a['mySessionId'],_0x324a96=_0xc55a43['model']['markers']['has'](_0x50b655);_0xc55a43['editing']['view']['hasDomSelection']?te(_0x28733a['mySessionId'],_0x5509b8['selection']['getFirstRange'](),_0xc55a43['model'],_0x29c175):_0x324a96&&(_0x29c175['removeMarker'](_0x50b655),_0x29c175['removeMarker'](_0x3fda4e));});}}function te(_0x1ae23a,_0x47e1ab,_0x1ca5c7,_0x5e6a7b){const _0xfccc28='user:range:'+_0x1ae23a,_0x129013='user:position:'+_0x1ae23a,_0x334d22=_0x47e1ab['getContainedElement']();let _0x2a4251=_0x47e1ab['start'];if(_0x334d22&&_0x334d22['is']('element','tableCell')){const _0x1f6c04=function(_0x477380,_0xc71791){for(const _0x4e809e of _0x477380['getPositions']())if(_0xc71791['schema']['checkChild'](_0x4e809e,'$text'))return _0x4e809e;}(_0x47e1ab,_0x1ca5c7);_0x1f6c04&&(_0x2a4251=_0x1f6c04,_0x47e1ab=_0x5e6a7b['createRange'](_0x2a4251));}const _0x4d5f5d=_0x5e6a7b['createRange'](_0x2a4251);_0x1ca5c7['markers']['has'](_0xfccc28)?(_0x5e6a7b['updateMarker'](_0xfccc28,{'range':_0x47e1ab}),_0x5e6a7b['updateMarker'](_0x129013,{'range':_0x4d5f5d})):(_0x5e6a7b['addMarker'](_0xfccc28,{'range':_0x47e1ab,'usingOperation':!0x0}),_0x5e6a7b['addMarker'](_0x129013,{'range':_0x4d5f5d,'usingOperation':!0x0}));}function $(_0xd5413c,_0x2dbaa3,_0x32da00){const _0x50e443=_0xd5413c['t'],t=_0xd5413c['t'];switch(_0x2dbaa3){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 _0x50e443({'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'},_0x32da00);default:return'';}}let Q=0x1;class l extends _0x51e259{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x281104)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x1ae22e,_0x566890,_0x167205];}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 _0x4c05f9=this['serverHistory']['getOperations']();for(let _0x40a006=_0x4c05f9['length']-0x1;_0x40a006>=0x0;_0x40a006--){const _0x31ef8e=_0x4c05f9[_0x40a006];if(!this['_disconnectionOperations']['has'](_0x31ef8e))return _0x31ef8e['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2976f9){if(super(_0x2976f9),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x32383e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x1ad561('collaboration-missing-channelid',this);const _0x334398=_0x2976f9['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x334398,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x548b13(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Z(this['_disconnectionOperations']);}['init'](){const _0x3e78a7=this['editor'],_0x38d9f8=_0x3e78a7['plugins']['get'](_0x566890),_0x5bb675=_0x3e78a7['plugins']['get'](n);this['listenTo'](_0x38d9f8,'getOperationAuthor',(_0x56b271,_0x567d43)=>{const _0x5a77bd=_0x567d43[0x0];_0x5a77bd['_authorId']&&(_0x56b271['return']=_0x38d9f8['getUser'](_0x5a77bd['_authorId']),_0x56b271['stop']()),null===_0x5a77bd['_authorId']&&(_0x56b271['return']=null,_0x56b271['stop']());},{'priority':'high'}),this['listenTo'](_0x3e78a7['model']['document']['selection'],'change:range',(_0x56e2db,_0x3b275c)=>{_0x3b275c['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3e78a7['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3e78a7['model']['on']('applyOperation',(_0x1e9a95,_0x2091df)=>{const _0x37c87e=_0x2091df[0x0];_0x37c87e['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x37c87e),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5bb675,'state',this,'_hasSynchronizationProblem',(_0x219fd9,_0x4ad8ec)=>'connected'===_0x219fd9&&!_0x4ad8ec),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3e78a7['disableReadOnlyMode']('rtc-offline'):_0x3e78a7['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3e78a7['disableReadOnlyMode']('rtc-offline'):_0x3e78a7['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x508bc9=this['editor']['plugins']['get'](i),_0x3037b7=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x508bc9['unregister'](this['_channelId']);const _0x4d58b4=await this['_service']['reconnect'](_0x3037b7['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4d58b4)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x139a49=await this['_service']['getConnectedSessions']();_0x508bc9['register'](this['_channelId'],_0x139a49),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x39bd77){if(function(_0x1ac0fb){return'404'===_0x1ac0fb['code'];}(_0x39bd77)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1783f7){return'409'===_0x1783f7['code'];}(_0x39bd77)){const _0x2f9df8=$(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'](_0x2f9df8);}else{if(!(_0x39bd77 instanceof X))throw _0x39bd77;this['_handleReconnectionError']();}}}}['destroy'](){const _0xeeb436=this['editor']['plugins']['get'](n),_0x3fc645=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x3fc645['channelSessions']['has'](this['_channelId'])&&_0x3fc645['unregister'](this['_channelId']),_0xeeb436['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5411bd){if(this['sessionId']!==_0x5411bd['sessionId']&&this['_lastSyncedOperationId']!==_0x5411bd['lastOperationId'])throw new X();return this['sessionId']=_0x5411bd['sessionId'],this['_handleServerResponse']([],{..._0x5411bd,'wereChangesApplied':!0x1,'data':_0x5411bd['data']},'reconnect');}async['_connectService'](_0x4ba58f,_0x529fba=!0x1){const {connection:_0x1d99de}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1d99de,this['_channelId'])['then'](_0x4f8936=>this['_initSessionsHandling'](_0x4f8936))['catch'](_0x3bc733=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3bc733);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5f11ad,_0x31a598)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x31a598);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xb531d8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4ba58f);this['_isPendingUpdate']=!0x0;const _0x274f03=await this['_service']['connect'](_0x1d99de,this['_compressOperations'](_0x4ba58f),_0xb531d8);if(this['sessionId']=_0x274f03['sessionId'],_0x529fba){if(!_0x274f03['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x274f03['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4ba58f,_0x274f03,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x274f03,_0x4ba58f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2f2f54=this['editor']['plugins']['get'](i),_0x55b260=this['editor']['plugins']['get'](G),_0x49fdd8=_0x2f2f54['channelSessions']['get'](this['_channelId']);_0x49fdd8&&_0x49fdd8['length']>0x1?_0x55b260['createUserMarkerOperations']():this['listenTo'](_0x2f2f54,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2f2f54['channelSessions']['get'](this['_channelId'])['length']&&_0x55b260['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x19b457,_0x55262e,_0x344b98,_0x2d9ac6){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x55262e){const _0x43aec5=this['_decompressOperations'](_0x344b98,_0x2d9ac6);await this['_fetchMissingUsers'](_0x43aec5),this['_handleExternalOperations'](_0x43aec5,_0x55262e,_0x344b98['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x4a3e44}=this['editor'];let _0x2aac9f;try{_0x2aac9f=await this['_service']['getDocumentDetails']();}catch{const _0x34046f=$(_0x4a3e44,'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'](_0x34046f);}const _0x59131f=_0x2aac9f['currentDocumentSession']||_0x2aac9f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x59131f['lastOperationId']){const _0x1f41d9=$(_0x4a3e44,'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'](_0x1f41d9);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x2c0f45){const _0x5b7692=this['editor']['plugins']['get'](i);this['listenTo'](_0x5b7692,'sessionAdd:'+this['_channelId'],(_0x5cce27,{session:_0x289ca8})=>{if(_0x289ca8['id']===_0x5b7692['mySessionId']){_0x5cce27['off']();const _0x185a3d=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x59cf01=_0x289ca8['permissions'];_0x185a3d&&_0x185a3d['isEnabled']&&(_0x59cf01=_0x59cf01['filter'](_0x17613f=>'document:write'!==_0x17613f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x59cf01,this['_channelId']);}}),_0x5b7692['register'](this['_channelId'],_0x2c0f45);}['_initThrowingOnDataSet'](){const _0x2a9e02=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2b3664)=>{if(!_0x2b3664[_0x2b3664['length']-0x1]['suppressErrorInCollaboration'])throw new _0x1ad561('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2a9e02['apply'](this['editor']['data'],_0x2b3664);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x61423b,[_0x1c41af])=>{if(this['_document']['version'])throw new _0x1ad561('realtimecollaborationclient-init-document-already-initialized',this);_0x61423b['stop'](),this['_setPendingAction']();const _0x1f870b=this['editor']['config']['get']('rootsAttributes'),_0x1b1c7e=this['_getOperationsFromInitData'](_0x1c41af,_0x1f870b);0x0==_0x1b1c7e['length']&&_0x1b1c7e['push'](new _0x4a7e8b(0x0)),_0x61423b['return']=this['_connectService'](_0x1b1c7e)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x465d6e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x465d6e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x124893,[_0x107ac3,_0x72900])=>{_0x124893['stop']();const _0x3eaddb=this['editor']['model']['document']['getRoot'](_0x107ac3);if(!this['_knownRootNames']['has'](_0x107ac3)){const _0x65f5e7=_0x72900&&_0x72900['data']?_0x72900['data']:'',_0xdfa2e6=_0x72900&&_0x72900['attributes']?_0x72900['attributes']:{};await this['_loadRoot'](_0x107ac3,_0x65f5e7,_0xdfa2e6);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3eaddb['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3eaddb);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1eef08){const _0x47f9a4=this['editor']['plugins']['get'](_0x566890),{connection:_0xbaf262}=this['editor']['plugins']['get'](n),_0x1d4d87=new Set();for(const _0x35118a of _0x1eef08){const _0x236f2b=_0x35118a['_authorId'];_0x236f2b&&!_0x47f9a4['getUser'](_0x236f2b)&&_0x1d4d87['add'](_0x236f2b);}if(0x0===_0x1d4d87['size'])return;const _0x3e2bc2=await ct['getMany'](_0xbaf262,Array['from'](_0x1d4d87));for(const _0x15cbc6 of _0x3e2bc2)_0x47f9a4['getUser'](_0x15cbc6['id'])||_0x47f9a4['addUser'](_0x15cbc6);}['_getOperationsFromInitData'](_0x16a653,_0x3f4732={}){const _0x176aea=this['editor']['model'],_0x3804fb=[];let _0x18a51f=0x0;const _0x5a067e='string'==typeof _0x16a653?{'main':_0x16a653}:_0x16a653;for(const _0x176720 of Object['keys'](_0x5a067e)){if(!this['_document']['roots']['has'](_0x176720))throw new _0x1ad561('realtimecollaborationclient-init-non-existent-root',this);const _0x3b412f=this['editor']['data']['parse'](_0x5a067e[_0x176720]),_0x118aa4=this['_document']['getRoot'](_0x176720),_0x1e4781=new _0x24f0ec(_0x176aea['createPositionAt'](_0x118aa4,0x0),_0x3b412f,_0x18a51f++);_0x3804fb['push'](_0x1e4781);for(const [_0x48ecb6,_0x58a4e2]of _0x3b412f['markers']){const _0xe2cb8c=_0x176aea['createRange'](_0x176aea['createPositionFromPath'](_0x118aa4,_0x58a4e2['start']['path']['slice']()),_0x176aea['createPositionFromPath'](_0x118aa4,_0x58a4e2['end']['path']['slice']())),_0x3d9c4e=new _0x24bac5(_0x48ecb6,null,_0xe2cb8c,_0x176aea['markers'],!0x0,_0x18a51f++);_0x3804fb['push'](_0x3d9c4e);}}if(_0x3f4732)for(const [_0x4b2a75,_0x5b7a9b]of Object['entries'](_0x3f4732)){const _0x24d25d=_0x176aea['document']['getRoot'](_0x4b2a75);if(!_0x24d25d)throw new _0x1ad561('multi-root-editor-root-attributes-no-root',null);for(const [_0x1db028,_0x5a6754]of Object['entries'](_0x5b7a9b))if(null!==_0x5a6754){const _0x5a3c8d=new _0x4e97ca(_0x24d25d,_0x1db028,null,_0x5a6754,_0x18a51f++);_0x3804fb['push'](_0x5a3c8d);}}return _0x3804fb;}async['_loadRoot'](_0x3d8ed2,_0x511160,_0x472b46){this['_getOperationsFromInitData']({[_0x3d8ed2]:_0x511160},{[_0x3d8ed2]:_0x472b46})['forEach']((_0x1638eb,_0x31aef4)=>{_0x1638eb['baseVersion']=this['_document']['version']+_0x31aef4,_0x1638eb['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1638eb);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x4e8295,_0x1f742d){let _0x24aace;this['_offset']=_0x4e8295['offset'];const _0x4a4a9d=_0x4e8295['wereChangesApplied']&&!_0x4e8295['initData'],_0x5e974b=_0x4a4a9d?0x0:_0x4e8295['data']['baseVersion'];if(_0x1f742d['forEach'](_0x161b46=>{_0x161b46['_isInit']=!0x0,_0x161b46['createdAt']=_0x4e8295['sessionCreatedAt'],_0x161b46['_authorId']=null;}),_0x4a4a9d)_0x24aace=_0x1f742d,this['_applyOperationsSet'](_0x24aace,_0x4a4a9d);else{if(_0x4e8295['initData']){const _0x5c4f2f=this['_getOperationsFromInitData'](_0x4e8295['initData']);this['_document']['history']['version']=-_0x5c4f2f['length'],_0x5c4f2f['forEach'](_0x321d0e=>{_0x321d0e['baseVersion']-=_0x5c4f2f['length'],_0x321d0e['createdAt']=_0x4e8295['sessionCreatedAt'],_0x321d0e['_isInit']=!0x0,_0x321d0e['_authorId']=null;}),this['_applyOperationsSet'](_0x5c4f2f,!0x0),this['serverHistory']['version']=-_0x5c4f2f['length']+this['_offset'],this['_updateServerHistory'](_0x5c4f2f);}this['_document']['history']['version']=_0x5e974b,_0x24aace=this['_decompressOperations'](_0x4e8295['data'],_0x4e8295['metadata']),await this['_fetchMissingUsers'](_0x24aace),this['_applyOperationsSet'](_0x24aace,_0x4a4a9d);}_0x4e8295['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x24aace,_0x4e8295['lastOperationId']),this['_lastSyncedOperationId']=_0x4e8295['lastOperationId']),this['serverHistory']['version']=_0x5e974b+this['_offset'],this['_updateServerHistory'](_0x24aace),_0x1f742d['filter'](_0x3c0b6a=>{const _0x2c8ab6=this['_getAffectedRoot'](_0x3c0b6a);return _0x2c8ab6&&!this['_knownRootNames']['has'](_0x2c8ab6);})['forEach']((_0x296744,_0x3942ae)=>{_0x296744['baseVersion']=this['_document']['version']+_0x3942ae,this['_saveOperationInBuffer'](_0x296744);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4111a9,_0x338794){const _0x27292c=_0x338794&&_0x338794['message'];if(_0x27292c&&_0x27292c['startsWith']('realtimecollaborationclient'))throw _0x338794;const _0x148b72=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x148b72['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x1ad561(_0x4111a9,this['editor'],_0x27292c?{'originalError':_0x27292c}:void 0x0);}['_saveOperationInBuffer'](_0x3ff313){this['_knownOperations']['has'](_0x3ff313)||(this['_knownOperations']['add'](_0x3ff313),this['_bufferedOperations']['push'](_0x3ff313),this['_pendingAction']||'marker'==_0x3ff313['type']&&!_0x3ff313['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x12a40f=!0x1){!_0x12a40f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1349fe=>{_0x1349fe&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x1a9f43=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1b8766){return _0x1b8766['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1b8766['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1b8766['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x1a9f43)||this['_crash'](_0x1a9f43['message'],_0x1a9f43);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x1920a9=>{this['on']('change:_isPendingUpdate',()=>{_0x1920a9();});});}async['_sendBufferedOperations'](){const _0x264474=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x264474['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xeca3d1=[...this['_bufferedOperations']];for(const _0x2676ff of _0xeca3d1)_0x2676ff['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2676ff);const _0x3eca57=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xeca3d1),_0x39b0d5=Q++,_0x5da572=this['_compressOperations'](_0xeca3d1),_0x2178e4=await this['_service']['sendOperations'](_0x5da572,_0x5da572['baseVersion'],_0x3eca57);try{return await this['_handleServerResponse'](_0xeca3d1,_0x2178e4,_0x39b0d5);}catch(_0x92a837){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x92a837);}}async['_handleServerResponse'](_0x59dfc7,_0xc335e6,_0x39cd47){if('error'in _0xc335e6)throw _0xc335e6['error'];let _0x15ce6f=!0x1;if(_0xc335e6['wereChangesApplied']){_0xc335e6['lastOperationId']&&(this['_lastSyncedOperationId']=_0xc335e6['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1dcf1f=>!_0x59dfc7['includes'](_0x1dcf1f));for(const _0x1136a1 of _0x59dfc7)_0x1136a1['createdAt']='lastOperationAcceptedAt'in _0xc335e6&&_0xc335e6['lastOperationAcceptedAt']||void 0x0;Y(_0x59dfc7,_0xc335e6['version']-_0x59dfc7['length']),this['_updateServerHistory'](_0x59dfc7);const _0x301784=_0x59dfc7['filter'](_0x55ea86=>{if(!_0x55ea86['_isInit'])return!0x1;const _0x4e6508=this['_getAffectedRoot'](_0x55ea86);return _0x4e6508&&!this['_knownRootNames']['has'](_0x4e6508);});Y(_0x301784,this['_document']['version']),this['_applyOperationsSet'](_0x301784),_0x15ce6f=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4e438e=this['_decompressOperations'](_0xc335e6['data'],_0xc335e6['metadata'])['filter'](_0x36b218=>_0x36b218['baseVersion']>=this['_lastServerVersion']);_0x4e438e['forEach'](_0x5d9c8a=>this['_addKnownRoot'](_0x5d9c8a)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x18ea08=>!_0x18ea08['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x18ea08))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x4e438e),_0x15ce6f=this['_handleExternalOperations'](_0x4e438e,_0xc335e6['version'],_0xc335e6['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x15ce6f?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1f9c96,_0x4cb74b,_0x48b43c){try{const _0x9aea1d={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x282e8c,operationsB:_0x101b0d,originalOperations:_0x28a126}=_0x59cf95(_0x1f9c96,this['_bufferedOperations'],_0x9aea1d);Y(_0x282e8c,this['_document']['version']),Y(_0x101b0d,_0x4cb74b);for(const _0x27ef4b of _0x282e8c){const _0x5bef19=_0x28a126['get'](_0x27ef4b);_0x27ef4b['_authorId']=_0x5bef19?_0x5bef19['_authorId']:null;}_0x48b43c&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f9c96,_0x48b43c),this['_lastSyncedOperationId']=_0x48b43c),this['_bufferedOperations']=[..._0x101b0d],this['_applyOperationsSet'](_0x282e8c),this['_updateServerHistory'](_0x1f9c96);}catch(_0x24c59c){return console['error'](_0x24c59c),!0x1;}return!0x0;}['_applyOperationsSet'](_0x221b34,_0xfd0e53=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1380fd=>{for(const _0x589623 of _0x221b34)this['_knownOperations']['add'](_0x589623),this['_addKnownRoot'](_0x589623),_0x1380fd['batch']['addOperation'](_0x589623),this['editor']['model']['applyOperation'](_0x589623);});}['_addKnownRoot'](_0x19a6ab){const _0x75a04=this['_getAffectedRoot'](_0x19a6ab);_0x75a04&&this['_knownRootNames']['add'](_0x75a04);}['_getAffectedRoot'](_0x2be771){let _0x21562d,_0x1e6b34;switch(_0x2be771['type']){case'insert':_0x21562d=_0x2be771['position']['root'];break;case'marker':if(_0x1e6b34=_0x2be771['newRange'],!_0x1e6b34)return null;_0x21562d=_0x1e6b34['root'];break;case'addRootAttribute':_0x21562d=_0x2be771['root'];break;case'addRoot':_0x21562d=_0x2be771['affectedSelectable'];break;case'move':_0x21562d=_0x2be771['targetPosition']['root'];break;default:return null;}return _0x21562d['rootName'];}['_updateServerHistory'](_0x4f3409){_0x4f3409['forEach'](_0x3c4398=>{const _0x519e10=_0x3c4398['clone']();_0x519e10['_authorId']=_0x3c4398['_authorId'],_0x519e10['_isInit']=!!_0x3c4398['_isInit'],_0x519e10['createdAt']=_0x3c4398['createdAt'],_0x519e10['baseVersion']+=this['_offset'],_0x3c4398['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x519e10),this['serverHistory']['addOperation'](_0x519e10);});}['_handleReconnectionError'](_0xbf37c6){const _0x3fcdb3=this['editor']['plugins']['get']('Notification'),_0x392d0f=this['editor']['locale'];_0xbf37c6||(_0xbf37c6=$(_0x392d0f,'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.')),_0x3fcdb3['showWarning'](_0xbf37c6,{'title':$(_0x392d0f,'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'](_0x1ae22e)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1ae22e)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x30b193){const _0x181de5=_0x30b193['map'](_0x5a92a4=>_0x5a92a4['toJSON']());return this['_compressor']['compress'](_0x181de5);}['_decompressOperations'](_0x363c8f,_0x421dad){return this['_compressor']['decompress'](_0x363c8f)['map']((_0x5db0e4,_0x232803)=>{const _0x1420a1='init'==_0x421dad[_0x232803]['type'];if('InsertOperation'==_0x5db0e4['__className']){const _0x706ae9=_0x5db0e4['position']['root'];!this['_document']['getRoot'](_0x706ae9)&&(this['_document']['createRoot']('$root',_0x706ae9)['_isAttached']=!0x1);}const _0x1bc2aa=_0x5b3bb9['fromJSON'](_0x5db0e4,this['_document']);return _0x1bc2aa['wasUndone']=_0x5db0e4['wasUndone'],_0x1bc2aa['_isInit']=_0x1420a1,_0x1bc2aa['_authorId']=_0x1420a1?null:_0x421dad[_0x232803]['userId'],_0x1bc2aa['_isDisconnection']='cs:removeUser'===_0x421dad[_0x232803]['type'],_0x1bc2aa['createdAt']=_0x421dad[_0x232803]['createdAt'],_0x1bc2aa;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x320748=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x320748&&_0x320748['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x51632e,_0x5545c0){for(const _0x8ece46 of _0x51632e)_0x8ece46['baseVersion']=_0x5545c0++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0x495375){this['_ignoredOperations']=_0x495375,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x37bfc1){let _0xdf4348=_0x37bfc1['length'];for(;_0xdf4348--;){const _0x404309=_0x37bfc1[_0xdf4348];if(!this['_ignoredOperations']['has'](_0x404309)){if(!this['_operationToId']['has'](_0x404309)){const _0x3ba340=_0x5511b8()['slice'](0x1,0x12);this['_operationToId']['set'](_0x404309,_0x3ba340);}return this['_operationToId']['get'](_0x404309);}}}['setIdForTheLastOperation'](_0x364876,_0x55c74b){if(!_0x55c74b)return;let _0x295ebf=_0x364876['length'];for(;_0x295ebf--;){const _0x547575=_0x364876[_0x295ebf];this['_ignoredOperations']['has'](_0x547575)||this['_operationToId']['set'](_0x547575,_0x55c74b);}}}class a extends _0x51e259{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0xcfca57{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x4fbe1e)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x566890];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x367396){super(_0x367396),this['_services']=new Map();}async['init'](){const _0x5eee32=this['context'],_0x2b4c0f=_0x5eee32['plugins']['get']('CommentsRepository');if(_0x5eee32['plugins']['get'](n)['addToReconnectionStack'](this),_0x2b4c0f['adapter']={'addCommentThread':async({channelId:_0xf6dc1f,threadId:_0x103a30,comments:_0x11c3d9,resolvedAt:_0x104785,resolvedBy:_0x12bb8b,context:_0x32887d,attributes:_0x12f28c})=>{const _0x3afb03=await this['_getService'](_0xf6dc1f)['addCommentThread']({'commentThreadId':_0x103a30,'comments':_0x11c3d9['map'](_0x3a6646=>function(_0x8f57de,_0x3460ba,_0x456e5a){return{'commentThreadId':_0x456e5a,'commentId':_0x8f57de['commentId'],'userId':_0x8f57de['authorId'],'content':_0x8f57de['content'],'documentId':_0x3460ba,'createdAt':_0x8f57de['createdAt'],'attributes':_0x8f57de['attributes']||{}};}(_0x3a6646,_0xf6dc1f,_0x103a30)),'resolvedAt':_0x104785,'resolvedBy':_0x12bb8b,'context':_0x32887d,'attributes':_0x12f28c})['catch'](at);return{'threadId':_0x3afb03['commentThreadId'],'comments':_0x3afb03['comments']};},'getCommentThread':async({channelId:_0x3ce83c,threadId:_0x1c5518})=>{const _0x8c0362=await this['_getService'](_0x3ce83c)['getCommentThread'](_0x1c5518)['catch'](f)['catch'](at);return _0x8c0362?_0x8c0362['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x8c0362]),{'threadId':_0x8c0362['commentThreadId'],'comments':_0x8c0362['comments']['map'](p),'context':_0x8c0362['context'],'resolvedAt':_0x8c0362['resolvedAt'],'resolvedBy':_0x8c0362['resolvedBy'],'attributes':_0x8c0362['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x39716d,threadId:_0x20702d,context:_0x1bcc8a,unlinkedAt:_0x2b46e7,attributes:_0x21a344})=>this['_getService'](_0x39716d)['updateCommentThread']({'commentThreadId':_0x20702d,'context':_0x1bcc8a,'attributes':_0x21a344,'unlinkedAt':_0x2b46e7})['catch'](f)['catch'](at),'resolveCommentThread':async({channelId:_0x1aafad,threadId:_0x4d36ef})=>{const _0xf36deb=await this['_getService'](_0x1aafad)['resolveCommentThread'](_0x4d36ef)['catch'](f)['catch'](at);return{'threadId':_0xf36deb['commentThreadId'],'resolvedAt':_0xf36deb['resolvedAt'],'resolvedBy':_0xf36deb['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3ceded,threadId:_0x2d7b11})=>this['_getService'](_0x3ceded)['reopenCommentThread'](_0x2d7b11)['catch'](f)['catch'](at),'removeCommentThread':({channelId:_0x1acffb,threadId:_0x24715d})=>this['_getService'](_0x1acffb)['removeCommentThread'](_0x24715d)['catch'](f)['catch'](at),'addComment':({channelId:_0x508036,threadId:_0x3e39af,commentId:_0x539ccb,content:_0x3a3555,attributes:_0xd69938})=>this['_getService'](_0x508036)['addComment'](_0x3e39af,_0x539ccb,_0x3a3555,_0xd69938)['catch'](at),'updateComment':({channelId:_0x48af6a,threadId:_0x8ca85e,commentId:_0x143699,content:_0x48767a,attributes:_0x13994b})=>this['_getService'](_0x48af6a)['updateComment'](_0x8ca85e,_0x143699,_0x48767a,_0x13994b)['catch'](f)['catch'](at),'removeComment':({channelId:_0x140cad,threadId:_0x459b62,commentId:_0x29355d})=>this['_getService'](_0x140cad)['removeComment'](_0x459b62,_0x29355d)['catch'](f)['catch'](at)},_0x5eee32 instanceof _0x3caf40){const _0x572fb7=_0x5eee32['config']['get']('collaboration.channelId'),_0x66423e=_0x5eee32['plugins']['get'](i);await this['_setUpService'](_0x572fb7);const _0x502364=await this['_services']['get'](_0x572fb7)['getConnectedSessions']();this['listenTo'](_0x66423e,'sessionAdd:'+_0x572fb7,(_0x4bd9de,{session:_0x2aff8d})=>{_0x2aff8d['id']===_0x66423e['mySessionId']&&(_0x4bd9de['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2aff8d['permissions'],_0x572fb7));}),_0x66423e['register'](_0x572fb7,_0x502364);}}async['_setUpService'](_0x2e300a){if(this['_services']['has'](_0x2e300a))throw new _0x1ad561('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2e300a});const _0xdc58f2=this['context']['plugins']['get']('CommentsRepository'),_0x561e43=new s['CommentsService'](_0x2e300a);this['_services']['set'](_0x2e300a,_0x561e43),this['listenTo'](_0x561e43,'commentThreadAdded',(_0x5df8ba,_0x3e3c3c)=>{const {commentThreadId:_0x40abac,documentId:_0xb7c14c,context:_0x4b8785,attributes:_0x3e23a2,resolvedAt:_0x7b65fc,resolvedBy:_0x290062,comments:_0x1c9ed7}=_0x3e3c3c;_0xdc58f2['getCommentThread'](_0x40abac)||_0xdc58f2['addCommentThread']({'threadId':_0x40abac,'channelId':_0xb7c14c,'comments':_0x1c9ed7?_0x1c9ed7['map'](p):[],'context':_0x4b8785,'attributes':_0x3e23a2,'resolvedAt':_0x7b65fc,'resolvedBy':_0x290062,'isFromAdapter':!0x0});}),this['listenTo'](_0x561e43,'commentThreadUpdated',(_0x395f95,{commentThreadId:_0x1476d6,documentId:_0x38eacf,context:_0x22d999,unlinkedAt:_0x5a04cc,attributes:_0x31619a})=>{_0xdc58f2['getCommentThread'](_0x1476d6)&&_0xdc58f2['updateCommentThread']({'threadId':_0x1476d6,'channelId':_0x38eacf,'context':_0x22d999,'unlinkedAt':_0x5a04cc,'attributes':_0x31619a,'isFromAdapter':!0x0});}),this['listenTo'](_0x561e43,'commentThreadResolved',(_0xb3214b,{commentThreadId:_0x33addf,resolvedBy:_0x16bbc0,resolvedAt:_0x5d1114})=>{const _0x294105=_0xdc58f2['getCommentThread'](_0x33addf);_0x294105&&_0x294105['resolve']({'resolvedBy':_0x16bbc0,'resolvedAt':_0x5d1114,'isFromAdapter':!0x0});}),this['listenTo'](_0x561e43,'commentThreadReopened',(_0x5a1345,{commentThreadId:_0x57fb22})=>{const _0x795cfe=_0xdc58f2['getCommentThread'](_0x57fb22);_0x795cfe&&_0x795cfe['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x561e43,'commentThreadRemoved',(_0x30cbee,{commentThreadId:_0x2bc3ae})=>{const _0x4518f3=_0xdc58f2['getCommentThread'](_0x2bc3ae);_0x4518f3&&_0x4518f3['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x561e43,'commentAdded',(_0x39237f,_0x4fe82f)=>{const _0x5bc8e8=_0x4fe82f['commentThreadId'],_0x51f674=_0xdc58f2['getCommentThread'](_0x5bc8e8);_0x51f674&&_0x51f674['addComment']({...p(_0x4fe82f),'isFromAdapter':!0x0});}),this['listenTo'](_0x561e43,'commentUpdated',(_0x19c1fc,{commentThreadId:_0x49697b,commentId:_0x20000e,content:_0x36648a,attributes:_0x2035e5})=>{const _0x5f1f0d=_0xdc58f2['getCommentThread'](_0x49697b);if(_0x5f1f0d){const _0x4675d7=_0x5f1f0d['getComment'](_0x20000e);_0x4675d7&&_0x4675d7['update']({'content':_0x36648a,'attributes':_0x2035e5,'isFromAdapter':!0x0});}}),this['listenTo'](_0x561e43,'commentRemoved',(_0x24ca11,{commentThreadId:_0x1779c3,commentId:_0x170260})=>{const _0x16d4e3=_0xdc58f2['getCommentThread'](_0x1779c3);if(_0x16d4e3){const _0x2a5e6e=_0x16d4e3['getComment'](_0x170260);_0x2a5e6e&&_0x2a5e6e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x2e300a);}['destroy'](){if(this['context']instanceof _0x3caf40){const _0x4002c9=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4002c9);}}['_terminateService'](_0x49ecd8){if(!this['_services']['has'](_0x49ecd8))throw new _0x1ad561('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x49ecd8});this['_getService'](_0x49ecd8)['disconnect'](),this['_services']['delete'](_0x49ecd8);}async['reconnect'](){for(const _0x1c1eec of this['_services']['keys']())await this['_connectService'](_0x1c1eec);if(this['context']instanceof _0x3caf40){const _0x325e80=this['context']['config']['get']('collaboration.channelId'),_0x3091f0=this['context']['plugins']['get'](i);_0x3091f0['unregister'](_0x325e80);const _0x3737b9=await this['_services']['get'](_0x325e80)['getConnectedSessions']();_0x3091f0['register'](_0x325e80,_0x3737b9);}}async['_connectService'](_0x4f8df6){const {connection:_0x278689}=this['context']['plugins']['get'](n),_0x3eee4a=this['context']['plugins']['get']('CommentsRepository'),_0x3d2cad=this['_services']['get'](_0x4f8df6),_0xe0a349=await _0x3d2cad['connect'](_0x278689);await this['_fetchMissingUsersForThreads'](_0xe0a349);const _0x142c6d=new Set(Array['from'](_0x3eee4a['getCommentThreads']({'channelId':_0x4f8df6}),_0x5d479b=>_0x5d479b['id']));for(const _0xf16730 of _0xe0a349)_0xf16730['deletedAt']||_0x142c6d['delete'](_0xf16730['commentThreadId']);for(const _0x5dfc02 of _0x142c6d)_0x3eee4a['getCommentThread'](_0x5dfc02)['remove']({'isFromAdapter':!0x0});for(const _0x5421e1 of _0xe0a349){let _0x53aefb=_0x3eee4a['getCommentThread'](_0x5421e1['commentThreadId']);const {commentThreadId:_0x29ad16,context:_0x39c843,attributes:_0x244ea3,resolvedBy:_0x29a476,resolvedAt:_0x2a51f4,unlinkedAt:_0x29014e,deletedAt:_0x1dd24d}=_0x5421e1;if(_0x1dd24d)continue;_0x53aefb||(_0x53aefb=_0x3eee4a['addCommentThread']({'channelId':_0x4f8df6,'threadId':_0x29ad16,'context':_0x39c843,'attributes':_0x244ea3||{},'resolvedBy':_0x29a476,'resolvedAt':_0x2a51f4,'unlinkedAt':_0x29014e,'isFromAdapter':!0x0}));const _0x110d74=new Set(Array['from'](_0x53aefb['comments'],_0x4afbb5=>_0x4afbb5['id']));for(const _0x4ed63b of _0x5421e1['comments'])_0x110d74['delete'](_0x4ed63b['commentId']);for(const _0x40f3f4 of _0x110d74)_0x53aefb['getComment'](_0x40f3f4)['remove']({'isFromAdapter':!0x0});for(const _0x3c67dd of _0x5421e1['comments']){const _0x1dcd83=_0x53aefb['getComment'](_0x3c67dd['commentId']);_0x1dcd83?_0x1dcd83['content']!==_0x3c67dd['content']&&_0x1dcd83['update']({'content':_0x3c67dd['content'],'isFromAdapter':!0x0}):_0x53aefb['addComment'](Object['assign'](p(_0x3c67dd),{'isFromAdapter':!0x0}));}}}['_getService'](_0x3a2dd0){if(!this['_services']['has'](_0x3a2dd0))throw new _0x1ad561('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x3a2dd0});return this['_services']['get'](_0x3a2dd0);}async['_fetchMissingUsersForThreads'](_0x4d07e9){const _0x27d2fb=this['context']['plugins']['get'](_0x566890),{connection:_0x2308ab}=this['context']['plugins']['get'](n),_0x11ce69=new Set();for(const {resolvedBy:_0x1f1b95,comments:_0x2d108a}of _0x4d07e9){_0x1f1b95&&!_0x27d2fb['getUser'](_0x1f1b95)&&_0x11ce69['add'](_0x1f1b95);for(const {userId:_0x1c95b8}of _0x2d108a)_0x27d2fb['getUser'](_0x1c95b8)||_0x11ce69['add'](_0x1c95b8);}if(0x0===_0x11ce69['size'])return;const _0x49dc7c=await ct['getMany'](_0x2308ab,Array['from'](_0x11ce69));for(const _0x23ded2 of _0x49dc7c)_0x27d2fb['getUser'](_0x23ded2['id'])||_0x27d2fb['addUser'](_0x23ded2);}}async function f(_0x38b2ca){if('404'!==_0x38b2ca['code'])throw _0x38b2ca;}function at(_0x5c1c10){if((_0x362c84=_0x5c1c10)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x362c84['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x362c84['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x362c84;throw _0x5c1c10;}function p(_0x59f4e4){return{'threadId':_0x59f4e4['commentThreadId'],'commentId':_0x59f4e4['commentId'],'content':_0x59f4e4['content'],'createdAt':_0x59f4e4['createdAt'],'authorId':_0x59f4e4['userId'],'attributes':_0x59f4e4['attributes']||{}};}class m extends _0x51e259{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x494746){super(_0x494746);const _0x58436b=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x58436b);}['init'](){const _0x5ef32d=this['editor']['plugins']['get'](n),_0xfe10d7=this['editor']['plugins']['get']('TrackChangesEditing');return _0xfe10d7['adapter']={'getSuggestion':async _0x126124=>{await this['_waitForServiceReady']();const _0x45296a=await this['_trackChangesService']['get'](_0x126124)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x45296a]),_0x45296a;},'addSuggestion':async({id:_0xa2232d,type:_0x535579,data:_0x3fca48,originalSuggestionId:_0x246dff,attributes:_0x322d35})=>{await this['_waitForServiceReady']();const _0x13ca0c={'id':_0xa2232d,'type':_0x535579,'data':_0x3fca48,'originalSuggestionId':_0x246dff,'attributes':_0x322d35},_0x163270=await this['_trackChangesService']['add'](_0xa2232d,_0x535579,_0x3fca48,_0x246dff,_0x322d35)['catch'](_0x5ebb5a=>{if(ht(_0x5ebb5a))return new Promise(_0x497fd2=>{this['_bufferedRequests']['set'](_0xa2232d,{'resolve':_0x497fd2,'suggestionData':_0x13ca0c});});throw _0x5ebb5a;});return this['_bufferedRequests']['delete'](_0xa2232d),_0x163270;},'updateSuggestion':async(_0x149712,_0xb99f30)=>{if(await this['_waitForServiceReady'](),'open'!==_0xb99f30['state'])return this['_trackChangesService']['update'](_0x149712,_0xb99f30)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x41307f,_0x56001e)=>{_0xfe10d7['hasSuggestion'](_0x56001e['id'])&&(_0xfe10d7['getSuggestion'](_0x56001e['id'])['attributes']=_0x56001e['attributes']);}),this['_trackChangesService']['connect'](_0x5ef32d['connection'])['then'](_0x45cfa7=>(_0x5ef32d['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x45cfa7)['then'](()=>{for(const _0x5472db of _0x45cfa7){_0xfe10d7['addSuggestionData'](_0x5472db)['_saved']=!0x0;}})));}async['reconnect'](){const _0x12f170=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0xdc1a35}=this['editor']['plugins']['get'](n),_0x4e9ee9=await this['_trackChangesService']['connect'](_0xdc1a35);await this['_fetchMissingUsersForThreads'](_0x4e9ee9);for(const {suggestionData:_0x1acb52,resolve:_0x57902a}of this['_bufferedRequests']['values']()){let _0x16f617=_0x4e9ee9['find'](_0x2b3cd8=>_0x2b3cd8['id']===_0x1acb52['id']);_0x16f617||(_0x16f617=await this['_trackChangesService']['add'](_0x1acb52['id'],_0x1acb52['type'],_0x1acb52['data'],_0x1acb52['originalSuggestionId'])),_0x57902a(_0x16f617);}for(const _0x552eb2 of _0x4e9ee9)_0x12f170['hasSuggestion'](_0x552eb2['id'])||_0x12f170['addSuggestionData'](_0x552eb2);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x3e19e9=>{this['listenTo'](this['_trackChangesService'],'connected',_0x248fe9=>{_0x248fe9['off'](),_0x3e19e9();});});}async['_fetchMissingUsersForThreads'](_0x171fdb){const _0x3cc46f=this['editor']['plugins']['get'](_0x566890),{connection:_0x464d37}=this['editor']['plugins']['get'](n),_0x2a7d6f=new Set();for(const {authorId:_0x4cd850}of _0x171fdb)_0x3cc46f['getUser'](_0x4cd850)||_0x2a7d6f['add'](_0x4cd850);if(0x0===_0x2a7d6f['size'])return;const _0x35c967=await ct['getMany'](_0x464d37,Array['from'](_0x2a7d6f));for(const _0x4fbd2c of _0x35c967)_0x3cc46f['getUser'](_0x4fbd2c['id'])||_0x3cc46f['addUser'](_0x4fbd2c);}}function A(_0x48264d){if(ht(_0x48264d))return new Promise(()=>{});throw _0x48264d;}function ht(_0x13c9a2){return _0x13c9a2['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x13c9a2['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x51e259{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 _0x3ab2d5=this['editor']['plugins']['get'](n),_0x28ece4=this['editor']['plugins']['get']('CommentsEditing'),_0x8d98af=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3ab2d5,'change:state',(_0x5d6f37,_0x21bb7b,_0x413af8)=>{_0x28ece4['isThreadsLoadingPaused']='connected'!==_0x413af8;});}),this['listenTo'](_0x3ab2d5,'change:state',(_0x226a03,_0x59ba0c,_0x1b5334)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1b5334);}),_0x8d98af['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x51e259{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 _0x51e259{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x1d98d3)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x566890];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5c16b3){super(_0x5c16b3);const _0x3b7211=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x3b7211);}async['init'](){const _0x463e30=this['editor']['plugins']['get'](l),_0x1525a6=_0x463e30['serverHistory'],_0x27a732=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x1525a6,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x463e30['sessionId']});const _0x49659e=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x523a64=await _0xa0c2f8['isBundleUploaded'](_0x27a732['connection'],_0x49659e);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x49a786})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x49a786)),'updateRevisions':async _0x5448d9=>{await this['_waitForServiceReady']();const _0x160545=this['_revisionTracker']['currentRevision'];if(_0x523a64&&0x1===_0x5448d9['length']&&_0x5448d9[0x0]['id']===_0x160545['id'])return _0x5448d9;for(const _0x100f33 of _0x5448d9)_0x100f33['id']===_0x160545['id']&&(_0x100f33['isEmptyCurrent']=_0x100f33['fromVersion']===_0x100f33['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x5448d9,this['_lastRequestId'])['then'](_0x2a2cb6=>(this['_lastRequestId']=_0x2a2cb6,_0x5448d9))['catch'](_0x1c11bb=>{if(b(_0x1c11bb)||'400'===_0x1c11bb['code']&&void 0x0!==_0x1c11bb['data']['wrongRequestId']){for(const _0x1da98e of _0x5448d9){!this['_revisionTracker']['repository']['getRevision'](_0x1da98e['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1da98e['id'],_0x1da98e,!0x1);}if(b(_0x1c11bb))throw _0x1c11bb;return _0x5448d9;}throw _0x1c11bb;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x51b592,{revisionsData:_0x114a0b,requestId:_0x3bda66})=>{Math['max'](..._0x114a0b['map'](_0x5e62c1=>_0x5e62c1['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x114a0b,_0x3bda66);}):this['_handleRevisionsUpdate'](_0x114a0b,_0x3bda66);});const {revisions:_0x2a7d2d,requestId:_0x41215b}=await this['_revisionHistoryService']['connect'](_0x27a732['connection']);_0x27a732['addToReconnectionStack'](this),this['_lastRequestId']=_0x41215b,await this['_fetchMissingUsers'](_0x2a7d2d);for(const _0x381d52 of _0x2a7d2d)this['_revisionTracker']['addRevisionData'](_0x381d52);this['listenTo'](_0x463e30,'change:_isConnected',(_0xf6c8dc,_0x490895,_0x184d3d)=>{_0x184d3d&&(this['_oldOffset']=_0x463e30['_offset'],_0xf6c8dc['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x27a732,'state',_0x3191a4=>_0x3191a4===_0x32a08a['CONNECTED']);}async['reconnect'](){const _0x440a7f=this['editor']['plugins']['get'](n),_0x3368e9=this['editor']['plugins']['get'](l),_0x5eb504=async()=>{const _0x2c8d2c=this['_revisionTracker']['currentRevision'],_0x2ef1a9=_0x2c8d2c['id'],_0x47f5ac=_0x2ef1a9!==_0x3368e9['sessionId'];if(_0x47f5ac){const _0x44718e=_0x3368e9['_offset']-this['_oldOffset'],_0x5e2790=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2c8d2c['toVersion']+_0x44718e!==_0x5e2790){const _0x3f019c=_0x2c8d2c['fromVersion']+_0x44718e,_0x5c5262=this['editor']['plugins']['get'](_0x566890),_0x53fcba=this['_revisionTracker']['buildRevisionData']({'revision':_0x2c8d2c,'from':_0x3f019c,'to':_0x5e2790});_0x53fcba['id']=_0x2c8d2c['id'];const _0x202159=_0x53fcba['authorsIds']['map'](_0x449346=>_0x5c5262['getUser'](_0x449346));_0x2c8d2c['_update']({..._0x53fcba,'authors':_0x202159},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2c8d2c['id'],_0x53fcba,!0x0);}this['_revisionTracker']['_startingVersion']=_0x5e2790,(_0x2c8d2c['toVersion']===_0x2c8d2c['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2ef1a9)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2ef1a9),this['_revisionTracker']['_createCurrentRevision'](_0x5e2790));}const {revisions:_0x20c9b2,requestId:_0x511f2f}=await this['_revisionHistoryService']['reconnect'](_0x440a7f['connection'],this['_lastRequestId']);_0x47f5ac&&_0x20c9b2['length']>0x0?_0x3368e9['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x20c9b2),this['_handleRevisionsUpdate'](_0x20c9b2,_0x511f2f),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3368e9['_isConnected']?_0x5eb504():new Promise((_0x4514b4,_0x3d8ebd)=>{_0x3368e9['once']('change:_isConnected',()=>{_0x5eb504()['then'](_0x4514b4)['catch'](_0x3d8ebd);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4b6f37=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x1bd764=>{_0x1bd764['off'](),_0x4b6f37();});});}['_getLatestVersionFromServerOperations'](){const _0x41f931=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x103a46 of _0x41f931)if('marker'!==_0x103a46['type']||_0x103a46['affectsData'])return _0x103a46['baseVersion']+0x1;}['_getLatestVersion'](){const _0x3aa8bb=this['editor']['plugins']['get'](l);return new Promise(_0xdb7dec=>{_0x3aa8bb['_isPendingUpdate']?_0x3aa8bb['once']('change:_isPendingUpdate',()=>{_0xdb7dec(this['_getLatestVersionFromServerOperations']());}):_0xdb7dec(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3f393a,_0x74e07c){const _0x511397=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x74e07c;for(const _0x4abc0b of _0x3f393a){const _0x6bfd7e=_0x511397['getRevision'](_0x4abc0b['id']);if(_0x6bfd7e){if((_0x4abc0b['fromVersion']||_0x4abc0b['toVersion'])&&(_0x4abc0b['diffData']=null),_0x6bfd7e===this['_revisionTracker']['currentRevision']){const _0x5328ee=Math['max'](_0x6bfd7e['toVersion'],_0x4abc0b['toVersion']),_0x110d98=Math['max'](_0x6bfd7e['fromVersion'],_0x4abc0b['fromVersion']);let _0x2920d2;_0x6bfd7e['toVersion']===_0x4abc0b['toVersion']&&_0x6bfd7e['fromVersion']===_0x4abc0b['fromVersion']?(_0x2920d2=!0x0,this['_preventResendingRevisionData'](_0x4abc0b)):_0x4abc0b['toVersion']===_0x5328ee&&_0x4abc0b['fromVersion']===_0x110d98?_0x2920d2=!0x1:(_0x6bfd7e['toVersion']===_0x5328ee&&_0x6bfd7e['fromVersion']===_0x110d98||this['_fixRevision']({'revision':_0x6bfd7e,'from':_0x110d98,'to':_0x5328ee}),_0x2920d2=!0x0),_0x2920d2&&(delete _0x4abc0b['fromVersion'],delete _0x4abc0b['toVersion'],delete _0x4abc0b['diffData'],delete _0x4abc0b['createdAt'],delete _0x4abc0b['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4abc0b),this['_preventResendingRevisionData'](_0x4abc0b);}else this['_revisionTracker']['addRevisionData'](_0x4abc0b);}const _0x1de027=_0x511397['getRevisions']();_0x1de027['reverse']();for(let _0x40d30c=0x0;_0x40d30c<_0x1de027['length']-0x1;_0x40d30c++){const _0x44853a=_0x1de027[_0x40d30c],_0x52d552=_0x1de027[_0x40d30c+0x1];if(_0x44853a['fromVersion']<_0x52d552['toVersion']){const _0x52c172=_0x52d552['toVersion'],_0x15f75e=Math['max'](_0x52c172,_0x44853a['toVersion']);this['_fixRevision']({'revision':_0x44853a,'from':_0x52c172,'to':_0x15f75e});}}}['_fixRevision']({revision:_0x5432ed,from:_0x5794b2,to:_0x512582}={}){const _0xf08ad5=this['editor']['plugins']['get'](_0x566890),_0x42d78c=this['_revisionTracker']['buildRevisionData']({'revision':_0x5432ed,'from':_0x5794b2,'to':_0x512582});_0x42d78c['authors']=_0x42d78c['authorsIds']['map'](_0x302c86=>_0xf08ad5['getUser'](_0x302c86)),_0x5432ed['_update'](_0x42d78c);}['_preventResendingRevisionData'](_0x140650){const _0x14b14={};_0x14b14['id']=_0x140650['id'];for(const _0x1f3c1f of Object['keys'](_0x140650))'id'!==_0x1f3c1f&&(_0x14b14[_0x1f3c1f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x14b14['id'],_0x14b14,!0x0);}async['_fetchMissingUsers'](_0x4e1c19){const _0x292765=this['editor']['plugins']['get'](_0x566890),{connection:_0x15cc17}=this['editor']['plugins']['get'](n),_0x142f5c=new Set();for(const _0xb7763e of _0x4e1c19){for(const _0x484402 of _0xb7763e['authorsIds'])_0x505192(_0x484402);_0xb7763e['creatorId']&&_0x505192(_0xb7763e['creatorId']);}if(0x0===_0x142f5c['size'])return;const _0x57f108=await ct['getMany'](_0x15cc17,Array['from'](_0x142f5c));for(const _0x4850fe of _0x57f108)_0x292765['getUser'](_0x4850fe['id'])||_0x292765['addUser'](_0x4850fe);function _0x505192(_0x5166bf){_0x292765['getUser'](_0x5166bf)||_0x142f5c['add'](_0x5166bf);}}}function b(_0x32edab){return _0x32edab['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x32edab['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x32edab['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x51e259{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class U extends _0x542b5b{['_collapseAt'];constructor(_0x25495a,_0x36a912=0x6){super(_0x25495a);const _0x2dfa21=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x36a912,this['bind']('isHidden')['to'](this,'usersCount',_0x26374b=>_0x26374b<_0x36a912),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x2dfa21['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':_0x2dfa21['to']('usersCount',_0xb1dbb1=>'+'+(_0xb1dbb1-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x542b5b{['items'];['keystrokes'];constructor(_0x2c651c){super(_0x2c651c);const _0x1bfff1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x17f45a(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1bfff1['if']('hasPopup'),'aria-expanded':_0x1bfff1['to']('isExpanded',_0x2aaefd=>this['hasPopup']&&String(_0x2aaefd)),'aria-label':_0x1bfff1['to']('hasPopup',_0xb97717=>$(_0x2c651c,_0xb97717?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1bfff1['to']('hasPopup',_0x59db04=>!!_0x59db04&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x1bfff1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x1bfff1['to'](_0x48eb32=>{const _0x1d0cf5=_0x48eb32,_0x9bbadc=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1fbe09=document['querySelector']('.ck-balloon-panel_with-arrow');_0x9bbadc?.['contains'](_0x1d0cf5['relatedTarget'])||_0x1fbe09?.['contains'](_0x1d0cf5['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2b2c5c,_0x49d3cb,_0x78d573)=>{this['element']&&(_0x78d573?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 P extends _0x542b5b{['counterView'];['inlineListView'];constructor(_0x13ee9e,_0x233ec0=0x6){super(_0x13ee9e);const _0x368290=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new U(this['locale'],_0x233ec0),this['inlineListView']=new is(_0x13ee9e),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2dc793 of this['inlineListView']['items'])_0x2dc793['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',_0x368290['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class D extends _0x542b5b{['listWrapperView'];constructor(_0x5132cd,_0x3bb157){super(_0x5132cd);const _0x1c70eb=this['bindTemplate'];this['listWrapperView']=new ut(_0x5132cd,_0x3bb157),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x5132cd,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1c70eb['to'](_0x5f3809=>{const _0x509465=_0x5f3809,_0x4ea319=document['querySelector']('.ck-presence-list__list'),_0x41edd7=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4ea319?.['contains'](_0x509465['relatedTarget'])||_0x41edd7?.['contains'](_0x509465['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x520492{constructor(_0x1fe3c3,_0x3c29f0){super(_0x1fe3c3);const _0x415370=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x3c29f0?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x415370['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x415370['to']('role'),'aria-label':_0x415370['to']('ariaLabel'),'aria-labelledby':_0x415370['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x221dd7['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x489f72=this['element'];_0x489f72&&(this['_isScrollable']=Math['max'](_0x489f72['scrollHeight'],_0x489f72['clientHeight'])>0.8*window['innerHeight']);}}class V extends et{['userView'];constructor(_0x4806c9,_0x4949e2,_0x239699){super(_0x4806c9);const _0x78d0b0=this['bindTemplate'];this['userView']=new st(_0x4806c9,_0x4949e2);const _0x13ea81={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4949e2['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4949e2['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4949e2['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x239699&&(_0x13ea81['tag']='button',_0x13ea81['on']={'click':_0x78d0b0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x13ea81);}['focus'](){this['element']['focus']();}}class E extends _0x542b5b{['userView'];['markerView'];constructor(_0x2c4bbb,_0x39de82,_0x5b6edd){super(_0x2c4bbb);const _0x298d7c=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x2c4bbb,_0x39de82),this['markerView']=new ot(_0x2c4bbb,_0x39de82);const _0x1ad00d=new it(_0x2c4bbb);_0x1ad00d['template']['tag']='span',_0x1ad00d['text']=_0x39de82['name'];const _0x3e0c54={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x298d7c['to']('isFocusable',_0x2988e5=>!!_0x2988e5&&0x0),'aria-labelledby':_0x1ad00d['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x298d7c['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x298d7c['to']('hasTooltip',_0xa9a319=>!_0xa9a319),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1ad00d]};_0x5b6edd&&(_0x3e0c54['tag']='button',_0x3e0c54['on']={'click':_0x298d7c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3e0c54);}}class ot extends _0x542b5b{constructor(_0x266dcb,_0x420a8c){super(_0x266dcb),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x420a8c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const M={'collapseAt':0x6,'displayMe':!0x0};class r extends _0xcfca57{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c8925){super(_0x3c8925),this['context']['config']['define']('presenceList',M);const _0x260f47=_0x3c8925['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x260f47)throw new _0x1ad561('presencelist-collapseat-invalid-format',this);if(_0x260f47<0x1)throw new _0x1ad561('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0xa42536(),this['balloonPanelView']=new _0x3fcd28(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x172a4c of this['_allConnectedUsers'])this['_handleUserAdd'](_0x172a4c);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5ca858,_0x24e576)=>{this['_handleUserAdd'](_0x24e576);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2a5ae4,_0x4ea6a5)=>{this['_handleUserRemove'](_0x4ea6a5);});}['_createView'](){const _0x53e595=this['context'],_0x361a86=new P(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x130d6c=this['balloonPanelView'];if(!_0x20cc7f(_0x53e595['config']['get']('presenceList.container')))throw new _0x1ad561('presencelist-missing-container',this);return _0x361a86['counterView']['bind']('usersCount')['to'](this),_0x361a86['bind']('isCollapsed')['to'](this,'usersCount',_0x4a5e9c=>{const {collapseAt:_0xcff525}=_0x53e595['config']['get']('presenceList'),_0x33948b=_0x4a5e9c>=_0xcff525;if(_0x33948b&&!_0x361a86['inlineListView']['items']['find'](_0x3973ed=>_0x3973ed instanceof U)){const _0xdbc0ab=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xdbc0ab&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x361a86['inlineListView']['items']['add'](_0x361a86['counterView']);}return _0x33948b||this['hideDropdown'](),_0x33948b;}),_0x361a86['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x46e1d5=>{const _0x3aba94=_0x53e595['config']['get']('presenceList'),_0x494f1e=new E(_0x53e595['locale'],_0x46e1d5,!!_0x3aba94['onClick']);return _0x494f1e['bind']('hasTooltip')['to'](_0x361a86,'isCollapsed',_0xae1031=>!_0xae1031),_0x494f1e['bind']('isFocusable')['to'](_0x361a86,'isCollapsed',_0x1706af=>!_0x1706af),_0x3aba94['onClick']&&this['listenTo'](_0x494f1e,'execute',()=>{this['view']['isCollapsed']||_0x3aba94['onClick'](_0x46e1d5,_0x494f1e['element']);}),_0x494f1e;}),this['listenTo'](_0x361a86['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x361a86['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x361a86['inlineListView']['keystrokes']['set']('Enter',(_0x586158,_0x299e15)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x299e15());}),_0x361a86['render'](),_0x130d6c['render'](),_0x1ed94d({'emitter':_0x361a86,'activator':()=>_0x130d6c['isVisible'],'contextElements':[_0x130d6c['element'],_0x361a86['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x53e595['config']['get']('presenceList.container')['appendChild'](_0x361a86['element']),this['_bodyCollection']=new _0x388128(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x361a86;}['_handleUserAdd'](_0x389337){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x389337['isMe'])return;const _0x4bb421=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x4bb421-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x483690=_0x389337['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x389337,_0x483690);}['_handleUserRemove'](_0x472e18){this['usersCount']--;const {collapseAt:_0x201730}=this['context']['config']['get']('presenceList'),_0x4c3118=this['usersCount']>=_0x201730;if(this['currentDisplayedUsers']['get'](_0x472e18['id']))this['currentDisplayedUsers']['remove'](_0x472e18['id']);else{if(_0x4c3118&&this['currentDisplayedUsers']['length']+0x1===_0x201730-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x4c3118?0x1:0x0)<this['usersCount']){for(const _0x5e9051 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5e9051['id'])&&(this['currentDisplayedUsers']['add'](_0x5e9051,Math['min'](this['currentDisplayedUsers']['length']-(_0x4c3118?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x4c3118?0x1:0x0)===_0x201730-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0xd909db=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new D(this['context']['locale'],!!_0xd909db['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x85c6c4}=this['presenceDropdownView'];_0x85c6c4['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5b9508=>{if(!_0xd909db['displayMe']&&_0x5b9508['isMe'])return null;const _0x57eb66=new V(this['context']['locale'],_0x5b9508,!!_0xd909db['onClick']);return _0xd909db['onClick']&&this['listenTo'](_0x57eb66,'execute',()=>{_0xd909db['onClick'](_0x5b9508,_0x57eb66['element']);}),_0x57eb66;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x85c6c4['focus'](),_0x85c6c4['checkIfScrollable']();const _0x47d3f7=(_0x4b51e5,_0x139631)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x139631();};_0x85c6c4['keystrokes']['set']('Esc',_0x47d3f7),_0x85c6c4['keystrokes']['set']('Shift+Tab',_0x47d3f7),_0x85c6c4['keystrokes']['set']('Tab',(_0x1ef784,_0x470db9)=>{!function(_0x161c8e){const _0x3a4af8=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x57b434=>_0x57b434+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x51fe59=[...document['body']['querySelectorAll'](_0x3a4af8)]['filter'](_0x32737f=>_0x32737f===document['activeElement']||_0x32737f['offsetWidth']+_0x32737f['offsetHeight']>0x0)['sort']((_0x353efd,_0x57c5f2)=>(_0x353efd['tabIndex']||0x0)-(_0x57c5f2['tabIndex']||0x0)),_0x46d51f=_0x51fe59['indexOf'](_0x161c8e),_0x238796=_0x51fe59[(_0x46d51f+0x1)%_0x51fe59['length']];_0x238796&&_0x238796['focus']();}(this['view']['element']),this['hideDropdown'](),_0x470db9();}),_0x85c6c4['focusTracker']['add'](this['view']['element']),_0x85c6c4['focusTracker']['on']('change:isFocused',(_0x1d19ec,_0x3fcb02,_0x174343)=>{_0x174343||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0xcfca57{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x33ae3c,Plugin as _0xdfadc0,PendingActions as _0x2ac7cc,Context as _0x39aa3f}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x72feab,CKEditorError as _0x1918b5,Collection as _0xa88889,global as _0x5586e3,version as nt,uid as _0x27b270,KeystrokeHandler as _0x45f8df}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3d92e2,View as _0x3dc104,ListView as _0x116b4c,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x1aeeca,clickOutsideHandler as _0x1126c3,BodyCollection as _0x3e2feb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x528005,History as _0x376849,NoOperation as _0x2948a2,InsertOperation as _0x25df19,MarkerOperation as _0x4e5372,RootAttributeOperation as _0x8ef2bf,transformOperationSets as _0x1a9e4a,OperationFactory as _0x110153}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0xb7a2de,User as lt,CommentsService as _0x5c856c,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x432691,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1131fd}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x18f043}from'es-toolkit/compat';class n extends _0x33ae3c{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3d92e2];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa53ddd){super(_0xa53ddd),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x72feab())();}['init'](){const _0x2470f2=this['context'],_0x2bf840=_0x2470f2['plugins']['get']('CloudServices'),_0x12350d=_0x2470f2['plugins']['get'](_0x3d92e2);if(!_0x2bf840['token'])throw new _0x1918b5('websocketgateway-missing-token',this);if(!_0x2bf840['webSocketUrl'])throw new _0x1918b5('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'](_0x2bf840['token'],_0x2bf840['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x48cd7=>{if(this['connection']=_0x48cd7,this['bind']('state')['to'](_0x48cd7,'state',this,'_isBrowserOffline',(_0x245579,_0x135913)=>('connected'!==_0x245579&&(this['_shouldPluginsReconnect']=!0x0),_0x135913||_0x245579!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x1cc6df,_0x5b166e)=>{if('limitExceeded'!==_0x5b166e['code'])throw console['error'](_0x5b166e),new _0x1918b5('cloudservices-init',null,{'originalError':_0x5b166e});_0x12350d['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'});}),!_0x48cd7['me'])return new Promise(_0x29dbd7=>_0x48cd7['on']('change:me',_0x29dbd7));})['catch'](_0x2ff1e2=>{throw console['error'](_0x2ff1e2),new _0x1918b5('cloudservices-init',null,{'originalError':_0x2ff1e2});});}['addToReconnectionStack'](_0x306726){if('function'!=typeof _0x306726['reconnect'])throw new _0x1918b5('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x306726))throw new _0x1918b5('websocketgateway-plugin-already-registered',this,{'name':_0x306726['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x306726);}['removeFromReconnectionStack'](_0x540acf){this['_reconnectionStack']['delete'](_0x540acf);}['isInReconnectionStack'](_0x564590){return this['_reconnectionStack']['has'](_0x564590);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4fd31f=>_0x4fd31f['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x32d5b4=>{throw console['error'](_0x32d5b4),new _0x1918b5('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x33ae3c{['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,_0x432691];}constructor(_0x65e4ae){super(_0x65e4ae),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0xa88889(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x432691);}['init'](){const _0x536505=this['context']['plugins']['get'](n);this['listenTo'](_0x536505,'change:state',(_0x188079,_0x243b9d,_0x187d3b)=>{if('connected'!==_0x187d3b)this['channelSessions']['forEach'](_0x3a3b89=>_0x3a3b89['clear']()),this['channelConnectedUsers']['forEach'](_0x325223=>_0x325223['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3d4108,_0x2cf005]of this['_registeredSessions'])for(const _0x8932a6 of _0x2cf005)this['_handleSessionAdd'](_0x3d4108,_0x8932a6);}}),this['_createUser'](_0x536505['connection']['me'],!0x0);}['register'](_0x15376c,_0x584ca5){if(this['_registeredSessions']['has'](_0x15376c))throw new _0x1918b5('sessions-register-already-registered',null,{'channelId':_0x15376c});this['_registeredSessions']['set'](_0x15376c,_0x584ca5),this['channelSessions']['set'](_0x15376c,new _0xa88889()),this['channelConnectedUsers']['set'](_0x15376c,new _0xa88889()),this['listenTo'](_0x584ca5,'add',(_0x20ea18,_0x3bfabd)=>this['_handleSessionAdd'](_0x15376c,_0x3bfabd)),this['listenTo'](_0x584ca5,'remove',(_0x2a48a3,_0x124eaa)=>this['_handleSessionRemove'](_0x15376c,_0x124eaa));for(const _0x5aefb8 of _0x584ca5)this['_handleSessionAdd'](_0x15376c,_0x5aefb8);}['unregister'](_0x314ca5){if(!this['_registeredSessions']['has'](_0x314ca5))throw new _0x1918b5('sessions-unregister-not-exist',null,{'channelId':_0x314ca5});const _0xb2b663=this['_registeredSessions']['get'](_0x314ca5);this['stopListening'](_0xb2b663);for(const _0x453a88 of _0xb2b663)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x314ca5,_0x453a88);this['_registeredSessions']['delete'](_0x314ca5),this['channelSessions']['delete'](_0x314ca5),this['channelConnectedUsers']['delete'](_0x314ca5);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x110a63){for(const _0x126d26 of this['channelSessions']['values']())for(const _0x396ada of _0x126d26)if(_0x396ada['id']===_0x110a63)return _0x396ada['user'];}['getUserSessions'](_0x52a567,_0x504d14){const _0x420fdb=_0x504d14?[this['channelSessions']['get'](_0x504d14)]:this['channelSessions']['values'](),_0x32a376=new Set();for(const _0x3bbdcf of _0x420fdb)for(const _0x434cc3 of _0x3bbdcf)_0x434cc3['user']['id']===_0x52a567['id']&&_0x32a376['add'](_0x434cc3['id']);return _0x32a376;}['getUserRole'](_0x28a7f6){for(const _0xe1c69c of this['channelSessions']['values']())for(const _0x582a4c of _0xe1c69c)if(_0x582a4c['user']===_0x28a7f6)return _0x582a4c['role'];}['_handleSessionAdd'](_0x32eeae,_0x4a73eb){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3982df=_0x4a73eb['user'],_0x44bd0a=this['_users']['getUser'](_0x3982df['id'])||this['_createUser'](_0x3982df),_0x3a2b07=Object['assign']({},_0x4a73eb,{'user':_0x44bd0a});if(this['channelSessions']['get'](_0x32eeae)['add'](_0x3a2b07),!_0x3982df['hiddenInPresenceList']){const _0x4f58cf=this['channelConnectedUsers']['get'](_0x32eeae);_0x4f58cf['has'](_0x44bd0a['id'])||_0x4f58cf['add'](_0x44bd0a),this['allConnectedUsers']['has'](_0x44bd0a['id'])||_0x3982df['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x44bd0a,_0x44bd0a['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x32eeae,{'channelId':_0x32eeae,'session':_0x3a2b07});}['_handleSessionRemove'](_0x2392c9,_0x154432){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3b908a=this['channelConnectedUsers']['get'](_0x2392c9),_0x2bb9f2=_0x154432['user'];_0x2bb9f2['id']&&(this['channelSessions']['get'](_0x2392c9)['remove'](_0x154432['id']),_0x3b908a['has'](_0x2bb9f2['id'])&&!this['getUserSessions'](_0x2bb9f2,_0x2392c9)['size']&&_0x3b908a['remove'](_0x2bb9f2['id']),this['allConnectedUsers']['get'](_0x2bb9f2['id'])&&!this['getUserSessions'](_0x2bb9f2)['size']&&this['allConnectedUsers']['remove'](_0x2bb9f2['id']));}['_createUser'](_0x5dc2d4,_0x44f08f){const _0xa7c531=this['_users']['addUser'](_0x5dc2d4);return _0x44f08f&&this['_users']['defineMe'](_0x5dc2d4['id']),_0xa7c531['orderNumber']=this['_uniqueUsersCount']++,_0xa7c531;}}class H extends _0xdfadc0{['_domEmitter']=new(_0x72feab())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x367f85=this['editor'],_0x4f6440=_0x367f85['plugins']['get'](i);_0x367f85['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x49d776,{writer:_0x34675b})=>function(_0x3db8cc,_0x2c894c,_0x4d0dd6,_0x206b79){const _0x2f7c86=_0x3db8cc['markerName']['split'](':')[0x2],_0x26d9a3=_0x4d0dd6['getUserBySessionId'](_0x2f7c86);if(!_0x26d9a3||_0x2f7c86===_0x4d0dd6['mySessionId'])return;if(!_0x206b79['model']['schema']['checkChild'](_0x3db8cc['markerRange']['start'],'$text'))return;const _0x350236={'class':'ck-user__marker\x20'+_0x26d9a3['color']['getMarkerClass'](),'data-name':_0x26d9a3['name'],'data-session-id':_0x2f7c86},_0x77211e=_0x206b79['model']['markers']['get'](_0x3db8cc['markerName']),_0x201d0b=_0x77211e['getStart'](),_0x2993fd=_0x201d0b['nodeAfter'],_0x314b52=_0x206b79['model']['schema'];if(_0x2993fd&&_0x314b52['isObject'](_0x2993fd)&&_0x314b52['isInline'](_0x2993fd)&&!_0x206b79['model']['markers']['get']('user:range:'+_0x2f7c86)['getRange']()['isCollapsed'])return;const _0x261da7=_0x201d0b['parent'];return _0x206b79['model']['schema']['isLimit'](_0x261da7)&&!_0x206b79['model']['hasContent'](_0x261da7)&&(_0x350236['contenteditable']=!0x1),function(_0x49f194,_0x59fd20,_0x4b8e0a){const _0x55d772=_0x49f194['createUIElement']('span',_0x59fd20);return _0x49f194['setCustomProperty']('userPositionMarker',!0x0,_0x55d772),_0x55d772['render']=function(_0x23f3ab){const _0x25db9c=this['toDomElement'](_0x23f3ab),_0x249703=document['createElement']('span');return _0x249703['classList']['add']('ck-user__marker-tooltip'),_0x249703['setAttribute']('contenteditable','false'),_0x249703['setAttribute']('spellcheck','false'),_0x249703['textContent']=_0x4b8e0a['name'],_0x25db9c['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x249703['outerHTML']+'⁠',_0x25db9c['addEventListener']('mouseenter',()=>{_0x25db9c['classList']['add']('ck-user__marker_hovered');}),_0x25db9c['addEventListener']('mouseleave',()=>{_0x25db9c['classList']['remove']('ck-user__marker_hovered');}),_0x25db9c;},_0x55d772['isSimilar']=function(_0x2e262c){return!(!this['getCustomProperty']('userPositionMarker')||!_0x2e262c['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x2e262c['getAttribute']('data-session-id'));},_0x55d772;}(_0x2c894c,_0x350236,_0x26d9a3);}(_0x49d776,_0x34675b,_0x4f6440,_0x367f85)}),_0x367f85['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x44a8e5=>function(_0x390bed,_0x351994){const _0x410e6e=_0x390bed['markerName']['split'](':')[0x2];if(_0x410e6e===_0x351994['mySessionId'])return null;const _0x1efc43=_0x351994['getUserBySessionId'](_0x410e6e);if(!_0x1efc43)return{'id':_0x410e6e,'classes':[]};return{'id':_0x410e6e,'classes':['ck-user__selection',_0x1efc43['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x410e6e},'priority':0x7d0+_0x1efc43['orderNumber']};}(_0x44a8e5,_0x4f6440)}),function(_0x189c9c){const _0x37e0a9=_0x189c9c['model'],_0x5421a8=new Map(),_0x805411=_0x189c9c['plugins']['get'](i);_0x37e0a9['markers']['on']('update:user:range',(_0x1ac159,_0x4ba75e,_0x3b36bf,_0x29ff67)=>{if(!_0x29ff67&&_0x5421a8['get'](_0x4ba75e['name']))return _0x5421a8['get'](_0x4ba75e['name'])['detach'](),void _0x5421a8['delete'](_0x4ba75e['name']);const _0x2af9df=_0x4ba75e['name']['split'](':')[0x2];if(_0x2af9df===_0x805411['mySessionId'])return;const _0x5389db='user:position:'+_0x2af9df;_0x37e0a9['markers']['has'](_0x5389db)&&_0x189c9c['editing']['reconvertMarker'](_0x5389db),_0x4ba75e['on']('change:range',(_0x8a089d,_0x243239,_0x681b32)=>{if('$graveyard'!=_0x243239['root']['rootName']&&'$graveyard'==_0x4ba75e['getRange']()['root']['rootName']&&!_0x5421a8['has'](_0x4ba75e['name'])){const _0x2419bc=_0x37e0a9['schema']['getNearestSelectionRange'](_0x681b32['deletionPosition']);if(_0x2419bc){const _0x5bf038=_0x528005['fromRange'](_0x2419bc);_0x5421a8['set'](_0x4ba75e['name'],_0x5bf038),_0x5bf038['on']('change:range',(_0x422df4,_0x1d7b87,_0x470e8c)=>{if('$graveyard'==_0x5bf038['root']['rootName']){const _0x14fe6a=_0x37e0a9['schema']['getNearestSelectionRange'](_0x470e8c['deletionPosition']);_0x14fe6a?(_0x5bf038['start']=_0x14fe6a['start'],_0x5bf038['end']=_0x14fe6a['end']):(_0x5421a8['delete'](_0x4ba75e['name']),_0x5bf038['detach']());}});}}});}),_0x37e0a9['document']['on']('change',()=>{_0x5421a8['size']>0x0&&_0x37e0a9['enqueueChange']({'isUndoable':!0x1},_0x28713f=>{for(const [_0x846562,_0x28046b]of _0x5421a8)'$graveyard'==_0x37e0a9['markers']['get'](_0x846562)['getRange']()['root']['rootName']&&(Z(_0x846562['split'](':')[0x2],_0x28046b['toRange'](),_0x37e0a9,_0x28713f),_0x28046b['detach']());_0x5421a8['clear']();});});}(_0x367f85),this['_domEmitter']['listenTo'](_0x5586e3['document'],'keydown',(_0x13586e,{key:_0x3f0d98})=>{'Escape'===_0x3f0d98&&function(_0x4d9a9e){_0x4d9a9e['editing']['view']['change'](_0x3c8f62=>{for(const _0x5132d2 of _0x4d9a9e['model']['markers']){if(!_0x5132d2['name']['startsWith']('user:position'))continue;const _0x37d99d=_0x4d9a9e['editing']['mapper']['markerNameToElements'](_0x5132d2['name']);if(_0x37d99d){for(const _0x55c196 of _0x37d99d)_0x3c8f62['removeClass']('ck-user__marker_hovered',_0x55c196);}}});}(_0x367f85);},{'useCapture':!0x0});}['afterInit'](){const _0x35e705=this['editor'],_0x2c7dd7=_0x35e705['commands']['get']('undo');_0x2c7dd7&&_0x35e705['model']['on']('applyOperation',(_0x25c18b,_0x5e490f)=>{const _0x51f830=_0x5e490f[0x0];if(!_0x51f830['isDocumentOperation'])return;if('marker'!=_0x51f830['type']||!_0x51f830['name']['startsWith']('user:'))return;const _0x59839a=_0x51f830['batch'];_0x2c7dd7['_createdBatches']['has'](_0x59839a)&&(_0x51f830['newRange']=_0x51f830['oldRange']?_0x35e705['model']['createRange'](_0x51f830['oldRange']['start'],_0x51f830['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x2cbdcd=this['editor'],_0x5f10f4=_0x2cbdcd['model']['document'],_0x1e1836=_0x2cbdcd['plugins']['get'](i);_0x2cbdcd['model']['enqueueChange']({'isUndoable':!0x1},_0x38df74=>{const _0x479ebe='user:range:'+_0x1e1836['mySessionId'],_0x38ba89='user:position:'+_0x1e1836['mySessionId'],_0xa7364c=_0x2cbdcd['model']['markers']['has'](_0x479ebe);_0x2cbdcd['editing']['view']['hasDomSelection']?Z(_0x1e1836['mySessionId'],_0x5f10f4['selection']['getFirstRange'](),_0x2cbdcd['model'],_0x38df74):_0xa7364c&&(_0x38df74['removeMarker'](_0x479ebe),_0x38df74['removeMarker'](_0x38ba89));});}}function Z(_0x3e300f,_0x4a299d,_0x408a59,_0x5b330b){const _0x10a683='user:range:'+_0x3e300f,_0x3ecac5='user:position:'+_0x3e300f,_0x340d48=_0x4a299d['getContainedElement']();let _0x3154b8=_0x4a299d['start'];if(_0x340d48&&_0x340d48['is']('element','tableCell')){const _0x5909d5=function(_0x18f247,_0x53dd3d){for(const _0x884827 of _0x18f247['getPositions']())if(_0x53dd3d['schema']['checkChild'](_0x884827,'$text'))return _0x884827;}(_0x4a299d,_0x408a59);_0x5909d5&&(_0x3154b8=_0x5909d5,_0x4a299d=_0x5b330b['createRange'](_0x3154b8));}const _0x9c921c=_0x5b330b['createRange'](_0x3154b8);_0x408a59['markers']['has'](_0x10a683)?(_0x5b330b['updateMarker'](_0x10a683,{'range':_0x4a299d}),_0x5b330b['updateMarker'](_0x3ecac5,{'range':_0x9c921c})):(_0x5b330b['addMarker'](_0x10a683,{'range':_0x4a299d,'usingOperation':!0x0}),_0x5b330b['addMarker'](_0x3ecac5,{'range':_0x9c921c,'usingOperation':!0x0}));}function V(_0x37bca9,_0x25bbf5,_0x4446a4){const _0x2f4782=_0x37bca9['t'],t=_0x37bca9['t'];switch(_0x25bbf5){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 _0x2f4782({'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'},_0x4446a4);default:return'';}}let G=0x1;class l extends _0xdfadc0{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0xb7a2de)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0x2ac7cc,_0x432691,_0x3d92e2];}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 _0x11fff7=this['serverHistory']['getOperations']();for(let _0x35da7b=_0x11fff7['length']-0x1;_0x35da7b>=0x0;_0x35da7b--){const _0x82a9bf=_0x11fff7[_0x35da7b];if(!this['_disconnectionOperations']['has'](_0x82a9bf))return _0x82a9bf['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x5d23c3){if(super(_0x5d23c3),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x376849(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x1918b5('collaboration-missing-channelid',this);const _0x1a04f8=_0x5d23c3['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x1a04f8,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1131fd(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new J(this['_disconnectionOperations']);}['init'](){const _0x327f47=this['editor'],_0x4fe6c5=_0x327f47['plugins']['get'](_0x432691),_0x11af99=_0x327f47['plugins']['get'](n);this['listenTo'](_0x4fe6c5,'getOperationAuthor',(_0x3c0e69,_0x4b2f09)=>{const _0x51be91=_0x4b2f09[0x0];_0x51be91['_authorId']&&(_0x3c0e69['return']=_0x4fe6c5['getUser'](_0x51be91['_authorId']),_0x3c0e69['stop']()),null===_0x51be91['_authorId']&&(_0x3c0e69['return']=null,_0x3c0e69['stop']());},{'priority':'high'}),this['listenTo'](_0x327f47['model']['document']['selection'],'change:range',(_0x4e6bff,_0x1ff8e6)=>{_0x1ff8e6['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x327f47['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x327f47['model']['on']('applyOperation',(_0x39a043,_0x434502)=>{const _0x26ff8c=_0x434502[0x0];_0x26ff8c['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x26ff8c),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x11af99,'state',this,'_hasSynchronizationProblem',(_0x20756e,_0x287354)=>'connected'===_0x20756e&&!_0x287354),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x327f47['disableReadOnlyMode']('rtc-offline'):_0x327f47['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x327f47['disableReadOnlyMode']('rtc-offline'):_0x327f47['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x344da8=this['editor']['plugins']['get'](i),_0x1858f2=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x344da8['unregister'](this['_channelId']);const _0x17df29=await this['_service']['reconnect'](_0x1858f2['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x17df29)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x22486d=await this['_service']['getConnectedSessions']();_0x344da8['register'](this['_channelId'],_0x22486d),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x421506){if(function(_0x4291e3){return'404'===_0x4291e3['code'];}(_0x421506)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4ec070){return'409'===_0x4ec070['code'];}(_0x421506)){const _0x4f1777=V(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x4f1777);}else{if(!(_0x421506 instanceof $))throw _0x421506;this['_handleReconnectionError']();}}}}['destroy'](){const _0x13037e=this['editor']['plugins']['get'](n),_0x1109cd=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x1109cd['channelSessions']['has'](this['_channelId'])&&_0x1109cd['unregister'](this['_channelId']),_0x13037e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x2c3b07){if(this['sessionId']!==_0x2c3b07['sessionId']&&this['_lastSyncedOperationId']!==_0x2c3b07['lastOperationId'])throw new $();return this['sessionId']=_0x2c3b07['sessionId'],this['_handleServerResponse']([],{..._0x2c3b07,'wereChangesApplied':!0x1,'data':_0x2c3b07['data']},'reconnect');}async['_connectService'](_0x1c273f,_0x1897ef=!0x1){const {connection:_0x1e8c49}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1e8c49,this['_channelId'])['then'](_0x4890b8=>this['_initSessionsHandling'](_0x4890b8))['catch'](_0x444936=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x444936);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4d3d38,_0xb54999)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xb54999);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x1b0bf6=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1c273f);this['_isPendingUpdate']=!0x0;const _0x552dac=await this['_service']['connect'](_0x1e8c49,this['_compressOperations'](_0x1c273f),_0x1b0bf6);if(this['sessionId']=_0x552dac['sessionId'],_0x1897ef){if(!_0x552dac['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x552dac['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1c273f,_0x552dac,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x552dac,_0x1c273f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x5309dd=this['editor']['plugins']['get'](i),_0x25f029=this['editor']['plugins']['get'](H),_0x371bf7=_0x5309dd['channelSessions']['get'](this['_channelId']);_0x371bf7&&_0x371bf7['length']>0x1?_0x25f029['createUserMarkerOperations']():this['listenTo'](_0x5309dd,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x5309dd['channelSessions']['get'](this['_channelId'])['length']&&_0x25f029['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3ac881,_0x102be0,_0x319406,_0x5c4877){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x102be0){const _0xab7a78=this['_decompressOperations'](_0x319406,_0x5c4877);await this['_fetchMissingUsers'](_0xab7a78),this['_handleExternalOperations'](_0xab7a78,_0x102be0,_0x319406['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x31696c}=this['editor'];let _0x5bbac8;try{_0x5bbac8=await this['_service']['getDocumentDetails']();}catch{const _0x4c114c=V(_0x31696c,'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'](_0x4c114c);}const _0x45a218=_0x5bbac8['currentDocumentSession']||_0x5bbac8['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x45a218['lastOperationId']){const _0x4c5f07=V(_0x31696c,'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'](_0x4c5f07);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x2c9e04){const _0x1e1863=this['editor']['plugins']['get'](i);this['listenTo'](_0x1e1863,'sessionAdd:'+this['_channelId'],(_0x573cd4,{session:_0x146e5e})=>{if(_0x146e5e['id']===_0x1e1863['mySessionId']){_0x573cd4['off']();const _0x2a619e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x57ce0d=_0x146e5e['permissions'];_0x2a619e&&_0x2a619e['isEnabled']&&(_0x57ce0d=_0x57ce0d['filter'](_0x4ca34f=>'document:write'!==_0x4ca34f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x57ce0d,this['_channelId']);}}),_0x1e1863['register'](this['_channelId'],_0x2c9e04);}['_initThrowingOnDataSet'](){const _0x4a6709=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1657d6)=>{if(!_0x1657d6[_0x1657d6['length']-0x1]['suppressErrorInCollaboration'])throw new _0x1918b5('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x4a6709['apply'](this['editor']['data'],_0x1657d6);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x510eca,[_0x24a674])=>{if(this['_document']['version'])throw new _0x1918b5('realtimecollaborationclient-init-document-already-initialized',this);_0x510eca['stop'](),this['_setPendingAction']();const _0x57bfc9=this['editor']['config']['get']('rootsAttributes'),_0x5a9634=this['_getOperationsFromInitData'](_0x24a674,_0x57bfc9);0x0==_0x5a9634['length']&&_0x5a9634['push'](new _0x2948a2(0x0)),_0x510eca['return']=this['_connectService'](_0x5a9634)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x41885a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x41885a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3b198f,[_0x208297,_0xca0a7d])=>{_0x3b198f['stop']();const _0x8ab8e9=this['editor']['model']['document']['getRoot'](_0x208297);if(!this['_knownRootNames']['has'](_0x208297)){const _0x8e10f4=_0xca0a7d&&_0xca0a7d['data']?_0xca0a7d['data']:'',_0x21449c=_0xca0a7d&&_0xca0a7d['attributes']?_0xca0a7d['attributes']:{};await this['_loadRoot'](_0x208297,_0x8e10f4,_0x21449c);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x8ab8e9['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x8ab8e9);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1382e9){const _0x3d675f=this['editor']['plugins']['get'](_0x432691),{connection:_0x2f5bce}=this['editor']['plugins']['get'](n),_0x52c200=new Set();for(const _0x4b7dbf of _0x1382e9){const _0x342d7f=_0x4b7dbf['_authorId'];_0x342d7f&&!_0x3d675f['getUser'](_0x342d7f)&&_0x52c200['add'](_0x342d7f);}if(0x0===_0x52c200['size'])return;const _0x5f2c0b=await lt['getMany'](_0x2f5bce,Array['from'](_0x52c200));for(const _0x381d02 of _0x5f2c0b)_0x3d675f['getUser'](_0x381d02['id'])||_0x3d675f['addUser'](_0x381d02);}['_getOperationsFromInitData'](_0x51cecc,_0x5673da={}){const _0x538f76=this['editor']['model'],_0x4ed27d=[];let _0x49875b=0x0;const _0x2a9bfd='string'==typeof _0x51cecc?{'main':_0x51cecc}:_0x51cecc;for(const _0x2baf81 of Object['keys'](_0x2a9bfd)){if(!this['_document']['roots']['has'](_0x2baf81))throw new _0x1918b5('realtimecollaborationclient-init-non-existent-root',this);const _0x37a325=this['editor']['data']['parse'](_0x2a9bfd[_0x2baf81]),_0x18c6c1=this['_document']['getRoot'](_0x2baf81),_0x32a649=new _0x25df19(_0x538f76['createPositionAt'](_0x18c6c1,0x0),_0x37a325,_0x49875b++);_0x4ed27d['push'](_0x32a649);for(const [_0x12142b,_0x20a3ef]of _0x37a325['markers']){const _0x4e77b8=_0x538f76['createRange'](_0x538f76['createPositionFromPath'](_0x18c6c1,_0x20a3ef['start']['path']['slice']()),_0x538f76['createPositionFromPath'](_0x18c6c1,_0x20a3ef['end']['path']['slice']())),_0x26be6c=new _0x4e5372(_0x12142b,null,_0x4e77b8,_0x538f76['markers'],!0x0,_0x49875b++);_0x4ed27d['push'](_0x26be6c);}}if(_0x5673da)for(const [_0x2d1598,_0x362d46]of Object['entries'](_0x5673da)){const _0x2bbfb6=_0x538f76['document']['getRoot'](_0x2d1598);if(!_0x2bbfb6)throw new _0x1918b5('multi-root-editor-root-attributes-no-root',null);for(const [_0xa560ab,_0x1f9892]of Object['entries'](_0x362d46))if(null!==_0x1f9892){const _0x1181c1=new _0x8ef2bf(_0x2bbfb6,_0xa560ab,null,_0x1f9892,_0x49875b++);_0x4ed27d['push'](_0x1181c1);}}return _0x4ed27d;}async['_loadRoot'](_0x108a0c,_0x4927b1,_0x2aeec3){this['_getOperationsFromInitData']({[_0x108a0c]:_0x4927b1},{[_0x108a0c]:_0x2aeec3})['forEach']((_0x3ae645,_0x3f7628)=>{_0x3ae645['baseVersion']=this['_document']['version']+_0x3f7628,_0x3ae645['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x3ae645);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x379194,_0x2b7373){let _0x2edf29;this['_offset']=_0x379194['offset'];const _0x3c6310=_0x379194['wereChangesApplied']&&!_0x379194['initData'],_0x15f9cd=_0x3c6310?0x0:_0x379194['data']['baseVersion'];if(_0x2b7373['forEach'](_0x16daf4=>{_0x16daf4['_isInit']=!0x0,_0x16daf4['createdAt']=_0x379194['sessionCreatedAt'],_0x16daf4['_authorId']=null;}),_0x3c6310)_0x2edf29=_0x2b7373,this['_applyOperationsSet'](_0x2edf29,_0x3c6310);else{if(_0x379194['initData']){const _0x30fb8e=this['_getOperationsFromInitData'](_0x379194['initData']);this['_document']['history']['version']=-_0x30fb8e['length'],_0x30fb8e['forEach'](_0x4bf8f9=>{_0x4bf8f9['baseVersion']-=_0x30fb8e['length'],_0x4bf8f9['createdAt']=_0x379194['sessionCreatedAt'],_0x4bf8f9['_isInit']=!0x0,_0x4bf8f9['_authorId']=null;}),this['_applyOperationsSet'](_0x30fb8e,!0x0),this['serverHistory']['version']=-_0x30fb8e['length']+this['_offset'],this['_updateServerHistory'](_0x30fb8e);}this['_document']['history']['version']=_0x15f9cd,_0x2edf29=this['_decompressOperations'](_0x379194['data'],_0x379194['metadata']),await this['_fetchMissingUsers'](_0x2edf29),this['_applyOperationsSet'](_0x2edf29,_0x3c6310);}_0x379194['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2edf29,_0x379194['lastOperationId']),this['_lastSyncedOperationId']=_0x379194['lastOperationId']),this['serverHistory']['version']=_0x15f9cd+this['_offset'],this['_updateServerHistory'](_0x2edf29),_0x2b7373['filter'](_0x1f65d6=>{const _0xdda5ff=this['_getAffectedRoot'](_0x1f65d6);return _0xdda5ff&&!this['_knownRootNames']['has'](_0xdda5ff);})['forEach']((_0x44c4cc,_0x5354ae)=>{_0x44c4cc['baseVersion']=this['_document']['version']+_0x5354ae,this['_saveOperationInBuffer'](_0x44c4cc);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x7fc547,_0x268440){const _0x5868d3=_0x268440&&_0x268440['message'];if(_0x5868d3&&_0x5868d3['startsWith']('realtimecollaborationclient'))throw _0x268440;const _0x28029a=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x28029a['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x1918b5(_0x7fc547,this['editor'],_0x5868d3?{'originalError':_0x5868d3}:void 0x0);}['_saveOperationInBuffer'](_0x469831){this['_knownOperations']['has'](_0x469831)||(this['_knownOperations']['add'](_0x469831),this['_bufferedOperations']['push'](_0x469831),this['_pendingAction']||'marker'==_0x469831['type']&&!_0x469831['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x38ed61=!0x1){!_0x38ed61&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x45eac9=>{_0x45eac9&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x17dafb=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5614c3){return _0x5614c3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5614c3['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5614c3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x17dafb)||this['_crash'](_0x17dafb['message'],_0x17dafb);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x10145d=>{this['on']('change:_isPendingUpdate',()=>{_0x10145d();});});}async['_sendBufferedOperations'](){const _0x135f68=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x135f68['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x33613d=[...this['_bufferedOperations']];for(const _0x5ef4ef of _0x33613d)_0x5ef4ef['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5ef4ef);const _0x2a4bd8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x33613d),_0x2bce3c=G++,_0x133927=this['_compressOperations'](_0x33613d),_0x10d379=await this['_service']['sendOperations'](_0x133927,_0x133927['baseVersion'],_0x2a4bd8);try{return await this['_handleServerResponse'](_0x33613d,_0x10d379,_0x2bce3c);}catch(_0x51409f){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x51409f);}}async['_handleServerResponse'](_0x132725,_0x28fab6,_0x552d5f){if('error'in _0x28fab6)throw _0x28fab6['error'];let _0x46fa53=!0x1;if(_0x28fab6['wereChangesApplied']){_0x28fab6['lastOperationId']&&(this['_lastSyncedOperationId']=_0x28fab6['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x48b484=>!_0x132725['includes'](_0x48b484));for(const _0x48afd0 of _0x132725)_0x48afd0['createdAt']='lastOperationAcceptedAt'in _0x28fab6&&_0x28fab6['lastOperationAcceptedAt']||void 0x0;K(_0x132725,_0x28fab6['version']-_0x132725['length']),this['_updateServerHistory'](_0x132725);const _0x3e624b=_0x132725['filter'](_0x2bd799=>{if(!_0x2bd799['_isInit'])return!0x1;const _0x38ca0c=this['_getAffectedRoot'](_0x2bd799);return _0x38ca0c&&!this['_knownRootNames']['has'](_0x38ca0c);});K(_0x3e624b,this['_document']['version']),this['_applyOperationsSet'](_0x3e624b),_0x46fa53=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xea4c62=this['_decompressOperations'](_0x28fab6['data'],_0x28fab6['metadata'])['filter'](_0x89397d=>_0x89397d['baseVersion']>=this['_lastServerVersion']);_0xea4c62['forEach'](_0x20e456=>this['_addKnownRoot'](_0x20e456)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x23b64e=>!_0x23b64e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x23b64e))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xea4c62),_0x46fa53=this['_handleExternalOperations'](_0xea4c62,_0x28fab6['version'],_0x28fab6['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x46fa53?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x548888,_0x2dcbca,_0x452677){try{const _0x5af550={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x40bacc,operationsB:_0x52293e,originalOperations:_0x3841d3}=_0x1a9e4a(_0x548888,this['_bufferedOperations'],_0x5af550);K(_0x40bacc,this['_document']['version']),K(_0x52293e,_0x2dcbca);for(const _0x11aa41 of _0x40bacc){const _0x545079=_0x3841d3['get'](_0x11aa41);_0x11aa41['_authorId']=_0x545079?_0x545079['_authorId']:null;}_0x452677&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x548888,_0x452677),this['_lastSyncedOperationId']=_0x452677),this['_bufferedOperations']=[..._0x52293e],this['_applyOperationsSet'](_0x40bacc),this['_updateServerHistory'](_0x548888);}catch(_0x5e28f4){return console['error'](_0x5e28f4),!0x1;}return!0x0;}['_applyOperationsSet'](_0x56692a,_0x6e0932=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0xc85fba=>{for(const _0x5d8e5a of _0x56692a)this['_knownOperations']['add'](_0x5d8e5a),this['_addKnownRoot'](_0x5d8e5a),_0xc85fba['batch']['addOperation'](_0x5d8e5a),this['editor']['model']['applyOperation'](_0x5d8e5a);});}['_addKnownRoot'](_0x2869da){const _0x29ed26=this['_getAffectedRoot'](_0x2869da);_0x29ed26&&this['_knownRootNames']['add'](_0x29ed26);}['_getAffectedRoot'](_0x5f5dd7){let _0x4c4261,_0x1bb95a;switch(_0x5f5dd7['type']){case'insert':_0x4c4261=_0x5f5dd7['position']['root'];break;case'marker':if(_0x1bb95a=_0x5f5dd7['newRange'],!_0x1bb95a)return null;_0x4c4261=_0x1bb95a['root'];break;case'addRootAttribute':_0x4c4261=_0x5f5dd7['root'];break;case'addRoot':_0x4c4261=_0x5f5dd7['affectedSelectable'];break;case'move':_0x4c4261=_0x5f5dd7['targetPosition']['root'];break;default:return null;}return _0x4c4261['rootName'];}['_updateServerHistory'](_0x139c78){_0x139c78['forEach'](_0x52ed91=>{const _0x719c97=_0x52ed91['clone']();_0x719c97['_authorId']=_0x52ed91['_authorId'],_0x719c97['_isInit']=!!_0x52ed91['_isInit'],_0x719c97['createdAt']=_0x52ed91['createdAt'],_0x719c97['baseVersion']+=this['_offset'],_0x52ed91['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x719c97),this['serverHistory']['addOperation'](_0x719c97);});}['_handleReconnectionError'](_0x37b986){const _0x1fcc3d=this['editor']['plugins']['get']('Notification'),_0x1237f7=this['editor']['locale'];_0x37b986||(_0x37b986=V(_0x1237f7,'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.')),_0x1fcc3d['showWarning'](_0x37b986,{'title':V(_0x1237f7,'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'](_0x2ac7cc)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2ac7cc)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x50c605){const _0xb2532d=_0x50c605['map'](_0x3cceab=>_0x3cceab['toJSON']());return this['_compressor']['compress'](_0xb2532d);}['_decompressOperations'](_0x19d839,_0x173569){return this['_compressor']['decompress'](_0x19d839)['map']((_0xc2324c,_0x49828c)=>{const _0x5e2ea4='init'==_0x173569[_0x49828c]['type'];if('InsertOperation'==_0xc2324c['__className']){const _0x3bc78b=_0xc2324c['position']['root'];!this['_document']['getRoot'](_0x3bc78b)&&(this['_document']['createRoot']('$root',_0x3bc78b)['_isAttached']=!0x1);}const _0x3d0911=_0x110153['fromJSON'](_0xc2324c,this['_document']);return _0x3d0911['wasUndone']=_0xc2324c['wasUndone'],_0x3d0911['_isInit']=_0x5e2ea4,_0x3d0911['_authorId']=_0x5e2ea4?null:_0x173569[_0x49828c]['userId'],_0x3d0911['_isDisconnection']='cs:removeUser'===_0x173569[_0x49828c]['type'],_0x3d0911['createdAt']=_0x173569[_0x49828c]['createdAt'],_0x3d0911;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x480c48=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x480c48&&_0x480c48['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x543a74,_0x31540a){for(const _0x26d7cd of _0x543a74)_0x26d7cd['baseVersion']=_0x31540a++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x4acf6b){this['_ignoredOperations']=_0x4acf6b,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x22855b){let _0x3ba6ed=_0x22855b['length'];for(;_0x3ba6ed--;){const _0x506a02=_0x22855b[_0x3ba6ed];if(!this['_ignoredOperations']['has'](_0x506a02)){if(!this['_operationToId']['has'](_0x506a02)){const _0x11a943=_0x27b270()['slice'](0x1,0x12);this['_operationToId']['set'](_0x506a02,_0x11a943);}return this['_operationToId']['get'](_0x506a02);}}}['setIdForTheLastOperation'](_0x6f4627,_0x4e7cca){if(!_0x4e7cca)return;let _0x54447f=_0x6f4627['length'];for(;_0x54447f--;){const _0x2afe6d=_0x6f4627[_0x54447f];this['_ignoredOperations']['has'](_0x2afe6d)||this['_operationToId']['set'](_0x2afe6d,_0x4e7cca);}}}class a extends _0xdfadc0{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x33ae3c{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x5c856c)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x432691];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5367fd){super(_0x5367fd),this['_services']=new Map();}async['init'](){const _0x11fee6=this['context'],_0x17a02e=_0x11fee6['plugins']['get']('CommentsRepository');if(_0x11fee6['plugins']['get'](n)['addToReconnectionStack'](this),_0x17a02e['adapter']={'addCommentThread':async({channelId:_0x3dab3d,threadId:_0x5d414d,comments:_0x5ae9d3,resolvedAt:_0x3d93e5,resolvedBy:_0x43bfba,context:_0x4308f5,attributes:_0x460ec1})=>{const _0x3d50fb=await this['_getService'](_0x3dab3d)['addCommentThread']({'commentThreadId':_0x5d414d,'comments':_0x5ae9d3['map'](_0x4e3298=>function(_0x10d18a,_0x1f958f,_0xe34020){return{'commentThreadId':_0xe34020,'commentId':_0x10d18a['commentId'],'userId':_0x10d18a['authorId'],'content':_0x10d18a['content'],'documentId':_0x1f958f,'createdAt':_0x10d18a['createdAt'],'attributes':_0x10d18a['attributes']||{}};}(_0x4e3298,_0x3dab3d,_0x5d414d)),'resolvedAt':_0x3d93e5,'resolvedBy':_0x43bfba,'context':_0x4308f5,'attributes':_0x460ec1})['catch'](dt);return{'threadId':_0x3d50fb['commentThreadId'],'comments':_0x3d50fb['comments']};},'getCommentThread':async({channelId:_0x15fedd,threadId:_0x459592})=>{const _0x7e3ca8=await this['_getService'](_0x15fedd)['getCommentThread'](_0x459592)['catch'](F)['catch'](dt);return _0x7e3ca8?_0x7e3ca8['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x7e3ca8]),{'threadId':_0x7e3ca8['commentThreadId'],'comments':_0x7e3ca8['comments']['map'](S),'context':_0x7e3ca8['context'],'resolvedAt':_0x7e3ca8['resolvedAt'],'resolvedBy':_0x7e3ca8['resolvedBy'],'attributes':_0x7e3ca8['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x35984a,threadId:_0x250a76,context:_0x3bb6a6,unlinkedAt:_0x3abc0b,attributes:_0x2c6d17})=>this['_getService'](_0x35984a)['updateCommentThread']({'commentThreadId':_0x250a76,'context':_0x3bb6a6,'attributes':_0x2c6d17,'unlinkedAt':_0x3abc0b})['catch'](F)['catch'](dt),'resolveCommentThread':async({channelId:_0x146cab,threadId:_0x14573b})=>{const _0x9032a1=await this['_getService'](_0x146cab)['resolveCommentThread'](_0x14573b)['catch'](F)['catch'](dt);return{'threadId':_0x9032a1['commentThreadId'],'resolvedAt':_0x9032a1['resolvedAt'],'resolvedBy':_0x9032a1['resolvedBy']};},'reopenCommentThread':async({channelId:_0x238a44,threadId:_0x45be92})=>this['_getService'](_0x238a44)['reopenCommentThread'](_0x45be92)['catch'](F)['catch'](dt),'removeCommentThread':({channelId:_0x37fe25,threadId:_0x13ab82})=>this['_getService'](_0x37fe25)['removeCommentThread'](_0x13ab82)['catch'](F)['catch'](dt),'addComment':({channelId:_0x3200e7,threadId:_0x140f04,commentId:_0x1e1c0b,content:_0x1cfdfe,attributes:_0x55fe42})=>this['_getService'](_0x3200e7)['addComment'](_0x140f04,_0x1e1c0b,_0x1cfdfe,_0x55fe42)['catch'](dt),'updateComment':({channelId:_0x528e09,threadId:_0xc8544d,commentId:_0xc1ceb5,content:_0x2b617c,attributes:_0x4b4644})=>this['_getService'](_0x528e09)['updateComment'](_0xc8544d,_0xc1ceb5,_0x2b617c,_0x4b4644)['catch'](F)['catch'](dt),'removeComment':({channelId:_0x53a433,threadId:_0x40d310,commentId:_0x3cce7c})=>this['_getService'](_0x53a433)['removeComment'](_0x40d310,_0x3cce7c)['catch'](F)['catch'](dt)},_0x11fee6 instanceof _0x39aa3f){const _0x1cd14f=_0x11fee6['config']['get']('collaboration.channelId'),_0x460b99=_0x11fee6['plugins']['get'](i);await this['_setUpService'](_0x1cd14f);const _0x1a7737=await this['_services']['get'](_0x1cd14f)['getConnectedSessions']();this['listenTo'](_0x460b99,'sessionAdd:'+_0x1cd14f,(_0x53113c,{session:_0x72cba5})=>{_0x72cba5['id']===_0x460b99['mySessionId']&&(_0x53113c['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x72cba5['permissions'],_0x1cd14f));}),_0x460b99['register'](_0x1cd14f,_0x1a7737);}}async['_setUpService'](_0x4672e7){if(this['_services']['has'](_0x4672e7))throw new _0x1918b5('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4672e7});const _0x555090=this['context']['plugins']['get']('CommentsRepository'),_0x515823=new s['CommentsService'](_0x4672e7);this['_services']['set'](_0x4672e7,_0x515823),this['listenTo'](_0x515823,'commentThreadAdded',(_0x30ff56,_0x1394eb)=>{const {commentThreadId:_0x3af2f2,documentId:_0x1619f1,context:_0x4584ae,attributes:_0x215546,resolvedAt:_0xbfe578,resolvedBy:_0xa0c6d2,comments:_0xbe09f3}=_0x1394eb;_0x555090['getCommentThread'](_0x3af2f2)||_0x555090['addCommentThread']({'threadId':_0x3af2f2,'channelId':_0x1619f1,'comments':_0xbe09f3?_0xbe09f3['map'](S):[],'context':_0x4584ae,'attributes':_0x215546,'resolvedAt':_0xbfe578,'resolvedBy':_0xa0c6d2,'isFromAdapter':!0x0});}),this['listenTo'](_0x515823,'commentThreadUpdated',(_0x47f8b5,{commentThreadId:_0x398825,documentId:_0x347452,context:_0x54b33a,unlinkedAt:_0x54e8f5,attributes:_0x39302d})=>{_0x555090['getCommentThread'](_0x398825)&&_0x555090['updateCommentThread']({'threadId':_0x398825,'channelId':_0x347452,'context':_0x54b33a,'unlinkedAt':_0x54e8f5,'attributes':_0x39302d,'isFromAdapter':!0x0});}),this['listenTo'](_0x515823,'commentThreadResolved',(_0x52a4bc,{commentThreadId:_0x1aa99b,resolvedBy:_0x2a4b92,resolvedAt:_0x3b9128})=>{const _0x3d4042=_0x555090['getCommentThread'](_0x1aa99b);_0x3d4042&&_0x3d4042['resolve']({'resolvedBy':_0x2a4b92,'resolvedAt':_0x3b9128,'isFromAdapter':!0x0});}),this['listenTo'](_0x515823,'commentThreadReopened',(_0x2854d3,{commentThreadId:_0x270ce0})=>{const _0xa7a1c6=_0x555090['getCommentThread'](_0x270ce0);_0xa7a1c6&&_0xa7a1c6['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x515823,'commentThreadRemoved',(_0x292b59,{commentThreadId:_0x5929dc})=>{const _0x17e4b5=_0x555090['getCommentThread'](_0x5929dc);_0x17e4b5&&_0x17e4b5['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x515823,'commentAdded',(_0x49661d,_0x5664bd)=>{const _0x41db2=_0x5664bd['commentThreadId'],_0x5e2c47=_0x555090['getCommentThread'](_0x41db2);_0x5e2c47&&_0x5e2c47['addComment']({...S(_0x5664bd),'isFromAdapter':!0x0});}),this['listenTo'](_0x515823,'commentUpdated',(_0x578891,{commentThreadId:_0x50b356,commentId:_0x3bc676,content:_0x248325,attributes:_0x5d36e3})=>{const _0x466e01=_0x555090['getCommentThread'](_0x50b356);if(_0x466e01){const _0x137e2a=_0x466e01['getComment'](_0x3bc676);_0x137e2a&&_0x137e2a['update']({'content':_0x248325,'attributes':_0x5d36e3,'isFromAdapter':!0x0});}}),this['listenTo'](_0x515823,'commentRemoved',(_0x458c88,{commentThreadId:_0x2a21d6,commentId:_0x14f2dc})=>{const _0x2adb31=_0x555090['getCommentThread'](_0x2a21d6);if(_0x2adb31){const _0x475341=_0x2adb31['getComment'](_0x14f2dc);_0x475341&&_0x475341['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4672e7);}['destroy'](){if(this['context']instanceof _0x39aa3f){const _0x217193=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x217193);}}['_terminateService'](_0x31bbc5){if(!this['_services']['has'](_0x31bbc5))throw new _0x1918b5('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x31bbc5});this['_getService'](_0x31bbc5)['disconnect'](),this['_services']['delete'](_0x31bbc5);}async['reconnect'](){for(const _0x13d01e of this['_services']['keys']())await this['_connectService'](_0x13d01e);if(this['context']instanceof _0x39aa3f){const _0x2d1d94=this['context']['config']['get']('collaboration.channelId'),_0x1cb44a=this['context']['plugins']['get'](i);_0x1cb44a['unregister'](_0x2d1d94);const _0x123115=await this['_services']['get'](_0x2d1d94)['getConnectedSessions']();_0x1cb44a['register'](_0x2d1d94,_0x123115);}}async['_connectService'](_0x148e25){const {connection:_0x48d9f1}=this['context']['plugins']['get'](n),_0xa92d8b=this['context']['plugins']['get']('CommentsRepository'),_0x1535fa=this['_services']['get'](_0x148e25),_0x5d2dbb=await _0x1535fa['connect'](_0x48d9f1);await this['_fetchMissingUsersForThreads'](_0x5d2dbb);const _0x43aa1a=new Set(Array['from'](_0xa92d8b['getCommentThreads']({'channelId':_0x148e25}),_0x3f7290=>_0x3f7290['id']));for(const _0x26d09c of _0x5d2dbb)_0x26d09c['deletedAt']||_0x43aa1a['delete'](_0x26d09c['commentThreadId']);for(const _0x2feb16 of _0x43aa1a)_0xa92d8b['getCommentThread'](_0x2feb16)['remove']({'isFromAdapter':!0x0});for(const _0x5c398e of _0x5d2dbb){let _0x35555d=_0xa92d8b['getCommentThread'](_0x5c398e['commentThreadId']);const {commentThreadId:_0x5b081a,context:_0x453390,attributes:_0x68a92f,resolvedBy:_0x1688f7,resolvedAt:_0x4221fb,unlinkedAt:_0x42cbf6,deletedAt:_0x5d813a}=_0x5c398e;if(_0x5d813a)continue;_0x35555d||(_0x35555d=_0xa92d8b['addCommentThread']({'channelId':_0x148e25,'threadId':_0x5b081a,'context':_0x453390,'attributes':_0x68a92f||{},'resolvedBy':_0x1688f7,'resolvedAt':_0x4221fb,'unlinkedAt':_0x42cbf6,'isFromAdapter':!0x0}));const _0x421799=new Set(Array['from'](_0x35555d['comments'],_0x3ce864=>_0x3ce864['id']));for(const _0x3f674c of _0x5c398e['comments'])_0x421799['delete'](_0x3f674c['commentId']);for(const _0x117fff of _0x421799)_0x35555d['getComment'](_0x117fff)['remove']({'isFromAdapter':!0x0});for(const _0x52a30d of _0x5c398e['comments']){const _0x255d7c=_0x35555d['getComment'](_0x52a30d['commentId']);_0x255d7c?_0x255d7c['content']!==_0x52a30d['content']&&_0x255d7c['update']({'content':_0x52a30d['content'],'isFromAdapter':!0x0}):_0x35555d['addComment'](Object['assign'](S(_0x52a30d),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5878e0){if(!this['_services']['has'](_0x5878e0))throw new _0x1918b5('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5878e0});return this['_services']['get'](_0x5878e0);}async['_fetchMissingUsersForThreads'](_0x546a81){const _0x1ba662=this['context']['plugins']['get'](_0x432691),{connection:_0x59cc4e}=this['context']['plugins']['get'](n),_0x15db22=new Set();for(const {resolvedBy:_0x4deb70,comments:_0x26127e}of _0x546a81){_0x4deb70&&!_0x1ba662['getUser'](_0x4deb70)&&_0x15db22['add'](_0x4deb70);for(const {userId:_0x5e15bf}of _0x26127e)_0x1ba662['getUser'](_0x5e15bf)||_0x15db22['add'](_0x5e15bf);}if(0x0===_0x15db22['size'])return;const _0x20965f=await lt['getMany'](_0x59cc4e,Array['from'](_0x15db22));for(const _0x283291 of _0x20965f)_0x1ba662['getUser'](_0x283291['id'])||_0x1ba662['addUser'](_0x283291);}}async function F(_0x4fab62){if('404'!==_0x4fab62['code'])throw _0x4fab62;}function dt(_0x1bef79){if((_0xde0f72=_0x1bef79)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0xde0f72['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xde0f72['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0xde0f72;throw _0x1bef79;}function S(_0xfa9b34){return{'threadId':_0xfa9b34['commentThreadId'],'commentId':_0xfa9b34['commentId'],'content':_0xfa9b34['content'],'createdAt':_0xfa9b34['createdAt'],'authorId':_0xfa9b34['userId'],'attributes':_0xfa9b34['attributes']||{}};}class m extends _0xdfadc0{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(_0x564bee){super(_0x564bee);const _0x4dd60a=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4dd60a);}['init'](){const _0x4663fb=this['editor']['plugins']['get'](n),_0xf61f11=this['editor']['plugins']['get']('TrackChangesEditing');return _0xf61f11['adapter']={'getSuggestion':async _0x1f9a5c=>{await this['_waitForServiceReady']();const _0x2bc059=await this['_trackChangesService']['get'](_0x1f9a5c)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0x2bc059]),_0x2bc059;},'addSuggestion':async({id:_0x32f9a7,type:_0x3e757e,data:_0x21034a,originalSuggestionId:_0x1916e5,attributes:_0x1be342})=>{await this['_waitForServiceReady']();const _0x5918d1={'id':_0x32f9a7,'type':_0x3e757e,'data':_0x21034a,'originalSuggestionId':_0x1916e5,'attributes':_0x1be342},_0x3b1527=await this['_trackChangesService']['add'](_0x32f9a7,_0x3e757e,_0x21034a,_0x1916e5,_0x1be342)['catch'](_0xf1dada=>{if(ut(_0xf1dada))return new Promise(_0xa7a1=>{this['_bufferedRequests']['set'](_0x32f9a7,{'resolve':_0xa7a1,'suggestionData':_0x5918d1});});throw _0xf1dada;});return this['_bufferedRequests']['delete'](_0x32f9a7),_0x3b1527;},'updateSuggestion':async(_0x19c550,_0x317726)=>{if(await this['_waitForServiceReady'](),'open'!==_0x317726['state'])return this['_trackChangesService']['update'](_0x19c550,_0x317726)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x4cee32,_0x36e534)=>{_0xf61f11['hasSuggestion'](_0x36e534['id'])&&(_0xf61f11['getSuggestion'](_0x36e534['id'])['attributes']=_0x36e534['attributes']);}),this['_trackChangesService']['connect'](_0x4663fb['connection'])['then'](_0x2a2903=>(_0x4663fb['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2a2903)['then'](()=>{for(const _0x3cad1d of _0x2a2903){_0xf61f11['addSuggestionData'](_0x3cad1d)['_saved']=!0x0;}})));}async['reconnect'](){const _0x131edb=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x12f206}=this['editor']['plugins']['get'](n),_0x253ee6=await this['_trackChangesService']['connect'](_0x12f206);await this['_fetchMissingUsersForThreads'](_0x253ee6);for(const {suggestionData:_0x1a0e61,resolve:_0x23354b}of this['_bufferedRequests']['values']()){let _0x1e5f7d=_0x253ee6['find'](_0x539573=>_0x539573['id']===_0x1a0e61['id']);_0x1e5f7d||(_0x1e5f7d=await this['_trackChangesService']['add'](_0x1a0e61['id'],_0x1a0e61['type'],_0x1a0e61['data'],_0x1a0e61['originalSuggestionId'])),_0x23354b(_0x1e5f7d);}for(const _0x2a21b2 of _0x253ee6)_0x131edb['hasSuggestion'](_0x2a21b2['id'])||_0x131edb['addSuggestionData'](_0x2a21b2);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x507e3c=>{this['listenTo'](this['_trackChangesService'],'connected',_0x30673a=>{_0x30673a['off'](),_0x507e3c();});});}async['_fetchMissingUsersForThreads'](_0x254ab3){const _0x52b1da=this['editor']['plugins']['get'](_0x432691),{connection:_0x1d078a}=this['editor']['plugins']['get'](n),_0x9ed65=new Set();for(const {authorId:_0xf61d1c}of _0x254ab3)_0x52b1da['getUser'](_0xf61d1c)||_0x9ed65['add'](_0xf61d1c);if(0x0===_0x9ed65['size'])return;const _0x349f9b=await lt['getMany'](_0x1d078a,Array['from'](_0x9ed65));for(const _0x2bc7b3 of _0x349f9b)_0x52b1da['getUser'](_0x2bc7b3['id'])||_0x52b1da['addUser'](_0x2bc7b3);}}function k(_0x4326db){if(ut(_0x4326db))return new Promise(()=>{});throw _0x4326db;}function ut(_0x2fd892){return _0x2fd892['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2fd892['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0xdfadc0{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 _0x3af71e=this['editor']['plugins']['get'](n),_0x11811e=this['editor']['plugins']['get']('CommentsEditing'),_0x51bef5=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3af71e,'change:state',(_0x288660,_0x1194f1,_0x1cc0f4)=>{_0x11811e['isThreadsLoadingPaused']='connected'!==_0x1cc0f4;});}),this['listenTo'](_0x3af71e,'change:state',(_0x312317,_0x427892,_0x82295c)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x82295c);}),_0x51bef5['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0xdfadc0{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 _0xdfadc0{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x432691];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b1661){super(_0x3b1661);const _0x4cf91c=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x4cf91c);}async['init'](){const _0x4f4dd7=this['editor']['plugins']['get'](l),_0x2139cd=_0x4f4dd7['serverHistory'],_0xe3bcb1=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x2139cd,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4f4dd7['sessionId']});const _0x550d71=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5ace34=await tt['isBundleUploaded'](_0xe3bcb1['connection'],_0x550d71);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x276265})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x276265)),'updateRevisions':async _0x13cd8a=>{await this['_waitForServiceReady']();const _0x35743d=this['_revisionTracker']['currentRevision'];if(_0x5ace34&&0x1===_0x13cd8a['length']&&_0x13cd8a[0x0]['id']===_0x35743d['id'])return _0x13cd8a;for(const _0x29db37 of _0x13cd8a)_0x29db37['id']===_0x35743d['id']&&(_0x29db37['isEmptyCurrent']=_0x29db37['fromVersion']===_0x29db37['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x13cd8a,this['_lastRequestId'])['then'](_0x2f04b0=>(this['_lastRequestId']=_0x2f04b0,_0x13cd8a))['catch'](_0x44dc79=>{if(st(_0x44dc79)||'400'===_0x44dc79['code']&&void 0x0!==_0x44dc79['data']['wrongRequestId']){for(const _0x39e340 of _0x13cd8a){!this['_revisionTracker']['repository']['getRevision'](_0x39e340['id'])||this['_revisionTracker']['_bufferUpdate'](_0x39e340['id'],_0x39e340,!0x1);}if(st(_0x44dc79))throw _0x44dc79;return _0x13cd8a;}throw _0x44dc79;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x224a24,{revisionsData:_0x61be6b,requestId:_0x5ebcbf})=>{Math['max'](..._0x61be6b['map'](_0x473283=>_0x473283['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x61be6b,_0x5ebcbf);}):this['_handleRevisionsUpdate'](_0x61be6b,_0x5ebcbf);});const {revisions:_0x50ecda,requestId:_0x1d2dd8}=await this['_revisionHistoryService']['connect'](_0xe3bcb1['connection']);_0xe3bcb1['addToReconnectionStack'](this),this['_lastRequestId']=_0x1d2dd8,await this['_fetchMissingUsers'](_0x50ecda);for(const _0x55f2c5 of _0x50ecda)this['_revisionTracker']['addRevisionData'](_0x55f2c5);this['listenTo'](_0x4f4dd7,'change:_isConnected',(_0x2592db,_0x17c6d8,_0x325033)=>{_0x325033&&(this['_oldOffset']=_0x4f4dd7['_offset'],_0x2592db['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0xe3bcb1,'state',_0x41e91d=>_0x41e91d===te['CONNECTED']);}async['reconnect'](){const _0x453533=this['editor']['plugins']['get'](n),_0x42e19f=this['editor']['plugins']['get'](l),_0x477d9c=async()=>{const _0x38b9f5=this['_revisionTracker']['currentRevision'],_0x416c9a=_0x38b9f5['id'],_0x51e1e6=_0x416c9a!==_0x42e19f['sessionId'];if(_0x51e1e6){const _0x422a6b=_0x42e19f['_offset']-this['_oldOffset'],_0x2d0527=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x38b9f5['toVersion']+_0x422a6b!==_0x2d0527){const _0x1722a9=_0x38b9f5['fromVersion']+_0x422a6b,_0x538983=this['editor']['plugins']['get'](_0x432691),_0x300bde=this['_revisionTracker']['buildRevisionData']({'revision':_0x38b9f5,'from':_0x1722a9,'to':_0x2d0527});_0x300bde['id']=_0x38b9f5['id'];const _0x2a8f07=_0x300bde['authorsIds']['map'](_0x3b852d=>_0x538983['getUser'](_0x3b852d));_0x38b9f5['_update']({..._0x300bde,'authors':_0x2a8f07},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x38b9f5['id'],_0x300bde,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2d0527,(_0x38b9f5['toVersion']===_0x38b9f5['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x416c9a)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x416c9a),this['_revisionTracker']['_createCurrentRevision'](_0x2d0527));}const {revisions:_0x33d74a,requestId:_0x4bd23d}=await this['_revisionHistoryService']['reconnect'](_0x453533['connection'],this['_lastRequestId']);_0x51e1e6&&_0x33d74a['length']>0x0?_0x42e19f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x33d74a),this['_handleRevisionsUpdate'](_0x33d74a,_0x4bd23d),this['_revisionTracker']['sendBufferedUpdates']());};return _0x42e19f['_isConnected']?_0x477d9c():new Promise((_0x540341,_0xed5b)=>{_0x42e19f['once']('change:_isConnected',()=>{_0x477d9c()['then'](_0x540341)['catch'](_0xed5b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5770ae=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x46e79b=>{_0x46e79b['off'](),_0x5770ae();});});}['_getLatestVersionFromServerOperations'](){const _0xb91567=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x59a35 of _0xb91567)if('marker'!==_0x59a35['type']||_0x59a35['affectsData'])return _0x59a35['baseVersion']+0x1;}['_getLatestVersion'](){const _0x74aef2=this['editor']['plugins']['get'](l);return new Promise(_0x2e168c=>{_0x74aef2['_isPendingUpdate']?_0x74aef2['once']('change:_isPendingUpdate',()=>{_0x2e168c(this['_getLatestVersionFromServerOperations']());}):_0x2e168c(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5ae15a,_0x39c4d8){const _0x4f7500=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x39c4d8;for(const _0x15f45f of _0x5ae15a){const _0x249843=_0x4f7500['getRevision'](_0x15f45f['id']);if(_0x249843){if((_0x15f45f['fromVersion']||_0x15f45f['toVersion'])&&(_0x15f45f['diffData']=null),_0x249843===this['_revisionTracker']['currentRevision']){const _0x1ac293=Math['max'](_0x249843['toVersion'],_0x15f45f['toVersion']),_0x39a1f3=Math['max'](_0x249843['fromVersion'],_0x15f45f['fromVersion']);let _0x441f84;_0x249843['toVersion']===_0x15f45f['toVersion']&&_0x249843['fromVersion']===_0x15f45f['fromVersion']?(_0x441f84=!0x0,this['_preventResendingRevisionData'](_0x15f45f)):_0x15f45f['toVersion']===_0x1ac293&&_0x15f45f['fromVersion']===_0x39a1f3?_0x441f84=!0x1:(_0x249843['toVersion']===_0x1ac293&&_0x249843['fromVersion']===_0x39a1f3||this['_fixRevision']({'revision':_0x249843,'from':_0x39a1f3,'to':_0x1ac293}),_0x441f84=!0x0),_0x441f84&&(delete _0x15f45f['fromVersion'],delete _0x15f45f['toVersion'],delete _0x15f45f['diffData'],delete _0x15f45f['createdAt'],delete _0x15f45f['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x15f45f),this['_preventResendingRevisionData'](_0x15f45f);}else this['_revisionTracker']['addRevisionData'](_0x15f45f);}const _0x461122=_0x4f7500['getRevisions']();_0x461122['reverse']();for(let _0x5f394e=0x0;_0x5f394e<_0x461122['length']-0x1;_0x5f394e++){const _0x1e220e=_0x461122[_0x5f394e],_0x10bce9=_0x461122[_0x5f394e+0x1];if(_0x1e220e['fromVersion']<_0x10bce9['toVersion']){const _0x3c62e3=_0x10bce9['toVersion'],_0x275894=Math['max'](_0x3c62e3,_0x1e220e['toVersion']);this['_fixRevision']({'revision':_0x1e220e,'from':_0x3c62e3,'to':_0x275894});}}}['_fixRevision']({revision:_0x25f33a,from:_0x2eb75d,to:_0x4f9ea7}={}){const _0x88e46d=this['editor']['plugins']['get'](_0x432691),_0xd090d6=this['_revisionTracker']['buildRevisionData']({'revision':_0x25f33a,'from':_0x2eb75d,'to':_0x4f9ea7});_0xd090d6['authors']=_0xd090d6['authorsIds']['map'](_0x3bead1=>_0x88e46d['getUser'](_0x3bead1)),_0x25f33a['_update'](_0xd090d6);}['_preventResendingRevisionData'](_0xd19b3c){const _0x2b7b3f={};_0x2b7b3f['id']=_0xd19b3c['id'];for(const _0x207048 of Object['keys'](_0xd19b3c))'id'!==_0x207048&&(_0x2b7b3f[_0x207048]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2b7b3f['id'],_0x2b7b3f,!0x0);}async['_fetchMissingUsers'](_0x32d992){const _0x2e239d=this['editor']['plugins']['get'](_0x432691),{connection:_0x5d4252}=this['editor']['plugins']['get'](n),_0x336f90=new Set();for(const _0x5e42d4 of _0x32d992){for(const _0x4498bf of _0x5e42d4['authorsIds'])_0x327b46(_0x4498bf);_0x5e42d4['creatorId']&&_0x327b46(_0x5e42d4['creatorId']);}if(0x0===_0x336f90['size'])return;const _0x8918cd=await lt['getMany'](_0x5d4252,Array['from'](_0x336f90));for(const _0x290248 of _0x8918cd)_0x2e239d['getUser'](_0x290248['id'])||_0x2e239d['addUser'](_0x290248);function _0x327b46(_0x4c813c){_0x2e239d['getUser'](_0x4c813c)||_0x336f90['add'](_0x4c813c);}}}function st(_0x31fe79){return _0x31fe79['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x31fe79['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x31fe79['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0xdfadc0{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x3dc104{['_collapseAt'];constructor(_0x29aa68,_0x4fd768=0x6){super(_0x29aa68);const _0x226f82=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4fd768,this['bind']('isHidden')['to'](this,'usersCount',_0x39009b=>_0x39009b<_0x4fd768),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x226f82['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':_0x226f82['to']('usersCount',_0x2b2939=>'+'+(_0x2b2939-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x3dc104{['items'];['keystrokes'];constructor(_0x15904d){super(_0x15904d);const _0x54c0cf=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x45f8df(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x54c0cf['if']('hasPopup'),'aria-expanded':_0x54c0cf['to']('isExpanded',_0x330214=>this['hasPopup']&&String(_0x330214)),'aria-label':_0x54c0cf['to']('hasPopup',_0x5e1d45=>V(_0x15904d,_0x5e1d45?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x54c0cf['to']('hasPopup',_0x2b5983=>!!_0x2b5983&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x54c0cf['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x54c0cf['to'](_0x511d1b=>{const _0x19f42c=_0x511d1b,_0x48149c=document['querySelector']('.ck-presence-list__dropdown-list'),_0x265588=document['querySelector']('.ck-balloon-panel_with-arrow');_0x48149c?.['contains'](_0x19f42c['relatedTarget'])||_0x265588?.['contains'](_0x19f42c['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2c3433,_0x4e4d92,_0x28feb4)=>{this['element']&&(_0x28feb4?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x3dc104{['counterView'];['inlineListView'];constructor(_0xb264c3,_0xe55733=0x6){super(_0xb264c3);const _0x843c39=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0xe55733),this['inlineListView']=new is(_0xb264c3),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3c6617 of this['inlineListView']['items'])_0x3c6617['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',_0x843c39['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x3dc104{['listWrapperView'];constructor(_0xd81f2d,_0x8c2618){super(_0xd81f2d);const _0x4eb152=this['bindTemplate'];this['listWrapperView']=new pt(_0xd81f2d,_0x8c2618),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0xd81f2d,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x4eb152['to'](_0x305149=>{const _0x293222=_0x305149,_0x4d9b3f=document['querySelector']('.ck-presence-list__list'),_0x3d7845=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4d9b3f?.['contains'](_0x293222['relatedTarget'])||_0x3d7845?.['contains'](_0x293222['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x116b4c{constructor(_0x50b124,_0x50712b){super(_0x50b124);const _0x484c2d=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x50712b?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x484c2d['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x484c2d['to']('role'),'aria-label':_0x484c2d['to']('ariaLabel'),'aria-labelledby':_0x484c2d['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x5586e3['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x39658c=this['element'];_0x39658c&&(this['_isScrollable']=Math['max'](_0x39658c['scrollHeight'],_0x39658c['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x5d26db,_0x112e18,_0x4ae995){super(_0x5d26db);const _0x53ce18=this['bindTemplate'];this['userView']=new ct(_0x5d26db,_0x112e18);const _0x49588c={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x112e18['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x112e18['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x112e18['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4ae995&&(_0x49588c['tag']='button',_0x49588c['on']={'click':_0x53ce18['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x49588c);}['focus'](){this['element']['focus']();}}class A extends _0x3dc104{['userView'];['markerView'];constructor(_0x410a75,_0x7bd24,_0x38eb39){super(_0x410a75);const _0x1db100=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x410a75,_0x7bd24),this['markerView']=new at(_0x410a75,_0x7bd24);const _0x3c1ca8=new ot(_0x410a75);_0x3c1ca8['template']['tag']='span',_0x3c1ca8['text']=_0x7bd24['name'];const _0x331d79={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1db100['to']('isFocusable',_0x3b3c76=>!!_0x3b3c76&&0x0),'aria-labelledby':_0x3c1ca8['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1db100['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1db100['to']('hasTooltip',_0x3ef626=>!_0x3ef626),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x3c1ca8]};_0x38eb39&&(_0x331d79['tag']='button',_0x331d79['on']={'click':_0x1db100['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x331d79);}}class at extends _0x3dc104{constructor(_0x5df072,_0x3fec04){super(_0x5df072),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3fec04['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x33ae3c{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x435311){super(_0x435311),this['context']['config']['define']('presenceList',x);const _0x4c927d=_0x435311['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4c927d)throw new _0x1918b5('presencelist-collapseat-invalid-format',this);if(_0x4c927d<0x1)throw new _0x1918b5('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0xa88889(),this['balloonPanelView']=new _0x1aeeca(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x5c2d33 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5c2d33);this['listenTo'](this['_allConnectedUsers'],'add',(_0x79ac79,_0x2b60e1)=>{this['_handleUserAdd'](_0x2b60e1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x3f257e,_0xb01e37)=>{this['_handleUserRemove'](_0xb01e37);});}['_createView'](){const _0x1c614a=this['context'],_0xff11c4=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2cf6aa=this['balloonPanelView'];if(!_0x18f043(_0x1c614a['config']['get']('presenceList.container')))throw new _0x1918b5('presencelist-missing-container',this);return _0xff11c4['counterView']['bind']('usersCount')['to'](this),_0xff11c4['bind']('isCollapsed')['to'](this,'usersCount',_0x49db61=>{const {collapseAt:_0x1d7006}=_0x1c614a['config']['get']('presenceList'),_0x275cf8=_0x49db61>=_0x1d7006;if(_0x275cf8&&!_0xff11c4['inlineListView']['items']['find'](_0x4c0d43=>_0x4c0d43 instanceof b)){const _0x8e0840=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x8e0840&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0xff11c4['inlineListView']['items']['add'](_0xff11c4['counterView']);}return _0x275cf8||this['hideDropdown'](),_0x275cf8;}),_0xff11c4['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1e47cc=>{const _0x1a9277=_0x1c614a['config']['get']('presenceList'),_0x54eb60=new A(_0x1c614a['locale'],_0x1e47cc,!!_0x1a9277['onClick']);return _0x54eb60['bind']('hasTooltip')['to'](_0xff11c4,'isCollapsed',_0x1b46f5=>!_0x1b46f5),_0x54eb60['bind']('isFocusable')['to'](_0xff11c4,'isCollapsed',_0x1d0404=>!_0x1d0404),_0x1a9277['onClick']&&this['listenTo'](_0x54eb60,'execute',()=>{this['view']['isCollapsed']||_0x1a9277['onClick'](_0x1e47cc,_0x54eb60['element']);}),_0x54eb60;}),this['listenTo'](_0xff11c4['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0xff11c4['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0xff11c4['inlineListView']['keystrokes']['set']('Enter',(_0x5292dc,_0x14835a)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x14835a());}),_0xff11c4['render'](),_0x2cf6aa['render'](),_0x1126c3({'emitter':_0xff11c4,'activator':()=>_0x2cf6aa['isVisible'],'contextElements':[_0x2cf6aa['element'],_0xff11c4['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1c614a['config']['get']('presenceList.container')['appendChild'](_0xff11c4['element']),this['_bodyCollection']=new _0x3e2feb(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xff11c4;}['_handleUserAdd'](_0x187d60){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x187d60['isMe'])return;const _0x31cc23=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x31cc23-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xd181a8=_0x187d60['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x187d60,_0xd181a8);}['_handleUserRemove'](_0x472f6d){this['usersCount']--;const {collapseAt:_0x50c868}=this['context']['config']['get']('presenceList'),_0x277faf=this['usersCount']>=_0x50c868;if(this['currentDisplayedUsers']['get'](_0x472f6d['id']))this['currentDisplayedUsers']['remove'](_0x472f6d['id']);else{if(_0x277faf&&this['currentDisplayedUsers']['length']+0x1===_0x50c868-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x277faf?0x1:0x0)<this['usersCount']){for(const _0x738309 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x738309['id'])&&(this['currentDisplayedUsers']['add'](_0x738309,Math['min'](this['currentDisplayedUsers']['length']-(_0x277faf?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x277faf?0x1:0x0)===_0x50c868-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4e1c55=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x4e1c55['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x51be98}=this['presenceDropdownView'];_0x51be98['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x57c41e=>{if(!_0x4e1c55['displayMe']&&_0x57c41e['isMe'])return null;const _0x31d628=new j(this['context']['locale'],_0x57c41e,!!_0x4e1c55['onClick']);return _0x4e1c55['onClick']&&this['listenTo'](_0x31d628,'execute',()=>{_0x4e1c55['onClick'](_0x57c41e,_0x31d628['element']);}),_0x31d628;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x51be98['focus'](),_0x51be98['checkIfScrollable']();const _0xa0caa7=(_0x18bf1a,_0x3c1c9b)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3c1c9b();};_0x51be98['keystrokes']['set']('Esc',_0xa0caa7),_0x51be98['keystrokes']['set']('Shift+Tab',_0xa0caa7),_0x51be98['keystrokes']['set']('Tab',(_0x2820b2,_0x388c8f)=>{!function(_0x17ddb1){const _0x4295e1=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x562b8d=>_0x562b8d+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x5a23ec=[...document['body']['querySelectorAll'](_0x4295e1)]['filter'](_0x4b079a=>_0x4b079a===document['activeElement']||_0x4b079a['offsetWidth']+_0x4b079a['offsetHeight']>0x0)['sort']((_0x2e522b,_0x2c14d8)=>(_0x2e522b['tabIndex']||0x0)-(_0x2c14d8['tabIndex']||0x0)),_0x33cf89=_0x5a23ec['indexOf'](_0x17ddb1),_0x1c8166=_0x5a23ec[(_0x33cf89+0x1)%_0x5a23ec['length']];_0x1c8166&&_0x1c8166['focus']();}(this['view']['element']),this['hideDropdown'](),_0x388c8f();}),_0x51be98['focusTracker']['add'](this['view']['element']),_0x51be98['focusTracker']['on']('change:isFocused',(_0x3baa21,_0x5d0488,_0x5e33c4)=>{_0x5e33c4||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class gt extends _0x33ae3c{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x1f4d2d=>0x1!=_0x1f4d2d}};
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':_0x493e23=>0x1!=_0x493e23}};