@ckeditor/ckeditor5-real-time-collaboration 0.0.0-internal-20241017.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/CHANGELOG.md +4 -0
- package/LICENSE.md +25 -0
- package/README.md +41 -0
- package/build/real-time-collaboration.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de-ch.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +87 -0
- package/dist/augmentation.d.ts +68 -0
- package/dist/common-translations.d.ts +13 -0
- package/dist/config.d.ts +52 -0
- package/dist/index-content.css +5 -0
- package/dist/index-editor.css +321 -0
- package/dist/index.css +423 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +28 -0
- package/dist/presencelist/presencelistui.d.ts +51 -0
- package/dist/presencelist/view/presencecounterview.d.ts +15 -0
- package/dist/presencelist/view/presencedropdownlistitemview.d.ts +19 -0
- package/dist/presencelist/view/presencedropdownlistview.d.ts +36 -0
- package/dist/presencelist/view/presenceinlinelistitemview.d.ts +23 -0
- package/dist/presencelist/view/presenceinlinelistview.d.ts +38 -0
- package/dist/presencelist/view/presencelistview.d.ts +24 -0
- package/dist/presencelist.d.ts +40 -0
- package/dist/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +64 -0
- package/dist/realtimecollaborativecomments.d.ts +48 -0
- package/dist/realtimecollaborativeediting/realtimecollaborationclient.d.ts +149 -0
- package/dist/realtimecollaborativeediting/sessions.d.ts +130 -0
- package/dist/realtimecollaborativeediting/usermarkers.d.ts +52 -0
- package/dist/realtimecollaborativeediting/websocketgateway.d.ts +67 -0
- package/dist/realtimecollaborativeediting.d.ts +38 -0
- package/dist/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +49 -0
- package/dist/realtimecollaborativerevisionhistory.d.ts +41 -0
- package/dist/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +43 -0
- package/dist/realtimecollaborativetrackchanges.d.ts +39 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +23 -0
- package/dist/translations/ar.umd.js +23 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +23 -0
- package/dist/translations/bg.umd.js +23 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +23 -0
- package/dist/translations/bn.umd.js +23 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +23 -0
- package/dist/translations/ca.umd.js +23 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +23 -0
- package/dist/translations/cs.umd.js +23 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +23 -0
- package/dist/translations/da.umd.js +23 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +23 -0
- package/dist/translations/de-ch.umd.js +23 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +23 -0
- package/dist/translations/de.umd.js +23 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +23 -0
- package/dist/translations/el.umd.js +23 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +23 -0
- package/dist/translations/en-au.umd.js +23 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +23 -0
- package/dist/translations/en.umd.js +23 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +23 -0
- package/dist/translations/es.umd.js +23 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +23 -0
- package/dist/translations/et.umd.js +23 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +23 -0
- package/dist/translations/fa.umd.js +23 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +23 -0
- package/dist/translations/fi.umd.js +23 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +23 -0
- package/dist/translations/fr.umd.js +23 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +23 -0
- package/dist/translations/gl.umd.js +23 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +23 -0
- package/dist/translations/he.umd.js +23 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +23 -0
- package/dist/translations/hi.umd.js +23 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +23 -0
- package/dist/translations/hr.umd.js +23 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +23 -0
- package/dist/translations/hu.umd.js +23 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +23 -0
- package/dist/translations/id.umd.js +23 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +23 -0
- package/dist/translations/it.umd.js +23 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +23 -0
- package/dist/translations/ja.umd.js +23 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +23 -0
- package/dist/translations/ko.umd.js +23 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +23 -0
- package/dist/translations/lt.umd.js +23 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +23 -0
- package/dist/translations/lv.umd.js +23 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +23 -0
- package/dist/translations/ms.umd.js +23 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +23 -0
- package/dist/translations/nl.umd.js +23 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +23 -0
- package/dist/translations/no.umd.js +23 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +23 -0
- package/dist/translations/pl.umd.js +23 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +23 -0
- package/dist/translations/pt-br.umd.js +23 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +23 -0
- package/dist/translations/pt.umd.js +23 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +23 -0
- package/dist/translations/ro.umd.js +23 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +23 -0
- package/dist/translations/ru.umd.js +23 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +23 -0
- package/dist/translations/sk.umd.js +23 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +23 -0
- package/dist/translations/sr-latn.umd.js +23 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +23 -0
- package/dist/translations/sr.umd.js +23 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +23 -0
- package/dist/translations/sv.umd.js +23 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +23 -0
- package/dist/translations/th.umd.js +23 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +23 -0
- package/dist/translations/tk.umd.js +23 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +23 -0
- package/dist/translations/tr.umd.js +23 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +23 -0
- package/dist/translations/uk.umd.js +23 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +23 -0
- package/dist/translations/vi.umd.js +23 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +23 -0
- package/dist/translations/zh-cn.umd.js +23 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +23 -0
- package/dist/translations/zh.umd.js +23 -0
- package/lang/contexts.json +12 -0
- package/lang/translations/ar.po +64 -0
- package/lang/translations/bg.po +60 -0
- package/lang/translations/bn.po +60 -0
- package/lang/translations/ca.po +60 -0
- package/lang/translations/cs.po +62 -0
- package/lang/translations/da.po +60 -0
- package/lang/translations/de-ch.po +60 -0
- package/lang/translations/de.po +60 -0
- package/lang/translations/el.po +60 -0
- package/lang/translations/en-au.po +60 -0
- package/lang/translations/en.po +60 -0
- package/lang/translations/es.po +61 -0
- package/lang/translations/et.po +60 -0
- package/lang/translations/fa.po +60 -0
- package/lang/translations/fi.po +60 -0
- package/lang/translations/fr.po +61 -0
- package/lang/translations/gl.po +60 -0
- package/lang/translations/he.po +61 -0
- package/lang/translations/hi.po +60 -0
- package/lang/translations/hr.po +61 -0
- package/lang/translations/hu.po +60 -0
- package/lang/translations/id.po +59 -0
- package/lang/translations/it.po +61 -0
- package/lang/translations/ja.po +59 -0
- package/lang/translations/ko.po +59 -0
- package/lang/translations/lt.po +62 -0
- package/lang/translations/lv.po +61 -0
- package/lang/translations/ms.po +59 -0
- package/lang/translations/nl.po +60 -0
- package/lang/translations/no.po +60 -0
- package/lang/translations/pl.po +62 -0
- package/lang/translations/pt-br.po +61 -0
- package/lang/translations/pt.po +61 -0
- package/lang/translations/ro.po +61 -0
- package/lang/translations/ru.po +62 -0
- package/lang/translations/sk.po +62 -0
- package/lang/translations/sr-latn.po +61 -0
- package/lang/translations/sr.po +61 -0
- package/lang/translations/sv.po +60 -0
- package/lang/translations/th.po +59 -0
- package/lang/translations/tk.po +60 -0
- package/lang/translations/tr.po +60 -0
- package/lang/translations/uk.po +62 -0
- package/lang/translations/vi.po +59 -0
- package/lang/translations/zh-cn.po +59 -0
- package/lang/translations/zh.po +59 -0
- package/package.json +57 -0
- package/src/augmentation.d.ts +64 -0
- package/src/augmentation.js +23 -0
- package/src/common-translations.d.ts +9 -0
- package/src/common-translations.js +23 -0
- package/src/config.d.ts +48 -0
- package/src/config.js +23 -0
- package/src/index.d.ts +14 -0
- package/src/index.js +23 -0
- package/src/presencelist/presencelistui.d.ts +47 -0
- package/src/presencelist/presencelistui.js +23 -0
- package/src/presencelist/view/presencecounterview.d.ts +11 -0
- package/src/presencelist/view/presencecounterview.js +23 -0
- package/src/presencelist/view/presencedropdownlistitemview.d.ts +15 -0
- package/src/presencelist/view/presencedropdownlistitemview.js +23 -0
- package/src/presencelist/view/presencedropdownlistview.d.ts +32 -0
- package/src/presencelist/view/presencedropdownlistview.js +23 -0
- package/src/presencelist/view/presenceinlinelistitemview.d.ts +19 -0
- package/src/presencelist/view/presenceinlinelistitemview.js +23 -0
- package/src/presencelist/view/presenceinlinelistview.d.ts +34 -0
- package/src/presencelist/view/presenceinlinelistview.js +23 -0
- package/src/presencelist/view/presencelistview.d.ts +20 -0
- package/src/presencelist/view/presencelistview.js +23 -0
- package/src/presencelist.d.ts +36 -0
- package/src/presencelist.js +23 -0
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +60 -0
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +23 -0
- package/src/realtimecollaborativecomments.d.ts +44 -0
- package/src/realtimecollaborativecomments.js +23 -0
- package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +145 -0
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +23 -0
- package/src/realtimecollaborativeediting/sessions.d.ts +126 -0
- package/src/realtimecollaborativeediting/sessions.js +23 -0
- package/src/realtimecollaborativeediting/usermarkers.d.ts +48 -0
- package/src/realtimecollaborativeediting/usermarkers.js +23 -0
- package/src/realtimecollaborativeediting/websocketgateway.d.ts +63 -0
- package/src/realtimecollaborativeediting/websocketgateway.js +23 -0
- package/src/realtimecollaborativeediting.d.ts +34 -0
- package/src/realtimecollaborativeediting.js +23 -0
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +45 -0
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +23 -0
- package/src/realtimecollaborativerevisionhistory.d.ts +37 -0
- package/src/realtimecollaborativerevisionhistory.js +23 -0
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +39 -0
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +23 -0
- package/src/realtimecollaborativetrackchanges.d.ts +35 -0
- package/src/realtimecollaborativetrackchanges.js +23 -0
- package/theme/presencelist.css +262 -0
- package/theme/usermarkers.css +107 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
import{ContextPlugin as _0x5fba94,Plugin as _0x574e71,PendingActions as _0x533fdf,Context as _0x462650}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x9c40ac,CKEditorError as _0x363645,Collection as _0x4ecba4,global as _0x58c4bd,version as nt,uid as _0x2042fc,KeystrokeHandler as _0x2aa4bd}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x18c234,View as _0x15e6ea,ListView as _0x2fe358,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x34d9ef,clickOutsideHandler as _0x538008,BodyCollection as _0x11f100}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x266f14,NoOperation as _0x32387a,InsertOperation as _0x22e099,MarkerOperation as _0x45976b,RootAttributeOperation as _0x49d9f5,transformSets as _0x1fe169,OperationFactory as _0xdb8289}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x3ff8eb,CollaborativeEditingService as _0x8521a6,User as dt,CommentsService as _0x49985c,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x52817f,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1ff523}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1104a8}from'lodash-es';class c extends _0x5fba94{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x18c234];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4766d6){super(_0x4766d6),this['set']('state',_0x3ff8eb['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x9c40ac);}['init'](){const _0x26c6da=this['context'],_0x4fe372=_0x26c6da['plugins']['get']('CloudServices'),_0x1e0048=_0x26c6da['plugins']['get'](_0x18c234);if(!_0x4fe372['token'])throw new _0x363645('websocketgateway-missing-token',this);if(!_0x4fe372['webSocketUrl'])throw new _0x363645('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'](_0x4fe372['token'],_0x4fe372['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x57e235=>{if(this['connection']=_0x57e235,this['bind']('state')['to'](_0x57e235,'state',this,'_isBrowserOffline',(_0x183f20,_0x2bcc54)=>('connected'!==_0x183f20&&(this['_shouldPluginsReconnect']=!0x0),_0x2bcc54||_0x183f20!==_0x3ff8eb['CONNECTED']?_0x3ff8eb['DISCONNECTED']:this['state']==_0x3ff8eb['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3ff8eb['CONNECTING']):_0x3ff8eb['CONNECTED'])),this['connection']['on']('error',(_0x272bf0,_0x37c52b)=>{if('limitExceeded'!==_0x37c52b['code'])throw console['error'](_0x37c52b),new _0x363645('cloudservices-init',null,{'originalError':_0x37c52b});_0x1e0048['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'});}),!_0x57e235['me'])return new Promise(_0x5ccdaf=>_0x57e235['on']('change:me',_0x5ccdaf));})['catch'](_0x9d10ec=>{throw console['error'](_0x9d10ec),new _0x363645('cloudservices-init',null,{'originalError':_0x9d10ec});});}['addToReconnectionStack'](_0x371ca0){if('function'!=typeof _0x371ca0['reconnect'])throw new _0x363645('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x371ca0))throw new _0x363645('websocketgateway-plugin-already-registered',this,{'name':_0x371ca0['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x371ca0);}['removeFromReconnectionStack'](_0x21b837){this['_reconnectionStack']['delete'](_0x21b837);}['isInReconnectionStack'](_0x26f23a){return this['_reconnectionStack']['has'](_0x26f23a);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x36dfae=>_0x36dfae['reconnect']())))['then'](()=>this['state']=_0x3ff8eb['CONNECTED'])['catch'](_0x263658=>{throw console['error'](_0x263658),new _0x363645('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3ff8eb['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x5fba94{['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,_0x52817f];}constructor(_0x5e9791){super(_0x5e9791),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4ecba4(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x52817f);}['init'](){const _0x2af6ea=this['context']['plugins']['get'](c);this['listenTo'](_0x2af6ea,'change:state',(_0xaa3efc,_0x56ae1f,_0x462ae3)=>{if('connected'!==_0x462ae3)this['channelSessions']['forEach'](_0x3caa27=>_0x3caa27['clear']()),this['channelConnectedUsers']['forEach'](_0xdb0a7e=>_0xdb0a7e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x227a9f,_0x1c50b1]of this['_registeredSessions'])for(const _0x511168 of _0x1c50b1)this['_handleSessionAdd'](_0x227a9f,_0x511168);}}),this['_createUser'](_0x2af6ea['connection']['me'],!0x0);}['register'](_0x1211ca,_0xef2328){if(this['_registeredSessions']['has'](_0x1211ca))throw new _0x363645('sessions-register-already-registered',null,{'channelId':_0x1211ca});this['_registeredSessions']['set'](_0x1211ca,_0xef2328),this['channelSessions']['set'](_0x1211ca,new _0x4ecba4()),this['channelConnectedUsers']['set'](_0x1211ca,new _0x4ecba4()),this['listenTo'](_0xef2328,'add',(_0x591fb7,_0xb2f0ad)=>this['_handleSessionAdd'](_0x1211ca,_0xb2f0ad)),this['listenTo'](_0xef2328,'remove',(_0x1c65b4,_0x343a1a)=>this['_handleSessionRemove'](_0x1211ca,_0x343a1a));for(const _0x13f1f2 of _0xef2328)this['_handleSessionAdd'](_0x1211ca,_0x13f1f2);}['unregister'](_0x218942){if(!this['_registeredSessions']['has'](_0x218942))throw new _0x363645('sessions-unregister-not-exist',null,{'channelId':_0x218942});const _0x54b039=this['_registeredSessions']['get'](_0x218942);this['stopListening'](_0x54b039);for(const _0xb95b2a of _0x54b039)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x218942,_0xb95b2a);this['_registeredSessions']['delete'](_0x218942),this['channelSessions']['delete'](_0x218942),this['channelConnectedUsers']['delete'](_0x218942);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x2dce51){for(const _0x43e377 of this['channelSessions']['values']())for(const _0x21cfe1 of _0x43e377)if(_0x21cfe1['id']===_0x2dce51)return _0x21cfe1['user'];}['getUserSessions'](_0x4a3575,_0x515ce9){const _0x26efc5=_0x515ce9?[this['channelSessions']['get'](_0x515ce9)]:this['channelSessions']['values'](),_0x27118f=new Set();for(const _0x4a68fd of _0x26efc5)for(const _0x103e5c of _0x4a68fd)_0x103e5c['user']['id']===_0x4a3575['id']&&_0x27118f['add'](_0x103e5c['id']);return _0x27118f;}['getUserRole'](_0x4d356c){for(const _0x5674a6 of this['channelSessions']['values']())for(const _0x34664b of _0x5674a6)if(_0x34664b['user']===_0x4d356c)return _0x34664b['role'];}['_handleSessionAdd'](_0x381fd0,_0x51fcfb){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xf92d5b=_0x51fcfb['user'],_0x527c8d=this['_users']['getUser'](_0xf92d5b['id'])||this['_createUser'](_0xf92d5b),_0x48cb12=Object['assign']({},_0x51fcfb,{'user':_0x527c8d});this['channelSessions']['get'](_0x381fd0)['add'](_0x48cb12);const _0x4f4890=this['channelConnectedUsers']['get'](_0x381fd0);_0x4f4890['has'](_0x527c8d['id'])||_0x4f4890['add'](_0x527c8d),this['allConnectedUsers']['has'](_0x527c8d['id'])||this['allConnectedUsers']['add'](_0x527c8d,_0x527c8d['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x381fd0,{'channelId':_0x381fd0,'session':_0x48cb12});}['_handleSessionRemove'](_0x567fb8,_0x10fa4a){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x5ff470=this['channelConnectedUsers']['get'](_0x567fb8),_0x39009b=_0x10fa4a['user'];_0x39009b['id']&&(this['channelSessions']['get'](_0x567fb8)['remove'](_0x10fa4a['id']),_0x5ff470['has'](_0x39009b['id'])&&!this['getUserSessions'](_0x39009b,_0x567fb8)['size']&&_0x5ff470['remove'](_0x39009b['id']),this['allConnectedUsers']['get'](_0x39009b['id'])&&!this['getUserSessions'](_0x39009b)['size']&&this['allConnectedUsers']['remove'](_0x39009b['id']));}['_createUser'](_0xc31a38,_0x4a907f){const _0x5ac16a=this['_users']['addUser'](_0xc31a38);return _0x4a907f&&this['_users']['defineMe'](_0xc31a38['id']),_0x5ac16a['orderNumber']=this['_uniqueUsersCount']++,_0x5ac16a;}}class H extends _0x574e71{['_domEmitter']=new(_0x9c40ac())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x59b1a7=this['editor'],_0x443aa3=_0x59b1a7['plugins']['get'](i);_0x59b1a7['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x15725a,{writer:_0xd336bd})=>function(_0x6cde84,_0x4c2f7f,_0x5d8a5b,_0x23e1f7){const _0x529227=_0x6cde84['markerName']['split'](':')[0x2],_0x5a1bcf=_0x5d8a5b['getUserBySessionId'](_0x529227);if(!_0x5a1bcf||_0x529227===_0x5d8a5b['mySessionId'])return;if(!_0x23e1f7['model']['schema']['checkChild'](_0x6cde84['markerRange']['start'],'$text'))return;const _0x27b26d={'class':'ck-user__marker\x20'+_0x5a1bcf['color']['getMarkerClass'](),'data-name':_0x5a1bcf['name'],'data-session-id':_0x529227},_0x1000b5=_0x23e1f7['model']['markers']['get'](_0x6cde84['markerName']),_0x9c290b=_0x1000b5['getStart'](),_0x1b6c42=_0x9c290b['nodeAfter'],_0x9ace20=_0x23e1f7['model']['schema'];if(_0x1b6c42&&_0x9ace20['isObject'](_0x1b6c42)&&_0x9ace20['isInline'](_0x1b6c42)&&!_0x23e1f7['model']['markers']['get']('user:range:'+_0x529227)['getRange']()['isCollapsed'])return;const _0x11997b=_0x9c290b['parent'];return _0x23e1f7['model']['schema']['isLimit'](_0x11997b)&&!_0x23e1f7['model']['hasContent'](_0x11997b)&&(_0x27b26d['contenteditable']=!0x1),function(_0x27aae8,_0x3d0509,_0x314abb){const _0x1f9c6e=_0x27aae8['createUIElement']('span',_0x3d0509);return _0x27aae8['setCustomProperty']('userPositionMarker',!0x0,_0x1f9c6e),_0x1f9c6e['render']=function(_0x56cb5a){const _0x4cfea0=this['toDomElement'](_0x56cb5a);return _0x4cfea0['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>'+_0x314abb['name']+'</span>',_0x4cfea0['addEventListener']('mouseenter',()=>{_0x4cfea0['classList']['add']('ck-user__marker_hovered');}),_0x4cfea0['addEventListener']('mouseleave',()=>{_0x4cfea0['classList']['remove']('ck-user__marker_hovered');}),_0x4cfea0;},_0x1f9c6e['isSimilar']=function(_0x3eaec4){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3eaec4['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3eaec4['getAttribute']('data-session-id'));},_0x1f9c6e;}(_0x4c2f7f,_0x27b26d,_0x5a1bcf);}(_0x15725a,_0xd336bd,_0x443aa3,_0x59b1a7)}),_0x59b1a7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5f00bf=>function(_0x10c0f0,_0x1968bb){const _0x29fe5c=_0x10c0f0['markerName']['split'](':')[0x2];if(_0x29fe5c===_0x1968bb['mySessionId'])return null;const _0x3a579a=_0x1968bb['getUserBySessionId'](_0x29fe5c);if(!_0x3a579a)return{'id':_0x29fe5c,'classes':[]};return{'id':_0x29fe5c,'classes':['ck-user__selection',_0x3a579a['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x29fe5c},'priority':0x7d0+_0x3a579a['orderNumber']};}(_0x5f00bf,_0x443aa3)}),function(_0x538436){const _0x16ae90=_0x538436['model'],_0x4dc6bc=new Map(),_0x58323f=_0x538436['plugins']['get'](i);_0x16ae90['markers']['on']('update:user:range',(_0x128e0b,_0x5ddda2,_0x16f9a2,_0x4c42f3)=>{if(!_0x4c42f3&&_0x4dc6bc['get'](_0x5ddda2['name']))return _0x4dc6bc['get'](_0x5ddda2['name'])['detach'](),void _0x4dc6bc['delete'](_0x5ddda2['name']);const _0x392b1d=_0x5ddda2['name']['split'](':')[0x2];if(_0x392b1d===_0x58323f['mySessionId'])return;const _0xa5c151='user:position:'+_0x392b1d;_0x16ae90['markers']['has'](_0xa5c151)&&_0x538436['editing']['reconvertMarker'](_0xa5c151),_0x5ddda2['on']('change:range',(_0x2e8872,_0x2f27d5,_0x2b8df9)=>{if('$graveyard'!=_0x2f27d5['root']['rootName']&&'$graveyard'==_0x5ddda2['getRange']()['root']['rootName']&&!_0x4dc6bc['has'](_0x5ddda2['name'])){const _0x3df635=_0x16ae90['schema']['getNearestSelectionRange'](_0x2b8df9['deletionPosition']);if(_0x3df635){const _0x5d4a1b=ht['fromRange'](_0x3df635);_0x4dc6bc['set'](_0x5ddda2['name'],_0x5d4a1b),_0x5d4a1b['on']('change:range',(_0x30cdd4,_0x59ad83,_0x1fa411)=>{if('$graveyard'==_0x5d4a1b['root']['rootName']){const _0x371835=_0x16ae90['schema']['getNearestSelectionRange'](_0x1fa411['deletionPosition']);_0x371835?(_0x5d4a1b['start']=_0x371835['start'],_0x5d4a1b['end']=_0x371835['end']):(_0x4dc6bc['delete'](_0x5ddda2['name']),_0x5d4a1b['detach']());}});}}});}),_0x16ae90['document']['on']('change',()=>{_0x4dc6bc['size']>0x0&&_0x16ae90['enqueueChange']({'isUndoable':!0x1},_0x2ad4e4=>{for(const [_0xe81fe1,_0x25159d]of _0x4dc6bc)'$graveyard'==_0x16ae90['markers']['get'](_0xe81fe1)['getRange']()['root']['rootName']&&(re(_0xe81fe1['split'](':')[0x2],_0x25159d['toRange'](),_0x16ae90,_0x2ad4e4),_0x25159d['detach']());_0x4dc6bc['clear']();});});}(_0x59b1a7),this['_domEmitter']['listenTo'](_0x58c4bd['document'],'keydown',(_0x2ec3fd,{key:_0x293330})=>{'Escape'===_0x293330&&function(_0x1aabf0){_0x1aabf0['editing']['view']['change'](_0x274da2=>{for(const _0x2a74fa of _0x1aabf0['model']['markers']){if(!_0x2a74fa['name']['startsWith']('user:position'))continue;const _0x1fbbed=_0x1aabf0['editing']['mapper']['markerNameToElements'](_0x2a74fa['name']);if(_0x1fbbed){for(const _0x869690 of _0x1fbbed)_0x274da2['removeClass']('ck-user__marker_hovered',_0x869690);}}});}(_0x59b1a7);},{'useCapture':!0x0});}['afterInit'](){const _0xf9c11a=this['editor'],_0x16581c=_0xf9c11a['commands']['get']('undo');_0x16581c&&_0xf9c11a['model']['on']('applyOperation',(_0x3dad42,_0xa244d6)=>{const _0xdeaac0=_0xa244d6[0x0];if('marker'!=_0xdeaac0['type']||!_0xdeaac0['name']['startsWith']('user:'))return;const _0x269792=_0xdeaac0['batch'];_0x16581c['_createdBatches']['has'](_0x269792)&&(_0xdeaac0['newRange']=_0xdeaac0['oldRange']?_0xf9c11a['model']['createRange'](_0xdeaac0['oldRange']['start'],_0xdeaac0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x48f04b=this['editor'],_0x5f0953=_0x48f04b['model']['document'],_0x27279e=_0x48f04b['plugins']['get'](i);_0x48f04b['model']['enqueueChange']({'isUndoable':!0x1},_0x26e4d8=>{const _0x1b371f='user:range:'+_0x27279e['mySessionId'],_0x1ddee3='user:position:'+_0x27279e['mySessionId'],_0x505ff0=_0x48f04b['model']['markers']['has'](_0x1b371f);_0x48f04b['editing']['view']['hasDomSelection']?re(_0x27279e['mySessionId'],_0x5f0953['selection']['getFirstRange'](),_0x48f04b['model'],_0x26e4d8):_0x505ff0&&(_0x26e4d8['removeMarker'](_0x1b371f),_0x26e4d8['removeMarker'](_0x1ddee3));});}}function re(_0x1a5850,_0x2a71b3,_0xa7e5c,_0x28dd2f){const _0x578b85='user:range:'+_0x1a5850,_0xc40f52='user:position:'+_0x1a5850,_0x4ce1bb=_0x2a71b3['getContainedElement']();let _0x54c7c3=_0x2a71b3['start'];_0x4ce1bb&&_0x4ce1bb['is']('element','tableCell')&&(_0x54c7c3=function(_0x1b47a1,_0x56e633){for(const _0x39c6d9 of _0x1b47a1['getPositions']())if(_0x56e633['schema']['checkChild'](_0x39c6d9,'$text'))return _0x39c6d9;}(_0x2a71b3,_0xa7e5c),_0x2a71b3=_0x28dd2f['createRange'](_0x54c7c3));const _0x3009f7=_0x28dd2f['createRange'](_0x54c7c3);_0xa7e5c['markers']['has'](_0x578b85)?(_0x28dd2f['updateMarker'](_0x578b85,{'range':_0x2a71b3}),_0x28dd2f['updateMarker'](_0xc40f52,{'range':_0x3009f7})):(_0x28dd2f['addMarker'](_0x578b85,{'range':_0x2a71b3,'usingOperation':!0x0}),_0x28dd2f['addMarker'](_0xc40f52,{'range':_0x3009f7,'usingOperation':!0x0}));}function q(_0x4e031b,_0x14e0d4,_0x16d90e){const t=_0x4e031b['t'];switch(_0x14e0d4){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'},_0x16d90e);default:return'';}}let K=0x1;class l extends _0x574e71{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x8521a6)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,H,_0x533fdf,_0x52817f,_0x18c234];}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 _0xbb581=this['serverHistory']['getOperations']();for(let _0x3043ec=_0xbb581['length']-0x1;_0x3043ec>=0x0;_0x3043ec--){const _0x4f2020=_0xbb581[_0x3043ec];if(!this['_disconnectionOperations']['has'](_0x4f2020))return _0x4f2020['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2d04f6){if(super(_0x2d04f6),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x266f14(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x363645('collaboration-missing-channelid',this);const _0x1aeb85=_0x2d04f6['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x1aeb85,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1ff523(),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 _0x586cf2=this['editor'],_0x329547=_0x586cf2['plugins']['get'](_0x52817f),_0x461039=_0x586cf2['plugins']['get'](c);this['listenTo'](_0x329547,'getOperationAuthor',(_0x4280da,_0x17d0f9)=>{const _0x5cbca6=_0x17d0f9[0x0];_0x5cbca6['_authorId']&&(_0x4280da['return']=_0x329547['getUser'](_0x5cbca6['_authorId']),_0x4280da['stop']()),null===_0x5cbca6['_authorId']&&(_0x4280da['return']=null,_0x4280da['stop']());},{'priority':'high'}),this['listenTo'](_0x586cf2['model']['document']['selection'],'change:range',(_0x33e882,_0x21de7c)=>{_0x21de7c['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x586cf2['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x586cf2['model']['on']('applyOperation',(_0x40b1f3,_0x5b46f2)=>{const _0x438d0c=_0x5b46f2[0x0];_0x438d0c['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x438d0c),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x461039,'state',this,'_hasSynchronizationProblem',(_0x5009e0,_0x77e7f5)=>'connected'===_0x5009e0&&!_0x77e7f5),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x586cf2['disableReadOnlyMode']('rtc-offline'):_0x586cf2['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x586cf2['disableReadOnlyMode']('rtc-offline'):_0x586cf2['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x45e01f=this['editor']['plugins']['get'](i),_0x2d8b45=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x45e01f['unregister'](this['_channelId']);const _0x1f9fed=await this['_service']['reconnect'](_0x2d8b45['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1f9fed)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2f0cb3=await this['_service']['getConnectedSessions']();_0x45e01f['register'](this['_channelId'],_0x2f0cb3),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xa08bd0){if(function(_0xc879e5){return'404'===_0xc879e5['code'];}(_0xa08bd0)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0xbd6592){return'409'===_0xbd6592['code'];}(_0xa08bd0)){const _0x354783=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'](_0x354783);}else{if(!(_0xa08bd0 instanceof J))throw _0xa08bd0;this['_handleReconnectionError']();}}}}['destroy'](){const _0x311896=this['editor']['plugins']['get'](c),_0x1a6890=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x1a6890['channelSessions']['has'](this['_channelId'])&&_0x1a6890['unregister'](this['_channelId']),_0x311896['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x33870b){if(this['sessionId']!==_0x33870b['sessionId']&&this['_lastSyncedOperationId']!==_0x33870b['lastOperationId'])throw new J();return this['sessionId']=_0x33870b['sessionId'],this['_handleServerResponse']([],{..._0x33870b,'wereChangesApplied':!0x1,'data':_0x33870b['data']},'reconnect');}async['_connectService'](_0x4a8be6,_0x4a182e=!0x1){const {connection:_0x10c4c8}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x10c4c8,this['_channelId'])['then'](_0x45508d=>this['_initSessionsHandling'](_0x45508d))['catch'](_0x1dc7f1=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1dc7f1);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5aee14,_0x3ebe41)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3ebe41);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x333a7d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4a8be6);this['_isPendingUpdate']=!0x0;const _0x34a5ce=await this['_service']['connect'](_0x10c4c8,this['_compressOperations'](_0x4a8be6),_0x333a7d);if(this['sessionId']=_0x34a5ce['sessionId'],_0x4a182e){if(!_0x34a5ce['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x34a5ce['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4a8be6,_0x34a5ce,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x34a5ce,_0x4a8be6);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2c8d3c=this['editor']['plugins']['get'](i),_0x2af2d1=this['editor']['plugins']['get'](H),_0x368948=_0x2c8d3c['channelSessions']['get'](this['_channelId']);_0x368948&&_0x368948['length']>0x1?_0x2af2d1['createUserMarkerOperations']():this['listenTo'](_0x2c8d3c,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2c8d3c['channelSessions']['get'](this['_channelId'])['length']&&_0x2af2d1['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4c46cb,_0x5a99c7,_0x496bf7,_0x41521a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x5a99c7){const _0x3ee128=this['_decompressOperations'](_0x496bf7,_0x41521a);await this['_fetchMissingUsers'](_0x3ee128),this['_handleExternalOperations'](_0x3ee128,_0x5a99c7,_0x496bf7['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x4642a1}=this['editor'];let _0x405fd9;try{_0x405fd9=await this['_service']['getDocumentDetails']();}catch(_0x2e4ad7){const _0x267cac=q(_0x4642a1,'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'](_0x267cac);}const _0x53b1a2=_0x405fd9['currentDocumentSession']||_0x405fd9['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x53b1a2['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x8e793b=q(_0x4642a1,'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'](_0x8e793b);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x53b603){const _0x2e21f2=this['editor']['plugins']['get'](i);this['listenTo'](_0x2e21f2,'sessionAdd:'+this['_channelId'],(_0x24d9aa,{session:_0x5d9a26})=>{if(_0x5d9a26['id']===_0x2e21f2['mySessionId']){_0x24d9aa['off']();const _0x2761a2=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x380975=_0x5d9a26['permissions'];_0x2761a2&&_0x2761a2['isEnabled']&&(_0x380975=_0x380975['filter'](_0x4751cd=>'document:write'!==_0x4751cd)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x380975,this['_channelId']);}}),_0x2e21f2['register'](this['_channelId'],_0x53b603);}['_initThrowingOnDataSet'](){const _0x2d35fc=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5bb550)=>{if(!_0x5bb550[_0x5bb550['length']-0x1]['suppressErrorInCollaboration'])throw new _0x363645('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2d35fc['apply'](this['editor']['data'],_0x5bb550);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x70c2cb,[_0x3959cd])=>{if(this['_document']['version'])throw new _0x363645('realtimecollaborationclient-init-document-already-initialized',this);_0x70c2cb['stop'](),this['_setPendingAction']();const _0x41c2a2=this['editor']['config']['get']('rootsAttributes'),_0x536007=this['_getOperationsFromInitData'](_0x3959cd,_0x41c2a2);0x0==_0x536007['length']&&_0x536007['push'](new _0x32387a(0x0)),_0x70c2cb['return']=this['_connectService'](_0x536007)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3362bf=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3362bf))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x499276,[_0x10dc86,_0x20d4dc])=>{_0x499276['stop']();const _0x4c9331=this['editor']['model']['document']['getRoot'](_0x10dc86);if(!this['_knownRootNames']['has'](_0x10dc86)){const _0x52e027=_0x20d4dc&&_0x20d4dc['data']?_0x20d4dc['data']:'',_0x1cd16c=_0x20d4dc&&_0x20d4dc['attributes']?_0x20d4dc['attributes']:{};await this['_loadRoot'](_0x10dc86,_0x52e027,_0x1cd16c);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4c9331['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4c9331);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x12590f){const _0x52a3a9=this['editor']['plugins']['get'](_0x52817f),{connection:_0x483662}=this['editor']['plugins']['get'](c),_0x552433=new Set();for(const _0x5dbce9 of _0x12590f){const _0x1d6b1d=_0x5dbce9['_authorId'];_0x1d6b1d&&!_0x52a3a9['getUser'](_0x1d6b1d)&&_0x552433['add'](_0x1d6b1d);}if(0x0===_0x552433['size'])return;const _0x4b43ba=await dt['getMany'](_0x483662,Array['from'](_0x552433));for(const _0x13b5b5 of _0x4b43ba)_0x52a3a9['getUser'](_0x13b5b5['id'])||_0x52a3a9['addUser'](_0x13b5b5);}['_getOperationsFromInitData'](_0x15ed90,_0x6ae223={}){const _0x47955e=this['editor']['model'],_0x3e7cad=[];let _0x3e6ed8=0x0;const _0x51359b='string'==typeof _0x15ed90?{'main':_0x15ed90}:_0x15ed90;for(const _0x4db44b of Object['keys'](_0x51359b)){if(!this['_document']['roots']['has'](_0x4db44b))throw new _0x363645('realtimecollaborationclient-init-non-existent-root',this);const _0x2af1ca=this['editor']['data']['parse'](_0x51359b[_0x4db44b]),_0x158782=this['_document']['getRoot'](_0x4db44b),_0x3f01af=new _0x22e099(_0x47955e['createPositionAt'](_0x158782,0x0),_0x2af1ca,_0x3e6ed8++);_0x3e7cad['push'](_0x3f01af);for(const [_0x4c938d,_0x17f453]of _0x2af1ca['markers']){const _0x5b75e4=_0x47955e['createRange'](_0x47955e['createPositionFromPath'](_0x158782,_0x17f453['start']['path']['slice']()),_0x47955e['createPositionFromPath'](_0x158782,_0x17f453['end']['path']['slice']())),_0xd7e31=new _0x45976b(_0x4c938d,null,_0x5b75e4,_0x47955e['markers'],!0x0,_0x3e6ed8++);_0x3e7cad['push'](_0xd7e31);}}if(_0x6ae223)for(const [_0x1f1370,_0x3cb010]of Object['entries'](_0x6ae223)){const _0x1592a6=_0x47955e['document']['getRoot'](_0x1f1370);if(!_0x1592a6)throw new _0x363645('multi-root-editor-root-attributes-no-root',null);for(const [_0x699df,_0xabed22]of Object['entries'](_0x3cb010))if(null!==_0xabed22){const _0x3efe23=new _0x49d9f5(_0x1592a6,_0x699df,null,_0xabed22,_0x3e6ed8++);_0x3e7cad['push'](_0x3efe23);}}return _0x3e7cad;}async['_loadRoot'](_0x298306,_0x6dbca6,_0x12a6a1){this['_getOperationsFromInitData']({[_0x298306]:_0x6dbca6},{[_0x298306]:_0x12a6a1})['forEach']((_0x516444,_0x2eb46b)=>{_0x516444['baseVersion']=this['_document']['version']+_0x2eb46b,_0x516444['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x516444);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x4b94f2,_0x9f42e6){let _0x447d8b;this['_offset']=_0x4b94f2['offset'];const _0xca2e83=_0x4b94f2['wereChangesApplied']&&!_0x4b94f2['initData'],_0x15d1a4=_0xca2e83?0x0:_0x4b94f2['data']['baseVersion'];if(_0x9f42e6['forEach'](_0x52886e=>{_0x52886e['_isInit']=!0x0,_0x52886e['createdAt']=_0x4b94f2['sessionCreatedAt'],_0x52886e['_authorId']=null;}),_0xca2e83)_0x447d8b=_0x9f42e6,this['_applyOperationsSet'](_0x447d8b,_0xca2e83);else{if(_0x4b94f2['initData']){const _0x5c0e65=this['_getOperationsFromInitData'](_0x4b94f2['initData']);this['_document']['history']['version']=-_0x5c0e65['length'],_0x5c0e65['forEach'](_0x50c10b=>{_0x50c10b['baseVersion']-=_0x5c0e65['length'],_0x50c10b['createdAt']=_0x4b94f2['sessionCreatedAt'],_0x50c10b['_isInit']=!0x0,_0x50c10b['_authorId']=null;}),this['_applyOperationsSet'](_0x5c0e65,!0x0),this['serverHistory']['version']=-_0x5c0e65['length']+this['_offset'],this['_updateServerHistory'](_0x5c0e65);}this['_document']['history']['version']=_0x15d1a4,_0x447d8b=this['_decompressOperations'](_0x4b94f2['data'],_0x4b94f2['metadata']),await this['_fetchMissingUsers'](_0x447d8b),this['_applyOperationsSet'](_0x447d8b,_0xca2e83);}_0x4b94f2['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x447d8b,_0x4b94f2['lastOperationId']),this['_lastSyncedOperationId']=_0x4b94f2['lastOperationId']),this['serverHistory']['version']=_0x15d1a4+this['_offset'],this['_updateServerHistory'](_0x447d8b),_0x9f42e6['filter'](_0x261eec=>{const _0x1df6a9=this['_getAffectedRoot'](_0x261eec);return _0x1df6a9&&!this['_knownRootNames']['has'](_0x1df6a9);})['forEach']((_0x47339f,_0x17cafe)=>{_0x47339f['baseVersion']=this['_document']['version']+_0x17cafe,this['_saveOperationInBuffer'](_0x47339f);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x182f3a,_0x5c6600){throw this['_isPendingUpdate']=!0x0,_0x5c6600&&console['error'](_0x5c6600),new _0x363645(_0x182f3a,this['editor']);}['_saveOperationInBuffer'](_0x1567d6){this['_knownOperations']['has'](_0x1567d6)||(this['_knownOperations']['add'](_0x1567d6),this['_bufferedOperations']['push'](_0x1567d6),this['_pendingAction']||'marker'==_0x1567d6['type']&&!_0x1567d6['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x2bd1a3=!0x1){!_0x2bd1a3&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x11436e=>{_0x11436e&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x266562=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x2681a9){return _0x2681a9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2681a9['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2681a9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x266562))throw _0x266562;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x4b94cf=>{this['on']('change:_isPendingUpdate',()=>{_0x4b94cf();});});}async['_sendBufferedOperations'](){const _0x3919aa=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x3919aa['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x219a34=[...this['_bufferedOperations']];for(const _0x2ed870 of _0x219a34)_0x2ed870['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2ed870);const _0x4d8a15=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x219a34),_0xc21e10=K++,_0x1f42e0=this['_compressOperations'](_0x219a34),_0xa8f2f9=await this['_service']['sendOperations'](_0x1f42e0,_0x1f42e0['baseVersion'],_0x4d8a15);try{return await this['_handleServerResponse'](_0x219a34,_0xa8f2f9,_0xc21e10);}catch(_0x402b97){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x402b97);}}async['_handleServerResponse'](_0x11fc78,_0x3b3df0,_0x3bde73){if('error'in _0x3b3df0)throw _0x3b3df0['error'];let _0x1de2e2=!0x1;if(_0x3b3df0['wereChangesApplied']){_0x3b3df0['lastOperationId']&&(this['_lastSyncedOperationId']=_0x3b3df0['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1b7e5e=>!_0x11fc78['includes'](_0x1b7e5e));for(const _0x12f5fb of _0x11fc78)_0x12f5fb['createdAt']='lastOperationAcceptedAt'in _0x3b3df0&&_0x3b3df0['lastOperationAcceptedAt']||void 0x0;Q(_0x11fc78,_0x3b3df0['version']-_0x11fc78['length']),this['_updateServerHistory'](_0x11fc78);const _0x1a65d6=_0x11fc78['filter'](_0x11bd1e=>{if(!_0x11bd1e['_isInit'])return!0x1;const _0x1f1737=this['_getAffectedRoot'](_0x11bd1e);return _0x1f1737&&!this['_knownRootNames']['has'](_0x1f1737);});Q(_0x1a65d6,this['_document']['version']),this['_applyOperationsSet'](_0x1a65d6),_0x1de2e2=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x28cffd=this['_decompressOperations'](_0x3b3df0['data'],_0x3b3df0['metadata'])['filter'](_0x584523=>_0x584523['baseVersion']>=this['_lastServerVersion']);_0x28cffd['forEach'](_0x2602f1=>this['_addKnownRoot'](_0x2602f1)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5cbc16=>!_0x5cbc16['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5cbc16))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x28cffd),_0x1de2e2=this['_handleExternalOperations'](_0x28cffd,_0x3b3df0['version'],_0x3b3df0['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1de2e2?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x599edd,_0x2b337b,_0x5d3ab2){try{const _0x4ab1c8={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x267da,operationsB:_0xba2d7d,originalOperations:_0x41b76c}=_0x1fe169(_0x599edd,this['_bufferedOperations'],_0x4ab1c8);Q(_0x267da,this['_document']['version']),Q(_0xba2d7d,_0x2b337b);for(const _0x41ce0a of _0x267da){const _0x259428=_0x41b76c['get'](_0x41ce0a);_0x41ce0a['_authorId']=_0x259428?_0x259428['_authorId']:null;}_0x5d3ab2&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x599edd,_0x5d3ab2),this['_lastSyncedOperationId']=_0x5d3ab2),this['_bufferedOperations']=[..._0xba2d7d],this['_applyOperationsSet'](_0x267da),this['_updateServerHistory'](_0x599edd);}catch(_0x569b40){return console['error'](_0x569b40),!0x1;}return!0x0;}['_applyOperationsSet'](_0x502549,_0x5d823e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x349532=>{for(const _0x4d48d1 of _0x502549)this['_knownOperations']['add'](_0x4d48d1),this['_addKnownRoot'](_0x4d48d1),_0x349532['batch']['addOperation'](_0x4d48d1),this['editor']['model']['applyOperation'](_0x4d48d1);});}['_addKnownRoot'](_0x213e7a){const _0xd48e6c=this['_getAffectedRoot'](_0x213e7a);_0xd48e6c&&this['_knownRootNames']['add'](_0xd48e6c);}['_getAffectedRoot'](_0x544801){let _0x52a1ad,_0x2a744f;switch(_0x544801['type']){case'insert':_0x52a1ad=_0x544801['position']['root'];break;case'marker':if(_0x2a744f=_0x544801['newRange'],!_0x2a744f)return null;_0x52a1ad=_0x2a744f['root'];break;case'addRootAttribute':_0x52a1ad=_0x544801['root'];break;case'addRoot':_0x52a1ad=_0x544801['affectedSelectable'];break;case'move':_0x52a1ad=_0x544801['targetPosition']['root'];break;default:return null;}return _0x52a1ad['rootName'];}['_updateServerHistory'](_0x3ecff8){_0x3ecff8['forEach'](_0x357fa8=>{const _0x1516c9=_0x357fa8['clone']();_0x1516c9['_authorId']=_0x357fa8['_authorId'],_0x1516c9['_isInit']=!!_0x357fa8['_isInit'],_0x1516c9['createdAt']=_0x357fa8['createdAt'],_0x1516c9['baseVersion']+=this['_offset'],_0x357fa8['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x1516c9),this['serverHistory']['addOperation'](_0x1516c9);});}['_handleReconnectionError'](_0x149552){const _0x496c8a=this['editor']['plugins']['get']('Notification'),_0x41c978=this['editor']['locale'];_0x149552||(_0x149552=q(_0x41c978,'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.')),_0x496c8a['showWarning'](_0x149552,{'title':q(_0x41c978,'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'](_0x533fdf)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x533fdf)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x24a8a9){const _0x481d8b=_0x24a8a9['map'](_0x346b40=>_0x346b40['toJSON']());return this['_compressor']['compress'](_0x481d8b);}['_decompressOperations'](_0x202122,_0x3f4290){return this['_compressor']['decompress'](_0x202122)['map']((_0x345f09,_0x3d1fae)=>{const _0x16621b='init'==_0x3f4290[_0x3d1fae]['type'];if('InsertOperation'==_0x345f09['__className']){const _0x23d0c4=_0x345f09['position']['root'];!this['_document']['getRoot'](_0x23d0c4)&&(this['_document']['createRoot']('$root',_0x23d0c4)['_isAttached']=!0x1);}const _0x544bb6=_0xdb8289['fromJSON'](_0x345f09,this['_document']);return _0x544bb6['wasUndone']=_0x345f09['wasUndone'],_0x544bb6['_isInit']=_0x16621b,_0x544bb6['_authorId']=_0x16621b?null:_0x3f4290[_0x3d1fae]['userId'],_0x544bb6['_isDisconnection']='cs:removeUser'===_0x3f4290[_0x3d1fae]['type'],_0x544bb6['createdAt']=_0x3f4290[_0x3d1fae]['createdAt'],_0x544bb6;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4b416=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4b416&&_0x4b416['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x3abd85,_0x5b0d72){for(const _0x52aee4 of _0x3abd85)_0x52aee4['baseVersion']=_0x5b0d72++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x2494c3){this['_ignoredOperations']=_0x2494c3,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2d2aad){let _0x5a5f7b=_0x2d2aad['length'];for(;_0x5a5f7b--;){const _0x24241f=_0x2d2aad[_0x5a5f7b];if(!this['_ignoredOperations']['has'](_0x24241f)){if(!this['_operationToId']['has'](_0x24241f)){const _0x2aee41=_0x2042fc()['slice'](0x1,0x12);this['_operationToId']['set'](_0x24241f,_0x2aee41);}return this['_operationToId']['get'](_0x24241f);}}}['setIdForTheLastOperation'](_0x2c12ed,_0x56289a){if(!_0x56289a)return;let _0x37de86=_0x2c12ed['length'];for(;_0x37de86--;){const _0x13cd25=_0x2c12ed[_0x37de86];this['_ignoredOperations']['has'](_0x13cd25)||this['_operationToId']['set'](_0x13cd25,_0x56289a);}}}class n extends _0x574e71{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x5fba94{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x49985c)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x52817f];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c7284){super(_0x4c7284),this['_services']=new Map();}async['init'](){const _0xabff63=this['context'],_0xc1df0a=_0xabff63['plugins']['get']('CommentsRepository');if(_0xabff63['plugins']['get'](c)['addToReconnectionStack'](this),_0xc1df0a['adapter']={'addCommentThread':async({channelId:_0x58896f,threadId:_0x429377,comments:_0x335bdb,resolvedAt:_0x5b6a0f,resolvedBy:_0x517433,context:_0xdf6000,attributes:_0xa5f827})=>{const _0xe4cf7b=await this['_getService'](_0x58896f)['addCommentThread']({'commentThreadId':_0x429377,'comments':_0x335bdb['map'](_0x49effd=>function(_0x154ec5,_0xf8b19f,_0x4b44a4){return{'commentThreadId':_0x4b44a4,'commentId':_0x154ec5['commentId'],'userId':_0x154ec5['authorId'],'content':_0x154ec5['content'],'documentId':_0xf8b19f,'createdAt':_0x154ec5['createdAt'],'attributes':_0x154ec5['attributes']||{}};}(_0x49effd,_0x58896f,_0x429377)),'resolvedAt':_0x5b6a0f,'resolvedBy':_0x517433,'context':_0xdf6000,'attributes':_0xa5f827})['catch'](ut);return{'threadId':_0xe4cf7b['commentThreadId'],'comments':_0xe4cf7b['comments']};},'getCommentThread':async({channelId:_0x21bd39,threadId:_0x325415})=>{const _0x21cdb9=await this['_getService'](_0x21bd39)['getCommentThread'](_0x325415)['catch'](ut);return _0x21cdb9['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x21cdb9]),{'threadId':_0x21cdb9['commentThreadId'],'comments':_0x21cdb9['comments']['map'](b),'context':_0x21cdb9['context'],'resolvedAt':_0x21cdb9['resolvedAt'],'resolvedBy':_0x21cdb9['resolvedBy'],'attributes':_0x21cdb9['attributes']||{}});},'updateCommentThread':async({channelId:_0x233aba,threadId:_0x24e260,context:_0x1695d7,unlinkedAt:_0x3b55ee,attributes:_0x57a1bb})=>this['_getService'](_0x233aba)['updateCommentThread']({'commentThreadId':_0x24e260,'context':_0x1695d7,'attributes':_0x57a1bb,'unlinkedAt':_0x3b55ee})['catch'](y)['catch'](ut),'resolveCommentThread':async({channelId:_0x368409,threadId:_0x4df881})=>{const _0x1bbc6b=await this['_getService'](_0x368409)['resolveCommentThread'](_0x4df881)['catch'](y)['catch'](ut);return{'threadId':_0x1bbc6b['commentThreadId'],'resolvedAt':_0x1bbc6b['resolvedAt'],'resolvedBy':_0x1bbc6b['resolvedBy']};},'reopenCommentThread':async({channelId:_0x21de0f,threadId:_0x1f9131})=>this['_getService'](_0x21de0f)['reopenCommentThread'](_0x1f9131)['catch'](y)['catch'](ut),'removeCommentThread':({channelId:_0xbc6120,threadId:_0x5cc86c})=>this['_getService'](_0xbc6120)['removeCommentThread'](_0x5cc86c)['catch'](y)['catch'](ut),'addComment':({channelId:_0x551dad,threadId:_0x1d6e55,commentId:_0x594d2b,content:_0x1bda6e,attributes:_0x243b3e})=>this['_getService'](_0x551dad)['addComment'](_0x1d6e55,_0x594d2b,_0x1bda6e,_0x243b3e)['catch'](ut),'updateComment':({channelId:_0x2f2a86,threadId:_0x27a18e,commentId:_0x5b8cc0,content:_0x4b9595,attributes:_0x49ee07})=>this['_getService'](_0x2f2a86)['updateComment'](_0x27a18e,_0x5b8cc0,_0x4b9595,_0x49ee07)['catch'](y)['catch'](ut),'removeComment':({channelId:_0x1745a7,threadId:_0x35dbb1,commentId:_0x3be111})=>this['_getService'](_0x1745a7)['removeComment'](_0x35dbb1,_0x3be111)['catch'](y)['catch'](ut)},_0xabff63 instanceof _0x462650){const _0x38422c=_0xabff63['config']['get']('collaboration.channelId'),_0x1ea794=_0xabff63['plugins']['get'](i);await this['_setUpService'](_0x38422c);const _0xa85482=await this['_services']['get'](_0x38422c)['getConnectedSessions']();this['listenTo'](_0x1ea794,'sessionAdd:'+_0x38422c,(_0x5e0562,{session:_0x3c8378})=>{_0x3c8378['id']===_0x1ea794['mySessionId']&&(_0x5e0562['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3c8378['permissions'],_0x38422c));}),_0x1ea794['register'](_0x38422c,_0xa85482);}}async['_setUpService'](_0x1a1bee){if(this['_services']['has'](_0x1a1bee))throw new _0x363645('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x1a1bee});const _0x113856=this['context']['plugins']['get']('CommentsRepository'),_0x2099a4=new a['CommentsService'](_0x1a1bee);this['_services']['set'](_0x1a1bee,_0x2099a4),this['listenTo'](_0x2099a4,'commentThreadAdded',(_0x4e1641,_0x1c6e85)=>{const {commentThreadId:_0x45582d,documentId:_0x133591,context:_0x585af6,attributes:_0x2eed7d,resolvedAt:_0x34c304,resolvedBy:_0x803c2b,comments:_0x5dcc6a}=_0x1c6e85;_0x113856['getCommentThread'](_0x45582d)||_0x113856['addCommentThread']({'threadId':_0x45582d,'channelId':_0x133591,'comments':_0x5dcc6a?_0x5dcc6a['map'](b):[],'context':_0x585af6,'attributes':_0x2eed7d,'resolvedAt':_0x34c304,'resolvedBy':_0x803c2b,'isFromAdapter':!0x0});}),this['listenTo'](_0x2099a4,'commentThreadUpdated',(_0x3745fc,{commentThreadId:_0x492a87,documentId:_0x1a9770,context:_0x1196a7,unlinkedAt:_0x1cd6d8,attributes:_0x541c34})=>{_0x113856['getCommentThread'](_0x492a87)&&_0x113856['updateCommentThread']({'threadId':_0x492a87,'channelId':_0x1a9770,'context':_0x1196a7,'unlinkedAt':_0x1cd6d8,'attributes':_0x541c34,'isFromAdapter':!0x0});}),this['listenTo'](_0x2099a4,'commentThreadResolved',(_0x45ec4f,{commentThreadId:_0x4c2533,resolvedBy:_0x2176d3,resolvedAt:_0x67caee})=>{const _0x7a3a70=_0x113856['getCommentThread'](_0x4c2533);_0x7a3a70&&_0x7a3a70['resolve']({'resolvedBy':_0x2176d3,'resolvedAt':_0x67caee,'isFromAdapter':!0x0});}),this['listenTo'](_0x2099a4,'commentThreadReopened',(_0x1c685e,{commentThreadId:_0x585519})=>{const _0x39a584=_0x113856['getCommentThread'](_0x585519);_0x39a584&&_0x39a584['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x2099a4,'commentThreadRemoved',(_0x37bee8,{commentThreadId:_0x285659})=>{const _0xf5025=_0x113856['getCommentThread'](_0x285659);_0xf5025&&_0xf5025['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x2099a4,'commentAdded',(_0x2032e4,_0x26652a)=>{const _0x22bdc8=_0x26652a['commentThreadId'],_0x3cd924=_0x113856['getCommentThread'](_0x22bdc8);_0x3cd924&&_0x3cd924['addComment']({...b(_0x26652a),'isFromAdapter':!0x0});}),this['listenTo'](_0x2099a4,'commentUpdated',(_0x20d84b,{commentThreadId:_0x375708,commentId:_0x1bd082,content:_0x41e045,attributes:_0x5d09a3})=>{const _0x47c9a7=_0x113856['getCommentThread'](_0x375708);if(_0x47c9a7){const _0x3a81bd=_0x47c9a7['getComment'](_0x1bd082);_0x3a81bd&&_0x3a81bd['update']({'content':_0x41e045,'attributes':_0x5d09a3,'isFromAdapter':!0x0});}}),this['listenTo'](_0x2099a4,'commentRemoved',(_0x26c357,{commentThreadId:_0xa8ccf4,commentId:_0x5145ff})=>{const _0x406908=_0x113856['getCommentThread'](_0xa8ccf4);if(_0x406908){const _0x1f5be6=_0x406908['getComment'](_0x5145ff);_0x1f5be6&&_0x1f5be6['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x1a1bee);}['destroy'](){if(this['context']instanceof _0x462650){const _0xea3a43=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0xea3a43);}}['_terminateService'](_0x28d609){if(!this['_services']['has'](_0x28d609))throw new _0x363645('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x28d609});this['_getService'](_0x28d609)['disconnect'](),this['_services']['delete'](_0x28d609);}async['reconnect'](){for(const _0x2ce3bf of this['_services']['keys']())await this['_connectService'](_0x2ce3bf);if(this['context']instanceof _0x462650){const _0x280f82=this['context']['config']['get']('collaboration.channelId'),_0x1327f6=this['context']['plugins']['get'](i);_0x1327f6['unregister'](_0x280f82);const _0x5347b0=await this['_services']['get'](_0x280f82)['getConnectedSessions']();_0x1327f6['register'](_0x280f82,_0x5347b0);}}async['_connectService'](_0x1beb4a){const {connection:_0x3e62d9}=this['context']['plugins']['get'](c),_0x1128b5=this['context']['plugins']['get']('CommentsRepository'),_0x288db4=this['_services']['get'](_0x1beb4a),_0x5ba349=await _0x288db4['connect'](_0x3e62d9);await this['_fetchMissingUsersForThreads'](_0x5ba349);const _0x14b7d5=new Set(Array['from'](_0x1128b5['getCommentThreads']({'channelId':_0x1beb4a}),_0x4a6a52=>_0x4a6a52['id']));for(const _0x527229 of _0x5ba349)_0x527229['deletedAt']||_0x14b7d5['delete'](_0x527229['commentThreadId']);for(const _0x3402fc of _0x14b7d5)_0x1128b5['getCommentThread'](_0x3402fc)['remove']({'isFromAdapter':!0x0});for(const _0x367c81 of _0x5ba349){let _0x5a005f=_0x1128b5['getCommentThread'](_0x367c81['commentThreadId']);const {commentThreadId:_0x46977b,context:_0x42c2a6,attributes:_0x5ed35b,resolvedBy:_0x1d553d,resolvedAt:_0x2959cf,unlinkedAt:_0x362e97,deletedAt:_0x3622e2}=_0x367c81;if(_0x3622e2)continue;_0x5a005f||(_0x5a005f=_0x1128b5['addCommentThread']({'channelId':_0x1beb4a,'threadId':_0x46977b,'context':_0x42c2a6,'attributes':_0x5ed35b||{},'resolvedBy':_0x1d553d,'resolvedAt':_0x2959cf,'unlinkedAt':_0x362e97,'isFromAdapter':!0x0}));const _0x4a1961=new Set(Array['from'](_0x5a005f['comments'],_0x55e49a=>_0x55e49a['id']));for(const _0x186104 of _0x367c81['comments'])_0x4a1961['delete'](_0x186104['commentId']);for(const _0x5a2a8d of _0x4a1961)_0x5a005f['getComment'](_0x5a2a8d)['remove']({'isFromAdapter':!0x0});for(const _0x370658 of _0x367c81['comments']){const _0x14b1be=_0x5a005f['getComment'](_0x370658['commentId']);_0x14b1be?_0x14b1be['content']!==_0x370658['content']&&_0x14b1be['update']({'content':_0x370658['content'],'isFromAdapter':!0x0}):_0x5a005f['addComment'](Object['assign'](b(_0x370658),{'isFromAdapter':!0x0}));}}}['_getService'](_0x2dcdc5){if(!this['_services']['has'](_0x2dcdc5))throw new _0x363645('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2dcdc5});return this['_services']['get'](_0x2dcdc5);}async['_fetchMissingUsersForThreads'](_0x39e836){const _0x3fa9c5=this['context']['plugins']['get'](_0x52817f),{connection:_0x41b88b}=this['context']['plugins']['get'](c),_0x549b91=new Set();for(const {resolvedBy:_0x5c8d9c,comments:_0x489b18}of _0x39e836){_0x5c8d9c&&!_0x3fa9c5['getUser'](_0x5c8d9c)&&_0x549b91['add'](_0x5c8d9c);for(const {userId:_0x1ac5c1}of _0x489b18)_0x3fa9c5['getUser'](_0x1ac5c1)||_0x549b91['add'](_0x1ac5c1);}if(0x0===_0x549b91['size'])return;const _0x231eae=await dt['getMany'](_0x41b88b,Array['from'](_0x549b91));for(const _0x14577b of _0x231eae)_0x3fa9c5['getUser'](_0x14577b['id'])||_0x3fa9c5['addUser'](_0x14577b);}}async function y(_0x2c3e68){if('404'!==_0x2c3e68['code'])throw _0x2c3e68;}function ut(_0x3a1de9){if((_0x501b45=_0x3a1de9)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x501b45['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x501b45['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x501b45;throw _0x3a1de9;}function b(_0x318693){return{'threadId':_0x318693['commentThreadId'],'commentId':_0x318693['commentId'],'content':_0x318693['content'],'createdAt':_0x318693['createdAt'],'authorId':_0x318693['userId'],'attributes':_0x318693['attributes']||{}};}class f extends _0x574e71{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(_0x54f0c7){super(_0x54f0c7);const _0x1f3316=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x1f3316);}['init'](){const _0x5b59ac=this['editor']['plugins']['get'](c),_0xf069a6=this['editor']['plugins']['get']('TrackChangesEditing');return _0xf069a6['adapter']={'getSuggestion':async _0x4f49e6=>{await this['_waitForServiceReady']();const _0x40debf=await this['_trackChangesService']['get'](_0x4f49e6)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x40debf]),_0x40debf;},'addSuggestion':async({id:_0x2a297e,type:_0xa915db,data:_0xc39f90,originalSuggestionId:_0x12c5f1,attributes:_0x263347})=>{await this['_waitForServiceReady']();const _0x5d2218={'id':_0x2a297e,'type':_0xa915db,'data':_0xc39f90,'originalSuggestionId':_0x12c5f1,'attributes':_0x263347},_0x169647=await this['_trackChangesService']['add'](_0x2a297e,_0xa915db,_0xc39f90,_0x12c5f1,_0x263347)['catch'](_0x67d63d=>{if(ft(_0x67d63d))return new Promise(_0x580a94=>{this['_bufferedRequests']['set'](_0x2a297e,{'resolve':_0x580a94,'suggestionData':_0x5d2218});});throw _0x67d63d;});return this['_bufferedRequests']['delete'](_0x2a297e),_0x169647;},'updateSuggestion':async(_0x453940,_0x5a6cd3)=>{if(await this['_waitForServiceReady'](),'open'!==_0x5a6cd3['state'])return this['_trackChangesService']['update'](_0x453940,_0x5a6cd3)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x5e635f,_0x3e437f)=>{_0xf069a6['hasSuggestion'](_0x3e437f['id'])&&(_0xf069a6['getSuggestion'](_0x3e437f['id'])['attributes']=_0x3e437f['attributes']);}),this['_trackChangesService']['connect'](_0x5b59ac['connection'])['then'](_0x2ea704=>(_0x5b59ac['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2ea704)['then'](()=>{for(const _0x4a73d6 of _0x2ea704){_0xf069a6['addSuggestionData'](_0x4a73d6)['_saved']=!0x0;}})));}async['reconnect'](){const _0x3f713f=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x4e4b4f}=this['editor']['plugins']['get'](c),_0x486662=await this['_trackChangesService']['connect'](_0x4e4b4f);await this['_fetchMissingUsersForThreads'](_0x486662);for(const {suggestionData:_0x46d413,resolve:_0x1deb8f}of this['_bufferedRequests']['values']()){let _0x4237e1=_0x486662['find'](_0x257d52=>_0x257d52['id']===_0x46d413['id']);_0x4237e1||(_0x4237e1=await this['_trackChangesService']['add'](_0x46d413['id'],_0x46d413['type'],_0x46d413['data'],_0x46d413['originalSuggestionId'])),_0x1deb8f(_0x4237e1);}for(const _0x2a72c2 of _0x486662)_0x3f713f['hasSuggestion'](_0x2a72c2['id'])||_0x3f713f['addSuggestionData'](_0x2a72c2);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x34f435=>{this['listenTo'](this['_trackChangesService'],'connected',_0x51647a=>{_0x51647a['off'](),_0x34f435();});});}async['_fetchMissingUsersForThreads'](_0x5e5d99){const _0x5d00f9=this['editor']['plugins']['get'](_0x52817f),{connection:_0x1dd83e}=this['editor']['plugins']['get'](c),_0x1ac617=new Set();for(const {authorId:_0x1d5267}of _0x5e5d99)_0x5d00f9['getUser'](_0x1d5267)||_0x1ac617['add'](_0x1d5267);if(0x0===_0x1ac617['size'])return;const _0x244e8a=await dt['getMany'](_0x1dd83e,Array['from'](_0x1ac617));for(const _0x38f7f0 of _0x244e8a)_0x5d00f9['getUser'](_0x38f7f0['id'])||_0x5d00f9['addUser'](_0x38f7f0);}}function w(_0xf39391){if(ft(_0xf39391))return new Promise(()=>{});throw _0xf39391;}function ft(_0x742bc5){return _0x742bc5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x742bc5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x574e71{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 _0x47399d=this['editor']['plugins']['get'](c),_0x15c925=this['editor']['plugins']['get']('CommentsEditing'),_0x51fee8=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x47399d,'change:state',(_0x26eeda,_0x28c6af,_0x51b9b5)=>{_0x15c925['isThreadsLoadingPaused']='connected'!==_0x51b9b5;});}),this['listenTo'](_0x47399d,'change:state',(_0x3dff14,_0x521c6f,_0x3789de)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x3789de);}),_0x51fee8['_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 _0x574e71{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 _0x574e71{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x52817f];}constructor(_0x1bc762){super(_0x1bc762);const _0xa68bb8=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0xa68bb8);}async['init'](){const _0x2b4d0d=this['editor']['plugins']['get'](l),_0x36b5b3=_0x2b4d0d['serverHistory'],_0x2c7e22=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x36b5b3,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x2b4d0d['sessionId']});const _0x5d535d=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x56ec39=await tt['isBundleUploaded'](_0x2c7e22['connection'],_0x5d535d);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x2ad386})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x2ad386)),'updateRevisions':async _0x22665d=>{await this['_waitForServiceReady']();const _0x3d9422=this['_revisionTracker']['currentRevision'];if(_0x56ec39&&0x1===_0x22665d['length']&&_0x22665d[0x0]['id']===_0x3d9422['id'])return _0x22665d;for(const _0x38d63d of _0x22665d)_0x38d63d['id']===_0x3d9422['id']&&(_0x38d63d['isEmptyCurrent']=_0x38d63d['fromVersion']===_0x38d63d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x22665d,this['_lastRequestId'])['then'](_0xff2f95=>(this['_lastRequestId']=_0xff2f95,_0x22665d))['catch'](_0x5ba4c0=>{if(st(_0x5ba4c0)||'400'===_0x5ba4c0['code']&&void 0x0!==_0x5ba4c0['data']['wrongRequestId']){for(const _0xcf6922 of _0x22665d){!this['_revisionTracker']['repository']['getRevision'](_0xcf6922['id'])||this['_revisionTracker']['_bufferUpdate'](_0xcf6922['id'],_0xcf6922,!0x1);}if(st(_0x5ba4c0))throw _0x5ba4c0;return _0x22665d;}throw _0x5ba4c0;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x48264b,{revisionsData:_0x5cf77f,requestId:_0x565551})=>{Math['max'](..._0x5cf77f['map'](_0xe968d0=>_0xe968d0['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5cf77f,_0x565551);}):this['_handleRevisionsUpdate'](_0x5cf77f,_0x565551);});const {revisions:_0x499aff,requestId:_0x172b6d}=await this['_revisionHistoryService']['connect'](_0x2c7e22['connection']);_0x2c7e22['addToReconnectionStack'](this),this['_lastRequestId']=_0x172b6d,await this['_fetchMissingUsers'](_0x499aff);for(const _0x307588 of _0x499aff)this['_revisionTracker']['addRevisionData'](_0x307588);this['listenTo'](_0x2b4d0d,'change:_isConnected',(_0xaa973f,_0x404c4c,_0x243282)=>{_0x243282&&(this['_oldOffset']=_0x2b4d0d['_offset'],_0xaa973f['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x2c7e22,'state',_0x57a134=>_0x57a134===_0x3ff8eb['CONNECTED']);}async['reconnect'](){const _0x152031=this['editor']['plugins']['get'](c),_0x27ef6e=this['editor']['plugins']['get'](l),_0x208975=async()=>{const _0x227aee=this['_revisionTracker']['currentRevision'],_0x536226=_0x227aee['id'],_0x126111=_0x536226!==_0x27ef6e['sessionId'];if(_0x126111){const _0x35ac22=_0x27ef6e['_offset']-this['_oldOffset'],_0x388d83=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x227aee['toVersion']+_0x35ac22!==_0x388d83){const _0x6b452d=_0x227aee['fromVersion']+_0x35ac22,_0x550dec=this['editor']['plugins']['get'](_0x52817f),_0xedc4c1=this['_revisionTracker']['buildRevisionData']({'revision':_0x227aee,'from':_0x6b452d,'to':_0x388d83});_0xedc4c1['id']=_0x227aee['id'];const _0x580193=_0xedc4c1['authorsIds']['map'](_0x3f7a74=>_0x550dec['getUser'](_0x3f7a74));_0x227aee['_update']({..._0xedc4c1,'authors':_0x580193},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x227aee['id'],_0xedc4c1,!0x0);}this['_revisionTracker']['_startingVersion']=_0x388d83,(_0x227aee['toVersion']===_0x227aee['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x536226)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x536226),this['_revisionTracker']['_createCurrentRevision'](_0x388d83));}const {revisions:_0x3afdb2,requestId:_0x2c4e9e}=await this['_revisionHistoryService']['reconnect'](_0x152031['connection'],this['_lastRequestId']);_0x126111&&_0x3afdb2['length']>0x0?_0x27ef6e['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3afdb2),this['_handleRevisionsUpdate'](_0x3afdb2,_0x2c4e9e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x27ef6e['_isConnected']?_0x208975():new Promise((_0x2df59b,_0xc0203b)=>{_0x27ef6e['once']('change:_isConnected',()=>{_0x208975()['then'](_0x2df59b)['catch'](_0xc0203b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x110b75=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3cbb03=>{_0x3cbb03['off'](),_0x110b75();});});}['_getLatestVersionFromServerOperations'](){const _0x2c7a20=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x397f2b of _0x2c7a20)if('marker'!==_0x397f2b['type']||_0x397f2b['affectsData'])return _0x397f2b['baseVersion']+0x1;}['_getLatestVersion'](){const _0x27d054=this['editor']['plugins']['get'](l);return new Promise(_0x14a9c1=>{_0x27d054['_isPendingUpdate']?_0x27d054['once']('change:_isPendingUpdate',()=>{_0x14a9c1(this['_getLatestVersionFromServerOperations']());}):_0x14a9c1(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x45a48e,_0x5d565c){const _0x4c6a41=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5d565c;for(const _0x371882 of _0x45a48e){const _0x4d5971=_0x4c6a41['getRevision'](_0x371882['id']);if(_0x4d5971){if((_0x371882['fromVersion']||_0x371882['toVersion'])&&(_0x371882['diffData']=null),_0x4d5971===this['_revisionTracker']['currentRevision']){const _0x285886=Math['max'](_0x4d5971['toVersion'],_0x371882['toVersion']),_0x815b5a=Math['max'](_0x4d5971['fromVersion'],_0x371882['fromVersion']);let _0x2c8ead;_0x4d5971['toVersion']===_0x371882['toVersion']&&_0x4d5971['fromVersion']===_0x371882['fromVersion']?(_0x2c8ead=!0x0,this['_preventResendingRevisionData'](_0x371882)):_0x371882['toVersion']===_0x285886&&_0x371882['fromVersion']===_0x815b5a?_0x2c8ead=!0x1:(_0x4d5971['toVersion']===_0x285886&&_0x4d5971['fromVersion']===_0x815b5a||this['_fixRevision']({'revision':_0x4d5971,'from':_0x815b5a,'to':_0x285886}),_0x2c8ead=!0x0),_0x2c8ead&&(delete _0x371882['fromVersion'],delete _0x371882['toVersion'],delete _0x371882['diffData'],delete _0x371882['createdAt'],delete _0x371882['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x371882),this['_preventResendingRevisionData'](_0x371882);}else this['_revisionTracker']['addRevisionData'](_0x371882);}const _0x401ef6=_0x4c6a41['getRevisions']();_0x401ef6['reverse']();for(let _0x2b8f75=0x0;_0x2b8f75<_0x401ef6['length']-0x1;_0x2b8f75++){const _0x2cd407=_0x401ef6[_0x2b8f75],_0x1451ce=_0x401ef6[_0x2b8f75+0x1];if(_0x2cd407['fromVersion']<_0x1451ce['toVersion']){const _0x54210b=_0x1451ce['toVersion'],_0x363342=Math['max'](_0x54210b,_0x2cd407['toVersion']);this['_fixRevision']({'revision':_0x2cd407,'from':_0x54210b,'to':_0x363342});}}}['_fixRevision']({revision:_0xf931d5,from:_0x29306f,to:_0x37bd7d}={}){const _0x5163db=this['editor']['plugins']['get'](_0x52817f),_0xb5296=this['_revisionTracker']['buildRevisionData']({'revision':_0xf931d5,'from':_0x29306f,'to':_0x37bd7d});_0xb5296['authors']=_0xb5296['authorsIds']['map'](_0x4a8509=>_0x5163db['getUser'](_0x4a8509)),_0xf931d5['_update'](_0xb5296);}['_preventResendingRevisionData'](_0xa41796){const _0x38e86e={};_0x38e86e['id']=_0xa41796['id'];for(const _0x1b9fbe of Object['keys'](_0xa41796))'id'!==_0x1b9fbe&&(_0x38e86e[_0x1b9fbe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x38e86e['id'],_0x38e86e,!0x0);}async['_fetchMissingUsers'](_0x168ec2){const _0x37ae24=this['editor']['plugins']['get'](_0x52817f),{connection:_0xeb3e0f}=this['editor']['plugins']['get'](c),_0x28eaec=new Set();for(const _0x1ae8b4 of _0x168ec2){for(const _0x45dda2 of _0x1ae8b4['authorsIds'])_0x46079e(_0x45dda2);_0x1ae8b4['creatorId']&&_0x46079e(_0x1ae8b4['creatorId']);}if(0x0===_0x28eaec['size'])return;const _0x301a3e=await dt['getMany'](_0xeb3e0f,Array['from'](_0x28eaec));for(const _0x126184 of _0x301a3e)_0x37ae24['getUser'](_0x126184['id'])||_0x37ae24['addUser'](_0x126184);function _0x46079e(_0x1be03c){_0x37ae24['getUser'](_0x1be03c)||_0x28eaec['add'](_0x1be03c);}}}function st(_0x169f40){return _0x169f40['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x169f40['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x169f40['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x574e71{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 _0x15e6ea{constructor(_0xc7e157){super(_0xc7e157);const _0x49c1e3=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x49c1e3['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x49c1e3['to']('usersCount',_0x38c6e=>q(_0xc7e157,'CONNECTED_USERS',_0x38c6e))}]});}}class es extends _0x15e6ea{['items'];['keystrokes'];constructor(_0x1c9a78){super(_0x1c9a78);const _0x3deb54=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2aa4bd(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x3deb54['if']('hasPopup'),'aria-expanded':_0x3deb54['to']('isExpanded',_0x5e1c73=>this['hasPopup']&&String(_0x5e1c73)),'aria-label':_0x3deb54['to']('hasPopup',_0x11fb8a=>q(_0x1c9a78,_0x11fb8a?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x3deb54['to']('hasPopup',_0x122ca1=>!!_0x122ca1&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x3deb54['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x209aba,_0x1a1d50,_0x3c0c99)=>{this['element']&&(_0x3c0c99?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class _ extends _0x15e6ea{['counterView'];['inlineListView'];constructor(_0x3f32fe){super(_0x3f32fe);const _0x190f82=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x3f32fe),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x59221d of this['inlineListView']['items'])_0x59221d['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',_0x190f82['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class M extends _0x15e6ea{['listWrapperView'];constructor(_0x498067,_0x1bc557){super(_0x498067),this['listWrapperView']=new mt(_0x498067,_0x1bc557),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x498067,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x2fe358{constructor(_0x45dab0,_0x1a8d20){super(_0x45dab0);const _0x363157=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x1a8d20?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x363157['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x363157['to']('role'),'aria-label':_0x363157['to']('ariaLabel'),'aria-labelledby':_0x363157['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x58c4bd['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1372ae=this['element'];_0x1372ae&&(this['_isScrollable']=Math['max'](_0x1372ae['scrollHeight'],_0x1372ae['clientHeight'])>0.8*window['innerHeight']);}}class E extends rt{['userView'];constructor(_0x59bb31,_0x107497,_0x1fabea){super(_0x59bb31);const _0x1df495=this['bindTemplate'];this['userView']=new ct(_0x59bb31,_0x107497);const _0x36cd99={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x107497['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x107497['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x107497['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x1fabea&&(_0x36cd99['tag']='button',_0x36cd99['on']={'click':_0x1df495['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x36cd99);}['focus'](){this['element']['focus']();}}class T extends _0x15e6ea{['userView'];['markerView'];constructor(_0x840265,_0x5a12ed,_0x3a0e41){super(_0x840265);const _0xaa45d6=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x840265,_0x5a12ed),this['markerView']=new at(_0x840265,_0x5a12ed);const _0x264655=new ot(_0x840265);_0x264655['template']['tag']='span',_0x264655['text']=_0x5a12ed['name'];const _0x3935c9={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0xaa45d6['to']('isFocusable',_0x22394a=>!!_0x22394a&&0x0),'aria-labelledby':_0x264655['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0xaa45d6['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0xaa45d6['to']('hasTooltip',_0x10c60e=>!_0x10c60e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x264655]};_0x3a0e41&&(_0x3935c9['tag']='button',_0x3935c9['on']={'click':_0xaa45d6['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3935c9);}}class at extends _0x15e6ea{constructor(_0x4942bb,_0x4fdf0e){super(_0x4942bb),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4fdf0e['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const D={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x5fba94{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x5727af){super(_0x5727af),this['context']['config']['define']('presenceList',D);const _0x369aeb=_0x5727af['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x369aeb)throw new _0x363645('presencelist-collapseat-invalid-format',this);if(_0x369aeb<0x1)throw new _0x363645('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4ecba4(),this['balloonPanelView']=new _0x34d9ef(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0xbee7a2 of this['_allConnectedUsers'])this['_handleUserAdd'](_0xbee7a2);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5bb70e,_0x5d5729)=>{this['_handleUserAdd'](_0x5d5729);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2c1fce,_0x150f8d)=>{this['_handleUserRemove'](_0x150f8d);});}['_createView'](){const _0x2a0477=this['context'],_0x34091d=new _(this['context']['locale']),_0x3f168e=this['balloonPanelView'];if(!_0x1104a8(_0x2a0477['config']['get']('presenceList.container')))throw new _0x363645('presencelist-missing-container',this);return _0x34091d['counterView']['bind']('usersCount')['to'](this),_0x34091d['bind']('isCollapsed')['to'](this,'usersCount',_0x16f051=>{const {collapseAt:_0x295594,displayMe:_0x5bb7de}=_0x2a0477['config']['get']('presenceList'),_0x3d1b5b=_0x16f051>=_0x295594;return _0x34091d['counterView']['isHidden']=!(0x1==_0x16f051&&_0x5bb7de||_0x3d1b5b),_0x3d1b5b||this['hideDropdown'](),_0x3d1b5b;}),_0x34091d['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xcfe2d2=>{const _0x36d76c=_0x2a0477['config']['get']('presenceList'),_0x2b0f74=new T(_0x2a0477['locale'],_0xcfe2d2,!!_0x36d76c['onClick']);return _0x2b0f74['bind']('hasTooltip')['to'](_0x34091d,'isCollapsed',_0x60c946=>!_0x60c946),_0x2b0f74['bind']('isFocusable')['to'](_0x34091d,'isCollapsed',_0x510370=>!_0x510370),_0x36d76c['onClick']&&this['listenTo'](_0x2b0f74,'execute',()=>{this['view']['isCollapsed']||_0x36d76c['onClick'](_0xcfe2d2,_0x2b0f74['element']);}),_0x2b0f74;}),this['listenTo'](_0x34091d['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x34091d['inlineListView']['keystrokes']['set']('Enter',(_0x38269d,_0x3854e8)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3854e8());}),_0x34091d['render'](),_0x3f168e['render'](),_0x538008({'emitter':_0x34091d,'activator':()=>_0x3f168e['isVisible'],'contextElements':[_0x3f168e['element'],_0x34091d['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x2a0477['config']['get']('presenceList.container')['appendChild'](_0x34091d['element']),this['_bodyCollection']=new _0x11f100(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x34091d;}['_handleUserAdd'](_0x440e62){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x440e62['isMe'])return;const _0x4fa724=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x4fa724&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x282f9f=_0x440e62['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x440e62,_0x282f9f);}['_handleUserRemove'](_0xeb950e){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0xeb950e['id'])&&(this['currentDisplayedUsers']['remove'](_0xeb950e['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x329a68 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x329a68['id']))return void this['currentDisplayedUsers']['add'](_0x329a68,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x215475=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new M(this['context']['locale'],!!_0x215475['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x36482f}=this['presenceDropdownView'];_0x36482f['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x222ad8=>{if(!_0x215475['displayMe']&&_0x222ad8['isMe'])return null;const _0x751621=new E(this['context']['locale'],_0x222ad8,!!_0x215475['onClick']);return _0x215475['onClick']&&this['listenTo'](_0x751621,'execute',()=>{_0x215475['onClick'](_0x222ad8,_0x751621['element']);}),_0x751621;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x36482f['focus'](),_0x36482f['checkIfScrollable']();const _0x5480a8=(_0x18b83b,_0x34a486)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x34a486();};_0x36482f['keystrokes']['set']('Esc',_0x5480a8),_0x36482f['keystrokes']['set']('Shift+Tab',_0x5480a8),_0x36482f['keystrokes']['set']('Tab',(_0xaeab9b,_0x520056)=>{!function(_0x34b2e1){const _0x13fc5c=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x201134=>_0x201134+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3c1be=[...document['body']['querySelectorAll'](_0x13fc5c)]['filter'](_0x39b001=>_0x39b001===document['activeElement']||_0x39b001['offsetWidth']+_0x39b001['offsetHeight']>0x0)['sort']((_0x7e9c03,_0x4e9a5b)=>(_0x7e9c03['tabIndex']||0x0)-(_0x4e9a5b['tabIndex']||0x0)),_0x20e9bb=_0x3c1be['indexOf'](_0x34b2e1),_0x403d3c=_0x3c1be[(_0x20e9bb+0x1)%_0x3c1be['length']];_0x403d3c&&_0x403d3c['focus']();}(this['view']['element']),this['hideDropdown'](),_0x520056();}),_0x36482f['focusTracker']['add'](this['view']['element']),_0x36482f['focusTracker']['on']('change:isFocused',(_0xf77787,_0x59a41c,_0x5c317f)=>{_0x5c317f||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 _0x5fba94{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};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module real-time-collaboration/presencelist/presencelistui
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import Sessions from '../realtimecollaborativeediting/sessions.js';
|
|
15
|
+
/**
|
|
16
|
+
* The `PresenceListUI` plugin is a part of the {@link module:real-time-collaboration/presencelist~PresenceList}
|
|
17
|
+
* and handles the UI part of the plugin.
|
|
18
|
+
*
|
|
19
|
+
* The presence list UI has two main modes of displaying users list:
|
|
20
|
+
*
|
|
21
|
+
* * inline (default), which shows users next to each other, and
|
|
22
|
+
* * collapsed, which shows users in a dropdown.
|
|
23
|
+
*
|
|
24
|
+
* By default, the list also displays the {@link module:collaboration-core/users~Users#me local user}.
|
|
25
|
+
*/
|
|
26
|
+
export default class PresenceListUI extends ContextPlugin {
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
constructor(context: Context | Editor);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get requires(): readonly [typeof Sessions];
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
init(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Creates and shows dropdown list with all connected users.
|
|
41
|
+
*/
|
|
42
|
+
showDropdown(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Hides and destroys dropdown list with all connected users.
|
|
45
|
+
*/
|
|
46
|
+
hideDropdown(): void;
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
destroy(): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
11
|
+
export default class PresenceCounterView extends View {
|
|
12
|
+
usersCount: number;
|
|
13
|
+
isHidden: boolean;
|
|
14
|
+
constructor(locale: Locale);
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { ListItemView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
11
|
+
import { UserView, type User } from 'ckeditor5-collaboration/src/collaboration-core.js';
|
|
12
|
+
export default class PresenceDropdownListItemView extends ListItemView {
|
|
13
|
+
userView: UserView;
|
|
14
|
+
constructor(locale: Locale, user: User, isButton: boolean);
|
|
15
|
+
/**
|
|
16
|
+
* Focuses the list item.
|
|
17
|
+
*/
|
|
18
|
+
focus(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module real-time-collaboration/presencelist/view/presencedropdownlistview
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ListView, View } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
/**
|
|
16
|
+
* `PresenceDropdownListView` is a view that represents the dropdown variant of users list.
|
|
17
|
+
*
|
|
18
|
+
* It is displayed when the user count is equal to or greater than the value specified in
|
|
19
|
+
* {@link module:real-time-collaboration/config~PresenceListConfig#collapseAt `config.presenceList.collapseAt`}.
|
|
20
|
+
*/
|
|
21
|
+
export default class PresenceDropdownListView extends View {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
constructor(locale: Locale, isButtonsList?: boolean);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Wrapper view for the presence dropdown list.
|
|
29
|
+
*/
|
|
30
|
+
export declare class PresenceDropdownListWrapperView extends ListView {
|
|
31
|
+
constructor(locale: Locale, isButtonsList?: boolean);
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
render(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
11
|
+
import { UserView, type User } from 'ckeditor5-collaboration/src/collaboration-core.js';
|
|
12
|
+
export default class PresenceInlineListItemView extends View {
|
|
13
|
+
isFocusable: boolean;
|
|
14
|
+
hasTooltip: boolean;
|
|
15
|
+
tooltipPosition: string;
|
|
16
|
+
userView: UserView;
|
|
17
|
+
markerView: MarkerView;
|
|
18
|
+
constructor(locale: Locale, user: User, isButton: boolean);
|
|
19
|
+
}
|
|
20
|
+
declare class MarkerView extends View {
|
|
21
|
+
constructor(locale: Locale, user: User);
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { View, type FocusableView, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import type PresenceInlineListItemView from './presenceinlinelistitemview.js';
|
|
11
|
+
import { KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
12
|
+
export default class PresenceInlineListView extends View implements FocusableView {
|
|
13
|
+
/**
|
|
14
|
+
* The collection of `PresenceInlineListItemView` instances.
|
|
15
|
+
*/
|
|
16
|
+
readonly items: ViewCollection<PresenceInlineListItemView>;
|
|
17
|
+
/**
|
|
18
|
+
* The keystroke handler for the presence inline list view.
|
|
19
|
+
*/
|
|
20
|
+
readonly keystrokes: KeystrokeHandler;
|
|
21
|
+
/**
|
|
22
|
+
* Indicates whether the element has popup.
|
|
23
|
+
*/
|
|
24
|
+
hasPopup: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Indicates whether the presence inline list view is expanded or not.
|
|
27
|
+
*/
|
|
28
|
+
isExpanded: boolean;
|
|
29
|
+
constructor(locale: Locale);
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
focus(): void;
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
render(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module real-time-collaboration/presencelist/view/presencelistview
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
import '../../../theme/presencelist.css';
|
|
16
|
+
/**
|
|
17
|
+
* `PresenceListView` is the default view for the presence list. It shows the inline list of users, and an optional user counter.
|
|
18
|
+
*/
|
|
19
|
+
export default class PresenceListView extends View {
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
constructor(locale: Locale);
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module real-time-collaboration/presencelist
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ContextPlugin } from 'ckeditor5/src/core.js';
|
|
14
|
+
import Sessions from './realtimecollaborativeediting/sessions.js';
|
|
15
|
+
import PresenceListUI from './presencelist/presencelistui.js';
|
|
16
|
+
/**
|
|
17
|
+
* The `PresenceList` plugin provides a UI which displays all {@link module:collaboration-core/users~Users users} that are
|
|
18
|
+
* currently connected to the edited document. The users are displayed as a row of avatars.
|
|
19
|
+
* The information about the users is provided by {@glink @cs developer-resources/security/token-endpoint#user CKEditor Cloud Services}.
|
|
20
|
+
*
|
|
21
|
+
* The presence list UI collapses to a dropdown if six or more users are connected.
|
|
22
|
+
*/
|
|
23
|
+
export default class PresenceList extends ContextPlugin {
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): readonly [typeof Sessions, typeof PresenceListUI];
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static get pluginName(): "PresenceList";
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
static get isOfficialPlugin(): true;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
static get isPremiumPlugin(): true;
|
|
40
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module real-time-collaboration/realtimecollaborativecomments/cloudservicescommentsadapter
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { Context, ContextPlugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import { Users } from 'ckeditor5-collaboration/src/collaboration-core.js';
|
|
15
|
+
import { CommentsService } from '@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';
|
|
16
|
+
import WebSocketGateway, { type ReconnectContextPlugin } from '../realtimecollaborativeediting/websocketgateway.js';
|
|
17
|
+
import Sessions from '../realtimecollaborativeediting/sessions.js';
|
|
18
|
+
/**
|
|
19
|
+
* The Cloud Services Comments Adapter plugin.
|
|
20
|
+
*
|
|
21
|
+
* Visit the {@glink features/collaboration/context-and-collaboration-features Context and Collaboration Features} guide
|
|
22
|
+
* to learn how to use it.
|
|
23
|
+
*/
|
|
24
|
+
export default class CloudServicesCommentsAdapter extends ContextPlugin implements ReconnectContextPlugin {
|
|
25
|
+
static CommentsService: typeof CommentsService;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): readonly [typeof WebSocketGateway, "CommentsRepository", typeof Sessions, typeof Users];
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get pluginName(): "CloudServicesCommentsAdapter";
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static get isOfficialPlugin(): true;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get isPremiumPlugin(): true;
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
constructor(context: Editor | Context);
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
init(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* @inheritDoc
|
|
52
|
+
*/
|
|
53
|
+
destroy(): void;
|
|
54
|
+
/**
|
|
55
|
+
* A method that will be executed when the `WebSocketGateway` will reconnect.
|
|
56
|
+
*/
|
|
57
|
+
reconnect(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* It connects a service for the given channel ID to the WebSocket and synchronizes local comments (`CommentsRepository`)
|
|
60
|
+
* with remote comments (the `service.connect()`'s response).
|
|
61
|
+
*/
|
|
62
|
+
private _connectService;
|
|
63
|
+
private _fetchMissingUsersForThreads;
|
|
64
|
+
}
|