UNPKG

@ckeditor/ckeditor5-real-time-collaboration

Version:

A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.

24 lines 8.24 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x231e1f=_0x35cb;(function(_0x305601,_0x1eb23d){const _0x1c545e=_0x35cb,_0x3ee7c4=_0x305601();while(!![]){try{const _0x55723d=parseInt(_0x1c545e(0xa0))/0x1*(-parseInt(_0x1c545e(0x95))/0x2)+parseInt(_0x1c545e(0x89))/0x3+-parseInt(_0x1c545e(0x86))/0x4*(parseInt(_0x1c545e(0x7e))/0x5)+-parseInt(_0x1c545e(0xa7))/0x6*(-parseInt(_0x1c545e(0x76))/0x7)+-parseInt(_0x1c545e(0x9f))/0x8*(parseInt(_0x1c545e(0xac))/0x9)+parseInt(_0x1c545e(0x74))/0xa+parseInt(_0x1c545e(0x7c))/0xb;if(_0x55723d===_0x1eb23d)break;else _0x3ee7c4['push'](_0x3ee7c4['shift']());}catch(_0x21a881){_0x3ee7c4['push'](_0x3ee7c4['shift']());}}}(_0x5f20,0x1ac04));import{Plugin as _0x14be4d}from'ckeditor5/src/core.js';import{User as _0x5e4479,TrackChangesService as _0x58a2a0}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';import{WebSocketGateway as _0x34435d}from'../realtimecollaborativeediting/websocketgateway.js';import{CloudServicesCommentsAdapter as _0x370b77}from'../realtimecollaborativecomments/cloudservicescommentsadapter.js';function _0x35cb(_0x2feee1,_0x414204){const _0x5f20cf=_0x5f20();return _0x35cb=function(_0x35cb01,_0x5e14fd){_0x35cb01=_0x35cb01-0x71;let _0x2d13bf=_0x5f20cf[_0x35cb01];return _0x2d13bf;},_0x35cb(_0x2feee1,_0x414204);}import{Users as _0x305d19}from'ckeditor5-collaboration/src/collaboration-core.js';export class CloudServicesTrackChangesAdapter extends _0x14be4d{static [_0x231e1f(0x72)]=/* #__PURE__ -- @preserve */ ((()=>_0x58a2a0)());[_0x231e1f(0xab)];[_0x231e1f(0x71)];static get[_0x231e1f(0xa2)](){const _0x2a6626=_0x231e1f;return[_0x370b77,_0x2a6626(0x7d),_0x34435d];}static get[_0x231e1f(0x9c)](){const _0x19e0d4=_0x231e1f;return _0x19e0d4(0x87);}static get[_0x231e1f(0xa6)](){return!0x0;}static get[_0x231e1f(0x99)](){return!0x0;}constructor(_0x3536fb){const _0x8a60b1=_0x231e1f;super(_0x3536fb);const _0x36e4dd=this[_0x8a60b1(0x75)][_0x8a60b1(0xaf)][_0x8a60b1(0x96)](_0x8a60b1(0x93));this[_0x8a60b1(0xab)]=new Map(),this[_0x8a60b1(0x71)]=new CloudServicesTrackChangesAdapter[(_0x8a60b1(0x72))](_0x36e4dd);}[_0x231e1f(0x73)](){const _0x129257=_0x231e1f,_0x2482ec=this[_0x129257(0x75)][_0x129257(0x7a)][_0x129257(0x96)](_0x34435d),_0xb019ee=this[_0x129257(0x75)][_0x129257(0x7a)][_0x129257(0x96)](_0x129257(0x7d));return _0xb019ee[_0x129257(0xad)]={'getSuggestion':async _0xdc637d=>{const _0x4af59d=_0x129257;await this[_0x4af59d(0x92)]();const _0x5b3d93=await this[_0x4af59d(0x71)][_0x4af59d(0x96)](_0xdc637d)[_0x4af59d(0x77)](k);return await this[_0x4af59d(0x94)]([_0x5b3d93]),_0x5b3d93;},'addSuggestion':async({id:_0x55bdcf,type:_0x59624e,data:_0x46d9ef,originalSuggestionId:_0xdf93a0,attributes:_0x1bf5e3})=>{const _0xc5488e=_0x129257;await this[_0xc5488e(0x92)]();const _0x534923={'id':_0x55bdcf,'type':_0x59624e,'data':_0x46d9ef,'originalSuggestionId':_0xdf93a0,'attributes':_0x1bf5e3},_0x2b17a6=await this[_0xc5488e(0x71)][_0xc5488e(0x7f)](_0x55bdcf,_0x59624e,_0x46d9ef,_0xdf93a0,_0x1bf5e3)[_0xc5488e(0x77)](_0x2bd064=>{if(_(_0x2bd064))return new Promise(_0x52d490=>{const _0x465158=_0x35cb;this[_0x465158(0xab)][_0x465158(0x80)](_0x55bdcf,{'resolve':_0x52d490,'suggestionData':_0x534923});});throw _0x2bd064;});return this[_0xc5488e(0xab)][_0xc5488e(0x90)](_0x55bdcf),_0x2b17a6;},'updateSuggestion':async(_0x249ebe,_0x5d2819)=>{const _0x1e74a7=_0x129257;if(await this[_0x1e74a7(0x92)](),_0x1e74a7(0x9d)!==_0x5d2819[_0x1e74a7(0x79)])return this[_0x1e74a7(0x71)][_0x1e74a7(0x8b)](_0x249ebe,_0x5d2819)[_0x1e74a7(0x77)](k);}},this[_0x129257(0x84)](this[_0x129257(0x71)],_0x129257(0x85),(_0x25fac1,_0x2a4f08)=>{const _0x5cd774=_0x129257;_0xb019ee[_0x5cd774(0xa9)](_0x2a4f08['id'])&&(_0xb019ee[_0x5cd774(0x7b)](_0x2a4f08['id'])[_0x5cd774(0x83)]=_0x2a4f08[_0x5cd774(0x83)]);}),this[_0x129257(0x71)][_0x129257(0xaa)](_0x2482ec[_0x129257(0x8f)])[_0x129257(0x82)](_0x38bede=>(_0x2482ec[_0x129257(0xa4)](this),this[_0x129257(0x94)](_0x38bede)[_0x129257(0x82)](()=>{const _0x27e48d=_0x129257;for(const _0x1e0d2c of _0x38bede){_0xb019ee[_0x27e48d(0x98)](_0x1e0d2c)[_0x27e48d(0x9b)]=!0x0;}})));}async[_0x231e1f(0x8a)](){const _0x5edded=_0x231e1f,_0xede1bf=this[_0x5edded(0x75)][_0x5edded(0x7a)][_0x5edded(0x96)](_0x5edded(0x7d)),{connection:_0x588116}=this[_0x5edded(0x75)][_0x5edded(0x7a)][_0x5edded(0x96)](_0x34435d),_0x32e951=await this[_0x5edded(0x71)][_0x5edded(0xaa)](_0x588116);await this[_0x5edded(0x94)](_0x32e951);for(const {suggestionData:_0x377134,resolve:_0xe04c53}of this[_0x5edded(0xab)][_0x5edded(0x78)]()){let _0x5d660f=_0x32e951[_0x5edded(0x91)](_0x17b7d7=>_0x17b7d7['id']===_0x377134['id']);_0x5d660f||(_0x5d660f=await this[_0x5edded(0x71)][_0x5edded(0x7f)](_0x377134['id'],_0x377134[_0x5edded(0xa5)],_0x377134[_0x5edded(0x9e)],_0x377134[_0x5edded(0x9a)])),_0xe04c53(_0x5d660f);}for(const _0x1c7d27 of _0x32e951)_0xede1bf[_0x5edded(0xa9)](_0x1c7d27['id'])||_0xede1bf[_0x5edded(0x98)](_0x1c7d27);}async[_0x231e1f(0x92)](){const _0x363054=_0x231e1f;this[_0x363054(0x71)][_0x363054(0xb0)]||await new Promise(_0x648c00=>{const _0x3cfccc=_0x363054;this[_0x3cfccc(0x84)](this[_0x3cfccc(0x71)],_0x3cfccc(0x8e),_0x369d38=>{const _0x1cf308=_0x3cfccc;_0x369d38[_0x1cf308(0xa8)](),_0x648c00();});});}async[_0x231e1f(0x94)](_0x264dd8){const _0x351767=_0x231e1f,_0x4d2ed5=this[_0x351767(0x75)][_0x351767(0x7a)][_0x351767(0x96)](_0x305d19),{connection:_0x1b3edf}=this[_0x351767(0x75)][_0x351767(0x7a)][_0x351767(0x96)](_0x34435d),_0x1b21eb=new Set();for(const {authorId:_0x18581c}of _0x264dd8)_0x4d2ed5[_0x351767(0x8c)](_0x18581c)||_0x1b21eb[_0x351767(0x7f)](_0x18581c);if(0x0===_0x1b21eb[_0x351767(0xa1)])return;const _0x3bcaf3=await _0x5e4479[_0x351767(0x97)](_0x1b3edf,Array[_0x351767(0x88)](_0x1b21eb));for(const _0x565b12 of _0x3bcaf3)_0x4d2ed5[_0x351767(0x8c)](_0x565b12['id'])||_0x4d2ed5[_0x351767(0x81)](_0x565b12);}}function k(_0x1e17ef){if(_(_0x1e17ef))return new Promise(()=>{});throw _0x1e17ef;}function _0x5f20(){const _0x1b0df9=['pluginName','open','data','720760lPLsht','7fUMevc','size','requires','message','addToReconnectionStack','type','isOfficialPlugin','4818BmZbpa','off','hasSuggestion','connect','_bufferedRequests','9bEJxov','adapter','startsWith','config','isConnected','cloud-services-internal-error:\x20Request\x20timeout.','_trackChangesService','TrackChangesService','init','285780dTtHIg','editor','560isPDQF','catch','values','state','plugins','getSuggestion','4170705hsdZXz','TrackChangesEditing','5dudBEq','add','set','addUser','then','attributes','listenTo','suggestionUpdated','589040yISLwg','CloudServicesTrackChangesAdapter','from','261330Xuomgt','reconnect','update','getUser','cloud-services-internal-error:\x20Not\x20connected.','connected','connection','delete','find','_waitForServiceReady','collaboration.channelId','_fetchMissingUsersForThreads','60616DYheoO','get','getMany','addSuggestionData','isPremiumPlugin','originalSuggestionId','_saved'];_0x5f20=function(){return _0x1b0df9;};return _0x5f20();}function _(_0x28d566){const _0x3926bb=_0x231e1f;return _0x28d566[_0x3926bb(0xa3)][_0x3926bb(0xae)](_0x3926bb(0x8d))||_0x28d566[_0x3926bb(0xa3)][_0x3926bb(0xae)](_0x3926bb(0xb1));}