@ckeditor/ckeditor5-real-time-collaboration 48.3.1-alpha.0 → 48.3.1
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/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 +12 -12
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Context as
|
|
24
|
-
((()=>_0x463167)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return[_0x714698,_0x11a28f];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a0aa1){super(_0x2a0aa1),this['set']('state',_0x1efdad['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2b5a78())();}['init'](){const _0x152b6f=this['context'],_0x11bda1=_0x152b6f['plugins']['get'](_0x714698),_0x4f0e70=_0x152b6f['plugins']['get'](_0x11a28f);if(!_0x11bda1['token'])throw new _0x598d78('websocketgateway-missing-token',this);if(!_0x11bda1['webSocketUrl'])throw new _0x598d78('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),WebSocketGateway['WebSocketGateway']['connect'](_0x11bda1['token'],_0x11bda1['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3af8b8=>{if(this['connection']=_0x3af8b8,this['bind']('state')['to'](_0x3af8b8,'state',this,'_isBrowserOffline',(_0x492574,_0x3ad291)=>('connected'!==_0x492574&&(this['_shouldPluginsReconnect']=!0x0),_0x3ad291||_0x492574!==_0x1efdad['CONNECTED']?_0x1efdad['DISCONNECTED']:this['state']==_0x1efdad['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1efdad['CONNECTING']):_0x1efdad['CONNECTED'])),this['connection']['on']('error',(_0x19a3ed,_0x13d516)=>{if('limitExceeded'!==_0x13d516['code'])throw console['error'](_0x13d516),new _0x598d78('cloudservices-init',null,{'originalError':_0x13d516});_0x4f0e70['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'});}),!_0x3af8b8['me'])return new Promise(_0x46d986=>_0x3af8b8['on']('change:me',_0x46d986));})['catch'](_0x6292fd=>{throw console['error'](_0x6292fd),new _0x598d78('cloudservices-init',null,{'originalError':_0x6292fd});});}['addToReconnectionStack'](_0x181cea){if('function'!=typeof _0x181cea['reconnect'])throw new _0x598d78('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x181cea))throw new _0x598d78('websocketgateway-plugin-already-registered',this,{'name':_0x181cea['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x181cea);}['removeFromReconnectionStack'](_0x3375f3){this['_reconnectionStack']['delete'](_0x3375f3);}['isInReconnectionStack'](_0x21402b){return this['_reconnectionStack']['has'](_0x21402b);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x3d787d=>_0x3d787d['reconnect']())))['then'](()=>this['state']=_0x1efdad['CONNECTED'])['catch'](_0x4c135f=>{throw console['error'](_0x4c135f),new _0x598d78('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1efdad['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}},Y=class extends _0x205d54{['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[z,_0x536115];}constructor(_0x7a54f8){super(_0x7a54f8),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x22f614(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x536115);}['init'](){const _0x4a68c3=this['context']['plugins']['get'](z);this['listenTo'](_0x4a68c3,'change:state',(_0x350aab,_0x56887d,_0x24f97a)=>{if('connected'!==_0x24f97a)this['channelSessions']['forEach'](_0x816fa3=>_0x816fa3['clear']()),this['channelConnectedUsers']['forEach'](_0x16de3f=>_0x16de3f['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3c07aa,_0x473880]of this['_registeredSessions'])for(const _0x2ca246 of _0x473880)this['_handleSessionAdd'](_0x3c07aa,_0x2ca246);}}),this['_createUser'](_0x4a68c3['connection']['me'],!0x0);}['register'](_0xe2333a,_0x3b648e){if(this['_registeredSessions']['has'](_0xe2333a))throw new _0x598d78('sessions-register-already-registered',null,{'channelId':_0xe2333a});this['_registeredSessions']['set'](_0xe2333a,_0x3b648e),this['channelSessions']['set'](_0xe2333a,new _0x22f614()),this['channelConnectedUsers']['set'](_0xe2333a,new _0x22f614()),this['listenTo'](_0x3b648e,'add',(_0xcd35fe,_0x4db798)=>this['_handleSessionAdd'](_0xe2333a,_0x4db798)),this['listenTo'](_0x3b648e,'remove',(_0x1a242,_0x2b9874)=>this['_handleSessionRemove'](_0xe2333a,_0x2b9874));for(const _0x2069e2 of _0x3b648e)this['_handleSessionAdd'](_0xe2333a,_0x2069e2);}['unregister'](_0x33c427){if(!this['_registeredSessions']['has'](_0x33c427))throw new _0x598d78('sessions-unregister-not-exist',null,{'channelId':_0x33c427});const _0x2339ab=this['_registeredSessions']['get'](_0x33c427);this['stopListening'](_0x2339ab);for(const _0x170962 of _0x2339ab)'connected'===this['context']['plugins']['get'](z)['state']&&this['_handleSessionRemove'](_0x33c427,_0x170962);this['_registeredSessions']['delete'](_0x33c427),this['channelSessions']['delete'](_0x33c427),this['channelConnectedUsers']['delete'](_0x33c427);}get['mySessionId'](){return this['context']['plugins']['get'](z)['connection']['sessionId'];}['getUserBySessionId'](_0x3c22ba){for(const _0x1e1696 of this['channelSessions']['values']())for(const _0x888fd5 of _0x1e1696)if(_0x888fd5['id']===_0x3c22ba)return _0x888fd5['user'];}['getUserSessions'](_0x182a9e,_0x34df25){const _0x43134a=_0x34df25?[this['channelSessions']['get'](_0x34df25)]:this['channelSessions']['values'](),_0x29708a=new Set();for(const _0x2450f7 of _0x43134a)for(const _0x24326d of _0x2450f7)_0x24326d['user']['id']===_0x182a9e['id']&&_0x29708a['add'](_0x24326d['id']);return _0x29708a;}['getUserRole'](_0x51e00b){for(const _0x135bd1 of this['channelSessions']['values']())for(const _0xc0ca34 of _0x135bd1)if(_0xc0ca34['user']===_0x51e00b)return _0xc0ca34['role'];}['_handleSessionAdd'](_0x240538,_0x5b88b7){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x31dc61=_0x5b88b7['user'],_0x20f471=this['_users']['getUser'](_0x31dc61['id'])||this['_createUser'](_0x31dc61),_0x59df0b=Object['assign']({},_0x5b88b7,{'user':_0x20f471});if(this['channelSessions']['get'](_0x240538)['add'](_0x59df0b),!_0x31dc61['hiddenInPresenceList']){const _0x420055=this['channelConnectedUsers']['get'](_0x240538);_0x420055['has'](_0x20f471['id'])||_0x420055['add'](_0x20f471),this['allConnectedUsers']['has'](_0x20f471['id'])||_0x31dc61['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x20f471,_0x20f471['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x240538,{'channelId':_0x240538,'session':_0x59df0b});}['_handleSessionRemove'](_0xd844d2,_0x4efed5){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x2b1d86=this['channelConnectedUsers']['get'](_0xd844d2),_0x6e66a=_0x4efed5['user'];_0x6e66a['id']&&(this['channelSessions']['get'](_0xd844d2)['remove'](_0x4efed5['id']),_0x2b1d86['has'](_0x6e66a['id'])&&!this['getUserSessions'](_0x6e66a,_0xd844d2)['size']&&_0x2b1d86['remove'](_0x6e66a['id']),this['allConnectedUsers']['get'](_0x6e66a['id'])&&!this['getUserSessions'](_0x6e66a)['size']&&this['allConnectedUsers']['remove'](_0x6e66a['id']));}['_createUser'](_0x1c4f7d,_0x4ac23b){const _0x340753=this['_users']['addUser'](_0x1c4f7d);return _0x4ac23b&&this['_users']['defineMe'](_0x1c4f7d['id']),_0x340753['orderNumber']=this['_uniqueUsersCount']++,_0x340753;}},K=class extends _0x12753f{['_domEmitter']=new(_0x2b5a78())();static get['requires'](){return[Y];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xa39f52=this['editor'],_0x48349e=_0xa39f52['plugins']['get'](Y);_0xa39f52['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x15d9da,{writer:_0x38af72})=>function(_0xa6cdbf,_0x177ca5,_0x1431f8,_0x3e6424){const _0x447cac=_0xa6cdbf['markerName']['split'](':')[0x2],_0x45a5bb=_0x1431f8['getUserBySessionId'](_0x447cac);if(!_0x45a5bb||_0x447cac===_0x1431f8['mySessionId'])return;if(!_0x3e6424['model']['schema']['checkChild'](_0xa6cdbf['markerRange']['start'],'$text'))return;const _0xa384c={'class':'ck-user__marker\x20'+_0x45a5bb['color']['getMarkerClass'](),'style':Q(_0x45a5bb),'data-name':_0x45a5bb['name'],'data-session-id':_0x447cac},_0xe19782=_0x3e6424['model']['markers']['get'](_0xa6cdbf['markerName'])['getStart'](),_0x1bf498=_0xe19782['nodeAfter'],_0x214ba4=_0x3e6424['model']['schema'];if(_0x1bf498&&_0x214ba4['isObject'](_0x1bf498)&&_0x214ba4['isInline'](_0x1bf498)&&!_0x3e6424['model']['markers']['get']('user:range:'+_0x447cac)['getRange']()['isCollapsed'])return;const _0x5681a5=_0xe19782['parent'];return _0x3e6424['model']['schema']['isLimit'](_0x5681a5)&&!_0x3e6424['model']['hasContent'](_0x5681a5)&&(_0xa384c['contenteditable']=!0x1),function(_0x17942e,_0x3f17bd,_0x2b3a6d){const _0x1f0505=_0x17942e['createUIElement']('span',_0x3f17bd);return _0x17942e['setCustomProperty']('userPositionMarker',!0x0,_0x1f0505),_0x1f0505['render']=function(_0x2d73f7){const _0x69a2c1=this['toDomElement'](_0x2d73f7),_0x22004f=document['createElement']('span');return _0x22004f['classList']['add']('ck-user__marker-tooltip'),_0x22004f['setAttribute']('contenteditable','false'),_0x22004f['setAttribute']('spellcheck','false'),_0x22004f['textContent']=_0x2b3a6d['name'],_0x69a2c1['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x22004f['outerHTML']+'',_0x69a2c1['addEventListener']('mouseenter',()=>{_0x69a2c1['classList']['add']('ck-user__marker_hovered');}),_0x69a2c1['addEventListener']('mouseleave',()=>{_0x69a2c1['classList']['remove']('ck-user__marker_hovered');}),_0x69a2c1;},_0x1f0505['isSimilar']=function(_0x1c51ac){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1c51ac['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1c51ac['getAttribute']('data-session-id'));},_0x1f0505;}(_0x177ca5,_0xa384c,_0x45a5bb);}(_0x15d9da,_0x38af72,_0x48349e,_0xa39f52)}),_0xa39f52['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3edd71=>function(_0x334bcf,_0x327fee){const _0x2cc5ee=_0x334bcf['markerName']['split'](':')[0x2];if(_0x2cc5ee===_0x327fee['mySessionId'])return null;const _0x4fef55=_0x327fee['getUserBySessionId'](_0x2cc5ee);return _0x4fef55?{'id':_0x2cc5ee,'classes':['ck-user__selection',_0x4fef55['color']['getSelectionClass']()],'attributes':{'style':Q(_0x4fef55),'data-session-id':_0x2cc5ee},'priority':0x7d0+_0x4fef55['orderNumber']}:{'id':_0x2cc5ee,'classes':[]};}(_0x3edd71,_0x48349e)}),function(_0x332aae){const _0x1d2aac=_0x332aae['model'],_0xb3303b=new Map(),_0x3b0494=_0x332aae['plugins']['get'](Y);_0x1d2aac['markers']['on']('update:user:range',(_0x2cd193,_0x413cf4,_0x20db6a,_0x3aaeea)=>{if(!_0x3aaeea&&_0xb3303b['get'](_0x413cf4['name']))return _0xb3303b['get'](_0x413cf4['name'])['detach'](),void _0xb3303b['delete'](_0x413cf4['name']);const _0x1364d6=_0x413cf4['name']['split'](':')[0x2];if(_0x1364d6===_0x3b0494['mySessionId'])return;const _0x3d6084='user:position:'+_0x1364d6;_0x1d2aac['markers']['has'](_0x3d6084)&&_0x332aae['editing']['reconvertMarker'](_0x3d6084),_0x413cf4['on']('change:range',(_0x131451,_0x28b91a,_0x27fe06)=>{if('$graveyard'!=_0x28b91a['root']['rootName']&&'$graveyard'==_0x413cf4['getRange']()['root']['rootName']&&!_0xb3303b['has'](_0x413cf4['name'])){const _0x1b392d=_0x1d2aac['schema']['getNearestSelectionRange'](_0x27fe06['deletionPosition']);if(_0x1b392d){const _0x1d0e7e=_0x4a7ea3['fromRange'](_0x1b392d);_0xb3303b['set'](_0x413cf4['name'],_0x1d0e7e),_0x1d0e7e['on']('change:range',(_0x53b451,_0x5718f1,_0x4e2135)=>{if('$graveyard'==_0x1d0e7e['root']['rootName']){const _0x2a677c=_0x1d2aac['schema']['getNearestSelectionRange'](_0x4e2135['deletionPosition']);_0x2a677c?(_0x1d0e7e['start']=_0x2a677c['start'],_0x1d0e7e['end']=_0x2a677c['end']):(_0xb3303b['delete'](_0x413cf4['name']),_0x1d0e7e['detach']());}});}}});}),_0x1d2aac['document']['on']('change',()=>{_0xb3303b['size']>0x0&&_0x1d2aac['enqueueChange']({'isUndoable':!0x1},_0x107b51=>{for(const [_0x144c5f,_0x73b35a]of _0xb3303b)'$graveyard'==_0x1d2aac['markers']['get'](_0x144c5f)['getRange']()['root']['rootName']&&(J(_0x144c5f['split'](':')[0x2],_0x73b35a['toRange'](),_0x1d2aac,_0x107b51),_0x73b35a['detach']());_0xb3303b['clear']();});});}(_0xa39f52),this['_domEmitter']['listenTo'](_0x50de14['document'],'keydown',(_0x2eebfe,{key:_0x2e9eab})=>{'Escape'===_0x2e9eab&&function(_0x54eb2d){_0x54eb2d['editing']['view']['change'](_0x273b5=>{for(const _0x2a69f7 of _0x54eb2d['model']['markers']){if(!_0x2a69f7['name']['startsWith']('user:position'))continue;const _0xcbbb43=_0x54eb2d['editing']['mapper']['markerNameToElements'](_0x2a69f7['name']);if(_0xcbbb43){for(const _0x307961 of _0xcbbb43)_0x273b5['removeClass']('ck-user__marker_hovered',_0x307961);}}});}(_0xa39f52);},{'useCapture':!0x0});}['afterInit'](){const _0x42555d=this['editor'],_0x1ec3b9=_0x42555d['commands']['get']('undo');_0x1ec3b9&&_0x42555d['model']['on']('applyOperation',(_0x30baa2,_0x28da87)=>{const _0x11f02d=_0x28da87[0x0];if(!_0x11f02d['isDocumentOperation'])return;if('marker'!=_0x11f02d['type']||!_0x11f02d['name']['startsWith']('user:'))return;const _0x1cbc02=_0x11f02d['batch'];_0x1ec3b9['_createdBatches']['has'](_0x1cbc02)&&(_0x11f02d['newRange']=_0x11f02d['oldRange']?_0x42555d['model']['createRange'](_0x11f02d['oldRange']['start'],_0x11f02d['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x19050d=this['editor'],_0x58d7d7=_0x19050d['model']['document'],_0x59a312=_0x19050d['plugins']['get'](Y);_0x19050d['model']['enqueueChange']({'isUndoable':!0x1},_0x2ef6ee=>{const _0x29eee5='user:range:'+_0x59a312['mySessionId'],_0x561dd7='user:position:'+_0x59a312['mySessionId'],_0x41f5e2=_0x19050d['model']['markers']['has'](_0x29eee5);_0x19050d['editing']['view']['hasDomSelection']?J(_0x59a312['mySessionId'],_0x58d7d7['selection']['getFirstRange'](),_0x19050d['model'],_0x2ef6ee):_0x41f5e2&&(_0x2ef6ee['removeMarker'](_0x29eee5),_0x2ef6ee['removeMarker'](_0x561dd7));});}};function J(_0x28b4f5,_0x129a62,_0x17965c,_0x269012){const _0x551445='user:range:'+_0x28b4f5,_0x493ed4='user:position:'+_0x28b4f5,_0x49f931=_0x129a62['getContainedElement']();let _0x21b4b0=_0x129a62['start'];if(_0x49f931&&_0x49f931['is']('element','tableCell')){const _0xd563f5=function(_0x5f065b,_0x3ce7bf){for(const _0x2a77d2 of _0x5f065b['getPositions']())if(_0x3ce7bf['schema']['checkChild'](_0x2a77d2,'$text'))return _0x2a77d2;}(_0x129a62,_0x17965c);_0xd563f5&&(_0x21b4b0=_0xd563f5,_0x129a62=_0x269012['createRange'](_0x21b4b0));}const _0x570ab6=_0x269012['createRange'](_0x21b4b0);_0x17965c['markers']['has'](_0x551445)?(_0x269012['updateMarker'](_0x551445,{'range':_0x129a62}),_0x269012['updateMarker'](_0x493ed4,{'range':_0x570ab6})):(_0x269012['addMarker'](_0x551445,{'range':_0x129a62,'usingOperation':!0x0}),_0x269012['addMarker'](_0x493ed4,{'range':_0x570ab6,'usingOperation':!0x0}));}function Q(_0x39da37){return'--ck-user-color:'+_0x39da37['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x39da37['color']['getColorAlphaVariable']()+';';}function X(_0x17c136,_0x244dad,_0x1415ed){const _0x2b5775=_0x17c136['t'],t=_0x17c136['t'];switch(_0x244dad){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 _0x2b5775({'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'},_0x1415ed);default:return'';}}let Z=0x1;var tt=class RealTimeCollaborationClient extends _0x12753f{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x2d630b)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[z,Y,K,_0x404f2f,_0x536115,_0x11a28f];}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 _0x3e7a76=this['serverHistory']['getOperations']();for(let _0x386a80=_0x3e7a76['length']-0x1;_0x386a80>=0x0;_0x386a80--){const _0x2297dd=_0x3e7a76[_0x386a80];if(!this['_disconnectionOperations']['has'](_0x2297dd))return _0x2297dd['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x559edd){if(super(_0x559edd),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1130c0(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x598d78('collaboration-missing-channelid',this);const _0x3ad504=_0x559edd['config']['get']('cloudServices.bundleVersion')||_0x9010bd;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x3ad504,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2d6326(),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 it(this['_disconnectionOperations']);}['init'](){const _0xdd5cfa=this['editor'],_0x8701ac=_0xdd5cfa['plugins']['get'](_0x536115),_0x22874a=_0xdd5cfa['plugins']['get'](z);this['listenTo'](_0x8701ac,'getOperationAuthor',(_0x397660,_0x3b9aa2)=>{const _0x481b2a=_0x3b9aa2[0x0];_0x481b2a['_authorId']&&(_0x397660['return']=_0x8701ac['getUser'](_0x481b2a['_authorId']),_0x397660['stop']()),null===_0x481b2a['_authorId']&&(_0x397660['return']=null,_0x397660['stop']());},{'priority':'high'}),this['listenTo'](_0xdd5cfa['model']['document']['selection'],'change:range',(_0x248f30,_0xfcdcd2)=>{_0xfcdcd2['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xdd5cfa['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xdd5cfa['model']['on']('applyOperation',(_0x82ef91,_0x1a12f3)=>{const _0x1eb8ae=_0x1a12f3[0x0];_0x1eb8ae['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1eb8ae),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x22874a,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x404df1,_0x1dc6c9,_0x3d4f72)=>'connected'===_0x404df1&&!_0x1dc6c9&&!_0x3d4f72),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xdd5cfa['disableReadOnlyMode']('rtc-offline'):_0xdd5cfa['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xdd5cfa['disableReadOnlyMode']('rtc-offline'):_0xdd5cfa['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x196643=this['editor']['plugins']['get'](Y),_0x25510c=this['editor']['plugins']['get'](z);try{this['_isPendingUpdate']=!0x0,_0x196643['unregister'](this['_channelId']);const _0x34e745=await this['_service']['reconnect'](_0x25510c['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x34e745)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3730ef=await this['_service']['getConnectedSessions']();_0x196643['register'](this['_channelId'],_0x3730ef),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2a1f3f){if(function(_0x2be86b){return'404'===_0x2be86b['code'];}(_0x2a1f3f)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x181c55){return'409'===_0x181c55['code'];}(_0x2a1f3f)){const _0x5590cc=X(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'](_0x5590cc);}else{if(!(_0x2a1f3f instanceof et))throw _0x2a1f3f;this['_handleReconnectionError']();}}}}['destroy'](){const _0x5e6da3=this['editor']['plugins']['get'](z),_0x28fa1a=this['editor']['plugins']['get'](Y);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x28fa1a['channelSessions']['has'](this['_channelId'])&&_0x28fa1a['unregister'](this['_channelId']),_0x5e6da3['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x39cf88){if(this['sessionId']!==_0x39cf88['sessionId']&&this['_lastSyncedOperationId']!==_0x39cf88['lastOperationId'])throw new et();return this['sessionId']=_0x39cf88['sessionId'],this['_handleServerResponse']([],{..._0x39cf88,'wereChangesApplied':!0x1,'data':_0x39cf88['data']},'reconnect');}async['_connectService'](_0x1d1811,_0xa96338=!0x1){const {connection:_0xb03d51}=this['editor']['plugins']['get'](z);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0xb03d51,this['_channelId'])['then'](_0x146da2=>this['_initSessionsHandling'](_0x146da2))['catch'](_0x4bb6f2=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4bb6f2);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x467acd,_0x177189)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x177189);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x324630=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1d1811);this['_isPendingUpdate']=!0x0;const _0xcefef7=await this['_service']['connect'](_0xb03d51,this['_compressOperations'](_0x1d1811),_0x324630);if(this['sessionId']=_0xcefef7['sessionId'],_0xa96338){if(!_0xcefef7['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xcefef7['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1d1811,_0xcefef7,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xcefef7,_0x1d1811);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3a98da=this['editor']['plugins']['get'](Y),_0x51ad84=this['editor']['plugins']['get'](K),_0x1e6efb=_0x3a98da['channelSessions']['get'](this['_channelId']);_0x1e6efb&&_0x1e6efb['length']>0x1?_0x51ad84['createUserMarkerOperations']():this['listenTo'](_0x3a98da,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3a98da['channelSessions']['get'](this['_channelId'])['length']&&_0x51ad84['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x37664d,_0x26da3d,_0x1e5de0,_0xd4d58a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x26da3d){const _0x5346a4=this['_decompressOperations'](_0x1e5de0,_0xd4d58a);await this['_fetchMissingUsers'](_0x5346a4),this['_handleExternalOperations'](_0x5346a4,_0x26da3d,_0x1e5de0['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x4ad652}=this['editor'];let _0x196ad1;try{_0x196ad1=await this['_service']['getDocumentDetails']();}catch{const _0x2e17f9=X(_0x4ad652,'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'](_0x2e17f9);}const _0x350167=_0x196ad1['currentDocumentSession']||_0x196ad1['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x350167['lastOperationId']){const _0x5aead1=X(_0x4ad652,'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'](_0x5aead1);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_handleChannelDisconnected'](){const _0x4f11cf=this['editor']['plugins']['get'](z);if(this['_isConnected']=!0x1,!_0x4f11cf['connection']||'connected'!==_0x4f11cf['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x11e5d1=this['editor']['plugins']['get'](Y);_0x11e5d1['channelSessions']['has'](this['_channelId'])&&_0x11e5d1['unregister'](this['_channelId']),_0x4f11cf['removeFromReconnectionStack'](this),this['_disconnectService']();}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xaaf166){const _0x441893=this['editor']['plugins']['get'](Y);this['listenTo'](_0x441893,'sessionAdd:'+this['_channelId'],(_0x4a61f5,{session:_0x17b6e0})=>{if(_0x17b6e0['id']===_0x441893['mySessionId']){_0x4a61f5['off']();const _0x352444=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4f5b50=_0x17b6e0['permissions'];_0x352444&&_0x352444['isEnabled']&&(_0x4f5b50=_0x4f5b50['filter'](_0x493fca=>'document:write'!==_0x493fca)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4f5b50,this['_channelId']);}}),_0x441893['register'](this['_channelId'],_0xaaf166);}['_initThrowingOnDataSet'](){const _0x16f53b=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x610d7b)=>{if(!_0x610d7b[_0x610d7b['length']-0x1]['suppressErrorInCollaboration'])throw new _0x598d78('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x16f53b['apply'](this['editor']['data'],_0x610d7b);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4f9217,[_0x2c0a33])=>{if(this['_document']['version'])throw new _0x598d78('realtimecollaborationclient-init-document-already-initialized',this);_0x4f9217['stop'](),this['_setPendingAction']();const _0xcb96b2=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x377829])=>!_0x377829['lazyLoad'])['map'](([_0x1638f4,_0x5ca25a])=>[_0x1638f4,_0x5ca25a['modelAttributes']||{}])),_0x25589b=this['_getOperationsFromInitData'](_0x2c0a33,_0xcb96b2);0x0==_0x25589b['length']&&_0x25589b['push'](new _0x21a0fe(0x0)),_0x4f9217['return']=this['_connectService'](_0x25589b)['then'](()=>{this['editor']['plugins']['get'](z)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0xee1e84=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0xee1e84))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1e5864,[_0x2a1be4,_0x4b3fea])=>{_0x1e5864['stop']();const _0x206e8e=this['editor']['model']['document']['getRoot'](_0x2a1be4);if(!this['_knownRootNames']['has'](_0x2a1be4)){const _0x1f506d=_0x4b3fea&&_0x4b3fea['data']?_0x4b3fea['data']:'',_0x4367a9=_0x4b3fea&&_0x4b3fea['attributes']?_0x4b3fea['attributes']:{};await this['_loadRoot'](_0x2a1be4,_0x1f506d,_0x4367a9);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x206e8e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x206e8e);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xa8ea3f){const _0x61fadf=this['editor']['plugins']['get'](_0x536115),{connection:_0x46c72d}=this['editor']['plugins']['get'](z),_0xfe444e=new Set();for(const _0x3bacd4 of _0xa8ea3f){const _0x2295f3=_0x3bacd4['_authorId'];_0x2295f3&&!_0x61fadf['getUser'](_0x2295f3)&&_0xfe444e['add'](_0x2295f3);}if(0x0===_0xfe444e['size'])return;const _0xb54030=await _0x31677b['getMany'](_0x46c72d,Array['from'](_0xfe444e));for(const _0x1e596e of _0xb54030)_0x61fadf['getUser'](_0x1e596e['id'])||_0x61fadf['addUser'](_0x1e596e);}['_getOperationsFromInitData'](_0x2eefb1,_0x2156fa={}){const _0x44f5de=this['editor']['model'],_0x279244=[];let _0x58f5c8=0x0;const _0x56570d='string'==typeof _0x2eefb1?{'main':_0x2eefb1}:_0x2eefb1;for(const _0x1b0333 of Object['keys'](_0x56570d)){if(!this['_document']['roots']['has'](_0x1b0333))throw new _0x598d78('realtimecollaborationclient-init-non-existent-root',this);const _0x19958b=this['_document']['getRoot'](_0x1b0333),_0x42ed28=this['editor']['data']['parse'](_0x56570d[_0x1b0333],_0x19958b),_0x1cb24f=new _0x43bd9a(_0x44f5de['createPositionAt'](_0x19958b,0x0),_0x42ed28,_0x58f5c8++);_0x279244['push'](_0x1cb24f);for(const [_0x3a5166,_0x3d457e]of _0x42ed28['markers']){const _0x3565ff=new _0x1cf862(_0x3a5166,null,_0x44f5de['createRange'](_0x44f5de['createPositionFromPath'](_0x19958b,_0x3d457e['start']['path']['slice']()),_0x44f5de['createPositionFromPath'](_0x19958b,_0x3d457e['end']['path']['slice']())),_0x44f5de['markers'],!0x0,_0x58f5c8++);_0x279244['push'](_0x3565ff);}}if(_0x2156fa)for(const [_0x2b23bf,_0x20ee80]of Object['entries'](_0x2156fa)){const _0x5c900d=_0x44f5de['document']['getRoot'](_0x2b23bf);if(!_0x5c900d)throw new _0x598d78('multi-root-editor-root-attributes-no-root',null);for(const [_0x5f209,_0x3d80f6]of Object['entries'](_0x20ee80))if(null!==_0x3d80f6){const _0x1d12d0=new _0x296644(_0x5c900d,_0x5f209,null,_0x3d80f6,_0x58f5c8++);_0x279244['push'](_0x1d12d0);}}return _0x279244;}async['_loadRoot'](_0x51ceb8,_0x3b3663,_0x151bf9){this['_getOperationsFromInitData']({[_0x51ceb8]:_0x3b3663},{[_0x51ceb8]:_0x151bf9})['forEach']((_0x51d8c8,_0x5a7e54)=>{_0x51d8c8['baseVersion']=this['_document']['version']+_0x5a7e54,_0x51d8c8['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x51d8c8);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5b22dc,_0x215041){let _0x390074;this['_offset']=_0x5b22dc['offset'];const _0x4aaa27=_0x5b22dc['wereChangesApplied']&&!_0x5b22dc['initData'],_0x37e5dc=_0x4aaa27?0x0:_0x5b22dc['data']['baseVersion'];if(_0x215041['forEach'](_0x3f3793=>{_0x3f3793['_isInit']=!0x0,_0x3f3793['createdAt']=_0x5b22dc['sessionCreatedAt'],_0x3f3793['_authorId']=null;}),_0x4aaa27)_0x390074=_0x215041,this['_applyOperationsSet'](_0x390074,_0x4aaa27);else{if(_0x5b22dc['initData']){const _0x15ce06=this['_getOperationsFromInitData'](_0x5b22dc['initData']);this['_document']['history']['version']=-_0x15ce06['length'],_0x15ce06['forEach'](_0x10403c=>{_0x10403c['baseVersion']-=_0x15ce06['length'],_0x10403c['createdAt']=_0x5b22dc['sessionCreatedAt'],_0x10403c['_isInit']=!0x0,_0x10403c['_authorId']=null;}),this['_applyOperationsSet'](_0x15ce06,!0x0),this['serverHistory']['version']=-_0x15ce06['length']+this['_offset'],this['_updateServerHistory'](_0x15ce06);}this['_document']['history']['version']=_0x37e5dc,_0x390074=this['_decompressOperations'](_0x5b22dc['data'],_0x5b22dc['metadata']),await this['_fetchMissingUsers'](_0x390074),this['_applyOperationsSet'](_0x390074,_0x4aaa27);}_0x5b22dc['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x390074,_0x5b22dc['lastOperationId']),this['_lastSyncedOperationId']=_0x5b22dc['lastOperationId']),this['serverHistory']['version']=_0x37e5dc+this['_offset'],this['_updateServerHistory'](_0x390074),_0x215041['filter'](_0xbc4c0c=>{const _0x56a434=this['_getAffectedRoot'](_0xbc4c0c);return _0x56a434&&!this['_knownRootNames']['has'](_0x56a434);})['forEach']((_0x452458,_0x1e8531)=>{_0x452458['baseVersion']=this['_document']['version']+_0x1e8531,this['_saveOperationInBuffer'](_0x452458);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0xda94a2,_0x57c7b4){const _0x356a7f=_0x57c7b4&&_0x57c7b4['message'];if(_0x356a7f&&_0x356a7f['startsWith']('realtimecollaborationclient'))throw _0x57c7b4;const _0x34b3f8=this['editor']['plugins']['get'](z);throw this['_isPendingUpdate']=!0x0,_0x34b3f8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x598d78(_0xda94a2,this['editor'],_0x356a7f?{'originalError':_0x356a7f}:void 0x0);}['_saveOperationInBuffer'](_0x325a86){this['_knownOperations']['has'](_0x325a86)||(this['_knownOperations']['add'](_0x325a86),this['_bufferedOperations']['push'](_0x325a86),this['_pendingAction']||'marker'==_0x325a86['type']&&!_0x325a86['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x51ba61=!0x1){!_0x51ba61&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1f2566=>{_0x1f2566&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0xdd15ac=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x27cb80){return _0x27cb80['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x27cb80['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x27cb80['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0xdd15ac)||this['_crash'](_0xdd15ac['message'],_0xdd15ac);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x25f622=>{this['on']('change:_isPendingUpdate',()=>{_0x25f622();});});}async['_sendBufferedOperations'](){const _0x1aa732=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x1aa732['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x34ac01=[...this['_bufferedOperations']];for(const _0x4da84f of _0x34ac01)_0x4da84f['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4da84f);const _0x32e5be=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x34ac01),_0x159640=Z++,_0x43d8b3=this['_compressOperations'](_0x34ac01),_0x2c610a=await this['_service']['sendOperations'](_0x43d8b3,_0x43d8b3['baseVersion'],_0x32e5be);try{return await this['_handleServerResponse'](_0x34ac01,_0x2c610a,_0x159640);}catch(_0x3bc46a){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3bc46a);}}async['_handleServerResponse'](_0x504016,_0x5e1118,_0x44db76){if('error'in _0x5e1118)throw _0x5e1118['error'];let _0x5b34a9=!0x1;if(_0x5e1118['wereChangesApplied']){_0x5e1118['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5e1118['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4849d3=>!_0x504016['includes'](_0x4849d3));for(const _0x1a4ba7 of _0x504016)_0x1a4ba7['createdAt']='lastOperationAcceptedAt'in _0x5e1118&&_0x5e1118['lastOperationAcceptedAt']||void 0x0;st(_0x504016,_0x5e1118['version']-_0x504016['length']),this['_updateServerHistory'](_0x504016);const _0x4472d9=_0x504016['filter'](_0x305c63=>{if(!_0x305c63['_isInit'])return!0x1;const _0x38eb4b=this['_getAffectedRoot'](_0x305c63);return _0x38eb4b&&!this['_knownRootNames']['has'](_0x38eb4b);});st(_0x4472d9,this['_document']['version']),this['_applyOperationsSet'](_0x4472d9),_0x5b34a9=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x454b1f=this['_decompressOperations'](_0x5e1118['data'],_0x5e1118['metadata'])['filter'](_0x375674=>_0x375674['baseVersion']>=this['_lastServerVersion']);_0x454b1f['forEach'](_0x4dfc0a=>this['_addKnownRoot'](_0x4dfc0a)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3b5294=>!_0x3b5294['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3b5294))),this['_bufferedOperations']['length']&&st(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x454b1f),_0x5b34a9=this['_handleExternalOperations'](_0x454b1f,_0x5e1118['version'],_0x5e1118['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5b34a9?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x8af6be,_0x2ae7e8,_0x3cd215){try{const _0x5a47b2={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2221a2,operationsB:_0x18a17b,originalOperations:_0x4fcc12}=_0x26b393(_0x8af6be,this['_bufferedOperations'],_0x5a47b2);st(_0x2221a2,this['_document']['version']),st(_0x18a17b,_0x2ae7e8);for(const _0xd7c2d0 of _0x2221a2){const _0x510ba5=_0x4fcc12['get'](_0xd7c2d0);_0x510ba5?(_0xd7c2d0['_authorId']=_0x510ba5['_authorId'],'noop'!==_0xd7c2d0['type']&&(_0xd7c2d0['_aiSource']=_0x510ba5['_aiSource'])):_0xd7c2d0['_authorId']=null;}for(const _0x4ea0aa of _0x18a17b)'noop'!==_0x4ea0aa['type']&&(_0x4ea0aa['_aiSource']=_0x4fcc12['get'](_0x4ea0aa)?.['_aiSource']);_0x3cd215&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x8af6be,_0x3cd215),this['_lastSyncedOperationId']=_0x3cd215),this['_bufferedOperations']=[..._0x18a17b],this['_applyOperationsSet'](_0x2221a2),this['_updateServerHistory'](_0x8af6be);}catch(_0xd35a78){return console['error'](_0xd35a78),!0x1;}return!0x0;}['_applyOperationsSet'](_0x511603,_0xdd9a69=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x47efcc=>{for(const _0x28e35c of _0x511603)this['_knownOperations']['add'](_0x28e35c),this['_addKnownRoot'](_0x28e35c),_0x47efcc['batch']['addOperation'](_0x28e35c),this['editor']['model']['applyOperation'](_0x28e35c);});}['_addKnownRoot'](_0x28baa3){const _0x406708=this['_getAffectedRoot'](_0x28baa3);_0x406708&&this['_knownRootNames']['add'](_0x406708);}['_getAffectedRoot'](_0x3ae803){let _0x4b4cab,_0x4aa879;switch(_0x3ae803['type']){case'insert':_0x4b4cab=_0x3ae803['position']['root'];break;case'marker':if(_0x4aa879=_0x3ae803['newRange'],!_0x4aa879)return null;_0x4b4cab=_0x4aa879['root'];break;case'addRootAttribute':_0x4b4cab=_0x3ae803['root'];break;case'addRoot':_0x4b4cab=_0x3ae803['affectedSelectable'];break;case'move':_0x4b4cab=_0x3ae803['targetPosition']['root'];break;default:return null;}return _0x4b4cab['rootName'];}['_updateServerHistory'](_0x1fb0fa){_0x1fb0fa['forEach'](_0x542ad8=>{const _0x4c85cb=_0x542ad8['clone']();_0x4c85cb['_authorId']=_0x542ad8['_authorId'],_0x4c85cb['_isInit']=!!_0x542ad8['_isInit'],_0x4c85cb['_aiSource']=_0x542ad8['_aiSource'],_0x4c85cb['createdAt']=_0x542ad8['createdAt'],_0x4c85cb['baseVersion']+=this['_offset'],_0x542ad8['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4c85cb),this['serverHistory']['addOperation'](_0x4c85cb);});}['_handleReconnectionError'](_0x29ef1a){const _0x5c71b2=this['editor']['plugins']['get']('Notification'),_0x412b19=this['editor']['locale'];_0x29ef1a||(_0x29ef1a=X(_0x412b19,'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.')),_0x5c71b2['showWarning'](_0x29ef1a,{'title':X(_0x412b19,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](z)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x404f2f)['add'](X(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x404f2f)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x29ac37){const _0x3d71f1=_0x29ac37['map'](_0x279791=>_0x279791['toJSON']());return this['_compressor']['compress'](_0x3d71f1);}['_decompressOperations'](_0x1257b4,_0x5b868d){return this['_compressor']['decompress'](_0x1257b4)['map']((_0x44ac40,_0x86d30)=>{const _0x51eed7='init'==_0x5b868d[_0x86d30]['type'];if('InsertOperation'==_0x44ac40['__className']){const _0x36cec1=_0x44ac40['position']['root'];!this['_document']['getRoot'](_0x36cec1)&&(this['_document']['createRoot']('$unknown',_0x36cec1)['_isAttached']=!0x1);}else{if('RootOperation'==_0x44ac40['__className']){const _0x299148=this['_document']['getRoot'](_0x44ac40['rootName']);_0x299148&&'$unknown'==_0x299148['name']&&_0x44ac40['elementName']!=_0x299148['name']&&(_0x299148['name']=_0x44ac40['elementName']);}}const _0x12ddcc=_0x5f362f['fromJSON'](_0x44ac40,this['_document']);return _0x12ddcc['wasUndone']=_0x44ac40['wasUndone'],_0x12ddcc['_isInit']=_0x51eed7,_0x12ddcc['_authorId']=_0x51eed7?null:_0x5b868d[_0x86d30]['userId'],_0x12ddcc['_isDisconnection']='cs:removeUser'===_0x5b868d[_0x86d30]['type'],_0x12ddcc['_aiSource']=_0x44ac40['_aiSource']||void 0x0,_0x12ddcc['createdAt']=_0x5b868d[_0x86d30]['createdAt'],_0x12ddcc;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x373c1a=this['editor']['plugins']['get'](Y)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x373c1a&&_0x373c1a['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},et=class extends Error{};function st(_0x2373cd,_0x1503ea){for(const _0xdc08ad of _0x2373cd)_0xdc08ad['baseVersion']=_0x1503ea++;}var it=class{['_ignoredOperations'];['_operationToId'];constructor(_0x517cd3){this['_ignoredOperations']=_0x517cd3,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x29d93f){let _0x23d8a3=_0x29d93f['length'];for(;_0x23d8a3--;){const _0x36c7fa=_0x29d93f[_0x23d8a3];if(!this['_ignoredOperations']['has'](_0x36c7fa)){if(!this['_operationToId']['has'](_0x36c7fa)){const _0x1e00fd=_0x1a4351()['slice'](0x1,0x12);this['_operationToId']['set'](_0x36c7fa,_0x1e00fd);}return this['_operationToId']['get'](_0x36c7fa);}}}['setIdForTheLastOperation'](_0x2cb95b,_0x157e0d){if(!_0x157e0d)return;let _0x15cd69=_0x2cb95b['length'];for(;_0x15cd69--;){const _0x11edf8=_0x2cb95b[_0x15cd69];this['_ignoredOperations']['has'](_0x11edf8)||this['_operationToId']['set'](_0x11edf8,_0x157e0d);}}},nt=class extends _0x12753f{static get['requires'](){return[tt];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ot=class CloudServicesCommentsAdapter extends _0x205d54{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x52be00)());['_services'];static get['requires'](){return[z,_0x8c7984,Y,_0x536115];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x195354){super(_0x195354),this['_services']=new Map();}async['init'](){const _0x433205=this['context'],_0x4ff488=_0x433205['plugins']['get'](_0x8c7984);if(_0x433205['plugins']['get'](z)['addToReconnectionStack'](this),_0x4ff488['adapter']={'addCommentThread':async({channelId:_0x579cb9,threadId:_0x4c0dc9,comments:_0x18a780,resolvedAt:_0x5bcea6,resolvedBy:_0x2f20ae,context:_0x42c622,attributes:_0x2e798b})=>{const _0x3809e7=await this['_getService'](_0x579cb9)['addCommentThread']({'commentThreadId':_0x4c0dc9,'comments':_0x18a780['map'](_0x200254=>function(_0x10bb7a,_0x24ab4d,_0x343aa5){return{'commentThreadId':_0x343aa5,'commentId':_0x10bb7a['commentId'],'userId':_0x10bb7a['authorId'],'content':_0x10bb7a['content'],'documentId':_0x24ab4d,'createdAt':_0x10bb7a['createdAt'],'attributes':_0x10bb7a['attributes']||{}};}(_0x200254,_0x579cb9,_0x4c0dc9)),'resolvedAt':_0x5bcea6,'resolvedBy':_0x2f20ae,'context':_0x42c622,'attributes':_0x2e798b})['catch'](ct);return{'threadId':_0x3809e7['commentThreadId'],'comments':_0x3809e7['comments']};},'getCommentThread':async({channelId:_0x2330ff,threadId:_0x552900})=>{const _0x552063=await this['_getService'](_0x2330ff)['getCommentThread'](_0x552900)['catch'](rt)['catch'](ct);return _0x552063?_0x552063['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x552063]),{'threadId':_0x552063['commentThreadId'],'comments':_0x552063['comments']['map'](at),'context':_0x552063['context'],'resolvedAt':_0x552063['resolvedAt'],'resolvedBy':_0x552063['resolvedBy'],'attributes':_0x552063['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x57a44d,threadId:_0x2453b5,context:_0x30c2df,unlinkedAt:_0x3c03cd,attributes:_0x58f044})=>this['_getService'](_0x57a44d)['updateCommentThread']({'commentThreadId':_0x2453b5,'context':_0x30c2df,'attributes':_0x58f044,'unlinkedAt':_0x3c03cd})['catch'](rt)['catch'](ct),'resolveCommentThread':async({channelId:_0x449b65,threadId:_0xb711aa})=>{const _0x15fa44=await this['_getService'](_0x449b65)['resolveCommentThread'](_0xb711aa)['catch'](rt)['catch'](ct);return{'threadId':_0x15fa44['commentThreadId'],'resolvedAt':_0x15fa44['resolvedAt'],'resolvedBy':_0x15fa44['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3d9a52,threadId:_0x552287})=>this['_getService'](_0x3d9a52)['reopenCommentThread'](_0x552287)['catch'](rt)['catch'](ct),'removeCommentThread':({channelId:_0x3566a0,threadId:_0x2e6237})=>this['_getService'](_0x3566a0)['removeCommentThread'](_0x2e6237)['catch'](rt)['catch'](ct),'addComment':({channelId:_0x1311a0,threadId:_0xb65bfa,commentId:_0x88d53b,content:_0x6639,attributes:_0xd851d0})=>this['_getService'](_0x1311a0)['addComment'](_0xb65bfa,_0x88d53b,_0x6639,_0xd851d0)['catch'](ct),'updateComment':({channelId:_0x46030f,threadId:_0x301b75,commentId:_0x3781bd,content:_0x3359c4,attributes:_0x40cb03})=>this['_getService'](_0x46030f)['updateComment'](_0x301b75,_0x3781bd,_0x3359c4,_0x40cb03)['catch'](rt)['catch'](ct),'removeComment':({channelId:_0x5d5f33,threadId:_0x59c41c,commentId:_0x17c92f})=>this['_getService'](_0x5d5f33)['removeComment'](_0x59c41c,_0x17c92f)['catch'](rt)['catch'](ct)},_0x433205 instanceof _0x54a80b){const _0x3eca1c=_0x433205['config']['get']('collaboration.channelId'),_0x346dd4=_0x433205['plugins']['get'](Y);await this['_setUpService'](_0x3eca1c);const _0xe6d275=await this['_services']['get'](_0x3eca1c)['getConnectedSessions']();this['listenTo'](_0x346dd4,'sessionAdd:'+_0x3eca1c,(_0x41e55d,{session:_0x31081d})=>{_0x31081d['id']===_0x346dd4['mySessionId']&&(_0x41e55d['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x31081d['permissions'],_0x3eca1c));}),_0x346dd4['register'](_0x3eca1c,_0xe6d275);}}async['_setUpService'](_0x5b3cd8){if(this['_services']['has'](_0x5b3cd8))throw new _0x598d78('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x5b3cd8});const _0x29d238=this['context']['plugins']['get'](_0x8c7984),_0x30af84=new CloudServicesCommentsAdapter['CommentsService'](_0x5b3cd8);this['_services']['set'](_0x5b3cd8,_0x30af84),this['listenTo'](_0x30af84,'commentThreadAdded',(_0x45ca8e,_0x805fb3)=>{const {commentThreadId:_0x5b2e56,documentId:_0x56d992,context:_0x1e360a,attributes:_0x4baf54,resolvedAt:_0x3372cf,resolvedBy:_0x2e68a3,comments:_0x5e8eed}=_0x805fb3;_0x29d238['getCommentThread'](_0x5b2e56)||_0x29d238['addCommentThread']({'threadId':_0x5b2e56,'channelId':_0x56d992,'comments':_0x5e8eed?_0x5e8eed['map'](at):[],'context':_0x1e360a,'attributes':_0x4baf54,'resolvedAt':_0x3372cf,'resolvedBy':_0x2e68a3,'isFromAdapter':!0x0});}),this['listenTo'](_0x30af84,'commentThreadUpdated',(_0x4100c5,{commentThreadId:_0x15f7ca,documentId:_0x40d8cf,context:_0x535dc9,unlinkedAt:_0x4f1e28,attributes:_0x5a277f})=>{_0x29d238['getCommentThread'](_0x15f7ca)&&_0x29d238['updateCommentThread']({'threadId':_0x15f7ca,'channelId':_0x40d8cf,'context':_0x535dc9,'unlinkedAt':_0x4f1e28,'attributes':_0x5a277f,'isFromAdapter':!0x0});}),this['listenTo'](_0x30af84,'commentThreadResolved',(_0x121e26,{commentThreadId:_0x57eecf,resolvedBy:_0x3306b2,resolvedAt:_0x1dce8f})=>{const _0xf35740=_0x29d238['getCommentThread'](_0x57eecf);_0xf35740&&_0xf35740['resolve']({'resolvedBy':_0x3306b2,'resolvedAt':_0x1dce8f,'isFromAdapter':!0x0});}),this['listenTo'](_0x30af84,'commentThreadReopened',(_0x4f836d,{commentThreadId:_0x5881dd})=>{const _0x55a466=_0x29d238['getCommentThread'](_0x5881dd);_0x55a466&&_0x55a466['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x30af84,'commentThreadRemoved',(_0x3c1fc4,{commentThreadId:_0x5d16a4})=>{const _0x2d4fe3=_0x29d238['getCommentThread'](_0x5d16a4);_0x2d4fe3&&_0x2d4fe3['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x30af84,'commentAdded',(_0x1e6535,_0x97ad75)=>{const _0x3152a4=_0x97ad75['commentThreadId'],_0x4a8736=_0x29d238['getCommentThread'](_0x3152a4);_0x4a8736&&_0x4a8736['addComment']({...at(_0x97ad75),'isFromAdapter':!0x0});}),this['listenTo'](_0x30af84,'commentUpdated',(_0x233db2,{commentThreadId:_0x26d7ed,commentId:_0x1189cd,content:_0x701cd0,attributes:_0x32ce62})=>{const _0x534106=_0x29d238['getCommentThread'](_0x26d7ed);if(_0x534106){const _0x213d96=_0x534106['getComment'](_0x1189cd);_0x213d96&&_0x213d96['update']({'content':_0x701cd0,'attributes':_0x32ce62,'isFromAdapter':!0x0});}}),this['listenTo'](_0x30af84,'commentRemoved',(_0x5a2a62,{commentThreadId:_0x15a016,commentId:_0x3e1e4b})=>{const _0x72925e=_0x29d238['getCommentThread'](_0x15a016);if(_0x72925e){const _0x41c877=_0x72925e['getComment'](_0x3e1e4b);_0x41c877&&_0x41c877['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x30af84,'disconnected',()=>{'connected'===this['context']['plugins']['get'](z)['connection']?.['state']&&(this['_services']['delete'](_0x5b3cd8),this['stopListening'](_0x30af84));}),await this['_connectService'](_0x5b3cd8);}['destroy'](){if(this['context']instanceof _0x54a80b){const _0xfaa031=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0xfaa031)&&this['_terminateService'](_0xfaa031);}}['_terminateService'](_0xf372d1){if(!this['_services']['has'](_0xf372d1))throw new _0x598d78('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0xf372d1});this['_getService'](_0xf372d1)['disconnect'](),this['_services']['delete'](_0xf372d1);}async['reconnect'](){for(const _0x3c2ceb of this['_services']['keys']())await this['_connectService'](_0x3c2ceb);if(this['context']instanceof _0x54a80b){const _0xbcf40b=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0xbcf40b)){const _0x544dc5=this['context']['plugins']['get'](Y);_0x544dc5['unregister'](_0xbcf40b);const _0x297121=await this['_services']['get'](_0xbcf40b)['getConnectedSessions']();_0x544dc5['register'](_0xbcf40b,_0x297121);}}}async['_connectService'](_0x16cf2a){const {connection:_0x2afe8f}=this['context']['plugins']['get'](z),_0x4475c0=this['context']['plugins']['get'](_0x8c7984),_0x44a332=await this['_services']['get'](_0x16cf2a)['connect'](_0x2afe8f);await this['_fetchMissingUsersForThreads'](_0x44a332);const _0x49a379=new Set(Array['from'](_0x4475c0['getCommentThreads']({'channelId':_0x16cf2a}),_0x5d8687=>_0x5d8687['id']));for(const _0x3534f3 of _0x44a332)_0x3534f3['deletedAt']||_0x49a379['delete'](_0x3534f3['commentThreadId']);for(const _0x89f1d5 of _0x49a379)_0x4475c0['getCommentThread'](_0x89f1d5)['remove']({'isFromAdapter':!0x0});for(const _0x43ea15 of _0x44a332){let _0x31a96f=_0x4475c0['getCommentThread'](_0x43ea15['commentThreadId']);const {commentThreadId:_0x2f3721,context:_0x311f4f,attributes:_0x531b1e,resolvedBy:_0x327a64,resolvedAt:_0x3f7900,unlinkedAt:_0xd68c5a,deletedAt:_0x117a82}=_0x43ea15;if(_0x117a82)continue;_0x31a96f||(_0x31a96f=_0x4475c0['addCommentThread']({'channelId':_0x16cf2a,'threadId':_0x2f3721,'context':_0x311f4f,'attributes':_0x531b1e||{},'resolvedBy':_0x327a64,'resolvedAt':_0x3f7900,'unlinkedAt':_0xd68c5a,'isFromAdapter':!0x0}));const _0x4fa6a7=new Set(Array['from'](_0x31a96f['comments'],_0x28af0d=>_0x28af0d['id']));for(const _0x316866 of _0x43ea15['comments'])_0x4fa6a7['delete'](_0x316866['commentId']);for(const _0x457d7b of _0x4fa6a7)_0x31a96f['getComment'](_0x457d7b)['remove']({'isFromAdapter':!0x0});for(const _0x3a973d of _0x43ea15['comments']){const _0x474349=_0x31a96f['getComment'](_0x3a973d['commentId']);_0x474349?_0x474349['content']!==_0x3a973d['content']&&_0x474349['update']({'content':_0x3a973d['content'],'isFromAdapter':!0x0}):_0x31a96f['addComment'](Object['assign'](at(_0x3a973d),{'isFromAdapter':!0x0}));}}}['_getService'](_0x29e69f){if(!this['_services']['has'](_0x29e69f))throw new _0x598d78('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x29e69f});return this['_services']['get'](_0x29e69f);}async['_fetchMissingUsersForThreads'](_0x3ebc18){const _0x4aa2fd=this['context']['plugins']['get'](_0x536115),{connection:_0x296154}=this['context']['plugins']['get'](z),_0x476dc0=new Set();for(const {resolvedBy:_0x18b8a9,comments:_0x19c92e}of _0x3ebc18){_0x18b8a9&&!_0x4aa2fd['getUser'](_0x18b8a9)&&_0x476dc0['add'](_0x18b8a9);for(const {userId:_0x4e1971}of _0x19c92e)_0x4aa2fd['getUser'](_0x4e1971)||_0x476dc0['add'](_0x4e1971);}if(0x0===_0x476dc0['size'])return;const _0x52b858=await _0x31677b['getMany'](_0x296154,Array['from'](_0x476dc0));for(const _0x2f5ffc of _0x52b858)_0x4aa2fd['getUser'](_0x2f5ffc['id'])||_0x4aa2fd['addUser'](_0x2f5ffc);}};async function rt(_0x529b7c){if('404'!==_0x529b7c['code'])throw _0x529b7c;}function ct(_0x423d80){if((_0x5147cc=_0x423d80)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5147cc['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5147cc['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5147cc;throw _0x423d80;}function at(_0x322d67){return{'threadId':_0x322d67['commentThreadId'],'commentId':_0x322d67['commentId'],'content':_0x322d67['content'],'createdAt':_0x322d67['createdAt'],'authorId':_0x322d67['userId'],'attributes':_0x322d67['attributes']||{}};}var ht=class CloudServicesTrackChangesAdapter extends _0x12753f{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x44490b)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[z,tt,_0x49c6d9,Y,_0x536115];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44bcdc){super(_0x44bcdc);const _0x1b31c2=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x1b31c2);}async['init'](){const _0x2acc5b=this['editor']['plugins']['get'](tt),_0x683101=_0x2acc5b['serverHistory'],_0x3198b9=this['editor']['plugins']['get'](z);this['_revisionTracker']['setSource']({'history':_0x683101,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x2acc5b['sessionId']});const _0x337231=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x9010bd,_0x12a463=await _0x445268['isBundleUploaded'](_0x3198b9['connection'],_0x337231);this['editor']['plugins']['get'](_0x49c6d9)['adapter']={'getRevision':async({revisionId:_0x2b7a7f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x2b7a7f)),'updateRevisions':async _0x4b7090=>{await this['_waitForServiceReady']();const _0x506093=this['_revisionTracker']['currentRevision'];if(_0x12a463&&0x1===_0x4b7090['length']&&_0x4b7090[0x0]['id']===_0x506093['id'])return _0x4b7090;for(const _0x3bf73b of _0x4b7090)_0x3bf73b['id']===_0x506093['id']&&(_0x3bf73b['isEmptyCurrent']=_0x3bf73b['fromVersion']===_0x3bf73b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4b7090,this['_lastRequestId'])['then'](_0x39151b=>(this['_lastRequestId']=_0x39151b,_0x4b7090))['catch'](_0x237f90=>{if(pt(_0x237f90)||'400'===_0x237f90['code']&&void 0x0!==_0x237f90['data']['wrongRequestId']){for(const _0x546cb3 of _0x4b7090)this['_revisionTracker']['repository']['getRevision'](_0x546cb3['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x546cb3['id'],_0x546cb3,!0x1);if(pt(_0x237f90)&&'destroyed'!==this['editor']['state'])throw _0x237f90;return _0x4b7090;}throw _0x237f90;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xa08de1,{revisionsData:_0x1cc931,requestId:_0x34e2f8})=>{Math['max'](..._0x1cc931['map'](_0x826531=>_0x826531['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1cc931,_0x34e2f8);}):this['_handleRevisionsUpdate'](_0x1cc931,_0x34e2f8);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x3198b9['connection']?.['state']&&(_0x3198b9['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x279579,requestId:_0x2d1405}=await this['_revisionHistoryService']['connect'](_0x3198b9['connection']);_0x3198b9['addToReconnectionStack'](this),this['_lastRequestId']=_0x2d1405,await this['_fetchMissingUsers'](_0x279579);for(const _0x1d47ff of _0x279579)this['_revisionTracker']['addRevisionData'](_0x1d47ff);this['listenTo'](_0x2acc5b,'change:_isConnected',(_0x31d950,_0x3ca159,_0x169599)=>{_0x169599&&(this['_oldOffset']=_0x2acc5b['_offset'],_0x31d950['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async['reconnect'](){const _0x45c83c=this['editor']['plugins']['get'](z),_0x4ebbcf=this['editor']['plugins']['get'](tt),_0x2cd273=async()=>{const _0x4c750a=this['_revisionTracker']['currentRevision'],_0x592c9a=_0x4c750a['id'],_0x54041e=_0x592c9a!==_0x4ebbcf['sessionId'];if(_0x54041e){const _0xc8ccea=_0x4ebbcf['_offset']-this['_oldOffset'],_0x3ce183=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x4c750a['toVersion']+_0xc8ccea!==_0x3ce183){const _0x540cf1=_0x4c750a['fromVersion']+_0xc8ccea,_0x164a5a=this['editor']['plugins']['get'](_0x536115),_0x3a35b2=this['_revisionTracker']['buildRevisionData']({'revision':_0x4c750a,'from':_0x540cf1,'to':_0x3ce183});_0x3a35b2['id']=_0x4c750a['id'];const _0x5ae921=_0x3a35b2['authorsIds']['map'](_0x41a311=>_0x164a5a['getUser'](_0x41a311));_0x4c750a['_update']({..._0x3a35b2,'authors':_0x5ae921},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4c750a['id'],_0x3a35b2,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3ce183,_0x4c750a['toVersion']!==_0x4c750a['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x592c9a)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x592c9a),this['_revisionTracker']['_createCurrentRevision'](_0x3ce183);}const {revisions:_0xea30cf,requestId:_0x53fed1}=await this['_revisionHistoryService']['reconnect'](_0x45c83c['connection'],this['_lastRequestId']);_0x54041e&&_0xea30cf['length']>0x0?_0x4ebbcf['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0xea30cf),this['_handleRevisionsUpdate'](_0xea30cf,_0x53fed1),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4ebbcf['_isConnected']?_0x2cd273():new Promise((_0x15bf72,_0x50e26c)=>{_0x4ebbcf['once']('change:_isConnected',()=>{_0x2cd273()['then'](_0x15bf72)['catch'](_0x50e26c);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1d50c0=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x11b105=>{_0x11b105['off'](),_0x1d50c0();});});}['_getLatestVersionFromServerOperations'](){const _0x1f2325=this['editor']['plugins']['get'](tt)['serverHistory']['getOperations']()['reverse']();for(const _0x423e3c of _0x1f2325)if('marker'!==_0x423e3c['type']||_0x423e3c['affectsData'])return _0x423e3c['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5a8966=this['editor']['plugins']['get'](tt);return new Promise(_0x550664=>{_0x5a8966['_isPendingUpdate']?_0x5a8966['once']('change:_isPendingUpdate',()=>{_0x550664(this['_getLatestVersionFromServerOperations']());}):_0x550664(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x2262e6,_0x1bbe1b){const _0x5d0e38=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x1bbe1b;for(const _0x1fbb77 of _0x2262e6){const _0x53b102=_0x5d0e38['getRevision'](_0x1fbb77['id']);if(_0x53b102){if((_0x1fbb77['fromVersion']||_0x1fbb77['toVersion'])&&(_0x1fbb77['diffData']=null),_0x53b102===this['_revisionTracker']['currentRevision']){const _0x51faae=Math['max'](_0x53b102['toVersion'],_0x1fbb77['toVersion']),_0x169520=Math['max'](_0x53b102['fromVersion'],_0x1fbb77['fromVersion']);let _0x46e2a0;_0x53b102['toVersion']===_0x1fbb77['toVersion']&&_0x53b102['fromVersion']===_0x1fbb77['fromVersion']?(_0x46e2a0=!0x0,this['_preventResendingRevisionData'](_0x1fbb77)):_0x1fbb77['toVersion']===_0x51faae&&_0x1fbb77['fromVersion']===_0x169520?_0x46e2a0=!0x1:(_0x53b102['toVersion']===_0x51faae&&_0x53b102['fromVersion']===_0x169520||this['_fixRevision']({'revision':_0x53b102,'from':_0x169520,'to':_0x51faae}),_0x46e2a0=!0x0),_0x46e2a0&&(delete _0x1fbb77['fromVersion'],delete _0x1fbb77['toVersion'],delete _0x1fbb77['diffData'],delete _0x1fbb77['createdAt'],delete _0x1fbb77['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1fbb77),this['_preventResendingRevisionData'](_0x1fbb77);}else this['_revisionTracker']['addRevisionData'](_0x1fbb77);}const _0x347b85=_0x5d0e38['getRevisions']();_0x347b85['reverse']();for(let _0x1dc016=0x0;_0x1dc016<_0x347b85['length']-0x1;_0x1dc016++){const _0x3878fc=_0x347b85[_0x1dc016],_0x4e7482=_0x347b85[_0x1dc016+0x1];if(_0x3878fc['fromVersion']<_0x4e7482['toVersion']){const _0x2887fc=_0x4e7482['toVersion'],_0x33bfb8=Math['max'](_0x2887fc,_0x3878fc['toVersion']);this['_fixRevision']({'revision':_0x3878fc,'from':_0x2887fc,'to':_0x33bfb8});}}}['_fixRevision']({revision:_0x10cde5,from:_0x4c852f,to:_0x2547db}={}){const _0xfcf007=this['editor']['plugins']['get'](_0x536115),_0x1afd04=this['_revisionTracker']['buildRevisionData']({'revision':_0x10cde5,'from':_0x4c852f,'to':_0x2547db});_0x1afd04['authors']=_0x1afd04['authorsIds']['map'](_0x32a483=>_0xfcf007['getUser'](_0x32a483)),_0x10cde5['_update'](_0x1afd04);}['_preventResendingRevisionData'](_0x304ec3){const _0x3805b4={};_0x3805b4['id']=_0x304ec3['id'];for(const _0x4abc30 of Object['keys'](_0x304ec3))'id'!==_0x4abc30&&(_0x3805b4[_0x4abc30]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x3805b4['id'],_0x3805b4,!0x0);}async['_fetchMissingUsers'](_0x120de2){const _0x2719ed=this['editor']['plugins']['get'](_0x536115),{connection:_0x2469af}=this['editor']['plugins']['get'](z),_0xa60039=new Set();for(const _0x20af19 of _0x120de2){for(const _0x4c4e93 of _0x20af19['authorsIds'])_0x42bbfc(_0x4c4e93);_0x20af19['creatorId']&&_0x42bbfc(_0x20af19['creatorId']);}if(0x0===_0xa60039['size'])return;const _0x3739b5=await _0x31677b['getMany'](_0x2469af,Array['from'](_0xa60039));for(const _0x3833ff of _0x3739b5)_0x2719ed['getUser'](_0x3833ff['id'])||_0x2719ed['addUser'](_0x3833ff);function _0x42bbfc(_0x3768db){_0x2719ed['getUser'](_0x3768db)||_0xa60039['add'](_0x3768db);}}};function pt(_0x5cdf5e){return _0x5cdf5e['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5cdf5e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5cdf5e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var gt=class extends _0x12753f{static get['requires'](){return[_0x49c6d9,mt,nt];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class extends _0x1a45ba{['_collapseAt'];constructor(_0xb26b14,_0x696a90=0x6){super(_0xb26b14);const _0x22109f=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x696a90,this['bind']('isHidden')['to'](this,'usersCount',_0x38a47f=>_0x38a47f<_0x696a90),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x22109f['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':_0x22109f['to']('usersCount',_0x67f396=>'+'+(_0x67f396-this['_collapseAt']+0x2)['toString']())}]}]}]});}},vt=class extends _0x1a45ba{['items'];['keystrokes'];constructor(_0x13adfc){super(_0x13adfc);const _0x31c676=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x1dd383(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x31c676['if']('hasPopup'),'aria-expanded':_0x31c676['to']('isExpanded',_0x15d2de=>this['hasPopup']&&String(_0x15d2de)),'aria-label':_0x31c676['to']('hasPopup',_0x45e0fd=>X(_0x13adfc,_0x45e0fd?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x31c676['to']('hasPopup',_0x295bd3=>!!_0x295bd3&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x31c676['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x31c676['to'](_0x3e7bda=>{const _0x458ba6=_0x3e7bda,_0x95ea4c=document['querySelector']('.ck-presence-list__dropdown-list'),_0x256acf=document['querySelector']('.ck-balloon-panel_with-arrow');_0x95ea4c?.['contains'](_0x458ba6['relatedTarget'])||_0x256acf?.['contains'](_0x458ba6['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2fd6fd,_0x373b46,_0x42aa1d)=>{this['element']&&(_0x42aa1d?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']);}},_t=class extends _0x1a45ba{['counterView'];['inlineListView'];constructor(_0x4ffdcf,_0x269ec6=0x6){super(_0x4ffdcf);const _0x4d13b1=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new wt(this['locale'],_0x269ec6),this['inlineListView']=new vt(_0x4ffdcf),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xfd4be9 of this['inlineListView']['items'])_0xfd4be9['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',_0x4d13b1['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},yt=class extends _0x1a45ba{['listWrapperView'];constructor(_0x29096c,_0x329893){super(_0x29096c);const _0xa3e412=this['bindTemplate'];this['listWrapperView']=new bt(_0x29096c,_0x329893),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':X(_0x29096c,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0xa3e412['to'](_0x59dba5=>{const _0x12621b=_0x59dba5,_0x15912d=document['querySelector']('.ck-presence-list__list'),_0x38e89e=document['querySelector']('.ck-balloon-panel_with-arrow');_0x15912d?.['contains'](_0x12621b['relatedTarget'])||_0x38e89e?.['contains'](_0x12621b['relatedTarget'])||this['fire']('presencelist:hide');})}});}},bt=class extends _0x4912d4{constructor(_0x5c946b,_0x59b256){super(_0x5c946b);const _0x55179d=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x59b256?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x55179d['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x55179d['to']('role'),'aria-label':_0x55179d['to']('ariaLabel'),'aria-labelledby':_0x55179d['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x50de14['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xf7988b=this['element'];_0xf7988b&&(this['_isScrollable']=Math['max'](_0xf7988b['scrollHeight'],_0xf7988b['clientHeight'])>0.8*window['innerHeight']);}},kt=class extends _0x1cd3cf{['userView'];constructor(_0x45b26b,_0x358e97,_0x1b0d16){super(_0x45b26b);const _0x4e97c3=this['bindTemplate'];this['userView']=new _0x3ea6fd(_0x45b26b,_0x358e97);const _0x596e4e={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x358e97['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x358e97['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x358e97['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x358e97['color']['getColorVariable'](),'--ck-user-color-alpha':_0x358e97['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x1b0d16&&(_0x596e4e['tag']='button',_0x596e4e['on']={'click':_0x4e97c3['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x596e4e);}['focus'](){this['element']['focus']();}},It=class extends _0x1a45ba{['userView'];['markerView'];constructor(_0x4c2227,_0x3760a6,_0x13c41d){super(_0x4c2227);const _0x2c65f3=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x3ea6fd(_0x4c2227,_0x3760a6),this['markerView']=new St(_0x4c2227,_0x3760a6);const _0x2451fc=new _0x361c56(_0x4c2227);_0x2451fc['template']['tag']='span',_0x2451fc['text']=_0x3760a6['name'];const _0x1e59dd={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x2c65f3['to']('isFocusable',_0x4ffea7=>!!_0x4ffea7&&0x0),'aria-labelledby':_0x2451fc['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x2c65f3['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x2c65f3['to']('hasTooltip',_0x356af3=>!_0x356af3),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2451fc]};_0x13c41d&&(_0x1e59dd['tag']='button',_0x1e59dd['on']={'click':_0x2c65f3['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1e59dd);}},St=class extends _0x1a45ba{constructor(_0x52a3f7,_0x26ee5c){super(_0x52a3f7),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x26ee5c['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x26ee5c['color']['getColorVariable'](),'--ck-user-color-alpha':_0x26ee5c['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Tt={'collapseAt':0x6,'displayMe':!0x0};var Ct=class extends _0x205d54{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b69ed){super(_0x3b69ed),this['context']['config']['define']('presenceList',Tt);const _0xe05405=_0x3b69ed['config']['get']('presenceList.collapseAt');if('number'!=typeof _0xe05405)throw new _0x598d78('presencelist-collapseat-invalid-format',this);if(_0xe05405<0x1)throw new _0x598d78('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Y)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x22f614(),this['balloonPanelView']=new _0x378580(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[Y];}['init'](){for(const _0x1489aa of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1489aa);this['listenTo'](this['_allConnectedUsers'],'add',(_0x545095,_0xf1883e)=>{this['_handleUserAdd'](_0xf1883e);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1a630d,_0x19b708)=>{this['_handleUserRemove'](_0x19b708);});}['_createView'](){const _0x197835=this['context'],_0xe11214=new _t(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x20edb9=this['balloonPanelView'];if(!_0x3201ca(_0x197835['config']['get']('presenceList.container')))throw new _0x598d78('presencelist-missing-container',this);return _0xe11214['counterView']['bind']('usersCount')['to'](this),_0xe11214['bind']('isCollapsed')['to'](this,'usersCount',_0x5ed8aa=>{const {collapseAt:_0x2fedfc}=_0x197835['config']['get']('presenceList'),_0x2b0850=_0x5ed8aa>=_0x2fedfc;if(_0x2b0850&&!_0xe11214['inlineListView']['items']['find'](_0x12cffc=>_0x12cffc instanceof wt)){const _0x4d304c=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x4d304c&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0xe11214['inlineListView']['items']['add'](_0xe11214['counterView']);}return _0x2b0850||this['hideDropdown'](),_0x2b0850;}),_0xe11214['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x392b31=>{const _0x443c02=_0x197835['config']['get']('presenceList'),_0x2b96cb=new It(_0x197835['locale'],_0x392b31,!!_0x443c02['onClick']);return _0x2b96cb['bind']('hasTooltip')['to'](_0xe11214,'isCollapsed',_0x2fe0c7=>!_0x2fe0c7),_0x2b96cb['bind']('isFocusable')['to'](_0xe11214,'isCollapsed',_0xeb9e12=>!_0xeb9e12),_0x443c02['onClick']&&this['listenTo'](_0x2b96cb,'execute',()=>{this['view']['isCollapsed']||_0x443c02['onClick'](_0x392b31,_0x2b96cb['element']);}),_0x2b96cb;}),this['listenTo'](_0xe11214['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0xe11214['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0xe11214['inlineListView']['keystrokes']['set']('Enter',(_0x15cc93,_0x2661ed)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2661ed());}),_0xe11214['render'](),_0x20edb9['render'](),_0x370b5f({'emitter':_0xe11214,'activator':()=>_0x20edb9['isVisible'],'contextElements':[_0x20edb9['element'],_0xe11214['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x197835['config']['get']('presenceList.container')['appendChild'](_0xe11214['element']),this['_bodyCollection']=new _0x276a01(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xe11214;}['_handleUserAdd'](_0xe7fc1c){if(!this['context']['config']['get']('presenceList.displayMe')&&_0xe7fc1c['isMe'])return;const _0x2e8da3=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2e8da3-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x14350f=_0xe7fc1c['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0xe7fc1c,_0x14350f);}['_handleUserRemove'](_0x396364){this['usersCount']--;const {collapseAt:_0x5f08a9}=this['context']['config']['get']('presenceList'),_0x133e42=this['usersCount']>=_0x5f08a9;if(this['currentDisplayedUsers']['get'](_0x396364['id']))this['currentDisplayedUsers']['remove'](_0x396364['id']);else{if(_0x133e42&&this['currentDisplayedUsers']['length']+0x1===_0x5f08a9-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x133e42?0x1:0x0)<this['usersCount']){for(const _0x1f03b0 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1f03b0['id'])&&(this['currentDisplayedUsers']['add'](_0x1f03b0,Math['min'](this['currentDisplayedUsers']['length']-(_0x133e42?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x133e42?0x1:0x0)===_0x5f08a9-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x374684=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new yt(this['context']['locale'],!!_0x374684['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x34f33b}=this['presenceDropdownView'];_0x34f33b['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3fefc4=>{if(!_0x374684['displayMe']&&_0x3fefc4['isMe'])return null;const _0x20aff4=new kt(this['context']['locale'],_0x3fefc4,!!_0x374684['onClick']);return _0x374684['onClick']&&this['listenTo'](_0x20aff4,'execute',()=>{_0x374684['onClick'](_0x3fefc4,_0x20aff4['element']);}),_0x20aff4;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x34f33b['focus'](),_0x34f33b['checkIfScrollable']();const _0x2b5a8d=(_0xdfbc06,_0x3b8a7d)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3b8a7d();};_0x34f33b['keystrokes']['set']('Esc',_0x2b5a8d),_0x34f33b['keystrokes']['set']('Shift+Tab',_0x2b5a8d),_0x34f33b['keystrokes']['set']('Tab',(_0x64d693,_0x1443f2)=>{!function(_0x3642b5){const _0x4451bc=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x14b43e=>_0x14b43e+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x16e8e8=[...document['body']['querySelectorAll'](_0x4451bc)]['filter'](_0x250716=>_0x250716===document['activeElement']||_0x250716['offsetWidth']+_0x250716['offsetHeight']>0x0)['sort']((_0x5c6c1a,_0x32a05e)=>(_0x5c6c1a['tabIndex']||0x0)-(_0x32a05e['tabIndex']||0x0)),_0x120bca=_0x16e8e8[(_0x16e8e8['indexOf'](_0x3642b5)+0x1)%_0x16e8e8['length']];_0x120bca&&_0x120bca['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1443f2();}),_0x34f33b['focusTracker']['add'](this['view']['element']),_0x34f33b['focusTracker']['on']('change:isFocused',(_0x515839,_0x484f12,_0x4dc4e2)=>{_0x4dc4e2||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);}},At=class extends _0x205d54{static get['requires'](){return[Y,Ct];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ot as CloudServicesCommentsAdapter,mt as CloudServicesRevisionHistoryAdapter,ht as CloudServicesTrackChangesAdapter,At as PresenceList,Ct as PresenceListUI,tt as RealTimeCollaborationClient,ut as RealTimeCollaborativeComments,nt as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,Y as Sessions,z as WebSocketGateway};
|
|
23
|
+
import{Context as _0x15b218,ContextPlugin as _0x49ae67,PendingActions as _0x1b1cb9,Plugin as _0xc1f62}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x126d14,Collection as _0x1a035a,DomEmitterMixin as _0x4e9957,KeystrokeHandler as _0x6ca5cf,global as _0x3d533,uid as _0x402abe,version as _0x2b5982}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x5cb958,BodyCollection as _0xafa5b4,LabelView as _0x47278a,ListItemView as _0x155146,ListView as _0x11c7db,Notification as _0x1f6b8b,View as _0x48174d,clickOutsideHandler as _0xcd0fcf}from'@ckeditor/ckeditor5-ui';import{History as _0x5c78cf,InsertOperation as _0x335bb3,MarkerOperation as _0x4739ee,ModelLiveRange as _0x4d9635,NoOperation as _0x3106f3,OperationFactory as _0x2de99b,RootAttributeOperation as _0x1209b3,transformOperationSets as _0x437cec}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0xb8a5f}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x35305c,CommentsService as _0x104468,EditorService as _0x3d091d,RevisionHistoryService as _0x4da89c,TrackChangesService as _0x4a709b,User as _0x2a3ac9,WEB_SOCKET_GATEWAY_STATES as _0xe75117,WebSocketGateway as _0x4e20e3}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x1465af,Users as _0x480172}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x251a0b}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x417533,TrackChangesEditing as _0x2a216b}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x14a994,CommentsEditing as _0x3afc4e,CommentsRepository as _0x52ddef}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x1e3875}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x12ce62}from'es-toolkit/compat';var z=class WebSocketGateway extends _0x49ae67{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>_0x4e20e3)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return[_0xb8a5f,_0x1f6b8b];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4eea1b){super(_0x4eea1b),this['set']('state',_0xe75117['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x4e9957())();}['init'](){const _0x1f89b8=this['context'],_0x2f528f=_0x1f89b8['plugins']['get'](_0xb8a5f),_0x3ee0e1=_0x1f89b8['plugins']['get'](_0x1f6b8b);if(!_0x2f528f['token'])throw new _0x126d14('websocketgateway-missing-token',this);if(!_0x2f528f['webSocketUrl'])throw new _0x126d14('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),WebSocketGateway['WebSocketGateway']['connect'](_0x2f528f['token'],_0x2f528f['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x1639d8=>{if(this['connection']=_0x1639d8,this['bind']('state')['to'](_0x1639d8,'state',this,'_isBrowserOffline',(_0x369d19,_0x38c9f4)=>('connected'!==_0x369d19&&(this['_shouldPluginsReconnect']=!0x0),_0x38c9f4||_0x369d19!==_0xe75117['CONNECTED']?_0xe75117['DISCONNECTED']:this['state']==_0xe75117['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0xe75117['CONNECTING']):_0xe75117['CONNECTED'])),this['connection']['on']('error',(_0x118a9a,_0x40d6ae)=>{if('limitExceeded'!==_0x40d6ae['code'])throw console['error'](_0x40d6ae),new _0x126d14('cloudservices-init',null,{'originalError':_0x40d6ae});_0x3ee0e1['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'});}),!_0x1639d8['me'])return new Promise(_0x4bf094=>_0x1639d8['on']('change:me',_0x4bf094));})['catch'](_0x2cb017=>{throw console['error'](_0x2cb017),new _0x126d14('cloudservices-init',null,{'originalError':_0x2cb017});});}['addToReconnectionStack'](_0x580465){if('function'!=typeof _0x580465['reconnect'])throw new _0x126d14('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x580465))throw new _0x126d14('websocketgateway-plugin-already-registered',this,{'name':_0x580465['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x580465);}['removeFromReconnectionStack'](_0x34998a){this['_reconnectionStack']['delete'](_0x34998a);}['isInReconnectionStack'](_0x270ca4){return this['_reconnectionStack']['has'](_0x270ca4);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x615fa7=>_0x615fa7['reconnect']())))['then'](()=>this['state']=_0xe75117['CONNECTED'])['catch'](_0x2ddb93=>{throw console['error'](_0x2ddb93),new _0x126d14('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0xe75117['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}},Y=class extends _0x49ae67{['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[z,_0x480172];}constructor(_0x429dac){super(_0x429dac),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1a035a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x480172);}['init'](){const _0x500e1a=this['context']['plugins']['get'](z);this['listenTo'](_0x500e1a,'change:state',(_0x8703f1,_0x2171f8,_0x2c2358)=>{if('connected'!==_0x2c2358)this['channelSessions']['forEach'](_0x1c6332=>_0x1c6332['clear']()),this['channelConnectedUsers']['forEach'](_0xe06725=>_0xe06725['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0xeebedc,_0x76e998]of this['_registeredSessions'])for(const _0x5370ad of _0x76e998)this['_handleSessionAdd'](_0xeebedc,_0x5370ad);}}),this['_createUser'](_0x500e1a['connection']['me'],!0x0);}['register'](_0x59cf3d,_0x5eeb6a){if(this['_registeredSessions']['has'](_0x59cf3d))throw new _0x126d14('sessions-register-already-registered',null,{'channelId':_0x59cf3d});this['_registeredSessions']['set'](_0x59cf3d,_0x5eeb6a),this['channelSessions']['set'](_0x59cf3d,new _0x1a035a()),this['channelConnectedUsers']['set'](_0x59cf3d,new _0x1a035a()),this['listenTo'](_0x5eeb6a,'add',(_0x4f0f1f,_0x46429c)=>this['_handleSessionAdd'](_0x59cf3d,_0x46429c)),this['listenTo'](_0x5eeb6a,'remove',(_0xa292bd,_0x5c879c)=>this['_handleSessionRemove'](_0x59cf3d,_0x5c879c));for(const _0x126e2b of _0x5eeb6a)this['_handleSessionAdd'](_0x59cf3d,_0x126e2b);}['unregister'](_0xfb0aa1){if(!this['_registeredSessions']['has'](_0xfb0aa1))throw new _0x126d14('sessions-unregister-not-exist',null,{'channelId':_0xfb0aa1});const _0x38e37f=this['_registeredSessions']['get'](_0xfb0aa1);this['stopListening'](_0x38e37f);for(const _0x4caadd of _0x38e37f)'connected'===this['context']['plugins']['get'](z)['state']&&this['_handleSessionRemove'](_0xfb0aa1,_0x4caadd);this['_registeredSessions']['delete'](_0xfb0aa1),this['channelSessions']['delete'](_0xfb0aa1),this['channelConnectedUsers']['delete'](_0xfb0aa1);}get['mySessionId'](){return this['context']['plugins']['get'](z)['connection']['sessionId'];}['getUserBySessionId'](_0xd94adc){for(const _0x1b0de2 of this['channelSessions']['values']())for(const _0x4eeb82 of _0x1b0de2)if(_0x4eeb82['id']===_0xd94adc)return _0x4eeb82['user'];}['getUserSessions'](_0x34780b,_0x3a90f4){const _0x5007f1=_0x3a90f4?[this['channelSessions']['get'](_0x3a90f4)]:this['channelSessions']['values'](),_0x3a1744=new Set();for(const _0x432e70 of _0x5007f1)for(const _0x1ce6d5 of _0x432e70)_0x1ce6d5['user']['id']===_0x34780b['id']&&_0x3a1744['add'](_0x1ce6d5['id']);return _0x3a1744;}['getUserRole'](_0x1450a4){for(const _0x58b48e of this['channelSessions']['values']())for(const _0x106bbe of _0x58b48e)if(_0x106bbe['user']===_0x1450a4)return _0x106bbe['role'];}['_handleSessionAdd'](_0x445086,_0x3a0c0b){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x5e3ff2=_0x3a0c0b['user'],_0x383ab1=this['_users']['getUser'](_0x5e3ff2['id'])||this['_createUser'](_0x5e3ff2),_0x3f9b8d=Object['assign']({},_0x3a0c0b,{'user':_0x383ab1});if(this['channelSessions']['get'](_0x445086)['add'](_0x3f9b8d),!_0x5e3ff2['hiddenInPresenceList']){const _0x4d358d=this['channelConnectedUsers']['get'](_0x445086);_0x4d358d['has'](_0x383ab1['id'])||_0x4d358d['add'](_0x383ab1),this['allConnectedUsers']['has'](_0x383ab1['id'])||_0x5e3ff2['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x383ab1,_0x383ab1['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x445086,{'channelId':_0x445086,'session':_0x3f9b8d});}['_handleSessionRemove'](_0x2d7db9,_0x1ce9c9){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x19ba3d=this['channelConnectedUsers']['get'](_0x2d7db9),_0x1f5645=_0x1ce9c9['user'];_0x1f5645['id']&&(this['channelSessions']['get'](_0x2d7db9)['remove'](_0x1ce9c9['id']),_0x19ba3d['has'](_0x1f5645['id'])&&!this['getUserSessions'](_0x1f5645,_0x2d7db9)['size']&&_0x19ba3d['remove'](_0x1f5645['id']),this['allConnectedUsers']['get'](_0x1f5645['id'])&&!this['getUserSessions'](_0x1f5645)['size']&&this['allConnectedUsers']['remove'](_0x1f5645['id']));}['_createUser'](_0x15b2c1,_0x3d45bd){const _0x393ed2=this['_users']['addUser'](_0x15b2c1);return _0x3d45bd&&this['_users']['defineMe'](_0x15b2c1['id']),_0x393ed2['orderNumber']=this['_uniqueUsersCount']++,_0x393ed2;}},K=class extends _0xc1f62{['_domEmitter']=new(_0x4e9957())();static get['requires'](){return[Y];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x407e63=this['editor'],_0x583f43=_0x407e63['plugins']['get'](Y);_0x407e63['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x47b768,{writer:_0x46cf72})=>function(_0x2eadf2,_0x2230b7,_0x480615,_0x30ebd1){const _0x10116d=_0x2eadf2['markerName']['split'](':')[0x2],_0x11df7b=_0x480615['getUserBySessionId'](_0x10116d);if(!_0x11df7b||_0x10116d===_0x480615['mySessionId'])return;if(!_0x30ebd1['model']['schema']['checkChild'](_0x2eadf2['markerRange']['start'],'$text'))return;const _0x1ceb13={'class':'ck-user__marker\x20'+_0x11df7b['color']['getMarkerClass'](),'style':Q(_0x11df7b),'data-name':_0x11df7b['name'],'data-session-id':_0x10116d},_0xdd71ac=_0x30ebd1['model']['markers']['get'](_0x2eadf2['markerName'])['getStart'](),_0x23afc5=_0xdd71ac['nodeAfter'],_0x59ba03=_0x30ebd1['model']['schema'];if(_0x23afc5&&_0x59ba03['isObject'](_0x23afc5)&&_0x59ba03['isInline'](_0x23afc5)&&!_0x30ebd1['model']['markers']['get']('user:range:'+_0x10116d)['getRange']()['isCollapsed'])return;const _0x15a8f9=_0xdd71ac['parent'];return _0x30ebd1['model']['schema']['isLimit'](_0x15a8f9)&&!_0x30ebd1['model']['hasContent'](_0x15a8f9)&&(_0x1ceb13['contenteditable']=!0x1),function(_0x59d7c1,_0xb1711c,_0x467dea){const _0x2f45b0=_0x59d7c1['createUIElement']('span',_0xb1711c);return _0x59d7c1['setCustomProperty']('userPositionMarker',!0x0,_0x2f45b0),_0x2f45b0['render']=function(_0x35133b){const _0x1bcd16=this['toDomElement'](_0x35133b),_0x200edb=document['createElement']('span');return _0x200edb['classList']['add']('ck-user__marker-tooltip'),_0x200edb['setAttribute']('contenteditable','false'),_0x200edb['setAttribute']('spellcheck','false'),_0x200edb['textContent']=_0x467dea['name'],_0x1bcd16['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x200edb['outerHTML']+'',_0x1bcd16['addEventListener']('mouseenter',()=>{_0x1bcd16['classList']['add']('ck-user__marker_hovered');}),_0x1bcd16['addEventListener']('mouseleave',()=>{_0x1bcd16['classList']['remove']('ck-user__marker_hovered');}),_0x1bcd16;},_0x2f45b0['isSimilar']=function(_0x1c8c10){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1c8c10['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1c8c10['getAttribute']('data-session-id'));},_0x2f45b0;}(_0x2230b7,_0x1ceb13,_0x11df7b);}(_0x47b768,_0x46cf72,_0x583f43,_0x407e63)}),_0x407e63['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4b8bad=>function(_0x3ee34c,_0x4d0eb8){const _0x3dee66=_0x3ee34c['markerName']['split'](':')[0x2];if(_0x3dee66===_0x4d0eb8['mySessionId'])return null;const _0x4228ce=_0x4d0eb8['getUserBySessionId'](_0x3dee66);return _0x4228ce?{'id':_0x3dee66,'classes':['ck-user__selection',_0x4228ce['color']['getSelectionClass']()],'attributes':{'style':Q(_0x4228ce),'data-session-id':_0x3dee66},'priority':0x7d0+_0x4228ce['orderNumber']}:{'id':_0x3dee66,'classes':[]};}(_0x4b8bad,_0x583f43)}),function(_0x2fc268){const _0x50312c=_0x2fc268['model'],_0x481a7c=new Map(),_0x471f9d=_0x2fc268['plugins']['get'](Y);_0x50312c['markers']['on']('update:user:range',(_0x4ea7bc,_0x75f7c4,_0x1bcc00,_0x4d5326)=>{if(!_0x4d5326&&_0x481a7c['get'](_0x75f7c4['name']))return _0x481a7c['get'](_0x75f7c4['name'])['detach'](),void _0x481a7c['delete'](_0x75f7c4['name']);const _0x1f4aa5=_0x75f7c4['name']['split'](':')[0x2];if(_0x1f4aa5===_0x471f9d['mySessionId'])return;const _0x19dde8='user:position:'+_0x1f4aa5;_0x50312c['markers']['has'](_0x19dde8)&&_0x2fc268['editing']['reconvertMarker'](_0x19dde8),_0x75f7c4['on']('change:range',(_0x48125f,_0x585b58,_0x86fae4)=>{if('$graveyard'!=_0x585b58['root']['rootName']&&'$graveyard'==_0x75f7c4['getRange']()['root']['rootName']&&!_0x481a7c['has'](_0x75f7c4['name'])){const _0x4ef0d7=_0x50312c['schema']['getNearestSelectionRange'](_0x86fae4['deletionPosition']);if(_0x4ef0d7){const _0x42f869=_0x4d9635['fromRange'](_0x4ef0d7);_0x481a7c['set'](_0x75f7c4['name'],_0x42f869),_0x42f869['on']('change:range',(_0x56b9d5,_0x282c22,_0x1bb203)=>{if('$graveyard'==_0x42f869['root']['rootName']){const _0x363d5b=_0x50312c['schema']['getNearestSelectionRange'](_0x1bb203['deletionPosition']);_0x363d5b?(_0x42f869['start']=_0x363d5b['start'],_0x42f869['end']=_0x363d5b['end']):(_0x481a7c['delete'](_0x75f7c4['name']),_0x42f869['detach']());}});}}});}),_0x50312c['document']['on']('change',()=>{_0x481a7c['size']>0x0&&_0x50312c['enqueueChange']({'isUndoable':!0x1},_0x5b11c2=>{for(const [_0x213fbb,_0x1fe432]of _0x481a7c)'$graveyard'==_0x50312c['markers']['get'](_0x213fbb)['getRange']()['root']['rootName']&&(J(_0x213fbb['split'](':')[0x2],_0x1fe432['toRange'](),_0x50312c,_0x5b11c2),_0x1fe432['detach']());_0x481a7c['clear']();});});}(_0x407e63),this['_domEmitter']['listenTo'](_0x3d533['document'],'keydown',(_0x41a999,{key:_0x39ab63})=>{'Escape'===_0x39ab63&&function(_0x3117c2){_0x3117c2['editing']['view']['change'](_0x2a3f73=>{for(const _0x50a1b0 of _0x3117c2['model']['markers']){if(!_0x50a1b0['name']['startsWith']('user:position'))continue;const _0x20e0e0=_0x3117c2['editing']['mapper']['markerNameToElements'](_0x50a1b0['name']);if(_0x20e0e0){for(const _0x54ae70 of _0x20e0e0)_0x2a3f73['removeClass']('ck-user__marker_hovered',_0x54ae70);}}});}(_0x407e63);},{'useCapture':!0x0});}['afterInit'](){const _0x95ccc5=this['editor'],_0x45c014=_0x95ccc5['commands']['get']('undo');_0x45c014&&_0x95ccc5['model']['on']('applyOperation',(_0x54741e,_0x466217)=>{const _0x2652ee=_0x466217[0x0];if(!_0x2652ee['isDocumentOperation'])return;if('marker'!=_0x2652ee['type']||!_0x2652ee['name']['startsWith']('user:'))return;const _0x223af4=_0x2652ee['batch'];_0x45c014['_createdBatches']['has'](_0x223af4)&&(_0x2652ee['newRange']=_0x2652ee['oldRange']?_0x95ccc5['model']['createRange'](_0x2652ee['oldRange']['start'],_0x2652ee['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3e58a1=this['editor'],_0x361c02=_0x3e58a1['model']['document'],_0x9941b9=_0x3e58a1['plugins']['get'](Y);_0x3e58a1['model']['enqueueChange']({'isUndoable':!0x1},_0x1d3854=>{const _0x4d52fe='user:range:'+_0x9941b9['mySessionId'],_0x43b109='user:position:'+_0x9941b9['mySessionId'],_0x1a018d=_0x3e58a1['model']['markers']['has'](_0x4d52fe);_0x3e58a1['editing']['view']['hasDomSelection']?J(_0x9941b9['mySessionId'],_0x361c02['selection']['getFirstRange'](),_0x3e58a1['model'],_0x1d3854):_0x1a018d&&(_0x1d3854['removeMarker'](_0x4d52fe),_0x1d3854['removeMarker'](_0x43b109));});}};function J(_0x155fdd,_0x101975,_0x12741e,_0x4455f5){const _0x3f1733='user:range:'+_0x155fdd,_0x1af5ef='user:position:'+_0x155fdd,_0x59acb0=_0x101975['getContainedElement']();let _0x3546aa=_0x101975['start'];if(_0x59acb0&&_0x59acb0['is']('element','tableCell')){const _0x36e6e0=function(_0x2ce003,_0xb23201){for(const _0x58c649 of _0x2ce003['getPositions']())if(_0xb23201['schema']['checkChild'](_0x58c649,'$text'))return _0x58c649;}(_0x101975,_0x12741e);_0x36e6e0&&(_0x3546aa=_0x36e6e0,_0x101975=_0x4455f5['createRange'](_0x3546aa));}const _0x2d673c=_0x4455f5['createRange'](_0x3546aa);_0x12741e['markers']['has'](_0x3f1733)?(_0x4455f5['updateMarker'](_0x3f1733,{'range':_0x101975}),_0x4455f5['updateMarker'](_0x1af5ef,{'range':_0x2d673c})):(_0x4455f5['addMarker'](_0x3f1733,{'range':_0x101975,'usingOperation':!0x0}),_0x4455f5['addMarker'](_0x1af5ef,{'range':_0x2d673c,'usingOperation':!0x0}));}function Q(_0x176b05){return'--ck-user-color:'+_0x176b05['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x176b05['color']['getColorAlphaVariable']()+';';}function X(_0x3755c0,_0x2e1130,_0x2754ea){const _0x231095=_0x3755c0['t'],t=_0x3755c0['t'];switch(_0x2e1130){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 _0x231095({'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'},_0x2754ea);default:return'';}}let Z=0x1;var tt=class RealTimeCollaborationClient extends _0xc1f62{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x35305c)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[z,Y,K,_0x1b1cb9,_0x480172,_0x1f6b8b];}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 _0x29fac5=this['serverHistory']['getOperations']();for(let _0x1edf29=_0x29fac5['length']-0x1;_0x1edf29>=0x0;_0x1edf29--){const _0x3daffe=_0x29fac5[_0x1edf29];if(!this['_disconnectionOperations']['has'](_0x3daffe))return _0x3daffe['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3e8491){if(super(_0x3e8491),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5c78cf(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x126d14('collaboration-missing-channelid',this);const _0x395008=_0x3e8491['config']['get']('cloudServices.bundleVersion')||_0x2b5982;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x395008,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x251a0b(),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 it(this['_disconnectionOperations']);}['init'](){const _0xb81ab5=this['editor'],_0x4aece5=_0xb81ab5['plugins']['get'](_0x480172),_0x12c611=_0xb81ab5['plugins']['get'](z);this['listenTo'](_0x4aece5,'getOperationAuthor',(_0x17ef56,_0x19ff12)=>{const _0x37b105=_0x19ff12[0x0];_0x37b105['_authorId']&&(_0x17ef56['return']=_0x4aece5['getUser'](_0x37b105['_authorId']),_0x17ef56['stop']()),null===_0x37b105['_authorId']&&(_0x17ef56['return']=null,_0x17ef56['stop']());},{'priority':'high'}),this['listenTo'](_0xb81ab5['model']['document']['selection'],'change:range',(_0x5e5748,_0x98b0f6)=>{_0x98b0f6['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xb81ab5['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xb81ab5['model']['on']('applyOperation',(_0x4ef435,_0x4ee940)=>{const _0x43f8b3=_0x4ee940[0x0];_0x43f8b3['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x43f8b3),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x12c611,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x8a021a,_0x7247e4,_0x487912)=>'connected'===_0x8a021a&&!_0x7247e4&&!_0x487912),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xb81ab5['disableReadOnlyMode']('rtc-offline'):_0xb81ab5['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xb81ab5['disableReadOnlyMode']('rtc-offline'):_0xb81ab5['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x62873a=this['editor']['plugins']['get'](Y),_0x1f700a=this['editor']['plugins']['get'](z);try{this['_isPendingUpdate']=!0x0,_0x62873a['unregister'](this['_channelId']);const _0x26dc00=await this['_service']['reconnect'](_0x1f700a['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x26dc00)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x57e016=await this['_service']['getConnectedSessions']();_0x62873a['register'](this['_channelId'],_0x57e016),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x52b920){if(function(_0x57b717){return'404'===_0x57b717['code'];}(_0x52b920)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x593ed7){return'409'===_0x593ed7['code'];}(_0x52b920)){const _0x57c7b3=X(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'](_0x57c7b3);}else{if(!(_0x52b920 instanceof et))throw _0x52b920;this['_handleReconnectionError']();}}}}['destroy'](){const _0x109584=this['editor']['plugins']['get'](z),_0x2c219a=this['editor']['plugins']['get'](Y);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2c219a['channelSessions']['has'](this['_channelId'])&&_0x2c219a['unregister'](this['_channelId']),_0x109584['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x43fe10){if(this['sessionId']!==_0x43fe10['sessionId']&&this['_lastSyncedOperationId']!==_0x43fe10['lastOperationId'])throw new et();return this['sessionId']=_0x43fe10['sessionId'],this['_handleServerResponse']([],{..._0x43fe10,'wereChangesApplied':!0x1,'data':_0x43fe10['data']},'reconnect');}async['_connectService'](_0xea3c,_0x35909b=!0x1){const {connection:_0x10f413}=this['editor']['plugins']['get'](z);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x10f413,this['_channelId'])['then'](_0x1daca5=>this['_initSessionsHandling'](_0x1daca5))['catch'](_0x213a9a=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x213a9a);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x49a784,_0x576a6f)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x576a6f);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x34962a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xea3c);this['_isPendingUpdate']=!0x0;const _0xb6a3f2=await this['_service']['connect'](_0x10f413,this['_compressOperations'](_0xea3c),_0x34962a);if(this['sessionId']=_0xb6a3f2['sessionId'],_0x35909b){if(!_0xb6a3f2['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xb6a3f2['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0xea3c,_0xb6a3f2,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xb6a3f2,_0xea3c);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x20c025=this['editor']['plugins']['get'](Y),_0xbe11b5=this['editor']['plugins']['get'](K),_0x7d351e=_0x20c025['channelSessions']['get'](this['_channelId']);_0x7d351e&&_0x7d351e['length']>0x1?_0xbe11b5['createUserMarkerOperations']():this['listenTo'](_0x20c025,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x20c025['channelSessions']['get'](this['_channelId'])['length']&&_0xbe11b5['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4875bf,_0x58846f,_0x4ecd53,_0x35d7af){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x58846f){const _0x5ab7a8=this['_decompressOperations'](_0x4ecd53,_0x35d7af);await this['_fetchMissingUsers'](_0x5ab7a8),this['_handleExternalOperations'](_0x5ab7a8,_0x58846f,_0x4ecd53['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2e16ee}=this['editor'];let _0x4439db;try{_0x4439db=await this['_service']['getDocumentDetails']();}catch{const _0x2f2f84=X(_0x2e16ee,'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'](_0x2f2f84);}const _0x92bd3a=_0x4439db['currentDocumentSession']||_0x4439db['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x92bd3a['lastOperationId']){const _0x3bf9a7=X(_0x2e16ee,'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'](_0x3bf9a7);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_handleChannelDisconnected'](){const _0x10aca9=this['editor']['plugins']['get'](z);if(this['_isConnected']=!0x1,!_0x10aca9['connection']||'connected'!==_0x10aca9['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x431d5b=this['editor']['plugins']['get'](Y);_0x431d5b['channelSessions']['has'](this['_channelId'])&&_0x431d5b['unregister'](this['_channelId']),_0x10aca9['removeFromReconnectionStack'](this),this['_disconnectService']();}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xa782fb){const _0x5c0d4e=this['editor']['plugins']['get'](Y);this['listenTo'](_0x5c0d4e,'sessionAdd:'+this['_channelId'],(_0x3d5c95,{session:_0x5114d6})=>{if(_0x5114d6['id']===_0x5c0d4e['mySessionId']){_0x3d5c95['off']();const _0x3e9f92=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x19b10a=_0x5114d6['permissions'];_0x3e9f92&&_0x3e9f92['isEnabled']&&(_0x19b10a=_0x19b10a['filter'](_0x4591e3=>'document:write'!==_0x4591e3)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x19b10a,this['_channelId']);}}),_0x5c0d4e['register'](this['_channelId'],_0xa782fb);}['_initThrowingOnDataSet'](){const _0xb7333=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x224b68)=>{if(!_0x224b68[_0x224b68['length']-0x1]['suppressErrorInCollaboration'])throw new _0x126d14('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0xb7333['apply'](this['editor']['data'],_0x224b68);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xfe42b4,[_0x47a7c4])=>{if(this['_document']['version'])throw new _0x126d14('realtimecollaborationclient-init-document-already-initialized',this);_0xfe42b4['stop'](),this['_setPendingAction']();const _0x18d3f0=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x34c58d])=>!_0x34c58d['lazyLoad'])['map'](([_0x52a0c5,_0x43db68])=>[_0x52a0c5,_0x43db68['modelAttributes']||{}])),_0x85a35b=this['_getOperationsFromInitData'](_0x47a7c4,_0x18d3f0);0x0==_0x85a35b['length']&&_0x85a35b['push'](new _0x3106f3(0x0)),_0xfe42b4['return']=this['_connectService'](_0x85a35b)['then'](()=>{this['editor']['plugins']['get'](z)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x116962=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x116962))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x202205,[_0x355747,_0x2acb3e])=>{_0x202205['stop']();const _0x5abf04=this['editor']['model']['document']['getRoot'](_0x355747);if(!this['_knownRootNames']['has'](_0x355747)){const _0x1d9ddd=_0x2acb3e&&_0x2acb3e['data']?_0x2acb3e['data']:'',_0x393de1=_0x2acb3e&&_0x2acb3e['attributes']?_0x2acb3e['attributes']:{};await this['_loadRoot'](_0x355747,_0x1d9ddd,_0x393de1);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x5abf04['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x5abf04);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x40bfd9){const _0x3fa30e=this['editor']['plugins']['get'](_0x480172),{connection:_0x1c8320}=this['editor']['plugins']['get'](z),_0x43c389=new Set();for(const _0x51f274 of _0x40bfd9){const _0x48305f=_0x51f274['_authorId'];_0x48305f&&!_0x3fa30e['getUser'](_0x48305f)&&_0x43c389['add'](_0x48305f);}if(0x0===_0x43c389['size'])return;const _0x5c1bac=await _0x2a3ac9['getMany'](_0x1c8320,Array['from'](_0x43c389));for(const _0x489096 of _0x5c1bac)_0x3fa30e['getUser'](_0x489096['id'])||_0x3fa30e['addUser'](_0x489096);}['_getOperationsFromInitData'](_0x31fb2e,_0x117238={}){const _0x4ae0f6=this['editor']['model'],_0x3fadea=[];let _0x735edb=0x0;const _0x404ef1='string'==typeof _0x31fb2e?{'main':_0x31fb2e}:_0x31fb2e;for(const _0x7816c7 of Object['keys'](_0x404ef1)){if(!this['_document']['roots']['has'](_0x7816c7))throw new _0x126d14('realtimecollaborationclient-init-non-existent-root',this);const _0x3239dc=this['_document']['getRoot'](_0x7816c7),_0x553883=this['editor']['data']['parse'](_0x404ef1[_0x7816c7],_0x3239dc),_0x471b75=new _0x335bb3(_0x4ae0f6['createPositionAt'](_0x3239dc,0x0),_0x553883,_0x735edb++);_0x3fadea['push'](_0x471b75);for(const [_0x344595,_0x169942]of _0x553883['markers']){const _0x310242=new _0x4739ee(_0x344595,null,_0x4ae0f6['createRange'](_0x4ae0f6['createPositionFromPath'](_0x3239dc,_0x169942['start']['path']['slice']()),_0x4ae0f6['createPositionFromPath'](_0x3239dc,_0x169942['end']['path']['slice']())),_0x4ae0f6['markers'],!0x0,_0x735edb++);_0x3fadea['push'](_0x310242);}}if(_0x117238)for(const [_0x124e3b,_0x36c066]of Object['entries'](_0x117238)){const _0x4db03c=_0x4ae0f6['document']['getRoot'](_0x124e3b);if(!_0x4db03c)throw new _0x126d14('multi-root-editor-root-attributes-no-root',null);for(const [_0x34785b,_0x1f8545]of Object['entries'](_0x36c066))if(null!==_0x1f8545){const _0x31e3bb=new _0x1209b3(_0x4db03c,_0x34785b,null,_0x1f8545,_0x735edb++);_0x3fadea['push'](_0x31e3bb);}}return _0x3fadea;}async['_loadRoot'](_0x184eeb,_0x3e469c,_0xd95bca){this['_getOperationsFromInitData']({[_0x184eeb]:_0x3e469c},{[_0x184eeb]:_0xd95bca})['forEach']((_0x33010f,_0x360bad)=>{_0x33010f['baseVersion']=this['_document']['version']+_0x360bad,_0x33010f['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x33010f);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x4424be,_0x1be472){let _0x2916c5;this['_offset']=_0x4424be['offset'];const _0x3aa84f=_0x4424be['wereChangesApplied']&&!_0x4424be['initData'],_0x1c3706=_0x3aa84f?0x0:_0x4424be['data']['baseVersion'];if(_0x1be472['forEach'](_0x3d4779=>{_0x3d4779['_isInit']=!0x0,_0x3d4779['createdAt']=_0x4424be['sessionCreatedAt'],_0x3d4779['_authorId']=null;}),_0x3aa84f)_0x2916c5=_0x1be472,this['_applyOperationsSet'](_0x2916c5,_0x3aa84f);else{if(_0x4424be['initData']){const _0x2932f9=this['_getOperationsFromInitData'](_0x4424be['initData']);this['_document']['history']['version']=-_0x2932f9['length'],_0x2932f9['forEach'](_0x4da2a5=>{_0x4da2a5['baseVersion']-=_0x2932f9['length'],_0x4da2a5['createdAt']=_0x4424be['sessionCreatedAt'],_0x4da2a5['_isInit']=!0x0,_0x4da2a5['_authorId']=null;}),this['_applyOperationsSet'](_0x2932f9,!0x0),this['serverHistory']['version']=-_0x2932f9['length']+this['_offset'],this['_updateServerHistory'](_0x2932f9);}this['_document']['history']['version']=_0x1c3706,_0x2916c5=this['_decompressOperations'](_0x4424be['data'],_0x4424be['metadata']),await this['_fetchMissingUsers'](_0x2916c5),this['_applyOperationsSet'](_0x2916c5,_0x3aa84f);}_0x4424be['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2916c5,_0x4424be['lastOperationId']),this['_lastSyncedOperationId']=_0x4424be['lastOperationId']),this['serverHistory']['version']=_0x1c3706+this['_offset'],this['_updateServerHistory'](_0x2916c5),_0x1be472['filter'](_0x5e5215=>{const _0x26271d=this['_getAffectedRoot'](_0x5e5215);return _0x26271d&&!this['_knownRootNames']['has'](_0x26271d);})['forEach']((_0x58866c,_0x2d00eb)=>{_0x58866c['baseVersion']=this['_document']['version']+_0x2d00eb,this['_saveOperationInBuffer'](_0x58866c);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x832e75,_0x4e8d11){const _0x328c24=_0x4e8d11&&_0x4e8d11['message'];if(_0x328c24&&_0x328c24['startsWith']('realtimecollaborationclient'))throw _0x4e8d11;const _0x1283b0=this['editor']['plugins']['get'](z);throw this['_isPendingUpdate']=!0x0,_0x1283b0['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x126d14(_0x832e75,this['editor'],_0x328c24?{'originalError':_0x328c24}:void 0x0);}['_saveOperationInBuffer'](_0x2948ca){this['_knownOperations']['has'](_0x2948ca)||(this['_knownOperations']['add'](_0x2948ca),this['_bufferedOperations']['push'](_0x2948ca),this['_pendingAction']||'marker'==_0x2948ca['type']&&!_0x2948ca['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x4be4a8=!0x1){!_0x4be4a8&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1a3aa7=>{_0x1a3aa7&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x358a5e=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x437392){return _0x437392['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x437392['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x437392['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x358a5e)||this['_crash'](_0x358a5e['message'],_0x358a5e);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x315c29=>{this['on']('change:_isPendingUpdate',()=>{_0x315c29();});});}async['_sendBufferedOperations'](){const _0x5ade3d=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x5ade3d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x98b3b3=[...this['_bufferedOperations']];for(const _0x116890 of _0x98b3b3)_0x116890['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x116890);const _0x40a888=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x98b3b3),_0x3aaa11=Z++,_0x2c4099=this['_compressOperations'](_0x98b3b3),_0x4371d2=await this['_service']['sendOperations'](_0x2c4099,_0x2c4099['baseVersion'],_0x40a888);try{return await this['_handleServerResponse'](_0x98b3b3,_0x4371d2,_0x3aaa11);}catch(_0x202634){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x202634);}}async['_handleServerResponse'](_0x3b3217,_0xaa2c85,_0x137678){if('error'in _0xaa2c85)throw _0xaa2c85['error'];let _0x14333c=!0x1;if(_0xaa2c85['wereChangesApplied']){_0xaa2c85['lastOperationId']&&(this['_lastSyncedOperationId']=_0xaa2c85['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x583705=>!_0x3b3217['includes'](_0x583705));for(const _0x425560 of _0x3b3217)_0x425560['createdAt']='lastOperationAcceptedAt'in _0xaa2c85&&_0xaa2c85['lastOperationAcceptedAt']||void 0x0;st(_0x3b3217,_0xaa2c85['version']-_0x3b3217['length']),this['_updateServerHistory'](_0x3b3217);const _0x24848d=_0x3b3217['filter'](_0x287399=>{if(!_0x287399['_isInit'])return!0x1;const _0x4b9768=this['_getAffectedRoot'](_0x287399);return _0x4b9768&&!this['_knownRootNames']['has'](_0x4b9768);});st(_0x24848d,this['_document']['version']),this['_applyOperationsSet'](_0x24848d),_0x14333c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x59f908=this['_decompressOperations'](_0xaa2c85['data'],_0xaa2c85['metadata'])['filter'](_0x425bc8=>_0x425bc8['baseVersion']>=this['_lastServerVersion']);_0x59f908['forEach'](_0x253bad=>this['_addKnownRoot'](_0x253bad)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x348fce=>!_0x348fce['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x348fce))),this['_bufferedOperations']['length']&&st(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x59f908),_0x14333c=this['_handleExternalOperations'](_0x59f908,_0xaa2c85['version'],_0xaa2c85['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x14333c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0xe7af20,_0x4e3ee2,_0x46c5b7){try{const _0x44ee0e={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x25e402,operationsB:_0x52eb58,originalOperations:_0x26d24d}=_0x437cec(_0xe7af20,this['_bufferedOperations'],_0x44ee0e);st(_0x25e402,this['_document']['version']),st(_0x52eb58,_0x4e3ee2);for(const _0x2e0c35 of _0x25e402){const _0x2b0c14=_0x26d24d['get'](_0x2e0c35);_0x2b0c14?(_0x2e0c35['_authorId']=_0x2b0c14['_authorId'],'noop'!==_0x2e0c35['type']&&(_0x2e0c35['_aiSource']=_0x2b0c14['_aiSource'])):_0x2e0c35['_authorId']=null;}for(const _0x148149 of _0x52eb58)'noop'!==_0x148149['type']&&(_0x148149['_aiSource']=_0x26d24d['get'](_0x148149)?.['_aiSource']);_0x46c5b7&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xe7af20,_0x46c5b7),this['_lastSyncedOperationId']=_0x46c5b7),this['_bufferedOperations']=[..._0x52eb58],this['_applyOperationsSet'](_0x25e402),this['_updateServerHistory'](_0xe7af20);}catch(_0xc30dc6){return console['error'](_0xc30dc6),!0x1;}return!0x0;}['_applyOperationsSet'](_0x43301a,_0x1dfd5b=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x50e090=>{for(const _0x22b88b of _0x43301a)this['_knownOperations']['add'](_0x22b88b),this['_addKnownRoot'](_0x22b88b),_0x50e090['batch']['addOperation'](_0x22b88b),this['editor']['model']['applyOperation'](_0x22b88b);});}['_addKnownRoot'](_0xe6c6ec){const _0x292110=this['_getAffectedRoot'](_0xe6c6ec);_0x292110&&this['_knownRootNames']['add'](_0x292110);}['_getAffectedRoot'](_0x40fe33){let _0x4f973c,_0x3faf56;switch(_0x40fe33['type']){case'insert':_0x4f973c=_0x40fe33['position']['root'];break;case'marker':if(_0x3faf56=_0x40fe33['newRange'],!_0x3faf56)return null;_0x4f973c=_0x3faf56['root'];break;case'addRootAttribute':_0x4f973c=_0x40fe33['root'];break;case'addRoot':_0x4f973c=_0x40fe33['affectedSelectable'];break;case'move':_0x4f973c=_0x40fe33['targetPosition']['root'];break;default:return null;}return _0x4f973c['rootName'];}['_updateServerHistory'](_0x1bf406){_0x1bf406['forEach'](_0x541346=>{const _0x1d6c9d=_0x541346['clone']();_0x1d6c9d['_authorId']=_0x541346['_authorId'],_0x1d6c9d['_isInit']=!!_0x541346['_isInit'],_0x1d6c9d['_aiSource']=_0x541346['_aiSource'],_0x1d6c9d['createdAt']=_0x541346['createdAt'],_0x1d6c9d['baseVersion']+=this['_offset'],_0x541346['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x1d6c9d),this['serverHistory']['addOperation'](_0x1d6c9d);});}['_handleReconnectionError'](_0x5d98fd){const _0x2c97a9=this['editor']['plugins']['get']('Notification'),_0x37723b=this['editor']['locale'];_0x5d98fd||(_0x5d98fd=X(_0x37723b,'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.')),_0x2c97a9['showWarning'](_0x5d98fd,{'title':X(_0x37723b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](z)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1b1cb9)['add'](X(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1b1cb9)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x425350){const _0x1857f0=_0x425350['map'](_0x9f2917=>_0x9f2917['toJSON']());return this['_compressor']['compress'](_0x1857f0);}['_decompressOperations'](_0x382ad3,_0x374651){return this['_compressor']['decompress'](_0x382ad3)['map']((_0x57b512,_0x4d2f05)=>{const _0x1d413d='init'==_0x374651[_0x4d2f05]['type'];if('InsertOperation'==_0x57b512['__className']){const _0x2ec0c7=_0x57b512['position']['root'];!this['_document']['getRoot'](_0x2ec0c7)&&(this['_document']['createRoot']('$unknown',_0x2ec0c7)['_isAttached']=!0x1);}else{if('RootOperation'==_0x57b512['__className']){const _0x26a1f0=this['_document']['getRoot'](_0x57b512['rootName']);_0x26a1f0&&'$unknown'==_0x26a1f0['name']&&_0x57b512['elementName']!=_0x26a1f0['name']&&(_0x26a1f0['name']=_0x57b512['elementName']);}}const _0xe55948=_0x2de99b['fromJSON'](_0x57b512,this['_document']);return _0xe55948['wasUndone']=_0x57b512['wasUndone'],_0xe55948['_isInit']=_0x1d413d,_0xe55948['_authorId']=_0x1d413d?null:_0x374651[_0x4d2f05]['userId'],_0xe55948['_isDisconnection']='cs:removeUser'===_0x374651[_0x4d2f05]['type'],_0xe55948['_aiSource']=_0x57b512['_aiSource']||void 0x0,_0xe55948['createdAt']=_0x374651[_0x4d2f05]['createdAt'],_0xe55948;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x380254=this['editor']['plugins']['get'](Y)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x380254&&_0x380254['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},et=class extends Error{};function st(_0x49d7fa,_0x4f59f0){for(const _0x3c0951 of _0x49d7fa)_0x3c0951['baseVersion']=_0x4f59f0++;}var it=class{['_ignoredOperations'];['_operationToId'];constructor(_0x20a7fd){this['_ignoredOperations']=_0x20a7fd,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3e251a){let _0x2eb2d1=_0x3e251a['length'];for(;_0x2eb2d1--;){const _0x2531f8=_0x3e251a[_0x2eb2d1];if(!this['_ignoredOperations']['has'](_0x2531f8)){if(!this['_operationToId']['has'](_0x2531f8)){const _0x48ba52=_0x402abe()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2531f8,_0x48ba52);}return this['_operationToId']['get'](_0x2531f8);}}}['setIdForTheLastOperation'](_0xe6505f,_0x3d1821){if(!_0x3d1821)return;let _0x529d06=_0xe6505f['length'];for(;_0x529d06--;){const _0x44d30a=_0xe6505f[_0x529d06];this['_ignoredOperations']['has'](_0x44d30a)||this['_operationToId']['set'](_0x44d30a,_0x3d1821);}}},nt=class extends _0xc1f62{static get['requires'](){return[tt];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ot=class CloudServicesCommentsAdapter extends _0x49ae67{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x104468)());['_services'];static get['requires'](){return[z,_0x52ddef,Y,_0x480172];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25b041){super(_0x25b041),this['_services']=new Map();}async['init'](){const _0x358b2a=this['context'],_0xefdbdc=_0x358b2a['plugins']['get'](_0x52ddef);if(_0x358b2a['plugins']['get'](z)['addToReconnectionStack'](this),_0xefdbdc['adapter']={'addCommentThread':async({channelId:_0x47f8f4,threadId:_0x457ee2,comments:_0x11811c,resolvedAt:_0x3f5cc6,resolvedBy:_0x447c7e,context:_0x3e6b06,attributes:_0x11aa4e})=>{const _0x49d097=await this['_getService'](_0x47f8f4)['addCommentThread']({'commentThreadId':_0x457ee2,'comments':_0x11811c['map'](_0x4eaf03=>function(_0x4f224a,_0x5ce988,_0x55c5f8){return{'commentThreadId':_0x55c5f8,'commentId':_0x4f224a['commentId'],'userId':_0x4f224a['authorId'],'content':_0x4f224a['content'],'documentId':_0x5ce988,'createdAt':_0x4f224a['createdAt'],'attributes':_0x4f224a['attributes']||{}};}(_0x4eaf03,_0x47f8f4,_0x457ee2)),'resolvedAt':_0x3f5cc6,'resolvedBy':_0x447c7e,'context':_0x3e6b06,'attributes':_0x11aa4e})['catch'](ct);return{'threadId':_0x49d097['commentThreadId'],'comments':_0x49d097['comments']};},'getCommentThread':async({channelId:_0x37632a,threadId:_0x43bb5d})=>{const _0x5de18e=await this['_getService'](_0x37632a)['getCommentThread'](_0x43bb5d)['catch'](rt)['catch'](ct);return _0x5de18e?_0x5de18e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5de18e]),{'threadId':_0x5de18e['commentThreadId'],'comments':_0x5de18e['comments']['map'](at),'context':_0x5de18e['context'],'resolvedAt':_0x5de18e['resolvedAt'],'resolvedBy':_0x5de18e['resolvedBy'],'attributes':_0x5de18e['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0xfc5d6f,threadId:_0x279549,context:_0x4cfcfb,unlinkedAt:_0x123aa5,attributes:_0x2cbae5})=>this['_getService'](_0xfc5d6f)['updateCommentThread']({'commentThreadId':_0x279549,'context':_0x4cfcfb,'attributes':_0x2cbae5,'unlinkedAt':_0x123aa5})['catch'](rt)['catch'](ct),'resolveCommentThread':async({channelId:_0x167db3,threadId:_0x1f39be})=>{const _0x2cbe9e=await this['_getService'](_0x167db3)['resolveCommentThread'](_0x1f39be)['catch'](rt)['catch'](ct);return{'threadId':_0x2cbe9e['commentThreadId'],'resolvedAt':_0x2cbe9e['resolvedAt'],'resolvedBy':_0x2cbe9e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x21b042,threadId:_0x5a36e9})=>this['_getService'](_0x21b042)['reopenCommentThread'](_0x5a36e9)['catch'](rt)['catch'](ct),'removeCommentThread':({channelId:_0x3e4dc6,threadId:_0x34e8a5})=>this['_getService'](_0x3e4dc6)['removeCommentThread'](_0x34e8a5)['catch'](rt)['catch'](ct),'addComment':({channelId:_0x2c07df,threadId:_0x4e8b02,commentId:_0x46b4f1,content:_0x556466,attributes:_0x3c6194})=>this['_getService'](_0x2c07df)['addComment'](_0x4e8b02,_0x46b4f1,_0x556466,_0x3c6194)['catch'](ct),'updateComment':({channelId:_0x42cb16,threadId:_0x45dc13,commentId:_0x3eff2d,content:_0x5a7e6b,attributes:_0x296bae})=>this['_getService'](_0x42cb16)['updateComment'](_0x45dc13,_0x3eff2d,_0x5a7e6b,_0x296bae)['catch'](rt)['catch'](ct),'removeComment':({channelId:_0x4bd5b1,threadId:_0x15be60,commentId:_0x12b8ac})=>this['_getService'](_0x4bd5b1)['removeComment'](_0x15be60,_0x12b8ac)['catch'](rt)['catch'](ct)},_0x358b2a instanceof _0x15b218){const _0x4a63da=_0x358b2a['config']['get']('collaboration.channelId'),_0x3c180c=_0x358b2a['plugins']['get'](Y);await this['_setUpService'](_0x4a63da);const _0x49071a=await this['_services']['get'](_0x4a63da)['getConnectedSessions']();this['listenTo'](_0x3c180c,'sessionAdd:'+_0x4a63da,(_0x4d9f9b,{session:_0x3b9a18})=>{_0x3b9a18['id']===_0x3c180c['mySessionId']&&(_0x4d9f9b['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3b9a18['permissions'],_0x4a63da));}),_0x3c180c['register'](_0x4a63da,_0x49071a);}}async['_setUpService'](_0x2c7284){if(this['_services']['has'](_0x2c7284))throw new _0x126d14('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2c7284});const _0x112523=this['context']['plugins']['get'](_0x52ddef),_0x4de713=new CloudServicesCommentsAdapter['CommentsService'](_0x2c7284);this['_services']['set'](_0x2c7284,_0x4de713),this['listenTo'](_0x4de713,'commentThreadAdded',(_0x48c59d,_0x4ec438)=>{const {commentThreadId:_0x4c77dd,documentId:_0x134199,context:_0x7f11b2,attributes:_0xd73f98,resolvedAt:_0x4ce7f3,resolvedBy:_0x1c8bc2,comments:_0x596a97}=_0x4ec438;_0x112523['getCommentThread'](_0x4c77dd)||_0x112523['addCommentThread']({'threadId':_0x4c77dd,'channelId':_0x134199,'comments':_0x596a97?_0x596a97['map'](at):[],'context':_0x7f11b2,'attributes':_0xd73f98,'resolvedAt':_0x4ce7f3,'resolvedBy':_0x1c8bc2,'isFromAdapter':!0x0});}),this['listenTo'](_0x4de713,'commentThreadUpdated',(_0x432a1b,{commentThreadId:_0x3ad2ca,documentId:_0x40a113,context:_0x34e4b6,unlinkedAt:_0x11b2e4,attributes:_0x52e67d})=>{_0x112523['getCommentThread'](_0x3ad2ca)&&_0x112523['updateCommentThread']({'threadId':_0x3ad2ca,'channelId':_0x40a113,'context':_0x34e4b6,'unlinkedAt':_0x11b2e4,'attributes':_0x52e67d,'isFromAdapter':!0x0});}),this['listenTo'](_0x4de713,'commentThreadResolved',(_0x53091f,{commentThreadId:_0x33ee2d,resolvedBy:_0x16044a,resolvedAt:_0x4df069})=>{const _0x3408f2=_0x112523['getCommentThread'](_0x33ee2d);_0x3408f2&&_0x3408f2['resolve']({'resolvedBy':_0x16044a,'resolvedAt':_0x4df069,'isFromAdapter':!0x0});}),this['listenTo'](_0x4de713,'commentThreadReopened',(_0x2fbe08,{commentThreadId:_0x248b56})=>{const _0x177e67=_0x112523['getCommentThread'](_0x248b56);_0x177e67&&_0x177e67['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4de713,'commentThreadRemoved',(_0x16cb98,{commentThreadId:_0x547e1d})=>{const _0x267ad3=_0x112523['getCommentThread'](_0x547e1d);_0x267ad3&&_0x267ad3['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4de713,'commentAdded',(_0x359373,_0x232db0)=>{const _0x119100=_0x232db0['commentThreadId'],_0x1e2702=_0x112523['getCommentThread'](_0x119100);_0x1e2702&&_0x1e2702['addComment']({...at(_0x232db0),'isFromAdapter':!0x0});}),this['listenTo'](_0x4de713,'commentUpdated',(_0x3fbe82,{commentThreadId:_0x1ff57c,commentId:_0x58fc84,content:_0x4e9001,attributes:_0x490baa})=>{const _0x4775a4=_0x112523['getCommentThread'](_0x1ff57c);if(_0x4775a4){const _0x1a524b=_0x4775a4['getComment'](_0x58fc84);_0x1a524b&&_0x1a524b['update']({'content':_0x4e9001,'attributes':_0x490baa,'isFromAdapter':!0x0});}}),this['listenTo'](_0x4de713,'commentRemoved',(_0x12a9ca,{commentThreadId:_0x116711,commentId:_0xc696c5})=>{const _0x40ab9d=_0x112523['getCommentThread'](_0x116711);if(_0x40ab9d){const _0x543dde=_0x40ab9d['getComment'](_0xc696c5);_0x543dde&&_0x543dde['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x4de713,'disconnected',()=>{'connected'===this['context']['plugins']['get'](z)['connection']?.['state']&&(this['_services']['delete'](_0x2c7284),this['stopListening'](_0x4de713));}),await this['_connectService'](_0x2c7284);}['destroy'](){if(this['context']instanceof _0x15b218){const _0x15b531=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x15b531)&&this['_terminateService'](_0x15b531);}}['_terminateService'](_0x3ca66f){if(!this['_services']['has'](_0x3ca66f))throw new _0x126d14('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x3ca66f});this['_getService'](_0x3ca66f)['disconnect'](),this['_services']['delete'](_0x3ca66f);}async['reconnect'](){for(const _0x8c5529 of this['_services']['keys']())await this['_connectService'](_0x8c5529);if(this['context']instanceof _0x15b218){const _0x33f3d9=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x33f3d9)){const _0x4cf64b=this['context']['plugins']['get'](Y);_0x4cf64b['unregister'](_0x33f3d9);const _0xef6a2d=await this['_services']['get'](_0x33f3d9)['getConnectedSessions']();_0x4cf64b['register'](_0x33f3d9,_0xef6a2d);}}}async['_connectService'](_0x3caaa0){const {connection:_0x3be000}=this['context']['plugins']['get'](z),_0x5a6016=this['context']['plugins']['get'](_0x52ddef),_0x6e4cf5=await this['_services']['get'](_0x3caaa0)['connect'](_0x3be000);await this['_fetchMissingUsersForThreads'](_0x6e4cf5);const _0x28f2c3=new Set(Array['from'](_0x5a6016['getCommentThreads']({'channelId':_0x3caaa0}),_0x144c2a=>_0x144c2a['id']));for(const _0x1e9457 of _0x6e4cf5)_0x1e9457['deletedAt']||_0x28f2c3['delete'](_0x1e9457['commentThreadId']);for(const _0x1ff2d8 of _0x28f2c3)_0x5a6016['getCommentThread'](_0x1ff2d8)['remove']({'isFromAdapter':!0x0});for(const _0x1da677 of _0x6e4cf5){let _0x338d69=_0x5a6016['getCommentThread'](_0x1da677['commentThreadId']);const {commentThreadId:_0x9ae8fb,context:_0x4cb3dd,attributes:_0x225cb3,resolvedBy:_0x2874ed,resolvedAt:_0x5c4e80,unlinkedAt:_0x4d2e39,deletedAt:_0x32b57f}=_0x1da677;if(_0x32b57f)continue;_0x338d69||(_0x338d69=_0x5a6016['addCommentThread']({'channelId':_0x3caaa0,'threadId':_0x9ae8fb,'context':_0x4cb3dd,'attributes':_0x225cb3||{},'resolvedBy':_0x2874ed,'resolvedAt':_0x5c4e80,'unlinkedAt':_0x4d2e39,'isFromAdapter':!0x0}));const _0x45910e=new Set(Array['from'](_0x338d69['comments'],_0x8ae1d8=>_0x8ae1d8['id']));for(const _0x7a7a8a of _0x1da677['comments'])_0x45910e['delete'](_0x7a7a8a['commentId']);for(const _0x5bd6ea of _0x45910e)_0x338d69['getComment'](_0x5bd6ea)['remove']({'isFromAdapter':!0x0});for(const _0x59b205 of _0x1da677['comments']){const _0xcacbad=_0x338d69['getComment'](_0x59b205['commentId']);_0xcacbad?_0xcacbad['content']!==_0x59b205['content']&&_0xcacbad['update']({'content':_0x59b205['content'],'isFromAdapter':!0x0}):_0x338d69['addComment'](Object['assign'](at(_0x59b205),{'isFromAdapter':!0x0}));}}}['_getService'](_0x387a19){if(!this['_services']['has'](_0x387a19))throw new _0x126d14('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x387a19});return this['_services']['get'](_0x387a19);}async['_fetchMissingUsersForThreads'](_0xfad2c7){const _0x535d0f=this['context']['plugins']['get'](_0x480172),{connection:_0x4f7007}=this['context']['plugins']['get'](z),_0x44c79a=new Set();for(const {resolvedBy:_0x500cfb,comments:_0xbbc1d2}of _0xfad2c7){_0x500cfb&&!_0x535d0f['getUser'](_0x500cfb)&&_0x44c79a['add'](_0x500cfb);for(const {userId:_0x7dff5c}of _0xbbc1d2)_0x535d0f['getUser'](_0x7dff5c)||_0x44c79a['add'](_0x7dff5c);}if(0x0===_0x44c79a['size'])return;const _0x20a757=await _0x2a3ac9['getMany'](_0x4f7007,Array['from'](_0x44c79a));for(const _0x5c01b9 of _0x20a757)_0x535d0f['getUser'](_0x5c01b9['id'])||_0x535d0f['addUser'](_0x5c01b9);}};async function rt(_0x323ada){if('404'!==_0x323ada['code'])throw _0x323ada;}function ct(_0x11f211){if((_0x5cfdf5=_0x11f211)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5cfdf5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5cfdf5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5cfdf5;throw _0x11f211;}function at(_0x47ee9b){return{'threadId':_0x47ee9b['commentThreadId'],'commentId':_0x47ee9b['commentId'],'content':_0x47ee9b['content'],'createdAt':_0x47ee9b['createdAt'],'authorId':_0x47ee9b['userId'],'attributes':_0x47ee9b['attributes']||{}};}var ht=class CloudServicesTrackChangesAdapter extends _0xc1f62{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>_0x4a709b)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[ot,_0x2a216b,z];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1d8ca5){super(_0x1d8ca5);const _0x2552ae=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x2552ae);}['init'](){const _0x24a4d5=this['editor']['plugins']['get'](z),_0x4ddc55=this['editor']['plugins']['get'](_0x2a216b);return _0x4ddc55['adapter']={'getSuggestion':async _0x1fcea6=>{await this['_waitForServiceReady']();const _0x635b7d=await this['_trackChangesService']['get'](_0x1fcea6)['catch'](lt);return await this['_fetchMissingUsersForThreads']([_0x635b7d]),_0x635b7d;},'addSuggestion':async({id:_0x36002f,type:_0x2d0596,data:_0x1e9032,originalSuggestionId:_0x423e53,attributes:_0x4d9d22})=>{await this['_waitForServiceReady']();const _0x4f8dad={'id':_0x36002f,'type':_0x2d0596,'data':_0x1e9032,'originalSuggestionId':_0x423e53,'attributes':_0x4d9d22},_0x4b147d=await this['_trackChangesService']['add'](_0x36002f,_0x2d0596,_0x1e9032,_0x423e53,_0x4d9d22)['catch'](_0x3cb06e=>{if(dt(_0x3cb06e))return new Promise(_0x55874e=>{this['_bufferedRequests']['set'](_0x36002f,{'resolve':_0x55874e,'suggestionData':_0x4f8dad});});throw _0x3cb06e;});return this['_bufferedRequests']['delete'](_0x36002f),_0x4b147d;},'updateSuggestion':async(_0x3c2503,_0x433421)=>{if(await this['_waitForServiceReady'](),'open'!==_0x433421['state'])return this['_trackChangesService']['update'](_0x3c2503,_0x433421)['catch'](lt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x4716b7,_0x3f2053)=>{_0x4ddc55['hasSuggestion'](_0x3f2053['id'])&&(_0x4ddc55['getSuggestion'](_0x3f2053['id'])['attributes']=_0x3f2053['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x24a4d5['connection']?.['state']&&(_0x24a4d5['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0x24a4d5['connection'])['then'](_0x2b003e=>(_0x24a4d5['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2b003e)['then'](()=>{for(const _0x20c79d of _0x2b003e){_0x4ddc55['addSuggestionData'](_0x20c79d)['_saved']=!0x0;}})));}async['reconnect'](){const _0x3b4e55=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x2945e9}=this['editor']['plugins']['get'](z),_0x4b8fe4=await this['_trackChangesService']['connect'](_0x2945e9);await this['_fetchMissingUsersForThreads'](_0x4b8fe4);for(const {suggestionData:_0x5c757b,resolve:_0x585843}of this['_bufferedRequests']['values']()){let _0x220336=_0x4b8fe4['find'](_0x4bf68b=>_0x4bf68b['id']===_0x5c757b['id']);_0x220336||(_0x220336=await this['_trackChangesService']['add'](_0x5c757b['id'],_0x5c757b['type'],_0x5c757b['data'],_0x5c757b['originalSuggestionId'])),_0x585843(_0x220336);}for(const _0x1d4cec of _0x4b8fe4)_0x3b4e55['hasSuggestion'](_0x1d4cec['id'])||_0x3b4e55['addSuggestionData'](_0x1d4cec);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x5c6d25=>{this['listenTo'](this['_trackChangesService'],'connected',_0x4c5044=>{_0x4c5044['off'](),_0x5c6d25();});});}async['_fetchMissingUsersForThreads'](_0x2e1390){const _0x5eedeb=this['editor']['plugins']['get'](_0x480172),{connection:_0x5cc416}=this['editor']['plugins']['get'](z),_0x2fe35f=new Set();for(const {authorId:_0x55aa76}of _0x2e1390)_0x5eedeb['getUser'](_0x55aa76)||_0x2fe35f['add'](_0x55aa76);if(0x0===_0x2fe35f['size'])return;const _0x1a15a8=await _0x2a3ac9['getMany'](_0x5cc416,Array['from'](_0x2fe35f));for(const _0x2212f0 of _0x1a15a8)_0x5eedeb['getUser'](_0x2212f0['id'])||_0x5eedeb['addUser'](_0x2212f0);}};function lt(_0x1b32a0){if(dt(_0x1b32a0))return new Promise(()=>{});throw _0x1b32a0;}function dt(_0x1accc6){return _0x1accc6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1accc6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var ut=class extends _0xc1f62{static get['requires'](){return[_0x14a994,ot,nt,z];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xe8b50f=this['editor']['plugins']['get'](z),_0x4539c4=this['editor']['plugins']['get'](_0x3afc4e),_0x2fcea7=this['editor']['plugins']['get'](ot);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0xe8b50f,'change:state',(_0x445375,_0x3a5fb1,_0x5c05a8)=>{_0x4539c4['isThreadsLoadingPaused']='connected'!==_0x5c05a8;});}),this['listenTo'](_0xe8b50f,'change:state',(_0x11c0bb,_0x3bab34,_0x156e6b)=>{this['editor']['plugins']['get'](_0x52ddef)['switchReadOnly']('connected'!==_0x156e6b);}),_0x2fcea7['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){const _0x2f7019=this['editor']['plugins']['get'](ot),_0x1daec1=this['editor']['config']['get']('collaboration.channelId');_0x2f7019['_services']['has'](_0x1daec1)&&_0x2f7019['_terminateService'](_0x1daec1),super['destroy']();}},ft=class extends _0xc1f62{static get['requires'](){return[ut,ht,_0x417533];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},mt=class CloudServicesRevisionHistoryAdapter extends _0xc1f62{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>_0x4da89c)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[z,tt,_0x1e3875,Y,_0x480172];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1fe190){super(_0x1fe190);const _0x4f6c24=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x4f6c24);}async['init'](){const _0x58d0b9=this['editor']['plugins']['get'](tt),_0x38709e=_0x58d0b9['serverHistory'],_0x619a8a=this['editor']['plugins']['get'](z);this['_revisionTracker']['setSource']({'history':_0x38709e,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x58d0b9['sessionId']});const _0x374117=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x2b5982,_0x1c4078=await _0x3d091d['isBundleUploaded'](_0x619a8a['connection'],_0x374117);this['editor']['plugins']['get'](_0x1e3875)['adapter']={'getRevision':async({revisionId:_0x51e8e3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x51e8e3)),'updateRevisions':async _0x174aef=>{await this['_waitForServiceReady']();const _0x185ecb=this['_revisionTracker']['currentRevision'];if(_0x1c4078&&0x1===_0x174aef['length']&&_0x174aef[0x0]['id']===_0x185ecb['id'])return _0x174aef;for(const _0x468cae of _0x174aef)_0x468cae['id']===_0x185ecb['id']&&(_0x468cae['isEmptyCurrent']=_0x468cae['fromVersion']===_0x468cae['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x174aef,this['_lastRequestId'])['then'](_0x25ee77=>(this['_lastRequestId']=_0x25ee77,_0x174aef))['catch'](_0x4abb8e=>{if(pt(_0x4abb8e)||'400'===_0x4abb8e['code']&&void 0x0!==_0x4abb8e['data']['wrongRequestId']){for(const _0x49571e of _0x174aef)this['_revisionTracker']['repository']['getRevision'](_0x49571e['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x49571e['id'],_0x49571e,!0x1);if(pt(_0x4abb8e)&&'destroyed'!==this['editor']['state'])throw _0x4abb8e;return _0x174aef;}throw _0x4abb8e;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xdaabd5,{revisionsData:_0x3d56e8,requestId:_0x35dacb})=>{Math['max'](..._0x3d56e8['map'](_0x59af2f=>_0x59af2f['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3d56e8,_0x35dacb);}):this['_handleRevisionsUpdate'](_0x3d56e8,_0x35dacb);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x619a8a['connection']?.['state']&&(_0x619a8a['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x115f3f,requestId:_0xe08a70}=await this['_revisionHistoryService']['connect'](_0x619a8a['connection']);_0x619a8a['addToReconnectionStack'](this),this['_lastRequestId']=_0xe08a70,await this['_fetchMissingUsers'](_0x115f3f);for(const _0x4e83d2 of _0x115f3f)this['_revisionTracker']['addRevisionData'](_0x4e83d2);this['listenTo'](_0x58d0b9,'change:_isConnected',(_0xfcb72f,_0xdeaddd,_0x195a7f)=>{_0x195a7f&&(this['_oldOffset']=_0x58d0b9['_offset'],_0xfcb72f['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async['reconnect'](){const _0x17190c=this['editor']['plugins']['get'](z),_0x158e90=this['editor']['plugins']['get'](tt),_0x399870=async()=>{const _0x2f4056=this['_revisionTracker']['currentRevision'],_0x6511d1=_0x2f4056['id'],_0x4829b4=_0x6511d1!==_0x158e90['sessionId'];if(_0x4829b4){const _0x597748=_0x158e90['_offset']-this['_oldOffset'],_0x3d2eff=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x2f4056['toVersion']+_0x597748!==_0x3d2eff){const _0x291bc9=_0x2f4056['fromVersion']+_0x597748,_0x34e6d6=this['editor']['plugins']['get'](_0x480172),_0x28f1f3=this['_revisionTracker']['buildRevisionData']({'revision':_0x2f4056,'from':_0x291bc9,'to':_0x3d2eff});_0x28f1f3['id']=_0x2f4056['id'];const _0x33b9fa=_0x28f1f3['authorsIds']['map'](_0x3fb568=>_0x34e6d6['getUser'](_0x3fb568));_0x2f4056['_update']({..._0x28f1f3,'authors':_0x33b9fa},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2f4056['id'],_0x28f1f3,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3d2eff,_0x2f4056['toVersion']!==_0x2f4056['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x6511d1)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x6511d1),this['_revisionTracker']['_createCurrentRevision'](_0x3d2eff);}const {revisions:_0x246782,requestId:_0x264307}=await this['_revisionHistoryService']['reconnect'](_0x17190c['connection'],this['_lastRequestId']);_0x4829b4&&_0x246782['length']>0x0?_0x158e90['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x246782),this['_handleRevisionsUpdate'](_0x246782,_0x264307),this['_revisionTracker']['sendBufferedUpdates']());};return _0x158e90['_isConnected']?_0x399870():new Promise((_0x41bae3,_0x5d5e6f)=>{_0x158e90['once']('change:_isConnected',()=>{_0x399870()['then'](_0x41bae3)['catch'](_0x5d5e6f);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4b9f3f=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x37476c=>{_0x37476c['off'](),_0x4b9f3f();});});}['_getLatestVersionFromServerOperations'](){const _0x2e73c8=this['editor']['plugins']['get'](tt)['serverHistory']['getOperations']()['reverse']();for(const _0x4a4d16 of _0x2e73c8)if('marker'!==_0x4a4d16['type']||_0x4a4d16['affectsData'])return _0x4a4d16['baseVersion']+0x1;}['_getLatestVersion'](){const _0x10073c=this['editor']['plugins']['get'](tt);return new Promise(_0x3664d2=>{_0x10073c['_isPendingUpdate']?_0x10073c['once']('change:_isPendingUpdate',()=>{_0x3664d2(this['_getLatestVersionFromServerOperations']());}):_0x3664d2(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x9b0b98,_0x2ba7c1){const _0x33d7f9=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2ba7c1;for(const _0x52e0f2 of _0x9b0b98){const _0x1a5052=_0x33d7f9['getRevision'](_0x52e0f2['id']);if(_0x1a5052){if((_0x52e0f2['fromVersion']||_0x52e0f2['toVersion'])&&(_0x52e0f2['diffData']=null),_0x1a5052===this['_revisionTracker']['currentRevision']){const _0x5c18b7=Math['max'](_0x1a5052['toVersion'],_0x52e0f2['toVersion']),_0x39cde8=Math['max'](_0x1a5052['fromVersion'],_0x52e0f2['fromVersion']);let _0x344f40;_0x1a5052['toVersion']===_0x52e0f2['toVersion']&&_0x1a5052['fromVersion']===_0x52e0f2['fromVersion']?(_0x344f40=!0x0,this['_preventResendingRevisionData'](_0x52e0f2)):_0x52e0f2['toVersion']===_0x5c18b7&&_0x52e0f2['fromVersion']===_0x39cde8?_0x344f40=!0x1:(_0x1a5052['toVersion']===_0x5c18b7&&_0x1a5052['fromVersion']===_0x39cde8||this['_fixRevision']({'revision':_0x1a5052,'from':_0x39cde8,'to':_0x5c18b7}),_0x344f40=!0x0),_0x344f40&&(delete _0x52e0f2['fromVersion'],delete _0x52e0f2['toVersion'],delete _0x52e0f2['diffData'],delete _0x52e0f2['createdAt'],delete _0x52e0f2['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x52e0f2),this['_preventResendingRevisionData'](_0x52e0f2);}else this['_revisionTracker']['addRevisionData'](_0x52e0f2);}const _0x51bd47=_0x33d7f9['getRevisions']();_0x51bd47['reverse']();for(let _0x203e05=0x0;_0x203e05<_0x51bd47['length']-0x1;_0x203e05++){const _0x128018=_0x51bd47[_0x203e05],_0x1c1374=_0x51bd47[_0x203e05+0x1];if(_0x128018['fromVersion']<_0x1c1374['toVersion']){const _0x143b13=_0x1c1374['toVersion'],_0x5134b9=Math['max'](_0x143b13,_0x128018['toVersion']);this['_fixRevision']({'revision':_0x128018,'from':_0x143b13,'to':_0x5134b9});}}}['_fixRevision']({revision:_0xdb07e4,from:_0x2cbc6b,to:_0xf314dc}={}){const _0x552ec0=this['editor']['plugins']['get'](_0x480172),_0x3023bf=this['_revisionTracker']['buildRevisionData']({'revision':_0xdb07e4,'from':_0x2cbc6b,'to':_0xf314dc});_0x3023bf['authors']=_0x3023bf['authorsIds']['map'](_0x4d6d3b=>_0x552ec0['getUser'](_0x4d6d3b)),_0xdb07e4['_update'](_0x3023bf);}['_preventResendingRevisionData'](_0x901e9f){const _0x3039b3={};_0x3039b3['id']=_0x901e9f['id'];for(const _0x5c1c0c of Object['keys'](_0x901e9f))'id'!==_0x5c1c0c&&(_0x3039b3[_0x5c1c0c]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x3039b3['id'],_0x3039b3,!0x0);}async['_fetchMissingUsers'](_0x571b8f){const _0x1ea1d8=this['editor']['plugins']['get'](_0x480172),{connection:_0x4d4950}=this['editor']['plugins']['get'](z),_0x280abf=new Set();for(const _0x1e9eaf of _0x571b8f){for(const _0x2d92f1 of _0x1e9eaf['authorsIds'])_0x44b261(_0x2d92f1);_0x1e9eaf['creatorId']&&_0x44b261(_0x1e9eaf['creatorId']);}if(0x0===_0x280abf['size'])return;const _0x27f707=await _0x2a3ac9['getMany'](_0x4d4950,Array['from'](_0x280abf));for(const _0xcf4924 of _0x27f707)_0x1ea1d8['getUser'](_0xcf4924['id'])||_0x1ea1d8['addUser'](_0xcf4924);function _0x44b261(_0x733438){_0x1ea1d8['getUser'](_0x733438)||_0x280abf['add'](_0x733438);}}};function pt(_0x31a495){return _0x31a495['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x31a495['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x31a495['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var gt=class extends _0xc1f62{static get['requires'](){return[_0x1e3875,mt,nt];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class extends _0x48174d{['_collapseAt'];constructor(_0x1cfc31,_0x4502ba=0x6){super(_0x1cfc31);const _0x3e549c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4502ba,this['bind']('isHidden')['to'](this,'usersCount',_0x1c1854=>_0x1c1854<_0x4502ba),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3e549c['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':_0x3e549c['to']('usersCount',_0x166f4a=>'+'+(_0x166f4a-this['_collapseAt']+0x2)['toString']())}]}]}]});}},vt=class extends _0x48174d{['items'];['keystrokes'];constructor(_0x2da826){super(_0x2da826);const _0x220251=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x6ca5cf(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x220251['if']('hasPopup'),'aria-expanded':_0x220251['to']('isExpanded',_0x370f7f=>this['hasPopup']&&String(_0x370f7f)),'aria-label':_0x220251['to']('hasPopup',_0xf20fc6=>X(_0x2da826,_0xf20fc6?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x220251['to']('hasPopup',_0x3b8114=>!!_0x3b8114&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x220251['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x220251['to'](_0x580a42=>{const _0x48b0b4=_0x580a42,_0x33420d=document['querySelector']('.ck-presence-list__dropdown-list'),_0x21b7d8=document['querySelector']('.ck-balloon-panel_with-arrow');_0x33420d?.['contains'](_0x48b0b4['relatedTarget'])||_0x21b7d8?.['contains'](_0x48b0b4['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3f279b,_0x3006e1,_0x330f33)=>{this['element']&&(_0x330f33?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']);}},_t=class extends _0x48174d{['counterView'];['inlineListView'];constructor(_0x168be6,_0x4f620a=0x6){super(_0x168be6);const _0x58c06a=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new wt(this['locale'],_0x4f620a),this['inlineListView']=new vt(_0x168be6),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x463a80 of this['inlineListView']['items'])_0x463a80['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',_0x58c06a['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},yt=class extends _0x48174d{['listWrapperView'];constructor(_0x58f2f9,_0x17b015){super(_0x58f2f9);const _0x46acac=this['bindTemplate'];this['listWrapperView']=new bt(_0x58f2f9,_0x17b015),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':X(_0x58f2f9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x46acac['to'](_0x19bca7=>{const _0x4ba6d0=_0x19bca7,_0x2c22d1=document['querySelector']('.ck-presence-list__list'),_0x236986=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2c22d1?.['contains'](_0x4ba6d0['relatedTarget'])||_0x236986?.['contains'](_0x4ba6d0['relatedTarget'])||this['fire']('presencelist:hide');})}});}},bt=class extends _0x11c7db{constructor(_0x2812f2,_0x5b7f07){super(_0x2812f2);const _0x3671be=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x5b7f07?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3671be['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3671be['to']('role'),'aria-label':_0x3671be['to']('ariaLabel'),'aria-labelledby':_0x3671be['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3d533['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x14e43c=this['element'];_0x14e43c&&(this['_isScrollable']=Math['max'](_0x14e43c['scrollHeight'],_0x14e43c['clientHeight'])>0.8*window['innerHeight']);}},kt=class extends _0x155146{['userView'];constructor(_0x1f863f,_0x904755,_0x22fe22){super(_0x1f863f);const _0x9a9b69=this['bindTemplate'];this['userView']=new _0x1465af(_0x1f863f,_0x904755);const _0x34050e={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x904755['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x904755['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x904755['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x904755['color']['getColorVariable'](),'--ck-user-color-alpha':_0x904755['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x22fe22&&(_0x34050e['tag']='button',_0x34050e['on']={'click':_0x9a9b69['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x34050e);}['focus'](){this['element']['focus']();}},It=class extends _0x48174d{['userView'];['markerView'];constructor(_0x433f37,_0x46901e,_0x5470db){super(_0x433f37);const _0x255bba=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x1465af(_0x433f37,_0x46901e),this['markerView']=new St(_0x433f37,_0x46901e);const _0x9385ce=new _0x47278a(_0x433f37);_0x9385ce['template']['tag']='span',_0x9385ce['text']=_0x46901e['name'];const _0x4c775c={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x255bba['to']('isFocusable',_0x591117=>!!_0x591117&&0x0),'aria-labelledby':_0x9385ce['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x255bba['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x255bba['to']('hasTooltip',_0x2f96ef=>!_0x2f96ef),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x9385ce]};_0x5470db&&(_0x4c775c['tag']='button',_0x4c775c['on']={'click':_0x255bba['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4c775c);}},St=class extends _0x48174d{constructor(_0x54a1ee,_0x2b9af5){super(_0x54a1ee),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2b9af5['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x2b9af5['color']['getColorVariable'](),'--ck-user-color-alpha':_0x2b9af5['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Tt={'collapseAt':0x6,'displayMe':!0x0};var Ct=class extends _0x49ae67{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x362b01){super(_0x362b01),this['context']['config']['define']('presenceList',Tt);const _0x5dbc92=_0x362b01['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5dbc92)throw new _0x126d14('presencelist-collapseat-invalid-format',this);if(_0x5dbc92<0x1)throw new _0x126d14('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Y)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1a035a(),this['balloonPanelView']=new _0x5cb958(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[Y];}['init'](){for(const _0x4519ab of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4519ab);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1e488f,_0x54600b)=>{this['_handleUserAdd'](_0x54600b);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2f4cdc,_0x364494)=>{this['_handleUserRemove'](_0x364494);});}['_createView'](){const _0x584f53=this['context'],_0x4df612=new _t(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x224f49=this['balloonPanelView'];if(!_0x12ce62(_0x584f53['config']['get']('presenceList.container')))throw new _0x126d14('presencelist-missing-container',this);return _0x4df612['counterView']['bind']('usersCount')['to'](this),_0x4df612['bind']('isCollapsed')['to'](this,'usersCount',_0x38fbd4=>{const {collapseAt:_0x185a45}=_0x584f53['config']['get']('presenceList'),_0x207a55=_0x38fbd4>=_0x185a45;if(_0x207a55&&!_0x4df612['inlineListView']['items']['find'](_0x70a5a2=>_0x70a5a2 instanceof wt)){const _0x3102e1=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x3102e1&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x4df612['inlineListView']['items']['add'](_0x4df612['counterView']);}return _0x207a55||this['hideDropdown'](),_0x207a55;}),_0x4df612['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1c17c5=>{const _0x400453=_0x584f53['config']['get']('presenceList'),_0x4c886c=new It(_0x584f53['locale'],_0x1c17c5,!!_0x400453['onClick']);return _0x4c886c['bind']('hasTooltip')['to'](_0x4df612,'isCollapsed',_0xe4cb31=>!_0xe4cb31),_0x4c886c['bind']('isFocusable')['to'](_0x4df612,'isCollapsed',_0x54acea=>!_0x54acea),_0x400453['onClick']&&this['listenTo'](_0x4c886c,'execute',()=>{this['view']['isCollapsed']||_0x400453['onClick'](_0x1c17c5,_0x4c886c['element']);}),_0x4c886c;}),this['listenTo'](_0x4df612['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x4df612['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x4df612['inlineListView']['keystrokes']['set']('Enter',(_0x2d55ea,_0x3902de)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3902de());}),_0x4df612['render'](),_0x224f49['render'](),_0xcd0fcf({'emitter':_0x4df612,'activator':()=>_0x224f49['isVisible'],'contextElements':[_0x224f49['element'],_0x4df612['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x584f53['config']['get']('presenceList.container')['appendChild'](_0x4df612['element']),this['_bodyCollection']=new _0xafa5b4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x4df612;}['_handleUserAdd'](_0x2ee482){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2ee482['isMe'])return;const _0x1adca0=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x1adca0-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x36317e=_0x2ee482['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2ee482,_0x36317e);}['_handleUserRemove'](_0x4fa5f0){this['usersCount']--;const {collapseAt:_0x4e02c3}=this['context']['config']['get']('presenceList'),_0x221cf8=this['usersCount']>=_0x4e02c3;if(this['currentDisplayedUsers']['get'](_0x4fa5f0['id']))this['currentDisplayedUsers']['remove'](_0x4fa5f0['id']);else{if(_0x221cf8&&this['currentDisplayedUsers']['length']+0x1===_0x4e02c3-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x221cf8?0x1:0x0)<this['usersCount']){for(const _0x141e2a of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x141e2a['id'])&&(this['currentDisplayedUsers']['add'](_0x141e2a,Math['min'](this['currentDisplayedUsers']['length']-(_0x221cf8?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x221cf8?0x1:0x0)===_0x4e02c3-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x42f835=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new yt(this['context']['locale'],!!_0x42f835['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x35314d}=this['presenceDropdownView'];_0x35314d['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x260e09=>{if(!_0x42f835['displayMe']&&_0x260e09['isMe'])return null;const _0x37e1de=new kt(this['context']['locale'],_0x260e09,!!_0x42f835['onClick']);return _0x42f835['onClick']&&this['listenTo'](_0x37e1de,'execute',()=>{_0x42f835['onClick'](_0x260e09,_0x37e1de['element']);}),_0x37e1de;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x35314d['focus'](),_0x35314d['checkIfScrollable']();const _0x201187=(_0x2ed547,_0x12ea4d)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x12ea4d();};_0x35314d['keystrokes']['set']('Esc',_0x201187),_0x35314d['keystrokes']['set']('Shift+Tab',_0x201187),_0x35314d['keystrokes']['set']('Tab',(_0x167d35,_0x34d449)=>{!function(_0x55351f){const _0x3900c5=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x469877=>_0x469877+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x4f5c94=[...document['body']['querySelectorAll'](_0x3900c5)]['filter'](_0x6ff53a=>_0x6ff53a===document['activeElement']||_0x6ff53a['offsetWidth']+_0x6ff53a['offsetHeight']>0x0)['sort']((_0x23eef1,_0x336c50)=>(_0x23eef1['tabIndex']||0x0)-(_0x336c50['tabIndex']||0x0)),_0xf9d8a8=_0x4f5c94[(_0x4f5c94['indexOf'](_0x55351f)+0x1)%_0x4f5c94['length']];_0xf9d8a8&&_0xf9d8a8['focus']();}(this['view']['element']),this['hideDropdown'](),_0x34d449();}),_0x35314d['focusTracker']['add'](this['view']['element']),_0x35314d['focusTracker']['on']('change:isFocused',(_0x6b178c,_0x5015c9,_0x5daa50)=>{_0x5daa50||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);}},At=class extends _0x49ae67{static get['requires'](){return[Y,Ct];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ot as CloudServicesCommentsAdapter,mt as CloudServicesRevisionHistoryAdapter,ht as CloudServicesTrackChangesAdapter,At as PresenceList,Ct as PresenceListUI,tt as RealTimeCollaborationClient,ut as RealTimeCollaborativeComments,nt as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,Y as Sessions,z as WebSocketGateway};
|