@ckeditor/ckeditor5-real-time-collaboration 43.2.0-alpha.1 → 43.2.0-alpha.3
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
|
-
((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x43f411];}static get['pluginName'](){return'WebSocketGateway';}constructor(_0x97f354){super(_0x97f354),this['set']('state',_0x49bf8d['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x3dd186);}['init'](){const _0x197210=this['context'],_0x5f57cd=_0x197210['plugins']['get']('CloudServices'),_0x21d5ea=_0x197210['plugins']['get'](_0x43f411);if(!_0x5f57cd['token'])throw new _0x331448('websocketgateway-missing-token',this);if(!_0x5f57cd['webSocketUrl'])throw new _0x331448('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'](_0x5f57cd['token'],_0x5f57cd['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xe00207=>{if(this['connection']=_0xe00207,this['bind']('state')['to'](_0xe00207,'state',this,'_isBrowserOffline',(_0x149c82,_0x59a778)=>('connected'!==_0x149c82&&(this['_shouldPluginsReconnect']=!0x0),_0x59a778||_0x149c82!==_0x49bf8d['CONNECTED']?_0x49bf8d['DISCONNECTED']:this['state']==_0x49bf8d['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x49bf8d['CONNECTING']):_0x49bf8d['CONNECTED'])),this['connection']['on']('error',(_0xb9aacc,_0xa7a7e6)=>{if('limitExceeded'!==_0xa7a7e6['code'])throw console['error'](_0xa7a7e6),new _0x331448('cloudservices-init',null,{'originalError':_0xa7a7e6});_0x21d5ea['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'});}),!_0xe00207['me'])return new Promise(_0x5e651e=>_0xe00207['on']('change:me',_0x5e651e));})['catch'](_0x32396e=>{throw console['error'](_0x32396e),new _0x331448('cloudservices-init',null,{'originalError':_0x32396e});});}['addToReconnectionStack'](_0x31d2fb){if('function'!=typeof _0x31d2fb['reconnect'])throw new _0x331448('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x31d2fb))throw new _0x331448('websocketgateway-plugin-already-registered',this,{'name':_0x31d2fb['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x31d2fb);}['removeFromReconnectionStack'](_0x41b635){this['_reconnectionStack']['delete'](_0x41b635);}['isInReconnectionStack'](_0x316953){return this['_reconnectionStack']['has'](_0x316953);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0xbb71ce=>_0xbb71ce['reconnect']())))['then'](()=>this['state']=_0x49bf8d['CONNECTED'])['catch'](_0x4801d9=>{throw console['error'](_0x4801d9),new _0x331448('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x49bf8d['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class r extends _0x54552e{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['requires'](){return[c,_0x11d8ec];}constructor(_0xb2bac){super(_0xb2bac),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1ef5f7(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x11d8ec);}['init'](){const _0x83a2ac=this['context']['plugins']['get'](c);this['listenTo'](_0x83a2ac,'change:state',(_0x76369b,_0x1cc4ef,_0x1164c4)=>{if('connected'!==_0x1164c4)this['channelSessions']['forEach'](_0x2d2515=>_0x2d2515['clear']()),this['channelConnectedUsers']['forEach'](_0x4baab2=>_0x4baab2['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2a7749,_0x2bb3c0]of this['_registeredSessions'])for(const _0x1e645e of _0x2bb3c0)this['_handleSessionAdd'](_0x2a7749,_0x1e645e);}}),this['_createUser'](_0x83a2ac['connection']['me'],!0x0);}['register'](_0x5f3f7b,_0x3d9468){if(this['_registeredSessions']['has'](_0x5f3f7b))throw new _0x331448('sessions-register-already-registered',null,{'channelId':_0x5f3f7b});this['_registeredSessions']['set'](_0x5f3f7b,_0x3d9468),this['channelSessions']['set'](_0x5f3f7b,new _0x1ef5f7()),this['channelConnectedUsers']['set'](_0x5f3f7b,new _0x1ef5f7()),this['listenTo'](_0x3d9468,'add',(_0xbf6799,_0x59afbe)=>this['_handleSessionAdd'](_0x5f3f7b,_0x59afbe)),this['listenTo'](_0x3d9468,'remove',(_0x978a59,_0x5bb598)=>this['_handleSessionRemove'](_0x5f3f7b,_0x5bb598));for(const _0x1a8379 of _0x3d9468)this['_handleSessionAdd'](_0x5f3f7b,_0x1a8379);}['unregister'](_0x2df286){if(!this['_registeredSessions']['has'](_0x2df286))throw new _0x331448('sessions-unregister-not-exist',null,{'channelId':_0x2df286});const _0x225628=this['_registeredSessions']['get'](_0x2df286);this['stopListening'](_0x225628);for(const _0x212964 of _0x225628)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2df286,_0x212964);this['_registeredSessions']['delete'](_0x2df286),this['channelSessions']['delete'](_0x2df286),this['channelConnectedUsers']['delete'](_0x2df286);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4dad56){for(const _0x40b034 of this['channelSessions']['values']())for(const _0x22107f of _0x40b034)if(_0x22107f['id']===_0x4dad56)return _0x22107f['user'];}['getUserSessions'](_0x5f3551,_0x1a7991){const _0x50c61e=_0x1a7991?[this['channelSessions']['get'](_0x1a7991)]:this['channelSessions']['values'](),_0x5699b6=new Set();for(const _0x1fce85 of _0x50c61e)for(const _0x3b0d33 of _0x1fce85)_0x3b0d33['user']['id']===_0x5f3551['id']&&_0x5699b6['add'](_0x3b0d33['id']);return _0x5699b6;}['getUserRole'](_0x293a95){for(const _0x1ea6e7 of this['channelSessions']['values']())for(const _0x42220b of _0x1ea6e7)if(_0x42220b['user']===_0x293a95)return _0x42220b['role'];}['_handleSessionAdd'](_0x9879be,_0x1eb0fd){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x5d675c=_0x1eb0fd['user'],_0x4521db=this['_users']['getUser'](_0x5d675c['id'])||this['_createUser'](_0x5d675c),_0x4ffda0=Object['assign']({},_0x1eb0fd,{'user':_0x4521db});this['channelSessions']['get'](_0x9879be)['add'](_0x4ffda0);const _0x5f16ef=this['channelConnectedUsers']['get'](_0x9879be);_0x5f16ef['has'](_0x4521db['id'])||_0x5f16ef['add'](_0x4521db),this['allConnectedUsers']['has'](_0x4521db['id'])||this['allConnectedUsers']['add'](_0x4521db,_0x4521db['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x9879be,{'channelId':_0x9879be,'session':_0x4ffda0});}['_handleSessionRemove'](_0x48ac61,_0x46f30c){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x374884=this['channelConnectedUsers']['get'](_0x48ac61),_0x405808=_0x46f30c['user'];_0x405808['id']&&(this['channelSessions']['get'](_0x48ac61)['remove'](_0x46f30c['id']),_0x374884['has'](_0x405808['id'])&&!this['getUserSessions'](_0x405808,_0x48ac61)['size']&&_0x374884['remove'](_0x405808['id']),this['allConnectedUsers']['get'](_0x405808['id'])&&!this['getUserSessions'](_0x405808)['size']&&this['allConnectedUsers']['remove'](_0x405808['id']));}['_createUser'](_0x3c7a5d,_0x2a4616){const _0x485ded=this['_users']['addUser'](_0x3c7a5d);return _0x2a4616&&this['_users']['defineMe'](_0x3c7a5d['id']),_0x485ded['orderNumber']=this['_uniqueUsersCount']++,_0x485ded;}}class P extends _0x360d0e{['_domEmitter']=new(_0x3dd186())();static get['requires'](){return[r];}static get['pluginName'](){return'UserMarkers';}['init'](){const _0x2567b5=this['editor'],_0x4e7ba3=_0x2567b5['plugins']['get'](r);_0x2567b5['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5359cd,{writer:_0x1bb24b})=>function(_0x40d2f0,_0x25c10a,_0x2a79e7,_0x39c738){const _0x52b5da=_0x40d2f0['markerName']['split'](':')[0x2],_0x1f5fe8=_0x2a79e7['getUserBySessionId'](_0x52b5da);if(!_0x1f5fe8||_0x52b5da===_0x2a79e7['mySessionId'])return;if(!_0x39c738['model']['schema']['checkChild'](_0x40d2f0['markerRange']['start'],'$text'))return;const _0x5a5a1e={'class':'ck-user__marker\x20'+_0x1f5fe8['color']['getMarkerClass'](),'data-name':_0x1f5fe8['name'],'data-session-id':_0x52b5da},_0x23cd93=_0x39c738['model']['markers']['get'](_0x40d2f0['markerName']),_0x232e31=_0x23cd93['getStart'](),_0x50dd56=_0x232e31['nodeAfter'],_0x26b028=_0x39c738['model']['schema'];if(_0x50dd56&&_0x26b028['isObject'](_0x50dd56)&&_0x26b028['isInline'](_0x50dd56)&&!_0x39c738['model']['markers']['get']('user:range:'+_0x52b5da)['getRange']()['isCollapsed'])return;const _0x3d5d63=_0x232e31['parent'];return _0x39c738['model']['schema']['isLimit'](_0x3d5d63)&&!_0x39c738['model']['hasContent'](_0x3d5d63)&&(_0x5a5a1e['contenteditable']=!0x1),function(_0x3caf54,_0x268ca4,_0x5ae3f8){const _0x5223ab=_0x3caf54['createUIElement']('span',_0x268ca4);return _0x3caf54['setCustomProperty']('userPositionMarker',!0x0,_0x5223ab),_0x5223ab['render']=function(_0x495c88){const _0x5e3f4e=this['toDomElement'](_0x495c88);return _0x5e3f4e['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>'+_0x5ae3f8['name']+'</span>',_0x5e3f4e['addEventListener']('mouseenter',()=>{_0x5e3f4e['classList']['add']('ck-user__marker_hovered');}),_0x5e3f4e['addEventListener']('mouseleave',()=>{_0x5e3f4e['classList']['remove']('ck-user__marker_hovered');}),_0x5e3f4e;},_0x5223ab['isSimilar']=function(_0x32d503){return!(!this['getCustomProperty']('userPositionMarker')||!_0x32d503['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x32d503['getAttribute']('data-session-id'));},_0x5223ab;}(_0x25c10a,_0x5a5a1e,_0x1f5fe8);}(_0x5359cd,_0x1bb24b,_0x4e7ba3,_0x2567b5)}),_0x2567b5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3e97a8=>function(_0x4c233b,_0x37a9cc){const _0x1ed703=_0x4c233b['markerName']['split'](':')[0x2];if(_0x1ed703===_0x37a9cc['mySessionId'])return null;const _0x21cc85=_0x37a9cc['getUserBySessionId'](_0x1ed703);if(!_0x21cc85)return{'id':_0x1ed703,'classes':[]};return{'id':_0x1ed703,'classes':['ck-user__selection',_0x21cc85['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x1ed703},'priority':0x7d0+_0x21cc85['orderNumber']};}(_0x3e97a8,_0x4e7ba3)}),function(_0x390297){const _0x165c38=_0x390297['model'],_0x58ea37=new Map(),_0x5a8d26=_0x390297['plugins']['get'](r);_0x165c38['markers']['on']('update:user:range',(_0x41e318,_0xe5e8c6,_0x38384d,_0x2ee144)=>{if(!_0x2ee144&&_0x58ea37['get'](_0xe5e8c6['name']))return _0x58ea37['get'](_0xe5e8c6['name'])['detach'](),void _0x58ea37['delete'](_0xe5e8c6['name']);const _0x40f29b=_0xe5e8c6['name']['split'](':')[0x2];if(_0x40f29b===_0x5a8d26['mySessionId'])return;const _0x2e1280='user:position:'+_0x40f29b;_0x165c38['markers']['has'](_0x2e1280)&&_0x390297['editing']['reconvertMarker'](_0x2e1280),_0xe5e8c6['on']('change:range',(_0x22f4dd,_0x3e2831,_0x354657)=>{if('$graveyard'!=_0x3e2831['root']['rootName']&&'$graveyard'==_0xe5e8c6['getRange']()['root']['rootName']&&!_0x58ea37['has'](_0xe5e8c6['name'])){const _0x11297c=_0x165c38['schema']['getNearestSelectionRange'](_0x354657['deletionPosition']);if(_0x11297c){const _0xbdba82=ut['fromRange'](_0x11297c);_0x58ea37['set'](_0xe5e8c6['name'],_0xbdba82),_0xbdba82['on']('change:range',(_0x2df3ed,_0x2b6033,_0x51f0e0)=>{if('$graveyard'==_0xbdba82['root']['rootName']){const _0x4a2099=_0x165c38['schema']['getNearestSelectionRange'](_0x51f0e0['deletionPosition']);_0x4a2099?(_0xbdba82['start']=_0x4a2099['start'],_0xbdba82['end']=_0x4a2099['end']):(_0x58ea37['delete'](_0xe5e8c6['name']),_0xbdba82['detach']());}});}}});}),_0x165c38['document']['on']('change',()=>{_0x58ea37['size']>0x0&&_0x165c38['enqueueChange']({'isUndoable':!0x1},_0xb872ea=>{for(const [_0x5e2a59,_0x1953f4]of _0x58ea37)'$graveyard'==_0x165c38['markers']['get'](_0x5e2a59)['getRange']()['root']['rootName']&&(G(_0x5e2a59['split'](':')[0x2],_0x1953f4['toRange'](),_0x165c38,_0xb872ea),_0x1953f4['detach']());_0x58ea37['clear']();});});}(_0x2567b5),this['_domEmitter']['listenTo'](_0x31593e['document'],'keydown',(_0x1f5132,{key:_0x389104})=>{'Escape'===_0x389104&&function(_0x2566e0){_0x2566e0['editing']['view']['change'](_0x191d37=>{for(const _0x3979b5 of _0x2566e0['model']['markers']){if(!_0x3979b5['name']['startsWith']('user:position'))continue;const _0x2cb77f=_0x2566e0['editing']['mapper']['markerNameToElements'](_0x3979b5['name']);if(_0x2cb77f){for(const _0x1ccf29 of _0x2cb77f)_0x191d37['removeClass']('ck-user__marker_hovered',_0x1ccf29);}}});}(_0x2567b5);},{'useCapture':!0x0});}['afterInit'](){const _0x5b1da3=this['editor'],_0x1ec1c5=_0x5b1da3['commands']['get']('undo');_0x1ec1c5&&_0x5b1da3['model']['on']('applyOperation',(_0x37ffb4,_0x4ca071)=>{const _0x3c7b20=_0x4ca071[0x0];if('marker'!=_0x3c7b20['type']||!_0x3c7b20['name']['startsWith']('user:'))return;const _0x5b5464=_0x3c7b20['batch'];_0x1ec1c5['_createdBatches']['has'](_0x5b5464)&&(_0x3c7b20['newRange']=_0x3c7b20['oldRange']?_0x5b1da3['model']['createRange'](_0x3c7b20['oldRange']['start'],_0x3c7b20['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x330004=this['editor'],_0x120cec=_0x330004['model']['document'],_0x4c18dc=_0x330004['plugins']['get'](r);_0x330004['model']['enqueueChange']({'isUndoable':!0x1},_0x132da8=>{const _0x30a6b9='user:range:'+_0x4c18dc['mySessionId'],_0x215fec='user:position:'+_0x4c18dc['mySessionId'],_0x181668=_0x330004['model']['markers']['has'](_0x30a6b9);_0x330004['editing']['view']['hasDomSelection']?G(_0x4c18dc['mySessionId'],_0x120cec['selection']['getFirstRange'](),_0x330004['model'],_0x132da8):_0x181668&&(_0x132da8['removeMarker'](_0x30a6b9),_0x132da8['removeMarker'](_0x215fec));});}}function G(_0x13f734,_0x9d4209,_0x571b29,_0x16b211){const _0x471e03='user:range:'+_0x13f734,_0x1deaf4='user:position:'+_0x13f734,_0x2079cc=_0x9d4209['getContainedElement']();let _0x5df9d4=_0x9d4209['start'];_0x2079cc&&_0x2079cc['is']('element','tableCell')&&(_0x5df9d4=function(_0x1bd06c,_0x24df9f){for(const _0x2c8a07 of _0x1bd06c['getPositions']())if(_0x24df9f['schema']['checkChild'](_0x2c8a07,'$text'))return _0x2c8a07;}(_0x9d4209,_0x571b29),_0x9d4209=_0x16b211['createRange'](_0x5df9d4));const _0x1a1e56=_0x16b211['createRange'](_0x5df9d4);_0x571b29['markers']['has'](_0x471e03)?(_0x16b211['updateMarker'](_0x471e03,{'range':_0x9d4209}),_0x16b211['updateMarker'](_0x1deaf4,{'range':_0x1a1e56})):(_0x16b211['addMarker'](_0x471e03,{'range':_0x9d4209,'usingOperation':!0x0}),_0x16b211['addMarker'](_0x1deaf4,{'range':_0x1a1e56,'usingOperation':!0x0}));}function E(_0x3acc9d,_0x56be88,_0x48a98d){const t=_0x3acc9d['t'];switch(_0x56be88){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'},_0x48a98d);default:return'';}}let M=0x1;class l extends _0x360d0e{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x3f90c9)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,r,P,_0x1d975a,_0x11d8ec,_0x43f411];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x8058c7=this['serverHistory']['getOperations']();for(let _0x3ab0f0=_0x8058c7['length']-0x1;_0x3ab0f0>=0x0;_0x3ab0f0--){const _0x2cb186=_0x8058c7[_0x3ab0f0];if(!this['_disconnectionOperations']['has'](_0x2cb186))return _0x2cb186['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1189da){if(super(_0x1189da),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x3b1fea(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x331448('collaboration-missing-channelid',this);const _0x474cd5=_0x1189da['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x474cd5,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1a7220(),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 W(this['_disconnectionOperations']);}['init'](){const _0x36b4f1=this['editor'],_0x25ddea=_0x36b4f1['plugins']['get'](_0x11d8ec),_0x237839=_0x36b4f1['plugins']['get'](c);this['listenTo'](_0x25ddea,'getOperationAuthor',(_0x1a0bd2,_0x406d99)=>{const _0x36ec73=_0x406d99[0x0];_0x36ec73['_authorId']&&(_0x1a0bd2['return']=_0x25ddea['getUser'](_0x36ec73['_authorId']),_0x1a0bd2['stop']()),null===_0x36ec73['_authorId']&&(_0x1a0bd2['return']=null,_0x1a0bd2['stop']());},{'priority':'high'}),this['listenTo'](_0x36b4f1['model']['document']['selection'],'change:range',(_0x83c4f6,_0x4686c7)=>{_0x4686c7['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x36b4f1['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x36b4f1['model']['on']('applyOperation',(_0x4cc7a7,_0x48a7d9)=>{const _0x4af8ab=_0x48a7d9[0x0];_0x4af8ab['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4af8ab),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x237839,'state',this,'_hasSynchronizationProblem',(_0x4c065f,_0x2659c3)=>'connected'===_0x4c065f&&!_0x2659c3),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x36b4f1['disableReadOnlyMode']('rtc-offline'):_0x36b4f1['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x36b4f1['disableReadOnlyMode']('rtc-offline'):_0x36b4f1['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xcf9f8f=this['editor']['plugins']['get'](r),_0x30a73f=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0xcf9f8f['unregister'](this['_channelId']);const _0x27fe76=await this['_service']['reconnect'](_0x30a73f['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x27fe76)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x10f54f=await this['_service']['getConnectedSessions']();_0xcf9f8f['register'](this['_channelId'],_0x10f54f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xc07ac0){if(function(_0x292916){return'404'===_0x292916['code'];}(_0xc07ac0)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4714fc){return'409'===_0x4714fc['code'];}(_0xc07ac0)){const _0x3b1b44=E(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x3b1b44);}else{if(!(_0xc07ac0 instanceof z))throw _0xc07ac0;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2c74f0=this['editor']['plugins']['get'](c),_0x268166=this['editor']['plugins']['get'](r);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x268166['channelSessions']['has'](this['_channelId'])&&_0x268166['unregister'](this['_channelId']),_0x2c74f0['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x223c9b){if(this['sessionId']!==_0x223c9b['sessionId']&&this['_lastSyncedOperationId']!==_0x223c9b['lastOperationId'])throw new z();return this['sessionId']=_0x223c9b['sessionId'],this['_handleServerResponse']([],{..._0x223c9b,'wereChangesApplied':!0x1,'data':_0x223c9b['data']},'reconnect');}async['_connectService'](_0x21569f,_0x553682=!0x1){const {connection:_0xfc986b}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0xfc986b,this['_channelId'])['then'](_0x35135c=>this['_initSessionsHandling'](_0x35135c))['catch'](_0x1de686=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1de686);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4aac0d,_0x5b1e8e)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x5b1e8e);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xef6085=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x21569f);this['_isPendingUpdate']=!0x0;const _0x15606e=await this['_service']['connect'](_0xfc986b,this['_compressOperations'](_0x21569f),_0xef6085);if(this['sessionId']=_0x15606e['sessionId'],_0x553682){if(!_0x15606e['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x15606e['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x21569f,_0x15606e,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x15606e,_0x21569f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xb78d32=this['editor']['plugins']['get'](r),_0x3e9e9f=this['editor']['plugins']['get'](P),_0x59aa53=_0xb78d32['channelSessions']['get'](this['_channelId']);_0x59aa53&&_0x59aa53['length']>0x1?_0x3e9e9f['createUserMarkerOperations']():this['listenTo'](_0xb78d32,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xb78d32['channelSessions']['get'](this['_channelId'])['length']&&_0x3e9e9f['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3d3b79,_0x4a777d,_0x513b7d,_0x91643a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4a777d){const _0x1e229a=this['_decompressOperations'](_0x513b7d,_0x91643a);await this['_fetchMissingUsers'](_0x1e229a),this['_handleExternalOperations'](_0x1e229a,_0x4a777d,_0x513b7d['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1952fe}=this['editor'];let _0x168aab;try{_0x168aab=await this['_service']['getDocumentDetails']();}catch(_0x3d379f){const _0x3b632a=E(_0x1952fe,'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'](_0x3b632a);}const _0x429756=_0x168aab['currentDocumentSession']||_0x168aab['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x429756['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x20919d=E(_0x1952fe,'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'](_0x20919d);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4f28e8){const _0x212143=this['editor']['plugins']['get'](r);this['listenTo'](_0x212143,'sessionAdd:'+this['_channelId'],(_0x3f5ec7,{session:_0x55056c})=>{if(_0x55056c['id']===_0x212143['mySessionId']){_0x3f5ec7['off']();const _0xaa18d1=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2185e8=_0x55056c['permissions'];_0xaa18d1&&_0xaa18d1['isEnabled']&&(_0x2185e8=_0x2185e8['filter'](_0xaa0ecd=>'document:write'!==_0xaa0ecd)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2185e8,this['_channelId']);}}),_0x212143['register'](this['_channelId'],_0x4f28e8);}['_initThrowingOnDataSet'](){const _0x32d9ea=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xf886a0)=>{if(!_0xf886a0[_0xf886a0['length']-0x1]['suppressErrorInCollaboration'])throw new _0x331448('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x32d9ea['apply'](this['editor']['data'],_0xf886a0);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x5da055,[_0x370bb7])=>{if(this['_document']['version'])throw new _0x331448('realtimecollaborationclient-init-document-already-initialized',this);_0x5da055['stop'](),this['_setPendingAction']();const _0x355ec0=this['editor']['config']['get']('rootsAttributes'),_0x316e96=this['_getOperationsFromInitData'](_0x370bb7,_0x355ec0);0x0==_0x316e96['length']&&_0x316e96['push'](new _0x34c6af(0x0)),_0x5da055['return']=this['_connectService'](_0x316e96)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x5a4690=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5a4690))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x564671,[_0x2a9c2e,_0x6480a0])=>{_0x564671['stop']();const _0x480331=this['editor']['model']['document']['getRoot'](_0x2a9c2e);if(!this['_knownRootNames']['has'](_0x2a9c2e)){const _0xd83ad2=_0x6480a0&&_0x6480a0['data']?_0x6480a0['data']:'',_0x4f1b8c=_0x6480a0&&_0x6480a0['attributes']?_0x6480a0['attributes']:{};await this['_loadRoot'](_0x2a9c2e,_0xd83ad2,_0x4f1b8c);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x480331['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x480331);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xa983d2){const _0xbde187=this['editor']['plugins']['get'](_0x11d8ec),{connection:_0x41c2d1}=this['editor']['plugins']['get'](c),_0x17b592=new Set();for(const _0x3076dc of _0xa983d2){const _0x1002af=_0x3076dc['_authorId'];_0x1002af&&!_0xbde187['getUser'](_0x1002af)&&_0x17b592['add'](_0x1002af);}if(0x0===_0x17b592['size'])return;const _0x31493f=await mt['getMany'](_0x41c2d1,Array['from'](_0x17b592));for(const _0x32ba93 of _0x31493f)_0xbde187['getUser'](_0x32ba93['id'])||_0xbde187['addUser'](_0x32ba93);}['_getOperationsFromInitData'](_0x3b6454,_0x2dabf8={}){const _0x38d862=this['editor']['model'],_0x17472e=[];let _0x487ce9=0x0;const _0x156d62='string'==typeof _0x3b6454?{'main':_0x3b6454}:_0x3b6454;for(const _0x2fd359 of Object['keys'](_0x156d62)){if(!this['_document']['roots']['has'](_0x2fd359))throw new _0x331448('realtimecollaborationclient-init-non-existent-root',this);const _0x33524f=this['editor']['data']['parse'](_0x156d62[_0x2fd359]),_0x381b06=this['_document']['getRoot'](_0x2fd359),_0x2e2fca=new _0x44b2e5(_0x38d862['createPositionAt'](_0x381b06,0x0),_0x33524f,_0x487ce9++);_0x17472e['push'](_0x2e2fca);for(const [_0xfa554d,_0x1e13f2]of _0x33524f['markers']){const _0x59380d=_0x38d862['createRange'](_0x38d862['createPositionFromPath'](_0x381b06,_0x1e13f2['start']['path']['slice']()),_0x38d862['createPositionFromPath'](_0x381b06,_0x1e13f2['end']['path']['slice']())),_0x237547=new _0x32b787(_0xfa554d,null,_0x59380d,_0x38d862['markers'],!0x0,_0x487ce9++);_0x17472e['push'](_0x237547);}}if(_0x2dabf8)for(const [_0xb063ad,_0x380e19]of Object['entries'](_0x2dabf8)){const _0x246b04=_0x38d862['document']['getRoot'](_0xb063ad);if(!_0x246b04)throw new _0x331448('multi-root-editor-root-attributes-no-root',null);for(const [_0x2f0bab,_0x51f970]of Object['entries'](_0x380e19))if(null!==_0x51f970){const _0x46996e=new _0x5c3499(_0x246b04,_0x2f0bab,null,_0x51f970,_0x487ce9++);_0x17472e['push'](_0x46996e);}}return _0x17472e;}async['_loadRoot'](_0x398a82,_0x4a328d,_0x48dfc3){this['_getOperationsFromInitData']({[_0x398a82]:_0x4a328d},{[_0x398a82]:_0x48dfc3})['forEach']((_0x53dd38,_0x28e338)=>{_0x53dd38['baseVersion']=this['_document']['version']+_0x28e338,_0x53dd38['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x53dd38);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x345306,_0x5d7d42){let _0x2c2802;this['_offset']=_0x345306['offset'];const _0x5cdf93=_0x345306['wereChangesApplied']&&!_0x345306['initData'],_0x5ce4bf=_0x5cdf93?0x0:_0x345306['data']['baseVersion'];if(_0x5d7d42['forEach'](_0x1e369a=>{_0x1e369a['_isInit']=!0x0,_0x1e369a['createdAt']=_0x345306['sessionCreatedAt'],_0x1e369a['_authorId']=null;}),_0x5cdf93)_0x2c2802=_0x5d7d42,this['_applyOperationsSet'](_0x2c2802,_0x5cdf93);else{if(_0x345306['initData']){const _0x2b490a=this['_getOperationsFromInitData'](_0x345306['initData']);this['_document']['history']['version']=-_0x2b490a['length'],_0x2b490a['forEach'](_0x3e276c=>{_0x3e276c['baseVersion']-=_0x2b490a['length'],_0x3e276c['createdAt']=_0x345306['sessionCreatedAt'],_0x3e276c['_isInit']=!0x0,_0x3e276c['_authorId']=null;}),this['_applyOperationsSet'](_0x2b490a,!0x0),this['serverHistory']['version']=-_0x2b490a['length']+this['_offset'],this['_updateServerHistory'](_0x2b490a);}this['_document']['history']['version']=_0x5ce4bf,_0x2c2802=this['_decompressOperations'](_0x345306['data'],_0x345306['metadata']),await this['_fetchMissingUsers'](_0x2c2802),this['_applyOperationsSet'](_0x2c2802,_0x5cdf93);}_0x345306['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2c2802,_0x345306['lastOperationId']),this['_lastSyncedOperationId']=_0x345306['lastOperationId']),this['serverHistory']['version']=_0x5ce4bf+this['_offset'],this['_updateServerHistory'](_0x2c2802),_0x5d7d42['filter'](_0x3a696d=>{const _0x564e97=this['_getAffectedRoot'](_0x3a696d);return _0x564e97&&!this['_knownRootNames']['has'](_0x564e97);})['forEach']((_0x3f0c99,_0x445101)=>{_0x3f0c99['baseVersion']=this['_document']['version']+_0x445101,this['_saveOperationInBuffer'](_0x3f0c99);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2ebd6d,_0x3f477e){throw this['_isPendingUpdate']=!0x0,_0x3f477e&&console['error'](_0x3f477e),new _0x331448(_0x2ebd6d,this['editor']);}['_saveOperationInBuffer'](_0x19cc9c){this['_knownOperations']['has'](_0x19cc9c)||(this['_knownOperations']['add'](_0x19cc9c),this['_bufferedOperations']['push'](_0x19cc9c),this['_pendingAction']||'marker'==_0x19cc9c['type']&&!_0x19cc9c['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x1c7348=!0x1){!_0x1c7348&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x367064=>{_0x367064&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0xb9ff62=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x399dfa){return _0x399dfa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x399dfa['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x399dfa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0xb9ff62))throw _0xb9ff62;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x55bfa3=>{this['on']('change:_isPendingUpdate',()=>{_0x55bfa3();});});}async['_sendBufferedOperations'](){const _0x33cdb4=this['editor']['plugins']['get'](P);if(this['_shouldSendSelectionUpdate']()&&(_0x33cdb4['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x215739=[...this['_bufferedOperations']];for(const _0x5f57e5 of _0x215739)_0x5f57e5['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5f57e5);const _0x51013d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x215739),_0x2e757a=M++,_0x49afcc=this['_compressOperations'](_0x215739),_0x272da4=await this['_service']['sendOperations'](_0x49afcc,_0x49afcc['baseVersion'],_0x51013d);try{return await this['_handleServerResponse'](_0x215739,_0x272da4,_0x2e757a);}catch(_0x3a450d){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3a450d);}}async['_handleServerResponse'](_0x426a5a,_0x5c11da,_0xfe8611){if('error'in _0x5c11da)throw _0x5c11da['error'];let _0x1fdba5=!0x1;if(_0x5c11da['wereChangesApplied']){_0x5c11da['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5c11da['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x30f6fb=>!_0x426a5a['includes'](_0x30f6fb));for(const _0x113308 of _0x426a5a)_0x113308['createdAt']='lastOperationAcceptedAt'in _0x5c11da&&_0x5c11da['lastOperationAcceptedAt']||void 0x0;V(_0x426a5a,_0x5c11da['version']-_0x426a5a['length']),this['_updateServerHistory'](_0x426a5a);const _0x44d7fe=_0x426a5a['filter'](_0x43e83d=>{if(!_0x43e83d['_isInit'])return!0x1;const _0x167864=this['_getAffectedRoot'](_0x43e83d);return _0x167864&&!this['_knownRootNames']['has'](_0x167864);});V(_0x44d7fe,this['_document']['version']),this['_applyOperationsSet'](_0x44d7fe),_0x1fdba5=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x421a98=this['_decompressOperations'](_0x5c11da['data'],_0x5c11da['metadata'])['filter'](_0x413356=>_0x413356['baseVersion']>=this['_lastServerVersion']);_0x421a98['forEach'](_0x22f775=>this['_addKnownRoot'](_0x22f775)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x8f83ee=>!_0x8f83ee['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x8f83ee))),this['_bufferedOperations']['length']&&V(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x421a98),_0x1fdba5=this['_handleExternalOperations'](_0x421a98,_0x5c11da['version'],_0x5c11da['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1fdba5?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x136fca,_0x1a05e1,_0x1e1196){try{const _0x51c97f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x151043,operationsB:_0x58356d,originalOperations:_0x1ee0e6}=_0x27b1de(_0x136fca,this['_bufferedOperations'],_0x51c97f);V(_0x151043,this['_document']['version']),V(_0x58356d,_0x1a05e1);for(const _0x1debb1 of _0x151043){const _0x1db163=_0x1ee0e6['get'](_0x1debb1);_0x1debb1['_authorId']=_0x1db163?_0x1db163['_authorId']:null;}_0x1e1196&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x136fca,_0x1e1196),this['_lastSyncedOperationId']=_0x1e1196),this['_bufferedOperations']=[..._0x58356d],this['_applyOperationsSet'](_0x151043),this['_updateServerHistory'](_0x136fca);}catch(_0x39f93a){return console['error'](_0x39f93a),!0x1;}return!0x0;}['_applyOperationsSet'](_0x491786,_0x455d6c=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x43d8a8=>{for(const _0x1a7cdc of _0x491786)this['_knownOperations']['add'](_0x1a7cdc),this['_addKnownRoot'](_0x1a7cdc),_0x43d8a8['batch']['addOperation'](_0x1a7cdc),this['editor']['model']['applyOperation'](_0x1a7cdc);});}['_addKnownRoot'](_0x188a70){const _0x4e956c=this['_getAffectedRoot'](_0x188a70);_0x4e956c&&this['_knownRootNames']['add'](_0x4e956c);}['_getAffectedRoot'](_0x22e1c1){let _0x3b67dd,_0x94e492;switch(_0x22e1c1['type']){case'insert':_0x3b67dd=_0x22e1c1['position']['root'];break;case'marker':if(_0x94e492=_0x22e1c1['newRange'],!_0x94e492)return null;_0x3b67dd=_0x94e492['root'];break;case'addRootAttribute':_0x3b67dd=_0x22e1c1['root'];break;case'addRoot':_0x3b67dd=_0x22e1c1['affectedSelectable'];break;case'move':_0x3b67dd=_0x22e1c1['targetPosition']['root'];break;default:return null;}return _0x3b67dd['rootName'];}['_updateServerHistory'](_0x3c7945){_0x3c7945['forEach'](_0x51583a=>{const _0x41a266=_0x51583a['clone']();_0x41a266['_authorId']=_0x51583a['_authorId'],_0x41a266['_isInit']=!!_0x51583a['_isInit'],_0x41a266['createdAt']=_0x51583a['createdAt'],_0x41a266['baseVersion']+=this['_offset'],_0x51583a['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x41a266),this['serverHistory']['addOperation'](_0x41a266);});}['_handleReconnectionError'](_0x3d047f){const _0x4b2329=this['editor']['plugins']['get']('Notification'),_0x5a4723=this['editor']['locale'];_0x3d047f||(_0x3d047f=E(_0x5a4723,'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.')),_0x4b2329['showWarning'](_0x3d047f,{'title':E(_0x5a4723,'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'](_0x1d975a)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1d975a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4e7729){const _0x33506c=_0x4e7729['map'](_0x4bc714=>_0x4bc714['toJSON']());return this['_compressor']['compress'](_0x33506c);}['_decompressOperations'](_0x4a7eb5,_0x4ff868){return this['_compressor']['decompress'](_0x4a7eb5)['map']((_0x2203c4,_0x19f311)=>{const _0x144e79='init'==_0x4ff868[_0x19f311]['type'];if('InsertOperation'==_0x2203c4['__className']){const _0x1a4012=_0x2203c4['position']['root'];!this['_document']['getRoot'](_0x1a4012)&&(this['_document']['createRoot']('$root',_0x1a4012)['_isAttached']=!0x1);}const _0x2fb0f6=_0x6f1576['fromJSON'](_0x2203c4,this['_document']);return _0x2fb0f6['wasUndone']=_0x2203c4['wasUndone'],_0x2fb0f6['_isInit']=_0x144e79,_0x2fb0f6['_authorId']=_0x144e79?null:_0x4ff868[_0x19f311]['userId'],_0x2fb0f6['_isDisconnection']='cs:removeUser'===_0x4ff868[_0x19f311]['type'],_0x2fb0f6['createdAt']=_0x4ff868[_0x19f311]['createdAt'],_0x2fb0f6;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2731da=this['editor']['plugins']['get'](r)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2731da&&_0x2731da['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class z extends Error{}function V(_0x21b147,_0x299b5f){for(const _0x45941d of _0x21b147)_0x45941d['baseVersion']=_0x299b5f++;}class W{['_ignoredOperations'];['_operationToId'];constructor(_0x3bcc0a){this['_ignoredOperations']=_0x3bcc0a,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4b3091){let _0x5ee7a2=_0x4b3091['length'];for(;_0x5ee7a2--;){const _0x2ccbec=_0x4b3091[_0x5ee7a2];if(!this['_ignoredOperations']['has'](_0x2ccbec)){if(!this['_operationToId']['has'](_0x2ccbec)){const _0x45df3d=_0x7076()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2ccbec,_0x45df3d);}return this['_operationToId']['get'](_0x2ccbec);}}}['setIdForTheLastOperation'](_0x3708bc,_0x4095af){if(!_0x4095af)return;let _0x4817fb=_0x3708bc['length'];for(;_0x4817fb--;){const _0x59ff4b=_0x3708bc[_0x4817fb];this['_ignoredOperations']['has'](_0x59ff4b)||this['_operationToId']['set'](_0x59ff4b,_0x4095af);}}}class n extends _0x360d0e{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}}class a extends _0x54552e{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x3881e8)());['_services'];static get['requires'](){return[c,'CommentsRepository',r,_0x11d8ec];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}constructor(_0x8339be){super(_0x8339be),this['_services']=new Map();}async['init'](){const _0x249130=this['context'],_0x5e0cde=_0x249130['plugins']['get']('CommentsRepository');if(_0x249130['plugins']['get'](c)['addToReconnectionStack'](this),_0x5e0cde['adapter']={'addCommentThread':async({channelId:_0x24f6c0,threadId:_0x31dc46,comments:_0x3ac28f,resolvedAt:_0x1b0035,resolvedBy:_0x534f14,context:_0x12add1,attributes:_0x518d8a})=>{const _0x485781=await this['_getService'](_0x24f6c0)['addCommentThread']({'commentThreadId':_0x31dc46,'comments':_0x3ac28f['map'](_0x247f4d=>function(_0x390111,_0x468ff1,_0x5090b8){return{'commentThreadId':_0x5090b8,'commentId':_0x390111['commentId'],'userId':_0x390111['authorId'],'content':_0x390111['content'],'documentId':_0x468ff1,'createdAt':_0x390111['createdAt'],'attributes':_0x390111['attributes']||{}};}(_0x247f4d,_0x24f6c0,_0x31dc46)),'resolvedAt':_0x1b0035,'resolvedBy':_0x534f14,'context':_0x12add1,'attributes':_0x518d8a})['catch'](wt);return{'threadId':_0x485781['commentThreadId'],'comments':_0x485781['comments']};},'getCommentThread':async({channelId:_0x7731c8,threadId:_0x3c11d9})=>{const _0x3cf0ce=await this['_getService'](_0x7731c8)['getCommentThread'](_0x3c11d9)['catch'](wt);return _0x3cf0ce['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3cf0ce]),{'threadId':_0x3cf0ce['commentThreadId'],'comments':_0x3cf0ce['comments']['map'](b),'context':_0x3cf0ce['context'],'resolvedAt':_0x3cf0ce['resolvedAt'],'resolvedBy':_0x3cf0ce['resolvedBy'],'attributes':_0x3cf0ce['attributes']||{}});},'updateCommentThread':async({channelId:_0x402390,threadId:_0x2a6086,context:_0x1d9dac,unlinkedAt:_0x40c08f,attributes:_0x3d667c})=>this['_getService'](_0x402390)['updateCommentThread']({'commentThreadId':_0x2a6086,'context':_0x1d9dac,'attributes':_0x3d667c,'unlinkedAt':_0x40c08f})['catch'](y)['catch'](wt),'resolveCommentThread':async({channelId:_0x49be17,threadId:_0x404203})=>{const _0x7404b1=await this['_getService'](_0x49be17)['resolveCommentThread'](_0x404203)['catch'](y)['catch'](wt);return{'threadId':_0x7404b1['commentThreadId'],'resolvedAt':_0x7404b1['resolvedAt'],'resolvedBy':_0x7404b1['resolvedBy']};},'reopenCommentThread':async({channelId:_0x21fe75,threadId:_0x5bfe1})=>this['_getService'](_0x21fe75)['reopenCommentThread'](_0x5bfe1)['catch'](y)['catch'](wt),'removeCommentThread':({channelId:_0xe0fd30,threadId:_0x29bb9c})=>this['_getService'](_0xe0fd30)['removeCommentThread'](_0x29bb9c)['catch'](y)['catch'](wt),'addComment':({channelId:_0x463722,threadId:_0x2a3b4a,commentId:_0x89c302,content:_0x3192ac,attributes:_0x48f33c})=>this['_getService'](_0x463722)['addComment'](_0x2a3b4a,_0x89c302,_0x3192ac,_0x48f33c)['catch'](wt),'updateComment':({channelId:_0x44fe93,threadId:_0x344cad,commentId:_0x539636,content:_0xf8fe0b,attributes:_0x11ee59})=>this['_getService'](_0x44fe93)['updateComment'](_0x344cad,_0x539636,_0xf8fe0b,_0x11ee59)['catch'](y)['catch'](wt),'removeComment':({channelId:_0x24c053,threadId:_0x29f0c8,commentId:_0x434c62})=>this['_getService'](_0x24c053)['removeComment'](_0x29f0c8,_0x434c62)['catch'](y)['catch'](wt)},_0x249130 instanceof _0x178f2b){const _0xcc86c3=_0x249130['config']['get']('collaboration.channelId'),_0x51b4e7=_0x249130['plugins']['get'](r);await this['_setUpService'](_0xcc86c3);const _0x5bcad3=await this['_services']['get'](_0xcc86c3)['getConnectedSessions']();this['listenTo'](_0x51b4e7,'sessionAdd:'+_0xcc86c3,(_0xdf1d34,{session:_0x26d8f4})=>{_0x26d8f4['id']===_0x51b4e7['mySessionId']&&(_0xdf1d34['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x26d8f4['permissions'],_0xcc86c3));}),_0x51b4e7['register'](_0xcc86c3,_0x5bcad3);}}async['_setUpService'](_0x4989c1){if(this['_services']['has'](_0x4989c1))throw new _0x331448('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4989c1});const _0x5a2c59=this['context']['plugins']['get']('CommentsRepository'),_0x35c842=new a['CommentsService'](_0x4989c1);this['_services']['set'](_0x4989c1,_0x35c842),this['listenTo'](_0x35c842,'commentThreadAdded',(_0xfbff74,_0x44ed43)=>{const {commentThreadId:_0x504294,documentId:_0x10df8b,context:_0x367c8a,attributes:_0x45978a,resolvedAt:_0x5f159e,resolvedBy:_0x28b27a,comments:_0x581bf9}=_0x44ed43;_0x5a2c59['getCommentThread'](_0x504294)||_0x5a2c59['addCommentThread']({'threadId':_0x504294,'channelId':_0x10df8b,'comments':_0x581bf9?_0x581bf9['map'](b):[],'context':_0x367c8a,'attributes':_0x45978a,'resolvedAt':_0x5f159e,'resolvedBy':_0x28b27a,'isFromAdapter':!0x0});}),this['listenTo'](_0x35c842,'commentThreadUpdated',(_0x1671f0,{commentThreadId:_0x33903d,documentId:_0x17c854,context:_0x5acb4c,unlinkedAt:_0x558535,attributes:_0x462cbf})=>{_0x5a2c59['getCommentThread'](_0x33903d)&&_0x5a2c59['updateCommentThread']({'threadId':_0x33903d,'channelId':_0x17c854,'context':_0x5acb4c,'unlinkedAt':_0x558535,'attributes':_0x462cbf,'isFromAdapter':!0x0});}),this['listenTo'](_0x35c842,'commentThreadResolved',(_0x3fde63,{commentThreadId:_0x59b4de,resolvedBy:_0x4288e3,resolvedAt:_0x77f9f7})=>{const _0x1de6e4=_0x5a2c59['getCommentThread'](_0x59b4de);_0x1de6e4&&_0x1de6e4['resolve']({'resolvedBy':_0x4288e3,'resolvedAt':_0x77f9f7,'isFromAdapter':!0x0});}),this['listenTo'](_0x35c842,'commentThreadReopened',(_0x374773,{commentThreadId:_0x2c720e})=>{const _0x318ed8=_0x5a2c59['getCommentThread'](_0x2c720e);_0x318ed8&&_0x318ed8['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35c842,'commentThreadRemoved',(_0x4c9cdf,{commentThreadId:_0x5e9248})=>{const _0x5500bc=_0x5a2c59['getCommentThread'](_0x5e9248);_0x5500bc&&_0x5500bc['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35c842,'commentAdded',(_0x33c524,_0x28c969)=>{const _0x4dc778=_0x28c969['commentThreadId'],_0x1529ea=_0x5a2c59['getCommentThread'](_0x4dc778);_0x1529ea&&_0x1529ea['addComment']({...b(_0x28c969),'isFromAdapter':!0x0});}),this['listenTo'](_0x35c842,'commentUpdated',(_0x357979,{commentThreadId:_0x5b22bb,commentId:_0x31d67a,content:_0x49176c,attributes:_0x5e7cea})=>{const _0x1c168e=_0x5a2c59['getCommentThread'](_0x5b22bb);if(_0x1c168e){const _0x3732c4=_0x1c168e['getComment'](_0x31d67a);_0x3732c4&&_0x3732c4['update']({'content':_0x49176c,'attributes':_0x5e7cea,'isFromAdapter':!0x0});}}),this['listenTo'](_0x35c842,'commentRemoved',(_0x1ca771,{commentThreadId:_0x1341e6,commentId:_0x217e26})=>{const _0x204942=_0x5a2c59['getCommentThread'](_0x1341e6);if(_0x204942){const _0x28d8dc=_0x204942['getComment'](_0x217e26);_0x28d8dc&&_0x28d8dc['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4989c1);}['destroy'](){if(this['context']instanceof _0x178f2b){const _0x251809=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x251809);}}['_terminateService'](_0x58c40a){if(!this['_services']['has'](_0x58c40a))throw new _0x331448('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x58c40a});this['_getService'](_0x58c40a)['disconnect'](),this['_services']['delete'](_0x58c40a);}async['reconnect'](){for(const _0x538d73 of this['_services']['keys']())await this['_connectService'](_0x538d73);if(this['context']instanceof _0x178f2b){const _0x39d640=this['context']['config']['get']('collaboration.channelId'),_0x22f32e=this['context']['plugins']['get'](r);_0x22f32e['unregister'](_0x39d640);const _0x21c31c=await this['_services']['get'](_0x39d640)['getConnectedSessions']();_0x22f32e['register'](_0x39d640,_0x21c31c);}}async['_connectService'](_0x4a21f9){const {connection:_0x83e95f}=this['context']['plugins']['get'](c),_0x3a31bd=this['context']['plugins']['get']('CommentsRepository'),_0x5624ad=this['_services']['get'](_0x4a21f9),_0x4cd0a2=await _0x5624ad['connect'](_0x83e95f);await this['_fetchMissingUsersForThreads'](_0x4cd0a2);const _0x2551b1=new Set(Array['from'](_0x3a31bd['getCommentThreads']({'channelId':_0x4a21f9}),_0xc71b82=>_0xc71b82['id']));for(const _0xa0fcdf of _0x4cd0a2)_0xa0fcdf['deletedAt']||_0x2551b1['delete'](_0xa0fcdf['commentThreadId']);for(const _0x4e14b6 of _0x2551b1)_0x3a31bd['getCommentThread'](_0x4e14b6)['remove']({'isFromAdapter':!0x0});for(const _0x244c4b of _0x4cd0a2){let _0x1fd98f=_0x3a31bd['getCommentThread'](_0x244c4b['commentThreadId']);const {commentThreadId:_0x543c62,context:_0x4506c1,attributes:_0x413683,resolvedBy:_0x8bf433,resolvedAt:_0x36cb84,unlinkedAt:_0x5452a0,deletedAt:_0x2898ae}=_0x244c4b;if(_0x2898ae)continue;_0x1fd98f||(_0x1fd98f=_0x3a31bd['addCommentThread']({'channelId':_0x4a21f9,'threadId':_0x543c62,'context':_0x4506c1,'attributes':_0x413683||{},'resolvedBy':_0x8bf433,'resolvedAt':_0x36cb84,'unlinkedAt':_0x5452a0,'isFromAdapter':!0x0}));const _0xcd8442=new Set(Array['from'](_0x1fd98f['comments'],_0xa5df70=>_0xa5df70['id']));for(const _0x17c50e of _0x244c4b['comments'])_0xcd8442['delete'](_0x17c50e['commentId']);for(const _0x2bae26 of _0xcd8442)_0x1fd98f['getComment'](_0x2bae26)['remove']({'isFromAdapter':!0x0});for(const _0x3a33a1 of _0x244c4b['comments']){const _0x412087=_0x1fd98f['getComment'](_0x3a33a1['commentId']);_0x412087?_0x412087['content']!==_0x3a33a1['content']&&_0x412087['update']({'content':_0x3a33a1['content'],'isFromAdapter':!0x0}):_0x1fd98f['addComment'](Object['assign'](b(_0x3a33a1),{'isFromAdapter':!0x0}));}}}['_getService'](_0x4154e8){if(!this['_services']['has'](_0x4154e8))throw new _0x331448('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4154e8});return this['_services']['get'](_0x4154e8);}async['_fetchMissingUsersForThreads'](_0x55fb39){const _0x4d58c7=this['context']['plugins']['get'](_0x11d8ec),{connection:_0x20f84f}=this['context']['plugins']['get'](c),_0x17b78d=new Set();for(const {resolvedBy:_0x38bad3,comments:_0x3c29c9}of _0x55fb39){_0x38bad3&&!_0x4d58c7['getUser'](_0x38bad3)&&_0x17b78d['add'](_0x38bad3);for(const {userId:_0xf8e522}of _0x3c29c9)_0x4d58c7['getUser'](_0xf8e522)||_0x17b78d['add'](_0xf8e522);}if(0x0===_0x17b78d['size'])return;const _0x2ffcb3=await mt['getMany'](_0x20f84f,Array['from'](_0x17b78d));for(const _0x57da91 of _0x2ffcb3)_0x4d58c7['getUser'](_0x57da91['id'])||_0x4d58c7['addUser'](_0x57da91);}}async function y(_0x1cfda8){if('404'!==_0x1cfda8['code'])throw _0x1cfda8;}function wt(_0x2f92a0){if((_0x42512c=_0x2f92a0)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x42512c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x42512c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x42512c;throw _0x2f92a0;}function b(_0x1fca42){return{'threadId':_0x1fca42['commentThreadId'],'commentId':_0x1fca42['commentId'],'content':_0x1fca42['content'],'createdAt':_0x1fca42['createdAt'],'authorId':_0x1fca42['userId'],'attributes':_0x1fca42['attributes']||{}};}class g extends _0x360d0e{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(
|
|
28
|
-
((()=>rt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',r,_0x11d8ec];}constructor(_0x3ee394){super(_0x3ee394);const _0x542a77=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new v['RevisionHistoryService'](_0x542a77);}async['init'](){const _0x505f17=this['editor']['plugins']['get'](l),_0x12ee0f=_0x505f17['serverHistory'],_0x49f432=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x12ee0f,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x505f17['sessionId']});const _0x318d89=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x22bb24=await ot['isBundleUploaded'](_0x49f432['connection'],_0x318d89);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4ed348})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4ed348)),'updateRevisions':async _0x2bbb5e=>{await this['_waitForServiceReady']();const _0x74eb87=this['_revisionTracker']['currentRevision'];if(_0x22bb24&&0x1===_0x2bbb5e['length']&&_0x2bbb5e[0x0]['id']===_0x74eb87['id'])return _0x2bbb5e;for(const _0x3d21c9 of _0x2bbb5e)_0x3d21c9['id']===_0x74eb87['id']&&(_0x3d21c9['isEmptyCurrent']=_0x3d21c9['fromVersion']===_0x3d21c9['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2bbb5e,this['_lastRequestId'])['then'](_0x58bfe7=>(this['_lastRequestId']=_0x58bfe7,_0x2bbb5e))['catch'](_0x48fd4f=>{if(nt(_0x48fd4f)||'400'===_0x48fd4f['code']&&void 0x0!==_0x48fd4f['data']['wrongRequestId']){for(const _0x164704 of _0x2bbb5e){!this['_revisionTracker']['repository']['getRevision'](_0x164704['id'])||this['_revisionTracker']['_bufferUpdate'](_0x164704['id'],_0x164704,!0x1);}if(nt(_0x48fd4f))throw _0x48fd4f;return _0x2bbb5e;}throw _0x48fd4f;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3e2a98,{revisionsData:_0x3cf5ac,requestId:_0x13b943})=>{Math['max'](..._0x3cf5ac['map'](_0x4b88cc=>_0x4b88cc['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3cf5ac,_0x13b943);}):this['_handleRevisionsUpdate'](_0x3cf5ac,_0x13b943);});const {revisions:_0x4244c8,requestId:_0x4f7486}=await this['_revisionHistoryService']['connect'](_0x49f432['connection']);_0x49f432['addToReconnectionStack'](this),this['_lastRequestId']=_0x4f7486,await this['_fetchMissingUsers'](_0x4244c8);for(const _0x2b4bc5 of _0x4244c8)this['_revisionTracker']['addRevisionData'](_0x2b4bc5);this['listenTo'](_0x505f17,'change:_isConnected',(_0x133578,_0x36c0bd,_0x23324c)=>{_0x23324c&&(this['_oldOffset']=_0x505f17['_offset'],_0x133578['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x49f432,'state',_0x66a3ce=>_0x66a3ce===_0x49bf8d['CONNECTED']);}async['reconnect'](){const _0x2b098d=this['editor']['plugins']['get'](c),_0x14dbab=this['editor']['plugins']['get'](l),_0x1cbdc3=async()=>{const _0x57a127=this['_revisionTracker']['currentRevision'],_0x49047c=_0x57a127['id'],_0x4c63ee=_0x49047c!==_0x14dbab['sessionId'];if(_0x4c63ee){const _0x55021c=_0x14dbab['_offset']-this['_oldOffset'],_0x1fa1ff=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x57a127['toVersion']+_0x55021c!==_0x1fa1ff){const _0x1d46ad=_0x57a127['fromVersion']+_0x55021c,_0xe205f=this['editor']['plugins']['get'](_0x11d8ec),_0x3342c3=this['_revisionTracker']['buildRevisionData']({'revision':_0x57a127,'from':_0x1d46ad,'to':_0x1fa1ff});_0x3342c3['id']=_0x57a127['id'];const _0x1908cb=_0x3342c3['authorsIds']['map'](_0x2b1efb=>_0xe205f['getUser'](_0x2b1efb));_0x57a127['_update']({..._0x3342c3,'authors':_0x1908cb},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x57a127['id'],_0x3342c3,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1fa1ff,(_0x57a127['toVersion']===_0x57a127['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x49047c)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x49047c),this['_revisionTracker']['_createCurrentRevision'](_0x1fa1ff));}const {revisions:_0x4e3dee,requestId:_0x303b22}=await this['_revisionHistoryService']['reconnect'](_0x2b098d['connection'],this['_lastRequestId']);_0x4c63ee&&_0x4e3dee['length']>0x0?_0x14dbab['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4e3dee),this['_handleRevisionsUpdate'](_0x4e3dee,_0x303b22),this['_revisionTracker']['sendBufferedUpdates']());};return _0x14dbab['_isConnected']?_0x1cbdc3():new Promise((_0x397d1e,_0x31936e)=>{_0x14dbab['once']('change:_isConnected',()=>{_0x1cbdc3()['then'](_0x397d1e)['catch'](_0x31936e);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x12e79d=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x2daafa=>{_0x2daafa['off'](),_0x12e79d();});});}['_getLatestVersionFromServerOperations'](){const _0x32972a=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x148884 of _0x32972a)if('marker'!==_0x148884['type']||_0x148884['affectsData'])return _0x148884['baseVersion']+0x1;}['_getLatestVersion'](){const _0x27fe96=this['editor']['plugins']['get'](l);return new Promise(_0x18bd47=>{_0x27fe96['_isPendingUpdate']?_0x27fe96['once']('change:_isPendingUpdate',()=>{_0x18bd47(this['_getLatestVersionFromServerOperations']());}):_0x18bd47(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5879de,_0x5b62f6){const _0x5d8e7d=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5b62f6;for(const _0xb30b94 of _0x5879de){const _0x309dbd=_0x5d8e7d['getRevision'](_0xb30b94['id']);if(_0x309dbd){if((_0xb30b94['fromVersion']||_0xb30b94['toVersion'])&&(_0xb30b94['diffData']=null),_0x309dbd===this['_revisionTracker']['currentRevision']){const _0x5b1db1=Math['max'](_0x309dbd['toVersion'],_0xb30b94['toVersion']),_0x2f3ced=Math['max'](_0x309dbd['fromVersion'],_0xb30b94['fromVersion']);let _0x2c375a;_0x309dbd['toVersion']===_0xb30b94['toVersion']&&_0x309dbd['fromVersion']===_0xb30b94['fromVersion']?(_0x2c375a=!0x0,this['_preventResendingRevisionData'](_0xb30b94)):_0xb30b94['toVersion']===_0x5b1db1&&_0xb30b94['fromVersion']===_0x2f3ced?_0x2c375a=!0x1:(_0x309dbd['toVersion']===_0x5b1db1&&_0x309dbd['fromVersion']===_0x2f3ced||this['_fixRevision']({'revision':_0x309dbd,'from':_0x2f3ced,'to':_0x5b1db1}),_0x2c375a=!0x0),_0x2c375a&&(delete _0xb30b94['fromVersion'],delete _0xb30b94['toVersion'],delete _0xb30b94['diffData'],delete _0xb30b94['createdAt'],delete _0xb30b94['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xb30b94),this['_preventResendingRevisionData'](_0xb30b94);}else this['_revisionTracker']['addRevisionData'](_0xb30b94);}const _0x3da220=_0x5d8e7d['getRevisions']();_0x3da220['reverse']();for(let _0x55c866=0x0;_0x55c866<_0x3da220['length']-0x1;_0x55c866++){const _0x31f234=_0x3da220[_0x55c866],_0x55cdb1=_0x3da220[_0x55c866+0x1];if(_0x31f234['fromVersion']<_0x55cdb1['toVersion']){const _0x3ddbf9=_0x55cdb1['toVersion'],_0x16f6f0=Math['max'](_0x3ddbf9,_0x31f234['toVersion']);this['_fixRevision']({'revision':_0x31f234,'from':_0x3ddbf9,'to':_0x16f6f0});}}}['_fixRevision']({revision:_0x2726e3,from:_0x203841,to:_0xf1d6d0}={}){const _0x53c3d6=this['editor']['plugins']['get'](_0x11d8ec),_0x38e7d6=this['_revisionTracker']['buildRevisionData']({'revision':_0x2726e3,'from':_0x203841,'to':_0xf1d6d0});_0x38e7d6['authors']=_0x38e7d6['authorsIds']['map'](_0x1fe60c=>_0x53c3d6['getUser'](_0x1fe60c)),_0x2726e3['_update'](_0x38e7d6);}['_preventResendingRevisionData'](_0x4d0087){const _0x3489fe={};_0x3489fe['id']=_0x4d0087['id'];for(const _0x1a2dfe of Object['keys'](_0x4d0087))'id'!==_0x1a2dfe&&(_0x3489fe[_0x1a2dfe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x3489fe['id'],_0x3489fe,!0x0);}async['_fetchMissingUsers'](_0xc854c){const _0x2f7817=this['editor']['plugins']['get'](_0x11d8ec),{connection:_0x540d9e}=this['editor']['plugins']['get'](c),_0x3e1092=new Set();for(const _0x1301d4 of _0xc854c){for(const _0x122c82 of _0x1301d4['authorsIds'])_0x482d4d(_0x122c82);_0x1301d4['creatorId']&&_0x482d4d(_0x1301d4['creatorId']);}if(0x0===_0x3e1092['size'])return;const _0x12a2b4=await mt['getMany'](_0x540d9e,Array['from'](_0x3e1092));for(const _0x4c2c42 of _0x12a2b4)_0x2f7817['getUser'](_0x4c2c42['id'])||_0x2f7817['addUser'](_0x4c2c42);function _0x482d4d(_0x5d12){_0x2f7817['getUser'](_0x5d12)||_0x3e1092['add'](_0x5d12);}}}function nt(_0x359ee1){return _0x359ee1['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x359ee1['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x359ee1['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class d extends _0x360d0e{static get['requires'](){return['RevisionHistory',v,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}}class ts extends _0x59eae8{constructor(_0x2b217a){super(_0x2b217a);const _0x56123a=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x56123a['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x56123a['to']('usersCount',_0x4cc3f8=>E(_0x2b217a,'CONNECTED_USERS',_0x4cc3f8))}]});}}class es extends _0x59eae8{['items'];['keystrokes'];constructor(_0x3920dc){super(_0x3920dc);const _0x241786=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4eab7e(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x241786['if']('hasPopup'),'aria-expanded':_0x241786['to']('isExpanded',_0x4cd94c=>this['hasPopup']&&String(_0x4cd94c)),'aria-label':_0x241786['to']('hasPopup',_0xf70adc=>E(_0x3920dc,_0xf70adc?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x241786['to']('hasPopup',_0x282880=>!!_0x282880&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x241786['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x1d7de8,_0x346f34,_0x45aa8e)=>{this['element']&&(_0x45aa8e?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 Z extends _0x59eae8{['counterView'];['inlineListView'];constructor(_0x2e203a){super(_0x2e203a);const _0x470505=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x2e203a),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x196121 of this['inlineListView']['items'])_0x196121['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',_0x470505['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class tt extends _0x59eae8{['listWrapperView'];constructor(_0x4fad3d,_0x1f8382){super(_0x4fad3d),this['listWrapperView']=new vt(_0x4fad3d,_0x1f8382),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x4fad3d,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x10303f{constructor(_0x2958d9,_0x4bbbe1){super(_0x2958d9);const _0x833682=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4bbbe1?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x833682['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x833682['to']('role'),'aria-label':_0x833682['to']('ariaLabel'),'aria-labelledby':_0x833682['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x31593e['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1023b7=this['element'];_0x1023b7&&(this['_isScrollable']=Math['max'](_0x1023b7['scrollHeight'],_0x1023b7['clientHeight'])>0.8*window['innerHeight']);}}class st extends ct{['userView'];constructor(_0x2a6a98,_0x39d153,_0x4f1754){super(_0x2a6a98);const _0xf42c7a=this['bindTemplate'];this['userView']=new lt(_0x2a6a98,_0x39d153);const _0x4bb608={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x39d153['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x39d153['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x39d153['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4f1754&&(_0x4bb608['tag']='button',_0x4bb608['on']={'click':_0xf42c7a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4bb608);}['focus'](){this['element']['focus']();}}class it extends _0x59eae8{['userView'];['markerView'];constructor(_0x560f2d,_0x4017cb,_0x43b294){super(_0x560f2d);const _0x315c38=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new lt(_0x560f2d,_0x4017cb),this['markerView']=new dt(_0x560f2d,_0x4017cb);const _0x4bb55c=new pt(_0x560f2d);_0x4bb55c['template']['tag']='span',_0x4bb55c['text']=_0x4017cb['name'];const _0x54e738={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x315c38['to']('isFocusable',_0x5ac654=>!!_0x5ac654&&0x0),'aria-labelledby':_0x4bb55c['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x315c38['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x315c38['to']('hasTooltip',_0x1310e0=>!_0x1310e0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4bb55c]};_0x43b294&&(_0x54e738['tag']='button',_0x54e738['on']={'click':_0x315c38['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x54e738);}}class dt extends _0x59eae8{constructor(_0x50e81d,_0x79e989){super(_0x50e81d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x79e989['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const et={'collapseAt':0x6,'displayMe':!0x0};class s extends _0x54552e{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x26a442){super(_0x26a442),this['context']['config']['define']('presenceList',et);const _0x5f0a0a=_0x26a442['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5f0a0a)throw new _0x331448('presencelist-collapseat-invalid-format',this);if(_0x5f0a0a<0x1)throw new _0x331448('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](r)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1ef5f7(),this['balloonPanelView']=new _0x367914(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[r];}['init'](){for(const _0x28e685 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x28e685);this['listenTo'](this['_allConnectedUsers'],'add',(_0x6d0708,_0x53c3a0)=>{this['_handleUserAdd'](_0x53c3a0);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x3fd202,_0x395699)=>{this['_handleUserRemove'](_0x395699);});}['_createView'](){const _0x1329c8=this['context'],_0x44cdfd=new Z(this['context']['locale']),_0x21f7bf=this['balloonPanelView'];if(!_0x53eb4c(_0x1329c8['config']['get']('presenceList.container')))throw new _0x331448('presencelist-missing-container',this);return _0x44cdfd['counterView']['bind']('usersCount')['to'](this),_0x44cdfd['bind']('isCollapsed')['to'](this,'usersCount',_0x4690b7=>{const {collapseAt:_0x386162,displayMe:_0x13c3f9}=_0x1329c8['config']['get']('presenceList'),_0x364ae8=_0x4690b7>=_0x386162;return _0x44cdfd['counterView']['isHidden']=!(0x1==_0x4690b7&&_0x13c3f9||_0x364ae8),_0x364ae8||this['hideDropdown'](),_0x364ae8;}),_0x44cdfd['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x63fadf=>{const _0x10f4c0=_0x1329c8['config']['get']('presenceList'),_0x2d8ebc=new it(_0x1329c8['locale'],_0x63fadf,!!_0x10f4c0['onClick']);return _0x2d8ebc['bind']('hasTooltip')['to'](_0x44cdfd,'isCollapsed',_0x23f83c=>!_0x23f83c),_0x2d8ebc['bind']('isFocusable')['to'](_0x44cdfd,'isCollapsed',_0xbef25c=>!_0xbef25c),_0x10f4c0['onClick']&&this['listenTo'](_0x2d8ebc,'execute',()=>{this['view']['isCollapsed']||_0x10f4c0['onClick'](_0x63fadf,_0x2d8ebc['element']);}),_0x2d8ebc;}),this['listenTo'](_0x44cdfd['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x44cdfd['inlineListView']['keystrokes']['set']('Enter',(_0xaf838a,_0x27bc90)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x27bc90());}),_0x44cdfd['render'](),_0x21f7bf['render'](),_0x18cb4({'emitter':_0x44cdfd,'activator':()=>_0x21f7bf['isVisible'],'contextElements':[_0x21f7bf['element'],_0x44cdfd['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1329c8['config']['get']('presenceList.container')['appendChild'](_0x44cdfd['element']),this['_bodyCollection']=new _0x15a38b(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x44cdfd;}['_handleUserAdd'](_0x3df455){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3df455['isMe'])return;const _0x13f9dc=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x13f9dc&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x2fdce9=_0x3df455['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3df455,_0x2fdce9);}['_handleUserRemove'](_0x47908b){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x47908b['id'])&&(this['currentDisplayedUsers']['remove'](_0x47908b['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x432607 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x432607['id']))return void this['currentDisplayedUsers']['add'](_0x432607,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x263179=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new tt(this['context']['locale'],!!_0x263179['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0xc267d2}=this['presenceDropdownView'];_0xc267d2['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x583c76=>{if(!_0x263179['displayMe']&&_0x583c76['isMe'])return null;const _0x42a2e8=new st(this['context']['locale'],_0x583c76,!!_0x263179['onClick']);return _0x263179['onClick']&&this['listenTo'](_0x42a2e8,'execute',()=>{_0x263179['onClick'](_0x583c76,_0x42a2e8['element']);}),_0x42a2e8;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0xc267d2['focus'](),_0xc267d2['checkIfScrollable']();const _0x132210=(_0x2f84dc,_0x418ac4)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x418ac4();};_0xc267d2['keystrokes']['set']('Esc',_0x132210),_0xc267d2['keystrokes']['set']('Shift+Tab',_0x132210),_0xc267d2['keystrokes']['set']('Tab',(_0x44f945,_0x23e318)=>{!function(_0xcc4f76){const _0x3f3c66=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4f1647=>_0x4f1647+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xb13084=[...document['body']['querySelectorAll'](_0x3f3c66)]['filter'](_0xe0393e=>_0xe0393e===document['activeElement']||_0xe0393e['offsetWidth']+_0xe0393e['offsetHeight']>0x0)['sort']((_0x545e43,_0x3171ac)=>(_0x545e43['tabIndex']||0x0)-(_0x3171ac['tabIndex']||0x0)),_0x1933ef=_0xb13084['indexOf'](_0xcc4f76),_0x2c48ec=_0xb13084[(_0x1933ef+0x1)%_0xb13084['length']];_0x2c48ec&&_0x2c48ec['focus']();}(this['view']['element']),this['hideDropdown'](),_0x23e318();}),_0xc267d2['focusTracker']['add'](this['view']['element']),_0xc267d2['focusTracker']['on']('change:isFocused',(_0xfe3a65,_0x498344,_0x51aaad)=>{_0x51aaad||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 _0x54552e{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 _0x536a58,Plugin as _0xa7b1dc,PendingActions as _0x2fc54a,Context as _0x20f32d}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x3e8a40,CKEditorError as _0x3e942c,Collection as _0x29beb2,global as _0x4bd3f5,version as ht,uid as _0x5c9614,KeystrokeHandler as _0x5b37f4}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x2e2629,View as _0x385240,ListView as _0x53e168,ListItemView as ct,LabelView as pt,BalloonPanelView as _0x19bb9a,clickOutsideHandler as _0x1293dd,BodyCollection as _0x54173d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ut,History as _0x5d978e,NoOperation as _0x5c431e,InsertOperation as _0x453615,MarkerOperation as _0x1128c5,RootAttributeOperation as _0x53a927,transformSets as _0x442640,OperationFactory as _0x168a4e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ft,WEB_SOCKET_GATEWAY_STATES as _0x2bb5ea,CollaborativeEditingService as _0x3c3a24,User as mt,CommentsService as tt,TrackChangesService as at,RevisionHistoryService as st,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x33926,UserView as lt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xe4dc0}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1d376a}from'lodash-es';class c extends _0x536a58{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x2e2629];}static get['pluginName'](){return'WebSocketGateway';}constructor(_0x29c2f7){super(_0x29c2f7),this['set']('state',_0x2bb5ea['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x3e8a40);}['init'](){const _0x56f4f3=this['context'],_0x464954=_0x56f4f3['plugins']['get']('CloudServices'),_0xf214d9=_0x56f4f3['plugins']['get'](_0x2e2629);if(!_0x464954['token'])throw new _0x3e942c('websocketgateway-missing-token',this);if(!_0x464954['webSocketUrl'])throw new _0x3e942c('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'](_0x464954['token'],_0x464954['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x179d7a=>{if(this['connection']=_0x179d7a,this['bind']('state')['to'](_0x179d7a,'state',this,'_isBrowserOffline',(_0x125ea5,_0x589ecb)=>('connected'!==_0x125ea5&&(this['_shouldPluginsReconnect']=!0x0),_0x589ecb||_0x125ea5!==_0x2bb5ea['CONNECTED']?_0x2bb5ea['DISCONNECTED']:this['state']==_0x2bb5ea['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x2bb5ea['CONNECTING']):_0x2bb5ea['CONNECTED'])),this['connection']['on']('error',(_0x5834a0,_0x25f1c4)=>{if('limitExceeded'!==_0x25f1c4['code'])throw console['error'](_0x25f1c4),new _0x3e942c('cloudservices-init',null,{'originalError':_0x25f1c4});_0xf214d9['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'});}),!_0x179d7a['me'])return new Promise(_0x54bd51=>_0x179d7a['on']('change:me',_0x54bd51));})['catch'](_0x17a4af=>{throw console['error'](_0x17a4af),new _0x3e942c('cloudservices-init',null,{'originalError':_0x17a4af});});}['addToReconnectionStack'](_0x27c6ae){if('function'!=typeof _0x27c6ae['reconnect'])throw new _0x3e942c('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x27c6ae))throw new _0x3e942c('websocketgateway-plugin-already-registered',this,{'name':_0x27c6ae['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x27c6ae);}['removeFromReconnectionStack'](_0x5795aa){this['_reconnectionStack']['delete'](_0x5795aa);}['isInReconnectionStack'](_0x2b4459){return this['_reconnectionStack']['has'](_0x2b4459);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x434818=>_0x434818['reconnect']())))['then'](()=>this['state']=_0x2bb5ea['CONNECTED'])['catch'](_0xe3fd40=>{throw console['error'](_0xe3fd40),new _0x3e942c('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x2bb5ea['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class r extends _0x536a58{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['requires'](){return[c,_0x33926];}constructor(_0x30e2aa){super(_0x30e2aa),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x29beb2(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x33926);}['init'](){const _0x35ba43=this['context']['plugins']['get'](c);this['listenTo'](_0x35ba43,'change:state',(_0x138d83,_0x1bf0a7,_0x75a0a)=>{if('connected'!==_0x75a0a)this['channelSessions']['forEach'](_0x40fbc0=>_0x40fbc0['clear']()),this['channelConnectedUsers']['forEach'](_0x581909=>_0x581909['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3e4b1d,_0x2831a0]of this['_registeredSessions'])for(const _0xaf3266 of _0x2831a0)this['_handleSessionAdd'](_0x3e4b1d,_0xaf3266);}}),this['_createUser'](_0x35ba43['connection']['me'],!0x0);}['register'](_0x3ee83f,_0xc7cb96){if(this['_registeredSessions']['has'](_0x3ee83f))throw new _0x3e942c('sessions-register-already-registered',null,{'channelId':_0x3ee83f});this['_registeredSessions']['set'](_0x3ee83f,_0xc7cb96),this['channelSessions']['set'](_0x3ee83f,new _0x29beb2()),this['channelConnectedUsers']['set'](_0x3ee83f,new _0x29beb2()),this['listenTo'](_0xc7cb96,'add',(_0x4ff7ab,_0x20dbb5)=>this['_handleSessionAdd'](_0x3ee83f,_0x20dbb5)),this['listenTo'](_0xc7cb96,'remove',(_0x3f358c,_0x1d0b72)=>this['_handleSessionRemove'](_0x3ee83f,_0x1d0b72));for(const _0x353232 of _0xc7cb96)this['_handleSessionAdd'](_0x3ee83f,_0x353232);}['unregister'](_0x356cd1){if(!this['_registeredSessions']['has'](_0x356cd1))throw new _0x3e942c('sessions-unregister-not-exist',null,{'channelId':_0x356cd1});const _0x4b8ae0=this['_registeredSessions']['get'](_0x356cd1);this['stopListening'](_0x4b8ae0);for(const _0xa0e9be of _0x4b8ae0)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x356cd1,_0xa0e9be);this['_registeredSessions']['delete'](_0x356cd1),this['channelSessions']['delete'](_0x356cd1),this['channelConnectedUsers']['delete'](_0x356cd1);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4cf57e){for(const _0x13906f of this['channelSessions']['values']())for(const _0xd098ef of _0x13906f)if(_0xd098ef['id']===_0x4cf57e)return _0xd098ef['user'];}['getUserSessions'](_0x22aa5d,_0x514275){const _0x14ede3=_0x514275?[this['channelSessions']['get'](_0x514275)]:this['channelSessions']['values'](),_0x169d38=new Set();for(const _0x47f868 of _0x14ede3)for(const _0x2f3e89 of _0x47f868)_0x2f3e89['user']['id']===_0x22aa5d['id']&&_0x169d38['add'](_0x2f3e89['id']);return _0x169d38;}['getUserRole'](_0x1330ca){for(const _0x58c4bb of this['channelSessions']['values']())for(const _0x370174 of _0x58c4bb)if(_0x370174['user']===_0x1330ca)return _0x370174['role'];}['_handleSessionAdd'](_0x5c9661,_0x41c572){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xcb8b90=_0x41c572['user'],_0x2e6ef7=this['_users']['getUser'](_0xcb8b90['id'])||this['_createUser'](_0xcb8b90),_0x59736c=Object['assign']({},_0x41c572,{'user':_0x2e6ef7});this['channelSessions']['get'](_0x5c9661)['add'](_0x59736c);const _0x3d1c10=this['channelConnectedUsers']['get'](_0x5c9661);_0x3d1c10['has'](_0x2e6ef7['id'])||_0x3d1c10['add'](_0x2e6ef7),this['allConnectedUsers']['has'](_0x2e6ef7['id'])||this['allConnectedUsers']['add'](_0x2e6ef7,_0x2e6ef7['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x5c9661,{'channelId':_0x5c9661,'session':_0x59736c});}['_handleSessionRemove'](_0x5ea8ca,_0x4ac991){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x5c60eb=this['channelConnectedUsers']['get'](_0x5ea8ca),_0xa881=_0x4ac991['user'];_0xa881['id']&&(this['channelSessions']['get'](_0x5ea8ca)['remove'](_0x4ac991['id']),_0x5c60eb['has'](_0xa881['id'])&&!this['getUserSessions'](_0xa881,_0x5ea8ca)['size']&&_0x5c60eb['remove'](_0xa881['id']),this['allConnectedUsers']['get'](_0xa881['id'])&&!this['getUserSessions'](_0xa881)['size']&&this['allConnectedUsers']['remove'](_0xa881['id']));}['_createUser'](_0x45a28c,_0x101aae){const _0x445bed=this['_users']['addUser'](_0x45a28c);return _0x101aae&&this['_users']['defineMe'](_0x45a28c['id']),_0x445bed['orderNumber']=this['_uniqueUsersCount']++,_0x445bed;}}class E extends _0xa7b1dc{['_domEmitter']=new(_0x3e8a40())();static get['requires'](){return[r];}static get['pluginName'](){return'UserMarkers';}['init'](){const _0x3611bc=this['editor'],_0x270891=_0x3611bc['plugins']['get'](r);_0x3611bc['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x134f02,{writer:_0x78b8c0})=>function(_0x356be4,_0x2ad6b0,_0x5df47f,_0x3a1a88){const _0x16d641=_0x356be4['markerName']['split'](':')[0x2],_0x2ebc2a=_0x5df47f['getUserBySessionId'](_0x16d641);if(!_0x2ebc2a||_0x16d641===_0x5df47f['mySessionId'])return;if(!_0x3a1a88['model']['schema']['checkChild'](_0x356be4['markerRange']['start'],'$text'))return;const _0x1399f3={'class':'ck-user__marker\x20'+_0x2ebc2a['color']['getMarkerClass'](),'data-name':_0x2ebc2a['name'],'data-session-id':_0x16d641},_0xad14a2=_0x3a1a88['model']['markers']['get'](_0x356be4['markerName']),_0x43cf76=_0xad14a2['getStart'](),_0x31e0e5=_0x43cf76['nodeAfter'],_0x40625f=_0x3a1a88['model']['schema'];if(_0x31e0e5&&_0x40625f['isObject'](_0x31e0e5)&&_0x40625f['isInline'](_0x31e0e5)&&!_0x3a1a88['model']['markers']['get']('user:range:'+_0x16d641)['getRange']()['isCollapsed'])return;const _0x2d91cd=_0x43cf76['parent'];return _0x3a1a88['model']['schema']['isLimit'](_0x2d91cd)&&!_0x3a1a88['model']['hasContent'](_0x2d91cd)&&(_0x1399f3['contenteditable']=!0x1),function(_0x35a116,_0x14480e,_0x115693){const _0x4e1409=_0x35a116['createUIElement']('span',_0x14480e);return _0x35a116['setCustomProperty']('userPositionMarker',!0x0,_0x4e1409),_0x4e1409['render']=function(_0x1ebe2d){const _0x35700a=this['toDomElement'](_0x1ebe2d);return _0x35700a['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>'+_0x115693['name']+'</span>',_0x35700a['addEventListener']('mouseenter',()=>{_0x35700a['classList']['add']('ck-user__marker_hovered');}),_0x35700a['addEventListener']('mouseleave',()=>{_0x35700a['classList']['remove']('ck-user__marker_hovered');}),_0x35700a;},_0x4e1409['isSimilar']=function(_0x4f05a6){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4f05a6['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4f05a6['getAttribute']('data-session-id'));},_0x4e1409;}(_0x2ad6b0,_0x1399f3,_0x2ebc2a);}(_0x134f02,_0x78b8c0,_0x270891,_0x3611bc)}),_0x3611bc['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xe6de7d=>function(_0x5a2355,_0x468def){const _0x2298d7=_0x5a2355['markerName']['split'](':')[0x2];if(_0x2298d7===_0x468def['mySessionId'])return null;const _0x462dd8=_0x468def['getUserBySessionId'](_0x2298d7);if(!_0x462dd8)return{'id':_0x2298d7,'classes':[]};return{'id':_0x2298d7,'classes':['ck-user__selection',_0x462dd8['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x2298d7},'priority':0x7d0+_0x462dd8['orderNumber']};}(_0xe6de7d,_0x270891)}),function(_0x1587e3){const _0x9a30c1=_0x1587e3['model'],_0x320f70=new Map(),_0x581b00=_0x1587e3['plugins']['get'](r);_0x9a30c1['markers']['on']('update:user:range',(_0x50bff6,_0x4ece31,_0x3c1271,_0x1fa7ce)=>{if(!_0x1fa7ce&&_0x320f70['get'](_0x4ece31['name']))return _0x320f70['get'](_0x4ece31['name'])['detach'](),void _0x320f70['delete'](_0x4ece31['name']);const _0x2e3a24=_0x4ece31['name']['split'](':')[0x2];if(_0x2e3a24===_0x581b00['mySessionId'])return;const _0x58b57f='user:position:'+_0x2e3a24;_0x9a30c1['markers']['has'](_0x58b57f)&&_0x1587e3['editing']['reconvertMarker'](_0x58b57f),_0x4ece31['on']('change:range',(_0x3ff10b,_0x348596,_0x41cb7e)=>{if('$graveyard'!=_0x348596['root']['rootName']&&'$graveyard'==_0x4ece31['getRange']()['root']['rootName']&&!_0x320f70['has'](_0x4ece31['name'])){const _0x5246df=_0x9a30c1['schema']['getNearestSelectionRange'](_0x41cb7e['deletionPosition']);if(_0x5246df){const _0x454f69=ut['fromRange'](_0x5246df);_0x320f70['set'](_0x4ece31['name'],_0x454f69),_0x454f69['on']('change:range',(_0x40dd9e,_0x20c975,_0x9c2299)=>{if('$graveyard'==_0x454f69['root']['rootName']){const _0x1b522b=_0x9a30c1['schema']['getNearestSelectionRange'](_0x9c2299['deletionPosition']);_0x1b522b?(_0x454f69['start']=_0x1b522b['start'],_0x454f69['end']=_0x1b522b['end']):(_0x320f70['delete'](_0x4ece31['name']),_0x454f69['detach']());}});}}});}),_0x9a30c1['document']['on']('change',()=>{_0x320f70['size']>0x0&&_0x9a30c1['enqueueChange']({'isUndoable':!0x1},_0x43ab9a=>{for(const [_0x33aa30,_0x1a667b]of _0x320f70)'$graveyard'==_0x9a30c1['markers']['get'](_0x33aa30)['getRange']()['root']['rootName']&&(Q(_0x33aa30['split'](':')[0x2],_0x1a667b['toRange'](),_0x9a30c1,_0x43ab9a),_0x1a667b['detach']());_0x320f70['clear']();});});}(_0x3611bc),this['_domEmitter']['listenTo'](_0x4bd3f5['document'],'keydown',(_0x3dbdf4,{key:_0x410669})=>{'Escape'===_0x410669&&function(_0x26ec35){_0x26ec35['editing']['view']['change'](_0x21b0f9=>{for(const _0x129548 of _0x26ec35['model']['markers']){if(!_0x129548['name']['startsWith']('user:position'))continue;const _0x239a45=_0x26ec35['editing']['mapper']['markerNameToElements'](_0x129548['name']);if(_0x239a45){for(const _0x5613ae of _0x239a45)_0x21b0f9['removeClass']('ck-user__marker_hovered',_0x5613ae);}}});}(_0x3611bc);},{'useCapture':!0x0});}['afterInit'](){const _0x2fe944=this['editor'],_0x26fb05=_0x2fe944['commands']['get']('undo');_0x26fb05&&_0x2fe944['model']['on']('applyOperation',(_0x8148fc,_0x586b17)=>{const _0x34092a=_0x586b17[0x0];if('marker'!=_0x34092a['type']||!_0x34092a['name']['startsWith']('user:'))return;const _0x1c131b=_0x34092a['batch'];_0x26fb05['_createdBatches']['has'](_0x1c131b)&&(_0x34092a['newRange']=_0x34092a['oldRange']?_0x2fe944['model']['createRange'](_0x34092a['oldRange']['start'],_0x34092a['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x26c213=this['editor'],_0x11b8c0=_0x26c213['model']['document'],_0xb0fc00=_0x26c213['plugins']['get'](r);_0x26c213['model']['enqueueChange']({'isUndoable':!0x1},_0x350506=>{const _0x80e26a='user:range:'+_0xb0fc00['mySessionId'],_0x3195b5='user:position:'+_0xb0fc00['mySessionId'],_0x2c73b3=_0x26c213['model']['markers']['has'](_0x80e26a);_0x26c213['editing']['view']['hasDomSelection']?Q(_0xb0fc00['mySessionId'],_0x11b8c0['selection']['getFirstRange'](),_0x26c213['model'],_0x350506):_0x2c73b3&&(_0x350506['removeMarker'](_0x80e26a),_0x350506['removeMarker'](_0x3195b5));});}}function Q(_0x422b45,_0x465332,_0x744c94,_0x9eaca0){const _0x47297b='user:range:'+_0x422b45,_0x5b2c5c='user:position:'+_0x422b45,_0x39396a=_0x465332['getContainedElement']();let _0xc25b7a=_0x465332['start'];_0x39396a&&_0x39396a['is']('element','tableCell')&&(_0xc25b7a=function(_0x32a310,_0x36049c){for(const _0x399564 of _0x32a310['getPositions']())if(_0x36049c['schema']['checkChild'](_0x399564,'$text'))return _0x399564;}(_0x465332,_0x744c94),_0x465332=_0x9eaca0['createRange'](_0xc25b7a));const _0x158141=_0x9eaca0['createRange'](_0xc25b7a);_0x744c94['markers']['has'](_0x47297b)?(_0x9eaca0['updateMarker'](_0x47297b,{'range':_0x465332}),_0x9eaca0['updateMarker'](_0x5b2c5c,{'range':_0x158141})):(_0x9eaca0['addMarker'](_0x47297b,{'range':_0x465332,'usingOperation':!0x0}),_0x9eaca0['addMarker'](_0x5b2c5c,{'range':_0x158141,'usingOperation':!0x0}));}function B(_0x23eb2b,_0x9213da,_0x5b48fb){const t=_0x23eb2b['t'];switch(_0x9213da){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'},_0x5b48fb);default:return'';}}let F=0x1;class l extends _0xa7b1dc{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x3c3a24)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,r,E,_0x2fc54a,_0x33926,_0x2e2629];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x262c2f=this['serverHistory']['getOperations']();for(let _0x3e0fde=_0x262c2f['length']-0x1;_0x3e0fde>=0x0;_0x3e0fde--){const _0xa56ed4=_0x262c2f[_0x3e0fde];if(!this['_disconnectionOperations']['has'](_0xa56ed4))return _0xa56ed4['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x50f3c4){if(super(_0x50f3c4),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5d978e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3e942c('collaboration-missing-channelid',this);const _0x5bbdf2=_0x50f3c4['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x5bbdf2,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xe4dc0(),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 G(this['_disconnectionOperations']);}['init'](){const _0x5bb65c=this['editor'],_0x14e5fe=_0x5bb65c['plugins']['get'](_0x33926),_0x16feb0=_0x5bb65c['plugins']['get'](c);this['listenTo'](_0x14e5fe,'getOperationAuthor',(_0x413785,_0xfafa93)=>{const _0x4f28f2=_0xfafa93[0x0];_0x4f28f2['_authorId']&&(_0x413785['return']=_0x14e5fe['getUser'](_0x4f28f2['_authorId']),_0x413785['stop']()),null===_0x4f28f2['_authorId']&&(_0x413785['return']=null,_0x413785['stop']());},{'priority':'high'}),this['listenTo'](_0x5bb65c['model']['document']['selection'],'change:range',(_0xbaf750,_0x2f1834)=>{_0x2f1834['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x5bb65c['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x5bb65c['model']['on']('applyOperation',(_0x553eb8,_0x56a339)=>{const _0x4b5596=_0x56a339[0x0];_0x4b5596['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4b5596),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x16feb0,'state',this,'_hasSynchronizationProblem',(_0x36f6c2,_0x33da08)=>'connected'===_0x36f6c2&&!_0x33da08),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x5bb65c['disableReadOnlyMode']('rtc-offline'):_0x5bb65c['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x5bb65c['disableReadOnlyMode']('rtc-offline'):_0x5bb65c['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4b413e=this['editor']['plugins']['get'](r),_0x2dee43=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x4b413e['unregister'](this['_channelId']);const _0x46eb34=await this['_service']['reconnect'](_0x2dee43['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x46eb34)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2c6b65=await this['_service']['getConnectedSessions']();_0x4b413e['register'](this['_channelId'],_0x2c6b65),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x10b97e){if(function(_0x5c7824){return'404'===_0x5c7824['code'];}(_0x10b97e)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4ab38e){return'409'===_0x4ab38e['code'];}(_0x10b97e)){const _0x16283a=B(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x16283a);}else{if(!(_0x10b97e instanceof H))throw _0x10b97e;this['_handleReconnectionError']();}}}}['destroy'](){const _0x103606=this['editor']['plugins']['get'](c),_0x5c788a=this['editor']['plugins']['get'](r);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5c788a['channelSessions']['has'](this['_channelId'])&&_0x5c788a['unregister'](this['_channelId']),_0x103606['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4d6567){if(this['sessionId']!==_0x4d6567['sessionId']&&this['_lastSyncedOperationId']!==_0x4d6567['lastOperationId'])throw new H();return this['sessionId']=_0x4d6567['sessionId'],this['_handleServerResponse']([],{..._0x4d6567,'wereChangesApplied':!0x1,'data':_0x4d6567['data']},'reconnect');}async['_connectService'](_0x39ae85,_0xe1fb33=!0x1){const {connection:_0x2e1b8b}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2e1b8b,this['_channelId'])['then'](_0x5596ad=>this['_initSessionsHandling'](_0x5596ad))['catch'](_0x666ec5=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x666ec5);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x215488,_0x281fef)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x281fef);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x45de4a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x39ae85);this['_isPendingUpdate']=!0x0;const _0x1580a1=await this['_service']['connect'](_0x2e1b8b,this['_compressOperations'](_0x39ae85),_0x45de4a);if(this['sessionId']=_0x1580a1['sessionId'],_0xe1fb33){if(!_0x1580a1['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x1580a1['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x39ae85,_0x1580a1,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x1580a1,_0x39ae85);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2ce99c=this['editor']['plugins']['get'](r),_0x257873=this['editor']['plugins']['get'](E),_0x39118d=_0x2ce99c['channelSessions']['get'](this['_channelId']);_0x39118d&&_0x39118d['length']>0x1?_0x257873['createUserMarkerOperations']():this['listenTo'](_0x2ce99c,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2ce99c['channelSessions']['get'](this['_channelId'])['length']&&_0x257873['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4ed7dd,_0x67ceb,_0x1dea7f,_0x39cf2d){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x67ceb){const _0xe7bc8c=this['_decompressOperations'](_0x1dea7f,_0x39cf2d);await this['_fetchMissingUsers'](_0xe7bc8c),this['_handleExternalOperations'](_0xe7bc8c,_0x67ceb,_0x1dea7f['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2dec11}=this['editor'];let _0x646a45;try{_0x646a45=await this['_service']['getDocumentDetails']();}catch(_0x5658f4){const _0x4e34cb=B(_0x2dec11,'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'](_0x4e34cb);}const _0x4c935c=_0x646a45['currentDocumentSession']||_0x646a45['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x4c935c['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x3e9b2f=B(_0x2dec11,'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'](_0x3e9b2f);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4ab9da){const _0x1d1448=this['editor']['plugins']['get'](r);this['listenTo'](_0x1d1448,'sessionAdd:'+this['_channelId'],(_0x290f52,{session:_0x4406d7})=>{if(_0x4406d7['id']===_0x1d1448['mySessionId']){_0x290f52['off']();const _0x9ce2bb=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x5df825=_0x4406d7['permissions'];_0x9ce2bb&&_0x9ce2bb['isEnabled']&&(_0x5df825=_0x5df825['filter'](_0x6c8700=>'document:write'!==_0x6c8700)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x5df825,this['_channelId']);}}),_0x1d1448['register'](this['_channelId'],_0x4ab9da);}['_initThrowingOnDataSet'](){const _0x512e4e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x40b8dc)=>{if(!_0x40b8dc[_0x40b8dc['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3e942c('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x512e4e['apply'](this['editor']['data'],_0x40b8dc);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x46112d,[_0x134484])=>{if(this['_document']['version'])throw new _0x3e942c('realtimecollaborationclient-init-document-already-initialized',this);_0x46112d['stop'](),this['_setPendingAction']();const _0x1f46d6=this['editor']['config']['get']('rootsAttributes'),_0x234891=this['_getOperationsFromInitData'](_0x134484,_0x1f46d6);0x0==_0x234891['length']&&_0x234891['push'](new _0x5c431e(0x0)),_0x46112d['return']=this['_connectService'](_0x234891)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2a1947=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2a1947))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x26db9a,[_0x2341f4,_0x192b7c])=>{_0x26db9a['stop']();const _0x419979=this['editor']['model']['document']['getRoot'](_0x2341f4);if(!this['_knownRootNames']['has'](_0x2341f4)){const _0x215043=_0x192b7c&&_0x192b7c['data']?_0x192b7c['data']:'',_0x1d745f=_0x192b7c&&_0x192b7c['attributes']?_0x192b7c['attributes']:{};await this['_loadRoot'](_0x2341f4,_0x215043,_0x1d745f);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x419979['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x419979);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xc43bfe){const _0x34a124=this['editor']['plugins']['get'](_0x33926),{connection:_0x45d478}=this['editor']['plugins']['get'](c),_0x1b6e6e=new Set();for(const _0x4551ee of _0xc43bfe){const _0x5a3ff6=_0x4551ee['_authorId'];_0x5a3ff6&&!_0x34a124['getUser'](_0x5a3ff6)&&_0x1b6e6e['add'](_0x5a3ff6);}if(0x0===_0x1b6e6e['size'])return;const _0x55d5a2=await mt['getMany'](_0x45d478,Array['from'](_0x1b6e6e));for(const _0x5d97e8 of _0x55d5a2)_0x34a124['getUser'](_0x5d97e8['id'])||_0x34a124['addUser'](_0x5d97e8);}['_getOperationsFromInitData'](_0x1b1f13,_0x42ec4d={}){const _0x4e895d=this['editor']['model'],_0x389956=[];let _0x1c5487=0x0;const _0x474cdc='string'==typeof _0x1b1f13?{'main':_0x1b1f13}:_0x1b1f13;for(const _0x403610 of Object['keys'](_0x474cdc)){if(!this['_document']['roots']['has'](_0x403610))throw new _0x3e942c('realtimecollaborationclient-init-non-existent-root',this);const _0x15f2fa=this['editor']['data']['parse'](_0x474cdc[_0x403610]),_0x106cf3=this['_document']['getRoot'](_0x403610),_0x54d687=new _0x453615(_0x4e895d['createPositionAt'](_0x106cf3,0x0),_0x15f2fa,_0x1c5487++);_0x389956['push'](_0x54d687);for(const [_0x3b7b1b,_0x3bc281]of _0x15f2fa['markers']){const _0x14e8d1=_0x4e895d['createRange'](_0x4e895d['createPositionFromPath'](_0x106cf3,_0x3bc281['start']['path']['slice']()),_0x4e895d['createPositionFromPath'](_0x106cf3,_0x3bc281['end']['path']['slice']())),_0xbe592f=new _0x1128c5(_0x3b7b1b,null,_0x14e8d1,_0x4e895d['markers'],!0x0,_0x1c5487++);_0x389956['push'](_0xbe592f);}}if(_0x42ec4d)for(const [_0x4494c4,_0x49a5e1]of Object['entries'](_0x42ec4d)){const _0x313c99=_0x4e895d['document']['getRoot'](_0x4494c4);if(!_0x313c99)throw new _0x3e942c('multi-root-editor-root-attributes-no-root',null);for(const [_0x4204b4,_0x39a7c7]of Object['entries'](_0x49a5e1))if(null!==_0x39a7c7){const _0xae97ba=new _0x53a927(_0x313c99,_0x4204b4,null,_0x39a7c7,_0x1c5487++);_0x389956['push'](_0xae97ba);}}return _0x389956;}async['_loadRoot'](_0x4d8fd6,_0x32b345,_0x57eada){this['_getOperationsFromInitData']({[_0x4d8fd6]:_0x32b345},{[_0x4d8fd6]:_0x57eada})['forEach']((_0x2d3102,_0x324021)=>{_0x2d3102['baseVersion']=this['_document']['version']+_0x324021,_0x2d3102['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2d3102);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x3b2eeb,_0x21d5d6){let _0x1f6631;this['_offset']=_0x3b2eeb['offset'];const _0x5d6a22=_0x3b2eeb['wereChangesApplied']&&!_0x3b2eeb['initData'],_0x284fc1=_0x5d6a22?0x0:_0x3b2eeb['data']['baseVersion'];if(_0x21d5d6['forEach'](_0x4a3b22=>{_0x4a3b22['_isInit']=!0x0,_0x4a3b22['createdAt']=_0x3b2eeb['sessionCreatedAt'],_0x4a3b22['_authorId']=null;}),_0x5d6a22)_0x1f6631=_0x21d5d6,this['_applyOperationsSet'](_0x1f6631,_0x5d6a22);else{if(_0x3b2eeb['initData']){const _0x2fd5d5=this['_getOperationsFromInitData'](_0x3b2eeb['initData']);this['_document']['history']['version']=-_0x2fd5d5['length'],_0x2fd5d5['forEach'](_0x19fd45=>{_0x19fd45['baseVersion']-=_0x2fd5d5['length'],_0x19fd45['createdAt']=_0x3b2eeb['sessionCreatedAt'],_0x19fd45['_isInit']=!0x0,_0x19fd45['_authorId']=null;}),this['_applyOperationsSet'](_0x2fd5d5,!0x0),this['serverHistory']['version']=-_0x2fd5d5['length']+this['_offset'],this['_updateServerHistory'](_0x2fd5d5);}this['_document']['history']['version']=_0x284fc1,_0x1f6631=this['_decompressOperations'](_0x3b2eeb['data'],_0x3b2eeb['metadata']),await this['_fetchMissingUsers'](_0x1f6631),this['_applyOperationsSet'](_0x1f6631,_0x5d6a22);}_0x3b2eeb['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f6631,_0x3b2eeb['lastOperationId']),this['_lastSyncedOperationId']=_0x3b2eeb['lastOperationId']),this['serverHistory']['version']=_0x284fc1+this['_offset'],this['_updateServerHistory'](_0x1f6631),_0x21d5d6['filter'](_0x4aebc5=>{const _0x3acfa0=this['_getAffectedRoot'](_0x4aebc5);return _0x3acfa0&&!this['_knownRootNames']['has'](_0x3acfa0);})['forEach']((_0x3a6be8,_0x52328a)=>{_0x3a6be8['baseVersion']=this['_document']['version']+_0x52328a,this['_saveOperationInBuffer'](_0x3a6be8);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0xa67e36,_0x1a1647){throw this['_isPendingUpdate']=!0x0,_0x1a1647&&console['error'](_0x1a1647),new _0x3e942c(_0xa67e36,this['editor']);}['_saveOperationInBuffer'](_0x26e39e){this['_knownOperations']['has'](_0x26e39e)||(this['_knownOperations']['add'](_0x26e39e),this['_bufferedOperations']['push'](_0x26e39e),this['_pendingAction']||'marker'==_0x26e39e['type']&&!_0x26e39e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xa417e7=!0x1){!_0xa417e7&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x5296f0=>{_0x5296f0&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2ff6a9=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x48dc3a){return _0x48dc3a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x48dc3a['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x48dc3a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2ff6a9))throw _0x2ff6a9;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5d9f18=>{this['on']('change:_isPendingUpdate',()=>{_0x5d9f18();});});}async['_sendBufferedOperations'](){const _0x466e86=this['editor']['plugins']['get'](E);if(this['_shouldSendSelectionUpdate']()&&(_0x466e86['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xcfffb=[...this['_bufferedOperations']];for(const _0x1bc466 of _0xcfffb)_0x1bc466['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1bc466);const _0x10c3a9=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xcfffb),_0x57aced=F++,_0x2ea5fa=this['_compressOperations'](_0xcfffb),_0x47c28d=await this['_service']['sendOperations'](_0x2ea5fa,_0x2ea5fa['baseVersion'],_0x10c3a9);try{return await this['_handleServerResponse'](_0xcfffb,_0x47c28d,_0x57aced);}catch(_0x4f57cc){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4f57cc);}}async['_handleServerResponse'](_0xc15c06,_0x1a70c6,_0x562e78){if('error'in _0x1a70c6)throw _0x1a70c6['error'];let _0x5daa36=!0x1;if(_0x1a70c6['wereChangesApplied']){_0x1a70c6['lastOperationId']&&(this['_lastSyncedOperationId']=_0x1a70c6['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x16345e=>!_0xc15c06['includes'](_0x16345e));for(const _0xe89915 of _0xc15c06)_0xe89915['createdAt']='lastOperationAcceptedAt'in _0x1a70c6&&_0x1a70c6['lastOperationAcceptedAt']||void 0x0;q(_0xc15c06,_0x1a70c6['version']-_0xc15c06['length']),this['_updateServerHistory'](_0xc15c06);const _0xdec1c2=_0xc15c06['filter'](_0x176ff3=>{if(!_0x176ff3['_isInit'])return!0x1;const _0x5e568b=this['_getAffectedRoot'](_0x176ff3);return _0x5e568b&&!this['_knownRootNames']['has'](_0x5e568b);});q(_0xdec1c2,this['_document']['version']),this['_applyOperationsSet'](_0xdec1c2),_0x5daa36=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x16bb00=this['_decompressOperations'](_0x1a70c6['data'],_0x1a70c6['metadata'])['filter'](_0x22e0bd=>_0x22e0bd['baseVersion']>=this['_lastServerVersion']);_0x16bb00['forEach'](_0x1545f1=>this['_addKnownRoot'](_0x1545f1)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2101e6=>!_0x2101e6['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2101e6))),this['_bufferedOperations']['length']&&q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x16bb00),_0x5daa36=this['_handleExternalOperations'](_0x16bb00,_0x1a70c6['version'],_0x1a70c6['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5daa36?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5155d1,_0x100738,_0x5f3db9){try{const _0x4e0891={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x19492f,operationsB:_0x59657a,originalOperations:_0x3bd364}=_0x442640(_0x5155d1,this['_bufferedOperations'],_0x4e0891);q(_0x19492f,this['_document']['version']),q(_0x59657a,_0x100738);for(const _0x1d82ca of _0x19492f){const _0x3164de=_0x3bd364['get'](_0x1d82ca);_0x1d82ca['_authorId']=_0x3164de?_0x3164de['_authorId']:null;}_0x5f3db9&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5155d1,_0x5f3db9),this['_lastSyncedOperationId']=_0x5f3db9),this['_bufferedOperations']=[..._0x59657a],this['_applyOperationsSet'](_0x19492f),this['_updateServerHistory'](_0x5155d1);}catch(_0x4031f8){return console['error'](_0x4031f8),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2cf54e,_0x4f1cf5=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x49a197=>{for(const _0x377bcf of _0x2cf54e)this['_knownOperations']['add'](_0x377bcf),this['_addKnownRoot'](_0x377bcf),_0x49a197['batch']['addOperation'](_0x377bcf),this['editor']['model']['applyOperation'](_0x377bcf);});}['_addKnownRoot'](_0x4c98d1){const _0x181569=this['_getAffectedRoot'](_0x4c98d1);_0x181569&&this['_knownRootNames']['add'](_0x181569);}['_getAffectedRoot'](_0x558798){let _0x1b5fff,_0x239423;switch(_0x558798['type']){case'insert':_0x1b5fff=_0x558798['position']['root'];break;case'marker':if(_0x239423=_0x558798['newRange'],!_0x239423)return null;_0x1b5fff=_0x239423['root'];break;case'addRootAttribute':_0x1b5fff=_0x558798['root'];break;case'addRoot':_0x1b5fff=_0x558798['affectedSelectable'];break;case'move':_0x1b5fff=_0x558798['targetPosition']['root'];break;default:return null;}return _0x1b5fff['rootName'];}['_updateServerHistory'](_0x334a38){_0x334a38['forEach'](_0x583496=>{const _0x4d0327=_0x583496['clone']();_0x4d0327['_authorId']=_0x583496['_authorId'],_0x4d0327['_isInit']=!!_0x583496['_isInit'],_0x4d0327['createdAt']=_0x583496['createdAt'],_0x4d0327['baseVersion']+=this['_offset'],_0x583496['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4d0327),this['serverHistory']['addOperation'](_0x4d0327);});}['_handleReconnectionError'](_0x152bfc){const _0xe6e2c=this['editor']['plugins']['get']('Notification'),_0x324ea9=this['editor']['locale'];_0x152bfc||(_0x152bfc=B(_0x324ea9,'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.')),_0xe6e2c['showWarning'](_0x152bfc,{'title':B(_0x324ea9,'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'](_0x2fc54a)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2fc54a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x84600b){const _0x23691d=_0x84600b['map'](_0x47e44d=>_0x47e44d['toJSON']());return this['_compressor']['compress'](_0x23691d);}['_decompressOperations'](_0x189f2d,_0x23bbfc){return this['_compressor']['decompress'](_0x189f2d)['map']((_0x59b030,_0x1db83e)=>{const _0x363ef7='init'==_0x23bbfc[_0x1db83e]['type'];if('InsertOperation'==_0x59b030['__className']){const _0x4188a1=_0x59b030['position']['root'];!this['_document']['getRoot'](_0x4188a1)&&(this['_document']['createRoot']('$root',_0x4188a1)['_isAttached']=!0x1);}const _0x3de89e=_0x168a4e['fromJSON'](_0x59b030,this['_document']);return _0x3de89e['wasUndone']=_0x59b030['wasUndone'],_0x3de89e['_isInit']=_0x363ef7,_0x3de89e['_authorId']=_0x363ef7?null:_0x23bbfc[_0x1db83e]['userId'],_0x3de89e['_isDisconnection']='cs:removeUser'===_0x23bbfc[_0x1db83e]['type'],_0x3de89e['createdAt']=_0x23bbfc[_0x1db83e]['createdAt'],_0x3de89e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4a7bcd=this['editor']['plugins']['get'](r)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4a7bcd&&_0x4a7bcd['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class H extends Error{}function q(_0x36623f,_0x262e43){for(const _0x51c720 of _0x36623f)_0x51c720['baseVersion']=_0x262e43++;}class G{['_ignoredOperations'];['_operationToId'];constructor(_0x5b1388){this['_ignoredOperations']=_0x5b1388,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xb9df7b){let _0x647415=_0xb9df7b['length'];for(;_0x647415--;){const _0x1de9e7=_0xb9df7b[_0x647415];if(!this['_ignoredOperations']['has'](_0x1de9e7)){if(!this['_operationToId']['has'](_0x1de9e7)){const _0x439ad7=_0x5c9614()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1de9e7,_0x439ad7);}return this['_operationToId']['get'](_0x1de9e7);}}}['setIdForTheLastOperation'](_0x509e83,_0x455514){if(!_0x455514)return;let _0x46f35f=_0x509e83['length'];for(;_0x46f35f--;){const _0x24bc73=_0x509e83[_0x46f35f];this['_ignoredOperations']['has'](_0x24bc73)||this['_operationToId']['set'](_0x24bc73,_0x455514);}}}class n extends _0xa7b1dc{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}}class a extends _0x536a58{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>tt)());['_services'];static get['requires'](){return[c,'CommentsRepository',r,_0x33926];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}constructor(_0x3511f0){super(_0x3511f0),this['_services']=new Map();}async['init'](){const _0x1067c8=this['context'],_0xac8901=_0x1067c8['plugins']['get']('CommentsRepository');if(_0x1067c8['plugins']['get'](c)['addToReconnectionStack'](this),_0xac8901['adapter']={'addCommentThread':async({channelId:_0x4d5226,threadId:_0xe4fe1b,comments:_0x5241f1,resolvedAt:_0xc6f331,resolvedBy:_0x34bbfc,context:_0x549dee,attributes:_0x55fc23})=>{const _0x44e3ee=await this['_getService'](_0x4d5226)['addCommentThread']({'commentThreadId':_0xe4fe1b,'comments':_0x5241f1['map'](_0xd6ed5d=>function(_0x2584d8,_0x5cd592,_0x2a5d75){return{'commentThreadId':_0x2a5d75,'commentId':_0x2584d8['commentId'],'userId':_0x2584d8['authorId'],'content':_0x2584d8['content'],'documentId':_0x5cd592,'createdAt':_0x2584d8['createdAt'],'attributes':_0x2584d8['attributes']||{}};}(_0xd6ed5d,_0x4d5226,_0xe4fe1b)),'resolvedAt':_0xc6f331,'resolvedBy':_0x34bbfc,'context':_0x549dee,'attributes':_0x55fc23})['catch'](wt);return{'threadId':_0x44e3ee['commentThreadId'],'comments':_0x44e3ee['comments']};},'getCommentThread':async({channelId:_0x4de9d5,threadId:_0x59be97})=>{const _0x2fa6ce=await this['_getService'](_0x4de9d5)['getCommentThread'](_0x59be97)['catch'](wt);return _0x2fa6ce['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2fa6ce]),{'threadId':_0x2fa6ce['commentThreadId'],'comments':_0x2fa6ce['comments']['map'](nt),'context':_0x2fa6ce['context'],'resolvedAt':_0x2fa6ce['resolvedAt'],'resolvedBy':_0x2fa6ce['resolvedBy'],'attributes':_0x2fa6ce['attributes']||{}});},'updateCommentThread':async({channelId:_0x580b41,threadId:_0x28fb1b,context:_0x27c919,unlinkedAt:_0x34ce07,attributes:_0xa31dfc})=>this['_getService'](_0x580b41)['updateCommentThread']({'commentThreadId':_0x28fb1b,'context':_0x27c919,'attributes':_0xa31dfc,'unlinkedAt':_0x34ce07})['catch'](et)['catch'](wt),'resolveCommentThread':async({channelId:_0x36f404,threadId:_0x4e7547})=>{const _0x2e85cb=await this['_getService'](_0x36f404)['resolveCommentThread'](_0x4e7547)['catch'](et)['catch'](wt);return{'threadId':_0x2e85cb['commentThreadId'],'resolvedAt':_0x2e85cb['resolvedAt'],'resolvedBy':_0x2e85cb['resolvedBy']};},'reopenCommentThread':async({channelId:_0x48de49,threadId:_0x456a40})=>this['_getService'](_0x48de49)['reopenCommentThread'](_0x456a40)['catch'](et)['catch'](wt),'removeCommentThread':({channelId:_0x1e2caf,threadId:_0xf1c540})=>this['_getService'](_0x1e2caf)['removeCommentThread'](_0xf1c540)['catch'](et)['catch'](wt),'addComment':({channelId:_0x38f035,threadId:_0x8c4302,commentId:_0x260e59,content:_0x3308d6,attributes:_0x2e629d})=>this['_getService'](_0x38f035)['addComment'](_0x8c4302,_0x260e59,_0x3308d6,_0x2e629d)['catch'](wt),'updateComment':({channelId:_0xcea788,threadId:_0x564917,commentId:_0x389c59,content:_0x260153,attributes:_0x1f32c3})=>this['_getService'](_0xcea788)['updateComment'](_0x564917,_0x389c59,_0x260153,_0x1f32c3)['catch'](et)['catch'](wt),'removeComment':({channelId:_0x5d154c,threadId:_0x30ff18,commentId:_0x5eb922})=>this['_getService'](_0x5d154c)['removeComment'](_0x30ff18,_0x5eb922)['catch'](et)['catch'](wt)},_0x1067c8 instanceof _0x20f32d){const _0x218e12=_0x1067c8['config']['get']('collaboration.channelId'),_0xef27e7=_0x1067c8['plugins']['get'](r);await this['_setUpService'](_0x218e12);const _0x1003d8=await this['_services']['get'](_0x218e12)['getConnectedSessions']();this['listenTo'](_0xef27e7,'sessionAdd:'+_0x218e12,(_0x422972,{session:_0x6fd060})=>{_0x6fd060['id']===_0xef27e7['mySessionId']&&(_0x422972['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x6fd060['permissions'],_0x218e12));}),_0xef27e7['register'](_0x218e12,_0x1003d8);}}async['_setUpService'](_0x586cc3){if(this['_services']['has'](_0x586cc3))throw new _0x3e942c('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x586cc3});const _0x2602e8=this['context']['plugins']['get']('CommentsRepository'),_0x4c27c2=new a['CommentsService'](_0x586cc3);this['_services']['set'](_0x586cc3,_0x4c27c2),this['listenTo'](_0x4c27c2,'commentThreadAdded',(_0x3c59d4,_0x231585)=>{const {commentThreadId:_0x3dfd42,documentId:_0x250eaa,context:_0x22a2f9,attributes:_0x573527,resolvedAt:_0x2f8144,resolvedBy:_0x305274,comments:_0x552426}=_0x231585;_0x2602e8['getCommentThread'](_0x3dfd42)||_0x2602e8['addCommentThread']({'threadId':_0x3dfd42,'channelId':_0x250eaa,'comments':_0x552426?_0x552426['map'](nt):[],'context':_0x22a2f9,'attributes':_0x573527,'resolvedAt':_0x2f8144,'resolvedBy':_0x305274,'isFromAdapter':!0x0});}),this['listenTo'](_0x4c27c2,'commentThreadUpdated',(_0x39dad5,{commentThreadId:_0x4382d1,documentId:_0x1eb63d,context:_0x33c590,unlinkedAt:_0x15c362,attributes:_0x13c701})=>{_0x2602e8['getCommentThread'](_0x4382d1)&&_0x2602e8['updateCommentThread']({'threadId':_0x4382d1,'channelId':_0x1eb63d,'context':_0x33c590,'unlinkedAt':_0x15c362,'attributes':_0x13c701,'isFromAdapter':!0x0});}),this['listenTo'](_0x4c27c2,'commentThreadResolved',(_0x548650,{commentThreadId:_0x50c050,resolvedBy:_0x207743,resolvedAt:_0x511cfb})=>{const _0x60be40=_0x2602e8['getCommentThread'](_0x50c050);_0x60be40&&_0x60be40['resolve']({'resolvedBy':_0x207743,'resolvedAt':_0x511cfb,'isFromAdapter':!0x0});}),this['listenTo'](_0x4c27c2,'commentThreadReopened',(_0x4d1ba8,{commentThreadId:_0x4ea58f})=>{const _0x362d76=_0x2602e8['getCommentThread'](_0x4ea58f);_0x362d76&&_0x362d76['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4c27c2,'commentThreadRemoved',(_0x2f0602,{commentThreadId:_0x178428})=>{const _0x442471=_0x2602e8['getCommentThread'](_0x178428);_0x442471&&_0x442471['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4c27c2,'commentAdded',(_0x25b4a1,_0x2bd06f)=>{const _0x238a74=_0x2bd06f['commentThreadId'],_0xe76df3=_0x2602e8['getCommentThread'](_0x238a74);_0xe76df3&&_0xe76df3['addComment']({...nt(_0x2bd06f),'isFromAdapter':!0x0});}),this['listenTo'](_0x4c27c2,'commentUpdated',(_0x3c8302,{commentThreadId:_0x4cfa4e,commentId:_0xa8840a,content:_0x54b434,attributes:_0x86efa})=>{const _0x4f4c45=_0x2602e8['getCommentThread'](_0x4cfa4e);if(_0x4f4c45){const _0x36466a=_0x4f4c45['getComment'](_0xa8840a);_0x36466a&&_0x36466a['update']({'content':_0x54b434,'attributes':_0x86efa,'isFromAdapter':!0x0});}}),this['listenTo'](_0x4c27c2,'commentRemoved',(_0x5545bc,{commentThreadId:_0x4c8fc9,commentId:_0x5b968c})=>{const _0x48c88e=_0x2602e8['getCommentThread'](_0x4c8fc9);if(_0x48c88e){const _0x11191e=_0x48c88e['getComment'](_0x5b968c);_0x11191e&&_0x11191e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x586cc3);}['destroy'](){if(this['context']instanceof _0x20f32d){const _0x54ab71=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x54ab71);}}['_terminateService'](_0x1b2bee){if(!this['_services']['has'](_0x1b2bee))throw new _0x3e942c('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1b2bee});this['_getService'](_0x1b2bee)['disconnect'](),this['_services']['delete'](_0x1b2bee);}async['reconnect'](){for(const _0x2500bf of this['_services']['keys']())await this['_connectService'](_0x2500bf);if(this['context']instanceof _0x20f32d){const _0x39fec6=this['context']['config']['get']('collaboration.channelId'),_0x4f5fd9=this['context']['plugins']['get'](r);_0x4f5fd9['unregister'](_0x39fec6);const _0x16312c=await this['_services']['get'](_0x39fec6)['getConnectedSessions']();_0x4f5fd9['register'](_0x39fec6,_0x16312c);}}async['_connectService'](_0x5237ce){const {connection:_0x30904e}=this['context']['plugins']['get'](c),_0x578933=this['context']['plugins']['get']('CommentsRepository'),_0x6b9de5=this['_services']['get'](_0x5237ce),_0x996e7b=await _0x6b9de5['connect'](_0x30904e);await this['_fetchMissingUsersForThreads'](_0x996e7b);const _0x3e54ef=new Set(Array['from'](_0x578933['getCommentThreads']({'channelId':_0x5237ce}),_0x12d2eb=>_0x12d2eb['id']));for(const _0x1a31f7 of _0x996e7b)_0x1a31f7['deletedAt']||_0x3e54ef['delete'](_0x1a31f7['commentThreadId']);for(const _0x521ed5 of _0x3e54ef)_0x578933['getCommentThread'](_0x521ed5)['remove']({'isFromAdapter':!0x0});for(const _0x4de3ca of _0x996e7b){let _0x3db2fa=_0x578933['getCommentThread'](_0x4de3ca['commentThreadId']);const {commentThreadId:_0x59ea75,context:_0x276a32,attributes:_0x1e813f,resolvedBy:_0x36afc9,resolvedAt:_0x5bb4cb,unlinkedAt:_0xee4adc,deletedAt:_0x3b3421}=_0x4de3ca;if(_0x3b3421)continue;_0x3db2fa||(_0x3db2fa=_0x578933['addCommentThread']({'channelId':_0x5237ce,'threadId':_0x59ea75,'context':_0x276a32,'attributes':_0x1e813f||{},'resolvedBy':_0x36afc9,'resolvedAt':_0x5bb4cb,'unlinkedAt':_0xee4adc,'isFromAdapter':!0x0}));const _0x2f099a=new Set(Array['from'](_0x3db2fa['comments'],_0x20faa6=>_0x20faa6['id']));for(const _0x50022c of _0x4de3ca['comments'])_0x2f099a['delete'](_0x50022c['commentId']);for(const _0xd672f4 of _0x2f099a)_0x3db2fa['getComment'](_0xd672f4)['remove']({'isFromAdapter':!0x0});for(const _0x351e41 of _0x4de3ca['comments']){const _0x1c5bd9=_0x3db2fa['getComment'](_0x351e41['commentId']);_0x1c5bd9?_0x1c5bd9['content']!==_0x351e41['content']&&_0x1c5bd9['update']({'content':_0x351e41['content'],'isFromAdapter':!0x0}):_0x3db2fa['addComment'](Object['assign'](nt(_0x351e41),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1e103b){if(!this['_services']['has'](_0x1e103b))throw new _0x3e942c('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1e103b});return this['_services']['get'](_0x1e103b);}async['_fetchMissingUsersForThreads'](_0x33a497){const _0x4ab273=this['context']['plugins']['get'](_0x33926),{connection:_0xd1ce78}=this['context']['plugins']['get'](c),_0x511ab7=new Set();for(const {resolvedBy:_0x3a5e00,comments:_0x310590}of _0x33a497){_0x3a5e00&&!_0x4ab273['getUser'](_0x3a5e00)&&_0x511ab7['add'](_0x3a5e00);for(const {userId:_0x5ae9d8}of _0x310590)_0x4ab273['getUser'](_0x5ae9d8)||_0x511ab7['add'](_0x5ae9d8);}if(0x0===_0x511ab7['size'])return;const _0x21ef6e=await mt['getMany'](_0xd1ce78,Array['from'](_0x511ab7));for(const _0x5c56b1 of _0x21ef6e)_0x4ab273['getUser'](_0x5c56b1['id'])||_0x4ab273['addUser'](_0x5c56b1);}}async function et(_0x23d153){if('404'!==_0x23d153['code'])throw _0x23d153;}function wt(_0x2dc18b){if((_0x3b7e09=_0x2dc18b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x3b7e09['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3b7e09['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x3b7e09;throw _0x2dc18b;}function nt(_0x769613){return{'threadId':_0x769613['commentThreadId'],'commentId':_0x769613['commentId'],'content':_0x769613['content'],'createdAt':_0x769613['createdAt'],'authorId':_0x769613['userId'],'attributes':_0x769613['attributes']||{}};}class g extends _0xa7b1dc{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(_0x9c33e7){super(_0x9c33e7);const _0x526931=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new g['TrackChangesService'](_0x526931);}['init'](){const _0x975255=this['editor']['plugins']['get'](c),_0x5a9c7b=this['editor']['plugins']['get']('TrackChangesEditing');return _0x5a9c7b['adapter']={'getSuggestion':async _0x4ff8ee=>{await this['_waitForServiceReady']();const _0x33c292=await this['_trackChangesService']['get'](_0x4ff8ee)['catch'](ot);return await this['_fetchMissingUsersForThreads']([_0x33c292]),_0x33c292;},'addSuggestion':async({id:_0x424371,type:_0x1ef7a9,data:_0x5c4534,originalSuggestionId:_0x5d1f8b,attributes:_0x440d55})=>{await this['_waitForServiceReady']();const _0x197a7e={'id':_0x424371,'type':_0x1ef7a9,'data':_0x5c4534,'originalSuggestionId':_0x5d1f8b,'attributes':_0x440d55},_0x5e8253=await this['_trackChangesService']['add'](_0x424371,_0x1ef7a9,_0x5c4534,_0x5d1f8b,_0x440d55)['catch'](_0x27b359=>{if(gt(_0x27b359))return new Promise(_0x39fdfd=>{this['_bufferedRequests']['set'](_0x424371,{'resolve':_0x39fdfd,'suggestionData':_0x197a7e});});throw _0x27b359;});return this['_bufferedRequests']['delete'](_0x424371),_0x5e8253;},'updateSuggestion':async(_0x4f63e2,_0x4a348e)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4a348e['state'])return this['_trackChangesService']['update'](_0x4f63e2,_0x4a348e)['catch'](ot);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x31f9e8,_0xb74ef0)=>{_0x5a9c7b['hasSuggestion'](_0xb74ef0['id'])&&(_0x5a9c7b['getSuggestion'](_0xb74ef0['id'])['attributes']=_0xb74ef0['attributes']);}),this['_trackChangesService']['connect'](_0x975255['connection'])['then'](_0x3503b7=>(_0x975255['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x3503b7)['then'](()=>{for(const _0x35c285 of _0x3503b7){_0x5a9c7b['addSuggestionData'](_0x35c285)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5738a6=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3e0149}=this['editor']['plugins']['get'](c),_0x4ba96=await this['_trackChangesService']['connect'](_0x3e0149);await this['_fetchMissingUsersForThreads'](_0x4ba96);for(const {suggestionData:_0x385b98,resolve:_0x13eb8a}of this['_bufferedRequests']['values']()){let _0x5b3dc7=_0x4ba96['find'](_0x4f7ba2=>_0x4f7ba2['id']===_0x385b98['id']);_0x5b3dc7||(_0x5b3dc7=await this['_trackChangesService']['add'](_0x385b98['id'],_0x385b98['type'],_0x385b98['data'],_0x385b98['originalSuggestionId'])),_0x13eb8a(_0x5b3dc7);}for(const _0x33ff89 of _0x4ba96)_0x5738a6['hasSuggestion'](_0x33ff89['id'])||_0x5738a6['addSuggestionData'](_0x33ff89);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x5b758b=>{this['listenTo'](this['_trackChangesService'],'connected',_0x18fe6c=>{_0x18fe6c['off'](),_0x5b758b();});});}async['_fetchMissingUsersForThreads'](_0x4ff03e){const _0x597ab8=this['editor']['plugins']['get'](_0x33926),{connection:_0x49d13e}=this['editor']['plugins']['get'](c),_0xaaec92=new Set();for(const {authorId:_0x438971}of _0x4ff03e)_0x597ab8['getUser'](_0x438971)||_0xaaec92['add'](_0x438971);if(0x0===_0xaaec92['size'])return;const _0x156095=await mt['getMany'](_0x49d13e,Array['from'](_0xaaec92));for(const _0x1c091f of _0x156095)_0x597ab8['getUser'](_0x1c091f['id'])||_0x597ab8['addUser'](_0x1c091f);}}function ot(_0x58a52c){if(gt(_0x58a52c))return new Promise(()=>{});throw _0x58a52c;}function gt(_0x39465b){return _0x39465b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x39465b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0xa7b1dc{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}['init'](){const _0x13e643=this['editor']['plugins']['get'](c),_0x33d227=this['editor']['plugins']['get']('CommentsEditing'),_0x4c6a1c=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x13e643,'change:state',(_0x428786,_0x4a8081,_0x36f916)=>{_0x33d227['isThreadsLoadingPaused']='connected'!==_0x36f916;});}),this['listenTo'](_0x13e643,'change:state',(_0x946506,_0x141f6f,_0x11b5db)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x11b5db);}),_0x4c6a1c['_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 _0xa7b1dc{static get['requires'](){return[m,g,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}}class v extends _0xa7b1dc{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>st)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',r,_0x33926];}constructor(_0x241461){super(_0x241461);const _0x193b2a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new v['RevisionHistoryService'](_0x193b2a);}async['init'](){const _0x120eaf=this['editor']['plugins']['get'](l),_0x486785=_0x120eaf['serverHistory'],_0x3a4268=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x486785,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x120eaf['sessionId']});const _0x3765b0=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x5d8100=await it['isBundleUploaded'](_0x3a4268['connection'],_0x3765b0);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4717b9})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4717b9)),'updateRevisions':async _0x89835=>{await this['_waitForServiceReady']();const _0x5ea356=this['_revisionTracker']['currentRevision'];if(_0x5d8100&&0x1===_0x89835['length']&&_0x89835[0x0]['id']===_0x5ea356['id'])return _0x89835;for(const _0x59ac87 of _0x89835)_0x59ac87['id']===_0x5ea356['id']&&(_0x59ac87['isEmptyCurrent']=_0x59ac87['fromVersion']===_0x59ac87['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x89835,this['_lastRequestId'])['then'](_0x2e40d6=>(this['_lastRequestId']=_0x2e40d6,_0x89835))['catch'](_0x1c5f31=>{if(rt(_0x1c5f31)||'400'===_0x1c5f31['code']&&void 0x0!==_0x1c5f31['data']['wrongRequestId']){for(const _0x48adb9 of _0x89835){!this['_revisionTracker']['repository']['getRevision'](_0x48adb9['id'])||this['_revisionTracker']['_bufferUpdate'](_0x48adb9['id'],_0x48adb9,!0x1);}if(rt(_0x1c5f31))throw _0x1c5f31;return _0x89835;}throw _0x1c5f31;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1d13c5,{revisionsData:_0x58a501,requestId:_0x143934})=>{Math['max'](..._0x58a501['map'](_0x4fa1b8=>_0x4fa1b8['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x58a501,_0x143934);}):this['_handleRevisionsUpdate'](_0x58a501,_0x143934);});const {revisions:_0x5b1296,requestId:_0x4f8523}=await this['_revisionHistoryService']['connect'](_0x3a4268['connection']);_0x3a4268['addToReconnectionStack'](this),this['_lastRequestId']=_0x4f8523,await this['_fetchMissingUsers'](_0x5b1296);for(const _0x4c74cb of _0x5b1296)this['_revisionTracker']['addRevisionData'](_0x4c74cb);this['listenTo'](_0x120eaf,'change:_isConnected',(_0x38d819,_0x107320,_0x4bfe3e)=>{_0x4bfe3e&&(this['_oldOffset']=_0x120eaf['_offset'],_0x38d819['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3a4268,'state',_0x155d3e=>_0x155d3e===_0x2bb5ea['CONNECTED']);}async['reconnect'](){const _0x40a373=this['editor']['plugins']['get'](c),_0x9c463a=this['editor']['plugins']['get'](l),_0x38f48f=async()=>{const _0x30d9d4=this['_revisionTracker']['currentRevision'],_0x4f0836=_0x30d9d4['id'],_0x23a32a=_0x4f0836!==_0x9c463a['sessionId'];if(_0x23a32a){const _0x16ed7a=_0x9c463a['_offset']-this['_oldOffset'],_0x2de1dc=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x30d9d4['toVersion']+_0x16ed7a!==_0x2de1dc){const _0x15c147=_0x30d9d4['fromVersion']+_0x16ed7a,_0x65033a=this['editor']['plugins']['get'](_0x33926),_0x2f58d2=this['_revisionTracker']['buildRevisionData']({'revision':_0x30d9d4,'from':_0x15c147,'to':_0x2de1dc});_0x2f58d2['id']=_0x30d9d4['id'];const _0x395cb5=_0x2f58d2['authorsIds']['map'](_0x17dfe5=>_0x65033a['getUser'](_0x17dfe5));_0x30d9d4['_update']({..._0x2f58d2,'authors':_0x395cb5},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x30d9d4['id'],_0x2f58d2,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2de1dc,(_0x30d9d4['toVersion']===_0x30d9d4['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x4f0836)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x4f0836),this['_revisionTracker']['_createCurrentRevision'](_0x2de1dc));}const {revisions:_0x37ca28,requestId:_0x52a0c1}=await this['_revisionHistoryService']['reconnect'](_0x40a373['connection'],this['_lastRequestId']);_0x23a32a&&_0x37ca28['length']>0x0?_0x9c463a['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x37ca28),this['_handleRevisionsUpdate'](_0x37ca28,_0x52a0c1),this['_revisionTracker']['sendBufferedUpdates']());};return _0x9c463a['_isConnected']?_0x38f48f():new Promise((_0x541b1f,_0x4451bb)=>{_0x9c463a['once']('change:_isConnected',()=>{_0x38f48f()['then'](_0x541b1f)['catch'](_0x4451bb);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x321112=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x48a285=>{_0x48a285['off'](),_0x321112();});});}['_getLatestVersionFromServerOperations'](){const _0xad7e02=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0xefcf35 of _0xad7e02)if('marker'!==_0xefcf35['type']||_0xefcf35['affectsData'])return _0xefcf35['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1b15b6=this['editor']['plugins']['get'](l);return new Promise(_0x3adb0c=>{_0x1b15b6['_isPendingUpdate']?_0x1b15b6['once']('change:_isPendingUpdate',()=>{_0x3adb0c(this['_getLatestVersionFromServerOperations']());}):_0x3adb0c(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x17905c,_0x12f9d3){const _0x43c764=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x12f9d3;for(const _0x138b3b of _0x17905c){const _0x2e09c1=_0x43c764['getRevision'](_0x138b3b['id']);if(_0x2e09c1){if((_0x138b3b['fromVersion']||_0x138b3b['toVersion'])&&(_0x138b3b['diffData']=null),_0x2e09c1===this['_revisionTracker']['currentRevision']){const _0x442440=Math['max'](_0x2e09c1['toVersion'],_0x138b3b['toVersion']),_0x260a12=Math['max'](_0x2e09c1['fromVersion'],_0x138b3b['fromVersion']);let _0x15b684;_0x2e09c1['toVersion']===_0x138b3b['toVersion']&&_0x2e09c1['fromVersion']===_0x138b3b['fromVersion']?(_0x15b684=!0x0,this['_preventResendingRevisionData'](_0x138b3b)):_0x138b3b['toVersion']===_0x442440&&_0x138b3b['fromVersion']===_0x260a12?_0x15b684=!0x1:(_0x2e09c1['toVersion']===_0x442440&&_0x2e09c1['fromVersion']===_0x260a12||this['_fixRevision']({'revision':_0x2e09c1,'from':_0x260a12,'to':_0x442440}),_0x15b684=!0x0),_0x15b684&&(delete _0x138b3b['fromVersion'],delete _0x138b3b['toVersion'],delete _0x138b3b['diffData'],delete _0x138b3b['createdAt'],delete _0x138b3b['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x138b3b),this['_preventResendingRevisionData'](_0x138b3b);}else this['_revisionTracker']['addRevisionData'](_0x138b3b);}const _0x2b5d70=_0x43c764['getRevisions']();_0x2b5d70['reverse']();for(let _0x5d4e88=0x0;_0x5d4e88<_0x2b5d70['length']-0x1;_0x5d4e88++){const _0x558feb=_0x2b5d70[_0x5d4e88],_0x59786f=_0x2b5d70[_0x5d4e88+0x1];if(_0x558feb['fromVersion']<_0x59786f['toVersion']){const _0x4890c7=_0x59786f['toVersion'],_0x23db74=Math['max'](_0x4890c7,_0x558feb['toVersion']);this['_fixRevision']({'revision':_0x558feb,'from':_0x4890c7,'to':_0x23db74});}}}['_fixRevision']({revision:_0x1b0c4a,from:_0x5f4d74,to:_0x5b2f8e}={}){const _0x29c1e9=this['editor']['plugins']['get'](_0x33926),_0x5e0891=this['_revisionTracker']['buildRevisionData']({'revision':_0x1b0c4a,'from':_0x5f4d74,'to':_0x5b2f8e});_0x5e0891['authors']=_0x5e0891['authorsIds']['map'](_0xbe4793=>_0x29c1e9['getUser'](_0xbe4793)),_0x1b0c4a['_update'](_0x5e0891);}['_preventResendingRevisionData'](_0x1a271){const _0x3d6c3d={};_0x3d6c3d['id']=_0x1a271['id'];for(const _0x15ebcd of Object['keys'](_0x1a271))'id'!==_0x15ebcd&&(_0x3d6c3d[_0x15ebcd]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x3d6c3d['id'],_0x3d6c3d,!0x0);}async['_fetchMissingUsers'](_0x47ab8f){const _0x469a32=this['editor']['plugins']['get'](_0x33926),{connection:_0x405773}=this['editor']['plugins']['get'](c),_0x2ad0fe=new Set();for(const _0x2320cd of _0x47ab8f){for(const _0xacf529 of _0x2320cd['authorsIds'])_0x144ed3(_0xacf529);_0x2320cd['creatorId']&&_0x144ed3(_0x2320cd['creatorId']);}if(0x0===_0x2ad0fe['size'])return;const _0x2f7bfe=await mt['getMany'](_0x405773,Array['from'](_0x2ad0fe));for(const _0x25c5db of _0x2f7bfe)_0x469a32['getUser'](_0x25c5db['id'])||_0x469a32['addUser'](_0x25c5db);function _0x144ed3(_0x24e64c){_0x469a32['getUser'](_0x24e64c)||_0x2ad0fe['add'](_0x24e64c);}}}function rt(_0x38101d){return _0x38101d['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x38101d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x38101d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class d extends _0xa7b1dc{static get['requires'](){return['RevisionHistory',v,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}}class ts extends _0x385240{constructor(_0x1745df){super(_0x1745df);const _0x1593ba=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x1593ba['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x1593ba['to']('usersCount',_0x2a3387=>B(_0x1745df,'CONNECTED_USERS',_0x2a3387))}]});}}class es extends _0x385240{['items'];['keystrokes'];constructor(_0x249130){super(_0x249130);const _0x58a8d1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5b37f4(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x58a8d1['if']('hasPopup'),'aria-expanded':_0x58a8d1['to']('isExpanded',_0x23ec78=>this['hasPopup']&&String(_0x23ec78)),'aria-label':_0x58a8d1['to']('hasPopup',_0x2be9e6=>B(_0x249130,_0x2be9e6?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x58a8d1['to']('hasPopup',_0x3afc40=>!!_0x3afc40&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x58a8d1['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x57c85b,_0x397a20,_0x2d13a8)=>{this['element']&&(_0x2d13a8?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 _0x385240{['counterView'];['inlineListView'];constructor(_0xc76b03){super(_0xc76b03);const _0x1cacdf=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0xc76b03),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x281af7 of this['inlineListView']['items'])_0x281af7['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',_0x1cacdf['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x385240{['listWrapperView'];constructor(_0xd7da29,_0x1d20a8){super(_0xd7da29),this['listWrapperView']=new vt(_0xd7da29,_0x1d20a8),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0xd7da29,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x53e168{constructor(_0x386bca,_0x7609f8){super(_0x386bca);const _0x4fdce0=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x7609f8?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4fdce0['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4fdce0['to']('role'),'aria-label':_0x4fdce0['to']('ariaLabel'),'aria-labelledby':_0x4fdce0['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x4bd3f5['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x22ad99=this['element'];_0x22ad99&&(this['_isScrollable']=Math['max'](_0x22ad99['scrollHeight'],_0x22ad99['clientHeight'])>0.8*window['innerHeight']);}}class k extends ct{['userView'];constructor(_0x2b68b5,_0x49d38c,_0x355ddf){super(_0x2b68b5);const _0x2a74b3=this['bindTemplate'];this['userView']=new lt(_0x2b68b5,_0x49d38c);const _0x97e11d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x49d38c['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x49d38c['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x49d38c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x355ddf&&(_0x97e11d['tag']='button',_0x97e11d['on']={'click':_0x2a74b3['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x97e11d);}['focus'](){this['element']['focus']();}}class y extends _0x385240{['userView'];['markerView'];constructor(_0x3e734b,_0x2b41bb,_0x18a9da){super(_0x3e734b);const _0x4311b5=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new lt(_0x3e734b,_0x2b41bb),this['markerView']=new dt(_0x3e734b,_0x2b41bb);const _0x295d83=new pt(_0x3e734b);_0x295d83['template']['tag']='span',_0x295d83['text']=_0x2b41bb['name'];const _0x2636fa={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x4311b5['to']('isFocusable',_0xee6d23=>!!_0xee6d23&&0x0),'aria-labelledby':_0x295d83['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x4311b5['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x4311b5['to']('hasTooltip',_0x15c5a8=>!_0x15c5a8),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x295d83]};_0x18a9da&&(_0x2636fa['tag']='button',_0x2636fa['on']={'click':_0x4311b5['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2636fa);}}class dt extends _0x385240{constructor(_0x3940af,_0x1ee82b){super(_0x3940af),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1ee82b['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class s extends _0x536a58{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x287df0){super(_0x287df0),this['context']['config']['define']('presenceList',A);const _0x3d07a4=_0x287df0['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3d07a4)throw new _0x3e942c('presencelist-collapseat-invalid-format',this);if(_0x3d07a4<0x1)throw new _0x3e942c('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](r)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x29beb2(),this['balloonPanelView']=new _0x19bb9a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[r];}['init'](){for(const _0x4b90e5 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4b90e5);this['listenTo'](this['_allConnectedUsers'],'add',(_0x147fd0,_0x4fdc09)=>{this['_handleUserAdd'](_0x4fdc09);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x21f2c8,_0x5e1ee2)=>{this['_handleUserRemove'](_0x5e1ee2);});}['_createView'](){const _0x4d40a3=this['context'],_0x385988=new L(this['context']['locale']),_0x285063=this['balloonPanelView'];if(!_0x1d376a(_0x4d40a3['config']['get']('presenceList.container')))throw new _0x3e942c('presencelist-missing-container',this);return _0x385988['counterView']['bind']('usersCount')['to'](this),_0x385988['bind']('isCollapsed')['to'](this,'usersCount',_0x2cfb1d=>{const {collapseAt:_0xebe0d9,displayMe:_0x3399b4}=_0x4d40a3['config']['get']('presenceList'),_0x53cd46=_0x2cfb1d>=_0xebe0d9;return _0x385988['counterView']['isHidden']=!(0x1==_0x2cfb1d&&_0x3399b4||_0x53cd46),_0x53cd46||this['hideDropdown'](),_0x53cd46;}),_0x385988['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4b2132=>{const _0x1538e1=_0x4d40a3['config']['get']('presenceList'),_0x661c81=new y(_0x4d40a3['locale'],_0x4b2132,!!_0x1538e1['onClick']);return _0x661c81['bind']('hasTooltip')['to'](_0x385988,'isCollapsed',_0x43cb05=>!_0x43cb05),_0x661c81['bind']('isFocusable')['to'](_0x385988,'isCollapsed',_0x756db0=>!_0x756db0),_0x1538e1['onClick']&&this['listenTo'](_0x661c81,'execute',()=>{this['view']['isCollapsed']||_0x1538e1['onClick'](_0x4b2132,_0x661c81['element']);}),_0x661c81;}),this['listenTo'](_0x385988['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x385988['inlineListView']['keystrokes']['set']('Enter',(_0x123bc0,_0x1a04c0)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x1a04c0());}),_0x385988['render'](),_0x285063['render'](),_0x1293dd({'emitter':_0x385988,'activator':()=>_0x285063['isVisible'],'contextElements':[_0x285063['element'],_0x385988['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4d40a3['config']['get']('presenceList.container')['appendChild'](_0x385988['element']),this['_bodyCollection']=new _0x54173d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x385988;}['_handleUserAdd'](_0x431baf){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x431baf['isMe'])return;const _0x14fc9b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x14fc9b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x4aff74=_0x431baf['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x431baf,_0x4aff74);}['_handleUserRemove'](_0x44126d){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x44126d['id'])&&(this['currentDisplayedUsers']['remove'](_0x44126d['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x443cce of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x443cce['id']))return void this['currentDisplayedUsers']['add'](_0x443cce,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x2ba537=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x2ba537['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x1d1809}=this['presenceDropdownView'];_0x1d1809['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x264f9b=>{if(!_0x2ba537['displayMe']&&_0x264f9b['isMe'])return null;const _0x241b95=new k(this['context']['locale'],_0x264f9b,!!_0x2ba537['onClick']);return _0x2ba537['onClick']&&this['listenTo'](_0x241b95,'execute',()=>{_0x2ba537['onClick'](_0x264f9b,_0x241b95['element']);}),_0x241b95;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1d1809['focus'](),_0x1d1809['checkIfScrollable']();const _0x5c7d11=(_0x105b00,_0xc028bc)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0xc028bc();};_0x1d1809['keystrokes']['set']('Esc',_0x5c7d11),_0x1d1809['keystrokes']['set']('Shift+Tab',_0x5c7d11),_0x1d1809['keystrokes']['set']('Tab',(_0x4740bf,_0x1c60db)=>{!function(_0x5f05df){const _0x2ba971=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x55d974=>_0x55d974+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x53e52a=[...document['body']['querySelectorAll'](_0x2ba971)]['filter'](_0x2d1b51=>_0x2d1b51===document['activeElement']||_0x2d1b51['offsetWidth']+_0x2d1b51['offsetHeight']>0x0)['sort']((_0x1c068c,_0x3a5548)=>(_0x1c068c['tabIndex']||0x0)-(_0x3a5548['tabIndex']||0x0)),_0x1d8e74=_0x53e52a['indexOf'](_0x5f05df),_0x40058c=_0x53e52a[(_0x1d8e74+0x1)%_0x53e52a['length']];_0x40058c&&_0x40058c['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1c60db();}),_0x1d1809['focusTracker']['add'](this['view']['element']),_0x1d1809['focusTracker']['on']('change:isFocused',(_0x40e28e,_0x127b59,_0x37318d)=>{_0x37318d||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 _0x536a58{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':_0x4f8cbd=>0x0==_0x4f8cbd?0x0:0x1==_0x4f8cbd?0x1:0x2==_0x4f8cbd?0x2:_0x4f8cbd%0x64>=0x3&&_0x4f8cbd%0x64<=0xa?0x3:_0x4f8cbd%0x64>=0xb&&_0x4f8cbd%0x64<=0x63?0x4:0x5}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x3452d9=>{const {ar:{dictionary:_0x108e0f,getPluralForm:_0x427e13}}={'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':_0x2a32ee=>0x0==_0x2a32ee?0x0:0x1==_0x2a32ee?0x1:0x2==_0x2a32ee?0x2:_0x2a32ee%0x64>=0x3&&_0x2a32ee%0x64<=0xa?0x3:_0x2a32ee%0x64>=0xb&&_0x2a32ee%0x64<=0x63?0x4:0x5}};_0x3452d9['ar']||={'dictionary':{},'getPluralForm':null},_0x3452d9['ar']['dictionary']=Object['assign'](_0x3452d9['ar']['dictionary'],_0x108e0f),_0x3452d9['ar']['getPluralForm']=_0x427e13;})(window['CKEDITOR_TRANSLATIONS']||={});
|