@ckeditor/ckeditor5-real-time-collaboration 46.0.0-alpha.0 → 46.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +2 -2
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- 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
|
|
24
|
-
((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x74010d];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x350e90){super(_0x350e90),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x28b11a())();}['init'](){const _0x4d5480=this['context'],_0x52acc2=_0x4d5480['plugins']['get']('CloudServices'),_0x65dc4a=_0x4d5480['plugins']['get'](_0x74010d);if(!_0x52acc2['token'])throw new _0x13586a('websocketgateway-missing-token',this);if(!_0x52acc2['webSocketUrl'])throw new _0x13586a('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'](_0x52acc2['token'],_0x52acc2['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5c00cd=>{if(this['connection']=_0x5c00cd,this['bind']('state')['to'](_0x5c00cd,'state',this,'_isBrowserOffline',(_0x4dafef,_0x3ad282)=>('connected'!==_0x4dafef&&(this['_shouldPluginsReconnect']=!0x0),_0x3ad282||_0x4dafef!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x50bf57,_0x129c66)=>{if('limitExceeded'!==_0x129c66['code'])throw console['error'](_0x129c66),new _0x13586a('cloudservices-init',null,{'originalError':_0x129c66});_0x65dc4a['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'});}),!_0x5c00cd['me'])return new Promise(_0xb0980f=>_0x5c00cd['on']('change:me',_0xb0980f));})['catch'](_0x5d703d=>{throw console['error'](_0x5d703d),new _0x13586a('cloudservices-init',null,{'originalError':_0x5d703d});});}['addToReconnectionStack'](_0xf9dee8){if('function'!=typeof _0xf9dee8['reconnect'])throw new _0x13586a('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0xf9dee8))throw new _0x13586a('websocketgateway-plugin-already-registered',this,{'name':_0xf9dee8['constructor']['pluginName']});this['_reconnectionStack']['add'](_0xf9dee8);}['removeFromReconnectionStack'](_0x1b2989){this['_reconnectionStack']['delete'](_0x1b2989);}['isInReconnectionStack'](_0x5cd94e){return this['_reconnectionStack']['has'](_0x5cd94e);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1de62a=>_0x1de62a['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x2349a5=>{throw console['error'](_0x2349a5),new _0x13586a('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 _0x44450c{['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,_0x1b6722];}constructor(_0x250ee5){super(_0x250ee5),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4f265b(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1b6722);}['init'](){const _0x4ee69e=this['context']['plugins']['get'](n);this['listenTo'](_0x4ee69e,'change:state',(_0x3a76eb,_0x342f11,_0x3ab4c4)=>{if('connected'!==_0x3ab4c4)this['channelSessions']['forEach'](_0x5a5e2c=>_0x5a5e2c['clear']()),this['channelConnectedUsers']['forEach'](_0xf16b89=>_0xf16b89['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0xf74b24,_0x157b8b]of this['_registeredSessions'])for(const _0x378356 of _0x157b8b)this['_handleSessionAdd'](_0xf74b24,_0x378356);}}),this['_createUser'](_0x4ee69e['connection']['me'],!0x0);}['register'](_0xfaa7f2,_0x1372c2){if(this['_registeredSessions']['has'](_0xfaa7f2))throw new _0x13586a('sessions-register-already-registered',null,{'channelId':_0xfaa7f2});this['_registeredSessions']['set'](_0xfaa7f2,_0x1372c2),this['channelSessions']['set'](_0xfaa7f2,new _0x4f265b()),this['channelConnectedUsers']['set'](_0xfaa7f2,new _0x4f265b()),this['listenTo'](_0x1372c2,'add',(_0x471d0e,_0x42a5bc)=>this['_handleSessionAdd'](_0xfaa7f2,_0x42a5bc)),this['listenTo'](_0x1372c2,'remove',(_0x580a9f,_0x99f4fc)=>this['_handleSessionRemove'](_0xfaa7f2,_0x99f4fc));for(const _0x307145 of _0x1372c2)this['_handleSessionAdd'](_0xfaa7f2,_0x307145);}['unregister'](_0x5990b5){if(!this['_registeredSessions']['has'](_0x5990b5))throw new _0x13586a('sessions-unregister-not-exist',null,{'channelId':_0x5990b5});const _0x1e9fd2=this['_registeredSessions']['get'](_0x5990b5);this['stopListening'](_0x1e9fd2);for(const _0x406a5b of _0x1e9fd2)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x5990b5,_0x406a5b);this['_registeredSessions']['delete'](_0x5990b5),this['channelSessions']['delete'](_0x5990b5),this['channelConnectedUsers']['delete'](_0x5990b5);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x420f6b){for(const _0x4b9394 of this['channelSessions']['values']())for(const _0x47c706 of _0x4b9394)if(_0x47c706['id']===_0x420f6b)return _0x47c706['user'];}['getUserSessions'](_0x1dd7ed,_0x1d8b29){const _0x80260e=_0x1d8b29?[this['channelSessions']['get'](_0x1d8b29)]:this['channelSessions']['values'](),_0x154762=new Set();for(const _0x5427c9 of _0x80260e)for(const _0x2bc04f of _0x5427c9)_0x2bc04f['user']['id']===_0x1dd7ed['id']&&_0x154762['add'](_0x2bc04f['id']);return _0x154762;}['getUserRole'](_0x675ff1){for(const _0x517a6e of this['channelSessions']['values']())for(const _0x30ce62 of _0x517a6e)if(_0x30ce62['user']===_0x675ff1)return _0x30ce62['role'];}['_handleSessionAdd'](_0x3f9a0b,_0x39c2b4){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0xbcf4d0=_0x39c2b4['user'],_0x2f5e27=this['_users']['getUser'](_0xbcf4d0['id'])||this['_createUser'](_0xbcf4d0),_0x4e3b33=Object['assign']({},_0x39c2b4,{'user':_0x2f5e27});this['channelSessions']['get'](_0x3f9a0b)['add'](_0x4e3b33);const _0x4968c4=this['channelConnectedUsers']['get'](_0x3f9a0b);_0x4968c4['has'](_0x2f5e27['id'])||_0x4968c4['add'](_0x2f5e27),this['allConnectedUsers']['has'](_0x2f5e27['id'])||this['allConnectedUsers']['add'](_0x2f5e27,_0x2f5e27['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3f9a0b,{'channelId':_0x3f9a0b,'session':_0x4e3b33});}['_handleSessionRemove'](_0xf6444,_0x8e67ca){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x28f5a1=this['channelConnectedUsers']['get'](_0xf6444),_0x4edd5f=_0x8e67ca['user'];_0x4edd5f['id']&&(this['channelSessions']['get'](_0xf6444)['remove'](_0x8e67ca['id']),_0x28f5a1['has'](_0x4edd5f['id'])&&!this['getUserSessions'](_0x4edd5f,_0xf6444)['size']&&_0x28f5a1['remove'](_0x4edd5f['id']),this['allConnectedUsers']['get'](_0x4edd5f['id'])&&!this['getUserSessions'](_0x4edd5f)['size']&&this['allConnectedUsers']['remove'](_0x4edd5f['id']));}['_createUser'](_0xb47b29,_0xb5df99){const _0x2cbd6a=this['_users']['addUser'](_0xb47b29);return _0xb5df99&&this['_users']['defineMe'](_0xb47b29['id']),_0x2cbd6a['orderNumber']=this['_uniqueUsersCount']++,_0x2cbd6a;}}class H extends _0x33f83f{['_domEmitter']=new(_0x28b11a())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2b38dd=this['editor'],_0x33b50b=_0x2b38dd['plugins']['get'](i);_0x2b38dd['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x15b607,{writer:_0xa59fd6})=>function(_0x370c48,_0xad0622,_0x145841,_0x25b1cb){const _0x5e94a5=_0x370c48['markerName']['split'](':')[0x2],_0x4f61c5=_0x145841['getUserBySessionId'](_0x5e94a5);if(!_0x4f61c5||_0x5e94a5===_0x145841['mySessionId'])return;if(!_0x25b1cb['model']['schema']['checkChild'](_0x370c48['markerRange']['start'],'$text'))return;const _0x26cb73={'class':'ck-user__marker\x20'+_0x4f61c5['color']['getMarkerClass'](),'data-name':_0x4f61c5['name'],'data-session-id':_0x5e94a5},_0x58c132=_0x25b1cb['model']['markers']['get'](_0x370c48['markerName']),_0x1d4489=_0x58c132['getStart'](),_0x2dd3f9=_0x1d4489['nodeAfter'],_0xf5ccaa=_0x25b1cb['model']['schema'];if(_0x2dd3f9&&_0xf5ccaa['isObject'](_0x2dd3f9)&&_0xf5ccaa['isInline'](_0x2dd3f9)&&!_0x25b1cb['model']['markers']['get']('user:range:'+_0x5e94a5)['getRange']()['isCollapsed'])return;const _0x41b680=_0x1d4489['parent'];return _0x25b1cb['model']['schema']['isLimit'](_0x41b680)&&!_0x25b1cb['model']['hasContent'](_0x41b680)&&(_0x26cb73['contenteditable']=!0x1),function(_0x4cf0eb,_0x21d6c6,_0x30e534){const _0x274863=_0x4cf0eb['createUIElement']('span',_0x21d6c6);return _0x4cf0eb['setCustomProperty']('userPositionMarker',!0x0,_0x274863),_0x274863['render']=function(_0x4cf3b9){const _0x281093=this['toDomElement'](_0x4cf3b9),_0x2b42e3=document['createElement']('span');return _0x2b42e3['classList']['add']('ck-user__marker-tooltip'),_0x2b42e3['setAttribute']('contenteditable','false'),_0x2b42e3['setAttribute']('spellcheck','false'),_0x2b42e3['textContent']=_0x30e534['name'],_0x281093['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x2b42e3['outerHTML']+'',_0x281093['addEventListener']('mouseenter',()=>{_0x281093['classList']['add']('ck-user__marker_hovered');}),_0x281093['addEventListener']('mouseleave',()=>{_0x281093['classList']['remove']('ck-user__marker_hovered');}),_0x281093;},_0x274863['isSimilar']=function(_0x1abf50){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1abf50['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1abf50['getAttribute']('data-session-id'));},_0x274863;}(_0xad0622,_0x26cb73,_0x4f61c5);}(_0x15b607,_0xa59fd6,_0x33b50b,_0x2b38dd)}),_0x2b38dd['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1a8381=>function(_0x4cee95,_0x206787){const _0x14886d=_0x4cee95['markerName']['split'](':')[0x2];if(_0x14886d===_0x206787['mySessionId'])return null;const _0x2008da=_0x206787['getUserBySessionId'](_0x14886d);if(!_0x2008da)return{'id':_0x14886d,'classes':[]};return{'id':_0x14886d,'classes':['ck-user__selection',_0x2008da['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x14886d},'priority':0x7d0+_0x2008da['orderNumber']};}(_0x1a8381,_0x33b50b)}),function(_0x253884){const _0x1db444=_0x253884['model'],_0xf3b8b2=new Map(),_0x3c8b98=_0x253884['plugins']['get'](i);_0x1db444['markers']['on']('update:user:range',(_0x545b5c,_0x3d2382,_0x131e29,_0x4eec32)=>{if(!_0x4eec32&&_0xf3b8b2['get'](_0x3d2382['name']))return _0xf3b8b2['get'](_0x3d2382['name'])['detach'](),void _0xf3b8b2['delete'](_0x3d2382['name']);const _0x43ef49=_0x3d2382['name']['split'](':')[0x2];if(_0x43ef49===_0x3c8b98['mySessionId'])return;const _0x433467='user:position:'+_0x43ef49;_0x1db444['markers']['has'](_0x433467)&&_0x253884['editing']['reconvertMarker'](_0x433467),_0x3d2382['on']('change:range',(_0x350feb,_0xb586b9,_0x4cee00)=>{if('$graveyard'!=_0xb586b9['root']['rootName']&&'$graveyard'==_0x3d2382['getRange']()['root']['rootName']&&!_0xf3b8b2['has'](_0x3d2382['name'])){const _0x2299c5=_0x1db444['schema']['getNearestSelectionRange'](_0x4cee00['deletionPosition']);if(_0x2299c5){const _0x5a2a0e=_0x2e756d['fromRange'](_0x2299c5);_0xf3b8b2['set'](_0x3d2382['name'],_0x5a2a0e),_0x5a2a0e['on']('change:range',(_0x10c46c,_0xa64fcc,_0xcdc214)=>{if('$graveyard'==_0x5a2a0e['root']['rootName']){const _0x214b24=_0x1db444['schema']['getNearestSelectionRange'](_0xcdc214['deletionPosition']);_0x214b24?(_0x5a2a0e['start']=_0x214b24['start'],_0x5a2a0e['end']=_0x214b24['end']):(_0xf3b8b2['delete'](_0x3d2382['name']),_0x5a2a0e['detach']());}});}}});}),_0x1db444['document']['on']('change',()=>{_0xf3b8b2['size']>0x0&&_0x1db444['enqueueChange']({'isUndoable':!0x1},_0xfd9b18=>{for(const [_0x565fbf,_0x4a5c0a]of _0xf3b8b2)'$graveyard'==_0x1db444['markers']['get'](_0x565fbf)['getRange']()['root']['rootName']&&(Z(_0x565fbf['split'](':')[0x2],_0x4a5c0a['toRange'](),_0x1db444,_0xfd9b18),_0x4a5c0a['detach']());_0xf3b8b2['clear']();});});}(_0x2b38dd),this['_domEmitter']['listenTo'](_0x3e984e['document'],'keydown',(_0x14f02b,{key:_0x269d69})=>{'Escape'===_0x269d69&&function(_0x591435){_0x591435['editing']['view']['change'](_0x4c32cd=>{for(const _0x47cb55 of _0x591435['model']['markers']){if(!_0x47cb55['name']['startsWith']('user:position'))continue;const _0x22cf66=_0x591435['editing']['mapper']['markerNameToElements'](_0x47cb55['name']);if(_0x22cf66){for(const _0x33e795 of _0x22cf66)_0x4c32cd['removeClass']('ck-user__marker_hovered',_0x33e795);}}});}(_0x2b38dd);},{'useCapture':!0x0});}['afterInit'](){const _0x87e058=this['editor'],_0x3cb40e=_0x87e058['commands']['get']('undo');_0x3cb40e&&_0x87e058['model']['on']('applyOperation',(_0xe92d16,_0x57e00f)=>{const _0x21b549=_0x57e00f[0x0];if(!_0x21b549['isDocumentOperation'])return;if('marker'!=_0x21b549['type']||!_0x21b549['name']['startsWith']('user:'))return;const _0x4b027e=_0x21b549['batch'];_0x3cb40e['_createdBatches']['has'](_0x4b027e)&&(_0x21b549['newRange']=_0x21b549['oldRange']?_0x87e058['model']['createRange'](_0x21b549['oldRange']['start'],_0x21b549['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x4286ac=this['editor'],_0x5205e9=_0x4286ac['model']['document'],_0x2bd7c3=_0x4286ac['plugins']['get'](i);_0x4286ac['model']['enqueueChange']({'isUndoable':!0x1},_0x4a29df=>{const _0x41dc17='user:range:'+_0x2bd7c3['mySessionId'],_0x4aa858='user:position:'+_0x2bd7c3['mySessionId'],_0x58aab5=_0x4286ac['model']['markers']['has'](_0x41dc17);_0x4286ac['editing']['view']['hasDomSelection']?Z(_0x2bd7c3['mySessionId'],_0x5205e9['selection']['getFirstRange'](),_0x4286ac['model'],_0x4a29df):_0x58aab5&&(_0x4a29df['removeMarker'](_0x41dc17),_0x4a29df['removeMarker'](_0x4aa858));});}}function Z(_0x9e5071,_0x590d1c,_0x4deb3b,_0x4469b5){const _0x217b1c='user:range:'+_0x9e5071,_0x2c0bb1='user:position:'+_0x9e5071,_0x1a396f=_0x590d1c['getContainedElement']();let _0x5603af=_0x590d1c['start'];if(_0x1a396f&&_0x1a396f['is']('element','tableCell')){const _0x2c66e8=function(_0x2aa04c,_0x430ea9){for(const _0x7b0710 of _0x2aa04c['getPositions']())if(_0x430ea9['schema']['checkChild'](_0x7b0710,'$text'))return _0x7b0710;}(_0x590d1c,_0x4deb3b);_0x2c66e8&&(_0x5603af=_0x2c66e8,_0x590d1c=_0x4469b5['createRange'](_0x5603af));}const _0x51d8ea=_0x4469b5['createRange'](_0x5603af);_0x4deb3b['markers']['has'](_0x217b1c)?(_0x4469b5['updateMarker'](_0x217b1c,{'range':_0x590d1c}),_0x4469b5['updateMarker'](_0x2c0bb1,{'range':_0x51d8ea})):(_0x4469b5['addMarker'](_0x217b1c,{'range':_0x590d1c,'usingOperation':!0x0}),_0x4469b5['addMarker'](_0x2c0bb1,{'range':_0x51d8ea,'usingOperation':!0x0}));}function V(_0x5cc5ec,_0x51c3c1,_0x4e7875){const _0x5e3c9f=_0x5cc5ec['t'],t=_0x5cc5ec['t'];switch(_0x51c3c1){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 _0x5e3c9f({'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'},_0x4e7875);default:return'';}}let G=0x1;class l extends _0x33f83f{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x3e0167)());['_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,_0x4f3b6c,_0x1b6722,_0x74010d];}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 _0x2e227d=this['serverHistory']['getOperations']();for(let _0x6f4afd=_0x2e227d['length']-0x1;_0x6f4afd>=0x0;_0x6f4afd--){const _0x559c3e=_0x2e227d[_0x6f4afd];if(!this['_disconnectionOperations']['has'](_0x559c3e))return _0x559c3e['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x13614b){if(super(_0x13614b),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x509926(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x13586a('collaboration-missing-channelid',this);const _0x1ae2eb=_0x13614b['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x1ae2eb,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x295b09(),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 _0x596cff=this['editor'],_0x5985ab=_0x596cff['plugins']['get'](_0x1b6722),_0x68545e=_0x596cff['plugins']['get'](n);this['listenTo'](_0x5985ab,'getOperationAuthor',(_0x148865,_0x2dd6fd)=>{const _0x280872=_0x2dd6fd[0x0];_0x280872['_authorId']&&(_0x148865['return']=_0x5985ab['getUser'](_0x280872['_authorId']),_0x148865['stop']()),null===_0x280872['_authorId']&&(_0x148865['return']=null,_0x148865['stop']());},{'priority':'high'}),this['listenTo'](_0x596cff['model']['document']['selection'],'change:range',(_0x44151f,_0x2d2192)=>{_0x2d2192['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x596cff['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x596cff['model']['on']('applyOperation',(_0x281d93,_0x10edb1)=>{const _0x56b54a=_0x10edb1[0x0];_0x56b54a['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x56b54a),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x68545e,'state',this,'_hasSynchronizationProblem',(_0x41e345,_0x26fabf)=>'connected'===_0x41e345&&!_0x26fabf),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x596cff['disableReadOnlyMode']('rtc-offline'):_0x596cff['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x596cff['disableReadOnlyMode']('rtc-offline'):_0x596cff['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x55370d=this['editor']['plugins']['get'](i),_0x5630ff=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x55370d['unregister'](this['_channelId']);const _0x41bccb=await this['_service']['reconnect'](_0x5630ff['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x41bccb)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x34068e=await this['_service']['getConnectedSessions']();_0x55370d['register'](this['_channelId'],_0x34068e),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4a390d){if(function(_0x4a2fb7){return'404'===_0x4a2fb7['code'];}(_0x4a390d)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5c527b){return'409'===_0x5c527b['code'];}(_0x4a390d)){const _0x564c81=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'](_0x564c81);}else{if(!(_0x4a390d instanceof $))throw _0x4a390d;this['_handleReconnectionError']();}}}}['destroy'](){const _0x416ede=this['editor']['plugins']['get'](n),_0x13a5d3=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x13a5d3['channelSessions']['has'](this['_channelId'])&&_0x13a5d3['unregister'](this['_channelId']),_0x416ede['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0xc99f62){if(this['sessionId']!==_0xc99f62['sessionId']&&this['_lastSyncedOperationId']!==_0xc99f62['lastOperationId'])throw new $();return this['sessionId']=_0xc99f62['sessionId'],this['_handleServerResponse']([],{..._0xc99f62,'wereChangesApplied':!0x1,'data':_0xc99f62['data']},'reconnect');}async['_connectService'](_0x368ca7,_0x1fd8bc=!0x1){const {connection:_0x28cee6}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x28cee6,this['_channelId'])['then'](_0x5add4c=>this['_initSessionsHandling'](_0x5add4c))['catch'](_0x62b216=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x62b216);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x22a6b0,_0x59f4a1)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x59f4a1);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x426a22=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x368ca7);this['_isPendingUpdate']=!0x0;const _0xef011=await this['_service']['connect'](_0x28cee6,this['_compressOperations'](_0x368ca7),_0x426a22);if(this['sessionId']=_0xef011['sessionId'],_0x1fd8bc){if(!_0xef011['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xef011['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x368ca7,_0xef011,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xef011,_0x368ca7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x5b7a=this['editor']['plugins']['get'](i),_0x4fcf79=this['editor']['plugins']['get'](H),_0x30296d=_0x5b7a['channelSessions']['get'](this['_channelId']);_0x30296d&&_0x30296d['length']>0x1?_0x4fcf79['createUserMarkerOperations']():this['listenTo'](_0x5b7a,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x5b7a['channelSessions']['get'](this['_channelId'])['length']&&_0x4fcf79['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x26048d,_0x40cfed,_0x7ef48,_0x55a4ce){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x40cfed){const _0x48ccbc=this['_decompressOperations'](_0x7ef48,_0x55a4ce);await this['_fetchMissingUsers'](_0x48ccbc),this['_handleExternalOperations'](_0x48ccbc,_0x40cfed,_0x7ef48['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3476cb}=this['editor'];let _0xe57587;try{_0xe57587=await this['_service']['getDocumentDetails']();}catch{const _0xda4db3=V(_0x3476cb,'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'](_0xda4db3);}const _0xd18c04=_0xe57587['currentDocumentSession']||_0xe57587['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0xd18c04['lastOperationId']){const _0x5c931f=V(_0x3476cb,'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'](_0x5c931f);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4a6c56){const _0x346b0f=this['editor']['plugins']['get'](i);this['listenTo'](_0x346b0f,'sessionAdd:'+this['_channelId'],(_0x4cfc5b,{session:_0xcec085})=>{if(_0xcec085['id']===_0x346b0f['mySessionId']){_0x4cfc5b['off']();const _0x1b6040=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x5723fe=_0xcec085['permissions'];_0x1b6040&&_0x1b6040['isEnabled']&&(_0x5723fe=_0x5723fe['filter'](_0x5c9360=>'document:write'!==_0x5c9360)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x5723fe,this['_channelId']);}}),_0x346b0f['register'](this['_channelId'],_0x4a6c56);}['_initThrowingOnDataSet'](){const _0x42793e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x342c5e)=>{if(!_0x342c5e[_0x342c5e['length']-0x1]['suppressErrorInCollaboration'])throw new _0x13586a('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x42793e['apply'](this['editor']['data'],_0x342c5e);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x5d24cc,[_0x2035de])=>{if(this['_document']['version'])throw new _0x13586a('realtimecollaborationclient-init-document-already-initialized',this);_0x5d24cc['stop'](),this['_setPendingAction']();const _0x3cae89=this['editor']['config']['get']('rootsAttributes'),_0x57e200=this['_getOperationsFromInitData'](_0x2035de,_0x3cae89);0x0==_0x57e200['length']&&_0x57e200['push'](new _0x1ae3c6(0x0)),_0x5d24cc['return']=this['_connectService'](_0x57e200)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x576b19=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x576b19))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5515dd,[_0x3b54a3,_0x3955c0])=>{_0x5515dd['stop']();const _0x2dcc43=this['editor']['model']['document']['getRoot'](_0x3b54a3);if(!this['_knownRootNames']['has'](_0x3b54a3)){const _0x998360=_0x3955c0&&_0x3955c0['data']?_0x3955c0['data']:'',_0x502749=_0x3955c0&&_0x3955c0['attributes']?_0x3955c0['attributes']:{};await this['_loadRoot'](_0x3b54a3,_0x998360,_0x502749);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x2dcc43['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x2dcc43);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x5c30dd){const _0x3c8d12=this['editor']['plugins']['get'](_0x1b6722),{connection:_0x40e18f}=this['editor']['plugins']['get'](n),_0x14557a=new Set();for(const _0x120802 of _0x5c30dd){const _0x1c4c38=_0x120802['_authorId'];_0x1c4c38&&!_0x3c8d12['getUser'](_0x1c4c38)&&_0x14557a['add'](_0x1c4c38);}if(0x0===_0x14557a['size'])return;const _0x4f196e=await lt['getMany'](_0x40e18f,Array['from'](_0x14557a));for(const _0x5bf6f3 of _0x4f196e)_0x3c8d12['getUser'](_0x5bf6f3['id'])||_0x3c8d12['addUser'](_0x5bf6f3);}['_getOperationsFromInitData'](_0x3d27c2,_0x485714={}){const _0xea846a=this['editor']['model'],_0x3547ad=[];let _0x3603d7=0x0;const _0x185207='string'==typeof _0x3d27c2?{'main':_0x3d27c2}:_0x3d27c2;for(const _0x9742d of Object['keys'](_0x185207)){if(!this['_document']['roots']['has'](_0x9742d))throw new _0x13586a('realtimecollaborationclient-init-non-existent-root',this);const _0x2c49fb=this['editor']['data']['parse'](_0x185207[_0x9742d]),_0x35d32c=this['_document']['getRoot'](_0x9742d),_0x5b8333=new _0x358107(_0xea846a['createPositionAt'](_0x35d32c,0x0),_0x2c49fb,_0x3603d7++);_0x3547ad['push'](_0x5b8333);for(const [_0x2c478f,_0x5cc3e8]of _0x2c49fb['markers']){const _0x2a4a57=_0xea846a['createRange'](_0xea846a['createPositionFromPath'](_0x35d32c,_0x5cc3e8['start']['path']['slice']()),_0xea846a['createPositionFromPath'](_0x35d32c,_0x5cc3e8['end']['path']['slice']())),_0x1507c9=new _0x44d877(_0x2c478f,null,_0x2a4a57,_0xea846a['markers'],!0x0,_0x3603d7++);_0x3547ad['push'](_0x1507c9);}}if(_0x485714)for(const [_0x58b52c,_0xb6e1b0]of Object['entries'](_0x485714)){const _0x4736dc=_0xea846a['document']['getRoot'](_0x58b52c);if(!_0x4736dc)throw new _0x13586a('multi-root-editor-root-attributes-no-root',null);for(const [_0x488ed5,_0x3bb555]of Object['entries'](_0xb6e1b0))if(null!==_0x3bb555){const _0x407d35=new _0x5db25b(_0x4736dc,_0x488ed5,null,_0x3bb555,_0x3603d7++);_0x3547ad['push'](_0x407d35);}}return _0x3547ad;}async['_loadRoot'](_0x117f7f,_0x2cf397,_0x41dade){this['_getOperationsFromInitData']({[_0x117f7f]:_0x2cf397},{[_0x117f7f]:_0x41dade})['forEach']((_0x2a26a2,_0x2bdd42)=>{_0x2a26a2['baseVersion']=this['_document']['version']+_0x2bdd42,_0x2a26a2['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2a26a2);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x24a45e,_0x249471){let _0x457c5d;this['_offset']=_0x24a45e['offset'];const _0x46b2c2=_0x24a45e['wereChangesApplied']&&!_0x24a45e['initData'],_0x5b3564=_0x46b2c2?0x0:_0x24a45e['data']['baseVersion'];if(_0x249471['forEach'](_0xbe12a1=>{_0xbe12a1['_isInit']=!0x0,_0xbe12a1['createdAt']=_0x24a45e['sessionCreatedAt'],_0xbe12a1['_authorId']=null;}),_0x46b2c2)_0x457c5d=_0x249471,this['_applyOperationsSet'](_0x457c5d,_0x46b2c2);else{if(_0x24a45e['initData']){const _0x279bdb=this['_getOperationsFromInitData'](_0x24a45e['initData']);this['_document']['history']['version']=-_0x279bdb['length'],_0x279bdb['forEach'](_0x123994=>{_0x123994['baseVersion']-=_0x279bdb['length'],_0x123994['createdAt']=_0x24a45e['sessionCreatedAt'],_0x123994['_isInit']=!0x0,_0x123994['_authorId']=null;}),this['_applyOperationsSet'](_0x279bdb,!0x0),this['serverHistory']['version']=-_0x279bdb['length']+this['_offset'],this['_updateServerHistory'](_0x279bdb);}this['_document']['history']['version']=_0x5b3564,_0x457c5d=this['_decompressOperations'](_0x24a45e['data'],_0x24a45e['metadata']),await this['_fetchMissingUsers'](_0x457c5d),this['_applyOperationsSet'](_0x457c5d,_0x46b2c2);}_0x24a45e['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x457c5d,_0x24a45e['lastOperationId']),this['_lastSyncedOperationId']=_0x24a45e['lastOperationId']),this['serverHistory']['version']=_0x5b3564+this['_offset'],this['_updateServerHistory'](_0x457c5d),_0x249471['filter'](_0x3433e9=>{const _0x508b67=this['_getAffectedRoot'](_0x3433e9);return _0x508b67&&!this['_knownRootNames']['has'](_0x508b67);})['forEach']((_0x51da69,_0xadaf26)=>{_0x51da69['baseVersion']=this['_document']['version']+_0xadaf26,this['_saveOperationInBuffer'](_0x51da69);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x40d73e,_0x4f1133){const _0x2c0a1d=_0x4f1133&&_0x4f1133['message'];if(_0x2c0a1d&&_0x2c0a1d['startsWith']('realtimecollaborationclient'))throw _0x4f1133;const _0x4d5a53=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x4d5a53['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x13586a(_0x40d73e,this['editor'],_0x2c0a1d?{'originalError':_0x2c0a1d}:void 0x0);}['_saveOperationInBuffer'](_0x29a578){this['_knownOperations']['has'](_0x29a578)||(this['_knownOperations']['add'](_0x29a578),this['_bufferedOperations']['push'](_0x29a578),this['_pendingAction']||'marker'==_0x29a578['type']&&!_0x29a578['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x57b439=!0x1){!_0x57b439&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x464230=>{_0x464230&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2b735f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x4758c6){return _0x4758c6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4758c6['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4758c6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2b735f)||this['_crash'](_0x2b735f['message'],_0x2b735f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x1fd4a7=>{this['on']('change:_isPendingUpdate',()=>{_0x1fd4a7();});});}async['_sendBufferedOperations'](){const _0x910fe0=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x910fe0['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x546903=[...this['_bufferedOperations']];for(const _0x1a9a16 of _0x546903)_0x1a9a16['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1a9a16);const _0x51ae96=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x546903),_0x4a65bf=G++,_0x2ada50=this['_compressOperations'](_0x546903),_0x44e7aa=await this['_service']['sendOperations'](_0x2ada50,_0x2ada50['baseVersion'],_0x51ae96);try{return await this['_handleServerResponse'](_0x546903,_0x44e7aa,_0x4a65bf);}catch(_0x22ea1e){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x22ea1e);}}async['_handleServerResponse'](_0x129da1,_0x6dc9aa,_0x15fb7a){if('error'in _0x6dc9aa)throw _0x6dc9aa['error'];let _0x52e040=!0x1;if(_0x6dc9aa['wereChangesApplied']){_0x6dc9aa['lastOperationId']&&(this['_lastSyncedOperationId']=_0x6dc9aa['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3b4e6b=>!_0x129da1['includes'](_0x3b4e6b));for(const _0x4aeaea of _0x129da1)_0x4aeaea['createdAt']='lastOperationAcceptedAt'in _0x6dc9aa&&_0x6dc9aa['lastOperationAcceptedAt']||void 0x0;K(_0x129da1,_0x6dc9aa['version']-_0x129da1['length']),this['_updateServerHistory'](_0x129da1);const _0x33e64d=_0x129da1['filter'](_0x3d26dd=>{if(!_0x3d26dd['_isInit'])return!0x1;const _0x4d35ad=this['_getAffectedRoot'](_0x3d26dd);return _0x4d35ad&&!this['_knownRootNames']['has'](_0x4d35ad);});K(_0x33e64d,this['_document']['version']),this['_applyOperationsSet'](_0x33e64d),_0x52e040=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1915d8=this['_decompressOperations'](_0x6dc9aa['data'],_0x6dc9aa['metadata'])['filter'](_0x25b9e1=>_0x25b9e1['baseVersion']>=this['_lastServerVersion']);_0x1915d8['forEach'](_0x49cc7b=>this['_addKnownRoot'](_0x49cc7b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x823cb7=>!_0x823cb7['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x823cb7))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1915d8),_0x52e040=this['_handleExternalOperations'](_0x1915d8,_0x6dc9aa['version'],_0x6dc9aa['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x52e040?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x18419c,_0x26b022,_0x2b26f3){try{const _0x28f645={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2a89ba,operationsB:_0x4d4262,originalOperations:_0x3236a8}=_0x30482e(_0x18419c,this['_bufferedOperations'],_0x28f645);K(_0x2a89ba,this['_document']['version']),K(_0x4d4262,_0x26b022);for(const _0xa199bc of _0x2a89ba){const _0x300bac=_0x3236a8['get'](_0xa199bc);_0xa199bc['_authorId']=_0x300bac?_0x300bac['_authorId']:null;}_0x2b26f3&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x18419c,_0x2b26f3),this['_lastSyncedOperationId']=_0x2b26f3),this['_bufferedOperations']=[..._0x4d4262],this['_applyOperationsSet'](_0x2a89ba),this['_updateServerHistory'](_0x18419c);}catch(_0x4961e5){return console['error'](_0x4961e5),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1b2266,_0x1e1ed8=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3a8374=>{for(const _0x599751 of _0x1b2266)this['_knownOperations']['add'](_0x599751),this['_addKnownRoot'](_0x599751),_0x3a8374['batch']['addOperation'](_0x599751),this['editor']['model']['applyOperation'](_0x599751);});}['_addKnownRoot'](_0x268feb){const _0x23949c=this['_getAffectedRoot'](_0x268feb);_0x23949c&&this['_knownRootNames']['add'](_0x23949c);}['_getAffectedRoot'](_0x5c11cf){let _0x1a538d,_0x5452a4;switch(_0x5c11cf['type']){case'insert':_0x1a538d=_0x5c11cf['position']['root'];break;case'marker':if(_0x5452a4=_0x5c11cf['newRange'],!_0x5452a4)return null;_0x1a538d=_0x5452a4['root'];break;case'addRootAttribute':_0x1a538d=_0x5c11cf['root'];break;case'addRoot':_0x1a538d=_0x5c11cf['affectedSelectable'];break;case'move':_0x1a538d=_0x5c11cf['targetPosition']['root'];break;default:return null;}return _0x1a538d['rootName'];}['_updateServerHistory'](_0x109c78){_0x109c78['forEach'](_0x5b7c8e=>{const _0x2dfca4=_0x5b7c8e['clone']();_0x2dfca4['_authorId']=_0x5b7c8e['_authorId'],_0x2dfca4['_isInit']=!!_0x5b7c8e['_isInit'],_0x2dfca4['createdAt']=_0x5b7c8e['createdAt'],_0x2dfca4['baseVersion']+=this['_offset'],_0x5b7c8e['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x2dfca4),this['serverHistory']['addOperation'](_0x2dfca4);});}['_handleReconnectionError'](_0x2f21f5){const _0xbb07fe=this['editor']['plugins']['get']('Notification'),_0x31c22b=this['editor']['locale'];_0x2f21f5||(_0x2f21f5=V(_0x31c22b,'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.')),_0xbb07fe['showWarning'](_0x2f21f5,{'title':V(_0x31c22b,'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'](_0x4f3b6c)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x4f3b6c)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x27d29f){const _0xfd5d39=_0x27d29f['map'](_0x2d33bc=>_0x2d33bc['toJSON']());return this['_compressor']['compress'](_0xfd5d39);}['_decompressOperations'](_0x6b96dd,_0x12ec26){return this['_compressor']['decompress'](_0x6b96dd)['map']((_0x1c69ab,_0x152573)=>{const _0x1748fe='init'==_0x12ec26[_0x152573]['type'];if('InsertOperation'==_0x1c69ab['__className']){const _0x546f1a=_0x1c69ab['position']['root'];!this['_document']['getRoot'](_0x546f1a)&&(this['_document']['createRoot']('$root',_0x546f1a)['_isAttached']=!0x1);}const _0x2f87ac=_0x11ed40['fromJSON'](_0x1c69ab,this['_document']);return _0x2f87ac['wasUndone']=_0x1c69ab['wasUndone'],_0x2f87ac['_isInit']=_0x1748fe,_0x2f87ac['_authorId']=_0x1748fe?null:_0x12ec26[_0x152573]['userId'],_0x2f87ac['_isDisconnection']='cs:removeUser'===_0x12ec26[_0x152573]['type'],_0x2f87ac['createdAt']=_0x12ec26[_0x152573]['createdAt'],_0x2f87ac;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x264d84=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x264d84&&_0x264d84['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x2653aa,_0x47add7){for(const _0x591e5d of _0x2653aa)_0x591e5d['baseVersion']=_0x47add7++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x56e177){this['_ignoredOperations']=_0x56e177,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3a1d91){let _0x32b7d5=_0x3a1d91['length'];for(;_0x32b7d5--;){const _0x28c251=_0x3a1d91[_0x32b7d5];if(!this['_ignoredOperations']['has'](_0x28c251)){if(!this['_operationToId']['has'](_0x28c251)){const _0x4a534f=_0x41c9fb()['slice'](0x1,0x12);this['_operationToId']['set'](_0x28c251,_0x4a534f);}return this['_operationToId']['get'](_0x28c251);}}}['setIdForTheLastOperation'](_0x12b5b3,_0x2d0038){if(!_0x2d0038)return;let _0x15dcdb=_0x12b5b3['length'];for(;_0x15dcdb--;){const _0x2ed792=_0x12b5b3[_0x15dcdb];this['_ignoredOperations']['has'](_0x2ed792)||this['_operationToId']['set'](_0x2ed792,_0x2d0038);}}}class a extends _0x33f83f{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x44450c{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x7ebd5c)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x1b6722];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ebe04){super(_0x2ebe04),this['_services']=new Map();}async['init'](){const _0x1f2f5f=this['context'],_0x256c46=_0x1f2f5f['plugins']['get']('CommentsRepository');if(_0x1f2f5f['plugins']['get'](n)['addToReconnectionStack'](this),_0x256c46['adapter']={'addCommentThread':async({channelId:_0x48809a,threadId:_0x1da030,comments:_0x3323cc,resolvedAt:_0x449227,resolvedBy:_0x332b01,context:_0x57b3b6,attributes:_0x135952})=>{const _0x13bb96=await this['_getService'](_0x48809a)['addCommentThread']({'commentThreadId':_0x1da030,'comments':_0x3323cc['map'](_0xb88f93=>function(_0x304f50,_0x29ce1a,_0xb68aab){return{'commentThreadId':_0xb68aab,'commentId':_0x304f50['commentId'],'userId':_0x304f50['authorId'],'content':_0x304f50['content'],'documentId':_0x29ce1a,'createdAt':_0x304f50['createdAt'],'attributes':_0x304f50['attributes']||{}};}(_0xb88f93,_0x48809a,_0x1da030)),'resolvedAt':_0x449227,'resolvedBy':_0x332b01,'context':_0x57b3b6,'attributes':_0x135952})['catch'](dt);return{'threadId':_0x13bb96['commentThreadId'],'comments':_0x13bb96['comments']};},'getCommentThread':async({channelId:_0x267560,threadId:_0x4b5b1e})=>{const _0x1af642=await this['_getService'](_0x267560)['getCommentThread'](_0x4b5b1e)['catch'](dt);return _0x1af642['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1af642]),{'threadId':_0x1af642['commentThreadId'],'comments':_0x1af642['comments']['map'](B),'context':_0x1af642['context'],'resolvedAt':_0x1af642['resolvedAt'],'resolvedBy':_0x1af642['resolvedBy'],'attributes':_0x1af642['attributes']||{}});},'updateCommentThread':async({channelId:_0x5afa26,threadId:_0x52ba8d,context:_0x4115ab,unlinkedAt:_0xc924d,attributes:_0x5132c1})=>this['_getService'](_0x5afa26)['updateCommentThread']({'commentThreadId':_0x52ba8d,'context':_0x4115ab,'attributes':_0x5132c1,'unlinkedAt':_0xc924d})['catch'](F)['catch'](dt),'resolveCommentThread':async({channelId:_0x3efcd8,threadId:_0x189964})=>{const _0x3569d0=await this['_getService'](_0x3efcd8)['resolveCommentThread'](_0x189964)['catch'](F)['catch'](dt);return{'threadId':_0x3569d0['commentThreadId'],'resolvedAt':_0x3569d0['resolvedAt'],'resolvedBy':_0x3569d0['resolvedBy']};},'reopenCommentThread':async({channelId:_0x555235,threadId:_0x52e220})=>this['_getService'](_0x555235)['reopenCommentThread'](_0x52e220)['catch'](F)['catch'](dt),'removeCommentThread':({channelId:_0x242558,threadId:_0x255b11})=>this['_getService'](_0x242558)['removeCommentThread'](_0x255b11)['catch'](F)['catch'](dt),'addComment':({channelId:_0x278977,threadId:_0x364aea,commentId:_0x27945a,content:_0x59c0cd,attributes:_0x239f3f})=>this['_getService'](_0x278977)['addComment'](_0x364aea,_0x27945a,_0x59c0cd,_0x239f3f)['catch'](dt),'updateComment':({channelId:_0x518c1e,threadId:_0x281fc2,commentId:_0x551d92,content:_0x2d06b5,attributes:_0x308860})=>this['_getService'](_0x518c1e)['updateComment'](_0x281fc2,_0x551d92,_0x2d06b5,_0x308860)['catch'](F)['catch'](dt),'removeComment':({channelId:_0x2c7aca,threadId:_0x4661b3,commentId:_0x2140ed})=>this['_getService'](_0x2c7aca)['removeComment'](_0x4661b3,_0x2140ed)['catch'](F)['catch'](dt)},_0x1f2f5f instanceof _0xc45d37){const _0x522fe4=_0x1f2f5f['config']['get']('collaboration.channelId'),_0x4bca82=_0x1f2f5f['plugins']['get'](i);await this['_setUpService'](_0x522fe4);const _0x5e18ec=await this['_services']['get'](_0x522fe4)['getConnectedSessions']();this['listenTo'](_0x4bca82,'sessionAdd:'+_0x522fe4,(_0x25a1e8,{session:_0x4be001})=>{_0x4be001['id']===_0x4bca82['mySessionId']&&(_0x25a1e8['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4be001['permissions'],_0x522fe4));}),_0x4bca82['register'](_0x522fe4,_0x5e18ec);}}async['_setUpService'](_0x1ab615){if(this['_services']['has'](_0x1ab615))throw new _0x13586a('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x1ab615});const _0x42ce8a=this['context']['plugins']['get']('CommentsRepository'),_0x405d88=new s['CommentsService'](_0x1ab615);this['_services']['set'](_0x1ab615,_0x405d88),this['listenTo'](_0x405d88,'commentThreadAdded',(_0x3cc512,_0x432095)=>{const {commentThreadId:_0x87e33e,documentId:_0x96cb38,context:_0x36a4f7,attributes:_0x4d0305,resolvedAt:_0x15f5a4,resolvedBy:_0x423e6c,comments:_0x50db5e}=_0x432095;_0x42ce8a['getCommentThread'](_0x87e33e)||_0x42ce8a['addCommentThread']({'threadId':_0x87e33e,'channelId':_0x96cb38,'comments':_0x50db5e?_0x50db5e['map'](B):[],'context':_0x36a4f7,'attributes':_0x4d0305,'resolvedAt':_0x15f5a4,'resolvedBy':_0x423e6c,'isFromAdapter':!0x0});}),this['listenTo'](_0x405d88,'commentThreadUpdated',(_0x5b7941,{commentThreadId:_0xe1fe10,documentId:_0x3306c3,context:_0x2ffa97,unlinkedAt:_0x31fccb,attributes:_0x2519e9})=>{_0x42ce8a['getCommentThread'](_0xe1fe10)&&_0x42ce8a['updateCommentThread']({'threadId':_0xe1fe10,'channelId':_0x3306c3,'context':_0x2ffa97,'unlinkedAt':_0x31fccb,'attributes':_0x2519e9,'isFromAdapter':!0x0});}),this['listenTo'](_0x405d88,'commentThreadResolved',(_0x580e7f,{commentThreadId:_0x2736ae,resolvedBy:_0x285c9a,resolvedAt:_0x36bddd})=>{const _0x16df89=_0x42ce8a['getCommentThread'](_0x2736ae);_0x16df89&&_0x16df89['resolve']({'resolvedBy':_0x285c9a,'resolvedAt':_0x36bddd,'isFromAdapter':!0x0});}),this['listenTo'](_0x405d88,'commentThreadReopened',(_0x45ab13,{commentThreadId:_0x3bca91})=>{const _0x27b8b9=_0x42ce8a['getCommentThread'](_0x3bca91);_0x27b8b9&&_0x27b8b9['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x405d88,'commentThreadRemoved',(_0x38afe6,{commentThreadId:_0x3b2c23})=>{const _0xaab4c1=_0x42ce8a['getCommentThread'](_0x3b2c23);_0xaab4c1&&_0xaab4c1['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x405d88,'commentAdded',(_0x4c2b69,_0x3fe66b)=>{const _0x4c17f=_0x3fe66b['commentThreadId'],_0xc52796=_0x42ce8a['getCommentThread'](_0x4c17f);_0xc52796&&_0xc52796['addComment']({...B(_0x3fe66b),'isFromAdapter':!0x0});}),this['listenTo'](_0x405d88,'commentUpdated',(_0x2cef98,{commentThreadId:_0x1bac10,commentId:_0x40b826,content:_0xaa0703,attributes:_0x446882})=>{const _0x512db6=_0x42ce8a['getCommentThread'](_0x1bac10);if(_0x512db6){const _0x180be4=_0x512db6['getComment'](_0x40b826);_0x180be4&&_0x180be4['update']({'content':_0xaa0703,'attributes':_0x446882,'isFromAdapter':!0x0});}}),this['listenTo'](_0x405d88,'commentRemoved',(_0x2d634b,{commentThreadId:_0x5bebf4,commentId:_0x328857})=>{const _0x2f9da3=_0x42ce8a['getCommentThread'](_0x5bebf4);if(_0x2f9da3){const _0x2f607d=_0x2f9da3['getComment'](_0x328857);_0x2f607d&&_0x2f607d['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x1ab615);}['destroy'](){if(this['context']instanceof _0xc45d37){const _0x51bac6=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x51bac6);}}['_terminateService'](_0x561087){if(!this['_services']['has'](_0x561087))throw new _0x13586a('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x561087});this['_getService'](_0x561087)['disconnect'](),this['_services']['delete'](_0x561087);}async['reconnect'](){for(const _0x36231c of this['_services']['keys']())await this['_connectService'](_0x36231c);if(this['context']instanceof _0xc45d37){const _0x5d5fe6=this['context']['config']['get']('collaboration.channelId'),_0x5b9bee=this['context']['plugins']['get'](i);_0x5b9bee['unregister'](_0x5d5fe6);const _0x562397=await this['_services']['get'](_0x5d5fe6)['getConnectedSessions']();_0x5b9bee['register'](_0x5d5fe6,_0x562397);}}async['_connectService'](_0x51eb14){const {connection:_0x1dfe81}=this['context']['plugins']['get'](n),_0x2e5104=this['context']['plugins']['get']('CommentsRepository'),_0x3bb3ba=this['_services']['get'](_0x51eb14),_0x480b14=await _0x3bb3ba['connect'](_0x1dfe81);await this['_fetchMissingUsersForThreads'](_0x480b14);const _0x3e9e17=new Set(Array['from'](_0x2e5104['getCommentThreads']({'channelId':_0x51eb14}),_0x289b37=>_0x289b37['id']));for(const _0x2bedbe of _0x480b14)_0x2bedbe['deletedAt']||_0x3e9e17['delete'](_0x2bedbe['commentThreadId']);for(const _0x437559 of _0x3e9e17)_0x2e5104['getCommentThread'](_0x437559)['remove']({'isFromAdapter':!0x0});for(const _0x2bebcf of _0x480b14){let _0x4312d8=_0x2e5104['getCommentThread'](_0x2bebcf['commentThreadId']);const {commentThreadId:_0x3aff6e,context:_0x16c771,attributes:_0x49a2e6,resolvedBy:_0x240d1e,resolvedAt:_0x34ee34,unlinkedAt:_0x15407c,deletedAt:_0x435e1f}=_0x2bebcf;if(_0x435e1f)continue;_0x4312d8||(_0x4312d8=_0x2e5104['addCommentThread']({'channelId':_0x51eb14,'threadId':_0x3aff6e,'context':_0x16c771,'attributes':_0x49a2e6||{},'resolvedBy':_0x240d1e,'resolvedAt':_0x34ee34,'unlinkedAt':_0x15407c,'isFromAdapter':!0x0}));const _0x552bae=new Set(Array['from'](_0x4312d8['comments'],_0x48d33d=>_0x48d33d['id']));for(const _0x540782 of _0x2bebcf['comments'])_0x552bae['delete'](_0x540782['commentId']);for(const _0x332b99 of _0x552bae)_0x4312d8['getComment'](_0x332b99)['remove']({'isFromAdapter':!0x0});for(const _0x1163a7 of _0x2bebcf['comments']){const _0xf54f94=_0x4312d8['getComment'](_0x1163a7['commentId']);_0xf54f94?_0xf54f94['content']!==_0x1163a7['content']&&_0xf54f94['update']({'content':_0x1163a7['content'],'isFromAdapter':!0x0}):_0x4312d8['addComment'](Object['assign'](B(_0x1163a7),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5aa2cf){if(!this['_services']['has'](_0x5aa2cf))throw new _0x13586a('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5aa2cf});return this['_services']['get'](_0x5aa2cf);}async['_fetchMissingUsersForThreads'](_0x1b0de6){const _0x1cab3a=this['context']['plugins']['get'](_0x1b6722),{connection:_0x1c7518}=this['context']['plugins']['get'](n),_0x3edbdc=new Set();for(const {resolvedBy:_0x38c8ea,comments:_0x56596c}of _0x1b0de6){_0x38c8ea&&!_0x1cab3a['getUser'](_0x38c8ea)&&_0x3edbdc['add'](_0x38c8ea);for(const {userId:_0x3dd8cd}of _0x56596c)_0x1cab3a['getUser'](_0x3dd8cd)||_0x3edbdc['add'](_0x3dd8cd);}if(0x0===_0x3edbdc['size'])return;const _0x430eb8=await lt['getMany'](_0x1c7518,Array['from'](_0x3edbdc));for(const _0x3057af of _0x430eb8)_0x1cab3a['getUser'](_0x3057af['id'])||_0x1cab3a['addUser'](_0x3057af);}}async function F(_0x125ab0){if('404'!==_0x125ab0['code'])throw _0x125ab0;}function dt(_0x1a623d){if((_0x7866ce=_0x1a623d)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x7866ce['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x7866ce['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x7866ce;throw _0x1a623d;}function B(_0x481a8a){return{'threadId':_0x481a8a['commentThreadId'],'commentId':_0x481a8a['commentId'],'content':_0x481a8a['content'],'createdAt':_0x481a8a['createdAt'],'authorId':_0x481a8a['userId'],'attributes':_0x481a8a['attributes']||{}};}class m extends _0x33f83f{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x1b6722];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a28ce){super(_0x2a28ce);const _0x4753bc=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x4753bc);}async['init'](){const _0x3af634=this['editor']['plugins']['get'](l),_0x2462d2=_0x3af634['serverHistory'],_0x346ab5=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x2462d2,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x3af634['sessionId']});const _0x44feb6=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x2fb4a0=await tt['isBundleUploaded'](_0x346ab5['connection'],_0x44feb6);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x5a3e3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5a3e3)),'updateRevisions':async _0x23869c=>{await this['_waitForServiceReady']();const _0x5a4e2d=this['_revisionTracker']['currentRevision'];if(_0x2fb4a0&&0x1===_0x23869c['length']&&_0x23869c[0x0]['id']===_0x5a4e2d['id'])return _0x23869c;for(const _0x3a67e1 of _0x23869c)_0x3a67e1['id']===_0x5a4e2d['id']&&(_0x3a67e1['isEmptyCurrent']=_0x3a67e1['fromVersion']===_0x3a67e1['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x23869c,this['_lastRequestId'])['then'](_0x540923=>(this['_lastRequestId']=_0x540923,_0x23869c))['catch'](_0x3158df=>{if(st(_0x3158df)||'400'===_0x3158df['code']&&void 0x0!==_0x3158df['data']['wrongRequestId']){for(const _0x46603d of _0x23869c){!this['_revisionTracker']['repository']['getRevision'](_0x46603d['id'])||this['_revisionTracker']['_bufferUpdate'](_0x46603d['id'],_0x46603d,!0x1);}if(st(_0x3158df))throw _0x3158df;return _0x23869c;}throw _0x3158df;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x21b567,{revisionsData:_0x3b56d5,requestId:_0x22aace})=>{Math['max'](..._0x3b56d5['map'](_0x54989c=>_0x54989c['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3b56d5,_0x22aace);}):this['_handleRevisionsUpdate'](_0x3b56d5,_0x22aace);});const {revisions:_0x5285a5,requestId:_0x188436}=await this['_revisionHistoryService']['connect'](_0x346ab5['connection']);_0x346ab5['addToReconnectionStack'](this),this['_lastRequestId']=_0x188436,await this['_fetchMissingUsers'](_0x5285a5);for(const _0x2d0eea of _0x5285a5)this['_revisionTracker']['addRevisionData'](_0x2d0eea);this['listenTo'](_0x3af634,'change:_isConnected',(_0x3f0934,_0x4b23e8,_0x5aec65)=>{_0x5aec65&&(this['_oldOffset']=_0x3af634['_offset'],_0x3f0934['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x346ab5,'state',_0x3903ff=>_0x3903ff===te['CONNECTED']);}async['reconnect'](){const _0x2aca6b=this['editor']['plugins']['get'](n),_0x558d8c=this['editor']['plugins']['get'](l),_0x3d7683=async()=>{const _0x1d4de7=this['_revisionTracker']['currentRevision'],_0x29b0c0=_0x1d4de7['id'],_0x5c862f=_0x29b0c0!==_0x558d8c['sessionId'];if(_0x5c862f){const _0x520591=_0x558d8c['_offset']-this['_oldOffset'],_0x413e19=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x1d4de7['toVersion']+_0x520591!==_0x413e19){const _0x2ba2b7=_0x1d4de7['fromVersion']+_0x520591,_0x441919=this['editor']['plugins']['get'](_0x1b6722),_0x35e540=this['_revisionTracker']['buildRevisionData']({'revision':_0x1d4de7,'from':_0x2ba2b7,'to':_0x413e19});_0x35e540['id']=_0x1d4de7['id'];const _0x9b7ce9=_0x35e540['authorsIds']['map'](_0x43eaed=>_0x441919['getUser'](_0x43eaed));_0x1d4de7['_update']({..._0x35e540,'authors':_0x9b7ce9},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x1d4de7['id'],_0x35e540,!0x0);}this['_revisionTracker']['_startingVersion']=_0x413e19,(_0x1d4de7['toVersion']===_0x1d4de7['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x29b0c0)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x29b0c0),this['_revisionTracker']['_createCurrentRevision'](_0x413e19));}const {revisions:_0x28739a,requestId:_0x343691}=await this['_revisionHistoryService']['reconnect'](_0x2aca6b['connection'],this['_lastRequestId']);_0x5c862f&&_0x28739a['length']>0x0?_0x558d8c['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x28739a),this['_handleRevisionsUpdate'](_0x28739a,_0x343691),this['_revisionTracker']['sendBufferedUpdates']());};return _0x558d8c['_isConnected']?_0x3d7683():new Promise((_0x419081,_0x312831)=>{_0x558d8c['once']('change:_isConnected',()=>{_0x3d7683()['then'](_0x419081)['catch'](_0x312831);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x101a05=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x139efd=>{_0x139efd['off'](),_0x101a05();});});}['_getLatestVersionFromServerOperations'](){const _0x2dc69f=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x365345 of _0x2dc69f)if('marker'!==_0x365345['type']||_0x365345['affectsData'])return _0x365345['baseVersion']+0x1;}['_getLatestVersion'](){const _0x372d4a=this['editor']['plugins']['get'](l);return new Promise(_0x4f4f54=>{_0x372d4a['_isPendingUpdate']?_0x372d4a['once']('change:_isPendingUpdate',()=>{_0x4f4f54(this['_getLatestVersionFromServerOperations']());}):_0x4f4f54(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x9b8a28,_0x346033){const _0x1de5ec=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x346033;for(const _0xf99ce7 of _0x9b8a28){const _0x2fdc76=_0x1de5ec['getRevision'](_0xf99ce7['id']);if(_0x2fdc76){if((_0xf99ce7['fromVersion']||_0xf99ce7['toVersion'])&&(_0xf99ce7['diffData']=null),_0x2fdc76===this['_revisionTracker']['currentRevision']){const _0x2d0581=Math['max'](_0x2fdc76['toVersion'],_0xf99ce7['toVersion']),_0x19ee92=Math['max'](_0x2fdc76['fromVersion'],_0xf99ce7['fromVersion']);let _0x1a04e9;_0x2fdc76['toVersion']===_0xf99ce7['toVersion']&&_0x2fdc76['fromVersion']===_0xf99ce7['fromVersion']?(_0x1a04e9=!0x0,this['_preventResendingRevisionData'](_0xf99ce7)):_0xf99ce7['toVersion']===_0x2d0581&&_0xf99ce7['fromVersion']===_0x19ee92?_0x1a04e9=!0x1:(_0x2fdc76['toVersion']===_0x2d0581&&_0x2fdc76['fromVersion']===_0x19ee92||this['_fixRevision']({'revision':_0x2fdc76,'from':_0x19ee92,'to':_0x2d0581}),_0x1a04e9=!0x0),_0x1a04e9&&(delete _0xf99ce7['fromVersion'],delete _0xf99ce7['toVersion'],delete _0xf99ce7['diffData'],delete _0xf99ce7['createdAt'],delete _0xf99ce7['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xf99ce7),this['_preventResendingRevisionData'](_0xf99ce7);}else this['_revisionTracker']['addRevisionData'](_0xf99ce7);}const _0x235d16=_0x1de5ec['getRevisions']();_0x235d16['reverse']();for(let _0x5db3fd=0x0;_0x5db3fd<_0x235d16['length']-0x1;_0x5db3fd++){const _0x3c909b=_0x235d16[_0x5db3fd],_0x3d3f7e=_0x235d16[_0x5db3fd+0x1];if(_0x3c909b['fromVersion']<_0x3d3f7e['toVersion']){const _0x52adf5=_0x3d3f7e['toVersion'],_0x4a53fe=Math['max'](_0x52adf5,_0x3c909b['toVersion']);this['_fixRevision']({'revision':_0x3c909b,'from':_0x52adf5,'to':_0x4a53fe});}}}['_fixRevision']({revision:_0x3ab25f,from:_0x4b017f,to:_0x77b61e}={}){const _0x3666a1=this['editor']['plugins']['get'](_0x1b6722),_0x19eb24=this['_revisionTracker']['buildRevisionData']({'revision':_0x3ab25f,'from':_0x4b017f,'to':_0x77b61e});_0x19eb24['authors']=_0x19eb24['authorsIds']['map'](_0x26ed5e=>_0x3666a1['getUser'](_0x26ed5e)),_0x3ab25f['_update'](_0x19eb24);}['_preventResendingRevisionData'](_0x3cfaad){const _0x6e6f7c={};_0x6e6f7c['id']=_0x3cfaad['id'];for(const _0x2ddb01 of Object['keys'](_0x3cfaad))'id'!==_0x2ddb01&&(_0x6e6f7c[_0x2ddb01]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x6e6f7c['id'],_0x6e6f7c,!0x0);}async['_fetchMissingUsers'](_0xbeb4d){const _0x46afd3=this['editor']['plugins']['get'](_0x1b6722),{connection:_0x595ef8}=this['editor']['plugins']['get'](n),_0x754f99=new Set();for(const _0x56663d of _0xbeb4d){for(const _0x4b815c of _0x56663d['authorsIds'])_0x80036f(_0x4b815c);_0x56663d['creatorId']&&_0x80036f(_0x56663d['creatorId']);}if(0x0===_0x754f99['size'])return;const _0x59896d=await lt['getMany'](_0x595ef8,Array['from'](_0x754f99));for(const _0x3603fb of _0x59896d)_0x46afd3['getUser'](_0x3603fb['id'])||_0x46afd3['addUser'](_0x3603fb);function _0x80036f(_0x1001c1){_0x46afd3['getUser'](_0x1001c1)||_0x754f99['add'](_0x1001c1);}}}function st(_0x2116ed){return _0x2116ed['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x2116ed['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2116ed['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x33f83f{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 _0x4198ae{['_collapseAt'];constructor(_0x3d2e06,_0x1a1b80=0x6){super(_0x3d2e06);const _0x4779b6=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1a1b80,this['bind']('isHidden')['to'](this,'usersCount',_0x43a41c=>_0x43a41c<_0x1a1b80),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4779b6['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':_0x4779b6['to']('usersCount',_0x3a1112=>'+'+(_0x3a1112-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x4198ae{['items'];['keystrokes'];constructor(_0x1b6f1d){super(_0x1b6f1d);const _0x1824eb=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2d99ed(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1824eb['if']('hasPopup'),'aria-expanded':_0x1824eb['to']('isExpanded',_0x3c9dfa=>this['hasPopup']&&String(_0x3c9dfa)),'aria-label':_0x1824eb['to']('hasPopup',_0x143217=>V(_0x1b6f1d,_0x143217?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1824eb['to']('hasPopup',_0x4232fe=>!!_0x4232fe&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x1824eb['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x1824eb['to'](_0x14b758=>{const _0x282f4e=_0x14b758,_0x1e0ead=document['querySelector']('.ck-presence-list__dropdown-list'),_0x5cb042=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1e0ead?.['contains'](_0x282f4e['relatedTarget'])||_0x5cb042?.['contains'](_0x282f4e['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4a412b,_0x5220e7,_0x2fc243)=>{this['element']&&(_0x2fc243?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 _0x4198ae{['counterView'];['inlineListView'];constructor(_0x5abe79,_0x2813a9=0x6){super(_0x5abe79);const _0x285e8d=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x2813a9),this['inlineListView']=new is(_0x5abe79),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x25f800 of this['inlineListView']['items'])_0x25f800['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',_0x285e8d['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x4198ae{['listWrapperView'];constructor(_0x24cf03,_0x4682e4){super(_0x24cf03);const _0x405d0a=this['bindTemplate'];this['listWrapperView']=new pt(_0x24cf03,_0x4682e4),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x24cf03,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x405d0a['to'](_0xb29874=>{const _0x23477e=_0xb29874,_0x17a737=document['querySelector']('.ck-presence-list__list'),_0x42ab93=document['querySelector']('.ck-balloon-panel_with-arrow');_0x17a737?.['contains'](_0x23477e['relatedTarget'])||_0x42ab93?.['contains'](_0x23477e['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x8b8723{constructor(_0x4b73a9,_0x3791fb){super(_0x4b73a9);const _0x1b930b=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x3791fb?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1b930b['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1b930b['to']('role'),'aria-label':_0x1b930b['to']('ariaLabel'),'aria-labelledby':_0x1b930b['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3e984e['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x2609fb=this['element'];_0x2609fb&&(this['_isScrollable']=Math['max'](_0x2609fb['scrollHeight'],_0x2609fb['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x58dd41,_0x238063,_0x111aac){super(_0x58dd41);const _0x2abdbd=this['bindTemplate'];this['userView']=new ct(_0x58dd41,_0x238063);const _0x44a840={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x238063['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x238063['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x238063['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x111aac&&(_0x44a840['tag']='button',_0x44a840['on']={'click':_0x2abdbd['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x44a840);}['focus'](){this['element']['focus']();}}class A extends _0x4198ae{['userView'];['markerView'];constructor(_0x8a37de,_0x54f8a6,_0x572615){super(_0x8a37de);const _0x277f2d=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x8a37de,_0x54f8a6),this['markerView']=new at(_0x8a37de,_0x54f8a6);const _0x5eb142=new ot(_0x8a37de);_0x5eb142['template']['tag']='span',_0x5eb142['text']=_0x54f8a6['name'];const _0x2dcd18={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x277f2d['to']('isFocusable',_0x17ee8d=>!!_0x17ee8d&&0x0),'aria-labelledby':_0x5eb142['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x277f2d['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x277f2d['to']('hasTooltip',_0x4ce09a=>!_0x4ce09a),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x5eb142]};_0x572615&&(_0x2dcd18['tag']='button',_0x2dcd18['on']={'click':_0x277f2d['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2dcd18);}}class at extends _0x4198ae{constructor(_0x44ff11,_0x543e6e){super(_0x44ff11),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x543e6e['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x44450c{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x165c6c){super(_0x165c6c),this['context']['config']['define']('presenceList',x);const _0x29fcde=_0x165c6c['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x29fcde)throw new _0x13586a('presencelist-collapseat-invalid-format',this);if(_0x29fcde<0x1)throw new _0x13586a('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4f265b(),this['balloonPanelView']=new _0x3282cd(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4e83d9 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4e83d9);this['listenTo'](this['_allConnectedUsers'],'add',(_0x503b54,_0x458419)=>{this['_handleUserAdd'](_0x458419);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2dd34b,_0x10f806)=>{this['_handleUserRemove'](_0x10f806);});}['_createView'](){const _0x41e567=this['context'],_0x33265e=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x44da47=this['balloonPanelView'];if(!_0x3a670d(_0x41e567['config']['get']('presenceList.container')))throw new _0x13586a('presencelist-missing-container',this);return _0x33265e['counterView']['bind']('usersCount')['to'](this),_0x33265e['bind']('isCollapsed')['to'](this,'usersCount',_0x27ed8a=>{const {collapseAt:_0x44dbb7}=_0x41e567['config']['get']('presenceList'),_0x412853=_0x27ed8a>=_0x44dbb7;if(_0x412853&&!_0x33265e['inlineListView']['items']['find'](_0xa20d91=>_0xa20d91 instanceof b)){const _0x5aefda=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5aefda&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x33265e['inlineListView']['items']['add'](_0x33265e['counterView']);}return _0x412853||this['hideDropdown'](),_0x412853;}),_0x33265e['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x50bace=>{const _0x517030=_0x41e567['config']['get']('presenceList'),_0x19c617=new A(_0x41e567['locale'],_0x50bace,!!_0x517030['onClick']);return _0x19c617['bind']('hasTooltip')['to'](_0x33265e,'isCollapsed',_0x24a1a5=>!_0x24a1a5),_0x19c617['bind']('isFocusable')['to'](_0x33265e,'isCollapsed',_0x98a9a8=>!_0x98a9a8),_0x517030['onClick']&&this['listenTo'](_0x19c617,'execute',()=>{this['view']['isCollapsed']||_0x517030['onClick'](_0x50bace,_0x19c617['element']);}),_0x19c617;}),this['listenTo'](_0x33265e['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x33265e['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x33265e['inlineListView']['keystrokes']['set']('Enter',(_0x1c7f6b,_0x16f1f4)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x16f1f4());}),_0x33265e['render'](),_0x44da47['render'](),_0xbe209d({'emitter':_0x33265e,'activator':()=>_0x44da47['isVisible'],'contextElements':[_0x44da47['element'],_0x33265e['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x41e567['config']['get']('presenceList.container')['appendChild'](_0x33265e['element']),this['_bodyCollection']=new _0x196a3f(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x33265e;}['_handleUserAdd'](_0x31a3a6){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x31a3a6['isMe'])return;const _0x578c98=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x578c98-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x469ea8=_0x31a3a6['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x31a3a6,_0x469ea8);}['_handleUserRemove'](_0x5e7536){this['usersCount']--;const {collapseAt:_0x28329d}=this['context']['config']['get']('presenceList'),_0x2ce444=this['usersCount']>=_0x28329d;if(this['currentDisplayedUsers']['get'](_0x5e7536['id']))this['currentDisplayedUsers']['remove'](_0x5e7536['id']);else{if(_0x2ce444&&this['currentDisplayedUsers']['length']+0x1===_0x28329d-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x2ce444?0x1:0x0)<this['usersCount']){for(const _0x3eaa2e of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x3eaa2e['id'])&&(this['currentDisplayedUsers']['add'](_0x3eaa2e,Math['min'](this['currentDisplayedUsers']['length']-(_0x2ce444?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x2ce444?0x1:0x0)===_0x28329d-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3b8262=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x3b8262['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x15850f}=this['presenceDropdownView'];_0x15850f['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x121f5b=>{if(!_0x3b8262['displayMe']&&_0x121f5b['isMe'])return null;const _0x13cf63=new j(this['context']['locale'],_0x121f5b,!!_0x3b8262['onClick']);return _0x3b8262['onClick']&&this['listenTo'](_0x13cf63,'execute',()=>{_0x3b8262['onClick'](_0x121f5b,_0x13cf63['element']);}),_0x13cf63;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x15850f['focus'](),_0x15850f['checkIfScrollable']();const _0x17a67a=(_0xb1545c,_0x2be510)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2be510();};_0x15850f['keystrokes']['set']('Esc',_0x17a67a),_0x15850f['keystrokes']['set']('Shift+Tab',_0x17a67a),_0x15850f['keystrokes']['set']('Tab',(_0x36f12a,_0x4b83bf)=>{!function(_0x4656bb){const _0x28ae1f=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x3b0b8c=>_0x3b0b8c+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x475087=[...document['body']['querySelectorAll'](_0x28ae1f)]['filter'](_0x2f3a8b=>_0x2f3a8b===document['activeElement']||_0x2f3a8b['offsetWidth']+_0x2f3a8b['offsetHeight']>0x0)['sort']((_0xeb2a32,_0x5772da)=>(_0xeb2a32['tabIndex']||0x0)-(_0x5772da['tabIndex']||0x0)),_0x43f965=_0x475087['indexOf'](_0x4656bb),_0x2937fc=_0x475087[(_0x43f965+0x1)%_0x475087['length']];_0x2937fc&&_0x2937fc['focus']();}(this['view']['element']),this['hideDropdown'](),_0x4b83bf();}),_0x15850f['focusTracker']['add'](this['view']['element']),_0x15850f['focusTracker']['on']('change:isFocused',(_0x36aea0,_0x428f44,_0x1dd4d0)=>{_0x1dd4d0||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 _0x44450c{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,L as _RtcPresenceDropdownListView,pt as _RtcPresenceDropdownListWrapperView,v as _RtcPresenceListView};
|
|
23
|
+
import{ContextPlugin as _0x452a47,Plugin as _0x4315dd,PendingActions as _0x5251f4,Context as _0x1ee2fd}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x590eb3,CKEditorError as _0x65b8a3,Collection as _0x25c985,global as _0x13e912,version as ht,uid as _0x5d9828,KeystrokeHandler as _0x50e56b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3a1c6e,View as _0x1a9ee9,ListView as _0x46080d,ListItemView as ct,LabelView as lt,BalloonPanelView as _0x5e66bf,clickOutsideHandler as _0xeb7538,BodyCollection as _0x6675d4}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x220844,History as _0x4c75b1,NoOperation as _0x1bed81,InsertOperation as _0x275997,MarkerOperation as _0x30de4d,RootAttributeOperation as _0x2be42f,transformOperationSets as _0xecfd02,OperationFactory as _0x36d8cd}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x407abe,CollaborativeEditingService as _0xf078c6,User as ut,CommentsService as _0x4d2ba8,TrackChangesService as rt,RevisionHistoryService as st,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x3cfe08,UserView as at}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xb0a8f7}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x111d5f}from'es-toolkit/compat';class n extends _0x452a47{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3a1c6e];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5ef7e0){super(_0x5ef7e0),this['set']('state',_0x407abe['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x590eb3())();}['init'](){const _0x19cdde=this['context'],_0x5e6805=_0x19cdde['plugins']['get']('CloudServices'),_0x533483=_0x19cdde['plugins']['get'](_0x3a1c6e);if(!_0x5e6805['token'])throw new _0x65b8a3('websocketgateway-missing-token',this);if(!_0x5e6805['webSocketUrl'])throw new _0x65b8a3('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'](_0x5e6805['token'],_0x5e6805['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3f3e71=>{if(this['connection']=_0x3f3e71,this['bind']('state')['to'](_0x3f3e71,'state',this,'_isBrowserOffline',(_0x13b653,_0x324095)=>('connected'!==_0x13b653&&(this['_shouldPluginsReconnect']=!0x0),_0x324095||_0x13b653!==_0x407abe['CONNECTED']?_0x407abe['DISCONNECTED']:this['state']==_0x407abe['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x407abe['CONNECTING']):_0x407abe['CONNECTED'])),this['connection']['on']('error',(_0x5c49ec,_0x445d25)=>{if('limitExceeded'!==_0x445d25['code'])throw console['error'](_0x445d25),new _0x65b8a3('cloudservices-init',null,{'originalError':_0x445d25});_0x533483['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'});}),!_0x3f3e71['me'])return new Promise(_0x3a39d6=>_0x3f3e71['on']('change:me',_0x3a39d6));})['catch'](_0x4e3073=>{throw console['error'](_0x4e3073),new _0x65b8a3('cloudservices-init',null,{'originalError':_0x4e3073});});}['addToReconnectionStack'](_0x57ac79){if('function'!=typeof _0x57ac79['reconnect'])throw new _0x65b8a3('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x57ac79))throw new _0x65b8a3('websocketgateway-plugin-already-registered',this,{'name':_0x57ac79['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x57ac79);}['removeFromReconnectionStack'](_0x56f5b3){this['_reconnectionStack']['delete'](_0x56f5b3);}['isInReconnectionStack'](_0x7c47ab){return this['_reconnectionStack']['has'](_0x7c47ab);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x16325d=>_0x16325d['reconnect']())))['then'](()=>this['state']=_0x407abe['CONNECTED'])['catch'](_0x551e19=>{throw console['error'](_0x551e19),new _0x65b8a3('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x407abe['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x452a47{['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,_0x3cfe08];}constructor(_0x871128){super(_0x871128),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x25c985(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x3cfe08);}['init'](){const _0x61e782=this['context']['plugins']['get'](n);this['listenTo'](_0x61e782,'change:state',(_0x3fdf6a,_0x21845f,_0x539a08)=>{if('connected'!==_0x539a08)this['channelSessions']['forEach'](_0x290c7f=>_0x290c7f['clear']()),this['channelConnectedUsers']['forEach'](_0x53a545=>_0x53a545['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x41d475,_0x29f1a7]of this['_registeredSessions'])for(const _0x516285 of _0x29f1a7)this['_handleSessionAdd'](_0x41d475,_0x516285);}}),this['_createUser'](_0x61e782['connection']['me'],!0x0);}['register'](_0x2482d2,_0x43d5e0){if(this['_registeredSessions']['has'](_0x2482d2))throw new _0x65b8a3('sessions-register-already-registered',null,{'channelId':_0x2482d2});this['_registeredSessions']['set'](_0x2482d2,_0x43d5e0),this['channelSessions']['set'](_0x2482d2,new _0x25c985()),this['channelConnectedUsers']['set'](_0x2482d2,new _0x25c985()),this['listenTo'](_0x43d5e0,'add',(_0x5e0ec0,_0x319a9d)=>this['_handleSessionAdd'](_0x2482d2,_0x319a9d)),this['listenTo'](_0x43d5e0,'remove',(_0x9a1340,_0x1426a2)=>this['_handleSessionRemove'](_0x2482d2,_0x1426a2));for(const _0x107893 of _0x43d5e0)this['_handleSessionAdd'](_0x2482d2,_0x107893);}['unregister'](_0x416b8f){if(!this['_registeredSessions']['has'](_0x416b8f))throw new _0x65b8a3('sessions-unregister-not-exist',null,{'channelId':_0x416b8f});const _0x2d4b75=this['_registeredSessions']['get'](_0x416b8f);this['stopListening'](_0x2d4b75);for(const _0x13db65 of _0x2d4b75)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x416b8f,_0x13db65);this['_registeredSessions']['delete'](_0x416b8f),this['channelSessions']['delete'](_0x416b8f),this['channelConnectedUsers']['delete'](_0x416b8f);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x2cd374){for(const _0x11eb30 of this['channelSessions']['values']())for(const _0x193c8f of _0x11eb30)if(_0x193c8f['id']===_0x2cd374)return _0x193c8f['user'];}['getUserSessions'](_0x412143,_0x462555){const _0x56248e=_0x462555?[this['channelSessions']['get'](_0x462555)]:this['channelSessions']['values'](),_0x2833cd=new Set();for(const _0x30ac63 of _0x56248e)for(const _0x57d85b of _0x30ac63)_0x57d85b['user']['id']===_0x412143['id']&&_0x2833cd['add'](_0x57d85b['id']);return _0x2833cd;}['getUserRole'](_0x52617c){for(const _0x12fe76 of this['channelSessions']['values']())for(const _0x12e32a of _0x12fe76)if(_0x12e32a['user']===_0x52617c)return _0x12e32a['role'];}['_handleSessionAdd'](_0x13258a,_0x5d3411){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0xc41ae4=_0x5d3411['user'],_0x1824c9=this['_users']['getUser'](_0xc41ae4['id'])||this['_createUser'](_0xc41ae4),_0x564c3b=Object['assign']({},_0x5d3411,{'user':_0x1824c9});this['channelSessions']['get'](_0x13258a)['add'](_0x564c3b);const _0x4f1bf3=this['channelConnectedUsers']['get'](_0x13258a);_0x4f1bf3['has'](_0x1824c9['id'])||_0x4f1bf3['add'](_0x1824c9),this['allConnectedUsers']['has'](_0x1824c9['id'])||this['allConnectedUsers']['add'](_0x1824c9,_0x1824c9['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x13258a,{'channelId':_0x13258a,'session':_0x564c3b});}['_handleSessionRemove'](_0x5dc04a,_0x3781ca){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x14b79d=this['channelConnectedUsers']['get'](_0x5dc04a),_0x113883=_0x3781ca['user'];_0x113883['id']&&(this['channelSessions']['get'](_0x5dc04a)['remove'](_0x3781ca['id']),_0x14b79d['has'](_0x113883['id'])&&!this['getUserSessions'](_0x113883,_0x5dc04a)['size']&&_0x14b79d['remove'](_0x113883['id']),this['allConnectedUsers']['get'](_0x113883['id'])&&!this['getUserSessions'](_0x113883)['size']&&this['allConnectedUsers']['remove'](_0x113883['id']));}['_createUser'](_0x50f41c,_0xe1e726){const _0xe30d90=this['_users']['addUser'](_0x50f41c);return _0xe1e726&&this['_users']['defineMe'](_0x50f41c['id']),_0xe30d90['orderNumber']=this['_uniqueUsersCount']++,_0xe30d90;}}class C extends _0x4315dd{['_domEmitter']=new(_0x590eb3())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2f60fb=this['editor'],_0x597d15=_0x2f60fb['plugins']['get'](i);_0x2f60fb['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x505748,{writer:_0x19d970})=>function(_0x1db93c,_0x1a4b64,_0x168a2a,_0x5eedbc){const _0x469af6=_0x1db93c['markerName']['split'](':')[0x2],_0x160e0a=_0x168a2a['getUserBySessionId'](_0x469af6);if(!_0x160e0a||_0x469af6===_0x168a2a['mySessionId'])return;if(!_0x5eedbc['model']['schema']['checkChild'](_0x1db93c['markerRange']['start'],'$text'))return;const _0x2c3f87={'class':'ck-user__marker\x20'+_0x160e0a['color']['getMarkerClass'](),'data-name':_0x160e0a['name'],'data-session-id':_0x469af6},_0x26b99b=_0x5eedbc['model']['markers']['get'](_0x1db93c['markerName']),_0x52a75f=_0x26b99b['getStart'](),_0x1cff19=_0x52a75f['nodeAfter'],_0x25b6ea=_0x5eedbc['model']['schema'];if(_0x1cff19&&_0x25b6ea['isObject'](_0x1cff19)&&_0x25b6ea['isInline'](_0x1cff19)&&!_0x5eedbc['model']['markers']['get']('user:range:'+_0x469af6)['getRange']()['isCollapsed'])return;const _0x209212=_0x52a75f['parent'];return _0x5eedbc['model']['schema']['isLimit'](_0x209212)&&!_0x5eedbc['model']['hasContent'](_0x209212)&&(_0x2c3f87['contenteditable']=!0x1),function(_0xd94c7e,_0x552e19,_0x303282){const _0x1d21b7=_0xd94c7e['createUIElement']('span',_0x552e19);return _0xd94c7e['setCustomProperty']('userPositionMarker',!0x0,_0x1d21b7),_0x1d21b7['render']=function(_0x42dcc1){const _0x138db2=this['toDomElement'](_0x42dcc1),_0x5d45b3=document['createElement']('span');return _0x5d45b3['classList']['add']('ck-user__marker-tooltip'),_0x5d45b3['setAttribute']('contenteditable','false'),_0x5d45b3['setAttribute']('spellcheck','false'),_0x5d45b3['textContent']=_0x303282['name'],_0x138db2['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x5d45b3['outerHTML']+'',_0x138db2['addEventListener']('mouseenter',()=>{_0x138db2['classList']['add']('ck-user__marker_hovered');}),_0x138db2['addEventListener']('mouseleave',()=>{_0x138db2['classList']['remove']('ck-user__marker_hovered');}),_0x138db2;},_0x1d21b7['isSimilar']=function(_0x10b077){return!(!this['getCustomProperty']('userPositionMarker')||!_0x10b077['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x10b077['getAttribute']('data-session-id'));},_0x1d21b7;}(_0x1a4b64,_0x2c3f87,_0x160e0a);}(_0x505748,_0x19d970,_0x597d15,_0x2f60fb)}),_0x2f60fb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x2685f6=>function(_0x2988e3,_0x2917b7){const _0x3f8a5b=_0x2988e3['markerName']['split'](':')[0x2];if(_0x3f8a5b===_0x2917b7['mySessionId'])return null;const _0x2dd6db=_0x2917b7['getUserBySessionId'](_0x3f8a5b);if(!_0x2dd6db)return{'id':_0x3f8a5b,'classes':[]};return{'id':_0x3f8a5b,'classes':['ck-user__selection',_0x2dd6db['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3f8a5b},'priority':0x7d0+_0x2dd6db['orderNumber']};}(_0x2685f6,_0x597d15)}),function(_0x33728e){const _0x57db76=_0x33728e['model'],_0x38e492=new Map(),_0x53d077=_0x33728e['plugins']['get'](i);_0x57db76['markers']['on']('update:user:range',(_0x142028,_0x17805e,_0x3a5572,_0x9e1f49)=>{if(!_0x9e1f49&&_0x38e492['get'](_0x17805e['name']))return _0x38e492['get'](_0x17805e['name'])['detach'](),void _0x38e492['delete'](_0x17805e['name']);const _0x1907f7=_0x17805e['name']['split'](':')[0x2];if(_0x1907f7===_0x53d077['mySessionId'])return;const _0x2dcb79='user:position:'+_0x1907f7;_0x57db76['markers']['has'](_0x2dcb79)&&_0x33728e['editing']['reconvertMarker'](_0x2dcb79),_0x17805e['on']('change:range',(_0x3248a9,_0x3d5740,_0x52e7e4)=>{if('$graveyard'!=_0x3d5740['root']['rootName']&&'$graveyard'==_0x17805e['getRange']()['root']['rootName']&&!_0x38e492['has'](_0x17805e['name'])){const _0x438ae9=_0x57db76['schema']['getNearestSelectionRange'](_0x52e7e4['deletionPosition']);if(_0x438ae9){const _0x40bfd4=_0x220844['fromRange'](_0x438ae9);_0x38e492['set'](_0x17805e['name'],_0x40bfd4),_0x40bfd4['on']('change:range',(_0x5ea3e0,_0xa61121,_0x33f73d)=>{if('$graveyard'==_0x40bfd4['root']['rootName']){const _0x20bdbf=_0x57db76['schema']['getNearestSelectionRange'](_0x33f73d['deletionPosition']);_0x20bdbf?(_0x40bfd4['start']=_0x20bdbf['start'],_0x40bfd4['end']=_0x20bdbf['end']):(_0x38e492['delete'](_0x17805e['name']),_0x40bfd4['detach']());}});}}});}),_0x57db76['document']['on']('change',()=>{_0x38e492['size']>0x0&&_0x57db76['enqueueChange']({'isUndoable':!0x1},_0x9690ca=>{for(const [_0x40f090,_0x579abe]of _0x38e492)'$graveyard'==_0x57db76['markers']['get'](_0x40f090)['getRange']()['root']['rootName']&&(J(_0x40f090['split'](':')[0x2],_0x579abe['toRange'](),_0x57db76,_0x9690ca),_0x579abe['detach']());_0x38e492['clear']();});});}(_0x2f60fb),this['_domEmitter']['listenTo'](_0x13e912['document'],'keydown',(_0x36703f,{key:_0x194f18})=>{'Escape'===_0x194f18&&function(_0x1360f1){_0x1360f1['editing']['view']['change'](_0x373368=>{for(const _0x565cbd of _0x1360f1['model']['markers']){if(!_0x565cbd['name']['startsWith']('user:position'))continue;const _0x56be61=_0x1360f1['editing']['mapper']['markerNameToElements'](_0x565cbd['name']);if(_0x56be61){for(const _0x4964cc of _0x56be61)_0x373368['removeClass']('ck-user__marker_hovered',_0x4964cc);}}});}(_0x2f60fb);},{'useCapture':!0x0});}['afterInit'](){const _0x45d8b5=this['editor'],_0x1aef73=_0x45d8b5['commands']['get']('undo');_0x1aef73&&_0x45d8b5['model']['on']('applyOperation',(_0x205313,_0x56d028)=>{const _0x3e7dab=_0x56d028[0x0];if(!_0x3e7dab['isDocumentOperation'])return;if('marker'!=_0x3e7dab['type']||!_0x3e7dab['name']['startsWith']('user:'))return;const _0x3ddf01=_0x3e7dab['batch'];_0x1aef73['_createdBatches']['has'](_0x3ddf01)&&(_0x3e7dab['newRange']=_0x3e7dab['oldRange']?_0x45d8b5['model']['createRange'](_0x3e7dab['oldRange']['start'],_0x3e7dab['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x422e2d=this['editor'],_0x3d27c6=_0x422e2d['model']['document'],_0x572e88=_0x422e2d['plugins']['get'](i);_0x422e2d['model']['enqueueChange']({'isUndoable':!0x1},_0xeb5e1b=>{const _0x1f7775='user:range:'+_0x572e88['mySessionId'],_0x1a08e4='user:position:'+_0x572e88['mySessionId'],_0x805b86=_0x422e2d['model']['markers']['has'](_0x1f7775);_0x422e2d['editing']['view']['hasDomSelection']?J(_0x572e88['mySessionId'],_0x3d27c6['selection']['getFirstRange'](),_0x422e2d['model'],_0xeb5e1b):_0x805b86&&(_0xeb5e1b['removeMarker'](_0x1f7775),_0xeb5e1b['removeMarker'](_0x1a08e4));});}}function J(_0x415ef6,_0x4fa420,_0x3b8bf7,_0x1f7b30){const _0x39bb3c='user:range:'+_0x415ef6,_0x5b68e0='user:position:'+_0x415ef6,_0x1195dc=_0x4fa420['getContainedElement']();let _0x4a75d9=_0x4fa420['start'];if(_0x1195dc&&_0x1195dc['is']('element','tableCell')){const _0x225b47=function(_0x3942a3,_0x5b9def){for(const _0x53e296 of _0x3942a3['getPositions']())if(_0x5b9def['schema']['checkChild'](_0x53e296,'$text'))return _0x53e296;}(_0x4fa420,_0x3b8bf7);_0x225b47&&(_0x4a75d9=_0x225b47,_0x4fa420=_0x1f7b30['createRange'](_0x4a75d9));}const _0x5dc9bd=_0x1f7b30['createRange'](_0x4a75d9);_0x3b8bf7['markers']['has'](_0x39bb3c)?(_0x1f7b30['updateMarker'](_0x39bb3c,{'range':_0x4fa420}),_0x1f7b30['updateMarker'](_0x5b68e0,{'range':_0x5dc9bd})):(_0x1f7b30['addMarker'](_0x39bb3c,{'range':_0x4fa420,'usingOperation':!0x0}),_0x1f7b30['addMarker'](_0x5b68e0,{'range':_0x5dc9bd,'usingOperation':!0x0}));}function E(_0x1a6f43,_0x22525c,_0x1beac0){const _0x32741a=_0x1a6f43['t'],t=_0x1a6f43['t'];switch(_0x22525c){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 _0x32741a({'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'},_0x1beac0);default:return'';}}let H=0x1;class l extends _0x4315dd{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0xf078c6)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,C,_0x5251f4,_0x3cfe08,_0x3a1c6e];}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 _0x477e54=this['serverHistory']['getOperations']();for(let _0x46ad16=_0x477e54['length']-0x1;_0x46ad16>=0x0;_0x46ad16--){const _0x3797cb=_0x477e54[_0x46ad16];if(!this['_disconnectionOperations']['has'](_0x3797cb))return _0x3797cb['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1ee471){if(super(_0x1ee471),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x4c75b1(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x65b8a3('collaboration-missing-channelid',this);const _0x4bf57d=_0x1ee471['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x4bf57d,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xb0a8f7(),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 F(this['_disconnectionOperations']);}['init'](){const _0x3bf241=this['editor'],_0x85fdf9=_0x3bf241['plugins']['get'](_0x3cfe08),_0x4e422c=_0x3bf241['plugins']['get'](n);this['listenTo'](_0x85fdf9,'getOperationAuthor',(_0x3e042b,_0x572f09)=>{const _0x56d5cb=_0x572f09[0x0];_0x56d5cb['_authorId']&&(_0x3e042b['return']=_0x85fdf9['getUser'](_0x56d5cb['_authorId']),_0x3e042b['stop']()),null===_0x56d5cb['_authorId']&&(_0x3e042b['return']=null,_0x3e042b['stop']());},{'priority':'high'}),this['listenTo'](_0x3bf241['model']['document']['selection'],'change:range',(_0x575d0b,_0x54b239)=>{_0x54b239['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3bf241['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3bf241['model']['on']('applyOperation',(_0x48c567,_0x57aa8e)=>{const _0xdfe4db=_0x57aa8e[0x0];_0xdfe4db['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0xdfe4db),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4e422c,'state',this,'_hasSynchronizationProblem',(_0x21f746,_0x11b19d)=>'connected'===_0x21f746&&!_0x11b19d),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3bf241['disableReadOnlyMode']('rtc-offline'):_0x3bf241['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3bf241['disableReadOnlyMode']('rtc-offline'):_0x3bf241['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x16494e=this['editor']['plugins']['get'](i),_0xec9f3f=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x16494e['unregister'](this['_channelId']);const _0x8cb2f1=await this['_service']['reconnect'](_0xec9f3f['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x8cb2f1)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4781e6=await this['_service']['getConnectedSessions']();_0x16494e['register'](this['_channelId'],_0x4781e6),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x173951){if(function(_0x2cb48c){return'404'===_0x2cb48c['code'];}(_0x173951)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x13a752){return'409'===_0x13a752['code'];}(_0x173951)){const _0x3c2c3c=E(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x3c2c3c);}else{if(!(_0x173951 instanceof V))throw _0x173951;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1a31a9=this['editor']['plugins']['get'](n),_0x3bfd4d=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x3bfd4d['channelSessions']['has'](this['_channelId'])&&_0x3bfd4d['unregister'](this['_channelId']),_0x1a31a9['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0xe347d4){if(this['sessionId']!==_0xe347d4['sessionId']&&this['_lastSyncedOperationId']!==_0xe347d4['lastOperationId'])throw new V();return this['sessionId']=_0xe347d4['sessionId'],this['_handleServerResponse']([],{..._0xe347d4,'wereChangesApplied':!0x1,'data':_0xe347d4['data']},'reconnect');}async['_connectService'](_0x4863b0,_0x1d4956=!0x1){const {connection:_0x49fbff}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x49fbff,this['_channelId'])['then'](_0x573f18=>this['_initSessionsHandling'](_0x573f18))['catch'](_0x3d7504=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3d7504);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5753c9,_0x5ded2c)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x5ded2c);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x361df6=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4863b0);this['_isPendingUpdate']=!0x0;const _0x19c028=await this['_service']['connect'](_0x49fbff,this['_compressOperations'](_0x4863b0),_0x361df6);if(this['sessionId']=_0x19c028['sessionId'],_0x1d4956){if(!_0x19c028['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x19c028['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4863b0,_0x19c028,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x19c028,_0x4863b0);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xb620b0=this['editor']['plugins']['get'](i),_0x5125f8=this['editor']['plugins']['get'](C),_0x390664=_0xb620b0['channelSessions']['get'](this['_channelId']);_0x390664&&_0x390664['length']>0x1?_0x5125f8['createUserMarkerOperations']():this['listenTo'](_0xb620b0,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xb620b0['channelSessions']['get'](this['_channelId'])['length']&&_0x5125f8['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x13a7a3,_0x219020,_0x1083d7,_0x3cfcb1){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x219020){const _0x539440=this['_decompressOperations'](_0x1083d7,_0x3cfcb1);await this['_fetchMissingUsers'](_0x539440),this['_handleExternalOperations'](_0x539440,_0x219020,_0x1083d7['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x26d19c}=this['editor'];let _0x81a8da;try{_0x81a8da=await this['_service']['getDocumentDetails']();}catch{const _0x2050a8=E(_0x26d19c,'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'](_0x2050a8);}const _0x383e22=_0x81a8da['currentDocumentSession']||_0x81a8da['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x383e22['lastOperationId']){const _0x2dbc67=E(_0x26d19c,'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'](_0x2dbc67);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4dec97){const _0x429a2a=this['editor']['plugins']['get'](i);this['listenTo'](_0x429a2a,'sessionAdd:'+this['_channelId'],(_0x1df508,{session:_0x25ebb7})=>{if(_0x25ebb7['id']===_0x429a2a['mySessionId']){_0x1df508['off']();const _0x5a6401=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0xd44d8b=_0x25ebb7['permissions'];_0x5a6401&&_0x5a6401['isEnabled']&&(_0xd44d8b=_0xd44d8b['filter'](_0x3be2b9=>'document:write'!==_0x3be2b9)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0xd44d8b,this['_channelId']);}}),_0x429a2a['register'](this['_channelId'],_0x4dec97);}['_initThrowingOnDataSet'](){const _0x2e05ad=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x28135a)=>{if(!_0x28135a[_0x28135a['length']-0x1]['suppressErrorInCollaboration'])throw new _0x65b8a3('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2e05ad['apply'](this['editor']['data'],_0x28135a);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4ecd5a,[_0x59ede0])=>{if(this['_document']['version'])throw new _0x65b8a3('realtimecollaborationclient-init-document-already-initialized',this);_0x4ecd5a['stop'](),this['_setPendingAction']();const _0x5e73f7=this['editor']['config']['get']('rootsAttributes'),_0x442f96=this['_getOperationsFromInitData'](_0x59ede0,_0x5e73f7);0x0==_0x442f96['length']&&_0x442f96['push'](new _0x1bed81(0x0)),_0x4ecd5a['return']=this['_connectService'](_0x442f96)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x18e31e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x18e31e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x382287,[_0x101bec,_0xb52882])=>{_0x382287['stop']();const _0x58b39e=this['editor']['model']['document']['getRoot'](_0x101bec);if(!this['_knownRootNames']['has'](_0x101bec)){const _0x3d1de0=_0xb52882&&_0xb52882['data']?_0xb52882['data']:'',_0x4421ed=_0xb52882&&_0xb52882['attributes']?_0xb52882['attributes']:{};await this['_loadRoot'](_0x101bec,_0x3d1de0,_0x4421ed);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x58b39e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x58b39e);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xb86c40){const _0xf7418a=this['editor']['plugins']['get'](_0x3cfe08),{connection:_0x54bf71}=this['editor']['plugins']['get'](n),_0x258030=new Set();for(const _0x2fe606 of _0xb86c40){const _0x1c4ab2=_0x2fe606['_authorId'];_0x1c4ab2&&!_0xf7418a['getUser'](_0x1c4ab2)&&_0x258030['add'](_0x1c4ab2);}if(0x0===_0x258030['size'])return;const _0x4e14ce=await ut['getMany'](_0x54bf71,Array['from'](_0x258030));for(const _0x1b5eff of _0x4e14ce)_0xf7418a['getUser'](_0x1b5eff['id'])||_0xf7418a['addUser'](_0x1b5eff);}['_getOperationsFromInitData'](_0x38cb36,_0x2960cb={}){const _0x313bb2=this['editor']['model'],_0x6a9737=[];let _0x527e36=0x0;const _0x4621c0='string'==typeof _0x38cb36?{'main':_0x38cb36}:_0x38cb36;for(const _0x516127 of Object['keys'](_0x4621c0)){if(!this['_document']['roots']['has'](_0x516127))throw new _0x65b8a3('realtimecollaborationclient-init-non-existent-root',this);const _0x2bf49e=this['editor']['data']['parse'](_0x4621c0[_0x516127]),_0x286c9c=this['_document']['getRoot'](_0x516127),_0x687188=new _0x275997(_0x313bb2['createPositionAt'](_0x286c9c,0x0),_0x2bf49e,_0x527e36++);_0x6a9737['push'](_0x687188);for(const [_0xbbf625,_0x259759]of _0x2bf49e['markers']){const _0x308032=_0x313bb2['createRange'](_0x313bb2['createPositionFromPath'](_0x286c9c,_0x259759['start']['path']['slice']()),_0x313bb2['createPositionFromPath'](_0x286c9c,_0x259759['end']['path']['slice']())),_0xf1c9e0=new _0x30de4d(_0xbbf625,null,_0x308032,_0x313bb2['markers'],!0x0,_0x527e36++);_0x6a9737['push'](_0xf1c9e0);}}if(_0x2960cb)for(const [_0x599cb7,_0x4c325a]of Object['entries'](_0x2960cb)){const _0x1a3399=_0x313bb2['document']['getRoot'](_0x599cb7);if(!_0x1a3399)throw new _0x65b8a3('multi-root-editor-root-attributes-no-root',null);for(const [_0x135ed9,_0xf11e08]of Object['entries'](_0x4c325a))if(null!==_0xf11e08){const _0x201c06=new _0x2be42f(_0x1a3399,_0x135ed9,null,_0xf11e08,_0x527e36++);_0x6a9737['push'](_0x201c06);}}return _0x6a9737;}async['_loadRoot'](_0x56591a,_0x5e2972,_0x29d221){this['_getOperationsFromInitData']({[_0x56591a]:_0x5e2972},{[_0x56591a]:_0x29d221})['forEach']((_0x5a1af5,_0x2429e4)=>{_0x5a1af5['baseVersion']=this['_document']['version']+_0x2429e4,_0x5a1af5['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x5a1af5);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x3ac85a,_0x1d4f05){let _0x12cbee;this['_offset']=_0x3ac85a['offset'];const _0x48ea6a=_0x3ac85a['wereChangesApplied']&&!_0x3ac85a['initData'],_0xd0a8fd=_0x48ea6a?0x0:_0x3ac85a['data']['baseVersion'];if(_0x1d4f05['forEach'](_0x23a231=>{_0x23a231['_isInit']=!0x0,_0x23a231['createdAt']=_0x3ac85a['sessionCreatedAt'],_0x23a231['_authorId']=null;}),_0x48ea6a)_0x12cbee=_0x1d4f05,this['_applyOperationsSet'](_0x12cbee,_0x48ea6a);else{if(_0x3ac85a['initData']){const _0x42fb4b=this['_getOperationsFromInitData'](_0x3ac85a['initData']);this['_document']['history']['version']=-_0x42fb4b['length'],_0x42fb4b['forEach'](_0x2a9902=>{_0x2a9902['baseVersion']-=_0x42fb4b['length'],_0x2a9902['createdAt']=_0x3ac85a['sessionCreatedAt'],_0x2a9902['_isInit']=!0x0,_0x2a9902['_authorId']=null;}),this['_applyOperationsSet'](_0x42fb4b,!0x0),this['serverHistory']['version']=-_0x42fb4b['length']+this['_offset'],this['_updateServerHistory'](_0x42fb4b);}this['_document']['history']['version']=_0xd0a8fd,_0x12cbee=this['_decompressOperations'](_0x3ac85a['data'],_0x3ac85a['metadata']),await this['_fetchMissingUsers'](_0x12cbee),this['_applyOperationsSet'](_0x12cbee,_0x48ea6a);}_0x3ac85a['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x12cbee,_0x3ac85a['lastOperationId']),this['_lastSyncedOperationId']=_0x3ac85a['lastOperationId']),this['serverHistory']['version']=_0xd0a8fd+this['_offset'],this['_updateServerHistory'](_0x12cbee),_0x1d4f05['filter'](_0x2464a4=>{const _0x26aee1=this['_getAffectedRoot'](_0x2464a4);return _0x26aee1&&!this['_knownRootNames']['has'](_0x26aee1);})['forEach']((_0x271563,_0xbf1a3a)=>{_0x271563['baseVersion']=this['_document']['version']+_0xbf1a3a,this['_saveOperationInBuffer'](_0x271563);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x352302,_0x2c83e1){const _0x5f2f56=_0x2c83e1&&_0x2c83e1['message'];if(_0x5f2f56&&_0x5f2f56['startsWith']('realtimecollaborationclient'))throw _0x2c83e1;const _0x317ce4=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x317ce4['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x65b8a3(_0x352302,this['editor'],_0x5f2f56?{'originalError':_0x5f2f56}:void 0x0);}['_saveOperationInBuffer'](_0x430290){this['_knownOperations']['has'](_0x430290)||(this['_knownOperations']['add'](_0x430290),this['_bufferedOperations']['push'](_0x430290),this['_pendingAction']||'marker'==_0x430290['type']&&!_0x430290['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x4bc574=!0x1){!_0x4bc574&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x39ad9e=>{_0x39ad9e&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x324d72=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x49c224){return _0x49c224['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x49c224['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x49c224['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x324d72)||this['_crash'](_0x324d72['message'],_0x324d72);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2eac73=>{this['on']('change:_isPendingUpdate',()=>{_0x2eac73();});});}async['_sendBufferedOperations'](){const _0x6fb719=this['editor']['plugins']['get'](C);if(this['_shouldSendSelectionUpdate']()&&(_0x6fb719['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2eca32=[...this['_bufferedOperations']];for(const _0x1abb7d of _0x2eca32)_0x1abb7d['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1abb7d);const _0x3a6ae5=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2eca32),_0x29a3f0=H++,_0x156740=this['_compressOperations'](_0x2eca32),_0x10de54=await this['_service']['sendOperations'](_0x156740,_0x156740['baseVersion'],_0x3a6ae5);try{return await this['_handleServerResponse'](_0x2eca32,_0x10de54,_0x29a3f0);}catch(_0x18401f){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x18401f);}}async['_handleServerResponse'](_0x17c4a7,_0x525d77,_0x5b6c0c){if('error'in _0x525d77)throw _0x525d77['error'];let _0x22a3ba=!0x1;if(_0x525d77['wereChangesApplied']){_0x525d77['lastOperationId']&&(this['_lastSyncedOperationId']=_0x525d77['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x43d46e=>!_0x17c4a7['includes'](_0x43d46e));for(const _0x20e3bc of _0x17c4a7)_0x20e3bc['createdAt']='lastOperationAcceptedAt'in _0x525d77&&_0x525d77['lastOperationAcceptedAt']||void 0x0;W(_0x17c4a7,_0x525d77['version']-_0x17c4a7['length']),this['_updateServerHistory'](_0x17c4a7);const _0x6dc835=_0x17c4a7['filter'](_0x1bee01=>{if(!_0x1bee01['_isInit'])return!0x1;const _0x35868e=this['_getAffectedRoot'](_0x1bee01);return _0x35868e&&!this['_knownRootNames']['has'](_0x35868e);});W(_0x6dc835,this['_document']['version']),this['_applyOperationsSet'](_0x6dc835),_0x22a3ba=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5b3056=this['_decompressOperations'](_0x525d77['data'],_0x525d77['metadata'])['filter'](_0x5e96b7=>_0x5e96b7['baseVersion']>=this['_lastServerVersion']);_0x5b3056['forEach'](_0xb69a6b=>this['_addKnownRoot'](_0xb69a6b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3b04d1=>!_0x3b04d1['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3b04d1))),this['_bufferedOperations']['length']&&W(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5b3056),_0x22a3ba=this['_handleExternalOperations'](_0x5b3056,_0x525d77['version'],_0x525d77['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x22a3ba?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5050c0,_0x2c8af3,_0x4997bd){try{const _0x15f44c={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x312ebe,operationsB:_0x4dc3bb,originalOperations:_0x409108}=_0xecfd02(_0x5050c0,this['_bufferedOperations'],_0x15f44c);W(_0x312ebe,this['_document']['version']),W(_0x4dc3bb,_0x2c8af3);for(const _0x5751f4 of _0x312ebe){const _0x48907e=_0x409108['get'](_0x5751f4);_0x5751f4['_authorId']=_0x48907e?_0x48907e['_authorId']:null;}_0x4997bd&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5050c0,_0x4997bd),this['_lastSyncedOperationId']=_0x4997bd),this['_bufferedOperations']=[..._0x4dc3bb],this['_applyOperationsSet'](_0x312ebe),this['_updateServerHistory'](_0x5050c0);}catch(_0x11dbec){return console['error'](_0x11dbec),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1c612c,_0x361bad=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x2d3d4a=>{for(const _0x211971 of _0x1c612c)this['_knownOperations']['add'](_0x211971),this['_addKnownRoot'](_0x211971),_0x2d3d4a['batch']['addOperation'](_0x211971),this['editor']['model']['applyOperation'](_0x211971);});}['_addKnownRoot'](_0x1b9fd2){const _0x214982=this['_getAffectedRoot'](_0x1b9fd2);_0x214982&&this['_knownRootNames']['add'](_0x214982);}['_getAffectedRoot'](_0x5eece7){let _0x3c24da,_0xe89df3;switch(_0x5eece7['type']){case'insert':_0x3c24da=_0x5eece7['position']['root'];break;case'marker':if(_0xe89df3=_0x5eece7['newRange'],!_0xe89df3)return null;_0x3c24da=_0xe89df3['root'];break;case'addRootAttribute':_0x3c24da=_0x5eece7['root'];break;case'addRoot':_0x3c24da=_0x5eece7['affectedSelectable'];break;case'move':_0x3c24da=_0x5eece7['targetPosition']['root'];break;default:return null;}return _0x3c24da['rootName'];}['_updateServerHistory'](_0x14d98d){_0x14d98d['forEach'](_0x11e7c1=>{const _0x5cca4f=_0x11e7c1['clone']();_0x5cca4f['_authorId']=_0x11e7c1['_authorId'],_0x5cca4f['_isInit']=!!_0x11e7c1['_isInit'],_0x5cca4f['createdAt']=_0x11e7c1['createdAt'],_0x5cca4f['baseVersion']+=this['_offset'],_0x11e7c1['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5cca4f),this['serverHistory']['addOperation'](_0x5cca4f);});}['_handleReconnectionError'](_0x4294f6){const _0x3386b0=this['editor']['plugins']['get']('Notification'),_0xf7eb9f=this['editor']['locale'];_0x4294f6||(_0x4294f6=E(_0xf7eb9f,'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.')),_0x3386b0['showWarning'](_0x4294f6,{'title':E(_0xf7eb9f,'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'](_0x5251f4)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5251f4)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x440015){const _0x1468b6=_0x440015['map'](_0x4212bc=>_0x4212bc['toJSON']());return this['_compressor']['compress'](_0x1468b6);}['_decompressOperations'](_0x3ce5cd,_0x12dbc0){return this['_compressor']['decompress'](_0x3ce5cd)['map']((_0x255aa4,_0x24ef17)=>{const _0x5e900='init'==_0x12dbc0[_0x24ef17]['type'];if('InsertOperation'==_0x255aa4['__className']){const _0x3c35f7=_0x255aa4['position']['root'];!this['_document']['getRoot'](_0x3c35f7)&&(this['_document']['createRoot']('$root',_0x3c35f7)['_isAttached']=!0x1);}const _0x432d00=_0x36d8cd['fromJSON'](_0x255aa4,this['_document']);return _0x432d00['wasUndone']=_0x255aa4['wasUndone'],_0x432d00['_isInit']=_0x5e900,_0x432d00['_authorId']=_0x5e900?null:_0x12dbc0[_0x24ef17]['userId'],_0x432d00['_isDisconnection']='cs:removeUser'===_0x12dbc0[_0x24ef17]['type'],_0x432d00['createdAt']=_0x12dbc0[_0x24ef17]['createdAt'],_0x432d00;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0xb6617f=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0xb6617f&&_0xb6617f['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class V extends Error{}function W(_0x346699,_0x48e7e7){for(const _0x4d76ed of _0x346699)_0x4d76ed['baseVersion']=_0x48e7e7++;}class F{['_ignoredOperations'];['_operationToId'];constructor(_0x5794b2){this['_ignoredOperations']=_0x5794b2,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x51ebc5){let _0x9131a1=_0x51ebc5['length'];for(;_0x9131a1--;){const _0x2ae7ab=_0x51ebc5[_0x9131a1];if(!this['_ignoredOperations']['has'](_0x2ae7ab)){if(!this['_operationToId']['has'](_0x2ae7ab)){const _0x177af7=_0x5d9828()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2ae7ab,_0x177af7);}return this['_operationToId']['get'](_0x2ae7ab);}}}['setIdForTheLastOperation'](_0x339814,_0x147377){if(!_0x147377)return;let _0x32d2f3=_0x339814['length'];for(;_0x32d2f3--;){const _0xb2ef52=_0x339814[_0x32d2f3];this['_ignoredOperations']['has'](_0xb2ef52)||this['_operationToId']['set'](_0xb2ef52,_0x147377);}}}class a extends _0x4315dd{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x452a47{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x4d2ba8)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x3cfe08];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b7d54){super(_0x3b7d54),this['_services']=new Map();}async['init'](){const _0x19847f=this['context'],_0x56b8f2=_0x19847f['plugins']['get']('CommentsRepository');if(_0x19847f['plugins']['get'](n)['addToReconnectionStack'](this),_0x56b8f2['adapter']={'addCommentThread':async({channelId:_0x1f446e,threadId:_0x1bf525,comments:_0x1f9725,resolvedAt:_0x4923ed,resolvedBy:_0x3ae5fe,context:_0x4fef84,attributes:_0x36c11f})=>{const _0x449eee=await this['_getService'](_0x1f446e)['addCommentThread']({'commentThreadId':_0x1bf525,'comments':_0x1f9725['map'](_0x27ac7c=>function(_0x38e676,_0xaa22d3,_0x25b86e){return{'commentThreadId':_0x25b86e,'commentId':_0x38e676['commentId'],'userId':_0x38e676['authorId'],'content':_0x38e676['content'],'documentId':_0xaa22d3,'createdAt':_0x38e676['createdAt'],'attributes':_0x38e676['attributes']||{}};}(_0x27ac7c,_0x1f446e,_0x1bf525)),'resolvedAt':_0x4923ed,'resolvedBy':_0x3ae5fe,'context':_0x4fef84,'attributes':_0x36c11f})['catch'](ft);return{'threadId':_0x449eee['commentThreadId'],'comments':_0x449eee['comments']};},'getCommentThread':async({channelId:_0x21321b,threadId:_0x3a4234})=>{const _0x4e953b=await this['_getService'](_0x21321b)['getCommentThread'](_0x3a4234)['catch'](ft);return _0x4e953b['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4e953b]),{'threadId':_0x4e953b['commentThreadId'],'comments':_0x4e953b['comments']['map'](et),'context':_0x4e953b['context'],'resolvedAt':_0x4e953b['resolvedAt'],'resolvedBy':_0x4e953b['resolvedBy'],'attributes':_0x4e953b['attributes']||{}});},'updateCommentThread':async({channelId:_0x262bad,threadId:_0x551ba5,context:_0x5546a0,unlinkedAt:_0x3a7ef0,attributes:_0x3b52fa})=>this['_getService'](_0x262bad)['updateCommentThread']({'commentThreadId':_0x551ba5,'context':_0x5546a0,'attributes':_0x3b52fa,'unlinkedAt':_0x3a7ef0})['catch'](Z)['catch'](ft),'resolveCommentThread':async({channelId:_0x469599,threadId:_0x2687a0})=>{const _0x4e6da5=await this['_getService'](_0x469599)['resolveCommentThread'](_0x2687a0)['catch'](Z)['catch'](ft);return{'threadId':_0x4e6da5['commentThreadId'],'resolvedAt':_0x4e6da5['resolvedAt'],'resolvedBy':_0x4e6da5['resolvedBy']};},'reopenCommentThread':async({channelId:_0x25dc4b,threadId:_0x2337fe})=>this['_getService'](_0x25dc4b)['reopenCommentThread'](_0x2337fe)['catch'](Z)['catch'](ft),'removeCommentThread':({channelId:_0x477c86,threadId:_0x4e2801})=>this['_getService'](_0x477c86)['removeCommentThread'](_0x4e2801)['catch'](Z)['catch'](ft),'addComment':({channelId:_0x40be0f,threadId:_0x931263,commentId:_0xa63c4,content:_0x1ca332,attributes:_0x5d1a5d})=>this['_getService'](_0x40be0f)['addComment'](_0x931263,_0xa63c4,_0x1ca332,_0x5d1a5d)['catch'](ft),'updateComment':({channelId:_0xe0d535,threadId:_0x59df5c,commentId:_0x35dc8e,content:_0x3c19a0,attributes:_0x47f126})=>this['_getService'](_0xe0d535)['updateComment'](_0x59df5c,_0x35dc8e,_0x3c19a0,_0x47f126)['catch'](Z)['catch'](ft),'removeComment':({channelId:_0xb71dd4,threadId:_0x9754ad,commentId:_0x1aa025})=>this['_getService'](_0xb71dd4)['removeComment'](_0x9754ad,_0x1aa025)['catch'](Z)['catch'](ft)},_0x19847f instanceof _0x1ee2fd){const _0x2a52ce=_0x19847f['config']['get']('collaboration.channelId'),_0x1fbd0e=_0x19847f['plugins']['get'](i);await this['_setUpService'](_0x2a52ce);const _0x4945d1=await this['_services']['get'](_0x2a52ce)['getConnectedSessions']();this['listenTo'](_0x1fbd0e,'sessionAdd:'+_0x2a52ce,(_0x1fd514,{session:_0x3f7e3c})=>{_0x3f7e3c['id']===_0x1fbd0e['mySessionId']&&(_0x1fd514['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3f7e3c['permissions'],_0x2a52ce));}),_0x1fbd0e['register'](_0x2a52ce,_0x4945d1);}}async['_setUpService'](_0x69ceaf){if(this['_services']['has'](_0x69ceaf))throw new _0x65b8a3('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x69ceaf});const _0x14e293=this['context']['plugins']['get']('CommentsRepository'),_0x3449b7=new s['CommentsService'](_0x69ceaf);this['_services']['set'](_0x69ceaf,_0x3449b7),this['listenTo'](_0x3449b7,'commentThreadAdded',(_0x15497a,_0xe80360)=>{const {commentThreadId:_0x252acb,documentId:_0x5cb29a,context:_0x25a4d9,attributes:_0xbe8d44,resolvedAt:_0x615dc4,resolvedBy:_0x1c0626,comments:_0x5dcd78}=_0xe80360;_0x14e293['getCommentThread'](_0x252acb)||_0x14e293['addCommentThread']({'threadId':_0x252acb,'channelId':_0x5cb29a,'comments':_0x5dcd78?_0x5dcd78['map'](et):[],'context':_0x25a4d9,'attributes':_0xbe8d44,'resolvedAt':_0x615dc4,'resolvedBy':_0x1c0626,'isFromAdapter':!0x0});}),this['listenTo'](_0x3449b7,'commentThreadUpdated',(_0x1e9caa,{commentThreadId:_0x260de7,documentId:_0x1f4fa0,context:_0x4eebf3,unlinkedAt:_0x4fdb43,attributes:_0x273bdd})=>{_0x14e293['getCommentThread'](_0x260de7)&&_0x14e293['updateCommentThread']({'threadId':_0x260de7,'channelId':_0x1f4fa0,'context':_0x4eebf3,'unlinkedAt':_0x4fdb43,'attributes':_0x273bdd,'isFromAdapter':!0x0});}),this['listenTo'](_0x3449b7,'commentThreadResolved',(_0x840189,{commentThreadId:_0x128269,resolvedBy:_0x3d7481,resolvedAt:_0x51c4b6})=>{const _0x4fa50c=_0x14e293['getCommentThread'](_0x128269);_0x4fa50c&&_0x4fa50c['resolve']({'resolvedBy':_0x3d7481,'resolvedAt':_0x51c4b6,'isFromAdapter':!0x0});}),this['listenTo'](_0x3449b7,'commentThreadReopened',(_0x575f78,{commentThreadId:_0x22541})=>{const _0x2306ff=_0x14e293['getCommentThread'](_0x22541);_0x2306ff&&_0x2306ff['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3449b7,'commentThreadRemoved',(_0x4e2a0e,{commentThreadId:_0x376171})=>{const _0x2cecd9=_0x14e293['getCommentThread'](_0x376171);_0x2cecd9&&_0x2cecd9['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3449b7,'commentAdded',(_0x456af8,_0x44ef21)=>{const _0x55e5c4=_0x44ef21['commentThreadId'],_0xf2ebb1=_0x14e293['getCommentThread'](_0x55e5c4);_0xf2ebb1&&_0xf2ebb1['addComment']({...et(_0x44ef21),'isFromAdapter':!0x0});}),this['listenTo'](_0x3449b7,'commentUpdated',(_0x33a49f,{commentThreadId:_0x3d2d3a,commentId:_0x4abc4c,content:_0x11c23b,attributes:_0x4574fe})=>{const _0x4e898e=_0x14e293['getCommentThread'](_0x3d2d3a);if(_0x4e898e){const _0x5bec71=_0x4e898e['getComment'](_0x4abc4c);_0x5bec71&&_0x5bec71['update']({'content':_0x11c23b,'attributes':_0x4574fe,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3449b7,'commentRemoved',(_0x1953c6,{commentThreadId:_0x476564,commentId:_0x6e1f03})=>{const _0x296c82=_0x14e293['getCommentThread'](_0x476564);if(_0x296c82){const _0x4e04d0=_0x296c82['getComment'](_0x6e1f03);_0x4e04d0&&_0x4e04d0['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x69ceaf);}['destroy'](){if(this['context']instanceof _0x1ee2fd){const _0x558972=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x558972);}}['_terminateService'](_0x541268){if(!this['_services']['has'](_0x541268))throw new _0x65b8a3('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x541268});this['_getService'](_0x541268)['disconnect'](),this['_services']['delete'](_0x541268);}async['reconnect'](){for(const _0x2bacf9 of this['_services']['keys']())await this['_connectService'](_0x2bacf9);if(this['context']instanceof _0x1ee2fd){const _0x9f5cb8=this['context']['config']['get']('collaboration.channelId'),_0x2ee957=this['context']['plugins']['get'](i);_0x2ee957['unregister'](_0x9f5cb8);const _0x460269=await this['_services']['get'](_0x9f5cb8)['getConnectedSessions']();_0x2ee957['register'](_0x9f5cb8,_0x460269);}}async['_connectService'](_0x663131){const {connection:_0x2dec19}=this['context']['plugins']['get'](n),_0x27eaf9=this['context']['plugins']['get']('CommentsRepository'),_0x515a65=this['_services']['get'](_0x663131),_0x3694ad=await _0x515a65['connect'](_0x2dec19);await this['_fetchMissingUsersForThreads'](_0x3694ad);const _0xb45e4=new Set(Array['from'](_0x27eaf9['getCommentThreads']({'channelId':_0x663131}),_0x5cb4b0=>_0x5cb4b0['id']));for(const _0x59295f of _0x3694ad)_0x59295f['deletedAt']||_0xb45e4['delete'](_0x59295f['commentThreadId']);for(const _0x265df6 of _0xb45e4)_0x27eaf9['getCommentThread'](_0x265df6)['remove']({'isFromAdapter':!0x0});for(const _0x4dbe30 of _0x3694ad){let _0x35a99d=_0x27eaf9['getCommentThread'](_0x4dbe30['commentThreadId']);const {commentThreadId:_0x1fe983,context:_0x1a2faf,attributes:_0x58d742,resolvedBy:_0x2ecf82,resolvedAt:_0x538a0b,unlinkedAt:_0x41dc9d,deletedAt:_0x39482d}=_0x4dbe30;if(_0x39482d)continue;_0x35a99d||(_0x35a99d=_0x27eaf9['addCommentThread']({'channelId':_0x663131,'threadId':_0x1fe983,'context':_0x1a2faf,'attributes':_0x58d742||{},'resolvedBy':_0x2ecf82,'resolvedAt':_0x538a0b,'unlinkedAt':_0x41dc9d,'isFromAdapter':!0x0}));const _0x872ac8=new Set(Array['from'](_0x35a99d['comments'],_0x2ef44d=>_0x2ef44d['id']));for(const _0x44ee5d of _0x4dbe30['comments'])_0x872ac8['delete'](_0x44ee5d['commentId']);for(const _0x2d0dac of _0x872ac8)_0x35a99d['getComment'](_0x2d0dac)['remove']({'isFromAdapter':!0x0});for(const _0x4c9609 of _0x4dbe30['comments']){const _0x4d12a9=_0x35a99d['getComment'](_0x4c9609['commentId']);_0x4d12a9?_0x4d12a9['content']!==_0x4c9609['content']&&_0x4d12a9['update']({'content':_0x4c9609['content'],'isFromAdapter':!0x0}):_0x35a99d['addComment'](Object['assign'](et(_0x4c9609),{'isFromAdapter':!0x0}));}}}['_getService'](_0x46db02){if(!this['_services']['has'](_0x46db02))throw new _0x65b8a3('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x46db02});return this['_services']['get'](_0x46db02);}async['_fetchMissingUsersForThreads'](_0x17c6b4){const _0x24cafe=this['context']['plugins']['get'](_0x3cfe08),{connection:_0x2c38c4}=this['context']['plugins']['get'](n),_0x449db2=new Set();for(const {resolvedBy:_0x28deaf,comments:_0x587bce}of _0x17c6b4){_0x28deaf&&!_0x24cafe['getUser'](_0x28deaf)&&_0x449db2['add'](_0x28deaf);for(const {userId:_0x4f909c}of _0x587bce)_0x24cafe['getUser'](_0x4f909c)||_0x449db2['add'](_0x4f909c);}if(0x0===_0x449db2['size'])return;const _0x41fd44=await ut['getMany'](_0x2c38c4,Array['from'](_0x449db2));for(const _0xb8903a of _0x41fd44)_0x24cafe['getUser'](_0xb8903a['id'])||_0x24cafe['addUser'](_0xb8903a);}}async function Z(_0x31c74c){if('404'!==_0x31c74c['code'])throw _0x31c74c;}function ft(_0x17dfcb){if((_0x1bc678=_0x17dfcb)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1bc678['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1bc678['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1bc678;throw _0x17dfcb;}function et(_0x1e6ea5){return{'threadId':_0x1e6ea5['commentThreadId'],'commentId':_0x1e6ea5['commentId'],'content':_0x1e6ea5['content'],'createdAt':_0x1e6ea5['createdAt'],'authorId':_0x1e6ea5['userId'],'attributes':_0x1e6ea5['attributes']||{}};}class m extends _0x4315dd{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>rt)());['_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(_0x3af4ce){super(_0x3af4ce);const _0x5ee20a=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x5ee20a);}['init'](){const _0x2e5d4b=this['editor']['plugins']['get'](n),_0x398ae0=this['editor']['plugins']['get']('TrackChangesEditing');return _0x398ae0['adapter']={'getSuggestion':async _0x588b43=>{await this['_waitForServiceReady']();const _0x45ea04=await this['_trackChangesService']['get'](_0x588b43)['catch'](tt);return await this['_fetchMissingUsersForThreads']([_0x45ea04]),_0x45ea04;},'addSuggestion':async({id:_0x25f726,type:_0x410388,data:_0x4b6c50,originalSuggestionId:_0x1256b0,attributes:_0x2af76c})=>{await this['_waitForServiceReady']();const _0x3e5461={'id':_0x25f726,'type':_0x410388,'data':_0x4b6c50,'originalSuggestionId':_0x1256b0,'attributes':_0x2af76c},_0x359c55=await this['_trackChangesService']['add'](_0x25f726,_0x410388,_0x4b6c50,_0x1256b0,_0x2af76c)['catch'](_0x5b5633=>{if(mt(_0x5b5633))return new Promise(_0x102022=>{this['_bufferedRequests']['set'](_0x25f726,{'resolve':_0x102022,'suggestionData':_0x3e5461});});throw _0x5b5633;});return this['_bufferedRequests']['delete'](_0x25f726),_0x359c55;},'updateSuggestion':async(_0x55f1d2,_0xd97efd)=>{if(await this['_waitForServiceReady'](),'open'!==_0xd97efd['state'])return this['_trackChangesService']['update'](_0x55f1d2,_0xd97efd)['catch'](tt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x12e09f,_0x2a59f7)=>{_0x398ae0['hasSuggestion'](_0x2a59f7['id'])&&(_0x398ae0['getSuggestion'](_0x2a59f7['id'])['attributes']=_0x2a59f7['attributes']);}),this['_trackChangesService']['connect'](_0x2e5d4b['connection'])['then'](_0x4353fe=>(_0x2e5d4b['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x4353fe)['then'](()=>{for(const _0x2cb5e7 of _0x4353fe){_0x398ae0['addSuggestionData'](_0x2cb5e7)['_saved']=!0x0;}})));}async['reconnect'](){const _0x4198b8=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x11cdc4}=this['editor']['plugins']['get'](n),_0x112270=await this['_trackChangesService']['connect'](_0x11cdc4);await this['_fetchMissingUsersForThreads'](_0x112270);for(const {suggestionData:_0x3c16a9,resolve:_0x551085}of this['_bufferedRequests']['values']()){let _0x1a629f=_0x112270['find'](_0x3bc28a=>_0x3bc28a['id']===_0x3c16a9['id']);_0x1a629f||(_0x1a629f=await this['_trackChangesService']['add'](_0x3c16a9['id'],_0x3c16a9['type'],_0x3c16a9['data'],_0x3c16a9['originalSuggestionId'])),_0x551085(_0x1a629f);}for(const _0x116f74 of _0x112270)_0x4198b8['hasSuggestion'](_0x116f74['id'])||_0x4198b8['addSuggestionData'](_0x116f74);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x33f639=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3ff7c2=>{_0x3ff7c2['off'](),_0x33f639();});});}async['_fetchMissingUsersForThreads'](_0x2b66e3){const _0x1dd813=this['editor']['plugins']['get'](_0x3cfe08),{connection:_0x1ae78f}=this['editor']['plugins']['get'](n),_0x21e1e4=new Set();for(const {authorId:_0x33dc2f}of _0x2b66e3)_0x1dd813['getUser'](_0x33dc2f)||_0x21e1e4['add'](_0x33dc2f);if(0x0===_0x21e1e4['size'])return;const _0x5baef2=await ut['getMany'](_0x1ae78f,Array['from'](_0x21e1e4));for(const _0x166787 of _0x5baef2)_0x1dd813['getUser'](_0x166787['id'])||_0x1dd813['addUser'](_0x166787);}}function tt(_0x4e180b){if(mt(_0x4e180b))return new Promise(()=>{});throw _0x4e180b;}function mt(_0x3741b0){return _0x3741b0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3741b0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x4315dd{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 _0x42c692=this['editor']['plugins']['get'](n),_0x4594d9=this['editor']['plugins']['get']('CommentsEditing'),_0x375518=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x42c692,'change:state',(_0x22d5b1,_0x5c8912,_0x4cb027)=>{_0x4594d9['isThreadsLoadingPaused']='connected'!==_0x4cb027;});}),this['listenTo'](_0x42c692,'change:state',(_0x51c3bd,_0x2802fc,_0x462099)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x462099);}),_0x375518['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class pt extends _0x4315dd{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 _0x4315dd{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>st)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x3cfe08];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x26bb7f){super(_0x26bb7f);const _0x51c358=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x51c358);}async['init'](){const _0x328602=this['editor']['plugins']['get'](l),_0x37d961=_0x328602['serverHistory'],_0x3fe40b=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x37d961,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x328602['sessionId']});const _0x45e5ce=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x2d6071=await it['isBundleUploaded'](_0x3fe40b['connection'],_0x45e5ce);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x10ff2b})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x10ff2b)),'updateRevisions':async _0x278d10=>{await this['_waitForServiceReady']();const _0x4635f0=this['_revisionTracker']['currentRevision'];if(_0x2d6071&&0x1===_0x278d10['length']&&_0x278d10[0x0]['id']===_0x4635f0['id'])return _0x278d10;for(const _0x4e84df of _0x278d10)_0x4e84df['id']===_0x4635f0['id']&&(_0x4e84df['isEmptyCurrent']=_0x4e84df['fromVersion']===_0x4e84df['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x278d10,this['_lastRequestId'])['then'](_0x464a70=>(this['_lastRequestId']=_0x464a70,_0x278d10))['catch'](_0x3de3e8=>{if(ot(_0x3de3e8)||'400'===_0x3de3e8['code']&&void 0x0!==_0x3de3e8['data']['wrongRequestId']){for(const _0x7d604a of _0x278d10){!this['_revisionTracker']['repository']['getRevision'](_0x7d604a['id'])||this['_revisionTracker']['_bufferUpdate'](_0x7d604a['id'],_0x7d604a,!0x1);}if(ot(_0x3de3e8))throw _0x3de3e8;return _0x278d10;}throw _0x3de3e8;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x2a172b,{revisionsData:_0x5f360d,requestId:_0xa2db1c})=>{Math['max'](..._0x5f360d['map'](_0x10c3ae=>_0x10c3ae['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5f360d,_0xa2db1c);}):this['_handleRevisionsUpdate'](_0x5f360d,_0xa2db1c);});const {revisions:_0x3b9fad,requestId:_0x2ce48f}=await this['_revisionHistoryService']['connect'](_0x3fe40b['connection']);_0x3fe40b['addToReconnectionStack'](this),this['_lastRequestId']=_0x2ce48f,await this['_fetchMissingUsers'](_0x3b9fad);for(const _0x491c2e of _0x3b9fad)this['_revisionTracker']['addRevisionData'](_0x491c2e);this['listenTo'](_0x328602,'change:_isConnected',(_0xf5ff9e,_0xa5a088,_0x16ed4e)=>{_0x16ed4e&&(this['_oldOffset']=_0x328602['_offset'],_0xf5ff9e['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3fe40b,'state',_0x3969c1=>_0x3969c1===_0x407abe['CONNECTED']);}async['reconnect'](){const _0x17d6f3=this['editor']['plugins']['get'](n),_0x4f80fd=this['editor']['plugins']['get'](l),_0x5f1a99=async()=>{const _0x501821=this['_revisionTracker']['currentRevision'],_0x3d0dfa=_0x501821['id'],_0x3bf81c=_0x3d0dfa!==_0x4f80fd['sessionId'];if(_0x3bf81c){const _0x5940a1=_0x4f80fd['_offset']-this['_oldOffset'],_0x11ab2f=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x501821['toVersion']+_0x5940a1!==_0x11ab2f){const _0x17706f=_0x501821['fromVersion']+_0x5940a1,_0x208cd2=this['editor']['plugins']['get'](_0x3cfe08),_0x325251=this['_revisionTracker']['buildRevisionData']({'revision':_0x501821,'from':_0x17706f,'to':_0x11ab2f});_0x325251['id']=_0x501821['id'];const _0x3ae0d1=_0x325251['authorsIds']['map'](_0x40cbd6=>_0x208cd2['getUser'](_0x40cbd6));_0x501821['_update']({..._0x325251,'authors':_0x3ae0d1},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x501821['id'],_0x325251,!0x0);}this['_revisionTracker']['_startingVersion']=_0x11ab2f,(_0x501821['toVersion']===_0x501821['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x3d0dfa)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x3d0dfa),this['_revisionTracker']['_createCurrentRevision'](_0x11ab2f));}const {revisions:_0x3ae5be,requestId:_0x3f350b}=await this['_revisionHistoryService']['reconnect'](_0x17d6f3['connection'],this['_lastRequestId']);_0x3bf81c&&_0x3ae5be['length']>0x0?_0x4f80fd['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3ae5be),this['_handleRevisionsUpdate'](_0x3ae5be,_0x3f350b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4f80fd['_isConnected']?_0x5f1a99():new Promise((_0x2cef35,_0x185416)=>{_0x4f80fd['once']('change:_isConnected',()=>{_0x5f1a99()['then'](_0x2cef35)['catch'](_0x185416);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x595332=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x22f07c=>{_0x22f07c['off'](),_0x595332();});});}['_getLatestVersionFromServerOperations'](){const _0xb94dd=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x399f38 of _0xb94dd)if('marker'!==_0x399f38['type']||_0x399f38['affectsData'])return _0x399f38['baseVersion']+0x1;}['_getLatestVersion'](){const _0x265e69=this['editor']['plugins']['get'](l);return new Promise(_0x3a7f8a=>{_0x265e69['_isPendingUpdate']?_0x265e69['once']('change:_isPendingUpdate',()=>{_0x3a7f8a(this['_getLatestVersionFromServerOperations']());}):_0x3a7f8a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x1ad5bf,_0xa6c12f){const _0x1b2607=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xa6c12f;for(const _0x15c093 of _0x1ad5bf){const _0x860200=_0x1b2607['getRevision'](_0x15c093['id']);if(_0x860200){if((_0x15c093['fromVersion']||_0x15c093['toVersion'])&&(_0x15c093['diffData']=null),_0x860200===this['_revisionTracker']['currentRevision']){const _0x2cb8ff=Math['max'](_0x860200['toVersion'],_0x15c093['toVersion']),_0x503c90=Math['max'](_0x860200['fromVersion'],_0x15c093['fromVersion']);let _0x4ed21c;_0x860200['toVersion']===_0x15c093['toVersion']&&_0x860200['fromVersion']===_0x15c093['fromVersion']?(_0x4ed21c=!0x0,this['_preventResendingRevisionData'](_0x15c093)):_0x15c093['toVersion']===_0x2cb8ff&&_0x15c093['fromVersion']===_0x503c90?_0x4ed21c=!0x1:(_0x860200['toVersion']===_0x2cb8ff&&_0x860200['fromVersion']===_0x503c90||this['_fixRevision']({'revision':_0x860200,'from':_0x503c90,'to':_0x2cb8ff}),_0x4ed21c=!0x0),_0x4ed21c&&(delete _0x15c093['fromVersion'],delete _0x15c093['toVersion'],delete _0x15c093['diffData'],delete _0x15c093['createdAt'],delete _0x15c093['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x15c093),this['_preventResendingRevisionData'](_0x15c093);}else this['_revisionTracker']['addRevisionData'](_0x15c093);}const _0x5c2a4d=_0x1b2607['getRevisions']();_0x5c2a4d['reverse']();for(let _0x550065=0x0;_0x550065<_0x5c2a4d['length']-0x1;_0x550065++){const _0x44c218=_0x5c2a4d[_0x550065],_0x54d9ce=_0x5c2a4d[_0x550065+0x1];if(_0x44c218['fromVersion']<_0x54d9ce['toVersion']){const _0x225b09=_0x54d9ce['toVersion'],_0x4fc7a4=Math['max'](_0x225b09,_0x44c218['toVersion']);this['_fixRevision']({'revision':_0x44c218,'from':_0x225b09,'to':_0x4fc7a4});}}}['_fixRevision']({revision:_0x2c8864,from:_0x43c185,to:_0x1ad8bc}={}){const _0xcded4f=this['editor']['plugins']['get'](_0x3cfe08),_0xf5a8dc=this['_revisionTracker']['buildRevisionData']({'revision':_0x2c8864,'from':_0x43c185,'to':_0x1ad8bc});_0xf5a8dc['authors']=_0xf5a8dc['authorsIds']['map'](_0x462663=>_0xcded4f['getUser'](_0x462663)),_0x2c8864['_update'](_0xf5a8dc);}['_preventResendingRevisionData'](_0x40342a){const _0x3a67d3={};_0x3a67d3['id']=_0x40342a['id'];for(const _0x1d7853 of Object['keys'](_0x40342a))'id'!==_0x1d7853&&(_0x3a67d3[_0x1d7853]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x3a67d3['id'],_0x3a67d3,!0x0);}async['_fetchMissingUsers'](_0x2a489d){const _0x2fbb0e=this['editor']['plugins']['get'](_0x3cfe08),{connection:_0x144788}=this['editor']['plugins']['get'](n),_0x44a2e6=new Set();for(const _0x264500 of _0x2a489d){for(const _0x2db40f of _0x264500['authorsIds'])_0x2e61fc(_0x2db40f);_0x264500['creatorId']&&_0x2e61fc(_0x264500['creatorId']);}if(0x0===_0x44a2e6['size'])return;const _0xb987d6=await ut['getMany'](_0x144788,Array['from'](_0x44a2e6));for(const _0x456c8b of _0xb987d6)_0x2fbb0e['getUser'](_0x456c8b['id'])||_0x2fbb0e['addUser'](_0x456c8b);function _0x2e61fc(_0x26c220){_0x2fbb0e['getUser'](_0x26c220)||_0x44a2e6['add'](_0x26c220);}}}function ot(_0x352533){return _0x352533['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x352533['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x352533['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x4315dd{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 _0x1a9ee9{['_collapseAt'];constructor(_0x8fdc52,_0x1700d2=0x6){super(_0x8fdc52);const _0x151987=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1700d2,this['bind']('isHidden')['to'](this,'usersCount',_0xa27152=>_0xa27152<_0x1700d2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x151987['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':_0x151987['to']('usersCount',_0x582a56=>'+'+(_0x582a56-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x1a9ee9{['items'];['keystrokes'];constructor(_0x403ac1){super(_0x403ac1);const _0x273f11=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x50e56b(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x273f11['if']('hasPopup'),'aria-expanded':_0x273f11['to']('isExpanded',_0x554d41=>this['hasPopup']&&String(_0x554d41)),'aria-label':_0x273f11['to']('hasPopup',_0x7feba9=>E(_0x403ac1,_0x7feba9?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x273f11['to']('hasPopup',_0x25a971=>!!_0x25a971&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x273f11['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x273f11['to'](_0x5029bc=>{const _0x2bc8d7=_0x5029bc,_0x4aa1c8=document['querySelector']('.ck-presence-list__dropdown-list'),_0x173875=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4aa1c8?.['contains'](_0x2bc8d7['relatedTarget'])||_0x173875?.['contains'](_0x2bc8d7['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x425045,_0x37d70a,_0x39ebee)=>{this['element']&&(_0x39ebee?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 _0x1a9ee9{['counterView'];['inlineListView'];constructor(_0x371502,_0x1fa9c9=0x6){super(_0x371502);const _0x3c95b8=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x1fa9c9),this['inlineListView']=new is(_0x371502),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x1f2751 of this['inlineListView']['items'])_0x1f2751['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',_0x3c95b8['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x1a9ee9{['listWrapperView'];constructor(_0x4306f3,_0x3843c0){super(_0x4306f3);const _0xe0dd15=this['bindTemplate'];this['listWrapperView']=new wt(_0x4306f3,_0x3843c0),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x4306f3,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0xe0dd15['to'](_0x5835ff=>{const _0x10a9ef=_0x5835ff,_0x391259=document['querySelector']('.ck-presence-list__list'),_0x2594b3=document['querySelector']('.ck-balloon-panel_with-arrow');_0x391259?.['contains'](_0x10a9ef['relatedTarget'])||_0x2594b3?.['contains'](_0x10a9ef['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x46080d{constructor(_0x2ed0b0,_0x198063){super(_0x2ed0b0);const _0x62dcaa=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x198063?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x62dcaa['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x62dcaa['to']('role'),'aria-label':_0x62dcaa['to']('ariaLabel'),'aria-labelledby':_0x62dcaa['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x13e912['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x402a17=this['element'];_0x402a17&&(this['_isScrollable']=Math['max'](_0x402a17['scrollHeight'],_0x402a17['clientHeight'])>0.8*window['innerHeight']);}}class j extends ct{['userView'];constructor(_0x5c98af,_0x4b8c33,_0x23240f){super(_0x5c98af);const _0xc80839=this['bindTemplate'];this['userView']=new at(_0x5c98af,_0x4b8c33);const _0x71b2f5={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4b8c33['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4b8c33['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4b8c33['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x23240f&&(_0x71b2f5['tag']='button',_0x71b2f5['on']={'click':_0xc80839['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x71b2f5);}['focus'](){this['element']['focus']();}}class A extends _0x1a9ee9{['userView'];['markerView'];constructor(_0x5068d5,_0x3aa874,_0x3567c6){super(_0x5068d5);const _0x82ffd5=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new at(_0x5068d5,_0x3aa874),this['markerView']=new nt(_0x5068d5,_0x3aa874);const _0xbabec=new lt(_0x5068d5);_0xbabec['template']['tag']='span',_0xbabec['text']=_0x3aa874['name'];const _0x59242c={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x82ffd5['to']('isFocusable',_0x2462bc=>!!_0x2462bc&&0x0),'aria-labelledby':_0xbabec['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x82ffd5['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x82ffd5['to']('hasTooltip',_0xc08c22=>!_0xc08c22),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0xbabec]};_0x3567c6&&(_0x59242c['tag']='button',_0x59242c['on']={'click':_0x82ffd5['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x59242c);}}class nt extends _0x1a9ee9{constructor(_0x360ba1,_0x55f88f){super(_0x360ba1),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x55f88f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x452a47{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f874c){super(_0x4f874c),this['context']['config']['define']('presenceList',x);const _0x335380=_0x4f874c['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x335380)throw new _0x65b8a3('presencelist-collapseat-invalid-format',this);if(_0x335380<0x1)throw new _0x65b8a3('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x25c985(),this['balloonPanelView']=new _0x5e66bf(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x266aa7 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x266aa7);this['listenTo'](this['_allConnectedUsers'],'add',(_0x41e7d1,_0xabcae0)=>{this['_handleUserAdd'](_0xabcae0);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x42a4c2,_0x2a354b)=>{this['_handleUserRemove'](_0x2a354b);});}['_createView'](){const _0x2dfec9=this['context'],_0x3c79c7=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2c710a=this['balloonPanelView'];if(!_0x111d5f(_0x2dfec9['config']['get']('presenceList.container')))throw new _0x65b8a3('presencelist-missing-container',this);return _0x3c79c7['counterView']['bind']('usersCount')['to'](this),_0x3c79c7['bind']('isCollapsed')['to'](this,'usersCount',_0x305077=>{const {collapseAt:_0x49952a}=_0x2dfec9['config']['get']('presenceList'),_0x7d72f2=_0x305077>=_0x49952a;if(_0x7d72f2&&!_0x3c79c7['inlineListView']['items']['find'](_0x505ee5=>_0x505ee5 instanceof b)){const _0x4b1b56=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x4b1b56&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3c79c7['inlineListView']['items']['add'](_0x3c79c7['counterView']);}return _0x7d72f2||this['hideDropdown'](),_0x7d72f2;}),_0x3c79c7['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1df917=>{const _0x37aab1=_0x2dfec9['config']['get']('presenceList'),_0x1d7d52=new A(_0x2dfec9['locale'],_0x1df917,!!_0x37aab1['onClick']);return _0x1d7d52['bind']('hasTooltip')['to'](_0x3c79c7,'isCollapsed',_0x1f8e30=>!_0x1f8e30),_0x1d7d52['bind']('isFocusable')['to'](_0x3c79c7,'isCollapsed',_0x36e5e2=>!_0x36e5e2),_0x37aab1['onClick']&&this['listenTo'](_0x1d7d52,'execute',()=>{this['view']['isCollapsed']||_0x37aab1['onClick'](_0x1df917,_0x1d7d52['element']);}),_0x1d7d52;}),this['listenTo'](_0x3c79c7['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3c79c7['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3c79c7['inlineListView']['keystrokes']['set']('Enter',(_0x13c867,_0x23427b)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x23427b());}),_0x3c79c7['render'](),_0x2c710a['render'](),_0xeb7538({'emitter':_0x3c79c7,'activator':()=>_0x2c710a['isVisible'],'contextElements':[_0x2c710a['element'],_0x3c79c7['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x2dfec9['config']['get']('presenceList.container')['appendChild'](_0x3c79c7['element']),this['_bodyCollection']=new _0x6675d4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3c79c7;}['_handleUserAdd'](_0x4bb106){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x4bb106['isMe'])return;const _0x5008d6=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x5008d6-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x55912a=_0x4bb106['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x4bb106,_0x55912a);}['_handleUserRemove'](_0x13adec){this['usersCount']--;const {collapseAt:_0x51b716}=this['context']['config']['get']('presenceList'),_0xd2473=this['usersCount']>=_0x51b716;if(this['currentDisplayedUsers']['get'](_0x13adec['id']))this['currentDisplayedUsers']['remove'](_0x13adec['id']);else{if(_0xd2473&&this['currentDisplayedUsers']['length']+0x1===_0x51b716-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0xd2473?0x1:0x0)<this['usersCount']){for(const _0x57dfe1 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x57dfe1['id'])&&(this['currentDisplayedUsers']['add'](_0x57dfe1,Math['min'](this['currentDisplayedUsers']['length']-(_0xd2473?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0xd2473?0x1:0x0)===_0x51b716-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1c6248=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x1c6248['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x2544a5}=this['presenceDropdownView'];_0x2544a5['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x826029=>{if(!_0x1c6248['displayMe']&&_0x826029['isMe'])return null;const _0x1aeb33=new j(this['context']['locale'],_0x826029,!!_0x1c6248['onClick']);return _0x1c6248['onClick']&&this['listenTo'](_0x1aeb33,'execute',()=>{_0x1c6248['onClick'](_0x826029,_0x1aeb33['element']);}),_0x1aeb33;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x2544a5['focus'](),_0x2544a5['checkIfScrollable']();const _0x3d3122=(_0x2c3b33,_0x1803a1)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1803a1();};_0x2544a5['keystrokes']['set']('Esc',_0x3d3122),_0x2544a5['keystrokes']['set']('Shift+Tab',_0x3d3122),_0x2544a5['keystrokes']['set']('Tab',(_0x1f1603,_0x1f2f12)=>{!function(_0xe9dd9e){const _0x8b2d81=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x1fbc66=>_0x1fbc66+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xdb138=[...document['body']['querySelectorAll'](_0x8b2d81)]['filter'](_0xdf6080=>_0xdf6080===document['activeElement']||_0xdf6080['offsetWidth']+_0xdf6080['offsetHeight']>0x0)['sort']((_0x31259d,_0x467996)=>(_0x31259d['tabIndex']||0x0)-(_0x467996['tabIndex']||0x0)),_0x5be1df=_0xdb138['indexOf'](_0xe9dd9e),_0x447e03=_0xdb138[(_0x5be1df+0x1)%_0xdb138['length']];_0x447e03&&_0x447e03['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1f2f12();}),_0x2544a5['focusTracker']['add'](this['view']['element']),_0x2544a5['focusTracker']['on']('change:isFocused',(_0x1dc930,_0x547524,_0x457750)=>{_0x457750||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 vt extends _0x452a47{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,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway,L as _RtcPresenceDropdownListView,wt as _RtcPresenceDropdownListWrapperView,v as _RtcPresenceListView};
|
package/dist/translations/af.js
CHANGED
|
@@ -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':
|
|
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':_0x4cb47a=>0x1!=_0x4cb47a}};
|