@ckeditor/ckeditor5-real-time-collaboration 43.2.0-alpha.7 → 43.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- package/build/translations/af.js +1 -0
- package/build/translations/ast.js +1 -0
- package/build/translations/az.js +1 -0
- package/build/translations/bs.js +1 -0
- package/build/translations/cs.js +1 -1
- package/build/translations/en-gb.js +1 -0
- package/build/translations/eo.js +1 -0
- package/build/translations/es-co.js +1 -0
- package/build/translations/es.js +1 -1
- package/build/translations/eu.js +1 -0
- package/build/translations/fa.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gu.js +1 -0
- package/build/translations/he.js +1 -1
- package/build/translations/hy.js +1 -0
- package/build/translations/it.js +1 -1
- package/build/translations/jv.js +1 -0
- package/build/translations/kk.js +1 -0
- package/build/translations/km.js +1 -0
- package/build/translations/kn.js +1 -0
- package/build/translations/ku.js +1 -0
- package/build/translations/lt.js +1 -1
- package/build/translations/nb.js +1 -0
- package/build/translations/ne.js +1 -0
- package/build/translations/oc.js +1 -0
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -0
- package/build/translations/sk.js +1 -1
- package/build/translations/sl.js +1 -0
- package/build/translations/sq.js +1 -0
- package/build/translations/ti.js +1 -0
- package/build/translations/tt.js +1 -0
- package/build/translations/ug.js +1 -0
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -0
- package/build/translations/uz.js +1 -0
- package/dist/index-editor.css +10 -14
- package/dist/index.css +10 -14
- package/dist/index.js +6 -6
- package/dist/presencelist.d.ts +8 -0
- package/dist/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +8 -0
- package/dist/realtimecollaborativecomments.d.ts +8 -0
- package/dist/realtimecollaborativeediting/realtimecollaborationclient.d.ts +8 -0
- package/dist/realtimecollaborativeediting/sessions.d.ts +8 -0
- package/dist/realtimecollaborativeediting/usermarkers.d.ts +8 -0
- package/dist/realtimecollaborativeediting/websocketgateway.d.ts +8 -0
- package/dist/realtimecollaborativeediting.d.ts +8 -0
- package/dist/realtimecollaborativerevisionhistory.d.ts +8 -0
- package/dist/realtimecollaborativetrackchanges.d.ts +8 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +23 -0
- package/dist/translations/af.umd.js +23 -0
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.d.ts +8 -0
- package/dist/translations/ast.js +23 -0
- package/dist/translations/ast.umd.js +23 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +23 -0
- package/dist/translations/az.umd.js +23 -0
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +23 -0
- package/dist/translations/bs.umd.js +23 -0
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +23 -0
- package/dist/translations/en-gb.umd.js +23 -0
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +23 -0
- package/dist/translations/eo.umd.js +23 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +23 -0
- package/dist/translations/es-co.umd.js +23 -0
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +23 -0
- package/dist/translations/eu.umd.js +23 -0
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.d.ts +8 -0
- package/dist/translations/gu.js +23 -0
- package/dist/translations/gu.umd.js +23 -0
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.d.ts +8 -0
- package/dist/translations/hy.js +23 -0
- package/dist/translations/hy.umd.js +23 -0
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +23 -0
- package/dist/translations/jv.umd.js +23 -0
- package/dist/translations/kk.d.ts +8 -0
- package/dist/translations/kk.js +23 -0
- package/dist/translations/kk.umd.js +23 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +23 -0
- package/dist/translations/km.umd.js +23 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +23 -0
- package/dist/translations/kn.umd.js +23 -0
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +23 -0
- package/dist/translations/ku.umd.js +23 -0
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +23 -0
- package/dist/translations/nb.umd.js +23 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +23 -0
- package/dist/translations/ne.umd.js +23 -0
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.d.ts +8 -0
- package/dist/translations/oc.js +23 -0
- package/dist/translations/oc.umd.js +23 -0
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.d.ts +8 -0
- package/dist/translations/si.js +23 -0
- package/dist/translations/si.umd.js +23 -0
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +23 -0
- package/dist/translations/sl.umd.js +23 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +23 -0
- package/dist/translations/sq.umd.js +23 -0
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +23 -0
- package/dist/translations/ti.umd.js +23 -0
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +23 -0
- package/dist/translations/tt.umd.js +23 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +23 -0
- package/dist/translations/ug.umd.js +23 -0
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +23 -0
- package/dist/translations/ur.umd.js +23 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +23 -0
- package/dist/translations/uz.umd.js +23 -0
- 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/lang/translations/af.po +54 -0
- package/lang/translations/ar.po +4 -10
- package/lang/translations/ast.po +54 -0
- package/lang/translations/az.po +54 -0
- package/lang/translations/bg.po +3 -9
- package/lang/translations/bn.po +3 -9
- package/lang/translations/bs.po +55 -0
- package/lang/translations/ca.po +3 -9
- package/lang/translations/cs.po +4 -11
- package/lang/translations/da.po +3 -9
- package/lang/translations/de-ch.po +3 -9
- package/lang/translations/de.po +3 -9
- package/lang/translations/el.po +3 -9
- package/lang/translations/en-au.po +3 -9
- package/lang/translations/en-gb.po +54 -0
- package/lang/translations/en.po +5 -11
- package/lang/translations/eo.po +54 -0
- package/lang/translations/es-co.po +54 -0
- package/lang/translations/es.po +4 -11
- package/lang/translations/et.po +3 -9
- package/lang/translations/eu.po +54 -0
- package/lang/translations/fa.po +4 -11
- package/lang/translations/fi.po +3 -9
- package/lang/translations/fr.po +4 -11
- package/lang/translations/gl.po +3 -9
- package/lang/translations/gu.po +54 -0
- package/lang/translations/he.po +4 -11
- package/lang/translations/hi.po +3 -9
- package/lang/translations/hr.po +4 -10
- package/lang/translations/hu.po +3 -9
- package/lang/translations/hy.po +54 -0
- package/lang/translations/id.po +3 -9
- package/lang/translations/it.po +4 -11
- package/lang/translations/ja.po +3 -9
- package/lang/translations/jv.po +54 -0
- package/lang/translations/kk.po +54 -0
- package/lang/translations/km.po +53 -0
- package/lang/translations/kn.po +54 -0
- package/lang/translations/ko.po +3 -9
- package/lang/translations/ku.po +54 -0
- package/lang/translations/lt.po +4 -11
- package/lang/translations/lv.po +4 -10
- package/lang/translations/ms.po +3 -9
- package/lang/translations/nb.po +54 -0
- package/lang/translations/ne.po +54 -0
- package/lang/translations/nl.po +3 -9
- package/lang/translations/no.po +3 -9
- package/lang/translations/oc.po +54 -0
- package/lang/translations/pl.po +4 -11
- package/lang/translations/pt-br.po +4 -11
- package/lang/translations/pt.po +4 -11
- package/lang/translations/ro.po +4 -10
- package/lang/translations/ru.po +4 -11
- package/lang/translations/si.po +54 -0
- package/lang/translations/sk.po +4 -11
- package/lang/translations/sl.po +56 -0
- package/lang/translations/sq.po +54 -0
- package/lang/translations/sr-latn.po +4 -10
- package/lang/translations/sr.po +4 -10
- package/lang/translations/sv.po +3 -9
- package/lang/translations/th.po +3 -9
- package/lang/translations/ti.po +54 -0
- package/lang/translations/tk.po +3 -9
- package/lang/translations/tr.po +3 -9
- package/lang/translations/tt.po +53 -0
- package/lang/translations/ug.po +53 -0
- package/lang/translations/uk.po +4 -11
- package/lang/translations/ur.po +54 -0
- package/lang/translations/uz.po +54 -0
- package/lang/translations/vi.po +3 -9
- package/lang/translations/zh-cn.po +3 -9
- package/lang/translations/zh.po +3 -9
- package/package.json +10 -10
- 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.d.ts +8 -0
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +8 -0
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
- package/src/realtimecollaborativecomments.d.ts +8 -0
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +8 -0
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
- package/src/realtimecollaborativeediting/sessions.d.ts +8 -0
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.d.ts +8 -0
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.d.ts +8 -0
- package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
- package/src/realtimecollaborativeediting.d.ts +8 -0
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
- package/src/realtimecollaborativerevisionhistory.d.ts +8 -0
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
- package/src/realtimecollaborativetrackchanges.d.ts +8 -0
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x249e5d];}static get['pluginName'](){return'WebSocketGateway';}constructor(_0x4fdd8e){super(_0x4fdd8e),this['set']('state',_0x131e8c['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x183a7f);}['init'](){const _0x8d8d3=this['context'],_0x3a23ed=_0x8d8d3['plugins']['get']('CloudServices'),_0x378cfb=_0x8d8d3['plugins']['get'](_0x249e5d);if(!_0x3a23ed['token'])throw new _0x3f3cf1('websocketgateway-missing-token',this);if(!_0x3a23ed['webSocketUrl'])throw new _0x3f3cf1('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'](_0x3a23ed['token'],_0x3a23ed['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2a7305=>{if(this['connection']=_0x2a7305,this['bind']('state')['to'](_0x2a7305,'state',this,'_isBrowserOffline',(_0x1b183b,_0x3f3259)=>('connected'!==_0x1b183b&&(this['_shouldPluginsReconnect']=!0x0),_0x3f3259||_0x1b183b!==_0x131e8c['CONNECTED']?_0x131e8c['DISCONNECTED']:this['state']==_0x131e8c['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x131e8c['CONNECTING']):_0x131e8c['CONNECTED'])),this['connection']['on']('error',(_0x4c8334,_0x315d45)=>{if('limitExceeded'!==_0x315d45['code'])throw console['error'](_0x315d45),new _0x3f3cf1('cloudservices-init',null,{'originalError':_0x315d45});_0x378cfb['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'});}),!_0x2a7305['me'])return new Promise(_0x2631bf=>_0x2a7305['on']('change:me',_0x2631bf));})['catch'](_0x36cbde=>{throw console['error'](_0x36cbde),new _0x3f3cf1('cloudservices-init',null,{'originalError':_0x36cbde});});}['addToReconnectionStack'](_0x3aa6ef){if('function'!=typeof _0x3aa6ef['reconnect'])throw new _0x3f3cf1('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3aa6ef))throw new _0x3f3cf1('websocketgateway-plugin-already-registered',this,{'name':_0x3aa6ef['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3aa6ef);}['removeFromReconnectionStack'](_0x3f44c7){this['_reconnectionStack']['delete'](_0x3f44c7);}['isInReconnectionStack'](_0xd68b37){return this['_reconnectionStack']['has'](_0xd68b37);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x505322=>_0x505322['reconnect']())))['then'](()=>this['state']=_0x131e8c['CONNECTED'])['catch'](_0x38589b=>{throw console['error'](_0x38589b),new _0x3f3cf1('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x131e8c['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class r extends _0xb4909c{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['requires'](){return[c,_0x5b2741];}constructor(_0x234db6){super(_0x234db6),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3d03ac(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5b2741);}['init'](){const _0x387433=this['context']['plugins']['get'](c);this['listenTo'](_0x387433,'change:state',(_0x3b128b,_0x4ccb2d,_0x10010f)=>{if('connected'!==_0x10010f)this['channelSessions']['forEach'](_0x1f282d=>_0x1f282d['clear']()),this['channelConnectedUsers']['forEach'](_0x2924cf=>_0x2924cf['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x473337,_0x405a4d]of this['_registeredSessions'])for(const _0x4e2fff of _0x405a4d)this['_handleSessionAdd'](_0x473337,_0x4e2fff);}}),this['_createUser'](_0x387433['connection']['me'],!0x0);}['register'](_0x158583,_0x37b1c8){if(this['_registeredSessions']['has'](_0x158583))throw new _0x3f3cf1('sessions-register-already-registered',null,{'channelId':_0x158583});this['_registeredSessions']['set'](_0x158583,_0x37b1c8),this['channelSessions']['set'](_0x158583,new _0x3d03ac()),this['channelConnectedUsers']['set'](_0x158583,new _0x3d03ac()),this['listenTo'](_0x37b1c8,'add',(_0x23515a,_0x5d3e17)=>this['_handleSessionAdd'](_0x158583,_0x5d3e17)),this['listenTo'](_0x37b1c8,'remove',(_0x535268,_0x4c378e)=>this['_handleSessionRemove'](_0x158583,_0x4c378e));for(const _0x293509 of _0x37b1c8)this['_handleSessionAdd'](_0x158583,_0x293509);}['unregister'](_0x1d5260){if(!this['_registeredSessions']['has'](_0x1d5260))throw new _0x3f3cf1('sessions-unregister-not-exist',null,{'channelId':_0x1d5260});const _0x4c7c2b=this['_registeredSessions']['get'](_0x1d5260);this['stopListening'](_0x4c7c2b);for(const _0x39472f of _0x4c7c2b)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x1d5260,_0x39472f);this['_registeredSessions']['delete'](_0x1d5260),this['channelSessions']['delete'](_0x1d5260),this['channelConnectedUsers']['delete'](_0x1d5260);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x3830e1){for(const _0x5a2a05 of this['channelSessions']['values']())for(const _0x1b7f5f of _0x5a2a05)if(_0x1b7f5f['id']===_0x3830e1)return _0x1b7f5f['user'];}['getUserSessions'](_0xeceb6,_0x22220f){const _0x52b2a3=_0x22220f?[this['channelSessions']['get'](_0x22220f)]:this['channelSessions']['values'](),_0xad4361=new Set();for(const _0x6f00ac of _0x52b2a3)for(const _0x41e36c of _0x6f00ac)_0x41e36c['user']['id']===_0xeceb6['id']&&_0xad4361['add'](_0x41e36c['id']);return _0xad4361;}['getUserRole'](_0x21ec11){for(const _0x2f5445 of this['channelSessions']['values']())for(const _0x3b789 of _0x2f5445)if(_0x3b789['user']===_0x21ec11)return _0x3b789['role'];}['_handleSessionAdd'](_0x3c4aac,_0x5c7cff){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1319f1=_0x5c7cff['user'],_0x381da2=this['_users']['getUser'](_0x1319f1['id'])||this['_createUser'](_0x1319f1),_0x1a7ac3=Object['assign']({},_0x5c7cff,{'user':_0x381da2});this['channelSessions']['get'](_0x3c4aac)['add'](_0x1a7ac3);const _0x4fbe8a=this['channelConnectedUsers']['get'](_0x3c4aac);_0x4fbe8a['has'](_0x381da2['id'])||_0x4fbe8a['add'](_0x381da2),this['allConnectedUsers']['has'](_0x381da2['id'])||this['allConnectedUsers']['add'](_0x381da2,_0x381da2['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3c4aac,{'channelId':_0x3c4aac,'session':_0x1a7ac3});}['_handleSessionRemove'](_0x45ec57,_0x4ae291){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x260430=this['channelConnectedUsers']['get'](_0x45ec57),_0x386b62=_0x4ae291['user'];_0x386b62['id']&&(this['channelSessions']['get'](_0x45ec57)['remove'](_0x4ae291['id']),_0x260430['has'](_0x386b62['id'])&&!this['getUserSessions'](_0x386b62,_0x45ec57)['size']&&_0x260430['remove'](_0x386b62['id']),this['allConnectedUsers']['get'](_0x386b62['id'])&&!this['getUserSessions'](_0x386b62)['size']&&this['allConnectedUsers']['remove'](_0x386b62['id']));}['_createUser'](_0x228cef,_0x542f36){const _0x4ac499=this['_users']['addUser'](_0x228cef);return _0x542f36&&this['_users']['defineMe'](_0x228cef['id']),_0x4ac499['orderNumber']=this['_uniqueUsersCount']++,_0x4ac499;}}class H extends _0x33017c{['_domEmitter']=new(_0x183a7f())();static get['requires'](){return[r];}static get['pluginName'](){return'UserMarkers';}['init'](){const _0x126c20=this['editor'],_0x2a1e69=_0x126c20['plugins']['get'](r);_0x126c20['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x210670,{writer:_0x426675})=>function(_0x2f2a28,_0x3b90d6,_0x241d6e,_0x30a2db){const _0x31850c=_0x2f2a28['markerName']['split'](':')[0x2],_0x39ae7c=_0x241d6e['getUserBySessionId'](_0x31850c);if(!_0x39ae7c||_0x31850c===_0x241d6e['mySessionId'])return;if(!_0x30a2db['model']['schema']['checkChild'](_0x2f2a28['markerRange']['start'],'$text'))return;const _0x5b5185={'class':'ck-user__marker\x20'+_0x39ae7c['color']['getMarkerClass'](),'data-name':_0x39ae7c['name'],'data-session-id':_0x31850c},_0x2b41d2=_0x30a2db['model']['markers']['get'](_0x2f2a28['markerName']),_0x1323fb=_0x2b41d2['getStart'](),_0x473ddd=_0x1323fb['nodeAfter'],_0x2b573a=_0x30a2db['model']['schema'];if(_0x473ddd&&_0x2b573a['isObject'](_0x473ddd)&&_0x2b573a['isInline'](_0x473ddd)&&!_0x30a2db['model']['markers']['get']('user:range:'+_0x31850c)['getRange']()['isCollapsed'])return;const _0x30728c=_0x1323fb['parent'];return _0x30a2db['model']['schema']['isLimit'](_0x30728c)&&!_0x30a2db['model']['hasContent'](_0x30728c)&&(_0x5b5185['contenteditable']=!0x1),function(_0x3a655e,_0x2e639d,_0x4c18a2){const _0x14907c=_0x3a655e['createUIElement']('span',_0x2e639d);return _0x3a655e['setCustomProperty']('userPositionMarker',!0x0,_0x14907c),_0x14907c['render']=function(_0x1fc103){const _0x3f4b58=this['toDomElement'](_0x1fc103);return _0x3f4b58['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>'+_0x4c18a2['name']+'</span>',_0x3f4b58['addEventListener']('mouseenter',()=>{_0x3f4b58['classList']['add']('ck-user__marker_hovered');}),_0x3f4b58['addEventListener']('mouseleave',()=>{_0x3f4b58['classList']['remove']('ck-user__marker_hovered');}),_0x3f4b58;},_0x14907c['isSimilar']=function(_0x809010){return!(!this['getCustomProperty']('userPositionMarker')||!_0x809010['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x809010['getAttribute']('data-session-id'));},_0x14907c;}(_0x3b90d6,_0x5b5185,_0x39ae7c);}(_0x210670,_0x426675,_0x2a1e69,_0x126c20)}),_0x126c20['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x566b5f=>function(_0x2fd8e8,_0x35190c){const _0x1ab979=_0x2fd8e8['markerName']['split'](':')[0x2];if(_0x1ab979===_0x35190c['mySessionId'])return null;const _0x189541=_0x35190c['getUserBySessionId'](_0x1ab979);if(!_0x189541)return{'id':_0x1ab979,'classes':[]};return{'id':_0x1ab979,'classes':['ck-user__selection',_0x189541['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x1ab979},'priority':0x7d0+_0x189541['orderNumber']};}(_0x566b5f,_0x2a1e69)}),function(_0x4b742c){const _0x3c578e=_0x4b742c['model'],_0x1bc107=new Map(),_0x9aa923=_0x4b742c['plugins']['get'](r);_0x3c578e['markers']['on']('update:user:range',(_0x2da7bd,_0x5cc694,_0x179462,_0x50d7d6)=>{if(!_0x50d7d6&&_0x1bc107['get'](_0x5cc694['name']))return _0x1bc107['get'](_0x5cc694['name'])['detach'](),void _0x1bc107['delete'](_0x5cc694['name']);const _0x986a43=_0x5cc694['name']['split'](':')[0x2];if(_0x986a43===_0x9aa923['mySessionId'])return;const _0x407604='user:position:'+_0x986a43;_0x3c578e['markers']['has'](_0x407604)&&_0x4b742c['editing']['reconvertMarker'](_0x407604),_0x5cc694['on']('change:range',(_0x419318,_0x587f43,_0x2b33b6)=>{if('$graveyard'!=_0x587f43['root']['rootName']&&'$graveyard'==_0x5cc694['getRange']()['root']['rootName']&&!_0x1bc107['has'](_0x5cc694['name'])){const _0x677360=_0x3c578e['schema']['getNearestSelectionRange'](_0x2b33b6['deletionPosition']);if(_0x677360){const _0x3aa02a=ht['fromRange'](_0x677360);_0x1bc107['set'](_0x5cc694['name'],_0x3aa02a),_0x3aa02a['on']('change:range',(_0x3f0e40,_0x5a1bac,_0x5b36f6)=>{if('$graveyard'==_0x3aa02a['root']['rootName']){const _0x5a5b3e=_0x3c578e['schema']['getNearestSelectionRange'](_0x5b36f6['deletionPosition']);_0x5a5b3e?(_0x3aa02a['start']=_0x5a5b3e['start'],_0x3aa02a['end']=_0x5a5b3e['end']):(_0x1bc107['delete'](_0x5cc694['name']),_0x3aa02a['detach']());}});}}});}),_0x3c578e['document']['on']('change',()=>{_0x1bc107['size']>0x0&&_0x3c578e['enqueueChange']({'isUndoable':!0x1},_0x48f639=>{for(const [_0x9ed638,_0x5cf6d5]of _0x1bc107)'$graveyard'==_0x3c578e['markers']['get'](_0x9ed638)['getRange']()['root']['rootName']&&(re(_0x9ed638['split'](':')[0x2],_0x5cf6d5['toRange'](),_0x3c578e,_0x48f639),_0x5cf6d5['detach']());_0x1bc107['clear']();});});}(_0x126c20),this['_domEmitter']['listenTo'](_0x3a845f['document'],'keydown',(_0x5cc4cd,{key:_0x747681})=>{'Escape'===_0x747681&&function(_0x85f55b){_0x85f55b['editing']['view']['change'](_0x48a306=>{for(const _0x554c38 of _0x85f55b['model']['markers']){if(!_0x554c38['name']['startsWith']('user:position'))continue;const _0x1018ea=_0x85f55b['editing']['mapper']['markerNameToElements'](_0x554c38['name']);if(_0x1018ea){for(const _0x12c8b4 of _0x1018ea)_0x48a306['removeClass']('ck-user__marker_hovered',_0x12c8b4);}}});}(_0x126c20);},{'useCapture':!0x0});}['afterInit'](){const _0x5d7547=this['editor'],_0x40d090=_0x5d7547['commands']['get']('undo');_0x40d090&&_0x5d7547['model']['on']('applyOperation',(_0x3f1a05,_0x436027)=>{const _0x1ce22c=_0x436027[0x0];if('marker'!=_0x1ce22c['type']||!_0x1ce22c['name']['startsWith']('user:'))return;const _0x1c4459=_0x1ce22c['batch'];_0x40d090['_createdBatches']['has'](_0x1c4459)&&(_0x1ce22c['newRange']=_0x1ce22c['oldRange']?_0x5d7547['model']['createRange'](_0x1ce22c['oldRange']['start'],_0x1ce22c['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x55a2be=this['editor'],_0x8a472f=_0x55a2be['model']['document'],_0x30dc1e=_0x55a2be['plugins']['get'](r);_0x55a2be['model']['enqueueChange']({'isUndoable':!0x1},_0x33db17=>{const _0x99905e='user:range:'+_0x30dc1e['mySessionId'],_0x4d8db4='user:position:'+_0x30dc1e['mySessionId'],_0x28ef3e=_0x55a2be['model']['markers']['has'](_0x99905e);_0x55a2be['editing']['view']['hasDomSelection']?re(_0x30dc1e['mySessionId'],_0x8a472f['selection']['getFirstRange'](),_0x55a2be['model'],_0x33db17):_0x28ef3e&&(_0x33db17['removeMarker'](_0x99905e),_0x33db17['removeMarker'](_0x4d8db4));});}}function re(_0x9aef8a,_0x238f78,_0x40b46,_0x4f8e36){const _0x212a22='user:range:'+_0x9aef8a,_0x8e6522='user:position:'+_0x9aef8a,_0x383ab0=_0x238f78['getContainedElement']();let _0x25515f=_0x238f78['start'];_0x383ab0&&_0x383ab0['is']('element','tableCell')&&(_0x25515f=function(_0x260656,_0x1dd646){for(const _0xa6ea4c of _0x260656['getPositions']())if(_0x1dd646['schema']['checkChild'](_0xa6ea4c,'$text'))return _0xa6ea4c;}(_0x238f78,_0x40b46),_0x238f78=_0x4f8e36['createRange'](_0x25515f));const _0x3c6f88=_0x4f8e36['createRange'](_0x25515f);_0x40b46['markers']['has'](_0x212a22)?(_0x4f8e36['updateMarker'](_0x212a22,{'range':_0x238f78}),_0x4f8e36['updateMarker'](_0x8e6522,{'range':_0x3c6f88})):(_0x4f8e36['addMarker'](_0x212a22,{'range':_0x238f78,'usingOperation':!0x0}),_0x4f8e36['addMarker'](_0x8e6522,{'range':_0x3c6f88,'usingOperation':!0x0}));}function q(_0x52ea93,_0x18ef64,_0x12d6de){const t=_0x52ea93['t'];switch(_0x18ef64){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'},_0x12d6de);default:return'';}}let K=0x1;class l extends _0x33017c{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x2c40a7)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,r,H,_0x133a20,_0x5b2741,_0x249e5d];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x11aea7=this['serverHistory']['getOperations']();for(let _0x2e486f=_0x11aea7['length']-0x1;_0x2e486f>=0x0;_0x2e486f--){const _0x56ec5f=_0x11aea7[_0x2e486f];if(!this['_disconnectionOperations']['has'](_0x56ec5f))return _0x56ec5f['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3b3b98){if(super(_0x3b3b98),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x589fbd(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3f3cf1('collaboration-missing-channelid',this);const _0x46c2af=_0x3b3b98['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x46c2af,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2db38a(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new X(this['_disconnectionOperations']);}['init'](){const _0x27fee7=this['editor'],_0x29068e=_0x27fee7['plugins']['get'](_0x5b2741),_0x5ce12f=_0x27fee7['plugins']['get'](c);this['listenTo'](_0x29068e,'getOperationAuthor',(_0x54408f,_0x471a13)=>{const _0x427ff6=_0x471a13[0x0];_0x427ff6['_authorId']&&(_0x54408f['return']=_0x29068e['getUser'](_0x427ff6['_authorId']),_0x54408f['stop']()),null===_0x427ff6['_authorId']&&(_0x54408f['return']=null,_0x54408f['stop']());},{'priority':'high'}),this['listenTo'](_0x27fee7['model']['document']['selection'],'change:range',(_0x19db8a,_0x2518a1)=>{_0x2518a1['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x27fee7['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x27fee7['model']['on']('applyOperation',(_0x10c3dd,_0x40d71d)=>{const _0x6fb5d=_0x40d71d[0x0];_0x6fb5d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x6fb5d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5ce12f,'state',this,'_hasSynchronizationProblem',(_0x24fa54,_0x1fef4d)=>'connected'===_0x24fa54&&!_0x1fef4d),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x27fee7['disableReadOnlyMode']('rtc-offline'):_0x27fee7['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x27fee7['disableReadOnlyMode']('rtc-offline'):_0x27fee7['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x16edc4=this['editor']['plugins']['get'](r),_0x341eea=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x16edc4['unregister'](this['_channelId']);const _0x5e926f=await this['_service']['reconnect'](_0x341eea['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5e926f)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x154285=await this['_service']['getConnectedSessions']();_0x16edc4['register'](this['_channelId'],_0x154285),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x54bd3c){if(function(_0x1ae868){return'404'===_0x1ae868['code'];}(_0x54bd3c)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x20a097){return'409'===_0x20a097['code'];}(_0x54bd3c)){const _0x5aebb9=q(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x5aebb9);}else{if(!(_0x54bd3c instanceof J))throw _0x54bd3c;this['_handleReconnectionError']();}}}}['destroy'](){const _0x160511=this['editor']['plugins']['get'](c),_0x57ab78=this['editor']['plugins']['get'](r);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x57ab78['channelSessions']['has'](this['_channelId'])&&_0x57ab78['unregister'](this['_channelId']),_0x160511['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x145bd6){if(this['sessionId']!==_0x145bd6['sessionId']&&this['_lastSyncedOperationId']!==_0x145bd6['lastOperationId'])throw new J();return this['sessionId']=_0x145bd6['sessionId'],this['_handleServerResponse']([],{..._0x145bd6,'wereChangesApplied':!0x1,'data':_0x145bd6['data']},'reconnect');}async['_connectService'](_0x40b892,_0x129e85=!0x1){const {connection:_0x44ec53}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x44ec53,this['_channelId'])['then'](_0x108526=>this['_initSessionsHandling'](_0x108526))['catch'](_0x31fee2=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x31fee2);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x6bbb79,_0x2ff8b1)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x2ff8b1);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x48ed3f=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x40b892);this['_isPendingUpdate']=!0x0;const _0x1ed66d=await this['_service']['connect'](_0x44ec53,this['_compressOperations'](_0x40b892),_0x48ed3f);if(this['sessionId']=_0x1ed66d['sessionId'],_0x129e85){if(!_0x1ed66d['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x1ed66d['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x40b892,_0x1ed66d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x1ed66d,_0x40b892);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3206b7=this['editor']['plugins']['get'](r),_0x1e6cbf=this['editor']['plugins']['get'](H),_0x32e754=_0x3206b7['channelSessions']['get'](this['_channelId']);_0x32e754&&_0x32e754['length']>0x1?_0x1e6cbf['createUserMarkerOperations']():this['listenTo'](_0x3206b7,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3206b7['channelSessions']['get'](this['_channelId'])['length']&&_0x1e6cbf['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x136671,_0x42ec2e,_0x49752a,_0x380304){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x42ec2e){const _0x221bdd=this['_decompressOperations'](_0x49752a,_0x380304);await this['_fetchMissingUsers'](_0x221bdd),this['_handleExternalOperations'](_0x221bdd,_0x42ec2e,_0x49752a['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2fbfcb}=this['editor'];let _0x4f4364;try{_0x4f4364=await this['_service']['getDocumentDetails']();}catch(_0x745ff6){const _0x1adb3d=q(_0x2fbfcb,'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'](_0x1adb3d);}const _0x212ccb=_0x4f4364['currentDocumentSession']||_0x4f4364['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x212ccb['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x4aadf1=q(_0x2fbfcb,'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'](_0x4aadf1);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x522954){const _0x23abcb=this['editor']['plugins']['get'](r);this['listenTo'](_0x23abcb,'sessionAdd:'+this['_channelId'],(_0x10afdf,{session:_0x429f51})=>{if(_0x429f51['id']===_0x23abcb['mySessionId']){_0x10afdf['off']();const _0x2527b1=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x54918f=_0x429f51['permissions'];_0x2527b1&&_0x2527b1['isEnabled']&&(_0x54918f=_0x54918f['filter'](_0x54fab4=>'document:write'!==_0x54fab4)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x54918f,this['_channelId']);}}),_0x23abcb['register'](this['_channelId'],_0x522954);}['_initThrowingOnDataSet'](){const _0xe7ec5a=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x15bcaf)=>{if(!_0x15bcaf[_0x15bcaf['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3f3cf1('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0xe7ec5a['apply'](this['editor']['data'],_0x15bcaf);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x326403,[_0x56111b])=>{if(this['_document']['version'])throw new _0x3f3cf1('realtimecollaborationclient-init-document-already-initialized',this);_0x326403['stop'](),this['_setPendingAction']();const _0x5f2812=this['editor']['config']['get']('rootsAttributes'),_0x438355=this['_getOperationsFromInitData'](_0x56111b,_0x5f2812);0x0==_0x438355['length']&&_0x438355['push'](new _0x28c0d7(0x0)),_0x326403['return']=this['_connectService'](_0x438355)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1472e4=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1472e4))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3be337,[_0x401a4d,_0x14c7b2])=>{_0x3be337['stop']();const _0x33ff9a=this['editor']['model']['document']['getRoot'](_0x401a4d);if(!this['_knownRootNames']['has'](_0x401a4d)){const _0x425e0f=_0x14c7b2&&_0x14c7b2['data']?_0x14c7b2['data']:'',_0x1c218a=_0x14c7b2&&_0x14c7b2['attributes']?_0x14c7b2['attributes']:{};await this['_loadRoot'](_0x401a4d,_0x425e0f,_0x1c218a);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x33ff9a['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x33ff9a);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2d5a92){const _0x17db37=this['editor']['plugins']['get'](_0x5b2741),{connection:_0x5c4e63}=this['editor']['plugins']['get'](c),_0xc1bf3=new Set();for(const _0x202a47 of _0x2d5a92){const _0x2aefa2=_0x202a47['_authorId'];_0x2aefa2&&!_0x17db37['getUser'](_0x2aefa2)&&_0xc1bf3['add'](_0x2aefa2);}if(0x0===_0xc1bf3['size'])return;const _0x2e036e=await lt['getMany'](_0x5c4e63,Array['from'](_0xc1bf3));for(const _0x15ef90 of _0x2e036e)_0x17db37['getUser'](_0x15ef90['id'])||_0x17db37['addUser'](_0x15ef90);}['_getOperationsFromInitData'](_0x694843,_0x541509={}){const _0x61bc6c=this['editor']['model'],_0x243811=[];let _0x58f23f=0x0;const _0x450b06='string'==typeof _0x694843?{'main':_0x694843}:_0x694843;for(const _0x2096fb of Object['keys'](_0x450b06)){if(!this['_document']['roots']['has'](_0x2096fb))throw new _0x3f3cf1('realtimecollaborationclient-init-non-existent-root',this);const _0x71b9d=this['editor']['data']['parse'](_0x450b06[_0x2096fb]),_0x3d1127=this['_document']['getRoot'](_0x2096fb),_0x4c6ca6=new _0x517d3e(_0x61bc6c['createPositionAt'](_0x3d1127,0x0),_0x71b9d,_0x58f23f++);_0x243811['push'](_0x4c6ca6);for(const [_0x1489cf,_0x5612d1]of _0x71b9d['markers']){const _0x197d47=_0x61bc6c['createRange'](_0x61bc6c['createPositionFromPath'](_0x3d1127,_0x5612d1['start']['path']['slice']()),_0x61bc6c['createPositionFromPath'](_0x3d1127,_0x5612d1['end']['path']['slice']())),_0x2f76bf=new _0x3f078c(_0x1489cf,null,_0x197d47,_0x61bc6c['markers'],!0x0,_0x58f23f++);_0x243811['push'](_0x2f76bf);}}if(_0x541509)for(const [_0x333353,_0x115989]of Object['entries'](_0x541509)){const _0x3022f6=_0x61bc6c['document']['getRoot'](_0x333353);if(!_0x3022f6)throw new _0x3f3cf1('multi-root-editor-root-attributes-no-root',null);for(const [_0x1c9fa5,_0x2e12ff]of Object['entries'](_0x115989))if(null!==_0x2e12ff){const _0x572c8a=new _0x58949f(_0x3022f6,_0x1c9fa5,null,_0x2e12ff,_0x58f23f++);_0x243811['push'](_0x572c8a);}}return _0x243811;}async['_loadRoot'](_0x135e8a,_0x25bec1,_0x150f3c){this['_getOperationsFromInitData']({[_0x135e8a]:_0x25bec1},{[_0x135e8a]:_0x150f3c})['forEach']((_0x24f621,_0x12bcfc)=>{_0x24f621['baseVersion']=this['_document']['version']+_0x12bcfc,_0x24f621['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x24f621);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x372c12,_0x2308e7){let _0x107be6;this['_offset']=_0x372c12['offset'];const _0x22ae13=_0x372c12['wereChangesApplied']&&!_0x372c12['initData'],_0x2b4642=_0x22ae13?0x0:_0x372c12['data']['baseVersion'];if(_0x2308e7['forEach'](_0x301074=>{_0x301074['_isInit']=!0x0,_0x301074['createdAt']=_0x372c12['sessionCreatedAt'],_0x301074['_authorId']=null;}),_0x22ae13)_0x107be6=_0x2308e7,this['_applyOperationsSet'](_0x107be6,_0x22ae13);else{if(_0x372c12['initData']){const _0x3da3c4=this['_getOperationsFromInitData'](_0x372c12['initData']);this['_document']['history']['version']=-_0x3da3c4['length'],_0x3da3c4['forEach'](_0x103c1e=>{_0x103c1e['baseVersion']-=_0x3da3c4['length'],_0x103c1e['createdAt']=_0x372c12['sessionCreatedAt'],_0x103c1e['_isInit']=!0x0,_0x103c1e['_authorId']=null;}),this['_applyOperationsSet'](_0x3da3c4,!0x0),this['serverHistory']['version']=-_0x3da3c4['length']+this['_offset'],this['_updateServerHistory'](_0x3da3c4);}this['_document']['history']['version']=_0x2b4642,_0x107be6=this['_decompressOperations'](_0x372c12['data'],_0x372c12['metadata']),await this['_fetchMissingUsers'](_0x107be6),this['_applyOperationsSet'](_0x107be6,_0x22ae13);}_0x372c12['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x107be6,_0x372c12['lastOperationId']),this['_lastSyncedOperationId']=_0x372c12['lastOperationId']),this['serverHistory']['version']=_0x2b4642+this['_offset'],this['_updateServerHistory'](_0x107be6),_0x2308e7['filter'](_0x1cee92=>{const _0xb0b7a3=this['_getAffectedRoot'](_0x1cee92);return _0xb0b7a3&&!this['_knownRootNames']['has'](_0xb0b7a3);})['forEach']((_0x52c4a,_0x4e4892)=>{_0x52c4a['baseVersion']=this['_document']['version']+_0x4e4892,this['_saveOperationInBuffer'](_0x52c4a);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x33a834,_0x19f3e1){throw this['_isPendingUpdate']=!0x0,_0x19f3e1&&console['error'](_0x19f3e1),new _0x3f3cf1(_0x33a834,this['editor']);}['_saveOperationInBuffer'](_0x3984c2){this['_knownOperations']['has'](_0x3984c2)||(this['_knownOperations']['add'](_0x3984c2),this['_bufferedOperations']['push'](_0x3984c2),this['_pendingAction']||'marker'==_0x3984c2['type']&&!_0x3984c2['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xf82ead=!0x1){!_0xf82ead&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x26498a=>{_0x26498a&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x51c018=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x53a3d3){return _0x53a3d3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x53a3d3['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x53a3d3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x51c018))throw _0x51c018;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x58723c=>{this['on']('change:_isPendingUpdate',()=>{_0x58723c();});});}async['_sendBufferedOperations'](){const _0x2f90f2=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x2f90f2['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x29a11f=[...this['_bufferedOperations']];for(const _0x31d306 of _0x29a11f)_0x31d306['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x31d306);const _0x50ba69=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x29a11f),_0x5accc5=K++,_0x2b4321=this['_compressOperations'](_0x29a11f),_0x47696e=await this['_service']['sendOperations'](_0x2b4321,_0x2b4321['baseVersion'],_0x50ba69);try{return await this['_handleServerResponse'](_0x29a11f,_0x47696e,_0x5accc5);}catch(_0x5aec53){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5aec53);}}async['_handleServerResponse'](_0x533cd9,_0x3a2eaa,_0x5a905b){if('error'in _0x3a2eaa)throw _0x3a2eaa['error'];let _0x248a0b=!0x1;if(_0x3a2eaa['wereChangesApplied']){_0x3a2eaa['lastOperationId']&&(this['_lastSyncedOperationId']=_0x3a2eaa['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x500637=>!_0x533cd9['includes'](_0x500637));for(const _0x5e4290 of _0x533cd9)_0x5e4290['createdAt']='lastOperationAcceptedAt'in _0x3a2eaa&&_0x3a2eaa['lastOperationAcceptedAt']||void 0x0;Q(_0x533cd9,_0x3a2eaa['version']-_0x533cd9['length']),this['_updateServerHistory'](_0x533cd9);const _0x47b3c9=_0x533cd9['filter'](_0x3e45f6=>{if(!_0x3e45f6['_isInit'])return!0x1;const _0x3ba30b=this['_getAffectedRoot'](_0x3e45f6);return _0x3ba30b&&!this['_knownRootNames']['has'](_0x3ba30b);});Q(_0x47b3c9,this['_document']['version']),this['_applyOperationsSet'](_0x47b3c9),_0x248a0b=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x2c11eb=this['_decompressOperations'](_0x3a2eaa['data'],_0x3a2eaa['metadata'])['filter'](_0x3880cb=>_0x3880cb['baseVersion']>=this['_lastServerVersion']);_0x2c11eb['forEach'](_0x204cb9=>this['_addKnownRoot'](_0x204cb9)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x59e59a=>!_0x59e59a['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x59e59a))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x2c11eb),_0x248a0b=this['_handleExternalOperations'](_0x2c11eb,_0x3a2eaa['version'],_0x3a2eaa['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x248a0b?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3eab33,_0x3b202c,_0x12490a){try{const _0x2be967={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5d28e9,operationsB:_0x184972,originalOperations:_0x302cc5}=_0x39c78b(_0x3eab33,this['_bufferedOperations'],_0x2be967);Q(_0x5d28e9,this['_document']['version']),Q(_0x184972,_0x3b202c);for(const _0x26609e of _0x5d28e9){const _0x56f935=_0x302cc5['get'](_0x26609e);_0x26609e['_authorId']=_0x56f935?_0x56f935['_authorId']:null;}_0x12490a&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3eab33,_0x12490a),this['_lastSyncedOperationId']=_0x12490a),this['_bufferedOperations']=[..._0x184972],this['_applyOperationsSet'](_0x5d28e9),this['_updateServerHistory'](_0x3eab33);}catch(_0x3bd476){return console['error'](_0x3bd476),!0x1;}return!0x0;}['_applyOperationsSet'](_0x848602,_0x27bc93=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1084b3=>{for(const _0x435f27 of _0x848602)this['_knownOperations']['add'](_0x435f27),this['_addKnownRoot'](_0x435f27),_0x1084b3['batch']['addOperation'](_0x435f27),this['editor']['model']['applyOperation'](_0x435f27);});}['_addKnownRoot'](_0x12a4fa){const _0x81e4de=this['_getAffectedRoot'](_0x12a4fa);_0x81e4de&&this['_knownRootNames']['add'](_0x81e4de);}['_getAffectedRoot'](_0x445e82){let _0x13ce28,_0x10adb7;switch(_0x445e82['type']){case'insert':_0x13ce28=_0x445e82['position']['root'];break;case'marker':if(_0x10adb7=_0x445e82['newRange'],!_0x10adb7)return null;_0x13ce28=_0x10adb7['root'];break;case'addRootAttribute':_0x13ce28=_0x445e82['root'];break;case'addRoot':_0x13ce28=_0x445e82['affectedSelectable'];break;case'move':_0x13ce28=_0x445e82['targetPosition']['root'];break;default:return null;}return _0x13ce28['rootName'];}['_updateServerHistory'](_0x156fee){_0x156fee['forEach'](_0x6612f9=>{const _0x1d025b=_0x6612f9['clone']();_0x1d025b['_authorId']=_0x6612f9['_authorId'],_0x1d025b['_isInit']=!!_0x6612f9['_isInit'],_0x1d025b['createdAt']=_0x6612f9['createdAt'],_0x1d025b['baseVersion']+=this['_offset'],_0x6612f9['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x1d025b),this['serverHistory']['addOperation'](_0x1d025b);});}['_handleReconnectionError'](_0x12a104){const _0x5eb722=this['editor']['plugins']['get']('Notification'),_0x3b68d3=this['editor']['locale'];_0x12a104||(_0x12a104=q(_0x3b68d3,'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.')),_0x5eb722['showWarning'](_0x12a104,{'title':q(_0x3b68d3,'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'](_0x133a20)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x133a20)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x15b620){const _0x403f80=_0x15b620['map'](_0x563e26=>_0x563e26['toJSON']());return this['_compressor']['compress'](_0x403f80);}['_decompressOperations'](_0x56d8cc,_0x3c8476){return this['_compressor']['decompress'](_0x56d8cc)['map']((_0x13b82b,_0x7f879c)=>{const _0x3ad25c='init'==_0x3c8476[_0x7f879c]['type'];if('InsertOperation'==_0x13b82b['__className']){const _0x233274=_0x13b82b['position']['root'];!this['_document']['getRoot'](_0x233274)&&(this['_document']['createRoot']('$root',_0x233274)['_isAttached']=!0x1);}const _0x445187=_0x3cbf6a['fromJSON'](_0x13b82b,this['_document']);return _0x445187['wasUndone']=_0x13b82b['wasUndone'],_0x445187['_isInit']=_0x3ad25c,_0x445187['_authorId']=_0x3ad25c?null:_0x3c8476[_0x7f879c]['userId'],_0x445187['_isDisconnection']='cs:removeUser'===_0x3c8476[_0x7f879c]['type'],_0x445187['createdAt']=_0x3c8476[_0x7f879c]['createdAt'],_0x445187;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5c0acf=this['editor']['plugins']['get'](r)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5c0acf&&_0x5c0acf['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x4552bb,_0x50692e){for(const _0x575404 of _0x4552bb)_0x575404['baseVersion']=_0x50692e++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x3c0bd5){this['_ignoredOperations']=_0x3c0bd5,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x217844){let _0x547159=_0x217844['length'];for(;_0x547159--;){const _0x3bd153=_0x217844[_0x547159];if(!this['_ignoredOperations']['has'](_0x3bd153)){if(!this['_operationToId']['has'](_0x3bd153)){const _0x40eb5d=_0x57d351()['slice'](0x1,0x12);this['_operationToId']['set'](_0x3bd153,_0x40eb5d);}return this['_operationToId']['get'](_0x3bd153);}}}['setIdForTheLastOperation'](_0x1563cd,_0x4cc2d5){if(!_0x4cc2d5)return;let _0x41d621=_0x1563cd['length'];for(;_0x41d621--;){const _0x2e5c6d=_0x1563cd[_0x41d621];this['_ignoredOperations']['has'](_0x2e5c6d)||this['_operationToId']['set'](_0x2e5c6d,_0x4cc2d5);}}}class n extends _0x33017c{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}}class a extends _0xb4909c{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x2b8343)());['_services'];static get['requires'](){return[c,'CommentsRepository',r,_0x5b2741];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}constructor(_0x208695){super(_0x208695),this['_services']=new Map();}async['init'](){const _0xc21ec=this['context'],_0x442ec0=_0xc21ec['plugins']['get']('CommentsRepository');if(_0xc21ec['plugins']['get'](c)['addToReconnectionStack'](this),_0x442ec0['adapter']={'addCommentThread':async({channelId:_0x3aeadf,threadId:_0x4ff435,comments:_0x118069,resolvedAt:_0x246aa7,resolvedBy:_0x5b22d1,context:_0x37bf89,attributes:_0x183abc})=>{const _0x3c5346=await this['_getService'](_0x3aeadf)['addCommentThread']({'commentThreadId':_0x4ff435,'comments':_0x118069['map'](_0x1e838c=>function(_0x6390fe,_0x2a3bf6,_0x10e1da){return{'commentThreadId':_0x10e1da,'commentId':_0x6390fe['commentId'],'userId':_0x6390fe['authorId'],'content':_0x6390fe['content'],'documentId':_0x2a3bf6,'createdAt':_0x6390fe['createdAt'],'attributes':_0x6390fe['attributes']||{}};}(_0x1e838c,_0x3aeadf,_0x4ff435)),'resolvedAt':_0x246aa7,'resolvedBy':_0x5b22d1,'context':_0x37bf89,'attributes':_0x183abc})['catch'](ut);return{'threadId':_0x3c5346['commentThreadId'],'comments':_0x3c5346['comments']};},'getCommentThread':async({channelId:_0x48a1fa,threadId:_0x183c07})=>{const _0x10690d=await this['_getService'](_0x48a1fa)['getCommentThread'](_0x183c07)['catch'](ut);return _0x10690d['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x10690d]),{'threadId':_0x10690d['commentThreadId'],'comments':_0x10690d['comments']['map'](S),'context':_0x10690d['context'],'resolvedAt':_0x10690d['resolvedAt'],'resolvedBy':_0x10690d['resolvedBy'],'attributes':_0x10690d['attributes']||{}});},'updateCommentThread':async({channelId:_0xac4977,threadId:_0x118567,context:_0x25efac,unlinkedAt:_0x6a3312,attributes:_0x429ffe})=>this['_getService'](_0xac4977)['updateCommentThread']({'commentThreadId':_0x118567,'context':_0x25efac,'attributes':_0x429ffe,'unlinkedAt':_0x6a3312})['catch'](B)['catch'](ut),'resolveCommentThread':async({channelId:_0x52ed90,threadId:_0x236043})=>{const _0x335929=await this['_getService'](_0x52ed90)['resolveCommentThread'](_0x236043)['catch'](B)['catch'](ut);return{'threadId':_0x335929['commentThreadId'],'resolvedAt':_0x335929['resolvedAt'],'resolvedBy':_0x335929['resolvedBy']};},'reopenCommentThread':async({channelId:_0xc83189,threadId:_0x5e3fb7})=>this['_getService'](_0xc83189)['reopenCommentThread'](_0x5e3fb7)['catch'](B)['catch'](ut),'removeCommentThread':({channelId:_0x23f44f,threadId:_0x3c4e1a})=>this['_getService'](_0x23f44f)['removeCommentThread'](_0x3c4e1a)['catch'](B)['catch'](ut),'addComment':({channelId:_0xa11b10,threadId:_0x211ad2,commentId:_0x28223c,content:_0x389401,attributes:_0x2b20b8})=>this['_getService'](_0xa11b10)['addComment'](_0x211ad2,_0x28223c,_0x389401,_0x2b20b8)['catch'](ut),'updateComment':({channelId:_0x3a13c8,threadId:_0x43567b,commentId:_0xd47e42,content:_0x2cad04,attributes:_0x5f025e})=>this['_getService'](_0x3a13c8)['updateComment'](_0x43567b,_0xd47e42,_0x2cad04,_0x5f025e)['catch'](B)['catch'](ut),'removeComment':({channelId:_0x1f0ec2,threadId:_0x4d4be6,commentId:_0x5a5601})=>this['_getService'](_0x1f0ec2)['removeComment'](_0x4d4be6,_0x5a5601)['catch'](B)['catch'](ut)},_0xc21ec instanceof _0x12c542){const _0x444fb6=_0xc21ec['config']['get']('collaboration.channelId'),_0x3cd020=_0xc21ec['plugins']['get'](r);await this['_setUpService'](_0x444fb6);const _0x2e564d=await this['_services']['get'](_0x444fb6)['getConnectedSessions']();this['listenTo'](_0x3cd020,'sessionAdd:'+_0x444fb6,(_0x393667,{session:_0x54f0f0})=>{_0x54f0f0['id']===_0x3cd020['mySessionId']&&(_0x393667['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x54f0f0['permissions'],_0x444fb6));}),_0x3cd020['register'](_0x444fb6,_0x2e564d);}}async['_setUpService'](_0x37376b){if(this['_services']['has'](_0x37376b))throw new _0x3f3cf1('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x37376b});const _0x131e7b=this['context']['plugins']['get']('CommentsRepository'),_0x324cf6=new a['CommentsService'](_0x37376b);this['_services']['set'](_0x37376b,_0x324cf6),this['listenTo'](_0x324cf6,'commentThreadAdded',(_0x31a8e5,_0x3ca64e)=>{const {commentThreadId:_0x3d99c0,documentId:_0x288cfe,context:_0x44f77b,attributes:_0x1cd932,resolvedAt:_0x2bec66,resolvedBy:_0x54151c,comments:_0x977100}=_0x3ca64e;_0x131e7b['getCommentThread'](_0x3d99c0)||_0x131e7b['addCommentThread']({'threadId':_0x3d99c0,'channelId':_0x288cfe,'comments':_0x977100?_0x977100['map'](S):[],'context':_0x44f77b,'attributes':_0x1cd932,'resolvedAt':_0x2bec66,'resolvedBy':_0x54151c,'isFromAdapter':!0x0});}),this['listenTo'](_0x324cf6,'commentThreadUpdated',(_0x855bf7,{commentThreadId:_0x1d48f0,documentId:_0x412013,context:_0x52af6a,unlinkedAt:_0x2ab68f,attributes:_0x55b018})=>{_0x131e7b['getCommentThread'](_0x1d48f0)&&_0x131e7b['updateCommentThread']({'threadId':_0x1d48f0,'channelId':_0x412013,'context':_0x52af6a,'unlinkedAt':_0x2ab68f,'attributes':_0x55b018,'isFromAdapter':!0x0});}),this['listenTo'](_0x324cf6,'commentThreadResolved',(_0x22dccf,{commentThreadId:_0xc97a22,resolvedBy:_0x1d419f,resolvedAt:_0x3a1b63})=>{const _0xa578dc=_0x131e7b['getCommentThread'](_0xc97a22);_0xa578dc&&_0xa578dc['resolve']({'resolvedBy':_0x1d419f,'resolvedAt':_0x3a1b63,'isFromAdapter':!0x0});}),this['listenTo'](_0x324cf6,'commentThreadReopened',(_0xc35d5f,{commentThreadId:_0x57e7a1})=>{const _0x50a673=_0x131e7b['getCommentThread'](_0x57e7a1);_0x50a673&&_0x50a673['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x324cf6,'commentThreadRemoved',(_0x2cac94,{commentThreadId:_0x525bd2})=>{const _0x2025f0=_0x131e7b['getCommentThread'](_0x525bd2);_0x2025f0&&_0x2025f0['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x324cf6,'commentAdded',(_0x275407,_0x7baf71)=>{const _0x5d2169=_0x7baf71['commentThreadId'],_0x4ee3d9=_0x131e7b['getCommentThread'](_0x5d2169);_0x4ee3d9&&_0x4ee3d9['addComment']({...S(_0x7baf71),'isFromAdapter':!0x0});}),this['listenTo'](_0x324cf6,'commentUpdated',(_0x355742,{commentThreadId:_0x2038a4,commentId:_0x11d42e,content:_0x3d7977,attributes:_0x15ca10})=>{const _0x323610=_0x131e7b['getCommentThread'](_0x2038a4);if(_0x323610){const _0x2f8cea=_0x323610['getComment'](_0x11d42e);_0x2f8cea&&_0x2f8cea['update']({'content':_0x3d7977,'attributes':_0x15ca10,'isFromAdapter':!0x0});}}),this['listenTo'](_0x324cf6,'commentRemoved',(_0x294319,{commentThreadId:_0xac9e64,commentId:_0x54a196})=>{const _0x512637=_0x131e7b['getCommentThread'](_0xac9e64);if(_0x512637){const _0xd52268=_0x512637['getComment'](_0x54a196);_0xd52268&&_0xd52268['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x37376b);}['destroy'](){if(this['context']instanceof _0x12c542){const _0x3019b1=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3019b1);}}['_terminateService'](_0x4dd26d){if(!this['_services']['has'](_0x4dd26d))throw new _0x3f3cf1('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4dd26d});this['_getService'](_0x4dd26d)['disconnect'](),this['_services']['delete'](_0x4dd26d);}async['reconnect'](){for(const _0x5b5c43 of this['_services']['keys']())await this['_connectService'](_0x5b5c43);if(this['context']instanceof _0x12c542){const _0x4b34e5=this['context']['config']['get']('collaboration.channelId'),_0x1a6611=this['context']['plugins']['get'](r);_0x1a6611['unregister'](_0x4b34e5);const _0x632865=await this['_services']['get'](_0x4b34e5)['getConnectedSessions']();_0x1a6611['register'](_0x4b34e5,_0x632865);}}async['_connectService'](_0x4a8375){const {connection:_0x36c079}=this['context']['plugins']['get'](c),_0x50497b=this['context']['plugins']['get']('CommentsRepository'),_0x42691a=this['_services']['get'](_0x4a8375),_0x48274b=await _0x42691a['connect'](_0x36c079);await this['_fetchMissingUsersForThreads'](_0x48274b);const _0x24290=new Set(Array['from'](_0x50497b['getCommentThreads']({'channelId':_0x4a8375}),_0x5064a3=>_0x5064a3['id']));for(const _0x1aaad5 of _0x48274b)_0x1aaad5['deletedAt']||_0x24290['delete'](_0x1aaad5['commentThreadId']);for(const _0x58f08c of _0x24290)_0x50497b['getCommentThread'](_0x58f08c)['remove']({'isFromAdapter':!0x0});for(const _0x38b6ea of _0x48274b){let _0x304a1f=_0x50497b['getCommentThread'](_0x38b6ea['commentThreadId']);const {commentThreadId:_0x1681bf,context:_0x3ed54e,attributes:_0x41cc16,resolvedBy:_0x8d4916,resolvedAt:_0x428711,unlinkedAt:_0x14590e,deletedAt:_0x44acb8}=_0x38b6ea;if(_0x44acb8)continue;_0x304a1f||(_0x304a1f=_0x50497b['addCommentThread']({'channelId':_0x4a8375,'threadId':_0x1681bf,'context':_0x3ed54e,'attributes':_0x41cc16||{},'resolvedBy':_0x8d4916,'resolvedAt':_0x428711,'unlinkedAt':_0x14590e,'isFromAdapter':!0x0}));const _0x5755df=new Set(Array['from'](_0x304a1f['comments'],_0x3e74e2=>_0x3e74e2['id']));for(const _0x1c2811 of _0x38b6ea['comments'])_0x5755df['delete'](_0x1c2811['commentId']);for(const _0xfcbff9 of _0x5755df)_0x304a1f['getComment'](_0xfcbff9)['remove']({'isFromAdapter':!0x0});for(const _0x519edf of _0x38b6ea['comments']){const _0x23a763=_0x304a1f['getComment'](_0x519edf['commentId']);_0x23a763?_0x23a763['content']!==_0x519edf['content']&&_0x23a763['update']({'content':_0x519edf['content'],'isFromAdapter':!0x0}):_0x304a1f['addComment'](Object['assign'](S(_0x519edf),{'isFromAdapter':!0x0}));}}}['_getService'](_0x3eeb1f){if(!this['_services']['has'](_0x3eeb1f))throw new _0x3f3cf1('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x3eeb1f});return this['_services']['get'](_0x3eeb1f);}async['_fetchMissingUsersForThreads'](_0x349082){const _0x16bc8c=this['context']['plugins']['get'](_0x5b2741),{connection:_0x4988e2}=this['context']['plugins']['get'](c),_0x5ca2cd=new Set();for(const {resolvedBy:_0x523dfb,comments:_0x2e37bb}of _0x349082){_0x523dfb&&!_0x16bc8c['getUser'](_0x523dfb)&&_0x5ca2cd['add'](_0x523dfb);for(const {userId:_0x223b80}of _0x2e37bb)_0x16bc8c['getUser'](_0x223b80)||_0x5ca2cd['add'](_0x223b80);}if(0x0===_0x5ca2cd['size'])return;const _0xc97a4c=await lt['getMany'](_0x4988e2,Array['from'](_0x5ca2cd));for(const _0x55086f of _0xc97a4c)_0x16bc8c['getUser'](_0x55086f['id'])||_0x16bc8c['addUser'](_0x55086f);}}async function B(_0x4d6f44){if('404'!==_0x4d6f44['code'])throw _0x4d6f44;}function ut(_0x7cb3ad){if((_0x2ae34c=_0x7cb3ad)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2ae34c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2ae34c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2ae34c;throw _0x7cb3ad;}function S(_0x226248){return{'threadId':_0x226248['commentThreadId'],'commentId':_0x226248['commentId'],'content':_0x226248['content'],'createdAt':_0x226248['createdAt'],'authorId':_0x226248['userId'],'attributes':_0x226248['attributes']||{}};}class g extends _0x33017c{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',r,_0x5b2741];}constructor(_0x468a2b){super(_0x468a2b);const _0x26f7b5=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new v['RevisionHistoryService'](_0x26f7b5);}async['init'](){const _0x259471=this['editor']['plugins']['get'](l),_0x1fccad=_0x259471['serverHistory'],_0x47297c=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x1fccad,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x259471['sessionId']});const _0x3a7a42=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x1a708b=await tt['isBundleUploaded'](_0x47297c['connection'],_0x3a7a42);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4555df})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4555df)),'updateRevisions':async _0x41e464=>{await this['_waitForServiceReady']();const _0x9e8980=this['_revisionTracker']['currentRevision'];if(_0x1a708b&&0x1===_0x41e464['length']&&_0x41e464[0x0]['id']===_0x9e8980['id'])return _0x41e464;for(const _0x586e5b of _0x41e464)_0x586e5b['id']===_0x9e8980['id']&&(_0x586e5b['isEmptyCurrent']=_0x586e5b['fromVersion']===_0x586e5b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x41e464,this['_lastRequestId'])['then'](_0xd46868=>(this['_lastRequestId']=_0xd46868,_0x41e464))['catch'](_0x3ad02f=>{if(st(_0x3ad02f)||'400'===_0x3ad02f['code']&&void 0x0!==_0x3ad02f['data']['wrongRequestId']){for(const _0x17bd39 of _0x41e464){!this['_revisionTracker']['repository']['getRevision'](_0x17bd39['id'])||this['_revisionTracker']['_bufferUpdate'](_0x17bd39['id'],_0x17bd39,!0x1);}if(st(_0x3ad02f))throw _0x3ad02f;return _0x41e464;}throw _0x3ad02f;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4a61e3,{revisionsData:_0x2a6777,requestId:_0x2140b2})=>{Math['max'](..._0x2a6777['map'](_0x40b781=>_0x40b781['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2a6777,_0x2140b2);}):this['_handleRevisionsUpdate'](_0x2a6777,_0x2140b2);});const {revisions:_0x56adc8,requestId:_0x4dc1e5}=await this['_revisionHistoryService']['connect'](_0x47297c['connection']);_0x47297c['addToReconnectionStack'](this),this['_lastRequestId']=_0x4dc1e5,await this['_fetchMissingUsers'](_0x56adc8);for(const _0x1ddcc5 of _0x56adc8)this['_revisionTracker']['addRevisionData'](_0x1ddcc5);this['listenTo'](_0x259471,'change:_isConnected',(_0x326cfa,_0x5a3ca3,_0x20b4a6)=>{_0x20b4a6&&(this['_oldOffset']=_0x259471['_offset'],_0x326cfa['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x47297c,'state',_0x17803b=>_0x17803b===_0x131e8c['CONNECTED']);}async['reconnect'](){const _0x3700e8=this['editor']['plugins']['get'](c),_0x50c4cd=this['editor']['plugins']['get'](l),_0x22e8c2=async()=>{const _0x2ba284=this['_revisionTracker']['currentRevision'],_0x4a105b=_0x2ba284['id'],_0x1ca1b2=_0x4a105b!==_0x50c4cd['sessionId'];if(_0x1ca1b2){const _0x20ccaa=_0x50c4cd['_offset']-this['_oldOffset'],_0x1d7682=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2ba284['toVersion']+_0x20ccaa!==_0x1d7682){const _0x29043d=_0x2ba284['fromVersion']+_0x20ccaa,_0x25534f=this['editor']['plugins']['get'](_0x5b2741),_0x368cfd=this['_revisionTracker']['buildRevisionData']({'revision':_0x2ba284,'from':_0x29043d,'to':_0x1d7682});_0x368cfd['id']=_0x2ba284['id'];const _0x12a5b5=_0x368cfd['authorsIds']['map'](_0x60b4f=>_0x25534f['getUser'](_0x60b4f));_0x2ba284['_update']({..._0x368cfd,'authors':_0x12a5b5},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2ba284['id'],_0x368cfd,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1d7682,(_0x2ba284['toVersion']===_0x2ba284['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x4a105b)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x4a105b),this['_revisionTracker']['_createCurrentRevision'](_0x1d7682));}const {revisions:_0x449e55,requestId:_0x551d0e}=await this['_revisionHistoryService']['reconnect'](_0x3700e8['connection'],this['_lastRequestId']);_0x1ca1b2&&_0x449e55['length']>0x0?_0x50c4cd['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x449e55),this['_handleRevisionsUpdate'](_0x449e55,_0x551d0e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x50c4cd['_isConnected']?_0x22e8c2():new Promise((_0x485035,_0x3a9f2c)=>{_0x50c4cd['once']('change:_isConnected',()=>{_0x22e8c2()['then'](_0x485035)['catch'](_0x3a9f2c);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4de0f7=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x44015f=>{_0x44015f['off'](),_0x4de0f7();});});}['_getLatestVersionFromServerOperations'](){const _0x83f038=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x322d14 of _0x83f038)if('marker'!==_0x322d14['type']||_0x322d14['affectsData'])return _0x322d14['baseVersion']+0x1;}['_getLatestVersion'](){const _0x49115e=this['editor']['plugins']['get'](l);return new Promise(_0x14ed2d=>{_0x49115e['_isPendingUpdate']?_0x49115e['once']('change:_isPendingUpdate',()=>{_0x14ed2d(this['_getLatestVersionFromServerOperations']());}):_0x14ed2d(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4c0a03,_0x2dcd0d){const _0x3dadee=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2dcd0d;for(const _0x2edd84 of _0x4c0a03){const _0x1f8a92=_0x3dadee['getRevision'](_0x2edd84['id']);if(_0x1f8a92){if((_0x2edd84['fromVersion']||_0x2edd84['toVersion'])&&(_0x2edd84['diffData']=null),_0x1f8a92===this['_revisionTracker']['currentRevision']){const _0x33ad26=Math['max'](_0x1f8a92['toVersion'],_0x2edd84['toVersion']),_0x2095c9=Math['max'](_0x1f8a92['fromVersion'],_0x2edd84['fromVersion']);let _0x57a47f;_0x1f8a92['toVersion']===_0x2edd84['toVersion']&&_0x1f8a92['fromVersion']===_0x2edd84['fromVersion']?(_0x57a47f=!0x0,this['_preventResendingRevisionData'](_0x2edd84)):_0x2edd84['toVersion']===_0x33ad26&&_0x2edd84['fromVersion']===_0x2095c9?_0x57a47f=!0x1:(_0x1f8a92['toVersion']===_0x33ad26&&_0x1f8a92['fromVersion']===_0x2095c9||this['_fixRevision']({'revision':_0x1f8a92,'from':_0x2095c9,'to':_0x33ad26}),_0x57a47f=!0x0),_0x57a47f&&(delete _0x2edd84['fromVersion'],delete _0x2edd84['toVersion'],delete _0x2edd84['diffData'],delete _0x2edd84['createdAt'],delete _0x2edd84['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2edd84),this['_preventResendingRevisionData'](_0x2edd84);}else this['_revisionTracker']['addRevisionData'](_0x2edd84);}const _0x539e43=_0x3dadee['getRevisions']();_0x539e43['reverse']();for(let _0x46cdae=0x0;_0x46cdae<_0x539e43['length']-0x1;_0x46cdae++){const _0x492ed8=_0x539e43[_0x46cdae],_0x2b6a50=_0x539e43[_0x46cdae+0x1];if(_0x492ed8['fromVersion']<_0x2b6a50['toVersion']){const _0x4e4310=_0x2b6a50['toVersion'],_0x292ea4=Math['max'](_0x4e4310,_0x492ed8['toVersion']);this['_fixRevision']({'revision':_0x492ed8,'from':_0x4e4310,'to':_0x292ea4});}}}['_fixRevision']({revision:_0x46141a,from:_0x466add,to:_0x292b84}={}){const _0x50ec05=this['editor']['plugins']['get'](_0x5b2741),_0x2a9651=this['_revisionTracker']['buildRevisionData']({'revision':_0x46141a,'from':_0x466add,'to':_0x292b84});_0x2a9651['authors']=_0x2a9651['authorsIds']['map'](_0x37bbe0=>_0x50ec05['getUser'](_0x37bbe0)),_0x46141a['_update'](_0x2a9651);}['_preventResendingRevisionData'](_0x9fc14f){const _0x1c594d={};_0x1c594d['id']=_0x9fc14f['id'];for(const _0x47445a of Object['keys'](_0x9fc14f))'id'!==_0x47445a&&(_0x1c594d[_0x47445a]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1c594d['id'],_0x1c594d,!0x0);}async['_fetchMissingUsers'](_0x54902c){const _0x59ae5b=this['editor']['plugins']['get'](_0x5b2741),{connection:_0x64b24a}=this['editor']['plugins']['get'](c),_0x462e59=new Set();for(const _0x377b0f of _0x54902c){for(const _0x2dee5e of _0x377b0f['authorsIds'])_0x36dc45(_0x2dee5e);_0x377b0f['creatorId']&&_0x36dc45(_0x377b0f['creatorId']);}if(0x0===_0x462e59['size'])return;const _0x29f128=await lt['getMany'](_0x64b24a,Array['from'](_0x462e59));for(const _0x538fd9 of _0x29f128)_0x59ae5b['getUser'](_0x538fd9['id'])||_0x59ae5b['addUser'](_0x538fd9);function _0x36dc45(_0x1941c7){_0x59ae5b['getUser'](_0x1941c7)||_0x462e59['add'](_0x1941c7);}}}function st(_0x1efb45){return _0x1efb45['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1efb45['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1efb45['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class d extends _0x33017c{static get['requires'](){return['RevisionHistory',v,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}}class ts extends _0x325e89{constructor(_0x557f89){super(_0x557f89);const _0x427db4=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x427db4['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x427db4['to']('usersCount',_0x2b0abf=>q(_0x557f89,'CONNECTED_USERS',_0x2b0abf))}]});}}class es extends _0x325e89{['items'];['keystrokes'];constructor(_0x579015){super(_0x579015);const _0x42f679=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x394e6f(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x42f679['if']('hasPopup'),'aria-expanded':_0x42f679['to']('isExpanded',_0x3347f4=>this['hasPopup']&&String(_0x3347f4)),'aria-label':_0x42f679['to']('hasPopup',_0x251f00=>q(_0x579015,_0x251f00?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x42f679['to']('hasPopup',_0x2a3dd0=>!!_0x2a3dd0&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x42f679['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x2ecba8,_0x2614d3,_0x5c273c)=>{this['element']&&(_0x5c273c?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 _0x325e89{['counterView'];['inlineListView'];constructor(_0xf5e75c){super(_0xf5e75c);const _0x5147ae=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0xf5e75c),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x1c3115 of this['inlineListView']['items'])_0x1c3115['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',_0x5147ae['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x325e89{['listWrapperView'];constructor(_0x58155b,_0x21fda6){super(_0x58155b),this['listWrapperView']=new mt(_0x58155b,_0x21fda6),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x58155b,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x376162{constructor(_0xadb9bb,_0x2433bd){super(_0xadb9bb);const _0x1b4039=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2433bd?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1b4039['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1b4039['to']('role'),'aria-label':_0x1b4039['to']('ariaLabel'),'aria-labelledby':_0x1b4039['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3a845f['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1e0e46=this['element'];_0x1e0e46&&(this['_isScrollable']=Math['max'](_0x1e0e46['scrollHeight'],_0x1e0e46['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x5130f8,_0x370d5a,_0x42acc8){super(_0x5130f8);const _0x49bf6d=this['bindTemplate'];this['userView']=new ct(_0x5130f8,_0x370d5a);const _0x51a903={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x370d5a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x370d5a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x370d5a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x42acc8&&(_0x51a903['tag']='button',_0x51a903['on']={'click':_0x49bf6d['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x51a903);}['focus'](){this['element']['focus']();}}class y extends _0x325e89{['userView'];['markerView'];constructor(_0x2c5def,_0x2cf8cc,_0x578cb3){super(_0x2c5def);const _0x3a8465=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x2c5def,_0x2cf8cc),this['markerView']=new at(_0x2c5def,_0x2cf8cc);const _0x1be1e7=new ot(_0x2c5def);_0x1be1e7['template']['tag']='span',_0x1be1e7['text']=_0x2cf8cc['name'];const _0x493e6d={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x3a8465['to']('isFocusable',_0xd7a233=>!!_0xd7a233&&0x0),'aria-labelledby':_0x1be1e7['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x3a8465['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x3a8465['to']('hasTooltip',_0x4dc190=>!_0x4dc190),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1be1e7]};_0x578cb3&&(_0x493e6d['tag']='button',_0x493e6d['on']={'click':_0x3a8465['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x493e6d);}}class at extends _0x325e89{constructor(_0x31958f,_0x40791c){super(_0x31958f),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x40791c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class s extends _0xb4909c{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0xddcce6){super(_0xddcce6),this['context']['config']['define']('presenceList',A);const _0x221a0d=_0xddcce6['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x221a0d)throw new _0x3f3cf1('presencelist-collapseat-invalid-format',this);if(_0x221a0d<0x1)throw new _0x3f3cf1('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](r)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3d03ac(),this['balloonPanelView']=new _0x4fafdb(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[r];}['init'](){for(const _0x5affd9 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5affd9);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5ef733,_0x47a5d2)=>{this['_handleUserAdd'](_0x47a5d2);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x382dee,_0x33ff84)=>{this['_handleUserRemove'](_0x33ff84);});}['_createView'](){const _0x56445b=this['context'],_0x2af86d=new L(this['context']['locale']),_0x33f7cc=this['balloonPanelView'];if(!_0x165d0f(_0x56445b['config']['get']('presenceList.container')))throw new _0x3f3cf1('presencelist-missing-container',this);return _0x2af86d['counterView']['bind']('usersCount')['to'](this),_0x2af86d['bind']('isCollapsed')['to'](this,'usersCount',_0x4b0789=>{const {collapseAt:_0x508521,displayMe:_0x2ba4b7}=_0x56445b['config']['get']('presenceList'),_0x998071=_0x4b0789>=_0x508521;return _0x2af86d['counterView']['isHidden']=!(0x1==_0x4b0789&&_0x2ba4b7||_0x998071),_0x998071||this['hideDropdown'](),_0x998071;}),_0x2af86d['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x871aa5=>{const _0x2c361a=_0x56445b['config']['get']('presenceList'),_0x7fa10c=new y(_0x56445b['locale'],_0x871aa5,!!_0x2c361a['onClick']);return _0x7fa10c['bind']('hasTooltip')['to'](_0x2af86d,'isCollapsed',_0x15e980=>!_0x15e980),_0x7fa10c['bind']('isFocusable')['to'](_0x2af86d,'isCollapsed',_0x426679=>!_0x426679),_0x2c361a['onClick']&&this['listenTo'](_0x7fa10c,'execute',()=>{this['view']['isCollapsed']||_0x2c361a['onClick'](_0x871aa5,_0x7fa10c['element']);}),_0x7fa10c;}),this['listenTo'](_0x2af86d['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x2af86d['inlineListView']['keystrokes']['set']('Enter',(_0x40403a,_0x2580be)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2580be());}),_0x2af86d['render'](),_0x33f7cc['render'](),_0x1663e4({'emitter':_0x2af86d,'activator':()=>_0x33f7cc['isVisible'],'contextElements':[_0x33f7cc['element'],_0x2af86d['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x56445b['config']['get']('presenceList.container')['appendChild'](_0x2af86d['element']),this['_bodyCollection']=new _0xb3c7c9(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2af86d;}['_handleUserAdd'](_0x6b6177){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x6b6177['isMe'])return;const _0x568d0a=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x568d0a&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x288c50=_0x6b6177['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x6b6177,_0x288c50);}['_handleUserRemove'](_0x543548){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x543548['id'])&&(this['currentDisplayedUsers']['remove'](_0x543548['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x54b002 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x54b002['id']))return void this['currentDisplayedUsers']['add'](_0x54b002,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x251e13=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x251e13['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x3484a7}=this['presenceDropdownView'];_0x3484a7['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x490d7e=>{if(!_0x251e13['displayMe']&&_0x490d7e['isMe'])return null;const _0x3adf04=new k(this['context']['locale'],_0x490d7e,!!_0x251e13['onClick']);return _0x251e13['onClick']&&this['listenTo'](_0x3adf04,'execute',()=>{_0x251e13['onClick'](_0x490d7e,_0x3adf04['element']);}),_0x3adf04;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3484a7['focus'](),_0x3484a7['checkIfScrollable']();const _0x273bb=(_0x5c0400,_0x490d70)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x490d70();};_0x3484a7['keystrokes']['set']('Esc',_0x273bb),_0x3484a7['keystrokes']['set']('Shift+Tab',_0x273bb),_0x3484a7['keystrokes']['set']('Tab',(_0x2c816a,_0x477a2e)=>{!function(_0x4e6d19){const _0x49a3a5=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x2a3d85=>_0x2a3d85+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2e1203=[...document['body']['querySelectorAll'](_0x49a3a5)]['filter'](_0x268da7=>_0x268da7===document['activeElement']||_0x268da7['offsetWidth']+_0x268da7['offsetHeight']>0x0)['sort']((_0xbc02c,_0x2e4e8d)=>(_0xbc02c['tabIndex']||0x0)-(_0x2e4e8d['tabIndex']||0x0)),_0x59c691=_0x2e1203['indexOf'](_0x4e6d19),_0x211e64=_0x2e1203[(_0x59c691+0x1)%_0x2e1203['length']];_0x211e64&&_0x211e64['focus']();}(this['view']['element']),this['hideDropdown'](),_0x477a2e();}),_0x3484a7['focusTracker']['add'](this['view']['element']),_0x3484a7['focusTracker']['on']('change:isFocused',(_0x26b2ed,_0x3b3b2c,_0x3e83a4)=>{_0x3e83a4||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 _0xb4909c{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 _0x34d5bf,Plugin as _0x255d8c,PendingActions as _0x3c2701,Context as _0x326182}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x4bc5a2,CKEditorError as _0x2e31b4,Collection as _0x3b97a7,global as _0x54f579,version as dt,uid as _0x24a4f3,KeystrokeHandler as _0x38ba82}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0xb84eee,View as _0x4a9566,ListView as _0x51992f,ListItemView as ct,LabelView as lt,BalloonPanelView as _0x21dd49,clickOutsideHandler as _0x1e1784,BodyCollection as tt}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ut,History as _0xa9ff56,NoOperation as _0x712f2e,InsertOperation as _0x3558c6,MarkerOperation as _0x4bec01,RootAttributeOperation as _0x35113a,transformSets as _0x2d51b7,OperationFactory as _0x460006}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ft,WEB_SOCKET_GATEWAY_STATES as _0x5c0f85,CollaborativeEditingService as _0x4564af,User as mt,CommentsService as _0x3b207a,TrackChangesService as nt,RevisionHistoryService as _0xca19f1,EditorService as _0x25c071}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x3ff6b5,UserView as at}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1142ec}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as st}from'lodash-es';class c extends _0x34d5bf{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xb84eee];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ac7ea){super(_0x4ac7ea),this['set']('state',_0x5c0f85['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4bc5a2);}['init'](){const _0x51bc35=this['context'],_0x2c1ea1=_0x51bc35['plugins']['get']('CloudServices'),_0x3cd429=_0x51bc35['plugins']['get'](_0xb84eee);if(!_0x2c1ea1['token'])throw new _0x2e31b4('websocketgateway-missing-token',this);if(!_0x2c1ea1['webSocketUrl'])throw new _0x2e31b4('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'](_0x2c1ea1['token'],_0x2c1ea1['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x1705ee=>{if(this['connection']=_0x1705ee,this['bind']('state')['to'](_0x1705ee,'state',this,'_isBrowserOffline',(_0x3d8e99,_0x3ee91e)=>('connected'!==_0x3d8e99&&(this['_shouldPluginsReconnect']=!0x0),_0x3ee91e||_0x3d8e99!==_0x5c0f85['CONNECTED']?_0x5c0f85['DISCONNECTED']:this['state']==_0x5c0f85['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x5c0f85['CONNECTING']):_0x5c0f85['CONNECTED'])),this['connection']['on']('error',(_0x36ada9,_0x68113f)=>{if('limitExceeded'!==_0x68113f['code'])throw console['error'](_0x68113f),new _0x2e31b4('cloudservices-init',null,{'originalError':_0x68113f});_0x3cd429['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'});}),!_0x1705ee['me'])return new Promise(_0x1c71de=>_0x1705ee['on']('change:me',_0x1c71de));})['catch'](_0x1edee8=>{throw console['error'](_0x1edee8),new _0x2e31b4('cloudservices-init',null,{'originalError':_0x1edee8});});}['addToReconnectionStack'](_0x5913b0){if('function'!=typeof _0x5913b0['reconnect'])throw new _0x2e31b4('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5913b0))throw new _0x2e31b4('websocketgateway-plugin-already-registered',this,{'name':_0x5913b0['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5913b0);}['removeFromReconnectionStack'](_0x55b6fd){this['_reconnectionStack']['delete'](_0x55b6fd);}['isInReconnectionStack'](_0x396e62){return this['_reconnectionStack']['has'](_0x396e62);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x27c40f=>_0x27c40f['reconnect']())))['then'](()=>this['state']=_0x5c0f85['CONNECTED'])['catch'](_0x7d545=>{throw console['error'](_0x7d545),new _0x2e31b4('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x5c0f85['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x34d5bf{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x3ff6b5];}constructor(_0x3e8837){super(_0x3e8837),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3b97a7(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x3ff6b5);}['init'](){const _0x541ab6=this['context']['plugins']['get'](c);this['listenTo'](_0x541ab6,'change:state',(_0x2f212f,_0x1d0deb,_0x5d7bf0)=>{if('connected'!==_0x5d7bf0)this['channelSessions']['forEach'](_0x4dc8f5=>_0x4dc8f5['clear']()),this['channelConnectedUsers']['forEach'](_0x1ff037=>_0x1ff037['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2c9396,_0x5ab6f2]of this['_registeredSessions'])for(const _0xe6076a of _0x5ab6f2)this['_handleSessionAdd'](_0x2c9396,_0xe6076a);}}),this['_createUser'](_0x541ab6['connection']['me'],!0x0);}['register'](_0x1541d8,_0x12ef6d){if(this['_registeredSessions']['has'](_0x1541d8))throw new _0x2e31b4('sessions-register-already-registered',null,{'channelId':_0x1541d8});this['_registeredSessions']['set'](_0x1541d8,_0x12ef6d),this['channelSessions']['set'](_0x1541d8,new _0x3b97a7()),this['channelConnectedUsers']['set'](_0x1541d8,new _0x3b97a7()),this['listenTo'](_0x12ef6d,'add',(_0x5249e0,_0xf96e35)=>this['_handleSessionAdd'](_0x1541d8,_0xf96e35)),this['listenTo'](_0x12ef6d,'remove',(_0x3a370b,_0x380049)=>this['_handleSessionRemove'](_0x1541d8,_0x380049));for(const _0x45f8f7 of _0x12ef6d)this['_handleSessionAdd'](_0x1541d8,_0x45f8f7);}['unregister'](_0xd597df){if(!this['_registeredSessions']['has'](_0xd597df))throw new _0x2e31b4('sessions-unregister-not-exist',null,{'channelId':_0xd597df});const _0x547266=this['_registeredSessions']['get'](_0xd597df);this['stopListening'](_0x547266);for(const _0x15b8cd of _0x547266)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0xd597df,_0x15b8cd);this['_registeredSessions']['delete'](_0xd597df),this['channelSessions']['delete'](_0xd597df),this['channelConnectedUsers']['delete'](_0xd597df);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x307448){for(const _0x176d8b of this['channelSessions']['values']())for(const _0x578ce3 of _0x176d8b)if(_0x578ce3['id']===_0x307448)return _0x578ce3['user'];}['getUserSessions'](_0x1d65f9,_0x1d1ef6){const _0x5cd742=_0x1d1ef6?[this['channelSessions']['get'](_0x1d1ef6)]:this['channelSessions']['values'](),_0x36e814=new Set();for(const _0x20752a of _0x5cd742)for(const _0x26c4c3 of _0x20752a)_0x26c4c3['user']['id']===_0x1d65f9['id']&&_0x36e814['add'](_0x26c4c3['id']);return _0x36e814;}['getUserRole'](_0x4b8bfa){for(const _0x13688f of this['channelSessions']['values']())for(const _0x468506 of _0x13688f)if(_0x468506['user']===_0x4b8bfa)return _0x468506['role'];}['_handleSessionAdd'](_0x3ba294,_0x4ac7aa){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x20c2ce=_0x4ac7aa['user'],_0x1cfd9f=this['_users']['getUser'](_0x20c2ce['id'])||this['_createUser'](_0x20c2ce),_0x114340=Object['assign']({},_0x4ac7aa,{'user':_0x1cfd9f});this['channelSessions']['get'](_0x3ba294)['add'](_0x114340);const _0x1ac7d9=this['channelConnectedUsers']['get'](_0x3ba294);_0x1ac7d9['has'](_0x1cfd9f['id'])||_0x1ac7d9['add'](_0x1cfd9f),this['allConnectedUsers']['has'](_0x1cfd9f['id'])||this['allConnectedUsers']['add'](_0x1cfd9f,_0x1cfd9f['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3ba294,{'channelId':_0x3ba294,'session':_0x114340});}['_handleSessionRemove'](_0x4bbf7e,_0x53bc28){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x475ebf=this['channelConnectedUsers']['get'](_0x4bbf7e),_0x23c3e7=_0x53bc28['user'];_0x23c3e7['id']&&(this['channelSessions']['get'](_0x4bbf7e)['remove'](_0x53bc28['id']),_0x475ebf['has'](_0x23c3e7['id'])&&!this['getUserSessions'](_0x23c3e7,_0x4bbf7e)['size']&&_0x475ebf['remove'](_0x23c3e7['id']),this['allConnectedUsers']['get'](_0x23c3e7['id'])&&!this['getUserSessions'](_0x23c3e7)['size']&&this['allConnectedUsers']['remove'](_0x23c3e7['id']));}['_createUser'](_0x33901c,_0x5e0854){const _0x2f9328=this['_users']['addUser'](_0x33901c);return _0x5e0854&&this['_users']['defineMe'](_0x33901c['id']),_0x2f9328['orderNumber']=this['_uniqueUsersCount']++,_0x2f9328;}}class N extends _0x255d8c{['_domEmitter']=new(_0x4bc5a2())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3d69fe=this['editor'],_0x4fa257=_0x3d69fe['plugins']['get'](i);_0x3d69fe['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4a6ab5,{writer:_0x22e7ea})=>function(_0x2f0afc,_0x5b180a,_0x43719a,_0x4cb300){const _0x1fd566=_0x2f0afc['markerName']['split'](':')[0x2],_0xcd7cc5=_0x43719a['getUserBySessionId'](_0x1fd566);if(!_0xcd7cc5||_0x1fd566===_0x43719a['mySessionId'])return;if(!_0x4cb300['model']['schema']['checkChild'](_0x2f0afc['markerRange']['start'],'$text'))return;const _0x14dd8f={'class':'ck-user__marker\x20'+_0xcd7cc5['color']['getMarkerClass'](),'data-name':_0xcd7cc5['name'],'data-session-id':_0x1fd566},_0x23831e=_0x4cb300['model']['markers']['get'](_0x2f0afc['markerName']),_0x3d4e1e=_0x23831e['getStart'](),_0x842743=_0x3d4e1e['nodeAfter'],_0x351077=_0x4cb300['model']['schema'];if(_0x842743&&_0x351077['isObject'](_0x842743)&&_0x351077['isInline'](_0x842743)&&!_0x4cb300['model']['markers']['get']('user:range:'+_0x1fd566)['getRange']()['isCollapsed'])return;const _0x19286a=_0x3d4e1e['parent'];return _0x4cb300['model']['schema']['isLimit'](_0x19286a)&&!_0x4cb300['model']['hasContent'](_0x19286a)&&(_0x14dd8f['contenteditable']=!0x1),function(_0x4c0618,_0x6583cb,_0x4f83a4){const _0x346fdf=_0x4c0618['createUIElement']('span',_0x6583cb);return _0x4c0618['setCustomProperty']('userPositionMarker',!0x0,_0x346fdf),_0x346fdf['render']=function(_0x40dd81){const _0x2a19ea=this['toDomElement'](_0x40dd81);return _0x2a19ea['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>'+_0x4f83a4['name']+'</span>',_0x2a19ea['addEventListener']('mouseenter',()=>{_0x2a19ea['classList']['add']('ck-user__marker_hovered');}),_0x2a19ea['addEventListener']('mouseleave',()=>{_0x2a19ea['classList']['remove']('ck-user__marker_hovered');}),_0x2a19ea;},_0x346fdf['isSimilar']=function(_0x2cbf8e){return!(!this['getCustomProperty']('userPositionMarker')||!_0x2cbf8e['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x2cbf8e['getAttribute']('data-session-id'));},_0x346fdf;}(_0x5b180a,_0x14dd8f,_0xcd7cc5);}(_0x4a6ab5,_0x22e7ea,_0x4fa257,_0x3d69fe)}),_0x3d69fe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x46ec7f=>function(_0x341750,_0x663d14){const _0x2a9341=_0x341750['markerName']['split'](':')[0x2];if(_0x2a9341===_0x663d14['mySessionId'])return null;const _0x463cc2=_0x663d14['getUserBySessionId'](_0x2a9341);if(!_0x463cc2)return{'id':_0x2a9341,'classes':[]};return{'id':_0x2a9341,'classes':['ck-user__selection',_0x463cc2['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x2a9341},'priority':0x7d0+_0x463cc2['orderNumber']};}(_0x46ec7f,_0x4fa257)}),function(_0x11d8ad){const _0x11709e=_0x11d8ad['model'],_0x24da7f=new Map(),_0x2fc70c=_0x11d8ad['plugins']['get'](i);_0x11709e['markers']['on']('update:user:range',(_0x543e9a,_0xae36c6,_0x328272,_0x27d83b)=>{if(!_0x27d83b&&_0x24da7f['get'](_0xae36c6['name']))return _0x24da7f['get'](_0xae36c6['name'])['detach'](),void _0x24da7f['delete'](_0xae36c6['name']);const _0x36f4be=_0xae36c6['name']['split'](':')[0x2];if(_0x36f4be===_0x2fc70c['mySessionId'])return;const _0x5789d2='user:position:'+_0x36f4be;_0x11709e['markers']['has'](_0x5789d2)&&_0x11d8ad['editing']['reconvertMarker'](_0x5789d2),_0xae36c6['on']('change:range',(_0x21407e,_0x5775d3,_0x5a9580)=>{if('$graveyard'!=_0x5775d3['root']['rootName']&&'$graveyard'==_0xae36c6['getRange']()['root']['rootName']&&!_0x24da7f['has'](_0xae36c6['name'])){const _0x80a346=_0x11709e['schema']['getNearestSelectionRange'](_0x5a9580['deletionPosition']);if(_0x80a346){const _0x190508=ut['fromRange'](_0x80a346);_0x24da7f['set'](_0xae36c6['name'],_0x190508),_0x190508['on']('change:range',(_0x1b918b,_0x52fc73,_0x550a65)=>{if('$graveyard'==_0x190508['root']['rootName']){const _0xdd30d2=_0x11709e['schema']['getNearestSelectionRange'](_0x550a65['deletionPosition']);_0xdd30d2?(_0x190508['start']=_0xdd30d2['start'],_0x190508['end']=_0xdd30d2['end']):(_0x24da7f['delete'](_0xae36c6['name']),_0x190508['detach']());}});}}});}),_0x11709e['document']['on']('change',()=>{_0x24da7f['size']>0x0&&_0x11709e['enqueueChange']({'isUndoable':!0x1},_0x149efc=>{for(const [_0x421676,_0x39c0b5]of _0x24da7f)'$graveyard'==_0x11709e['markers']['get'](_0x421676)['getRange']()['root']['rootName']&&(G(_0x421676['split'](':')[0x2],_0x39c0b5['toRange'](),_0x11709e,_0x149efc),_0x39c0b5['detach']());_0x24da7f['clear']();});});}(_0x3d69fe),this['_domEmitter']['listenTo'](_0x54f579['document'],'keydown',(_0x39027c,{key:_0x20fc36})=>{'Escape'===_0x20fc36&&function(_0xf1023e){_0xf1023e['editing']['view']['change'](_0x51daf4=>{for(const _0x50471e of _0xf1023e['model']['markers']){if(!_0x50471e['name']['startsWith']('user:position'))continue;const _0x4a9cc9=_0xf1023e['editing']['mapper']['markerNameToElements'](_0x50471e['name']);if(_0x4a9cc9){for(const _0x3b92ed of _0x4a9cc9)_0x51daf4['removeClass']('ck-user__marker_hovered',_0x3b92ed);}}});}(_0x3d69fe);},{'useCapture':!0x0});}['afterInit'](){const _0x19ba80=this['editor'],_0x4c46b4=_0x19ba80['commands']['get']('undo');_0x4c46b4&&_0x19ba80['model']['on']('applyOperation',(_0x1c6d81,_0x44fb9d)=>{const _0x3b7010=_0x44fb9d[0x0];if('marker'!=_0x3b7010['type']||!_0x3b7010['name']['startsWith']('user:'))return;const _0x25fae4=_0x3b7010['batch'];_0x4c46b4['_createdBatches']['has'](_0x25fae4)&&(_0x3b7010['newRange']=_0x3b7010['oldRange']?_0x19ba80['model']['createRange'](_0x3b7010['oldRange']['start'],_0x3b7010['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0xff7cfa=this['editor'],_0x42564e=_0xff7cfa['model']['document'],_0x1bed41=_0xff7cfa['plugins']['get'](i);_0xff7cfa['model']['enqueueChange']({'isUndoable':!0x1},_0x2dbff3=>{const _0x1843ba='user:range:'+_0x1bed41['mySessionId'],_0x2559c9='user:position:'+_0x1bed41['mySessionId'],_0x3d83b4=_0xff7cfa['model']['markers']['has'](_0x1843ba);_0xff7cfa['editing']['view']['hasDomSelection']?G(_0x1bed41['mySessionId'],_0x42564e['selection']['getFirstRange'](),_0xff7cfa['model'],_0x2dbff3):_0x3d83b4&&(_0x2dbff3['removeMarker'](_0x1843ba),_0x2dbff3['removeMarker'](_0x2559c9));});}}function G(_0x1fd4a7,_0x4a6171,_0x5e16a6,_0x1bee2d){const _0x130778='user:range:'+_0x1fd4a7,_0x2161fb='user:position:'+_0x1fd4a7,_0x129ad2=_0x4a6171['getContainedElement']();let _0x186dc0=_0x4a6171['start'];_0x129ad2&&_0x129ad2['is']('element','tableCell')&&(_0x186dc0=function(_0x42abe4,_0x34486f){for(const _0x322b47 of _0x42abe4['getPositions']())if(_0x34486f['schema']['checkChild'](_0x322b47,'$text'))return _0x322b47;}(_0x4a6171,_0x5e16a6),_0x4a6171=_0x1bee2d['createRange'](_0x186dc0));const _0x39a9b7=_0x1bee2d['createRange'](_0x186dc0);_0x5e16a6['markers']['has'](_0x130778)?(_0x1bee2d['updateMarker'](_0x130778,{'range':_0x4a6171}),_0x1bee2d['updateMarker'](_0x2161fb,{'range':_0x39a9b7})):(_0x1bee2d['addMarker'](_0x130778,{'range':_0x4a6171,'usingOperation':!0x0}),_0x1bee2d['addMarker'](_0x2161fb,{'range':_0x39a9b7,'usingOperation':!0x0}));}function E(_0x2b0d22,_0x56868b,_0x4a91e8){const _0x5f3aea=_0x2b0d22['t'],t=_0x2b0d22['t'];switch(_0x56868b){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 _0x5f3aea({'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'},_0x4a91e8);default:return'';}}let M=0x1;class l extends _0x255d8c{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x4564af)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,N,_0x3c2701,_0x3ff6b5,_0xb84eee];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x54c536=this['serverHistory']['getOperations']();for(let _0x1c6af6=_0x54c536['length']-0x1;_0x1c6af6>=0x0;_0x1c6af6--){const _0x4d16f6=_0x54c536[_0x1c6af6];if(!this['_disconnectionOperations']['has'](_0x4d16f6))return _0x4d16f6['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2efed0){if(super(_0x2efed0),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0xa9ff56(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x2e31b4('collaboration-missing-channelid',this);const _0x348240=_0x2efed0['config']['get']('cloudServices.bundleVersion')||dt;this['_service']=new l['CollaborativeEditingService'](_0x348240,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1142ec(),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 _0x3cb529=this['editor'],_0xd9ad23=_0x3cb529['plugins']['get'](_0x3ff6b5),_0x4cb23e=_0x3cb529['plugins']['get'](c);this['listenTo'](_0xd9ad23,'getOperationAuthor',(_0x378249,_0x3aa26f)=>{const _0x1789a9=_0x3aa26f[0x0];_0x1789a9['_authorId']&&(_0x378249['return']=_0xd9ad23['getUser'](_0x1789a9['_authorId']),_0x378249['stop']()),null===_0x1789a9['_authorId']&&(_0x378249['return']=null,_0x378249['stop']());},{'priority':'high'}),this['listenTo'](_0x3cb529['model']['document']['selection'],'change:range',(_0x3ea83c,_0x404994)=>{_0x404994['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3cb529['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3cb529['model']['on']('applyOperation',(_0x547491,_0x4dc801)=>{const _0x326441=_0x4dc801[0x0];_0x326441['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x326441),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4cb23e,'state',this,'_hasSynchronizationProblem',(_0x2855a4,_0x3e1080)=>'connected'===_0x2855a4&&!_0x3e1080),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3cb529['disableReadOnlyMode']('rtc-offline'):_0x3cb529['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3cb529['disableReadOnlyMode']('rtc-offline'):_0x3cb529['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x52dcd0=this['editor']['plugins']['get'](i),_0x48c4db=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x52dcd0['unregister'](this['_channelId']);const _0x5bbb88=await this['_service']['reconnect'](_0x48c4db['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5bbb88)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3c1e37=await this['_service']['getConnectedSessions']();_0x52dcd0['register'](this['_channelId'],_0x3c1e37),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1d6109){if(function(_0x4aab7e){return'404'===_0x4aab7e['code'];}(_0x1d6109)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x963931){return'409'===_0x963931['code'];}(_0x1d6109)){const _0x226124=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'](_0x226124);}else{if(!(_0x1d6109 instanceof z))throw _0x1d6109;this['_handleReconnectionError']();}}}}['destroy'](){const _0x440a20=this['editor']['plugins']['get'](c),_0x4f2d2c=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4f2d2c['channelSessions']['has'](this['_channelId'])&&_0x4f2d2c['unregister'](this['_channelId']),_0x440a20['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5a9c21){if(this['sessionId']!==_0x5a9c21['sessionId']&&this['_lastSyncedOperationId']!==_0x5a9c21['lastOperationId'])throw new z();return this['sessionId']=_0x5a9c21['sessionId'],this['_handleServerResponse']([],{..._0x5a9c21,'wereChangesApplied':!0x1,'data':_0x5a9c21['data']},'reconnect');}async['_connectService'](_0x26c356,_0x2229f1=!0x1){const {connection:_0x106f55}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x106f55,this['_channelId'])['then'](_0x3fcf93=>this['_initSessionsHandling'](_0x3fcf93))['catch'](_0x3c5695=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3c5695);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x31f093,_0x36a9a7)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x36a9a7);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2df6db=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x26c356);this['_isPendingUpdate']=!0x0;const _0x20a6e7=await this['_service']['connect'](_0x106f55,this['_compressOperations'](_0x26c356),_0x2df6db);if(this['sessionId']=_0x20a6e7['sessionId'],_0x2229f1){if(!_0x20a6e7['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x20a6e7['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x26c356,_0x20a6e7,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x20a6e7,_0x26c356);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4f836f=this['editor']['plugins']['get'](i),_0x4354d1=this['editor']['plugins']['get'](N),_0x577985=_0x4f836f['channelSessions']['get'](this['_channelId']);_0x577985&&_0x577985['length']>0x1?_0x4354d1['createUserMarkerOperations']():this['listenTo'](_0x4f836f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4f836f['channelSessions']['get'](this['_channelId'])['length']&&_0x4354d1['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4dbe17,_0x2432d1,_0xecc235,_0xd110ec){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2432d1){const _0x381c21=this['_decompressOperations'](_0xecc235,_0xd110ec);await this['_fetchMissingUsers'](_0x381c21),this['_handleExternalOperations'](_0x381c21,_0x2432d1,_0xecc235['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0xc47f82}=this['editor'];let _0x1c5f33;try{_0x1c5f33=await this['_service']['getDocumentDetails']();}catch(_0x36153f){const _0x53232b=E(_0xc47f82,'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'](_0x53232b);}const _0x35bcb5=_0x1c5f33['currentDocumentSession']||_0x1c5f33['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x35bcb5['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x507223=E(_0xc47f82,'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'](_0x507223);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4a82ce){const _0x291b8f=this['editor']['plugins']['get'](i);this['listenTo'](_0x291b8f,'sessionAdd:'+this['_channelId'],(_0x1aaf5f,{session:_0x5f09e4})=>{if(_0x5f09e4['id']===_0x291b8f['mySessionId']){_0x1aaf5f['off']();const _0x1e9be4=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x274f8a=_0x5f09e4['permissions'];_0x1e9be4&&_0x1e9be4['isEnabled']&&(_0x274f8a=_0x274f8a['filter'](_0x2bdf47=>'document:write'!==_0x2bdf47)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x274f8a,this['_channelId']);}}),_0x291b8f['register'](this['_channelId'],_0x4a82ce);}['_initThrowingOnDataSet'](){const _0x2f69d1=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xb6a417)=>{if(!_0xb6a417[_0xb6a417['length']-0x1]['suppressErrorInCollaboration'])throw new _0x2e31b4('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2f69d1['apply'](this['editor']['data'],_0xb6a417);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1ed946,[_0x50bd47])=>{if(this['_document']['version'])throw new _0x2e31b4('realtimecollaborationclient-init-document-already-initialized',this);_0x1ed946['stop'](),this['_setPendingAction']();const _0x5b1c7b=this['editor']['config']['get']('rootsAttributes'),_0x38b2c0=this['_getOperationsFromInitData'](_0x50bd47,_0x5b1c7b);0x0==_0x38b2c0['length']&&_0x38b2c0['push'](new _0x712f2e(0x0)),_0x1ed946['return']=this['_connectService'](_0x38b2c0)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x5cdb30=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5cdb30))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5a20bb,[_0x148c2c,_0xcb4d5c])=>{_0x5a20bb['stop']();const _0x2b6e18=this['editor']['model']['document']['getRoot'](_0x148c2c);if(!this['_knownRootNames']['has'](_0x148c2c)){const _0x272864=_0xcb4d5c&&_0xcb4d5c['data']?_0xcb4d5c['data']:'',_0x57b6cc=_0xcb4d5c&&_0xcb4d5c['attributes']?_0xcb4d5c['attributes']:{};await this['_loadRoot'](_0x148c2c,_0x272864,_0x57b6cc);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x2b6e18['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x2b6e18);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x47381a){const _0x4078ec=this['editor']['plugins']['get'](_0x3ff6b5),{connection:_0x29a48c}=this['editor']['plugins']['get'](c),_0x3b0763=new Set();for(const _0xe3c6b8 of _0x47381a){const _0x2dceb4=_0xe3c6b8['_authorId'];_0x2dceb4&&!_0x4078ec['getUser'](_0x2dceb4)&&_0x3b0763['add'](_0x2dceb4);}if(0x0===_0x3b0763['size'])return;const _0x329290=await mt['getMany'](_0x29a48c,Array['from'](_0x3b0763));for(const _0x2e96fa of _0x329290)_0x4078ec['getUser'](_0x2e96fa['id'])||_0x4078ec['addUser'](_0x2e96fa);}['_getOperationsFromInitData'](_0x42910a,_0xb85e17={}){const _0x326ea3=this['editor']['model'],_0x3e6f7a=[];let _0x5d2f47=0x0;const _0x56de00='string'==typeof _0x42910a?{'main':_0x42910a}:_0x42910a;for(const _0x4e970e of Object['keys'](_0x56de00)){if(!this['_document']['roots']['has'](_0x4e970e))throw new _0x2e31b4('realtimecollaborationclient-init-non-existent-root',this);const _0x41174a=this['editor']['data']['parse'](_0x56de00[_0x4e970e]),_0x4c8ccf=this['_document']['getRoot'](_0x4e970e),_0x2eedc9=new _0x3558c6(_0x326ea3['createPositionAt'](_0x4c8ccf,0x0),_0x41174a,_0x5d2f47++);_0x3e6f7a['push'](_0x2eedc9);for(const [_0x50d682,_0x39a454]of _0x41174a['markers']){const _0x356881=_0x326ea3['createRange'](_0x326ea3['createPositionFromPath'](_0x4c8ccf,_0x39a454['start']['path']['slice']()),_0x326ea3['createPositionFromPath'](_0x4c8ccf,_0x39a454['end']['path']['slice']())),_0xb1c33c=new _0x4bec01(_0x50d682,null,_0x356881,_0x326ea3['markers'],!0x0,_0x5d2f47++);_0x3e6f7a['push'](_0xb1c33c);}}if(_0xb85e17)for(const [_0x59edb5,_0x3205e3]of Object['entries'](_0xb85e17)){const _0x3ffe9d=_0x326ea3['document']['getRoot'](_0x59edb5);if(!_0x3ffe9d)throw new _0x2e31b4('multi-root-editor-root-attributes-no-root',null);for(const [_0x308226,_0x4a19c6]of Object['entries'](_0x3205e3))if(null!==_0x4a19c6){const _0x103077=new _0x35113a(_0x3ffe9d,_0x308226,null,_0x4a19c6,_0x5d2f47++);_0x3e6f7a['push'](_0x103077);}}return _0x3e6f7a;}async['_loadRoot'](_0xe3ade9,_0xb56dc0,_0x27f533){this['_getOperationsFromInitData']({[_0xe3ade9]:_0xb56dc0},{[_0xe3ade9]:_0x27f533})['forEach']((_0x59401b,_0xdc034)=>{_0x59401b['baseVersion']=this['_document']['version']+_0xdc034,_0x59401b['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x59401b);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x4ac3b4,_0x294321){let _0x4d9911;this['_offset']=_0x4ac3b4['offset'];const _0x1237f8=_0x4ac3b4['wereChangesApplied']&&!_0x4ac3b4['initData'],_0x304a5e=_0x1237f8?0x0:_0x4ac3b4['data']['baseVersion'];if(_0x294321['forEach'](_0x1769dc=>{_0x1769dc['_isInit']=!0x0,_0x1769dc['createdAt']=_0x4ac3b4['sessionCreatedAt'],_0x1769dc['_authorId']=null;}),_0x1237f8)_0x4d9911=_0x294321,this['_applyOperationsSet'](_0x4d9911,_0x1237f8);else{if(_0x4ac3b4['initData']){const _0x340fce=this['_getOperationsFromInitData'](_0x4ac3b4['initData']);this['_document']['history']['version']=-_0x340fce['length'],_0x340fce['forEach'](_0x4bf461=>{_0x4bf461['baseVersion']-=_0x340fce['length'],_0x4bf461['createdAt']=_0x4ac3b4['sessionCreatedAt'],_0x4bf461['_isInit']=!0x0,_0x4bf461['_authorId']=null;}),this['_applyOperationsSet'](_0x340fce,!0x0),this['serverHistory']['version']=-_0x340fce['length']+this['_offset'],this['_updateServerHistory'](_0x340fce);}this['_document']['history']['version']=_0x304a5e,_0x4d9911=this['_decompressOperations'](_0x4ac3b4['data'],_0x4ac3b4['metadata']),await this['_fetchMissingUsers'](_0x4d9911),this['_applyOperationsSet'](_0x4d9911,_0x1237f8);}_0x4ac3b4['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4d9911,_0x4ac3b4['lastOperationId']),this['_lastSyncedOperationId']=_0x4ac3b4['lastOperationId']),this['serverHistory']['version']=_0x304a5e+this['_offset'],this['_updateServerHistory'](_0x4d9911),_0x294321['filter'](_0x572ec3=>{const _0x295612=this['_getAffectedRoot'](_0x572ec3);return _0x295612&&!this['_knownRootNames']['has'](_0x295612);})['forEach']((_0x593421,_0x335594)=>{_0x593421['baseVersion']=this['_document']['version']+_0x335594,this['_saveOperationInBuffer'](_0x593421);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x3eae08,_0x1e3424){throw this['_isPendingUpdate']=!0x0,_0x1e3424&&console['error'](_0x1e3424),new _0x2e31b4(_0x3eae08,this['editor']);}['_saveOperationInBuffer'](_0x5374f3){this['_knownOperations']['has'](_0x5374f3)||(this['_knownOperations']['add'](_0x5374f3),this['_bufferedOperations']['push'](_0x5374f3),this['_pendingAction']||'marker'==_0x5374f3['type']&&!_0x5374f3['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5076d5=!0x1){!_0x5076d5&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x32a0d3=>{_0x32a0d3&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x111bf0=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x594736){return _0x594736['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x594736['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x594736['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x111bf0))throw _0x111bf0;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x78d5c0=>{this['on']('change:_isPendingUpdate',()=>{_0x78d5c0();});});}async['_sendBufferedOperations'](){const _0x3f34d2=this['editor']['plugins']['get'](N);if(this['_shouldSendSelectionUpdate']()&&(_0x3f34d2['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1908e0=[...this['_bufferedOperations']];for(const _0xbe5be6 of _0x1908e0)_0xbe5be6['wasUndone']=this['_document']['history']['isUndoneOperation'](_0xbe5be6);const _0x1daab6=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1908e0),_0x2bb8d6=M++,_0xaa080=this['_compressOperations'](_0x1908e0),_0x26c7ec=await this['_service']['sendOperations'](_0xaa080,_0xaa080['baseVersion'],_0x1daab6);try{return await this['_handleServerResponse'](_0x1908e0,_0x26c7ec,_0x2bb8d6);}catch(_0x380618){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x380618);}}async['_handleServerResponse'](_0xced1ae,_0x14b668,_0x25bf4f){if('error'in _0x14b668)throw _0x14b668['error'];let _0x4ba738=!0x1;if(_0x14b668['wereChangesApplied']){_0x14b668['lastOperationId']&&(this['_lastSyncedOperationId']=_0x14b668['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2ab341=>!_0xced1ae['includes'](_0x2ab341));for(const _0x4ba6e8 of _0xced1ae)_0x4ba6e8['createdAt']='lastOperationAcceptedAt'in _0x14b668&&_0x14b668['lastOperationAcceptedAt']||void 0x0;V(_0xced1ae,_0x14b668['version']-_0xced1ae['length']),this['_updateServerHistory'](_0xced1ae);const _0x17a112=_0xced1ae['filter'](_0x5595f8=>{if(!_0x5595f8['_isInit'])return!0x1;const _0x531457=this['_getAffectedRoot'](_0x5595f8);return _0x531457&&!this['_knownRootNames']['has'](_0x531457);});V(_0x17a112,this['_document']['version']),this['_applyOperationsSet'](_0x17a112),_0x4ba738=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5e1032=this['_decompressOperations'](_0x14b668['data'],_0x14b668['metadata'])['filter'](_0x362965=>_0x362965['baseVersion']>=this['_lastServerVersion']);_0x5e1032['forEach'](_0x18a2e9=>this['_addKnownRoot'](_0x18a2e9)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x21c6ee=>!_0x21c6ee['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x21c6ee))),this['_bufferedOperations']['length']&&V(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5e1032),_0x4ba738=this['_handleExternalOperations'](_0x5e1032,_0x14b668['version'],_0x14b668['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4ba738?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x240bfd,_0x45152c,_0x5c4164){try{const _0x472c9d={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x55f136,operationsB:_0x3306bb,originalOperations:_0x34f7dc}=_0x2d51b7(_0x240bfd,this['_bufferedOperations'],_0x472c9d);V(_0x55f136,this['_document']['version']),V(_0x3306bb,_0x45152c);for(const _0x2f739a of _0x55f136){const _0x226bfd=_0x34f7dc['get'](_0x2f739a);_0x2f739a['_authorId']=_0x226bfd?_0x226bfd['_authorId']:null;}_0x5c4164&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x240bfd,_0x5c4164),this['_lastSyncedOperationId']=_0x5c4164),this['_bufferedOperations']=[..._0x3306bb],this['_applyOperationsSet'](_0x55f136),this['_updateServerHistory'](_0x240bfd);}catch(_0x4ee6d8){return console['error'](_0x4ee6d8),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4f1c6f,_0x3a9a2e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4c90c1=>{for(const _0x458a4f of _0x4f1c6f)this['_knownOperations']['add'](_0x458a4f),this['_addKnownRoot'](_0x458a4f),_0x4c90c1['batch']['addOperation'](_0x458a4f),this['editor']['model']['applyOperation'](_0x458a4f);});}['_addKnownRoot'](_0x7ca3dd){const _0x13cb1b=this['_getAffectedRoot'](_0x7ca3dd);_0x13cb1b&&this['_knownRootNames']['add'](_0x13cb1b);}['_getAffectedRoot'](_0xa03b46){let _0x33d4f3,_0x38b780;switch(_0xa03b46['type']){case'insert':_0x33d4f3=_0xa03b46['position']['root'];break;case'marker':if(_0x38b780=_0xa03b46['newRange'],!_0x38b780)return null;_0x33d4f3=_0x38b780['root'];break;case'addRootAttribute':_0x33d4f3=_0xa03b46['root'];break;case'addRoot':_0x33d4f3=_0xa03b46['affectedSelectable'];break;case'move':_0x33d4f3=_0xa03b46['targetPosition']['root'];break;default:return null;}return _0x33d4f3['rootName'];}['_updateServerHistory'](_0x55ec4d){_0x55ec4d['forEach'](_0x3ceb1f=>{const _0x516e6e=_0x3ceb1f['clone']();_0x516e6e['_authorId']=_0x3ceb1f['_authorId'],_0x516e6e['_isInit']=!!_0x3ceb1f['_isInit'],_0x516e6e['createdAt']=_0x3ceb1f['createdAt'],_0x516e6e['baseVersion']+=this['_offset'],_0x3ceb1f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x516e6e),this['serverHistory']['addOperation'](_0x516e6e);});}['_handleReconnectionError'](_0x56f521){const _0x251030=this['editor']['plugins']['get']('Notification'),_0x1f5eb2=this['editor']['locale'];_0x56f521||(_0x56f521=E(_0x1f5eb2,'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.')),_0x251030['showWarning'](_0x56f521,{'title':E(_0x1f5eb2,'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'](_0x3c2701)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3c2701)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3d197a){const _0x968fd1=_0x3d197a['map'](_0x2d9c2c=>_0x2d9c2c['toJSON']());return this['_compressor']['compress'](_0x968fd1);}['_decompressOperations'](_0x268a2e,_0xf5c5cb){return this['_compressor']['decompress'](_0x268a2e)['map']((_0x2e21d1,_0x5bb455)=>{const _0x3384aa='init'==_0xf5c5cb[_0x5bb455]['type'];if('InsertOperation'==_0x2e21d1['__className']){const _0x5f1451=_0x2e21d1['position']['root'];!this['_document']['getRoot'](_0x5f1451)&&(this['_document']['createRoot']('$root',_0x5f1451)['_isAttached']=!0x1);}const _0x215550=_0x460006['fromJSON'](_0x2e21d1,this['_document']);return _0x215550['wasUndone']=_0x2e21d1['wasUndone'],_0x215550['_isInit']=_0x3384aa,_0x215550['_authorId']=_0x3384aa?null:_0xf5c5cb[_0x5bb455]['userId'],_0x215550['_isDisconnection']='cs:removeUser'===_0xf5c5cb[_0x5bb455]['type'],_0x215550['createdAt']=_0xf5c5cb[_0x5bb455]['createdAt'],_0x215550;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5a03ed=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5a03ed&&_0x5a03ed['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class z extends Error{}function V(_0x47bd3a,_0x591e1e){for(const _0x1010e0 of _0x47bd3a)_0x1010e0['baseVersion']=_0x591e1e++;}class W{['_ignoredOperations'];['_operationToId'];constructor(_0x50c9e1){this['_ignoredOperations']=_0x50c9e1,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3eb4cc){let _0x38b489=_0x3eb4cc['length'];for(;_0x38b489--;){const _0x285354=_0x3eb4cc[_0x38b489];if(!this['_ignoredOperations']['has'](_0x285354)){if(!this['_operationToId']['has'](_0x285354)){const _0x2e1d33=_0x24a4f3()['slice'](0x1,0x12);this['_operationToId']['set'](_0x285354,_0x2e1d33);}return this['_operationToId']['get'](_0x285354);}}}['setIdForTheLastOperation'](_0x5cb69a,_0xa24c4a){if(!_0xa24c4a)return;let _0x529397=_0x5cb69a['length'];for(;_0x529397--;){const _0x44a66c=_0x5cb69a[_0x529397];this['_ignoredOperations']['has'](_0x44a66c)||this['_operationToId']['set'](_0x44a66c,_0xa24c4a);}}}class n extends _0x255d8c{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x34d5bf{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x3b207a)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x3ff6b5];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3bf2a3){super(_0x3bf2a3),this['_services']=new Map();}async['init'](){const _0x44857f=this['context'],_0xa8781b=_0x44857f['plugins']['get']('CommentsRepository');if(_0x44857f['plugins']['get'](c)['addToReconnectionStack'](this),_0xa8781b['adapter']={'addCommentThread':async({channelId:_0xa9eadd,threadId:_0x37f266,comments:_0x2ebefd,resolvedAt:_0x469558,resolvedBy:_0x181579,context:_0x1c104a,attributes:_0x11294f})=>{const _0x3999a1=await this['_getService'](_0xa9eadd)['addCommentThread']({'commentThreadId':_0x37f266,'comments':_0x2ebefd['map'](_0x323ea2=>function(_0x2b0e30,_0x56abb2,_0x2d5941){return{'commentThreadId':_0x2d5941,'commentId':_0x2b0e30['commentId'],'userId':_0x2b0e30['authorId'],'content':_0x2b0e30['content'],'documentId':_0x56abb2,'createdAt':_0x2b0e30['createdAt'],'attributes':_0x2b0e30['attributes']||{}};}(_0x323ea2,_0xa9eadd,_0x37f266)),'resolvedAt':_0x469558,'resolvedBy':_0x181579,'context':_0x1c104a,'attributes':_0x11294f})['catch'](gt);return{'threadId':_0x3999a1['commentThreadId'],'comments':_0x3999a1['comments']};},'getCommentThread':async({channelId:_0x28f4c0,threadId:_0x3d00ad})=>{const _0x5e2660=await this['_getService'](_0x28f4c0)['getCommentThread'](_0x3d00ad)['catch'](gt);return _0x5e2660['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5e2660]),{'threadId':_0x5e2660['commentThreadId'],'comments':_0x5e2660['comments']['map'](b),'context':_0x5e2660['context'],'resolvedAt':_0x5e2660['resolvedAt'],'resolvedBy':_0x5e2660['resolvedBy'],'attributes':_0x5e2660['attributes']||{}});},'updateCommentThread':async({channelId:_0x3e56b8,threadId:_0x4a491d,context:_0x17f9dc,unlinkedAt:_0x5665f2,attributes:_0x3216b4})=>this['_getService'](_0x3e56b8)['updateCommentThread']({'commentThreadId':_0x4a491d,'context':_0x17f9dc,'attributes':_0x3216b4,'unlinkedAt':_0x5665f2})['catch'](y)['catch'](gt),'resolveCommentThread':async({channelId:_0x444d8e,threadId:_0x4a2324})=>{const _0xed1aca=await this['_getService'](_0x444d8e)['resolveCommentThread'](_0x4a2324)['catch'](y)['catch'](gt);return{'threadId':_0xed1aca['commentThreadId'],'resolvedAt':_0xed1aca['resolvedAt'],'resolvedBy':_0xed1aca['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2750c1,threadId:_0x370540})=>this['_getService'](_0x2750c1)['reopenCommentThread'](_0x370540)['catch'](y)['catch'](gt),'removeCommentThread':({channelId:_0x44b873,threadId:_0x5847c4})=>this['_getService'](_0x44b873)['removeCommentThread'](_0x5847c4)['catch'](y)['catch'](gt),'addComment':({channelId:_0x2cac7a,threadId:_0x337d79,commentId:_0x2b7008,content:_0x58b52b,attributes:_0x1c1141})=>this['_getService'](_0x2cac7a)['addComment'](_0x337d79,_0x2b7008,_0x58b52b,_0x1c1141)['catch'](gt),'updateComment':({channelId:_0xbec47c,threadId:_0x45e3bc,commentId:_0x2eeb16,content:_0x302e1b,attributes:_0x7567ee})=>this['_getService'](_0xbec47c)['updateComment'](_0x45e3bc,_0x2eeb16,_0x302e1b,_0x7567ee)['catch'](y)['catch'](gt),'removeComment':({channelId:_0x1605a5,threadId:_0x464e86,commentId:_0x5119c3})=>this['_getService'](_0x1605a5)['removeComment'](_0x464e86,_0x5119c3)['catch'](y)['catch'](gt)},_0x44857f instanceof _0x326182){const _0x56a0fa=_0x44857f['config']['get']('collaboration.channelId'),_0x164ee2=_0x44857f['plugins']['get'](i);await this['_setUpService'](_0x56a0fa);const _0xb44ba2=await this['_services']['get'](_0x56a0fa)['getConnectedSessions']();this['listenTo'](_0x164ee2,'sessionAdd:'+_0x56a0fa,(_0x1ce055,{session:_0x22b843})=>{_0x22b843['id']===_0x164ee2['mySessionId']&&(_0x1ce055['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x22b843['permissions'],_0x56a0fa));}),_0x164ee2['register'](_0x56a0fa,_0xb44ba2);}}async['_setUpService'](_0x199659){if(this['_services']['has'](_0x199659))throw new _0x2e31b4('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x199659});const _0x1550e3=this['context']['plugins']['get']('CommentsRepository'),_0x35214d=new a['CommentsService'](_0x199659);this['_services']['set'](_0x199659,_0x35214d),this['listenTo'](_0x35214d,'commentThreadAdded',(_0x186b53,_0x335e71)=>{const {commentThreadId:_0x1c3ff8,documentId:_0x3de4dc,context:_0x4ed30e,attributes:_0x1dd760,resolvedAt:_0x28dcc8,resolvedBy:_0xdd416b,comments:_0xe12b50}=_0x335e71;_0x1550e3['getCommentThread'](_0x1c3ff8)||_0x1550e3['addCommentThread']({'threadId':_0x1c3ff8,'channelId':_0x3de4dc,'comments':_0xe12b50?_0xe12b50['map'](b):[],'context':_0x4ed30e,'attributes':_0x1dd760,'resolvedAt':_0x28dcc8,'resolvedBy':_0xdd416b,'isFromAdapter':!0x0});}),this['listenTo'](_0x35214d,'commentThreadUpdated',(_0x4949f0,{commentThreadId:_0x3b5bee,documentId:_0x5cac53,context:_0x426d0d,unlinkedAt:_0x5f1c1a,attributes:_0x4d4de5})=>{_0x1550e3['getCommentThread'](_0x3b5bee)&&_0x1550e3['updateCommentThread']({'threadId':_0x3b5bee,'channelId':_0x5cac53,'context':_0x426d0d,'unlinkedAt':_0x5f1c1a,'attributes':_0x4d4de5,'isFromAdapter':!0x0});}),this['listenTo'](_0x35214d,'commentThreadResolved',(_0x11a2b4,{commentThreadId:_0xffc32f,resolvedBy:_0x2eb725,resolvedAt:_0x3a9813})=>{const _0x19a1ed=_0x1550e3['getCommentThread'](_0xffc32f);_0x19a1ed&&_0x19a1ed['resolve']({'resolvedBy':_0x2eb725,'resolvedAt':_0x3a9813,'isFromAdapter':!0x0});}),this['listenTo'](_0x35214d,'commentThreadReopened',(_0x2d5a5b,{commentThreadId:_0x5ad5c6})=>{const _0x37cbd5=_0x1550e3['getCommentThread'](_0x5ad5c6);_0x37cbd5&&_0x37cbd5['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35214d,'commentThreadRemoved',(_0x50ff13,{commentThreadId:_0x9dbde5})=>{const _0x1e153a=_0x1550e3['getCommentThread'](_0x9dbde5);_0x1e153a&&_0x1e153a['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35214d,'commentAdded',(_0x5d1f2a,_0x38e882)=>{const _0x1900ab=_0x38e882['commentThreadId'],_0x3a0971=_0x1550e3['getCommentThread'](_0x1900ab);_0x3a0971&&_0x3a0971['addComment']({...b(_0x38e882),'isFromAdapter':!0x0});}),this['listenTo'](_0x35214d,'commentUpdated',(_0x2f85f5,{commentThreadId:_0xa270e7,commentId:_0x38aeb9,content:_0x4e6789,attributes:_0xe419d4})=>{const _0x2068ae=_0x1550e3['getCommentThread'](_0xa270e7);if(_0x2068ae){const _0x4eea8f=_0x2068ae['getComment'](_0x38aeb9);_0x4eea8f&&_0x4eea8f['update']({'content':_0x4e6789,'attributes':_0xe419d4,'isFromAdapter':!0x0});}}),this['listenTo'](_0x35214d,'commentRemoved',(_0x226534,{commentThreadId:_0x11697b,commentId:_0x5836f6})=>{const _0xf3b7fd=_0x1550e3['getCommentThread'](_0x11697b);if(_0xf3b7fd){const _0x33dff4=_0xf3b7fd['getComment'](_0x5836f6);_0x33dff4&&_0x33dff4['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x199659);}['destroy'](){if(this['context']instanceof _0x326182){const _0x4f5130=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4f5130);}}['_terminateService'](_0x2135f8){if(!this['_services']['has'](_0x2135f8))throw new _0x2e31b4('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2135f8});this['_getService'](_0x2135f8)['disconnect'](),this['_services']['delete'](_0x2135f8);}async['reconnect'](){for(const _0x1c300d of this['_services']['keys']())await this['_connectService'](_0x1c300d);if(this['context']instanceof _0x326182){const _0x5dca9c=this['context']['config']['get']('collaboration.channelId'),_0x2061e9=this['context']['plugins']['get'](i);_0x2061e9['unregister'](_0x5dca9c);const _0x14d19b=await this['_services']['get'](_0x5dca9c)['getConnectedSessions']();_0x2061e9['register'](_0x5dca9c,_0x14d19b);}}async['_connectService'](_0x35d143){const {connection:_0x1637b3}=this['context']['plugins']['get'](c),_0x372373=this['context']['plugins']['get']('CommentsRepository'),_0x52008e=this['_services']['get'](_0x35d143),_0x30ecf1=await _0x52008e['connect'](_0x1637b3);await this['_fetchMissingUsersForThreads'](_0x30ecf1);const _0x5ab2cd=new Set(Array['from'](_0x372373['getCommentThreads']({'channelId':_0x35d143}),_0xd84e3e=>_0xd84e3e['id']));for(const _0x2f1438 of _0x30ecf1)_0x2f1438['deletedAt']||_0x5ab2cd['delete'](_0x2f1438['commentThreadId']);for(const _0x54dea8 of _0x5ab2cd)_0x372373['getCommentThread'](_0x54dea8)['remove']({'isFromAdapter':!0x0});for(const _0x5f21a4 of _0x30ecf1){let _0x2c6b0c=_0x372373['getCommentThread'](_0x5f21a4['commentThreadId']);const {commentThreadId:_0x31ed92,context:_0x439365,attributes:_0x31b4e7,resolvedBy:_0x303a78,resolvedAt:_0x19bc5d,unlinkedAt:_0x4f0911,deletedAt:_0x428bb8}=_0x5f21a4;if(_0x428bb8)continue;_0x2c6b0c||(_0x2c6b0c=_0x372373['addCommentThread']({'channelId':_0x35d143,'threadId':_0x31ed92,'context':_0x439365,'attributes':_0x31b4e7||{},'resolvedBy':_0x303a78,'resolvedAt':_0x19bc5d,'unlinkedAt':_0x4f0911,'isFromAdapter':!0x0}));const _0x203055=new Set(Array['from'](_0x2c6b0c['comments'],_0x40afae=>_0x40afae['id']));for(const _0x1cb42b of _0x5f21a4['comments'])_0x203055['delete'](_0x1cb42b['commentId']);for(const _0x377b67 of _0x203055)_0x2c6b0c['getComment'](_0x377b67)['remove']({'isFromAdapter':!0x0});for(const _0x360331 of _0x5f21a4['comments']){const _0x542882=_0x2c6b0c['getComment'](_0x360331['commentId']);_0x542882?_0x542882['content']!==_0x360331['content']&&_0x542882['update']({'content':_0x360331['content'],'isFromAdapter':!0x0}):_0x2c6b0c['addComment'](Object['assign'](b(_0x360331),{'isFromAdapter':!0x0}));}}}['_getService'](_0x30161b){if(!this['_services']['has'](_0x30161b))throw new _0x2e31b4('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x30161b});return this['_services']['get'](_0x30161b);}async['_fetchMissingUsersForThreads'](_0x26b178){const _0x4f276e=this['context']['plugins']['get'](_0x3ff6b5),{connection:_0x740874}=this['context']['plugins']['get'](c),_0x3fcf4b=new Set();for(const {resolvedBy:_0x2a24bd,comments:_0x416d6b}of _0x26b178){_0x2a24bd&&!_0x4f276e['getUser'](_0x2a24bd)&&_0x3fcf4b['add'](_0x2a24bd);for(const {userId:_0x3d2195}of _0x416d6b)_0x4f276e['getUser'](_0x3d2195)||_0x3fcf4b['add'](_0x3d2195);}if(0x0===_0x3fcf4b['size'])return;const _0x44206d=await mt['getMany'](_0x740874,Array['from'](_0x3fcf4b));for(const _0x16d9a0 of _0x44206d)_0x4f276e['getUser'](_0x16d9a0['id'])||_0x4f276e['addUser'](_0x16d9a0);}}async function y(_0x7cf2b8){if('404'!==_0x7cf2b8['code'])throw _0x7cf2b8;}function gt(_0x18ead8){if((_0x5800d8=_0x18ead8)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5800d8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5800d8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5800d8;throw _0x18ead8;}function b(_0x22c9e2){return{'threadId':_0x22c9e2['commentThreadId'],'commentId':_0x22c9e2['commentId'],'content':_0x22c9e2['content'],'createdAt':_0x22c9e2['createdAt'],'authorId':_0x22c9e2['userId'],'attributes':_0x22c9e2['attributes']||{}};}class f extends _0x255d8c{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>nt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(_0x573219){super(_0x573219);const _0x4c2724=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x4c2724);}['init'](){const _0x357219=this['editor']['plugins']['get'](c),_0x122b48=this['editor']['plugins']['get']('TrackChangesEditing');return _0x122b48['adapter']={'getSuggestion':async _0x521b14=>{await this['_waitForServiceReady']();const _0x1c3868=await this['_trackChangesService']['get'](_0x521b14)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x1c3868]),_0x1c3868;},'addSuggestion':async({id:_0x119a0e,type:_0x5e89e7,data:_0x445991,originalSuggestionId:_0x18274d,attributes:_0x580d0b})=>{await this['_waitForServiceReady']();const _0x3602f7={'id':_0x119a0e,'type':_0x5e89e7,'data':_0x445991,'originalSuggestionId':_0x18274d,'attributes':_0x580d0b},_0x53deea=await this['_trackChangesService']['add'](_0x119a0e,_0x5e89e7,_0x445991,_0x18274d,_0x580d0b)['catch'](_0xeb4da8=>{if(wt(_0xeb4da8))return new Promise(_0x5a1124=>{this['_bufferedRequests']['set'](_0x119a0e,{'resolve':_0x5a1124,'suggestionData':_0x3602f7});});throw _0xeb4da8;});return this['_bufferedRequests']['delete'](_0x119a0e),_0x53deea;},'updateSuggestion':async(_0x23107e,_0x231eca)=>{if(await this['_waitForServiceReady'](),'open'!==_0x231eca['state'])return this['_trackChangesService']['update'](_0x23107e,_0x231eca)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x586bd9,_0x48003a)=>{_0x122b48['hasSuggestion'](_0x48003a['id'])&&(_0x122b48['getSuggestion'](_0x48003a['id'])['attributes']=_0x48003a['attributes']);}),this['_trackChangesService']['connect'](_0x357219['connection'])['then'](_0xf95582=>(_0x357219['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0xf95582)['then'](()=>{for(const _0x33a37c of _0xf95582){_0x122b48['addSuggestionData'](_0x33a37c)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1d5d34=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0xf53349}=this['editor']['plugins']['get'](c),_0x4423b1=await this['_trackChangesService']['connect'](_0xf53349);await this['_fetchMissingUsersForThreads'](_0x4423b1);for(const {suggestionData:_0x5095c3,resolve:_0x222089}of this['_bufferedRequests']['values']()){let _0x590caa=_0x4423b1['find'](_0x2a00c1=>_0x2a00c1['id']===_0x5095c3['id']);_0x590caa||(_0x590caa=await this['_trackChangesService']['add'](_0x5095c3['id'],_0x5095c3['type'],_0x5095c3['data'],_0x5095c3['originalSuggestionId'])),_0x222089(_0x590caa);}for(const _0x3f6bca of _0x4423b1)_0x1d5d34['hasSuggestion'](_0x3f6bca['id'])||_0x1d5d34['addSuggestionData'](_0x3f6bca);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1f1fd9=>{this['listenTo'](this['_trackChangesService'],'connected',_0x6fdda3=>{_0x6fdda3['off'](),_0x1f1fd9();});});}async['_fetchMissingUsersForThreads'](_0x2a9d52){const _0x57606e=this['editor']['plugins']['get'](_0x3ff6b5),{connection:_0x296ceb}=this['editor']['plugins']['get'](c),_0x31dc77=new Set();for(const {authorId:_0x473016}of _0x2a9d52)_0x57606e['getUser'](_0x473016)||_0x31dc77['add'](_0x473016);if(0x0===_0x31dc77['size'])return;const _0x3bda91=await mt['getMany'](_0x296ceb,Array['from'](_0x31dc77));for(const _0x5cf8d4 of _0x3bda91)_0x57606e['getUser'](_0x5cf8d4['id'])||_0x57606e['addUser'](_0x5cf8d4);}}function w(_0x53a5ea){if(wt(_0x53a5ea))return new Promise(()=>{});throw _0x53a5ea;}function wt(_0x34baf7){return _0x34baf7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x34baf7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x255d8c{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3db55e=this['editor']['plugins']['get'](c),_0x23317a=this['editor']['plugins']['get']('CommentsEditing'),_0x54da3d=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3db55e,'change:state',(_0x25cedd,_0xb428e5,_0x260889)=>{_0x23317a['isThreadsLoadingPaused']='connected'!==_0x260889;});}),this['listenTo'](_0x3db55e,'change:state',(_0x3af8f2,_0x2547d4,_0x92b087)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x92b087);}),_0x54da3d['_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 _0x255d8c{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x255d8c{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>_0xca19f1)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x3ff6b5];}constructor(_0x234fe4){super(_0x234fe4);const _0x22a0f6=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x22a0f6);}async['init'](){const _0xa9b21d=this['editor']['plugins']['get'](l),_0x71558a=_0xa9b21d['serverHistory'],_0x3c2984=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x71558a,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xa9b21d['sessionId']});const _0x465cde=this['editor']['config']['get']('cloudServices.bundleVersion')||dt,_0x24f4b5=await _0x25c071['isBundleUploaded'](_0x3c2984['connection'],_0x465cde);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x21fc52})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x21fc52)),'updateRevisions':async _0x24f361=>{await this['_waitForServiceReady']();const _0x22b159=this['_revisionTracker']['currentRevision'];if(_0x24f4b5&&0x1===_0x24f361['length']&&_0x24f361[0x0]['id']===_0x22b159['id'])return _0x24f361;for(const _0x12e03b of _0x24f361)_0x12e03b['id']===_0x22b159['id']&&(_0x12e03b['isEmptyCurrent']=_0x12e03b['fromVersion']===_0x12e03b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x24f361,this['_lastRequestId'])['then'](_0x4aa250=>(this['_lastRequestId']=_0x4aa250,_0x24f361))['catch'](_0x1eb7e3=>{if(X(_0x1eb7e3)||'400'===_0x1eb7e3['code']&&void 0x0!==_0x1eb7e3['data']['wrongRequestId']){for(const _0x361049 of _0x24f361){!this['_revisionTracker']['repository']['getRevision'](_0x361049['id'])||this['_revisionTracker']['_bufferUpdate'](_0x361049['id'],_0x361049,!0x1);}if(X(_0x1eb7e3))throw _0x1eb7e3;return _0x24f361;}throw _0x1eb7e3;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x2c5495,{revisionsData:_0x3ed43c,requestId:_0x3f8e49})=>{Math['max'](..._0x3ed43c['map'](_0xfa0594=>_0xfa0594['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3ed43c,_0x3f8e49);}):this['_handleRevisionsUpdate'](_0x3ed43c,_0x3f8e49);});const {revisions:_0x96cb1d,requestId:_0x5a90dc}=await this['_revisionHistoryService']['connect'](_0x3c2984['connection']);_0x3c2984['addToReconnectionStack'](this),this['_lastRequestId']=_0x5a90dc,await this['_fetchMissingUsers'](_0x96cb1d);for(const _0x41da9f of _0x96cb1d)this['_revisionTracker']['addRevisionData'](_0x41da9f);this['listenTo'](_0xa9b21d,'change:_isConnected',(_0x3e085c,_0x31a143,_0x2380bd)=>{_0x2380bd&&(this['_oldOffset']=_0xa9b21d['_offset'],_0x3e085c['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3c2984,'state',_0x1fb024=>_0x1fb024===_0x5c0f85['CONNECTED']);}async['reconnect'](){const _0x4ab57a=this['editor']['plugins']['get'](c),_0x6551f6=this['editor']['plugins']['get'](l),_0x56f614=async()=>{const _0x25af31=this['_revisionTracker']['currentRevision'],_0x29e436=_0x25af31['id'],_0xb4165d=_0x29e436!==_0x6551f6['sessionId'];if(_0xb4165d){const _0x38a6a2=_0x6551f6['_offset']-this['_oldOffset'],_0x486a89=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x25af31['toVersion']+_0x38a6a2!==_0x486a89){const _0x5bbc24=_0x25af31['fromVersion']+_0x38a6a2,_0x407e9f=this['editor']['plugins']['get'](_0x3ff6b5),_0x1bf517=this['_revisionTracker']['buildRevisionData']({'revision':_0x25af31,'from':_0x5bbc24,'to':_0x486a89});_0x1bf517['id']=_0x25af31['id'];const _0x15159f=_0x1bf517['authorsIds']['map'](_0x1e9faa=>_0x407e9f['getUser'](_0x1e9faa));_0x25af31['_update']({..._0x1bf517,'authors':_0x15159f},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x25af31['id'],_0x1bf517,!0x0);}this['_revisionTracker']['_startingVersion']=_0x486a89,(_0x25af31['toVersion']===_0x25af31['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x29e436)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x29e436),this['_revisionTracker']['_createCurrentRevision'](_0x486a89));}const {revisions:_0x4d12bd,requestId:_0x2dac26}=await this['_revisionHistoryService']['reconnect'](_0x4ab57a['connection'],this['_lastRequestId']);_0xb4165d&&_0x4d12bd['length']>0x0?_0x6551f6['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4d12bd),this['_handleRevisionsUpdate'](_0x4d12bd,_0x2dac26),this['_revisionTracker']['sendBufferedUpdates']());};return _0x6551f6['_isConnected']?_0x56f614():new Promise((_0x17733e,_0x3c9d7b)=>{_0x6551f6['once']('change:_isConnected',()=>{_0x56f614()['then'](_0x17733e)['catch'](_0x3c9d7b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x490c59=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x42a012=>{_0x42a012['off'](),_0x490c59();});});}['_getLatestVersionFromServerOperations'](){const _0x33c962=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3298c1 of _0x33c962)if('marker'!==_0x3298c1['type']||_0x3298c1['affectsData'])return _0x3298c1['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5d4111=this['editor']['plugins']['get'](l);return new Promise(_0x1917b0=>{_0x5d4111['_isPendingUpdate']?_0x5d4111['once']('change:_isPendingUpdate',()=>{_0x1917b0(this['_getLatestVersionFromServerOperations']());}):_0x1917b0(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4c4b37,_0x497e81){const _0x4b9d1c=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x497e81;for(const _0x35a256 of _0x4c4b37){const _0x4f4521=_0x4b9d1c['getRevision'](_0x35a256['id']);if(_0x4f4521){if((_0x35a256['fromVersion']||_0x35a256['toVersion'])&&(_0x35a256['diffData']=null),_0x4f4521===this['_revisionTracker']['currentRevision']){const _0x4fe3f8=Math['max'](_0x4f4521['toVersion'],_0x35a256['toVersion']),_0x4c8136=Math['max'](_0x4f4521['fromVersion'],_0x35a256['fromVersion']);let _0x38658f;_0x4f4521['toVersion']===_0x35a256['toVersion']&&_0x4f4521['fromVersion']===_0x35a256['fromVersion']?(_0x38658f=!0x0,this['_preventResendingRevisionData'](_0x35a256)):_0x35a256['toVersion']===_0x4fe3f8&&_0x35a256['fromVersion']===_0x4c8136?_0x38658f=!0x1:(_0x4f4521['toVersion']===_0x4fe3f8&&_0x4f4521['fromVersion']===_0x4c8136||this['_fixRevision']({'revision':_0x4f4521,'from':_0x4c8136,'to':_0x4fe3f8}),_0x38658f=!0x0),_0x38658f&&(delete _0x35a256['fromVersion'],delete _0x35a256['toVersion'],delete _0x35a256['diffData'],delete _0x35a256['createdAt'],delete _0x35a256['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x35a256),this['_preventResendingRevisionData'](_0x35a256);}else this['_revisionTracker']['addRevisionData'](_0x35a256);}const _0x57123a=_0x4b9d1c['getRevisions']();_0x57123a['reverse']();for(let _0xd1b967=0x0;_0xd1b967<_0x57123a['length']-0x1;_0xd1b967++){const _0x5ab4e0=_0x57123a[_0xd1b967],_0x28b74e=_0x57123a[_0xd1b967+0x1];if(_0x5ab4e0['fromVersion']<_0x28b74e['toVersion']){const _0x44e078=_0x28b74e['toVersion'],_0x2a98a0=Math['max'](_0x44e078,_0x5ab4e0['toVersion']);this['_fixRevision']({'revision':_0x5ab4e0,'from':_0x44e078,'to':_0x2a98a0});}}}['_fixRevision']({revision:_0x26003d,from:_0x3116f2,to:_0x3b5e72}={}){const _0xb4d505=this['editor']['plugins']['get'](_0x3ff6b5),_0xa66521=this['_revisionTracker']['buildRevisionData']({'revision':_0x26003d,'from':_0x3116f2,'to':_0x3b5e72});_0xa66521['authors']=_0xa66521['authorsIds']['map'](_0x74150c=>_0xb4d505['getUser'](_0x74150c)),_0x26003d['_update'](_0xa66521);}['_preventResendingRevisionData'](_0x4fb4ec){const _0x5ee2b3={};_0x5ee2b3['id']=_0x4fb4ec['id'];for(const _0x333883 of Object['keys'](_0x4fb4ec))'id'!==_0x333883&&(_0x5ee2b3[_0x333883]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5ee2b3['id'],_0x5ee2b3,!0x0);}async['_fetchMissingUsers'](_0x39cc71){const _0x1d7d1c=this['editor']['plugins']['get'](_0x3ff6b5),{connection:_0x2f4bdf}=this['editor']['plugins']['get'](c),_0xe5f524=new Set();for(const _0x385ea5 of _0x39cc71){for(const _0x190d6e of _0x385ea5['authorsIds'])_0x2b5457(_0x190d6e);_0x385ea5['creatorId']&&_0x2b5457(_0x385ea5['creatorId']);}if(0x0===_0xe5f524['size'])return;const _0x31fbea=await mt['getMany'](_0x2f4bdf,Array['from'](_0xe5f524));for(const _0x579b2b of _0x31fbea)_0x1d7d1c['getUser'](_0x579b2b['id'])||_0x1d7d1c['addUser'](_0x579b2b);function _0x2b5457(_0x35b3a1){_0x1d7d1c['getUser'](_0x35b3a1)||_0xe5f524['add'](_0x35b3a1);}}}function X(_0x5657f3){return _0x5657f3['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5657f3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5657f3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x255d8c{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x4a9566{constructor(_0x355c9e){super(_0x355c9e);const _0x187802=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x187802['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x187802['to']('usersCount',_0x264e53=>E(_0x355c9e,'CONNECTED_USERS',_0x264e53))}]});}}class es extends _0x4a9566{['items'];['keystrokes'];constructor(_0x566395){super(_0x566395);const _0x169c28=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x38ba82(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x169c28['if']('hasPopup'),'aria-expanded':_0x169c28['to']('isExpanded',_0x1676af=>this['hasPopup']&&String(_0x1676af)),'aria-label':_0x169c28['to']('hasPopup',_0xa68d7d=>E(_0x566395,_0xa68d7d?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x169c28['to']('hasPopup',_0x5ab470=>!!_0x5ab470&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x169c28['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x54e633,_0x2927a8,_0x33a424)=>{this['element']&&(_0x33a424?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 it extends _0x4a9566{['counterView'];['inlineListView'];constructor(_0x5332e5){super(_0x5332e5);const _0x4288be=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x5332e5),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x38f820 of this['inlineListView']['items'])_0x38f820['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',_0x4288be['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class et extends _0x4a9566{['listWrapperView'];constructor(_0x49ddc9,_0x2b2c94){super(_0x49ddc9),this['listWrapperView']=new vt(_0x49ddc9,_0x2b2c94),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x49ddc9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x51992f{constructor(_0x3508ed,_0x1f8def){super(_0x3508ed);const _0x47eb0f=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x1f8def?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x47eb0f['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x47eb0f['to']('role'),'aria-label':_0x47eb0f['to']('ariaLabel'),'aria-labelledby':_0x47eb0f['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x54f579['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4c44f2=this['element'];_0x4c44f2&&(this['_isScrollable']=Math['max'](_0x4c44f2['scrollHeight'],_0x4c44f2['clientHeight'])>0.8*window['innerHeight']);}}class ht extends ct{['userView'];constructor(_0x1e6a48,_0x5cc43c,_0x5a0346){super(_0x1e6a48);const _0x712660=this['bindTemplate'];this['userView']=new at(_0x1e6a48,_0x5cc43c);const _0xf2d59c={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x5cc43c['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x5cc43c['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5cc43c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5a0346&&(_0xf2d59c['tag']='button',_0xf2d59c['on']={'click':_0x712660['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xf2d59c);}['focus'](){this['element']['focus']();}}class rt extends _0x4a9566{['userView'];['markerView'];constructor(_0x1315d3,_0x358530,_0x17848e){super(_0x1315d3);const _0x103a0f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new at(_0x1315d3,_0x358530),this['markerView']=new pt(_0x1315d3,_0x358530);const _0x4130cb=new lt(_0x1315d3);_0x4130cb['template']['tag']='span',_0x4130cb['text']=_0x358530['name'];const _0x1375ac={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x103a0f['to']('isFocusable',_0x498769=>!!_0x498769&&0x0),'aria-labelledby':_0x4130cb['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x103a0f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x103a0f['to']('hasTooltip',_0x486920=>!_0x486920),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4130cb]};_0x17848e&&(_0x1375ac['tag']='button',_0x1375ac['on']={'click':_0x103a0f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1375ac);}}class pt extends _0x4a9566{constructor(_0x51cc67,_0x1a3387){super(_0x51cc67),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1a3387['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const ot={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x34d5bf{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x75b2d8){super(_0x75b2d8),this['context']['config']['define']('presenceList',ot);const _0x2d453a=_0x75b2d8['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2d453a)throw new _0x2e31b4('presencelist-collapseat-invalid-format',this);if(_0x2d453a<0x1)throw new _0x2e31b4('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3b97a7(),this['balloonPanelView']=new _0x21dd49(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x41b40c of this['_allConnectedUsers'])this['_handleUserAdd'](_0x41b40c);this['listenTo'](this['_allConnectedUsers'],'add',(_0x47fe8f,_0x12b2e1)=>{this['_handleUserAdd'](_0x12b2e1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x3ca1f5,_0x269f5b)=>{this['_handleUserRemove'](_0x269f5b);});}['_createView'](){const _0x378525=this['context'],_0x5b70c8=new it(this['context']['locale']),_0x5c4106=this['balloonPanelView'];if(!st(_0x378525['config']['get']('presenceList.container')))throw new _0x2e31b4('presencelist-missing-container',this);return _0x5b70c8['counterView']['bind']('usersCount')['to'](this),_0x5b70c8['bind']('isCollapsed')['to'](this,'usersCount',_0x54c295=>{const {collapseAt:_0x3bed75,displayMe:_0x446c04}=_0x378525['config']['get']('presenceList'),_0x476ed6=_0x54c295>=_0x3bed75;return _0x5b70c8['counterView']['isHidden']=!(0x1==_0x54c295&&_0x446c04||_0x476ed6),_0x476ed6||this['hideDropdown'](),_0x476ed6;}),_0x5b70c8['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x5d099b=>{const _0x16b355=_0x378525['config']['get']('presenceList'),_0x62fd8a=new rt(_0x378525['locale'],_0x5d099b,!!_0x16b355['onClick']);return _0x62fd8a['bind']('hasTooltip')['to'](_0x5b70c8,'isCollapsed',_0x50f2af=>!_0x50f2af),_0x62fd8a['bind']('isFocusable')['to'](_0x5b70c8,'isCollapsed',_0x2a274a=>!_0x2a274a),_0x16b355['onClick']&&this['listenTo'](_0x62fd8a,'execute',()=>{this['view']['isCollapsed']||_0x16b355['onClick'](_0x5d099b,_0x62fd8a['element']);}),_0x62fd8a;}),this['listenTo'](_0x5b70c8['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x5b70c8['inlineListView']['keystrokes']['set']('Enter',(_0x36471f,_0x2661b8)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2661b8());}),_0x5b70c8['render'](),_0x5c4106['render'](),_0x1e1784({'emitter':_0x5b70c8,'activator':()=>_0x5c4106['isVisible'],'contextElements':[_0x5c4106['element'],_0x5b70c8['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x378525['config']['get']('presenceList.container')['appendChild'](_0x5b70c8['element']),this['_bodyCollection']=new tt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5b70c8;}['_handleUserAdd'](_0x56f53f){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x56f53f['isMe'])return;const _0x57acbd=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x57acbd&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x9028d0=_0x56f53f['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x56f53f,_0x9028d0);}['_handleUserRemove'](_0x1111e8){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x1111e8['id'])&&(this['currentDisplayedUsers']['remove'](_0x1111e8['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x560ab4 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x560ab4['id']))return void this['currentDisplayedUsers']['add'](_0x560ab4,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x5c9d4b=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new et(this['context']['locale'],!!_0x5c9d4b['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x559d65}=this['presenceDropdownView'];_0x559d65['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x184a5a=>{if(!_0x5c9d4b['displayMe']&&_0x184a5a['isMe'])return null;const _0x1aa8f5=new ht(this['context']['locale'],_0x184a5a,!!_0x5c9d4b['onClick']);return _0x5c9d4b['onClick']&&this['listenTo'](_0x1aa8f5,'execute',()=>{_0x5c9d4b['onClick'](_0x184a5a,_0x1aa8f5['element']);}),_0x1aa8f5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x559d65['focus'](),_0x559d65['checkIfScrollable']();const _0x5dd822=(_0x1225e1,_0x4a357f)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x4a357f();};_0x559d65['keystrokes']['set']('Esc',_0x5dd822),_0x559d65['keystrokes']['set']('Shift+Tab',_0x5dd822),_0x559d65['keystrokes']['set']('Tab',(_0x53b19d,_0x31caac)=>{!function(_0x4e17c1){const _0x4c3ae5=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x448858=>_0x448858+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x52e414=[...document['body']['querySelectorAll'](_0x4c3ae5)]['filter'](_0x2be570=>_0x2be570===document['activeElement']||_0x2be570['offsetWidth']+_0x2be570['offsetHeight']>0x0)['sort']((_0x1146e1,_0x438567)=>(_0x1146e1['tabIndex']||0x0)-(_0x438567['tabIndex']||0x0)),_0x22518e=_0x52e414['indexOf'](_0x4e17c1),_0x42c3fa=_0x52e414[(_0x22518e+0x1)%_0x52e414['length']];_0x42c3fa&&_0x42c3fa['focus']();}(this['view']['element']),this['hideDropdown'](),_0x31caac();}),_0x559d65['focusTracker']['add'](this['view']['element']),_0x559d65['focusTracker']['on']('change:isFocused',(_0x3b39db,_0x5f59e4,_0x40129e)=>{_0x40129e||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 s extends _0x34d5bf{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
|
package/dist/presencelist.d.ts
CHANGED
|
@@ -29,4 +29,12 @@ export default class PresenceList extends ContextPlugin {
|
|
|
29
29
|
* @inheritDoc
|
|
30
30
|
*/
|
|
31
31
|
static get pluginName(): "PresenceList";
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
static get isOfficialPlugin(): true;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
static get isPremiumPlugin(): true;
|
|
32
40
|
}
|
|
@@ -31,6 +31,14 @@ export default class CloudServicesCommentsAdapter extends ContextPlugin implemen
|
|
|
31
31
|
* @inheritDoc
|
|
32
32
|
*/
|
|
33
33
|
static get pluginName(): "CloudServicesCommentsAdapter";
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static get isOfficialPlugin(): true;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get isPremiumPlugin(): true;
|
|
34
42
|
/**
|
|
35
43
|
* @inheritDoc
|
|
36
44
|
*/
|
|
@@ -29,6 +29,14 @@ export default class RealTimeCollaborativeComments extends Plugin {
|
|
|
29
29
|
* @inheritDoc
|
|
30
30
|
*/
|
|
31
31
|
static get pluginName(): "RealTimeCollaborativeComments";
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
static get isOfficialPlugin(): true;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
static get isPremiumPlugin(): true;
|
|
32
40
|
/**
|
|
33
41
|
* @inheritDoc
|
|
34
42
|
*/
|