@ckeditor/ckeditor5-real-time-collaboration 43.1.0 → 43.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- package/dist/index.js +6 -6
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.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/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.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/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/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/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/ko.js +1 -1
- package/dist/translations/ko.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/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/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/sk.js +1 -1
- package/dist/translations/sk.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/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/uk.js +1 -1
- package/dist/translations/uk.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 +9 -9
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x11135c];}static get['pluginName'](){return'WebSocketGateway';}constructor(_0x37bd17){super(_0x37bd17),this['set']('state',_0x597889['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4c7a02);}['init'](){const _0x148cd3=this['context'],_0x222636=_0x148cd3['plugins']['get']('CloudServices'),_0x59a661=_0x148cd3['plugins']['get'](_0x11135c);if(!_0x222636['token'])throw new _0x3eb044('websocketgateway-missing-token',this);if(!_0x222636['webSocketUrl'])throw new _0x3eb044('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),c['WebSocketGateway']['connect'](_0x222636['token'],_0x222636['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x30ff2f=>{if(this['connection']=_0x30ff2f,this['bind']('state')['to'](_0x30ff2f,'state',this,'_isBrowserOffline',(_0x775ad3,_0x42f73f)=>('connected'!==_0x775ad3&&(this['_shouldPluginsReconnect']=!0x0),_0x42f73f||_0x775ad3!==_0x597889['CONNECTED']?_0x597889['DISCONNECTED']:this['state']==_0x597889['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x597889['CONNECTING']):_0x597889['CONNECTED'])),this['connection']['on']('error',(_0x45a2dd,_0x26ff55)=>{if('limitExceeded'!==_0x26ff55['code'])throw console['error'](_0x26ff55),new _0x3eb044('cloudservices-init',null,{'originalError':_0x26ff55});_0x59a661['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'});}),!_0x30ff2f['me'])return new Promise(_0x42115c=>_0x30ff2f['on']('change:me',_0x42115c));})['catch'](_0x25b137=>{throw console['error'](_0x25b137),new _0x3eb044('cloudservices-init',null,{'originalError':_0x25b137});});}['addToReconnectionStack'](_0x16e050){if('function'!=typeof _0x16e050['reconnect'])throw new _0x3eb044('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x16e050))throw new _0x3eb044('websocketgateway-plugin-already-registered',this,{'name':_0x16e050['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x16e050);}['removeFromReconnectionStack'](_0x3594af){this['_reconnectionStack']['delete'](_0x3594af);}['isInReconnectionStack'](_0x3158e3){return this['_reconnectionStack']['has'](_0x3158e3);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1ae46e=>_0x1ae46e['reconnect']())))['then'](()=>this['state']=_0x597889['CONNECTED'])['catch'](_0x32565e=>{throw console['error'](_0x32565e),new _0x3eb044('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x597889['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class r extends _0x41fb54{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['requires'](){return[c,_0x5b0702];}constructor(_0x18f429){super(_0x18f429),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x332aca(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5b0702);}['init'](){const _0x49399c=this['context']['plugins']['get'](c);this['listenTo'](_0x49399c,'change:state',(_0x451fa7,_0x496baf,_0x426885)=>{if('connected'!==_0x426885)this['channelSessions']['forEach'](_0x417cc5=>_0x417cc5['clear']()),this['channelConnectedUsers']['forEach'](_0x3b6b3e=>_0x3b6b3e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x298a44,_0x27c78c]of this['_registeredSessions'])for(const _0x3c7e07 of _0x27c78c)this['_handleSessionAdd'](_0x298a44,_0x3c7e07);}}),this['_createUser'](_0x49399c['connection']['me'],!0x0);}['register'](_0x461d3c,_0x244aea){if(this['_registeredSessions']['has'](_0x461d3c))throw new _0x3eb044('sessions-register-already-registered',null,{'channelId':_0x461d3c});this['_registeredSessions']['set'](_0x461d3c,_0x244aea),this['channelSessions']['set'](_0x461d3c,new _0x332aca()),this['channelConnectedUsers']['set'](_0x461d3c,new _0x332aca()),this['listenTo'](_0x244aea,'add',(_0x1003a2,_0x332ce2)=>this['_handleSessionAdd'](_0x461d3c,_0x332ce2)),this['listenTo'](_0x244aea,'remove',(_0x5c84e6,_0x379acc)=>this['_handleSessionRemove'](_0x461d3c,_0x379acc));for(const _0x45c542 of _0x244aea)this['_handleSessionAdd'](_0x461d3c,_0x45c542);}['unregister'](_0x42e04b){if(!this['_registeredSessions']['has'](_0x42e04b))throw new _0x3eb044('sessions-unregister-not-exist',null,{'channelId':_0x42e04b});const _0x523eb0=this['_registeredSessions']['get'](_0x42e04b);this['stopListening'](_0x523eb0);for(const _0x1fc963 of _0x523eb0)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x42e04b,_0x1fc963);this['_registeredSessions']['delete'](_0x42e04b),this['channelSessions']['delete'](_0x42e04b),this['channelConnectedUsers']['delete'](_0x42e04b);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x23bd73){for(const _0x20cdad of this['channelSessions']['values']())for(const _0x530b04 of _0x20cdad)if(_0x530b04['id']===_0x23bd73)return _0x530b04['user'];}['getUserSessions'](_0x1f7cdc,_0x351a51){const _0xe77d23=_0x351a51?[this['channelSessions']['get'](_0x351a51)]:this['channelSessions']['values'](),_0x1afa82=new Set();for(const _0x536b50 of _0xe77d23)for(const _0x218819 of _0x536b50)_0x218819['user']['id']===_0x1f7cdc['id']&&_0x1afa82['add'](_0x218819['id']);return _0x1afa82;}['getUserRole'](_0x444312){for(const _0x4f7d54 of this['channelSessions']['values']())for(const _0x5590c2 of _0x4f7d54)if(_0x5590c2['user']===_0x444312)return _0x5590c2['role'];}['_handleSessionAdd'](_0x52449e,_0xf1737b){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1cfeb3=_0xf1737b['user'],_0x3a052e=this['_users']['getUser'](_0x1cfeb3['id'])||this['_createUser'](_0x1cfeb3),_0x1974fc=Object['assign']({},_0xf1737b,{'user':_0x3a052e});this['channelSessions']['get'](_0x52449e)['add'](_0x1974fc);const _0x19bbdf=this['channelConnectedUsers']['get'](_0x52449e);_0x19bbdf['has'](_0x3a052e['id'])||_0x19bbdf['add'](_0x3a052e),this['allConnectedUsers']['has'](_0x3a052e['id'])||this['allConnectedUsers']['add'](_0x3a052e,_0x3a052e['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x52449e,{'channelId':_0x52449e,'session':_0x1974fc});}['_handleSessionRemove'](_0x41e4fa,_0x5bef12){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x58e383=this['channelConnectedUsers']['get'](_0x41e4fa),_0x140436=_0x5bef12['user'];_0x140436['id']&&(this['channelSessions']['get'](_0x41e4fa)['remove'](_0x5bef12['id']),_0x58e383['has'](_0x140436['id'])&&!this['getUserSessions'](_0x140436,_0x41e4fa)['size']&&_0x58e383['remove'](_0x140436['id']),this['allConnectedUsers']['get'](_0x140436['id'])&&!this['getUserSessions'](_0x140436)['size']&&this['allConnectedUsers']['remove'](_0x140436['id']));}['_createUser'](_0x1db362,_0x13b13d){const _0x1d5751=this['_users']['addUser'](_0x1db362);return _0x13b13d&&this['_users']['defineMe'](_0x1db362['id']),_0x1d5751['orderNumber']=this['_uniqueUsersCount']++,_0x1d5751;}}class H extends _0x2b8fdd{['_domEmitter']=new(_0x4c7a02())();static get['requires'](){return[r];}static get['pluginName'](){return'UserMarkers';}['init'](){const _0x3bb074=this['editor'],_0x2ed3e3=_0x3bb074['plugins']['get'](r);_0x3bb074['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x59472c,{writer:_0x31f7b1})=>function(_0xef3b68,_0x38965a,_0x1871ea,_0x2db7aa){const _0x4a301d=_0xef3b68['markerName']['split'](':')[0x2],_0xb0b40=_0x1871ea['getUserBySessionId'](_0x4a301d);if(!_0xb0b40||_0x4a301d===_0x1871ea['mySessionId'])return;if(!_0x2db7aa['model']['schema']['checkChild'](_0xef3b68['markerRange']['start'],'$text'))return;const _0x1db5e3={'class':'ck-user__marker\x20'+_0xb0b40['color']['getMarkerClass'](),'data-name':_0xb0b40['name'],'data-session-id':_0x4a301d},_0x58dcdb=_0x2db7aa['model']['markers']['get'](_0xef3b68['markerName']),_0x2d7496=_0x58dcdb['getStart'](),_0xf6113a=_0x2d7496['nodeAfter'],_0x1f73a8=_0x2db7aa['model']['schema'];if(_0xf6113a&&_0x1f73a8['isObject'](_0xf6113a)&&_0x1f73a8['isInline'](_0xf6113a)&&!_0x2db7aa['model']['markers']['get']('user:range:'+_0x4a301d)['getRange']()['isCollapsed'])return;const _0x5e66dc=_0x2d7496['parent'];return _0x2db7aa['model']['schema']['isLimit'](_0x5e66dc)&&!_0x2db7aa['model']['hasContent'](_0x5e66dc)&&(_0x1db5e3['contenteditable']=!0x1),function(_0x40f6c2,_0x3ab430,_0x2022e0){const _0x1aa4df=_0x40f6c2['createUIElement']('span',_0x3ab430);return _0x40f6c2['setCustomProperty']('userPositionMarker',!0x0,_0x1aa4df),_0x1aa4df['render']=function(_0x26d691){const _0x26dba3=this['toDomElement'](_0x26d691);return _0x26dba3['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x2022e0['name']+'</span>',_0x26dba3['addEventListener']('mouseenter',()=>{_0x26dba3['classList']['add']('ck-user__marker_hovered');}),_0x26dba3['addEventListener']('mouseleave',()=>{_0x26dba3['classList']['remove']('ck-user__marker_hovered');}),_0x26dba3;},_0x1aa4df['isSimilar']=function(_0x515a00){return!(!this['getCustomProperty']('userPositionMarker')||!_0x515a00['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x515a00['getAttribute']('data-session-id'));},_0x1aa4df;}(_0x38965a,_0x1db5e3,_0xb0b40);}(_0x59472c,_0x31f7b1,_0x2ed3e3,_0x3bb074)}),_0x3bb074['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x509456=>function(_0x5a2761,_0x37556e){const _0x115653=_0x5a2761['markerName']['split'](':')[0x2];if(_0x115653===_0x37556e['mySessionId'])return null;const _0xc9d24d=_0x37556e['getUserBySessionId'](_0x115653);if(!_0xc9d24d)return{'id':_0x115653,'classes':[]};return{'id':_0x115653,'classes':['ck-user__selection',_0xc9d24d['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x115653},'priority':0x7d0+_0xc9d24d['orderNumber']};}(_0x509456,_0x2ed3e3)}),function(_0x54ef33){const _0x160ac5=_0x54ef33['model'],_0x3964c9=new Map(),_0x529f01=_0x54ef33['plugins']['get'](r);_0x160ac5['markers']['on']('update:user:range',(_0x8fc38d,_0x4fb0c7,_0x432dd7,_0x59f23b)=>{if(!_0x59f23b&&_0x3964c9['get'](_0x4fb0c7['name']))return _0x3964c9['get'](_0x4fb0c7['name'])['detach'](),void _0x3964c9['delete'](_0x4fb0c7['name']);const _0x1a5657=_0x4fb0c7['name']['split'](':')[0x2];if(_0x1a5657===_0x529f01['mySessionId'])return;const _0x50589a='user:position:'+_0x1a5657;_0x160ac5['markers']['has'](_0x50589a)&&_0x54ef33['editing']['reconvertMarker'](_0x50589a),_0x4fb0c7['on']('change:range',(_0x11b633,_0x4c3f5c,_0x4faff8)=>{if('$graveyard'!=_0x4c3f5c['root']['rootName']&&'$graveyard'==_0x4fb0c7['getRange']()['root']['rootName']&&!_0x3964c9['has'](_0x4fb0c7['name'])){const _0x39ff9f=_0x160ac5['schema']['getNearestSelectionRange'](_0x4faff8['deletionPosition']);if(_0x39ff9f){const _0x1f9c86=ht['fromRange'](_0x39ff9f);_0x3964c9['set'](_0x4fb0c7['name'],_0x1f9c86),_0x1f9c86['on']('change:range',(_0x47137a,_0x17bab0,_0x51da43)=>{if('$graveyard'==_0x1f9c86['root']['rootName']){const _0x2ae16e=_0x160ac5['schema']['getNearestSelectionRange'](_0x51da43['deletionPosition']);_0x2ae16e?(_0x1f9c86['start']=_0x2ae16e['start'],_0x1f9c86['end']=_0x2ae16e['end']):(_0x3964c9['delete'](_0x4fb0c7['name']),_0x1f9c86['detach']());}});}}});}),_0x160ac5['document']['on']('change',()=>{_0x3964c9['size']>0x0&&_0x160ac5['enqueueChange']({'isUndoable':!0x1},_0x3616cc=>{for(const [_0xad9612,_0x16c098]of _0x3964c9)'$graveyard'==_0x160ac5['markers']['get'](_0xad9612)['getRange']()['root']['rootName']&&(re(_0xad9612['split'](':')[0x2],_0x16c098['toRange'](),_0x160ac5,_0x3616cc),_0x16c098['detach']());_0x3964c9['clear']();});});}(_0x3bb074),this['_domEmitter']['listenTo'](_0x126da3['document'],'keydown',(_0x3009e2,{key:_0x2ee29c})=>{'Escape'===_0x2ee29c&&function(_0x5f24b6){_0x5f24b6['editing']['view']['change'](_0x1388a8=>{for(const _0x121fc3 of _0x5f24b6['model']['markers']){if(!_0x121fc3['name']['startsWith']('user:position'))continue;const _0x4aebd6=_0x5f24b6['editing']['mapper']['markerNameToElements'](_0x121fc3['name']);if(_0x4aebd6){for(const _0xb207ca of _0x4aebd6)_0x1388a8['removeClass']('ck-user__marker_hovered',_0xb207ca);}}});}(_0x3bb074);},{'useCapture':!0x0});}['afterInit'](){const _0x366e5b=this['editor'],_0x5ebab3=_0x366e5b['commands']['get']('undo');_0x5ebab3&&_0x366e5b['model']['on']('applyOperation',(_0x31cbde,_0x1b9ce1)=>{const _0x5d195b=_0x1b9ce1[0x0];if('marker'!=_0x5d195b['type']||!_0x5d195b['name']['startsWith']('user:'))return;const _0x5a14dc=_0x5d195b['batch'];_0x5ebab3['_createdBatches']['has'](_0x5a14dc)&&(_0x5d195b['newRange']=_0x5d195b['oldRange']?_0x366e5b['model']['createRange'](_0x5d195b['oldRange']['start'],_0x5d195b['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x196264=this['editor'],_0x11ec42=_0x196264['model']['document'],_0x4cc510=_0x196264['plugins']['get'](r);_0x196264['model']['enqueueChange']({'isUndoable':!0x1},_0x64cf94=>{const _0x576b8f='user:range:'+_0x4cc510['mySessionId'],_0x3d68d9='user:position:'+_0x4cc510['mySessionId'],_0x2c11a9=_0x196264['model']['markers']['has'](_0x576b8f);_0x196264['editing']['view']['hasDomSelection']?re(_0x4cc510['mySessionId'],_0x11ec42['selection']['getFirstRange'](),_0x196264['model'],_0x64cf94):_0x2c11a9&&(_0x64cf94['removeMarker'](_0x576b8f),_0x64cf94['removeMarker'](_0x3d68d9));});}}function re(_0x5d18d0,_0x18581,_0x2df071,_0x1f2c80){const _0x2e082b='user:range:'+_0x5d18d0,_0x392726='user:position:'+_0x5d18d0,_0x396d12=_0x18581['getContainedElement']();let _0x4a927e=_0x18581['start'];_0x396d12&&_0x396d12['is']('element','tableCell')&&(_0x4a927e=function(_0x38fe13,_0x332e74){for(const _0x45547e of _0x38fe13['getPositions']())if(_0x332e74['schema']['checkChild'](_0x45547e,'$text'))return _0x45547e;}(_0x18581,_0x2df071),_0x18581=_0x1f2c80['createRange'](_0x4a927e));const _0x2931e1=_0x1f2c80['createRange'](_0x4a927e);_0x2df071['markers']['has'](_0x2e082b)?(_0x1f2c80['updateMarker'](_0x2e082b,{'range':_0x18581}),_0x1f2c80['updateMarker'](_0x392726,{'range':_0x2931e1})):(_0x1f2c80['addMarker'](_0x2e082b,{'range':_0x18581,'usingOperation':!0x0}),_0x1f2c80['addMarker'](_0x392726,{'range':_0x2931e1,'usingOperation':!0x0}));}function q(_0x21ae0b,_0x4fcec8,_0x1f7712){const t=_0x21ae0b['t'];switch(_0x4fcec8){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 t({'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'},_0x1f7712);default:return'';}}let K=0x1;class l extends _0x2b8fdd{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x30e732)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,r,H,_0x315bd9,_0x5b0702,_0x11135c];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0xd3c437=this['serverHistory']['getOperations']();for(let _0x4977c5=_0xd3c437['length']-0x1;_0x4977c5>=0x0;_0x4977c5--){const _0x32f3f3=_0xd3c437[_0x4977c5];if(!this['_disconnectionOperations']['has'](_0x32f3f3))return _0x32f3f3['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2e4212){if(super(_0x2e4212),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x3c5016(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3eb044('collaboration-missing-channelid',this);const _0x36feeb=_0x2e4212['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x36feeb,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x466aa5(),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 X(this['_disconnectionOperations']);}['init'](){const _0x488e78=this['editor'],_0x163930=_0x488e78['plugins']['get'](_0x5b0702),_0x19db3f=_0x488e78['plugins']['get'](c);this['listenTo'](_0x163930,'getOperationAuthor',(_0x39bbc2,_0x1d4e27)=>{const _0x1f8af7=_0x1d4e27[0x0];_0x1f8af7['_authorId']&&(_0x39bbc2['return']=_0x163930['getUser'](_0x1f8af7['_authorId']),_0x39bbc2['stop']()),null===_0x1f8af7['_authorId']&&(_0x39bbc2['return']=null,_0x39bbc2['stop']());},{'priority':'high'}),this['listenTo'](_0x488e78['model']['document']['selection'],'change:range',(_0x1c66eb,_0x7fb2b1)=>{_0x7fb2b1['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x488e78['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x488e78['model']['on']('applyOperation',(_0x2d8a5d,_0x4dc832)=>{const _0x5bad0c=_0x4dc832[0x0];_0x5bad0c['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5bad0c),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x19db3f,'state',this,'_hasSynchronizationProblem',(_0x14881d,_0x473eb8)=>'connected'===_0x14881d&&!_0x473eb8),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x488e78['disableReadOnlyMode']('rtc-offline'):_0x488e78['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x488e78['disableReadOnlyMode']('rtc-offline'):_0x488e78['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x32ba6f=this['editor']['plugins']['get'](r),_0x28fb42=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x32ba6f['unregister'](this['_channelId']);const _0x369743=await this['_service']['reconnect'](_0x28fb42['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x369743)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x915838=await this['_service']['getConnectedSessions']();_0x32ba6f['register'](this['_channelId'],_0x915838),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xa981ec){if(function(_0x2594e6){return'404'===_0x2594e6['code'];}(_0xa981ec)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x442640){return'409'===_0x442640['code'];}(_0xa981ec)){const _0x3ff961=q(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'](_0x3ff961);}else{if(!(_0xa981ec instanceof J))throw _0xa981ec;this['_handleReconnectionError']();}}}}['destroy'](){const _0x3c170a=this['editor']['plugins']['get'](c),_0x4b3ad0=this['editor']['plugins']['get'](r);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4b3ad0['channelSessions']['has'](this['_channelId'])&&_0x4b3ad0['unregister'](this['_channelId']),_0x3c170a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4dc3a8){if(this['sessionId']!==_0x4dc3a8['sessionId']&&this['_lastSyncedOperationId']!==_0x4dc3a8['lastOperationId'])throw new J();return this['sessionId']=_0x4dc3a8['sessionId'],this['_handleServerResponse']([],{..._0x4dc3a8,'wereChangesApplied':!0x1,'data':_0x4dc3a8['data']},'reconnect');}async['_connectService'](_0x4f9dd8,_0x56e74f=!0x1){const {connection:_0x23315a}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x23315a,this['_channelId'])['then'](_0x1d9f56=>this['_initSessionsHandling'](_0x1d9f56))['catch'](_0x74e370=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x74e370);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x2407b3,_0x5d16d9)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x5d16d9);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x5b1ec3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4f9dd8);this['_isPendingUpdate']=!0x0;const _0x9c3094=await this['_service']['connect'](_0x23315a,this['_compressOperations'](_0x4f9dd8),_0x5b1ec3);if(this['sessionId']=_0x9c3094['sessionId'],_0x56e74f){if(!_0x9c3094['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x9c3094['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4f9dd8,_0x9c3094,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x9c3094,_0x4f9dd8);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4c341e=this['editor']['plugins']['get'](r),_0x15eb53=this['editor']['plugins']['get'](H),_0x53e8a8=_0x4c341e['channelSessions']['get'](this['_channelId']);_0x53e8a8&&_0x53e8a8['length']>0x1?_0x15eb53['createUserMarkerOperations']():this['listenTo'](_0x4c341e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4c341e['channelSessions']['get'](this['_channelId'])['length']&&_0x15eb53['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x55d33b,_0x4fdec5,_0x89e649,_0x202818){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4fdec5){const _0xbbe63f=this['_decompressOperations'](_0x89e649,_0x202818);await this['_fetchMissingUsers'](_0xbbe63f),this['_handleExternalOperations'](_0xbbe63f,_0x4fdec5,_0x89e649['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x6c2f12}=this['editor'];let _0x4e87be;try{_0x4e87be=await this['_service']['getDocumentDetails']();}catch(_0xdc78df){const _0x52d1e0=q(_0x6c2f12,'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'](_0x52d1e0);}const _0x21bc00=_0x4e87be['currentDocumentSession']||_0x4e87be['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x21bc00['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x5db41e=q(_0x6c2f12,'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.');this['_handleReconnectionError'](_0x5db41e);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x163ba0){const _0x4bb357=this['editor']['plugins']['get'](r);this['listenTo'](_0x4bb357,'sessionAdd:'+this['_channelId'],(_0x5b4696,{session:_0x3e6cdf})=>{if(_0x3e6cdf['id']===_0x4bb357['mySessionId']){_0x5b4696['off']();const _0x58c0a3=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3d97c9=_0x3e6cdf['permissions'];_0x58c0a3&&_0x58c0a3['isEnabled']&&(_0x3d97c9=_0x3d97c9['filter'](_0x29520b=>'document:write'!==_0x29520b)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3d97c9,this['_channelId']);}}),_0x4bb357['register'](this['_channelId'],_0x163ba0);}['_initThrowingOnDataSet'](){const _0x23fc3f=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2391bc)=>{if(!_0x2391bc[_0x2391bc['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3eb044('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x23fc3f['apply'](this['editor']['data'],_0x2391bc);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x16d4c9,[_0x53952d])=>{if(this['_document']['version'])throw new _0x3eb044('realtimecollaborationclient-init-document-already-initialized',this);_0x16d4c9['stop'](),this['_setPendingAction']();const _0x13a7b3=this['editor']['config']['get']('rootsAttributes'),_0x3ff82e=this['_getOperationsFromInitData'](_0x53952d,_0x13a7b3);0x0==_0x3ff82e['length']&&_0x3ff82e['push'](new _0x43000b(0x0)),_0x16d4c9['return']=this['_connectService'](_0x3ff82e)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x35446e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x35446e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5df467,[_0x4f316c,_0x3230bb])=>{_0x5df467['stop']();const _0x5e75e7=this['editor']['model']['document']['getRoot'](_0x4f316c);if(!this['_knownRootNames']['has'](_0x4f316c)){const _0x584490=_0x3230bb&&_0x3230bb['data']?_0x3230bb['data']:'',_0x23fe87=_0x3230bb&&_0x3230bb['attributes']?_0x3230bb['attributes']:{};await this['_loadRoot'](_0x4f316c,_0x584490,_0x23fe87);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x5e75e7['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x5e75e7);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x3c955b){const _0x5669fe=this['editor']['plugins']['get'](_0x5b0702),{connection:_0x5ae5db}=this['editor']['plugins']['get'](c),_0x4009a7=new Set();for(const _0x14cd83 of _0x3c955b){const _0x122849=_0x14cd83['_authorId'];_0x122849&&!_0x5669fe['getUser'](_0x122849)&&_0x4009a7['add'](_0x122849);}if(0x0===_0x4009a7['size'])return;const _0x907fe0=await lt['getMany'](_0x5ae5db,Array['from'](_0x4009a7));for(const _0x1dcab2 of _0x907fe0)_0x5669fe['getUser'](_0x1dcab2['id'])||_0x5669fe['addUser'](_0x1dcab2);}['_getOperationsFromInitData'](_0x39a94a,_0x2ac220={}){const _0x180974=this['editor']['model'],_0x40f216=[];let _0xe80707=0x0;const _0xa8bb28='string'==typeof _0x39a94a?{'main':_0x39a94a}:_0x39a94a;for(const _0x5eb4d7 of Object['keys'](_0xa8bb28)){if(!this['_document']['roots']['has'](_0x5eb4d7))throw new _0x3eb044('realtimecollaborationclient-init-non-existent-root',this);const _0x555a25=this['editor']['data']['parse'](_0xa8bb28[_0x5eb4d7]),_0x1ad82c=this['_document']['getRoot'](_0x5eb4d7),_0x3bffb9=new _0x3f89c9(_0x180974['createPositionAt'](_0x1ad82c,0x0),_0x555a25,_0xe80707++);_0x40f216['push'](_0x3bffb9);for(const [_0x5b052e,_0x47ff09]of _0x555a25['markers']){const _0x302721=_0x180974['createRange'](_0x180974['createPositionFromPath'](_0x1ad82c,_0x47ff09['start']['path']['slice']()),_0x180974['createPositionFromPath'](_0x1ad82c,_0x47ff09['end']['path']['slice']())),_0x572b53=new _0x34774d(_0x5b052e,null,_0x302721,_0x180974['markers'],!0x0,_0xe80707++);_0x40f216['push'](_0x572b53);}}if(_0x2ac220)for(const [_0x56dc4f,_0x37eb82]of Object['entries'](_0x2ac220)){const _0x13bde0=_0x180974['document']['getRoot'](_0x56dc4f);if(!_0x13bde0)throw new _0x3eb044('multi-root-editor-root-attributes-no-root',null);for(const [_0x311fb5,_0x85328b]of Object['entries'](_0x37eb82))if(null!==_0x85328b){const _0x3a8be4=new _0x4f6c57(_0x13bde0,_0x311fb5,null,_0x85328b,_0xe80707++);_0x40f216['push'](_0x3a8be4);}}return _0x40f216;}async['_loadRoot'](_0x1b5fa9,_0x34652b,_0x59bb69){this['_getOperationsFromInitData']({[_0x1b5fa9]:_0x34652b},{[_0x1b5fa9]:_0x59bb69})['forEach']((_0xcf455e,_0x19e2a7)=>{_0xcf455e['baseVersion']=this['_document']['version']+_0x19e2a7,_0xcf455e['_isInit']=!0x0,this['_saveOperationInBuffer'](_0xcf455e);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x164c53,_0x45bab8){let _0x2e1113;this['_offset']=_0x164c53['offset'];const _0x545f85=_0x164c53['wereChangesApplied']&&!_0x164c53['initData'],_0x1dfd57=_0x545f85?0x0:_0x164c53['data']['baseVersion'];if(_0x45bab8['forEach'](_0x4e9a7d=>{_0x4e9a7d['_isInit']=!0x0,_0x4e9a7d['createdAt']=_0x164c53['sessionCreatedAt'],_0x4e9a7d['_authorId']=null;}),_0x545f85)_0x2e1113=_0x45bab8,this['_applyOperationsSet'](_0x2e1113,_0x545f85);else{if(_0x164c53['initData']){const _0x4fe978=this['_getOperationsFromInitData'](_0x164c53['initData']);this['_document']['history']['version']=-_0x4fe978['length'],_0x4fe978['forEach'](_0x5ef1f3=>{_0x5ef1f3['baseVersion']-=_0x4fe978['length'],_0x5ef1f3['createdAt']=_0x164c53['sessionCreatedAt'],_0x5ef1f3['_isInit']=!0x0,_0x5ef1f3['_authorId']=null;}),this['_applyOperationsSet'](_0x4fe978,!0x0),this['serverHistory']['version']=-_0x4fe978['length']+this['_offset'],this['_updateServerHistory'](_0x4fe978);}this['_document']['history']['version']=_0x1dfd57,_0x2e1113=this['_decompressOperations'](_0x164c53['data'],_0x164c53['metadata']),await this['_fetchMissingUsers'](_0x2e1113),this['_applyOperationsSet'](_0x2e1113,_0x545f85);}_0x164c53['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2e1113,_0x164c53['lastOperationId']),this['_lastSyncedOperationId']=_0x164c53['lastOperationId']),this['serverHistory']['version']=_0x1dfd57+this['_offset'],this['_updateServerHistory'](_0x2e1113),_0x45bab8['filter'](_0x1f7703=>{const _0x3f95c5=this['_getAffectedRoot'](_0x1f7703);return _0x3f95c5&&!this['_knownRootNames']['has'](_0x3f95c5);})['forEach']((_0xb3662f,_0x18fc39)=>{_0xb3662f['baseVersion']=this['_document']['version']+_0x18fc39,this['_saveOperationInBuffer'](_0xb3662f);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0xa40fee,_0x37f946){throw this['_isPendingUpdate']=!0x0,_0x37f946&&console['error'](_0x37f946),new _0x3eb044(_0xa40fee,this['editor']);}['_saveOperationInBuffer'](_0x44cae6){this['_knownOperations']['has'](_0x44cae6)||(this['_knownOperations']['add'](_0x44cae6),this['_bufferedOperations']['push'](_0x44cae6),this['_pendingAction']||'marker'==_0x44cae6['type']&&!_0x44cae6['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x50e56e=!0x1){!_0x50e56e&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x5ccfd4=>{_0x5ccfd4&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x42b8ef=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x4e9625){return _0x4e9625['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4e9625['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4e9625['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x42b8ef))throw _0x42b8ef;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0xe6a865=>{this['on']('change:_isPendingUpdate',()=>{_0xe6a865();});});}async['_sendBufferedOperations'](){const _0x36729d=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x36729d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x336416=[...this['_bufferedOperations']];for(const _0x540daa of _0x336416)_0x540daa['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x540daa);const _0x124711=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x336416),_0x2e0cb1=K++,_0x322f61=this['_compressOperations'](_0x336416),_0x56bd84=await this['_service']['sendOperations'](_0x322f61,_0x322f61['baseVersion'],_0x124711);try{return await this['_handleServerResponse'](_0x336416,_0x56bd84,_0x2e0cb1);}catch(_0x1b8c56){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1b8c56);}}async['_handleServerResponse'](_0x23b4c0,_0x2de59d,_0x12f64e){if('error'in _0x2de59d)throw _0x2de59d['error'];let _0x40b960=!0x1;if(_0x2de59d['wereChangesApplied']){_0x2de59d['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2de59d['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x435f07=>!_0x23b4c0['includes'](_0x435f07));for(const _0x31d23b of _0x23b4c0)_0x31d23b['createdAt']='lastOperationAcceptedAt'in _0x2de59d&&_0x2de59d['lastOperationAcceptedAt']||void 0x0;Q(_0x23b4c0,_0x2de59d['version']-_0x23b4c0['length']),this['_updateServerHistory'](_0x23b4c0);const _0xabad6d=_0x23b4c0['filter'](_0x48a05d=>{if(!_0x48a05d['_isInit'])return!0x1;const _0x1669ab=this['_getAffectedRoot'](_0x48a05d);return _0x1669ab&&!this['_knownRootNames']['has'](_0x1669ab);});Q(_0xabad6d,this['_document']['version']),this['_applyOperationsSet'](_0xabad6d),_0x40b960=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3b040a=this['_decompressOperations'](_0x2de59d['data'],_0x2de59d['metadata'])['filter'](_0x4a6c83=>_0x4a6c83['baseVersion']>=this['_lastServerVersion']);_0x3b040a['forEach'](_0x3291c5=>this['_addKnownRoot'](_0x3291c5)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2fac4b=>!_0x2fac4b['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2fac4b))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3b040a),_0x40b960=this['_handleExternalOperations'](_0x3b040a,_0x2de59d['version'],_0x2de59d['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x40b960?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x456615,_0x5a787f,_0x4fcea7){try{const _0x49e7bd={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x16604c,operationsB:_0x2ccc73,originalOperations:_0x57b9d0}=_0x5b542c(_0x456615,this['_bufferedOperations'],_0x49e7bd);Q(_0x16604c,this['_document']['version']),Q(_0x2ccc73,_0x5a787f);for(const _0x4f643d of _0x16604c){const _0x9a45f7=_0x57b9d0['get'](_0x4f643d);_0x4f643d['_authorId']=_0x9a45f7?_0x9a45f7['_authorId']:null;}_0x4fcea7&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x456615,_0x4fcea7),this['_lastSyncedOperationId']=_0x4fcea7),this['_bufferedOperations']=[..._0x2ccc73],this['_applyOperationsSet'](_0x16604c),this['_updateServerHistory'](_0x456615);}catch(_0xbcacd9){return console['error'](_0xbcacd9),!0x1;}return!0x0;}['_applyOperationsSet'](_0x299302,_0x3c6218=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3b8410=>{for(const _0x38372f of _0x299302)this['_knownOperations']['add'](_0x38372f),this['_addKnownRoot'](_0x38372f),_0x3b8410['batch']['addOperation'](_0x38372f),this['editor']['model']['applyOperation'](_0x38372f);});}['_addKnownRoot'](_0x3116ad){const _0x1d4c0c=this['_getAffectedRoot'](_0x3116ad);_0x1d4c0c&&this['_knownRootNames']['add'](_0x1d4c0c);}['_getAffectedRoot'](_0x94d3f3){let _0x1fc4ee,_0x43635f;switch(_0x94d3f3['type']){case'insert':_0x1fc4ee=_0x94d3f3['position']['root'];break;case'marker':if(_0x43635f=_0x94d3f3['newRange'],!_0x43635f)return null;_0x1fc4ee=_0x43635f['root'];break;case'addRootAttribute':_0x1fc4ee=_0x94d3f3['root'];break;case'addRoot':_0x1fc4ee=_0x94d3f3['affectedSelectable'];break;case'move':_0x1fc4ee=_0x94d3f3['targetPosition']['root'];break;default:return null;}return _0x1fc4ee['rootName'];}['_updateServerHistory'](_0x348cc7){_0x348cc7['forEach'](_0x17cbf0=>{const _0x51c3b7=_0x17cbf0['clone']();_0x51c3b7['_authorId']=_0x17cbf0['_authorId'],_0x51c3b7['_isInit']=!!_0x17cbf0['_isInit'],_0x51c3b7['createdAt']=_0x17cbf0['createdAt'],_0x51c3b7['baseVersion']+=this['_offset'],_0x17cbf0['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x51c3b7),this['serverHistory']['addOperation'](_0x51c3b7);});}['_handleReconnectionError'](_0x2da0ee){const _0x3d1a92=this['editor']['plugins']['get']('Notification'),_0x1e4da9=this['editor']['locale'];_0x2da0ee||(_0x2da0ee=q(_0x1e4da9,'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.')),_0x3d1a92['showWarning'](_0x2da0ee,{'title':q(_0x1e4da9,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x315bd9)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x315bd9)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2d52ff){const _0x1e34c0=_0x2d52ff['map'](_0x473086=>_0x473086['toJSON']());return this['_compressor']['compress'](_0x1e34c0);}['_decompressOperations'](_0x28c03f,_0x8d577f){return this['_compressor']['decompress'](_0x28c03f)['map']((_0x367b02,_0x5187e0)=>{const _0x5c317c='init'==_0x8d577f[_0x5187e0]['type'];if('InsertOperation'==_0x367b02['__className']){const _0x5887a1=_0x367b02['position']['root'];!this['_document']['getRoot'](_0x5887a1)&&(this['_document']['createRoot']('$root',_0x5887a1)['_isAttached']=!0x1);}const _0x3775c6=_0x15a230['fromJSON'](_0x367b02,this['_document']);return _0x3775c6['wasUndone']=_0x367b02['wasUndone'],_0x3775c6['_isInit']=_0x5c317c,_0x3775c6['_authorId']=_0x5c317c?null:_0x8d577f[_0x5187e0]['userId'],_0x3775c6['_isDisconnection']='cs:removeUser'===_0x8d577f[_0x5187e0]['type'],_0x3775c6['createdAt']=_0x8d577f[_0x5187e0]['createdAt'],_0x3775c6;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x25e888=this['editor']['plugins']['get'](r)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x25e888&&_0x25e888['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x1eea2e,_0x54945e){for(const _0x27c885 of _0x1eea2e)_0x27c885['baseVersion']=_0x54945e++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x5c9c28){this['_ignoredOperations']=_0x5c9c28,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x18d932){let _0x4d7fc8=_0x18d932['length'];for(;_0x4d7fc8--;){const _0x3245ce=_0x18d932[_0x4d7fc8];if(!this['_ignoredOperations']['has'](_0x3245ce)){if(!this['_operationToId']['has'](_0x3245ce)){const _0x9c8c4b=_0x1f4103()['slice'](0x1,0x12);this['_operationToId']['set'](_0x3245ce,_0x9c8c4b);}return this['_operationToId']['get'](_0x3245ce);}}}['setIdForTheLastOperation'](_0x43d582,_0x68f34b){if(!_0x68f34b)return;let _0x453de8=_0x43d582['length'];for(;_0x453de8--;){const _0x131b01=_0x43d582[_0x453de8];this['_ignoredOperations']['has'](_0x131b01)||this['_operationToId']['set'](_0x131b01,_0x68f34b);}}}class n extends _0x2b8fdd{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}}class a extends _0x41fb54{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x4f788f)());['_services'];static get['requires'](){return[c,'CommentsRepository',r,_0x5b0702];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}constructor(_0x468382){super(_0x468382),this['_services']=new Map();}async['init'](){const _0x4cdecd=this['context'],_0x1d6a0f=_0x4cdecd['plugins']['get']('CommentsRepository');if(_0x4cdecd['plugins']['get'](c)['addToReconnectionStack'](this),_0x1d6a0f['adapter']={'addCommentThread':async({channelId:_0x588bc1,threadId:_0x337458,comments:_0x5edc9d,resolvedAt:_0x375f56,resolvedBy:_0x3f8b16,context:_0xee2a01,attributes:_0x37b526})=>{const _0x27c048=await this['_getService'](_0x588bc1)['addCommentThread']({'commentThreadId':_0x337458,'comments':_0x5edc9d['map'](_0x33eb7f=>function(_0x26c88a,_0x4f0c5c,_0x49ff09){return{'commentThreadId':_0x49ff09,'commentId':_0x26c88a['commentId'],'userId':_0x26c88a['authorId'],'content':_0x26c88a['content'],'documentId':_0x4f0c5c,'createdAt':_0x26c88a['createdAt'],'attributes':_0x26c88a['attributes']||{}};}(_0x33eb7f,_0x588bc1,_0x337458)),'resolvedAt':_0x375f56,'resolvedBy':_0x3f8b16,'context':_0xee2a01,'attributes':_0x37b526})['catch'](ut);return{'threadId':_0x27c048['commentThreadId'],'comments':_0x27c048['comments']};},'getCommentThread':async({channelId:_0x578786,threadId:_0xdb8edc})=>{const _0x488963=await this['_getService'](_0x578786)['getCommentThread'](_0xdb8edc)['catch'](ut);return _0x488963['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x488963]),{'threadId':_0x488963['commentThreadId'],'comments':_0x488963['comments']['map'](b),'context':_0x488963['context'],'resolvedAt':_0x488963['resolvedAt'],'resolvedBy':_0x488963['resolvedBy'],'attributes':_0x488963['attributes']||{}});},'updateCommentThread':async({channelId:_0x5d27c2,threadId:_0x434426,context:_0x211e0d,unlinkedAt:_0x3f595c,attributes:_0x2a511e})=>this['_getService'](_0x5d27c2)['updateCommentThread']({'commentThreadId':_0x434426,'context':_0x211e0d,'attributes':_0x2a511e,'unlinkedAt':_0x3f595c})['catch'](y)['catch'](ut),'resolveCommentThread':async({channelId:_0x29031f,threadId:_0x164bb9})=>{const _0x8f649a=await this['_getService'](_0x29031f)['resolveCommentThread'](_0x164bb9)['catch'](y)['catch'](ut);return{'threadId':_0x8f649a['commentThreadId'],'resolvedAt':_0x8f649a['resolvedAt'],'resolvedBy':_0x8f649a['resolvedBy']};},'reopenCommentThread':async({channelId:_0x582e8b,threadId:_0x3b795e})=>this['_getService'](_0x582e8b)['reopenCommentThread'](_0x3b795e)['catch'](y)['catch'](ut),'removeCommentThread':({channelId:_0x3d95fa,threadId:_0xb0274b})=>this['_getService'](_0x3d95fa)['removeCommentThread'](_0xb0274b)['catch'](y)['catch'](ut),'addComment':({channelId:_0xf5411d,threadId:_0x2d16c4,commentId:_0x409c9f,content:_0x5ac85b,attributes:_0x2e02db})=>this['_getService'](_0xf5411d)['addComment'](_0x2d16c4,_0x409c9f,_0x5ac85b,_0x2e02db)['catch'](ut),'updateComment':({channelId:_0x372368,threadId:_0x4a4b11,commentId:_0x591057,content:_0x53b66b,attributes:_0x4eb633})=>this['_getService'](_0x372368)['updateComment'](_0x4a4b11,_0x591057,_0x53b66b,_0x4eb633)['catch'](y)['catch'](ut),'removeComment':({channelId:_0xf6b7a8,threadId:_0x3f860b,commentId:_0x16c6e})=>this['_getService'](_0xf6b7a8)['removeComment'](_0x3f860b,_0x16c6e)['catch'](y)['catch'](ut)},_0x4cdecd instanceof _0x3c31ef){const _0x2c598e=_0x4cdecd['config']['get']('collaboration.channelId'),_0x1f27da=_0x4cdecd['plugins']['get'](r);await this['_setUpService'](_0x2c598e);const _0x2f2dbf=await this['_services']['get'](_0x2c598e)['getConnectedSessions']();this['listenTo'](_0x1f27da,'sessionAdd:'+_0x2c598e,(_0x274e2a,{session:_0x181d4c})=>{_0x181d4c['id']===_0x1f27da['mySessionId']&&(_0x274e2a['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x181d4c['permissions'],_0x2c598e));}),_0x1f27da['register'](_0x2c598e,_0x2f2dbf);}}async['_setUpService'](_0x180996){if(this['_services']['has'](_0x180996))throw new _0x3eb044('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x180996});const _0x5a691f=this['context']['plugins']['get']('CommentsRepository'),_0x537ec8=new a['CommentsService'](_0x180996);this['_services']['set'](_0x180996,_0x537ec8),this['listenTo'](_0x537ec8,'commentThreadAdded',(_0x1b8c7f,_0x4299cd)=>{const {commentThreadId:_0x172dfa,documentId:_0x522052,context:_0x2861b5,attributes:_0x3d16e7,resolvedAt:_0x11e77b,resolvedBy:_0xa2e27e,comments:_0x5cab11}=_0x4299cd;_0x5a691f['getCommentThread'](_0x172dfa)||_0x5a691f['addCommentThread']({'threadId':_0x172dfa,'channelId':_0x522052,'comments':_0x5cab11?_0x5cab11['map'](b):[],'context':_0x2861b5,'attributes':_0x3d16e7,'resolvedAt':_0x11e77b,'resolvedBy':_0xa2e27e,'isFromAdapter':!0x0});}),this['listenTo'](_0x537ec8,'commentThreadUpdated',(_0x1bdca2,{commentThreadId:_0x475788,documentId:_0x29495f,context:_0x2ba3d2,unlinkedAt:_0x2f3383,attributes:_0x8ea943})=>{_0x5a691f['getCommentThread'](_0x475788)&&_0x5a691f['updateCommentThread']({'threadId':_0x475788,'channelId':_0x29495f,'context':_0x2ba3d2,'unlinkedAt':_0x2f3383,'attributes':_0x8ea943,'isFromAdapter':!0x0});}),this['listenTo'](_0x537ec8,'commentThreadResolved',(_0x4790ae,{commentThreadId:_0xedd382,resolvedBy:_0x31fd27,resolvedAt:_0x5046ec})=>{const _0x476e34=_0x5a691f['getCommentThread'](_0xedd382);_0x476e34&&_0x476e34['resolve']({'resolvedBy':_0x31fd27,'resolvedAt':_0x5046ec,'isFromAdapter':!0x0});}),this['listenTo'](_0x537ec8,'commentThreadReopened',(_0x4778aa,{commentThreadId:_0x13e516})=>{const _0x54bb86=_0x5a691f['getCommentThread'](_0x13e516);_0x54bb86&&_0x54bb86['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x537ec8,'commentThreadRemoved',(_0x25b715,{commentThreadId:_0x3628af})=>{const _0x5e9980=_0x5a691f['getCommentThread'](_0x3628af);_0x5e9980&&_0x5e9980['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x537ec8,'commentAdded',(_0x3f21f0,_0x2718c8)=>{const _0xd8a671=_0x2718c8['commentThreadId'],_0x220c2f=_0x5a691f['getCommentThread'](_0xd8a671);_0x220c2f&&_0x220c2f['addComment']({...b(_0x2718c8),'isFromAdapter':!0x0});}),this['listenTo'](_0x537ec8,'commentUpdated',(_0x39188d,{commentThreadId:_0x1ddfb4,commentId:_0x2f9445,content:_0x5b013f,attributes:_0x36be1f})=>{const _0x78019a=_0x5a691f['getCommentThread'](_0x1ddfb4);if(_0x78019a){const _0x2839a9=_0x78019a['getComment'](_0x2f9445);_0x2839a9&&_0x2839a9['update']({'content':_0x5b013f,'attributes':_0x36be1f,'isFromAdapter':!0x0});}}),this['listenTo'](_0x537ec8,'commentRemoved',(_0x246805,{commentThreadId:_0x403c15,commentId:_0x1539b7})=>{const _0x203e76=_0x5a691f['getCommentThread'](_0x403c15);if(_0x203e76){const _0xeffe9c=_0x203e76['getComment'](_0x1539b7);_0xeffe9c&&_0xeffe9c['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x180996);}['destroy'](){if(this['context']instanceof _0x3c31ef){const _0x3a1784=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3a1784);}}['_terminateService'](_0x40718d){if(!this['_services']['has'](_0x40718d))throw new _0x3eb044('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x40718d});this['_getService'](_0x40718d)['disconnect'](),this['_services']['delete'](_0x40718d);}async['reconnect'](){for(const _0x178ccc of this['_services']['keys']())await this['_connectService'](_0x178ccc);if(this['context']instanceof _0x3c31ef){const _0x399cc3=this['context']['config']['get']('collaboration.channelId'),_0xbb27b6=this['context']['plugins']['get'](r);_0xbb27b6['unregister'](_0x399cc3);const _0x28f984=await this['_services']['get'](_0x399cc3)['getConnectedSessions']();_0xbb27b6['register'](_0x399cc3,_0x28f984);}}async['_connectService'](_0x4c62f8){const {connection:_0x1310bf}=this['context']['plugins']['get'](c),_0x331702=this['context']['plugins']['get']('CommentsRepository'),_0x245373=this['_services']['get'](_0x4c62f8),_0x4e613b=await _0x245373['connect'](_0x1310bf);await this['_fetchMissingUsersForThreads'](_0x4e613b);const _0x38cf6e=new Set(Array['from'](_0x331702['getCommentThreads']({'channelId':_0x4c62f8}),_0x8c23eb=>_0x8c23eb['id']));for(const _0x2cfb7a of _0x4e613b)_0x2cfb7a['deletedAt']||_0x38cf6e['delete'](_0x2cfb7a['commentThreadId']);for(const _0x2b3278 of _0x38cf6e)_0x331702['getCommentThread'](_0x2b3278)['remove']({'isFromAdapter':!0x0});for(const _0x4edbd9 of _0x4e613b){let _0x3420e3=_0x331702['getCommentThread'](_0x4edbd9['commentThreadId']);const {commentThreadId:_0x470bb2,context:_0xcbef39,attributes:_0x5cd50b,resolvedBy:_0x4bb408,resolvedAt:_0x18b5d3,unlinkedAt:_0x123cc2,deletedAt:_0xafee19}=_0x4edbd9;if(_0xafee19)continue;_0x3420e3||(_0x3420e3=_0x331702['addCommentThread']({'channelId':_0x4c62f8,'threadId':_0x470bb2,'context':_0xcbef39,'attributes':_0x5cd50b||{},'resolvedBy':_0x4bb408,'resolvedAt':_0x18b5d3,'unlinkedAt':_0x123cc2,'isFromAdapter':!0x0}));const _0x336c0a=new Set(Array['from'](_0x3420e3['comments'],_0x5d2f0c=>_0x5d2f0c['id']));for(const _0x3ebfd1 of _0x4edbd9['comments'])_0x336c0a['delete'](_0x3ebfd1['commentId']);for(const _0x41f0c5 of _0x336c0a)_0x3420e3['getComment'](_0x41f0c5)['remove']({'isFromAdapter':!0x0});for(const _0x24319b of _0x4edbd9['comments']){const _0x2d377e=_0x3420e3['getComment'](_0x24319b['commentId']);_0x2d377e?_0x2d377e['content']!==_0x24319b['content']&&_0x2d377e['update']({'content':_0x24319b['content'],'isFromAdapter':!0x0}):_0x3420e3['addComment'](Object['assign'](b(_0x24319b),{'isFromAdapter':!0x0}));}}}['_getService'](_0x574e83){if(!this['_services']['has'](_0x574e83))throw new _0x3eb044('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x574e83});return this['_services']['get'](_0x574e83);}async['_fetchMissingUsersForThreads'](_0x4d1907){const _0x5767e0=this['context']['plugins']['get'](_0x5b0702),{connection:_0xd94b7b}=this['context']['plugins']['get'](c),_0x1f088a=new Set();for(const {resolvedBy:_0x3915da,comments:_0x4cdffa}of _0x4d1907){_0x3915da&&!_0x5767e0['getUser'](_0x3915da)&&_0x1f088a['add'](_0x3915da);for(const {userId:_0x1b95c9}of _0x4cdffa)_0x5767e0['getUser'](_0x1b95c9)||_0x1f088a['add'](_0x1b95c9);}if(0x0===_0x1f088a['size'])return;const _0x219182=await lt['getMany'](_0xd94b7b,Array['from'](_0x1f088a));for(const _0x2d786e of _0x219182)_0x5767e0['getUser'](_0x2d786e['id'])||_0x5767e0['addUser'](_0x2d786e);}}async function y(_0xf5cac0){if('404'!==_0xf5cac0['code'])throw _0xf5cac0;}function ut(_0x117964){if((_0x2bd99b=_0x117964)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2bd99b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2bd99b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2bd99b;throw _0x117964;}function b(_0x1793f6){return{'threadId':_0x1793f6['commentThreadId'],'commentId':_0x1793f6['commentId'],'content':_0x1793f6['content'],'createdAt':_0x1793f6['createdAt'],'authorId':_0x1793f6['userId'],'attributes':_0x1793f6['attributes']||{}};}class g extends _0x2b8fdd{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(
|
|
28
|
-
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',r,_0x5b0702];}constructor(_0x17fc55){super(_0x17fc55);const _0x5b3c97=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new v['RevisionHistoryService'](_0x5b3c97);}async['init'](){const _0x29e1b8=this['editor']['plugins']['get'](l),_0x4f5884=_0x29e1b8['serverHistory'],_0x516882=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x4f5884,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x29e1b8['sessionId']});const _0x2a3638=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5728c7=await tt['isBundleUploaded'](_0x516882['connection'],_0x2a3638);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4cf8f9})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4cf8f9)),'updateRevisions':async _0x1c1f00=>{await this['_waitForServiceReady']();const _0x4c51f2=this['_revisionTracker']['currentRevision'];if(_0x5728c7&&0x1===_0x1c1f00['length']&&_0x1c1f00[0x0]['id']===_0x4c51f2['id'])return _0x1c1f00;for(const _0x1651fb of _0x1c1f00)_0x1651fb['id']===_0x4c51f2['id']&&(_0x1651fb['isEmptyCurrent']=_0x1651fb['fromVersion']===_0x1651fb['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x1c1f00,this['_lastRequestId'])['then'](_0x2704a0=>(this['_lastRequestId']=_0x2704a0,_0x1c1f00))['catch'](_0x4ba545=>{if(st(_0x4ba545)||'400'===_0x4ba545['code']&&void 0x0!==_0x4ba545['data']['wrongRequestId']){for(const _0xb8ef4c of _0x1c1f00){!this['_revisionTracker']['repository']['getRevision'](_0xb8ef4c['id'])||this['_revisionTracker']['_bufferUpdate'](_0xb8ef4c['id'],_0xb8ef4c,!0x1);}if(st(_0x4ba545))throw _0x4ba545;return _0x1c1f00;}throw _0x4ba545;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x19d5ac,{revisionsData:_0x2be4de,requestId:_0x5a19cf})=>{Math['max'](..._0x2be4de['map'](_0x4645e1=>_0x4645e1['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2be4de,_0x5a19cf);}):this['_handleRevisionsUpdate'](_0x2be4de,_0x5a19cf);});const {revisions:_0x162bfd,requestId:_0x131077}=await this['_revisionHistoryService']['connect'](_0x516882['connection']);_0x516882['addToReconnectionStack'](this),this['_lastRequestId']=_0x131077,await this['_fetchMissingUsers'](_0x162bfd);for(const _0x100e56 of _0x162bfd)this['_revisionTracker']['addRevisionData'](_0x100e56);this['listenTo'](_0x29e1b8,'change:_isConnected',(_0x4bd868,_0x1ba3ca,_0x2dff0a)=>{_0x2dff0a&&(this['_oldOffset']=_0x29e1b8['_offset'],_0x4bd868['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x516882,'state',_0x287c17=>_0x287c17===_0x597889['CONNECTED']);}async['reconnect'](){const _0x887b66=this['editor']['plugins']['get'](c),_0x4f301c=this['editor']['plugins']['get'](l),_0x1f9dc5=async()=>{const _0x38e6b5=this['_revisionTracker']['currentRevision'],_0xaa0f71=_0x38e6b5['id'],_0x2ff406=_0xaa0f71!==_0x4f301c['sessionId'];if(_0x2ff406){const _0x59b4df=_0x4f301c['_offset']-this['_oldOffset'],_0x1c9b9b=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x38e6b5['toVersion']+_0x59b4df!==_0x1c9b9b){const _0x1e4ae5=_0x38e6b5['fromVersion']+_0x59b4df,_0x617a3=this['editor']['plugins']['get'](_0x5b0702),_0x1fb3d2=this['_revisionTracker']['buildRevisionData']({'revision':_0x38e6b5,'from':_0x1e4ae5,'to':_0x1c9b9b});_0x1fb3d2['id']=_0x38e6b5['id'];const _0x7fcd49=_0x1fb3d2['authorsIds']['map'](_0x5b8de7=>_0x617a3['getUser'](_0x5b8de7));_0x38e6b5['_update']({..._0x1fb3d2,'authors':_0x7fcd49},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x38e6b5['id'],_0x1fb3d2,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1c9b9b,(_0x38e6b5['toVersion']===_0x38e6b5['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xaa0f71)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xaa0f71),this['_revisionTracker']['_createCurrentRevision'](_0x1c9b9b));}const {revisions:_0x3530c4,requestId:_0x2de425}=await this['_revisionHistoryService']['reconnect'](_0x887b66['connection'],this['_lastRequestId']);_0x2ff406&&_0x3530c4['length']>0x0?_0x4f301c['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3530c4),this['_handleRevisionsUpdate'](_0x3530c4,_0x2de425),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4f301c['_isConnected']?_0x1f9dc5():new Promise((_0x35082d,_0x350daf)=>{_0x4f301c['once']('change:_isConnected',()=>{_0x1f9dc5()['then'](_0x35082d)['catch'](_0x350daf);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4c53d4=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x32928f=>{_0x32928f['off'](),_0x4c53d4();});});}['_getLatestVersionFromServerOperations'](){const _0x278e6f=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x4dbc99 of _0x278e6f)if('marker'!==_0x4dbc99['type']||_0x4dbc99['affectsData'])return _0x4dbc99['baseVersion']+0x1;}['_getLatestVersion'](){const _0x2db0b3=this['editor']['plugins']['get'](l);return new Promise(_0x306dec=>{_0x2db0b3['_isPendingUpdate']?_0x2db0b3['once']('change:_isPendingUpdate',()=>{_0x306dec(this['_getLatestVersionFromServerOperations']());}):_0x306dec(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x1903a4,_0x36a3a2){const _0x78b560=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x36a3a2;for(const _0x334efb of _0x1903a4){const _0x3e882a=_0x78b560['getRevision'](_0x334efb['id']);if(_0x3e882a){if((_0x334efb['fromVersion']||_0x334efb['toVersion'])&&(_0x334efb['diffData']=null),_0x3e882a===this['_revisionTracker']['currentRevision']){const _0x52c1c0=Math['max'](_0x3e882a['toVersion'],_0x334efb['toVersion']),_0x5843c8=Math['max'](_0x3e882a['fromVersion'],_0x334efb['fromVersion']);let _0x4488c3;_0x3e882a['toVersion']===_0x334efb['toVersion']&&_0x3e882a['fromVersion']===_0x334efb['fromVersion']?(_0x4488c3=!0x0,this['_preventResendingRevisionData'](_0x334efb)):_0x334efb['toVersion']===_0x52c1c0&&_0x334efb['fromVersion']===_0x5843c8?_0x4488c3=!0x1:(_0x3e882a['toVersion']===_0x52c1c0&&_0x3e882a['fromVersion']===_0x5843c8||this['_fixRevision']({'revision':_0x3e882a,'from':_0x5843c8,'to':_0x52c1c0}),_0x4488c3=!0x0),_0x4488c3&&(delete _0x334efb['fromVersion'],delete _0x334efb['toVersion'],delete _0x334efb['diffData'],delete _0x334efb['createdAt'],delete _0x334efb['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x334efb),this['_preventResendingRevisionData'](_0x334efb);}else this['_revisionTracker']['addRevisionData'](_0x334efb);}const _0x456fc0=_0x78b560['getRevisions']();_0x456fc0['reverse']();for(let _0x271881=0x0;_0x271881<_0x456fc0['length']-0x1;_0x271881++){const _0x3cbb56=_0x456fc0[_0x271881],_0x56f255=_0x456fc0[_0x271881+0x1];if(_0x3cbb56['fromVersion']<_0x56f255['toVersion']){const _0x379f96=_0x56f255['toVersion'],_0x61d479=Math['max'](_0x379f96,_0x3cbb56['toVersion']);this['_fixRevision']({'revision':_0x3cbb56,'from':_0x379f96,'to':_0x61d479});}}}['_fixRevision']({revision:_0xf9b87b,from:_0x128921,to:_0x3927a2}={}){const _0x418a73=this['editor']['plugins']['get'](_0x5b0702),_0x31ef42=this['_revisionTracker']['buildRevisionData']({'revision':_0xf9b87b,'from':_0x128921,'to':_0x3927a2});_0x31ef42['authors']=_0x31ef42['authorsIds']['map'](_0x21b32e=>_0x418a73['getUser'](_0x21b32e)),_0xf9b87b['_update'](_0x31ef42);}['_preventResendingRevisionData'](_0x5281f9){const _0x2c466e={};_0x2c466e['id']=_0x5281f9['id'];for(const _0x1ae49f of Object['keys'](_0x5281f9))'id'!==_0x1ae49f&&(_0x2c466e[_0x1ae49f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2c466e['id'],_0x2c466e,!0x0);}async['_fetchMissingUsers'](_0x4b0b65){const _0x3bf8b3=this['editor']['plugins']['get'](_0x5b0702),{connection:_0xcc4b96}=this['editor']['plugins']['get'](c),_0x48cf31=new Set();for(const _0x49686b of _0x4b0b65){for(const _0x4a3cde of _0x49686b['authorsIds'])_0x21d9ab(_0x4a3cde);_0x49686b['creatorId']&&_0x21d9ab(_0x49686b['creatorId']);}if(0x0===_0x48cf31['size'])return;const _0x20fc6c=await lt['getMany'](_0xcc4b96,Array['from'](_0x48cf31));for(const _0x1250e3 of _0x20fc6c)_0x3bf8b3['getUser'](_0x1250e3['id'])||_0x3bf8b3['addUser'](_0x1250e3);function _0x21d9ab(_0x59c434){_0x3bf8b3['getUser'](_0x59c434)||_0x48cf31['add'](_0x59c434);}}}function st(_0x5a2ec4){return _0x5a2ec4['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5a2ec4['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5a2ec4['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class d extends _0x2b8fdd{static get['requires'](){return['RevisionHistory',v,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}}class ts extends _0x40503d{constructor(_0x395217){super(_0x395217);const _0x2c7bb2=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x2c7bb2['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x2c7bb2['to']('usersCount',_0x1b4fbe=>q(_0x395217,'CONNECTED_USERS',_0x1b4fbe))}]});}}class es extends _0x40503d{['items'];['keystrokes'];constructor(_0x59d6df){super(_0x59d6df);const _0x410e9e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2d785d(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x410e9e['if']('hasPopup'),'aria-expanded':_0x410e9e['to']('isExpanded',_0x4943a3=>this['hasPopup']&&String(_0x4943a3)),'aria-label':_0x410e9e['to']('hasPopup',_0x3b2f66=>q(_0x59d6df,_0x3b2f66?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x410e9e['to']('hasPopup',_0x33c359=>!!_0x33c359&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x410e9e['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x1228e3,_0x278443,_0x2afddd)=>{this['element']&&(_0x2afddd?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class _ extends _0x40503d{['counterView'];['inlineListView'];constructor(_0x3b0bba){super(_0x3b0bba);const _0x219745=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x3b0bba),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x55633c of this['inlineListView']['items'])_0x55633c['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',_0x219745['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class M extends _0x40503d{['listWrapperView'];constructor(_0x401b40,_0x5a6cd0){super(_0x401b40),this['listWrapperView']=new mt(_0x401b40,_0x5a6cd0),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x401b40,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x4c2bf3{constructor(_0xdef5fb,_0x577dd9){super(_0xdef5fb);const _0x31b5d6=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x577dd9?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x31b5d6['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x31b5d6['to']('role'),'aria-label':_0x31b5d6['to']('ariaLabel'),'aria-labelledby':_0x31b5d6['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x126da3['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x21e461=this['element'];_0x21e461&&(this['_isScrollable']=Math['max'](_0x21e461['scrollHeight'],_0x21e461['clientHeight'])>0.8*window['innerHeight']);}}class E extends rt{['userView'];constructor(_0x5ee867,_0x4cbe96,_0x2b0fd3){super(_0x5ee867);const _0x2b8414=this['bindTemplate'];this['userView']=new ct(_0x5ee867,_0x4cbe96);const _0x4bce18={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4cbe96['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4cbe96['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4cbe96['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2b0fd3&&(_0x4bce18['tag']='button',_0x4bce18['on']={'click':_0x2b8414['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4bce18);}['focus'](){this['element']['focus']();}}class T extends _0x40503d{['userView'];['markerView'];constructor(_0x2d19e1,_0x2f1852,_0x29c186){super(_0x2d19e1);const _0x4547c0=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x2d19e1,_0x2f1852),this['markerView']=new at(_0x2d19e1,_0x2f1852);const _0x4065f7=new ot(_0x2d19e1);_0x4065f7['template']['tag']='span',_0x4065f7['text']=_0x2f1852['name'];const _0x10876d={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x4547c0['to']('isFocusable',_0x41e21b=>!!_0x41e21b&&0x0),'aria-labelledby':_0x4065f7['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x4547c0['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x4547c0['to']('hasTooltip',_0x3403c=>!_0x3403c),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4065f7]};_0x29c186&&(_0x10876d['tag']='button',_0x10876d['on']={'click':_0x4547c0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x10876d);}}class at extends _0x40503d{constructor(_0x16030d,_0x2ba87b){super(_0x16030d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2ba87b['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const D={'collapseAt':0x6,'displayMe':!0x0};class s extends _0x41fb54{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x54c660){super(_0x54c660),this['context']['config']['define']('presenceList',D);const _0x1ff729=_0x54c660['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1ff729)throw new _0x3eb044('presencelist-collapseat-invalid-format',this);if(_0x1ff729<0x1)throw new _0x3eb044('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](r)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x332aca(),this['balloonPanelView']=new _0x1aa4ee(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[r];}['init'](){for(const _0x3a1c83 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3a1c83);this['listenTo'](this['_allConnectedUsers'],'add',(_0xe323d7,_0x434339)=>{this['_handleUserAdd'](_0x434339);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x59a200,_0x4e2a8a)=>{this['_handleUserRemove'](_0x4e2a8a);});}['_createView'](){const _0x431690=this['context'],_0x20bc36=new _(this['context']['locale']),_0x159b8f=this['balloonPanelView'];if(!_0x390e35(_0x431690['config']['get']('presenceList.container')))throw new _0x3eb044('presencelist-missing-container',this);return _0x20bc36['counterView']['bind']('usersCount')['to'](this),_0x20bc36['bind']('isCollapsed')['to'](this,'usersCount',_0x582c78=>{const {collapseAt:_0x5e2839,displayMe:_0x2aa30c}=_0x431690['config']['get']('presenceList'),_0x2f3f2e=_0x582c78>=_0x5e2839;return _0x20bc36['counterView']['isHidden']=!(0x1==_0x582c78&&_0x2aa30c||_0x2f3f2e),_0x2f3f2e||this['hideDropdown'](),_0x2f3f2e;}),_0x20bc36['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x52da2c=>{const _0x4d8205=_0x431690['config']['get']('presenceList'),_0x1ea9f3=new T(_0x431690['locale'],_0x52da2c,!!_0x4d8205['onClick']);return _0x1ea9f3['bind']('hasTooltip')['to'](_0x20bc36,'isCollapsed',_0x66dbaa=>!_0x66dbaa),_0x1ea9f3['bind']('isFocusable')['to'](_0x20bc36,'isCollapsed',_0x50c353=>!_0x50c353),_0x4d8205['onClick']&&this['listenTo'](_0x1ea9f3,'execute',()=>{this['view']['isCollapsed']||_0x4d8205['onClick'](_0x52da2c,_0x1ea9f3['element']);}),_0x1ea9f3;}),this['listenTo'](_0x20bc36['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x20bc36['inlineListView']['keystrokes']['set']('Enter',(_0x20f086,_0x143b58)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x143b58());}),_0x20bc36['render'](),_0x159b8f['render'](),_0x1f60fe({'emitter':_0x20bc36,'activator':()=>_0x159b8f['isVisible'],'contextElements':[_0x159b8f['element'],_0x20bc36['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x431690['config']['get']('presenceList.container')['appendChild'](_0x20bc36['element']),this['_bodyCollection']=new _0x2bca20(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x20bc36;}['_handleUserAdd'](_0x540441){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x540441['isMe'])return;const _0x30c097=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x30c097&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0xa7e2a8=_0x540441['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x540441,_0xa7e2a8);}['_handleUserRemove'](_0x6340bb){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x6340bb['id'])&&(this['currentDisplayedUsers']['remove'](_0x6340bb['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x107427 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x107427['id']))return void this['currentDisplayedUsers']['add'](_0x107427,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x534c23=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new M(this['context']['locale'],!!_0x534c23['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x328c56}=this['presenceDropdownView'];_0x328c56['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x34903b=>{if(!_0x534c23['displayMe']&&_0x34903b['isMe'])return null;const _0x1a4b74=new E(this['context']['locale'],_0x34903b,!!_0x534c23['onClick']);return _0x534c23['onClick']&&this['listenTo'](_0x1a4b74,'execute',()=>{_0x534c23['onClick'](_0x34903b,_0x1a4b74['element']);}),_0x1a4b74;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x328c56['focus'](),_0x328c56['checkIfScrollable']();const _0x37dfb0=(_0x426da3,_0x22e772)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x22e772();};_0x328c56['keystrokes']['set']('Esc',_0x37dfb0),_0x328c56['keystrokes']['set']('Shift+Tab',_0x37dfb0),_0x328c56['keystrokes']['set']('Tab',(_0xa9262b,_0x47d3d6)=>{!function(_0xda8027){const _0x10307f=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x23b06d=>_0x23b06d+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x54777b=[...document['body']['querySelectorAll'](_0x10307f)]['filter'](_0x1c3d3b=>_0x1c3d3b===document['activeElement']||_0x1c3d3b['offsetWidth']+_0x1c3d3b['offsetHeight']>0x0)['sort']((_0xce7c1,_0x33ccdb)=>(_0xce7c1['tabIndex']||0x0)-(_0x33ccdb['tabIndex']||0x0)),_0x568765=_0x54777b['indexOf'](_0xda8027),_0x510e52=_0x54777b[(_0x568765+0x1)%_0x54777b['length']];_0x510e52&&_0x510e52['focus']();}(this['view']['element']),this['hideDropdown'](),_0x47d3d6();}),_0x328c56['focusTracker']['add'](this['view']['element']),_0x328c56['focusTracker']['on']('change:isFocused',(_0x3f647b,_0x3923e4,_0x54b989)=>{_0x54b989||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class i extends _0x41fb54{static get['requires'](){return[r,s];}static get['pluginName'](){return'PresenceList';}}export{a as CloudServicesCommentsAdapter,v as CloudServicesRevisionHistoryAdapter,g as CloudServicesTrackChangesAdapter,i as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,d as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
|
|
23
|
+
import{ContextPlugin as _0x59636b,Plugin as _0x2e94c1,PendingActions as _0x49f0c8,Context as _0x50fc4a}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x194205,CKEditorError as _0x43ccf9,Collection as _0x5f4219,global as _0x520df5,version as nt,uid as _0x1cebbe,KeystrokeHandler as _0x34083d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1d8524,View as _0x5948f1,ListView as _0x3045df,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x26fbca,clickOutsideHandler as _0xb440bd,BodyCollection as _0x22a271}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x410eba,NoOperation as _0x131b5b,InsertOperation as _0x13ab53,MarkerOperation as _0x2d34ba,RootAttributeOperation as _0x444d18,transformSets as _0x3f2467,OperationFactory as _0x2c3492}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x128058,CollaborativeEditingService as _0x596db4,User as lt,CommentsService as _0x143257,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x28f53f,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x482cca}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x427ff9}from'lodash-es';class c extends _0x59636b{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1d8524];}static get['pluginName'](){return'WebSocketGateway';}constructor(_0x28d6c9){super(_0x28d6c9),this['set']('state',_0x128058['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x194205);}['init'](){const _0xf88d71=this['context'],_0x41d832=_0xf88d71['plugins']['get']('CloudServices'),_0x2055fb=_0xf88d71['plugins']['get'](_0x1d8524);if(!_0x41d832['token'])throw new _0x43ccf9('websocketgateway-missing-token',this);if(!_0x41d832['webSocketUrl'])throw new _0x43ccf9('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),c['WebSocketGateway']['connect'](_0x41d832['token'],_0x41d832['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x277c66=>{if(this['connection']=_0x277c66,this['bind']('state')['to'](_0x277c66,'state',this,'_isBrowserOffline',(_0x5678a9,_0x4c652e)=>('connected'!==_0x5678a9&&(this['_shouldPluginsReconnect']=!0x0),_0x4c652e||_0x5678a9!==_0x128058['CONNECTED']?_0x128058['DISCONNECTED']:this['state']==_0x128058['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x128058['CONNECTING']):_0x128058['CONNECTED'])),this['connection']['on']('error',(_0xdd03ed,_0x5cac66)=>{if('limitExceeded'!==_0x5cac66['code'])throw console['error'](_0x5cac66),new _0x43ccf9('cloudservices-init',null,{'originalError':_0x5cac66});_0x2055fb['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'});}),!_0x277c66['me'])return new Promise(_0xbd745c=>_0x277c66['on']('change:me',_0xbd745c));})['catch'](_0x4e4b2c=>{throw console['error'](_0x4e4b2c),new _0x43ccf9('cloudservices-init',null,{'originalError':_0x4e4b2c});});}['addToReconnectionStack'](_0x349112){if('function'!=typeof _0x349112['reconnect'])throw new _0x43ccf9('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x349112))throw new _0x43ccf9('websocketgateway-plugin-already-registered',this,{'name':_0x349112['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x349112);}['removeFromReconnectionStack'](_0xe0dbbb){this['_reconnectionStack']['delete'](_0xe0dbbb);}['isInReconnectionStack'](_0x57884a){return this['_reconnectionStack']['has'](_0x57884a);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x19d9c0=>_0x19d9c0['reconnect']())))['then'](()=>this['state']=_0x128058['CONNECTED'])['catch'](_0xade1a4=>{throw console['error'](_0xade1a4),new _0x43ccf9('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x128058['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class r extends _0x59636b{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['requires'](){return[c,_0x28f53f];}constructor(_0x1086b4){super(_0x1086b4),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5f4219(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x28f53f);}['init'](){const _0xf7574f=this['context']['plugins']['get'](c);this['listenTo'](_0xf7574f,'change:state',(_0x4533d3,_0x352a52,_0x1d124c)=>{if('connected'!==_0x1d124c)this['channelSessions']['forEach'](_0x53ff79=>_0x53ff79['clear']()),this['channelConnectedUsers']['forEach'](_0x35ff54=>_0x35ff54['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x18ccea,_0x594755]of this['_registeredSessions'])for(const _0x340c27 of _0x594755)this['_handleSessionAdd'](_0x18ccea,_0x340c27);}}),this['_createUser'](_0xf7574f['connection']['me'],!0x0);}['register'](_0x124675,_0x201830){if(this['_registeredSessions']['has'](_0x124675))throw new _0x43ccf9('sessions-register-already-registered',null,{'channelId':_0x124675});this['_registeredSessions']['set'](_0x124675,_0x201830),this['channelSessions']['set'](_0x124675,new _0x5f4219()),this['channelConnectedUsers']['set'](_0x124675,new _0x5f4219()),this['listenTo'](_0x201830,'add',(_0x51990a,_0x3d997e)=>this['_handleSessionAdd'](_0x124675,_0x3d997e)),this['listenTo'](_0x201830,'remove',(_0x54d550,_0x4cbb90)=>this['_handleSessionRemove'](_0x124675,_0x4cbb90));for(const _0x39ee5e of _0x201830)this['_handleSessionAdd'](_0x124675,_0x39ee5e);}['unregister'](_0x92dbf5){if(!this['_registeredSessions']['has'](_0x92dbf5))throw new _0x43ccf9('sessions-unregister-not-exist',null,{'channelId':_0x92dbf5});const _0x416e17=this['_registeredSessions']['get'](_0x92dbf5);this['stopListening'](_0x416e17);for(const _0x301dd6 of _0x416e17)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x92dbf5,_0x301dd6);this['_registeredSessions']['delete'](_0x92dbf5),this['channelSessions']['delete'](_0x92dbf5),this['channelConnectedUsers']['delete'](_0x92dbf5);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x37a5cb){for(const _0x3122e1 of this['channelSessions']['values']())for(const _0x48c7e2 of _0x3122e1)if(_0x48c7e2['id']===_0x37a5cb)return _0x48c7e2['user'];}['getUserSessions'](_0x5045db,_0x379281){const _0x41e5cb=_0x379281?[this['channelSessions']['get'](_0x379281)]:this['channelSessions']['values'](),_0x298d64=new Set();for(const _0x4f6112 of _0x41e5cb)for(const _0x1590da of _0x4f6112)_0x1590da['user']['id']===_0x5045db['id']&&_0x298d64['add'](_0x1590da['id']);return _0x298d64;}['getUserRole'](_0x12fe27){for(const _0x41d628 of this['channelSessions']['values']())for(const _0x594cf0 of _0x41d628)if(_0x594cf0['user']===_0x12fe27)return _0x594cf0['role'];}['_handleSessionAdd'](_0x4b0351,_0x2748a4){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x35da35=_0x2748a4['user'],_0x56ae71=this['_users']['getUser'](_0x35da35['id'])||this['_createUser'](_0x35da35),_0x23b21d=Object['assign']({},_0x2748a4,{'user':_0x56ae71});this['channelSessions']['get'](_0x4b0351)['add'](_0x23b21d);const _0x3b6869=this['channelConnectedUsers']['get'](_0x4b0351);_0x3b6869['has'](_0x56ae71['id'])||_0x3b6869['add'](_0x56ae71),this['allConnectedUsers']['has'](_0x56ae71['id'])||this['allConnectedUsers']['add'](_0x56ae71,_0x56ae71['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4b0351,{'channelId':_0x4b0351,'session':_0x23b21d});}['_handleSessionRemove'](_0x2fb28f,_0x1e530c){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x264cc3=this['channelConnectedUsers']['get'](_0x2fb28f),_0xa602f5=_0x1e530c['user'];_0xa602f5['id']&&(this['channelSessions']['get'](_0x2fb28f)['remove'](_0x1e530c['id']),_0x264cc3['has'](_0xa602f5['id'])&&!this['getUserSessions'](_0xa602f5,_0x2fb28f)['size']&&_0x264cc3['remove'](_0xa602f5['id']),this['allConnectedUsers']['get'](_0xa602f5['id'])&&!this['getUserSessions'](_0xa602f5)['size']&&this['allConnectedUsers']['remove'](_0xa602f5['id']));}['_createUser'](_0x379f0b,_0x34f2af){const _0x34dcb6=this['_users']['addUser'](_0x379f0b);return _0x34f2af&&this['_users']['defineMe'](_0x379f0b['id']),_0x34dcb6['orderNumber']=this['_uniqueUsersCount']++,_0x34dcb6;}}class H extends _0x2e94c1{['_domEmitter']=new(_0x194205())();static get['requires'](){return[r];}static get['pluginName'](){return'UserMarkers';}['init'](){const _0x1d9c3f=this['editor'],_0x5592ca=_0x1d9c3f['plugins']['get'](r);_0x1d9c3f['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5639b4,{writer:_0x27ac1e})=>function(_0xba7b1a,_0x13cdce,_0x175e20,_0x1565c0){const _0x546758=_0xba7b1a['markerName']['split'](':')[0x2],_0x2dc8d9=_0x175e20['getUserBySessionId'](_0x546758);if(!_0x2dc8d9||_0x546758===_0x175e20['mySessionId'])return;if(!_0x1565c0['model']['schema']['checkChild'](_0xba7b1a['markerRange']['start'],'$text'))return;const _0x339a73={'class':'ck-user__marker\x20'+_0x2dc8d9['color']['getMarkerClass'](),'data-name':_0x2dc8d9['name'],'data-session-id':_0x546758},_0xb6fb40=_0x1565c0['model']['markers']['get'](_0xba7b1a['markerName']),_0x35e3bd=_0xb6fb40['getStart'](),_0x273b1c=_0x35e3bd['nodeAfter'],_0x5cf950=_0x1565c0['model']['schema'];if(_0x273b1c&&_0x5cf950['isObject'](_0x273b1c)&&_0x5cf950['isInline'](_0x273b1c)&&!_0x1565c0['model']['markers']['get']('user:range:'+_0x546758)['getRange']()['isCollapsed'])return;const _0x568caa=_0x35e3bd['parent'];return _0x1565c0['model']['schema']['isLimit'](_0x568caa)&&!_0x1565c0['model']['hasContent'](_0x568caa)&&(_0x339a73['contenteditable']=!0x1),function(_0x40ba15,_0x226157,_0x4907a8){const _0x79a84d=_0x40ba15['createUIElement']('span',_0x226157);return _0x40ba15['setCustomProperty']('userPositionMarker',!0x0,_0x79a84d),_0x79a84d['render']=function(_0x5a4c3b){const _0x2aa406=this['toDomElement'](_0x5a4c3b);return _0x2aa406['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x4907a8['name']+'</span>',_0x2aa406['addEventListener']('mouseenter',()=>{_0x2aa406['classList']['add']('ck-user__marker_hovered');}),_0x2aa406['addEventListener']('mouseleave',()=>{_0x2aa406['classList']['remove']('ck-user__marker_hovered');}),_0x2aa406;},_0x79a84d['isSimilar']=function(_0x52ce78){return!(!this['getCustomProperty']('userPositionMarker')||!_0x52ce78['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x52ce78['getAttribute']('data-session-id'));},_0x79a84d;}(_0x13cdce,_0x339a73,_0x2dc8d9);}(_0x5639b4,_0x27ac1e,_0x5592ca,_0x1d9c3f)}),_0x1d9c3f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x420b32=>function(_0x314591,_0x327db2){const _0x56930b=_0x314591['markerName']['split'](':')[0x2];if(_0x56930b===_0x327db2['mySessionId'])return null;const _0x2a960f=_0x327db2['getUserBySessionId'](_0x56930b);if(!_0x2a960f)return{'id':_0x56930b,'classes':[]};return{'id':_0x56930b,'classes':['ck-user__selection',_0x2a960f['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x56930b},'priority':0x7d0+_0x2a960f['orderNumber']};}(_0x420b32,_0x5592ca)}),function(_0x17da05){const _0x58632b=_0x17da05['model'],_0x3fec59=new Map(),_0x1d6095=_0x17da05['plugins']['get'](r);_0x58632b['markers']['on']('update:user:range',(_0x124994,_0x55d1d0,_0x22bdff,_0x30c82e)=>{if(!_0x30c82e&&_0x3fec59['get'](_0x55d1d0['name']))return _0x3fec59['get'](_0x55d1d0['name'])['detach'](),void _0x3fec59['delete'](_0x55d1d0['name']);const _0x30a2f1=_0x55d1d0['name']['split'](':')[0x2];if(_0x30a2f1===_0x1d6095['mySessionId'])return;const _0x1457fc='user:position:'+_0x30a2f1;_0x58632b['markers']['has'](_0x1457fc)&&_0x17da05['editing']['reconvertMarker'](_0x1457fc),_0x55d1d0['on']('change:range',(_0x495042,_0xf8de03,_0x45d379)=>{if('$graveyard'!=_0xf8de03['root']['rootName']&&'$graveyard'==_0x55d1d0['getRange']()['root']['rootName']&&!_0x3fec59['has'](_0x55d1d0['name'])){const _0x3cdaa0=_0x58632b['schema']['getNearestSelectionRange'](_0x45d379['deletionPosition']);if(_0x3cdaa0){const _0x5b24f3=ht['fromRange'](_0x3cdaa0);_0x3fec59['set'](_0x55d1d0['name'],_0x5b24f3),_0x5b24f3['on']('change:range',(_0x1153ac,_0xecf781,_0xca6bdc)=>{if('$graveyard'==_0x5b24f3['root']['rootName']){const _0x1e2e9e=_0x58632b['schema']['getNearestSelectionRange'](_0xca6bdc['deletionPosition']);_0x1e2e9e?(_0x5b24f3['start']=_0x1e2e9e['start'],_0x5b24f3['end']=_0x1e2e9e['end']):(_0x3fec59['delete'](_0x55d1d0['name']),_0x5b24f3['detach']());}});}}});}),_0x58632b['document']['on']('change',()=>{_0x3fec59['size']>0x0&&_0x58632b['enqueueChange']({'isUndoable':!0x1},_0x2167e7=>{for(const [_0x5d5353,_0x1cc90e]of _0x3fec59)'$graveyard'==_0x58632b['markers']['get'](_0x5d5353)['getRange']()['root']['rootName']&&(re(_0x5d5353['split'](':')[0x2],_0x1cc90e['toRange'](),_0x58632b,_0x2167e7),_0x1cc90e['detach']());_0x3fec59['clear']();});});}(_0x1d9c3f),this['_domEmitter']['listenTo'](_0x520df5['document'],'keydown',(_0xa59f33,{key:_0x1816bf})=>{'Escape'===_0x1816bf&&function(_0x4081fc){_0x4081fc['editing']['view']['change'](_0x15d141=>{for(const _0x24fb66 of _0x4081fc['model']['markers']){if(!_0x24fb66['name']['startsWith']('user:position'))continue;const _0x239f43=_0x4081fc['editing']['mapper']['markerNameToElements'](_0x24fb66['name']);if(_0x239f43){for(const _0x366811 of _0x239f43)_0x15d141['removeClass']('ck-user__marker_hovered',_0x366811);}}});}(_0x1d9c3f);},{'useCapture':!0x0});}['afterInit'](){const _0x4ea5f3=this['editor'],_0x45e985=_0x4ea5f3['commands']['get']('undo');_0x45e985&&_0x4ea5f3['model']['on']('applyOperation',(_0xa85354,_0x217ce2)=>{const _0x3c72dd=_0x217ce2[0x0];if('marker'!=_0x3c72dd['type']||!_0x3c72dd['name']['startsWith']('user:'))return;const _0x36ec15=_0x3c72dd['batch'];_0x45e985['_createdBatches']['has'](_0x36ec15)&&(_0x3c72dd['newRange']=_0x3c72dd['oldRange']?_0x4ea5f3['model']['createRange'](_0x3c72dd['oldRange']['start'],_0x3c72dd['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x310042=this['editor'],_0x51a895=_0x310042['model']['document'],_0x42e7c3=_0x310042['plugins']['get'](r);_0x310042['model']['enqueueChange']({'isUndoable':!0x1},_0x3ba073=>{const _0x4e4c5e='user:range:'+_0x42e7c3['mySessionId'],_0x29b9fa='user:position:'+_0x42e7c3['mySessionId'],_0x1b7186=_0x310042['model']['markers']['has'](_0x4e4c5e);_0x310042['editing']['view']['hasDomSelection']?re(_0x42e7c3['mySessionId'],_0x51a895['selection']['getFirstRange'](),_0x310042['model'],_0x3ba073):_0x1b7186&&(_0x3ba073['removeMarker'](_0x4e4c5e),_0x3ba073['removeMarker'](_0x29b9fa));});}}function re(_0x4c5dfd,_0x1a4bb8,_0x5f4046,_0x1c7b12){const _0x16056f='user:range:'+_0x4c5dfd,_0x139610='user:position:'+_0x4c5dfd,_0x42b5cf=_0x1a4bb8['getContainedElement']();let _0x463f2e=_0x1a4bb8['start'];_0x42b5cf&&_0x42b5cf['is']('element','tableCell')&&(_0x463f2e=function(_0x5e1eaa,_0x5b6449){for(const _0x520868 of _0x5e1eaa['getPositions']())if(_0x5b6449['schema']['checkChild'](_0x520868,'$text'))return _0x520868;}(_0x1a4bb8,_0x5f4046),_0x1a4bb8=_0x1c7b12['createRange'](_0x463f2e));const _0x1d5ead=_0x1c7b12['createRange'](_0x463f2e);_0x5f4046['markers']['has'](_0x16056f)?(_0x1c7b12['updateMarker'](_0x16056f,{'range':_0x1a4bb8}),_0x1c7b12['updateMarker'](_0x139610,{'range':_0x1d5ead})):(_0x1c7b12['addMarker'](_0x16056f,{'range':_0x1a4bb8,'usingOperation':!0x0}),_0x1c7b12['addMarker'](_0x139610,{'range':_0x1d5ead,'usingOperation':!0x0}));}function q(_0x1235cd,_0x45598b,_0x556fa9){const t=_0x1235cd['t'];switch(_0x45598b){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 t({'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'},_0x556fa9);default:return'';}}let K=0x1;class l extends _0x2e94c1{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x596db4)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,r,H,_0x49f0c8,_0x28f53f,_0x1d8524];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x22ebdb=this['serverHistory']['getOperations']();for(let _0x24c2c0=_0x22ebdb['length']-0x1;_0x24c2c0>=0x0;_0x24c2c0--){const _0x306f5c=_0x22ebdb[_0x24c2c0];if(!this['_disconnectionOperations']['has'](_0x306f5c))return _0x306f5c['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1ee2b4){if(super(_0x1ee2b4),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x410eba(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x43ccf9('collaboration-missing-channelid',this);const _0x1bd131=_0x1ee2b4['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x1bd131,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x482cca(),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 X(this['_disconnectionOperations']);}['init'](){const _0x54abf9=this['editor'],_0x750152=_0x54abf9['plugins']['get'](_0x28f53f),_0x145d45=_0x54abf9['plugins']['get'](c);this['listenTo'](_0x750152,'getOperationAuthor',(_0x49bd85,_0x4cccbc)=>{const _0x5a240e=_0x4cccbc[0x0];_0x5a240e['_authorId']&&(_0x49bd85['return']=_0x750152['getUser'](_0x5a240e['_authorId']),_0x49bd85['stop']()),null===_0x5a240e['_authorId']&&(_0x49bd85['return']=null,_0x49bd85['stop']());},{'priority':'high'}),this['listenTo'](_0x54abf9['model']['document']['selection'],'change:range',(_0x3c1c99,_0x277085)=>{_0x277085['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x54abf9['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x54abf9['model']['on']('applyOperation',(_0x1d15fb,_0x609750)=>{const _0x180bc1=_0x609750[0x0];_0x180bc1['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x180bc1),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x145d45,'state',this,'_hasSynchronizationProblem',(_0x188149,_0x16a569)=>'connected'===_0x188149&&!_0x16a569),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x54abf9['disableReadOnlyMode']('rtc-offline'):_0x54abf9['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x54abf9['disableReadOnlyMode']('rtc-offline'):_0x54abf9['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x416975=this['editor']['plugins']['get'](r),_0x5af7a0=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x416975['unregister'](this['_channelId']);const _0x2dba51=await this['_service']['reconnect'](_0x5af7a0['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x2dba51)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2a4a27=await this['_service']['getConnectedSessions']();_0x416975['register'](this['_channelId'],_0x2a4a27),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x123023){if(function(_0x20fb33){return'404'===_0x20fb33['code'];}(_0x123023)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x37792c){return'409'===_0x37792c['code'];}(_0x123023)){const _0x44bfb4=q(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'](_0x44bfb4);}else{if(!(_0x123023 instanceof J))throw _0x123023;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1d7f44=this['editor']['plugins']['get'](c),_0x278426=this['editor']['plugins']['get'](r);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x278426['channelSessions']['has'](this['_channelId'])&&_0x278426['unregister'](this['_channelId']),_0x1d7f44['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x121fbf){if(this['sessionId']!==_0x121fbf['sessionId']&&this['_lastSyncedOperationId']!==_0x121fbf['lastOperationId'])throw new J();return this['sessionId']=_0x121fbf['sessionId'],this['_handleServerResponse']([],{..._0x121fbf,'wereChangesApplied':!0x1,'data':_0x121fbf['data']},'reconnect');}async['_connectService'](_0x25704e,_0x54f9b0=!0x1){const {connection:_0x3ac9af}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x3ac9af,this['_channelId'])['then'](_0x3a4200=>this['_initSessionsHandling'](_0x3a4200))['catch'](_0x4d9f78=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4d9f78);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x283f31,_0x314605)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x314605);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2e1d65=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x25704e);this['_isPendingUpdate']=!0x0;const _0x423c2d=await this['_service']['connect'](_0x3ac9af,this['_compressOperations'](_0x25704e),_0x2e1d65);if(this['sessionId']=_0x423c2d['sessionId'],_0x54f9b0){if(!_0x423c2d['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x423c2d['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x25704e,_0x423c2d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x423c2d,_0x25704e);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x500ac6=this['editor']['plugins']['get'](r),_0x308220=this['editor']['plugins']['get'](H),_0x260cca=_0x500ac6['channelSessions']['get'](this['_channelId']);_0x260cca&&_0x260cca['length']>0x1?_0x308220['createUserMarkerOperations']():this['listenTo'](_0x500ac6,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x500ac6['channelSessions']['get'](this['_channelId'])['length']&&_0x308220['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x5e3843,_0x4d40cb,_0x19bd36,_0x273452){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4d40cb){const _0x2b1317=this['_decompressOperations'](_0x19bd36,_0x273452);await this['_fetchMissingUsers'](_0x2b1317),this['_handleExternalOperations'](_0x2b1317,_0x4d40cb,_0x19bd36['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x4cc4a7}=this['editor'];let _0x19e6c0;try{_0x19e6c0=await this['_service']['getDocumentDetails']();}catch(_0x23e734){const _0x53d47c=q(_0x4cc4a7,'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'](_0x53d47c);}const _0x544834=_0x19e6c0['currentDocumentSession']||_0x19e6c0['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x544834['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x456ec5=q(_0x4cc4a7,'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.');this['_handleReconnectionError'](_0x456ec5);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x22cf76){const _0x587513=this['editor']['plugins']['get'](r);this['listenTo'](_0x587513,'sessionAdd:'+this['_channelId'],(_0x29f4c6,{session:_0x38af8a})=>{if(_0x38af8a['id']===_0x587513['mySessionId']){_0x29f4c6['off']();const _0x3cfc84=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x1c3694=_0x38af8a['permissions'];_0x3cfc84&&_0x3cfc84['isEnabled']&&(_0x1c3694=_0x1c3694['filter'](_0x3ab1eb=>'document:write'!==_0x3ab1eb)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x1c3694,this['_channelId']);}}),_0x587513['register'](this['_channelId'],_0x22cf76);}['_initThrowingOnDataSet'](){const _0x5292d0=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2cfcab)=>{if(!_0x2cfcab[_0x2cfcab['length']-0x1]['suppressErrorInCollaboration'])throw new _0x43ccf9('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5292d0['apply'](this['editor']['data'],_0x2cfcab);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xc419e8,[_0x533cee])=>{if(this['_document']['version'])throw new _0x43ccf9('realtimecollaborationclient-init-document-already-initialized',this);_0xc419e8['stop'](),this['_setPendingAction']();const _0xcce348=this['editor']['config']['get']('rootsAttributes'),_0x54a170=this['_getOperationsFromInitData'](_0x533cee,_0xcce348);0x0==_0x54a170['length']&&_0x54a170['push'](new _0x131b5b(0x0)),_0xc419e8['return']=this['_connectService'](_0x54a170)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2f770c=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2f770c))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x557667,[_0x250742,_0x2c10f8])=>{_0x557667['stop']();const _0x57ced9=this['editor']['model']['document']['getRoot'](_0x250742);if(!this['_knownRootNames']['has'](_0x250742)){const _0x5b55c1=_0x2c10f8&&_0x2c10f8['data']?_0x2c10f8['data']:'',_0x1980ba=_0x2c10f8&&_0x2c10f8['attributes']?_0x2c10f8['attributes']:{};await this['_loadRoot'](_0x250742,_0x5b55c1,_0x1980ba);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x57ced9['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x57ced9);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x442f09){const _0x5e61d7=this['editor']['plugins']['get'](_0x28f53f),{connection:_0x34b9b3}=this['editor']['plugins']['get'](c),_0x58b687=new Set();for(const _0x44a3dc of _0x442f09){const _0x3cbe30=_0x44a3dc['_authorId'];_0x3cbe30&&!_0x5e61d7['getUser'](_0x3cbe30)&&_0x58b687['add'](_0x3cbe30);}if(0x0===_0x58b687['size'])return;const _0x497272=await lt['getMany'](_0x34b9b3,Array['from'](_0x58b687));for(const _0x56f137 of _0x497272)_0x5e61d7['getUser'](_0x56f137['id'])||_0x5e61d7['addUser'](_0x56f137);}['_getOperationsFromInitData'](_0x33be5a,_0x500833={}){const _0x55c9e1=this['editor']['model'],_0x42f42a=[];let _0x45ef86=0x0;const _0x4712b0='string'==typeof _0x33be5a?{'main':_0x33be5a}:_0x33be5a;for(const _0x522f5a of Object['keys'](_0x4712b0)){if(!this['_document']['roots']['has'](_0x522f5a))throw new _0x43ccf9('realtimecollaborationclient-init-non-existent-root',this);const _0x54dd85=this['editor']['data']['parse'](_0x4712b0[_0x522f5a]),_0x24e4b4=this['_document']['getRoot'](_0x522f5a),_0x5aab15=new _0x13ab53(_0x55c9e1['createPositionAt'](_0x24e4b4,0x0),_0x54dd85,_0x45ef86++);_0x42f42a['push'](_0x5aab15);for(const [_0x37da9b,_0x161e3d]of _0x54dd85['markers']){const _0x45aef9=_0x55c9e1['createRange'](_0x55c9e1['createPositionFromPath'](_0x24e4b4,_0x161e3d['start']['path']['slice']()),_0x55c9e1['createPositionFromPath'](_0x24e4b4,_0x161e3d['end']['path']['slice']())),_0x328e01=new _0x2d34ba(_0x37da9b,null,_0x45aef9,_0x55c9e1['markers'],!0x0,_0x45ef86++);_0x42f42a['push'](_0x328e01);}}if(_0x500833)for(const [_0x1900f6,_0x440d0e]of Object['entries'](_0x500833)){const _0x16ee1a=_0x55c9e1['document']['getRoot'](_0x1900f6);if(!_0x16ee1a)throw new _0x43ccf9('multi-root-editor-root-attributes-no-root',null);for(const [_0x2df211,_0x1a314f]of Object['entries'](_0x440d0e))if(null!==_0x1a314f){const _0x484abf=new _0x444d18(_0x16ee1a,_0x2df211,null,_0x1a314f,_0x45ef86++);_0x42f42a['push'](_0x484abf);}}return _0x42f42a;}async['_loadRoot'](_0x1aa0ee,_0x26c69c,_0x5830cd){this['_getOperationsFromInitData']({[_0x1aa0ee]:_0x26c69c},{[_0x1aa0ee]:_0x5830cd})['forEach']((_0x4c1b20,_0x24e2b3)=>{_0x4c1b20['baseVersion']=this['_document']['version']+_0x24e2b3,_0x4c1b20['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x4c1b20);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x198880,_0x455567){let _0x42646f;this['_offset']=_0x198880['offset'];const _0x2a7bae=_0x198880['wereChangesApplied']&&!_0x198880['initData'],_0x43889c=_0x2a7bae?0x0:_0x198880['data']['baseVersion'];if(_0x455567['forEach'](_0x4d5452=>{_0x4d5452['_isInit']=!0x0,_0x4d5452['createdAt']=_0x198880['sessionCreatedAt'],_0x4d5452['_authorId']=null;}),_0x2a7bae)_0x42646f=_0x455567,this['_applyOperationsSet'](_0x42646f,_0x2a7bae);else{if(_0x198880['initData']){const _0x3f0a70=this['_getOperationsFromInitData'](_0x198880['initData']);this['_document']['history']['version']=-_0x3f0a70['length'],_0x3f0a70['forEach'](_0x3c93e0=>{_0x3c93e0['baseVersion']-=_0x3f0a70['length'],_0x3c93e0['createdAt']=_0x198880['sessionCreatedAt'],_0x3c93e0['_isInit']=!0x0,_0x3c93e0['_authorId']=null;}),this['_applyOperationsSet'](_0x3f0a70,!0x0),this['serverHistory']['version']=-_0x3f0a70['length']+this['_offset'],this['_updateServerHistory'](_0x3f0a70);}this['_document']['history']['version']=_0x43889c,_0x42646f=this['_decompressOperations'](_0x198880['data'],_0x198880['metadata']),await this['_fetchMissingUsers'](_0x42646f),this['_applyOperationsSet'](_0x42646f,_0x2a7bae);}_0x198880['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x42646f,_0x198880['lastOperationId']),this['_lastSyncedOperationId']=_0x198880['lastOperationId']),this['serverHistory']['version']=_0x43889c+this['_offset'],this['_updateServerHistory'](_0x42646f),_0x455567['filter'](_0x42c1cf=>{const _0x2b667a=this['_getAffectedRoot'](_0x42c1cf);return _0x2b667a&&!this['_knownRootNames']['has'](_0x2b667a);})['forEach']((_0x57fd2b,_0x3252b4)=>{_0x57fd2b['baseVersion']=this['_document']['version']+_0x3252b4,this['_saveOperationInBuffer'](_0x57fd2b);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4b673e,_0x3f4b4a){throw this['_isPendingUpdate']=!0x0,_0x3f4b4a&&console['error'](_0x3f4b4a),new _0x43ccf9(_0x4b673e,this['editor']);}['_saveOperationInBuffer'](_0x4713a0){this['_knownOperations']['has'](_0x4713a0)||(this['_knownOperations']['add'](_0x4713a0),this['_bufferedOperations']['push'](_0x4713a0),this['_pendingAction']||'marker'==_0x4713a0['type']&&!_0x4713a0['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x471e61=!0x1){!_0x471e61&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x467716=>{_0x467716&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x4927dc=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x5c1a61){return _0x5c1a61['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5c1a61['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5c1a61['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x4927dc))throw _0x4927dc;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x28adcf=>{this['on']('change:_isPendingUpdate',()=>{_0x28adcf();});});}async['_sendBufferedOperations'](){const _0x489774=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x489774['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3474fb=[...this['_bufferedOperations']];for(const _0x4d2f35 of _0x3474fb)_0x4d2f35['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4d2f35);const _0x171a4e=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3474fb),_0x282b42=K++,_0x579c18=this['_compressOperations'](_0x3474fb),_0xd9f0fe=await this['_service']['sendOperations'](_0x579c18,_0x579c18['baseVersion'],_0x171a4e);try{return await this['_handleServerResponse'](_0x3474fb,_0xd9f0fe,_0x282b42);}catch(_0x2fbf16){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2fbf16);}}async['_handleServerResponse'](_0x4177bd,_0x5a6e57,_0x53559d){if('error'in _0x5a6e57)throw _0x5a6e57['error'];let _0x19a973=!0x1;if(_0x5a6e57['wereChangesApplied']){_0x5a6e57['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5a6e57['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x32b91d=>!_0x4177bd['includes'](_0x32b91d));for(const _0x2a8374 of _0x4177bd)_0x2a8374['createdAt']='lastOperationAcceptedAt'in _0x5a6e57&&_0x5a6e57['lastOperationAcceptedAt']||void 0x0;Q(_0x4177bd,_0x5a6e57['version']-_0x4177bd['length']),this['_updateServerHistory'](_0x4177bd);const _0xf94783=_0x4177bd['filter'](_0x47eaad=>{if(!_0x47eaad['_isInit'])return!0x1;const _0x58250a=this['_getAffectedRoot'](_0x47eaad);return _0x58250a&&!this['_knownRootNames']['has'](_0x58250a);});Q(_0xf94783,this['_document']['version']),this['_applyOperationsSet'](_0xf94783),_0x19a973=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x35d7a8=this['_decompressOperations'](_0x5a6e57['data'],_0x5a6e57['metadata'])['filter'](_0x5b007b=>_0x5b007b['baseVersion']>=this['_lastServerVersion']);_0x35d7a8['forEach'](_0x54299b=>this['_addKnownRoot'](_0x54299b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xe2840f=>!_0xe2840f['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xe2840f))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x35d7a8),_0x19a973=this['_handleExternalOperations'](_0x35d7a8,_0x5a6e57['version'],_0x5a6e57['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x19a973?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x4b3639,_0x1fba21,_0x80d99f){try{const _0x3cfa59={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4012d1,operationsB:_0x999652,originalOperations:_0x2b8695}=_0x3f2467(_0x4b3639,this['_bufferedOperations'],_0x3cfa59);Q(_0x4012d1,this['_document']['version']),Q(_0x999652,_0x1fba21);for(const _0x38ed73 of _0x4012d1){const _0x2a242f=_0x2b8695['get'](_0x38ed73);_0x38ed73['_authorId']=_0x2a242f?_0x2a242f['_authorId']:null;}_0x80d99f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4b3639,_0x80d99f),this['_lastSyncedOperationId']=_0x80d99f),this['_bufferedOperations']=[..._0x999652],this['_applyOperationsSet'](_0x4012d1),this['_updateServerHistory'](_0x4b3639);}catch(_0x4778e2){return console['error'](_0x4778e2),!0x1;}return!0x0;}['_applyOperationsSet'](_0x28696e,_0x5c42a3=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x20efbe=>{for(const _0x359ab1 of _0x28696e)this['_knownOperations']['add'](_0x359ab1),this['_addKnownRoot'](_0x359ab1),_0x20efbe['batch']['addOperation'](_0x359ab1),this['editor']['model']['applyOperation'](_0x359ab1);});}['_addKnownRoot'](_0x42483b){const _0x197168=this['_getAffectedRoot'](_0x42483b);_0x197168&&this['_knownRootNames']['add'](_0x197168);}['_getAffectedRoot'](_0x10ecb5){let _0x3549de,_0xfdebb5;switch(_0x10ecb5['type']){case'insert':_0x3549de=_0x10ecb5['position']['root'];break;case'marker':if(_0xfdebb5=_0x10ecb5['newRange'],!_0xfdebb5)return null;_0x3549de=_0xfdebb5['root'];break;case'addRootAttribute':_0x3549de=_0x10ecb5['root'];break;case'addRoot':_0x3549de=_0x10ecb5['affectedSelectable'];break;case'move':_0x3549de=_0x10ecb5['targetPosition']['root'];break;default:return null;}return _0x3549de['rootName'];}['_updateServerHistory'](_0x3179b8){_0x3179b8['forEach'](_0x4b2db1=>{const _0x4b575e=_0x4b2db1['clone']();_0x4b575e['_authorId']=_0x4b2db1['_authorId'],_0x4b575e['_isInit']=!!_0x4b2db1['_isInit'],_0x4b575e['createdAt']=_0x4b2db1['createdAt'],_0x4b575e['baseVersion']+=this['_offset'],_0x4b2db1['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4b575e),this['serverHistory']['addOperation'](_0x4b575e);});}['_handleReconnectionError'](_0x34f360){const _0x534874=this['editor']['plugins']['get']('Notification'),_0x33cc2a=this['editor']['locale'];_0x34f360||(_0x34f360=q(_0x33cc2a,'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.')),_0x534874['showWarning'](_0x34f360,{'title':q(_0x33cc2a,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x49f0c8)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x49f0c8)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x50b103){const _0x9402e7=_0x50b103['map'](_0x57a88f=>_0x57a88f['toJSON']());return this['_compressor']['compress'](_0x9402e7);}['_decompressOperations'](_0x5dc68,_0x2497f4){return this['_compressor']['decompress'](_0x5dc68)['map']((_0x37c5eb,_0x1f91d5)=>{const _0x25c1bf='init'==_0x2497f4[_0x1f91d5]['type'];if('InsertOperation'==_0x37c5eb['__className']){const _0x31f256=_0x37c5eb['position']['root'];!this['_document']['getRoot'](_0x31f256)&&(this['_document']['createRoot']('$root',_0x31f256)['_isAttached']=!0x1);}const _0x3071f5=_0x2c3492['fromJSON'](_0x37c5eb,this['_document']);return _0x3071f5['wasUndone']=_0x37c5eb['wasUndone'],_0x3071f5['_isInit']=_0x25c1bf,_0x3071f5['_authorId']=_0x25c1bf?null:_0x2497f4[_0x1f91d5]['userId'],_0x3071f5['_isDisconnection']='cs:removeUser'===_0x2497f4[_0x1f91d5]['type'],_0x3071f5['createdAt']=_0x2497f4[_0x1f91d5]['createdAt'],_0x3071f5;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x638c8=this['editor']['plugins']['get'](r)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x638c8&&_0x638c8['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x1c9e32,_0x5e7259){for(const _0x2d0c88 of _0x1c9e32)_0x2d0c88['baseVersion']=_0x5e7259++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x40cf21){this['_ignoredOperations']=_0x40cf21,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4e9d66){let _0x10e927=_0x4e9d66['length'];for(;_0x10e927--;){const _0x553b95=_0x4e9d66[_0x10e927];if(!this['_ignoredOperations']['has'](_0x553b95)){if(!this['_operationToId']['has'](_0x553b95)){const _0x347ce3=_0x1cebbe()['slice'](0x1,0x12);this['_operationToId']['set'](_0x553b95,_0x347ce3);}return this['_operationToId']['get'](_0x553b95);}}}['setIdForTheLastOperation'](_0x361f45,_0x1bef96){if(!_0x1bef96)return;let _0x227e41=_0x361f45['length'];for(;_0x227e41--;){const _0x412e30=_0x361f45[_0x227e41];this['_ignoredOperations']['has'](_0x412e30)||this['_operationToId']['set'](_0x412e30,_0x1bef96);}}}class n extends _0x2e94c1{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}}class a extends _0x59636b{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x143257)());['_services'];static get['requires'](){return[c,'CommentsRepository',r,_0x28f53f];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}constructor(_0x2dbe8e){super(_0x2dbe8e),this['_services']=new Map();}async['init'](){const _0x1c91ed=this['context'],_0x155d2d=_0x1c91ed['plugins']['get']('CommentsRepository');if(_0x1c91ed['plugins']['get'](c)['addToReconnectionStack'](this),_0x155d2d['adapter']={'addCommentThread':async({channelId:_0x10033c,threadId:_0x2f6913,comments:_0x5ccc66,resolvedAt:_0x5f325a,resolvedBy:_0x3e2f48,context:_0x510000,attributes:_0x34bcee})=>{const _0x480393=await this['_getService'](_0x10033c)['addCommentThread']({'commentThreadId':_0x2f6913,'comments':_0x5ccc66['map'](_0x2c209d=>function(_0x1fa8ba,_0x56b5f4,_0x2cc76b){return{'commentThreadId':_0x2cc76b,'commentId':_0x1fa8ba['commentId'],'userId':_0x1fa8ba['authorId'],'content':_0x1fa8ba['content'],'documentId':_0x56b5f4,'createdAt':_0x1fa8ba['createdAt'],'attributes':_0x1fa8ba['attributes']||{}};}(_0x2c209d,_0x10033c,_0x2f6913)),'resolvedAt':_0x5f325a,'resolvedBy':_0x3e2f48,'context':_0x510000,'attributes':_0x34bcee})['catch'](ut);return{'threadId':_0x480393['commentThreadId'],'comments':_0x480393['comments']};},'getCommentThread':async({channelId:_0xb7d21c,threadId:_0x8d5845})=>{const _0x1595d7=await this['_getService'](_0xb7d21c)['getCommentThread'](_0x8d5845)['catch'](ut);return _0x1595d7['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1595d7]),{'threadId':_0x1595d7['commentThreadId'],'comments':_0x1595d7['comments']['map'](S),'context':_0x1595d7['context'],'resolvedAt':_0x1595d7['resolvedAt'],'resolvedBy':_0x1595d7['resolvedBy'],'attributes':_0x1595d7['attributes']||{}});},'updateCommentThread':async({channelId:_0x7c39b8,threadId:_0x16c138,context:_0x2bacfd,unlinkedAt:_0x540753,attributes:_0x853bb3})=>this['_getService'](_0x7c39b8)['updateCommentThread']({'commentThreadId':_0x16c138,'context':_0x2bacfd,'attributes':_0x853bb3,'unlinkedAt':_0x540753})['catch'](B)['catch'](ut),'resolveCommentThread':async({channelId:_0x8500c,threadId:_0x549c76})=>{const _0xca726a=await this['_getService'](_0x8500c)['resolveCommentThread'](_0x549c76)['catch'](B)['catch'](ut);return{'threadId':_0xca726a['commentThreadId'],'resolvedAt':_0xca726a['resolvedAt'],'resolvedBy':_0xca726a['resolvedBy']};},'reopenCommentThread':async({channelId:_0x27511d,threadId:_0x3361d8})=>this['_getService'](_0x27511d)['reopenCommentThread'](_0x3361d8)['catch'](B)['catch'](ut),'removeCommentThread':({channelId:_0x45afc9,threadId:_0x4c8d0d})=>this['_getService'](_0x45afc9)['removeCommentThread'](_0x4c8d0d)['catch'](B)['catch'](ut),'addComment':({channelId:_0xa834d2,threadId:_0xdc413d,commentId:_0x157dea,content:_0x20c5ea,attributes:_0x8483b9})=>this['_getService'](_0xa834d2)['addComment'](_0xdc413d,_0x157dea,_0x20c5ea,_0x8483b9)['catch'](ut),'updateComment':({channelId:_0x8be33f,threadId:_0x1358b8,commentId:_0x1b62a8,content:_0x1d51bd,attributes:_0xaca485})=>this['_getService'](_0x8be33f)['updateComment'](_0x1358b8,_0x1b62a8,_0x1d51bd,_0xaca485)['catch'](B)['catch'](ut),'removeComment':({channelId:_0x148ab4,threadId:_0x6173fb,commentId:_0x1c58e6})=>this['_getService'](_0x148ab4)['removeComment'](_0x6173fb,_0x1c58e6)['catch'](B)['catch'](ut)},_0x1c91ed instanceof _0x50fc4a){const _0x2c91f6=_0x1c91ed['config']['get']('collaboration.channelId'),_0x3c2745=_0x1c91ed['plugins']['get'](r);await this['_setUpService'](_0x2c91f6);const _0x2d4225=await this['_services']['get'](_0x2c91f6)['getConnectedSessions']();this['listenTo'](_0x3c2745,'sessionAdd:'+_0x2c91f6,(_0x347cda,{session:_0x3e4d88})=>{_0x3e4d88['id']===_0x3c2745['mySessionId']&&(_0x347cda['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3e4d88['permissions'],_0x2c91f6));}),_0x3c2745['register'](_0x2c91f6,_0x2d4225);}}async['_setUpService'](_0x31fe80){if(this['_services']['has'](_0x31fe80))throw new _0x43ccf9('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x31fe80});const _0x4f1ad4=this['context']['plugins']['get']('CommentsRepository'),_0x311d73=new a['CommentsService'](_0x31fe80);this['_services']['set'](_0x31fe80,_0x311d73),this['listenTo'](_0x311d73,'commentThreadAdded',(_0x1b9a14,_0x2836c4)=>{const {commentThreadId:_0x4278f,documentId:_0x1f9e6c,context:_0x3dfeb5,attributes:_0x1f58b3,resolvedAt:_0xf41a75,resolvedBy:_0x5d2c8d,comments:_0x34a65e}=_0x2836c4;_0x4f1ad4['getCommentThread'](_0x4278f)||_0x4f1ad4['addCommentThread']({'threadId':_0x4278f,'channelId':_0x1f9e6c,'comments':_0x34a65e?_0x34a65e['map'](S):[],'context':_0x3dfeb5,'attributes':_0x1f58b3,'resolvedAt':_0xf41a75,'resolvedBy':_0x5d2c8d,'isFromAdapter':!0x0});}),this['listenTo'](_0x311d73,'commentThreadUpdated',(_0x50db19,{commentThreadId:_0x5404ad,documentId:_0x4cb52a,context:_0x37fbb1,unlinkedAt:_0x444bea,attributes:_0x564d52})=>{_0x4f1ad4['getCommentThread'](_0x5404ad)&&_0x4f1ad4['updateCommentThread']({'threadId':_0x5404ad,'channelId':_0x4cb52a,'context':_0x37fbb1,'unlinkedAt':_0x444bea,'attributes':_0x564d52,'isFromAdapter':!0x0});}),this['listenTo'](_0x311d73,'commentThreadResolved',(_0x47a716,{commentThreadId:_0x1bfca7,resolvedBy:_0x4ad0df,resolvedAt:_0x478586})=>{const _0x30eff9=_0x4f1ad4['getCommentThread'](_0x1bfca7);_0x30eff9&&_0x30eff9['resolve']({'resolvedBy':_0x4ad0df,'resolvedAt':_0x478586,'isFromAdapter':!0x0});}),this['listenTo'](_0x311d73,'commentThreadReopened',(_0x282f6b,{commentThreadId:_0x327116})=>{const _0x4ec75b=_0x4f1ad4['getCommentThread'](_0x327116);_0x4ec75b&&_0x4ec75b['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x311d73,'commentThreadRemoved',(_0x51bd36,{commentThreadId:_0x27cab3})=>{const _0xeb5d1b=_0x4f1ad4['getCommentThread'](_0x27cab3);_0xeb5d1b&&_0xeb5d1b['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x311d73,'commentAdded',(_0x248e8e,_0x2f7cc2)=>{const _0x59210f=_0x2f7cc2['commentThreadId'],_0x407fab=_0x4f1ad4['getCommentThread'](_0x59210f);_0x407fab&&_0x407fab['addComment']({...S(_0x2f7cc2),'isFromAdapter':!0x0});}),this['listenTo'](_0x311d73,'commentUpdated',(_0x38ebea,{commentThreadId:_0x4dc34a,commentId:_0x5d64a8,content:_0x4bcd01,attributes:_0x5a7b33})=>{const _0xd4fac7=_0x4f1ad4['getCommentThread'](_0x4dc34a);if(_0xd4fac7){const _0x94b912=_0xd4fac7['getComment'](_0x5d64a8);_0x94b912&&_0x94b912['update']({'content':_0x4bcd01,'attributes':_0x5a7b33,'isFromAdapter':!0x0});}}),this['listenTo'](_0x311d73,'commentRemoved',(_0x2d013f,{commentThreadId:_0xe3aee8,commentId:_0x2620af})=>{const _0x365f00=_0x4f1ad4['getCommentThread'](_0xe3aee8);if(_0x365f00){const _0x47af21=_0x365f00['getComment'](_0x2620af);_0x47af21&&_0x47af21['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x31fe80);}['destroy'](){if(this['context']instanceof _0x50fc4a){const _0x58d2b9=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x58d2b9);}}['_terminateService'](_0x2aecee){if(!this['_services']['has'](_0x2aecee))throw new _0x43ccf9('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2aecee});this['_getService'](_0x2aecee)['disconnect'](),this['_services']['delete'](_0x2aecee);}async['reconnect'](){for(const _0x4e7507 of this['_services']['keys']())await this['_connectService'](_0x4e7507);if(this['context']instanceof _0x50fc4a){const _0x21e506=this['context']['config']['get']('collaboration.channelId'),_0x3d1b98=this['context']['plugins']['get'](r);_0x3d1b98['unregister'](_0x21e506);const _0x179756=await this['_services']['get'](_0x21e506)['getConnectedSessions']();_0x3d1b98['register'](_0x21e506,_0x179756);}}async['_connectService'](_0x40126d){const {connection:_0x4d817e}=this['context']['plugins']['get'](c),_0x29e19c=this['context']['plugins']['get']('CommentsRepository'),_0x888710=this['_services']['get'](_0x40126d),_0x5a7b52=await _0x888710['connect'](_0x4d817e);await this['_fetchMissingUsersForThreads'](_0x5a7b52);const _0x121c4a=new Set(Array['from'](_0x29e19c['getCommentThreads']({'channelId':_0x40126d}),_0x598fa9=>_0x598fa9['id']));for(const _0x394e46 of _0x5a7b52)_0x394e46['deletedAt']||_0x121c4a['delete'](_0x394e46['commentThreadId']);for(const _0x29b37a of _0x121c4a)_0x29e19c['getCommentThread'](_0x29b37a)['remove']({'isFromAdapter':!0x0});for(const _0x41040e of _0x5a7b52){let _0x369128=_0x29e19c['getCommentThread'](_0x41040e['commentThreadId']);const {commentThreadId:_0x2f4d1e,context:_0x227144,attributes:_0x5771f1,resolvedBy:_0x411a4a,resolvedAt:_0x8f1209,unlinkedAt:_0x93954d,deletedAt:_0xd0e46a}=_0x41040e;if(_0xd0e46a)continue;_0x369128||(_0x369128=_0x29e19c['addCommentThread']({'channelId':_0x40126d,'threadId':_0x2f4d1e,'context':_0x227144,'attributes':_0x5771f1||{},'resolvedBy':_0x411a4a,'resolvedAt':_0x8f1209,'unlinkedAt':_0x93954d,'isFromAdapter':!0x0}));const _0x1c52ef=new Set(Array['from'](_0x369128['comments'],_0xc3c857=>_0xc3c857['id']));for(const _0x1e8ddf of _0x41040e['comments'])_0x1c52ef['delete'](_0x1e8ddf['commentId']);for(const _0x21532e of _0x1c52ef)_0x369128['getComment'](_0x21532e)['remove']({'isFromAdapter':!0x0});for(const _0x344c1d of _0x41040e['comments']){const _0x4e878d=_0x369128['getComment'](_0x344c1d['commentId']);_0x4e878d?_0x4e878d['content']!==_0x344c1d['content']&&_0x4e878d['update']({'content':_0x344c1d['content'],'isFromAdapter':!0x0}):_0x369128['addComment'](Object['assign'](S(_0x344c1d),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5af26b){if(!this['_services']['has'](_0x5af26b))throw new _0x43ccf9('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5af26b});return this['_services']['get'](_0x5af26b);}async['_fetchMissingUsersForThreads'](_0x3129b4){const _0x4a8c60=this['context']['plugins']['get'](_0x28f53f),{connection:_0x4b400b}=this['context']['plugins']['get'](c),_0x38f473=new Set();for(const {resolvedBy:_0x2eb523,comments:_0x49e958}of _0x3129b4){_0x2eb523&&!_0x4a8c60['getUser'](_0x2eb523)&&_0x38f473['add'](_0x2eb523);for(const {userId:_0x223481}of _0x49e958)_0x4a8c60['getUser'](_0x223481)||_0x38f473['add'](_0x223481);}if(0x0===_0x38f473['size'])return;const _0x28222a=await lt['getMany'](_0x4b400b,Array['from'](_0x38f473));for(const _0x3b36c1 of _0x28222a)_0x4a8c60['getUser'](_0x3b36c1['id'])||_0x4a8c60['addUser'](_0x3b36c1);}}async function B(_0x3a3439){if('404'!==_0x3a3439['code'])throw _0x3a3439;}function ut(_0x257c2b){if((_0x32c517=_0x257c2b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x32c517['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x32c517['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x32c517;throw _0x257c2b;}function S(_0x3e01c8){return{'threadId':_0x3e01c8['commentThreadId'],'commentId':_0x3e01c8['commentId'],'content':_0x3e01c8['content'],'createdAt':_0x3e01c8['createdAt'],'authorId':_0x3e01c8['userId'],'attributes':_0x3e01c8['attributes']||{}};}class g extends _0x2e94c1{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(_0x228f96){super(_0x228f96);const _0x1759c8=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new g['TrackChangesService'](_0x1759c8);}['init'](){const _0x1956e6=this['editor']['plugins']['get'](c),_0x3afdff=this['editor']['plugins']['get']('TrackChangesEditing');return _0x3afdff['adapter']={'getSuggestion':async _0x780a4b=>{await this['_waitForServiceReady']();const _0x7ee96d=await this['_trackChangesService']['get'](_0x780a4b)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x7ee96d]),_0x7ee96d;},'addSuggestion':async({id:_0x31490e,type:_0xe885e3,data:_0x2831c1,originalSuggestionId:_0x12ff05,attributes:_0x29a85d})=>{await this['_waitForServiceReady']();const _0x5617c7={'id':_0x31490e,'type':_0xe885e3,'data':_0x2831c1,'originalSuggestionId':_0x12ff05,'attributes':_0x29a85d},_0xe63cf1=await this['_trackChangesService']['add'](_0x31490e,_0xe885e3,_0x2831c1,_0x12ff05,_0x29a85d)['catch'](_0x914da6=>{if(ft(_0x914da6))return new Promise(_0x2a8a6e=>{this['_bufferedRequests']['set'](_0x31490e,{'resolve':_0x2a8a6e,'suggestionData':_0x5617c7});});throw _0x914da6;});return this['_bufferedRequests']['delete'](_0x31490e),_0xe63cf1;},'updateSuggestion':async(_0x5aadea,_0x21fab6)=>{if(await this['_waitForServiceReady'](),'open'!==_0x21fab6['state'])return this['_trackChangesService']['update'](_0x5aadea,_0x21fab6)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2cbc61,_0x220299)=>{_0x3afdff['hasSuggestion'](_0x220299['id'])&&(_0x3afdff['getSuggestion'](_0x220299['id'])['attributes']=_0x220299['attributes']);}),this['_trackChangesService']['connect'](_0x1956e6['connection'])['then'](_0x4e7ab7=>(_0x1956e6['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x4e7ab7)['then'](()=>{for(const _0x494f49 of _0x4e7ab7){_0x3afdff['addSuggestionData'](_0x494f49)['_saved']=!0x0;}})));}async['reconnect'](){const _0x2f75ae=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x47e3d9}=this['editor']['plugins']['get'](c),_0x4370c3=await this['_trackChangesService']['connect'](_0x47e3d9);await this['_fetchMissingUsersForThreads'](_0x4370c3);for(const {suggestionData:_0x39d480,resolve:_0x5922ab}of this['_bufferedRequests']['values']()){let _0x5f4702=_0x4370c3['find'](_0x5bffae=>_0x5bffae['id']===_0x39d480['id']);_0x5f4702||(_0x5f4702=await this['_trackChangesService']['add'](_0x39d480['id'],_0x39d480['type'],_0x39d480['data'],_0x39d480['originalSuggestionId'])),_0x5922ab(_0x5f4702);}for(const _0x7e0cfd of _0x4370c3)_0x2f75ae['hasSuggestion'](_0x7e0cfd['id'])||_0x2f75ae['addSuggestionData'](_0x7e0cfd);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x51735e=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2fc9f9=>{_0x2fc9f9['off'](),_0x51735e();});});}async['_fetchMissingUsersForThreads'](_0x372507){const _0x7e0dc2=this['editor']['plugins']['get'](_0x28f53f),{connection:_0x2986a2}=this['editor']['plugins']['get'](c),_0x232401=new Set();for(const {authorId:_0x179ba4}of _0x372507)_0x7e0dc2['getUser'](_0x179ba4)||_0x232401['add'](_0x179ba4);if(0x0===_0x232401['size'])return;const _0x10750e=await lt['getMany'](_0x2986a2,Array['from'](_0x232401));for(const _0x4271f1 of _0x10750e)_0x7e0dc2['getUser'](_0x4271f1['id'])||_0x7e0dc2['addUser'](_0x4271f1);}}function R(_0x3fdbc5){if(ft(_0x3fdbc5))return new Promise(()=>{});throw _0x3fdbc5;}function ft(_0x1963f3){return _0x1963f3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1963f3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x2e94c1{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}['init'](){const _0x406b1c=this['editor']['plugins']['get'](c),_0x4854d0=this['editor']['plugins']['get']('CommentsEditing'),_0x122bed=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x406b1c,'change:state',(_0x1fa73e,_0x31e194,_0x230520)=>{_0x4854d0['isThreadsLoadingPaused']='connected'!==_0x230520;});}),this['listenTo'](_0x406b1c,'change:state',(_0x47af08,_0x4df504,_0x23dbd8)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x23dbd8);}),_0x122bed['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x2e94c1{static get['requires'](){return[m,g,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}}class v extends _0x2e94c1{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',r,_0x28f53f];}constructor(_0xcbc274){super(_0xcbc274);const _0x459508=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new v['RevisionHistoryService'](_0x459508);}async['init'](){const _0x410166=this['editor']['plugins']['get'](l),_0x3c9f2c=_0x410166['serverHistory'],_0x39f01b=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x3c9f2c,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x410166['sessionId']});const _0x40ce03=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x296b38=await tt['isBundleUploaded'](_0x39f01b['connection'],_0x40ce03);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4cecef})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4cecef)),'updateRevisions':async _0x4f0253=>{await this['_waitForServiceReady']();const _0x1027d9=this['_revisionTracker']['currentRevision'];if(_0x296b38&&0x1===_0x4f0253['length']&&_0x4f0253[0x0]['id']===_0x1027d9['id'])return _0x4f0253;for(const _0x2a47c4 of _0x4f0253)_0x2a47c4['id']===_0x1027d9['id']&&(_0x2a47c4['isEmptyCurrent']=_0x2a47c4['fromVersion']===_0x2a47c4['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4f0253,this['_lastRequestId'])['then'](_0x2763da=>(this['_lastRequestId']=_0x2763da,_0x4f0253))['catch'](_0x1f624d=>{if(st(_0x1f624d)||'400'===_0x1f624d['code']&&void 0x0!==_0x1f624d['data']['wrongRequestId']){for(const _0x4d52cc of _0x4f0253){!this['_revisionTracker']['repository']['getRevision'](_0x4d52cc['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4d52cc['id'],_0x4d52cc,!0x1);}if(st(_0x1f624d))throw _0x1f624d;return _0x4f0253;}throw _0x1f624d;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x484e65,{revisionsData:_0x345235,requestId:_0x330749})=>{Math['max'](..._0x345235['map'](_0x2e3bbc=>_0x2e3bbc['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x345235,_0x330749);}):this['_handleRevisionsUpdate'](_0x345235,_0x330749);});const {revisions:_0x5cbb49,requestId:_0x4c007b}=await this['_revisionHistoryService']['connect'](_0x39f01b['connection']);_0x39f01b['addToReconnectionStack'](this),this['_lastRequestId']=_0x4c007b,await this['_fetchMissingUsers'](_0x5cbb49);for(const _0x569712 of _0x5cbb49)this['_revisionTracker']['addRevisionData'](_0x569712);this['listenTo'](_0x410166,'change:_isConnected',(_0x5c47fe,_0x5decda,_0xda635c)=>{_0xda635c&&(this['_oldOffset']=_0x410166['_offset'],_0x5c47fe['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x39f01b,'state',_0x70bb35=>_0x70bb35===_0x128058['CONNECTED']);}async['reconnect'](){const _0x3650e=this['editor']['plugins']['get'](c),_0x508d77=this['editor']['plugins']['get'](l),_0x590ef8=async()=>{const _0x43e999=this['_revisionTracker']['currentRevision'],_0x5da8f9=_0x43e999['id'],_0x2d6b38=_0x5da8f9!==_0x508d77['sessionId'];if(_0x2d6b38){const _0x12b747=_0x508d77['_offset']-this['_oldOffset'],_0x2b48f7=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x43e999['toVersion']+_0x12b747!==_0x2b48f7){const _0x4c6737=_0x43e999['fromVersion']+_0x12b747,_0x697683=this['editor']['plugins']['get'](_0x28f53f),_0x28bf96=this['_revisionTracker']['buildRevisionData']({'revision':_0x43e999,'from':_0x4c6737,'to':_0x2b48f7});_0x28bf96['id']=_0x43e999['id'];const _0x5abb90=_0x28bf96['authorsIds']['map'](_0x5bfb25=>_0x697683['getUser'](_0x5bfb25));_0x43e999['_update']({..._0x28bf96,'authors':_0x5abb90},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x43e999['id'],_0x28bf96,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2b48f7,(_0x43e999['toVersion']===_0x43e999['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5da8f9)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5da8f9),this['_revisionTracker']['_createCurrentRevision'](_0x2b48f7));}const {revisions:_0x14f0ea,requestId:_0x529491}=await this['_revisionHistoryService']['reconnect'](_0x3650e['connection'],this['_lastRequestId']);_0x2d6b38&&_0x14f0ea['length']>0x0?_0x508d77['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x14f0ea),this['_handleRevisionsUpdate'](_0x14f0ea,_0x529491),this['_revisionTracker']['sendBufferedUpdates']());};return _0x508d77['_isConnected']?_0x590ef8():new Promise((_0x29d23c,_0x2b666c)=>{_0x508d77['once']('change:_isConnected',()=>{_0x590ef8()['then'](_0x29d23c)['catch'](_0x2b666c);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4767bf=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x2384d0=>{_0x2384d0['off'](),_0x4767bf();});});}['_getLatestVersionFromServerOperations'](){const _0x4b40fe=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3bced9 of _0x4b40fe)if('marker'!==_0x3bced9['type']||_0x3bced9['affectsData'])return _0x3bced9['baseVersion']+0x1;}['_getLatestVersion'](){const _0x27ea1c=this['editor']['plugins']['get'](l);return new Promise(_0x97d7c6=>{_0x27ea1c['_isPendingUpdate']?_0x27ea1c['once']('change:_isPendingUpdate',()=>{_0x97d7c6(this['_getLatestVersionFromServerOperations']());}):_0x97d7c6(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x2d564a,_0x1f7bff){const _0x20ab40=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x1f7bff;for(const _0x2a8e45 of _0x2d564a){const _0x2be751=_0x20ab40['getRevision'](_0x2a8e45['id']);if(_0x2be751){if((_0x2a8e45['fromVersion']||_0x2a8e45['toVersion'])&&(_0x2a8e45['diffData']=null),_0x2be751===this['_revisionTracker']['currentRevision']){const _0x5af2e8=Math['max'](_0x2be751['toVersion'],_0x2a8e45['toVersion']),_0x5e40f2=Math['max'](_0x2be751['fromVersion'],_0x2a8e45['fromVersion']);let _0x58f288;_0x2be751['toVersion']===_0x2a8e45['toVersion']&&_0x2be751['fromVersion']===_0x2a8e45['fromVersion']?(_0x58f288=!0x0,this['_preventResendingRevisionData'](_0x2a8e45)):_0x2a8e45['toVersion']===_0x5af2e8&&_0x2a8e45['fromVersion']===_0x5e40f2?_0x58f288=!0x1:(_0x2be751['toVersion']===_0x5af2e8&&_0x2be751['fromVersion']===_0x5e40f2||this['_fixRevision']({'revision':_0x2be751,'from':_0x5e40f2,'to':_0x5af2e8}),_0x58f288=!0x0),_0x58f288&&(delete _0x2a8e45['fromVersion'],delete _0x2a8e45['toVersion'],delete _0x2a8e45['diffData'],delete _0x2a8e45['createdAt'],delete _0x2a8e45['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2a8e45),this['_preventResendingRevisionData'](_0x2a8e45);}else this['_revisionTracker']['addRevisionData'](_0x2a8e45);}const _0x18aad8=_0x20ab40['getRevisions']();_0x18aad8['reverse']();for(let _0x2a0ef4=0x0;_0x2a0ef4<_0x18aad8['length']-0x1;_0x2a0ef4++){const _0x45c9d6=_0x18aad8[_0x2a0ef4],_0x28f3fd=_0x18aad8[_0x2a0ef4+0x1];if(_0x45c9d6['fromVersion']<_0x28f3fd['toVersion']){const _0x259e30=_0x28f3fd['toVersion'],_0x5d0946=Math['max'](_0x259e30,_0x45c9d6['toVersion']);this['_fixRevision']({'revision':_0x45c9d6,'from':_0x259e30,'to':_0x5d0946});}}}['_fixRevision']({revision:_0x282c88,from:_0x290fb0,to:_0x551b89}={}){const _0xc1cb1a=this['editor']['plugins']['get'](_0x28f53f),_0x3a618c=this['_revisionTracker']['buildRevisionData']({'revision':_0x282c88,'from':_0x290fb0,'to':_0x551b89});_0x3a618c['authors']=_0x3a618c['authorsIds']['map'](_0x5b3197=>_0xc1cb1a['getUser'](_0x5b3197)),_0x282c88['_update'](_0x3a618c);}['_preventResendingRevisionData'](_0x16de03){const _0x419af9={};_0x419af9['id']=_0x16de03['id'];for(const _0x528d40 of Object['keys'](_0x16de03))'id'!==_0x528d40&&(_0x419af9[_0x528d40]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x419af9['id'],_0x419af9,!0x0);}async['_fetchMissingUsers'](_0x1b982a){const _0x4cb764=this['editor']['plugins']['get'](_0x28f53f),{connection:_0x42a515}=this['editor']['plugins']['get'](c),_0x5744eb=new Set();for(const _0x14e359 of _0x1b982a){for(const _0x44c939 of _0x14e359['authorsIds'])_0x43bd7d(_0x44c939);_0x14e359['creatorId']&&_0x43bd7d(_0x14e359['creatorId']);}if(0x0===_0x5744eb['size'])return;const _0x247afb=await lt['getMany'](_0x42a515,Array['from'](_0x5744eb));for(const _0x8f7400 of _0x247afb)_0x4cb764['getUser'](_0x8f7400['id'])||_0x4cb764['addUser'](_0x8f7400);function _0x43bd7d(_0x3450bb){_0x4cb764['getUser'](_0x3450bb)||_0x5744eb['add'](_0x3450bb);}}}function st(_0x1320f8){return _0x1320f8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1320f8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1320f8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class d extends _0x2e94c1{static get['requires'](){return['RevisionHistory',v,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}}class ts extends _0x5948f1{constructor(_0x410309){super(_0x410309);const _0x11d2c0=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x11d2c0['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x11d2c0['to']('usersCount',_0x582e16=>q(_0x410309,'CONNECTED_USERS',_0x582e16))}]});}}class es extends _0x5948f1{['items'];['keystrokes'];constructor(_0x547f42){super(_0x547f42);const _0x5c2657=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x34083d(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5c2657['if']('hasPopup'),'aria-expanded':_0x5c2657['to']('isExpanded',_0x388e64=>this['hasPopup']&&String(_0x388e64)),'aria-label':_0x5c2657['to']('hasPopup',_0x3de654=>q(_0x547f42,_0x3de654?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5c2657['to']('hasPopup',_0x565db5=>!!_0x565db5&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x5c2657['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x1f68ab,_0x566e63,_0x22e3e9)=>{this['element']&&(_0x22e3e9?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class L extends _0x5948f1{['counterView'];['inlineListView'];constructor(_0x377b27){super(_0x377b27);const _0x2c88a1=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x377b27),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3cc3bb of this['inlineListView']['items'])_0x3cc3bb['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',_0x2c88a1['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x5948f1{['listWrapperView'];constructor(_0x593dd7,_0x11344d){super(_0x593dd7),this['listWrapperView']=new mt(_0x593dd7,_0x11344d),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x593dd7,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x3045df{constructor(_0x19d937,_0x1d528f){super(_0x19d937);const _0x102fa7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x1d528f?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x102fa7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x102fa7['to']('role'),'aria-label':_0x102fa7['to']('ariaLabel'),'aria-labelledby':_0x102fa7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x520df5['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x59731d=this['element'];_0x59731d&&(this['_isScrollable']=Math['max'](_0x59731d['scrollHeight'],_0x59731d['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x2686c4,_0x410cbc,_0x3c1bab){super(_0x2686c4);const _0x3708e6=this['bindTemplate'];this['userView']=new ct(_0x2686c4,_0x410cbc);const _0x30aaf2={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x410cbc['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x410cbc['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x410cbc['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x3c1bab&&(_0x30aaf2['tag']='button',_0x30aaf2['on']={'click':_0x3708e6['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x30aaf2);}['focus'](){this['element']['focus']();}}class y extends _0x5948f1{['userView'];['markerView'];constructor(_0x15aa55,_0x6a0ca9,_0x5758d1){super(_0x15aa55);const _0x32b4e4=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x15aa55,_0x6a0ca9),this['markerView']=new at(_0x15aa55,_0x6a0ca9);const _0x491c1f=new ot(_0x15aa55);_0x491c1f['template']['tag']='span',_0x491c1f['text']=_0x6a0ca9['name'];const _0x1f19a8={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x32b4e4['to']('isFocusable',_0x29f829=>!!_0x29f829&&0x0),'aria-labelledby':_0x491c1f['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x32b4e4['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x32b4e4['to']('hasTooltip',_0xb961c0=>!_0xb961c0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x491c1f]};_0x5758d1&&(_0x1f19a8['tag']='button',_0x1f19a8['on']={'click':_0x32b4e4['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1f19a8);}}class at extends _0x5948f1{constructor(_0x5187be,_0x37e103){super(_0x5187be),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x37e103['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class s extends _0x59636b{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x4b0fe7){super(_0x4b0fe7),this['context']['config']['define']('presenceList',A);const _0x1658b6=_0x4b0fe7['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1658b6)throw new _0x43ccf9('presencelist-collapseat-invalid-format',this);if(_0x1658b6<0x1)throw new _0x43ccf9('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](r)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5f4219(),this['balloonPanelView']=new _0x26fbca(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[r];}['init'](){for(const _0x38df31 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x38df31);this['listenTo'](this['_allConnectedUsers'],'add',(_0x3430e1,_0x9b9710)=>{this['_handleUserAdd'](_0x9b9710);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x28b9c8,_0x279d43)=>{this['_handleUserRemove'](_0x279d43);});}['_createView'](){const _0x38f201=this['context'],_0x48b84e=new L(this['context']['locale']),_0x197801=this['balloonPanelView'];if(!_0x427ff9(_0x38f201['config']['get']('presenceList.container')))throw new _0x43ccf9('presencelist-missing-container',this);return _0x48b84e['counterView']['bind']('usersCount')['to'](this),_0x48b84e['bind']('isCollapsed')['to'](this,'usersCount',_0x485e10=>{const {collapseAt:_0x33ed3f,displayMe:_0x338fe5}=_0x38f201['config']['get']('presenceList'),_0xc2e053=_0x485e10>=_0x33ed3f;return _0x48b84e['counterView']['isHidden']=!(0x1==_0x485e10&&_0x338fe5||_0xc2e053),_0xc2e053||this['hideDropdown'](),_0xc2e053;}),_0x48b84e['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x34e2c7=>{const _0x4aed57=_0x38f201['config']['get']('presenceList'),_0x52b4c3=new y(_0x38f201['locale'],_0x34e2c7,!!_0x4aed57['onClick']);return _0x52b4c3['bind']('hasTooltip')['to'](_0x48b84e,'isCollapsed',_0x373145=>!_0x373145),_0x52b4c3['bind']('isFocusable')['to'](_0x48b84e,'isCollapsed',_0x294676=>!_0x294676),_0x4aed57['onClick']&&this['listenTo'](_0x52b4c3,'execute',()=>{this['view']['isCollapsed']||_0x4aed57['onClick'](_0x34e2c7,_0x52b4c3['element']);}),_0x52b4c3;}),this['listenTo'](_0x48b84e['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x48b84e['inlineListView']['keystrokes']['set']('Enter',(_0x25deb8,_0x2795e8)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2795e8());}),_0x48b84e['render'](),_0x197801['render'](),_0xb440bd({'emitter':_0x48b84e,'activator':()=>_0x197801['isVisible'],'contextElements':[_0x197801['element'],_0x48b84e['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x38f201['config']['get']('presenceList.container')['appendChild'](_0x48b84e['element']),this['_bodyCollection']=new _0x22a271(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x48b84e;}['_handleUserAdd'](_0x2a3c31){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2a3c31['isMe'])return;const _0x42982a=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x42982a&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x445c92=_0x2a3c31['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2a3c31,_0x445c92);}['_handleUserRemove'](_0x5d8e76){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x5d8e76['id'])&&(this['currentDisplayedUsers']['remove'](_0x5d8e76['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x22ec9f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x22ec9f['id']))return void this['currentDisplayedUsers']['add'](_0x22ec9f,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x47694e=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x47694e['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x404d8b}=this['presenceDropdownView'];_0x404d8b['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x2e8133=>{if(!_0x47694e['displayMe']&&_0x2e8133['isMe'])return null;const _0x325229=new k(this['context']['locale'],_0x2e8133,!!_0x47694e['onClick']);return _0x47694e['onClick']&&this['listenTo'](_0x325229,'execute',()=>{_0x47694e['onClick'](_0x2e8133,_0x325229['element']);}),_0x325229;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x404d8b['focus'](),_0x404d8b['checkIfScrollable']();const _0x2ec0d8=(_0x22e2eb,_0x516013)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x516013();};_0x404d8b['keystrokes']['set']('Esc',_0x2ec0d8),_0x404d8b['keystrokes']['set']('Shift+Tab',_0x2ec0d8),_0x404d8b['keystrokes']['set']('Tab',(_0x17ec76,_0x3aefdb)=>{!function(_0xf8de19){const _0x21ead3=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x18ac0b=>_0x18ac0b+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xb99222=[...document['body']['querySelectorAll'](_0x21ead3)]['filter'](_0x130908=>_0x130908===document['activeElement']||_0x130908['offsetWidth']+_0x130908['offsetHeight']>0x0)['sort']((_0x3ab8c3,_0x37c973)=>(_0x3ab8c3['tabIndex']||0x0)-(_0x37c973['tabIndex']||0x0)),_0x9553ff=_0xb99222['indexOf'](_0xf8de19),_0x1e92f2=_0xb99222[(_0x9553ff+0x1)%_0xb99222['length']];_0x1e92f2&&_0x1e92f2['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3aefdb();}),_0x404d8b['focusTracker']['add'](this['view']['element']),_0x404d8b['focusTracker']['on']('change:isFocused',(_0x484a50,_0x1151e7,_0x437892)=>{_0x437892||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class i extends _0x59636b{static get['requires'](){return[r,s];}static get['pluginName'](){return'PresenceList';}}export{a as CloudServicesCommentsAdapter,v as CloudServicesRevisionHistoryAdapter,g as CloudServicesTrackChangesAdapter,i as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,d as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
|
package/dist/translations/ar.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'ar':{'dictionary':{'CONNECTED_USERS':['1\x20مستخدم\x20متصل\x20(أنا)','%0\x20مستخدم\x20متصل','%0\x20مستخدم\x20متصل','%0\x20مستخدمين\x20متصلين','%0\x20مستخدماً\x20متصلاً','%0\x20مستخدمٍ\x20متصلٍ'],'PENDING_ACTION_SENDING_DATA':'إرسال\x20البيانات\x20إلى\x20الخادم','Synchronization\x20issue':'مشكلة\x20في\x20المزامنة','Connected\x20users\x20list\x20dropdown\x20menu':'القائمة\x20المنسدلة\x20لقائمة\x20المستخدمين\x20المتصلين','Connected\x20users\x20list':'قائمة\x20المستخدمين\x20المتصلين','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'قائمة\x20مطوية\x20للمستخدمين\x20المتصلين\x20(اضغط\x20على\x20ENTER\x20لفتحها)','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'لا\x20يمكن\x20إعادة\x20ربط\x20المستند\x20بالخادم\x20مرة\x20أخرى.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'تعذرت\x20عملية\x20قراءة\x20بيانات\x20المستند\x20أثناء\x20عملية\x20إعادة\x20الاتصال.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','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.':'الإصدار\x20الأخير\x20المحفوظ\x20من\x20هذا\x20المستند\x20لا\x20يطابق\x20الإصدار\x20المحلي.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','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.':'يوجد\x20اختلاف\x20بين\x20المستند\x20المحلي\x20والمستند\x20الموجود\x20على\x20الخادم،\x20ودمجهما\x20قد\x20يتسبب\x20في\x20نتائج\x20غير\x20متوقعة.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.'},'getPluralForm':
|
|
23
|
+
export default{'ar':{'dictionary':{'CONNECTED_USERS':['1\x20مستخدم\x20متصل\x20(أنا)','%0\x20مستخدم\x20متصل','%0\x20مستخدم\x20متصل','%0\x20مستخدمين\x20متصلين','%0\x20مستخدماً\x20متصلاً','%0\x20مستخدمٍ\x20متصلٍ'],'PENDING_ACTION_SENDING_DATA':'إرسال\x20البيانات\x20إلى\x20الخادم','Synchronization\x20issue':'مشكلة\x20في\x20المزامنة','Connected\x20users\x20list\x20dropdown\x20menu':'القائمة\x20المنسدلة\x20لقائمة\x20المستخدمين\x20المتصلين','Connected\x20users\x20list':'قائمة\x20المستخدمين\x20المتصلين','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'قائمة\x20مطوية\x20للمستخدمين\x20المتصلين\x20(اضغط\x20على\x20ENTER\x20لفتحها)','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'لا\x20يمكن\x20إعادة\x20ربط\x20المستند\x20بالخادم\x20مرة\x20أخرى.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'تعذرت\x20عملية\x20قراءة\x20بيانات\x20المستند\x20أثناء\x20عملية\x20إعادة\x20الاتصال.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','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.':'الإصدار\x20الأخير\x20المحفوظ\x20من\x20هذا\x20المستند\x20لا\x20يطابق\x20الإصدار\x20المحلي.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','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.':'يوجد\x20اختلاف\x20بين\x20المستند\x20المحلي\x20والمستند\x20الموجود\x20على\x20الخادم،\x20ودمجهما\x20قد\x20يتسبب\x20في\x20نتائج\x20غير\x20متوقعة.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.'},'getPluralForm':_0x291be8=>0x0==_0x291be8?0x0:0x1==_0x291be8?0x1:0x2==_0x291be8?0x2:_0x291be8%0x64>=0x3&&_0x291be8%0x64<=0xa?0x3:_0x291be8%0x64>=0xb&&_0x291be8%0x64<=0x63?0x4:0x5}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x1dda2b=>{const {ar:{dictionary:_0x2175d1,getPluralForm:_0x4de748}}={'ar':{'dictionary':{'CONNECTED_USERS':['1\x20مستخدم\x20متصل\x20(أنا)','%0\x20مستخدم\x20متصل','%0\x20مستخدم\x20متصل','%0\x20مستخدمين\x20متصلين','%0\x20مستخدماً\x20متصلاً','%0\x20مستخدمٍ\x20متصلٍ'],'PENDING_ACTION_SENDING_DATA':'إرسال\x20البيانات\x20إلى\x20الخادم','Synchronization\x20issue':'مشكلة\x20في\x20المزامنة','Connected\x20users\x20list\x20dropdown\x20menu':'القائمة\x20المنسدلة\x20لقائمة\x20المستخدمين\x20المتصلين','Connected\x20users\x20list':'قائمة\x20المستخدمين\x20المتصلين','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'قائمة\x20مطوية\x20للمستخدمين\x20المتصلين\x20(اضغط\x20على\x20ENTER\x20لفتحها)','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'لا\x20يمكن\x20إعادة\x20ربط\x20المستند\x20بالخادم\x20مرة\x20أخرى.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'تعذرت\x20عملية\x20قراءة\x20بيانات\x20المستند\x20أثناء\x20عملية\x20إعادة\x20الاتصال.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','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.':'الإصدار\x20الأخير\x20المحفوظ\x20من\x20هذا\x20المستند\x20لا\x20يطابق\x20الإصدار\x20المحلي.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.','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.':'يوجد\x20اختلاف\x20بين\x20المستند\x20المحلي\x20والمستند\x20الموجود\x20على\x20الخادم،\x20ودمجهما\x20قد\x20يتسبب\x20في\x20نتائج\x20غير\x20متوقعة.\x20كي\x20لا\x20تفقد\x20المحتوى،\x20احفظ\x20المستند\x20محلياً\x20وأجر\x20عملية\x20إنعاش\x20للمحرر\x20لديك.'},'getPluralForm':_0x302861=>0x0==_0x302861?0x0:0x1==_0x302861?0x1:0x2==_0x302861?0x2:_0x302861%0x64>=0x3&&_0x302861%0x64<=0xa?0x3:_0x302861%0x64>=0xb&&_0x302861%0x64<=0x63?0x4:0x5}};_0x1dda2b['ar']||={'dictionary':{},'getPluralForm':null},_0x1dda2b['ar']['dictionary']=Object['assign'](_0x1dda2b['ar']['dictionary'],_0x2175d1),_0x1dda2b['ar']['getPluralForm']=_0x4de748;})(window['CKEDITOR_TRANSLATIONS']||={});
|