@ckeditor/ckeditor5-operations-compressor 36.0.1 → 37.0.0-rc.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.
Files changed (40) hide show
  1. package/package.json +14 -4
  2. package/src/actioncompressor/actioncompressor.d.ts +56 -0
  3. package/src/actioncompressor/actioncompressor.js +1 -1
  4. package/src/actioncompressor/deletingactioncompressor.d.ts +24 -0
  5. package/src/actioncompressor/deletingactioncompressor.js +1 -1
  6. package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +24 -0
  7. package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
  8. package/src/actioncompressor/typingactioncompressor.d.ts +24 -0
  9. package/src/actioncompressor/typingactioncompressor.js +1 -1
  10. package/src/actioncompressor/userselectionactioncompressor.d.ts +12 -0
  11. package/src/actioncompressor/userselectionactioncompressor.js +1 -1
  12. package/src/compressor.d.ts +41 -0
  13. package/src/compressor.js +1 -1
  14. package/src/lib/compiledmessages.d.ts +1435 -0
  15. package/src/lib/compiledmessages.js +23 -0
  16. package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +18 -0
  17. package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
  18. package/src/operationcompressor/attributeoperationcompressor.d.ts +13 -0
  19. package/src/operationcompressor/attributeoperationcompressor.js +1 -1
  20. package/src/operationcompressor/insertoperationcompressor.d.ts +13 -0
  21. package/src/operationcompressor/insertoperationcompressor.js +1 -1
  22. package/src/operationcompressor/markeroperationcompressor.d.ts +9 -0
  23. package/src/operationcompressor/markeroperationcompressor.js +1 -1
  24. package/src/operationcompressor/nooperationcompressor.d.ts +16 -0
  25. package/src/operationcompressor/nooperationcompressor.js +1 -1
  26. package/src/operationcompressor/operationcompressor.d.ts +24 -0
  27. package/src/operationcompressor/operationcompressor.js +1 -1
  28. package/src/protobufdescriptions.d.ts +12 -0
  29. package/src/protobufdescriptions.js +23 -0
  30. package/src/protobuffactory.d.ts +1 -0
  31. package/src/protobuffactory.js +1 -1
  32. package/src/utils.d.ts +26 -0
  33. package/src/utils.js +1 -1
  34. package/src/commondescriptions.js +0 -23
  35. package/src/errors.jsdoc +0 -18
  36. package/src/operationcompressor/mergeoperationcompressor.js +0 -23
  37. package/src/operationcompressor/moveoperationcompressor.js +0 -23
  38. package/src/operationcompressor/renameoperationcompressor.js +0 -23
  39. package/src/operationcompressor/rootattributeoperationcompressor.js +0 -23
  40. package/src/operationcompressor/splitoperationcompressor.js +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-operations-compressor",
3
- "version": "36.0.1",
3
+ "version": "37.0.0-rc.0",
4
4
  "description": "CKEditor 5 operations compressor for real-time collaboration.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://ckeditor.com/collaboration/real-time/",
@@ -27,8 +27,18 @@
27
27
  ],
28
28
  "author": "CKSource (http://cksource.com/)",
29
29
  "dependencies": {
30
- "ckeditor5": "^36.0.1",
30
+ "ckeditor5": "^37.0.0-rc.0",
31
31
  "lodash-es": "^4.17.11",
32
- "protobufjs": "^6.8.8"
33
- }
32
+ "protobufjs": "^7.0.0"
33
+ },
34
+ "files": [
35
+ "src/**/*.js",
36
+ "src/**/*.d.ts",
37
+ "CHANGELOG.md"
38
+ ],
39
+ "scripts": {
40
+ "build": "tsc -p ./tsconfig.json",
41
+ "postversion": "npm run build"
42
+ },
43
+ "obfuscated": true
34
44
  }
@@ -0,0 +1,56 @@
1
+ import type { CompressedOperationsData, default as Compressor } from '../compressor';
2
+ /**
3
+ * * Compresses and decompresses multiple operations into the one buffer.
4
+ */
5
+ export default abstract class ActionCompressor {
6
+ constructor(id: number, context: Compressor);
7
+ /**
8
+ * Combines and compress operations from the list.
9
+ * Operations are consumed as long as match this compressor.
10
+ *
11
+ * @param result Object to which compression result should be added.
12
+ * @param operations List of operations in JSON format to compress.
13
+ * @returns `true` when operation is consumed `false` otherwise.
14
+ */
15
+ compress(result: CompressedOperationsData, operations: Array<any>): boolean;
16
+ /**
17
+ * Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
18
+ *
19
+ * @param result Decompressed operations in JSON format.
20
+ * @param data Compressed operations data.
21
+ */
22
+ decompress(result: Array<any>, data: CompressedOperationsData): void;
23
+ /**
24
+ * Compresses single operation using a proper compressor.
25
+ *
26
+ * @param operation Operation in JSON format.
27
+ * @returns Operation JSON compressed to the binary format.
28
+ */
29
+ protected abstract _compressSingleOperation(operation: any): Uint8Array;
30
+ /**
31
+ * Decompresses combined operation using a proper compressor.
32
+ *
33
+ * @param data Data to compress.
34
+ * @returns Decompressed operation in JSON format.
35
+ */
36
+ protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
37
+ /**
38
+ * Combine next operation into the combined one.
39
+ *
40
+ * @param nextOperation Operation to combine in JSON format.
41
+ * @param combined Combined operation in JSON format.
42
+ * @returns Combined operation in JSON format.
43
+ */
44
+ protected abstract _combineNext(nextOperation: any, combined: any): any;
45
+ /**
46
+ * Split operation from combined one.
47
+ *
48
+ * @param combined Combined operation in JSON format.
49
+ * @returns Split operation in JSON format.
50
+ */
51
+ protected abstract _splitCurrent(combined: any): any;
52
+ /**
53
+ * Checks if two operations can be combined.
54
+ */
55
+ protected abstract _compareOperations(opA: any, opB: any): boolean;
56
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x43a4=['compress','_splitCurrent','buffers','decompress','types','shift','_context','_decompressSingleOperation','push','_combineNext'];(function(_0x8ec5fc,_0x43a46b){const _0x8d228f=function(_0x60faf5){while(--_0x60faf5){_0x8ec5fc['push'](_0x8ec5fc['shift']());}};_0x8d228f(++_0x43a46b);}(_0x43a4,0x89));const _0x8d22=function(_0x8ec5fc,_0x43a46b){_0x8ec5fc=_0x8ec5fc-0x0;let _0x8d228f=_0x43a4[_0x8ec5fc];return _0x8d228f;};import{cloneDeep as _0x561270}from'lodash-es';export default class j{constructor(_0x1d0788,_0x59dfcb){this['id']=_0x1d0788,this[_0x8d22('0x9')]=_0x59dfcb;}[_0x8d22('0x3')](_0x1f1812,_0x52ff3b){let _0x2ec3d4;for(;_0x52ff3b['length']>0x1&&this['_compareOperations'](_0x52ff3b[0x0],_0x52ff3b[0x1]);)_0x2ec3d4?(_0x2ec3d4=this['_combineNext'](_0x52ff3b[_0x8d22('0x8')](),_0x2ec3d4),_0x1f1812[_0x8d22('0x7')]['push'](0x0)):(_0x2ec3d4=_0x561270(_0x52ff3b[_0x8d22('0x8')]()),_0x1f1812[_0x8d22('0x7')][_0x8d22('0x1')](this['id']));return!!_0x2ec3d4&&(_0x2ec3d4=this[_0x8d22('0x2')](_0x52ff3b[_0x8d22('0x8')](),_0x2ec3d4),_0x1f1812[_0x8d22('0x7')][_0x8d22('0x1')](0x0),_0x1f1812[_0x8d22('0x5')][_0x8d22('0x1')](this['_compressSingleOperation'](_0x2ec3d4)),!0x0);}[_0x8d22('0x6')](_0x25eb82,_0x4d227e){const _0x514ee0=this[_0x8d22('0x0')](_0x4d227e);for(;0x0==_0x4d227e[_0x8d22('0x7')][0x0];)_0x4d227e[_0x8d22('0x7')][_0x8d22('0x8')](),_0x25eb82[_0x8d22('0x1')](this[_0x8d22('0x4')](_0x514ee0));_0x25eb82['push'](_0x514ee0);}}
23
+ const _0x54da=['length','_compareOperations','push','_decompressSingleOperation','types','_splitCurrent','shift','_compressSingleOperation','_combineNext','compress','_id'];(function(_0x53fbad,_0x54dade){const _0x521280=function(_0x8986d){while(--_0x8986d){_0x53fbad['push'](_0x53fbad['shift']());}};_0x521280(++_0x54dade);}(_0x54da,0x1c5));const _0x5212=function(_0x53fbad,_0x54dade){_0x53fbad=_0x53fbad-0x0;let _0x521280=_0x54da[_0x53fbad];return _0x521280;};import{cloneDeep as _0x1163ed}from'lodash-es';export default class b{constructor(_0x172647,_0x5dcec5){this[_0x5212('0x8')]=_0x172647,this['_context']=_0x5dcec5;}[_0x5212('0x7')](_0x1cd530,_0x266616){let _0x315bcb;for(;_0x266616[_0x5212('0x9')]>0x1&&this[_0x5212('0xa')](_0x266616[0x0],_0x266616[0x1]);)_0x315bcb?(_0x315bcb=this[_0x5212('0x6')](_0x266616['shift'](),_0x315bcb),_0x1cd530[_0x5212('0x2')][_0x5212('0x0')](0x0)):(_0x315bcb=_0x1163ed(_0x266616[_0x5212('0x4')]()),_0x1cd530[_0x5212('0x2')][_0x5212('0x0')](this[_0x5212('0x8')]));return!!_0x315bcb&&(_0x315bcb=this[_0x5212('0x6')](_0x266616['shift'](),_0x315bcb),_0x1cd530[_0x5212('0x2')][_0x5212('0x0')](0x0),_0x1cd530['buffers'][_0x5212('0x0')](this[_0x5212('0x5')](_0x315bcb)),!0x0);}['decompress'](_0x59b549,_0x30f98f){const _0x263dde=this[_0x5212('0x1')](_0x30f98f);for(;0x0==_0x30f98f[_0x5212('0x2')][0x0];)_0x30f98f[_0x5212('0x2')][_0x5212('0x4')](),_0x59b549['push'](this[_0x5212('0x3')](_0x263dde));_0x59b549[_0x5212('0x0')](_0x263dde);}}
@@ -0,0 +1,24 @@
1
+ import ActionCompressor from './actioncompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ export default class DeletingActionCompressor extends ActionCompressor {
4
+ /**
5
+ * @inheritDoc
6
+ */
7
+ protected _combineNext(nextOperation: any, combined: any): any;
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ protected _splitCurrent(combined: any): any;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ protected _compareOperations(opA: any, opB: any): boolean;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ protected _compressSingleOperation(operation: any): Uint8Array;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ protected _decompressSingleOperation(data: CompressedOperationsData): any;
24
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x21fc=['$graveyard','MoveOperation','root','sourcePosition','compress','_compareOperations','_context','_splitCurrent','targetPosition','_compressSingleOperation','_getCompressorByName','howMany','__className','buffers'];(function(_0x251a79,_0x21fcaa){const _0x2d58ea=function(_0x39ebed){while(--_0x39ebed){_0x251a79['push'](_0x251a79['shift']());}};_0x2d58ea(++_0x21fcaa);}(_0x21fc,0xff));const _0x2d58=function(_0x251a79,_0x21fcaa){_0x251a79=_0x251a79-0x0;let _0x2d58ea=_0x21fc[_0x251a79];return _0x2d58ea;};import _0x2987c0 from'./actioncompressor';import{arePositionsEqual as _0x4424f4,getPositionShiftedBy as _0x19c4aa}from'../utils';import{cloneDeep as _0x150960}from'lodash-es';export default class u extends _0x2987c0{['_combineNext'](_0x540f7b,_0x34d574){return _0x34d574[_0x2d58('0x8')]++,_0x34d574[_0x2d58('0x0')]=_0x150960(_0x540f7b[_0x2d58('0x0')]),_0x34d574;}[_0x2d58('0x4')](_0x5dbb58){const _0x55fa21=_0x150960(_0x5dbb58);return _0x5dbb58[_0x2d58('0x8')]--,_0x55fa21[_0x2d58('0x8')]=0x1,_0x55fa21[_0x2d58('0x0')]=_0x19c4aa(_0x55fa21[_0x2d58('0x0')],_0x5dbb58[_0x2d58('0x8')]),_0x55fa21;}[_0x2d58('0x2')](_0x106053,_0x50baff){return!(!S(_0x106053)||!S(_0x50baff))&&(_0x4424f4(_0x19c4aa(_0x106053[_0x2d58('0x0')],-0x1),_0x50baff[_0x2d58('0x0')])&&_0x4424f4(_0x106053[_0x2d58('0x5')],_0x50baff[_0x2d58('0x5')]));}[_0x2d58('0x6')](_0x458004){const _0x57181c={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x2d58('0x3')][_0x2d58('0x7')](_0x2d58('0xc'))[_0x2d58('0x1')](_0x57181c,[_0x458004]),_0x57181c[_0x2d58('0xa')][0x0];}['_decompressSingleOperation'](_0x53f523){const _0x2e7e37=[];return this['_context'][_0x2d58('0x7')]('MoveOperation')['decompress'](_0x2e7e37,_0x53f523),_0x2e7e37[0x0];}}function S(_0x5c2150){return _0x2d58('0xc')==_0x5c2150[_0x2d58('0x9')]&&_0x2d58('0xb')==_0x5c2150['targetPosition'][_0x2d58('0xd')]&&0x1==_0x5c2150[_0x2d58('0x8')]&&!_0x5c2150['wasUndone'];}
23
+ const _0x63c8=['__className','compress','$graveyard','sourcePosition','targetPosition','wasUndone','_compressSingleOperation','_splitCurrent','_checkOperation','_combineNext','howMany','_getCompressorByName','buffers','decompress','MoveOperation','_context'];(function(_0x408d05,_0x63c800){const _0x2539b7=function(_0x132284){while(--_0x132284){_0x408d05['push'](_0x408d05['shift']());}};_0x2539b7(++_0x63c800);}(_0x63c8,0x173));const _0x2539=function(_0x408d05,_0x63c800){_0x408d05=_0x408d05-0x0;let _0x2539b7=_0x63c8[_0x408d05];return _0x2539b7;};import _0x3c1dcd from'./actioncompressor';import{arePositionsEqual as _0x4f04c3,getPositionShiftedBy as _0x46fbaf}from'../utils';import{cloneDeep as _0x4f72b2}from'lodash-es';export default class c extends _0x3c1dcd{[_0x2539('0x6')](_0x28447c,_0x1d4914){return _0x1d4914[_0x2539('0x7')]++,_0x1d4914[_0x2539('0x0')]=_0x4f72b2(_0x28447c[_0x2539('0x0')]),_0x1d4914;}[_0x2539('0x4')](_0xe9961){const _0x5354ba=_0x4f72b2(_0xe9961);return _0xe9961[_0x2539('0x7')]--,_0x5354ba[_0x2539('0x7')]=0x1,_0x5354ba[_0x2539('0x0')]=_0x46fbaf(_0x5354ba[_0x2539('0x0')],_0xe9961['howMany']),_0x5354ba;}['_compareOperations'](_0x37b307,_0x5feca4){return!(!this[_0x2539('0x5')](_0x37b307)||!this[_0x2539('0x5')](_0x5feca4))&&(_0x4f04c3(_0x46fbaf(_0x37b307['sourcePosition'],-0x1),_0x5feca4[_0x2539('0x0')])&&_0x4f04c3(_0x37b307[_0x2539('0x1')],_0x5feca4[_0x2539('0x1')]));}[_0x2539('0x3')](_0x37b25d){const _0x4873d6={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x2539('0xc')]['_getCompressorByName'](_0x2539('0xb'))[_0x2539('0xe')](_0x4873d6,[_0x37b25d]),_0x4873d6[_0x2539('0x9')][0x0];}['_decompressSingleOperation'](_0x5c9de){const _0x4e87b2=[];return this[_0x2539('0xc')][_0x2539('0x8')](_0x2539('0xb'))[_0x2539('0xa')](_0x4e87b2,_0x5c9de),_0x4e87b2[0x0];}[_0x2539('0x5')](_0x48e6be){return _0x2539('0xb')==_0x48e6be[_0x2539('0xd')]&&_0x2539('0xf')==_0x48e6be[_0x2539('0x1')]['root']&&0x1==_0x48e6be[_0x2539('0x7')]&&!_0x48e6be[_0x2539('0x2')];}}
@@ -0,0 +1,24 @@
1
+ import ActionCompressor from './actioncompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ export default class ForwardDeletingActionCompressor extends ActionCompressor {
4
+ /**
5
+ * @inheritDoc
6
+ */
7
+ protected _combineNext(nextOperation: any, combined: any): any;
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ protected _splitCurrent(combined: any): any;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ protected _compareOperations(opA: any, opB: any): boolean;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ protected _compressSingleOperation(operation: any): Uint8Array;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ protected _decompressSingleOperation(data: CompressedOperationsData): any;
24
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3e43=['_decompressSingleOperation','howMany','_combineNext','decompress','MoveOperation','sourcePosition','_splitCurrent','wasUndone','_compareOperations','_compressSingleOperation','_context','compress','root','buffers','targetPosition','$graveyard'];(function(_0x4d8a09,_0x3e431f){const _0x3e967a=function(_0x2c826b){while(--_0x2c826b){_0x4d8a09['push'](_0x4d8a09['shift']());}};_0x3e967a(++_0x3e431f);}(_0x3e43,0x1aa));const _0x3e96=function(_0x4d8a09,_0x3e431f){_0x4d8a09=_0x4d8a09-0x0;let _0x3e967a=_0x3e43[_0x4d8a09];return _0x3e967a;};import _0x2396a1 from'./actioncompressor';import{arePositionsEqual as _0x4dc739}from'../utils';import{cloneDeep as _0x3ca661}from'lodash-es';export default class l extends _0x2396a1{[_0x3e96('0x8')](_0x1c1678,_0x41633e){return _0x41633e[_0x3e96('0x7')]++,_0x41633e;}[_0x3e96('0xc')](_0x4d79eb){const _0x190660=_0x3ca661(_0x4d79eb);return _0x190660[_0x3e96('0x7')]=0x1,_0x4d79eb[_0x3e96('0x7')]--,_0x190660;}[_0x3e96('0xe')](_0x4c6dd2,_0x45f700){return!(!S(_0x4c6dd2)||!S(_0x45f700))&&(_0x4dc739(_0x4c6dd2[_0x3e96('0xb')],_0x45f700['sourcePosition'])&&_0x4dc739(_0x4c6dd2[_0x3e96('0x4')],_0x45f700[_0x3e96('0x4')]));}[_0x3e96('0xf')](_0x219ea7){const _0x1867a8={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x3e96('0x0')]['_getCompressorByName'](_0x3e96('0xa'))[_0x3e96('0x1')](_0x1867a8,[_0x219ea7]),_0x1867a8[_0x3e96('0x3')][0x0];}[_0x3e96('0x6')](_0x2f6d38){const _0x1c6758=[];return this[_0x3e96('0x0')]['_getCompressorByName'](_0x3e96('0xa'))[_0x3e96('0x9')](_0x1c6758,_0x2f6d38),_0x1c6758[0x0];}}function S(_0x269900){return _0x3e96('0xa')==_0x269900['__className']&&_0x3e96('0x5')==_0x269900[_0x3e96('0x4')][_0x3e96('0x2')]&&0x1==_0x269900[_0x3e96('0x7')]&&!_0x269900[_0x3e96('0xd')];}
23
+ const _0x50e6=['_compareOperations','_getCompressorByName','wasUndone','sourcePosition','__className','_combineNext','targetPosition','_checkOperation','_context','$graveyard','_decompressSingleOperation','root','MoveOperation','_compressSingleOperation','howMany','_splitCurrent'];(function(_0x6e8111,_0x50e6c3){const _0x490635=function(_0x54c0ee){while(--_0x54c0ee){_0x6e8111['push'](_0x6e8111['shift']());}};_0x490635(++_0x50e6c3);}(_0x50e6,0x81));const _0x4906=function(_0x6e8111,_0x50e6c3){_0x6e8111=_0x6e8111-0x0;let _0x490635=_0x50e6[_0x6e8111];return _0x490635;};import _0x27bad0 from'./actioncompressor';import{arePositionsEqual as _0x52a4b3}from'../utils';import{cloneDeep as _0x277371}from'lodash-es';export default class h extends _0x27bad0{[_0x4906('0x4')](_0x2495b0,_0x46230e){return _0x46230e[_0x4906('0xd')]++,_0x46230e;}[_0x4906('0xe')](_0x16eda0){const _0x1d3b9d=_0x277371(_0x16eda0);return _0x1d3b9d[_0x4906('0xd')]=0x1,_0x16eda0['howMany']--,_0x1d3b9d;}[_0x4906('0xf')](_0x4a0dba,_0x5d7f82){return!(!this[_0x4906('0x6')](_0x4a0dba)||!this['_checkOperation'](_0x5d7f82))&&(_0x52a4b3(_0x4a0dba[_0x4906('0x2')],_0x5d7f82[_0x4906('0x2')])&&_0x52a4b3(_0x4a0dba[_0x4906('0x5')],_0x5d7f82[_0x4906('0x5')]));}[_0x4906('0xc')](_0x16e6a1){const _0x1a565a={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x4906('0x7')][_0x4906('0x0')](_0x4906('0xb'))['compress'](_0x1a565a,[_0x16e6a1]),_0x1a565a['buffers'][0x0];}[_0x4906('0x9')](_0x38bd78){const _0x585232=[];return this[_0x4906('0x7')][_0x4906('0x0')](_0x4906('0xb'))['decompress'](_0x585232,_0x38bd78),_0x585232[0x0];}['_checkOperation'](_0x22057b){return _0x4906('0xb')==_0x22057b[_0x4906('0x3')]&&_0x4906('0x8')==_0x22057b['targetPosition'][_0x4906('0xa')]&&0x1==_0x22057b[_0x4906('0xd')]&&!_0x22057b[_0x4906('0x1')];}}
@@ -0,0 +1,24 @@
1
+ import ActionCompressor from './actioncompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ export default class TypingActionCompressor extends ActionCompressor {
4
+ /**
5
+ * @inheritDocs
6
+ */
7
+ protected _combineNext(nextOperation: any, combined: any): any;
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ protected _splitCurrent(combined: any): any;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ protected _compareOperations(opA: any, opB: any): boolean;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ protected _compressSingleOperation(operation: any): Uint8Array;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ protected _decompressSingleOperation(data: CompressedOperationsData): any;
24
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x41b6=['data','next','_compressSingleOperation','attributes','decompress','wasUndone','length','_decompressSingleOperation','_getCompressorByName','nodes','value','buffers','_context','InsertOperation','every','_combineNext','position','_compareOperations','keys','substr'];(function(_0x3d1594,_0x41b678){const _0x35f9c2=function(_0x4113d7){while(--_0x4113d7){_0x3d1594['push'](_0x3d1594['shift']());}};_0x35f9c2(++_0x41b678);}(_0x41b6,0x164));const _0x35f9=function(_0x3d1594,_0x41b678){_0x3d1594=_0x3d1594-0x0;let _0x35f9c2=_0x41b6[_0x3d1594];return _0x35f9c2;};import _0x206378 from'./actioncompressor';import{arePositionsEqual as _0xcbe1c4,getPositionShiftedBy as _0x3e82f7}from'../utils';import{cloneDeep as _0x599f86}from'lodash-es';export default class g extends _0x206378{[_0x35f9('0x13')](_0x379fc9,_0x2897fc){return _0x2897fc[_0x35f9('0xd')][0x0][_0x35f9('0x4')]+=_0x379fc9[_0x35f9('0xd')][0x0][_0x35f9('0x4')],_0x2897fc;}['_splitCurrent'](_0x58dfe9){const _0x18696e=_0x599f86(_0x58dfe9),_0x36ceec=_0x18696e[_0x35f9('0xd')][0x0],_0x91430c=_0x58dfe9[_0x35f9('0xd')][0x0],_0xfc8549=_0x91430c['data'][Symbol['iterator']]()[_0x35f9('0x5')]()[_0x35f9('0xe')],_0x51dec6=_0xfc8549[_0x35f9('0xa')];return _0x36ceec[_0x35f9('0x4')]=_0xfc8549,_0x91430c[_0x35f9('0x4')]=_0x91430c[_0x35f9('0x4')][_0x35f9('0x3')](_0x51dec6),_0x58dfe9[_0x35f9('0x0')]=_0x3e82f7(_0x58dfe9[_0x35f9('0x0')],_0x51dec6),_0x18696e;}[_0x35f9('0x1')](_0x3a227d,_0x13c093){if(S(_0x3a227d)&&S(_0x13c093)){const _0x32918c=_0x3a227d['nodes'][0x0][_0x35f9('0x4')][_0x35f9('0xa')],_0xece04d=_0xcbe1c4(_0x3e82f7(_0x3a227d[_0x35f9('0x0')],_0x32918c),_0x13c093[_0x35f9('0x0')]),_0x28d933=_0x3a227d['nodes'][0x0],_0x27b1f5=_0x13c093[_0x35f9('0xd')][0x0];return _0xece04d&&function(_0x1be417,_0x46807a){const _0x40d97f=Object[_0x35f9('0x2')](_0x1be417[_0x35f9('0x7')]||{}),_0x46adef=Object['keys'](_0x46807a['attributes']||{});if(_0x40d97f[_0x35f9('0xa')]!==_0x46adef[_0x35f9('0xa')])return!0x1;return _0x40d97f[_0x35f9('0x12')](_0x4b8e42=>_0x46807a[_0x35f9('0x7')][_0x4b8e42]&&_0x46807a[_0x35f9('0x7')][_0x4b8e42]===_0x1be417[_0x35f9('0x7')][_0x4b8e42]);}(_0x28d933,_0x27b1f5);}return!0x1;}[_0x35f9('0x6')](_0x5682fc){const _0x3d5a11={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x35f9('0x10')][_0x35f9('0xc')]('InsertOperation')['compress'](_0x3d5a11,[_0x5682fc]),_0x3d5a11[_0x35f9('0xf')][0x0];}[_0x35f9('0xb')](_0x51b612){const _0x200e04=[];return this[_0x35f9('0x10')]['_getCompressorByName'](_0x35f9('0x11'))[_0x35f9('0x8')](_0x200e04,_0x51b612),_0x200e04[0x0];}}function S(_0x2bb77a){return _0x35f9('0x11')==_0x2bb77a['__className']&&0x1==_0x2bb77a[_0x35f9('0xd')]['length']&&_0x2bb77a[_0x35f9('0xd')][0x0]['data']&&!_0x2bb77a[_0x35f9('0x9')]&&0x1==Array['from'](_0x2bb77a[_0x35f9('0xd')][0x0][_0x35f9('0x4')])['length'];}
23
+ const _0x2b07=['iterator','nodes','_compareOperations','position','data','_combineNext','InsertOperation','next','_checkOperation','substr','_compareAttributes','_decompressSingleOperation','length','attributes','__className','decompress','_splitCurrent','value','_getCompressorByName','_context','keys'];(function(_0x510abc,_0x2b072c){const _0x5216db=function(_0x272b05){while(--_0x272b05){_0x510abc['push'](_0x510abc['shift']());}};_0x5216db(++_0x2b072c);}(_0x2b07,0x1b8));const _0x5216=function(_0x510abc,_0x2b072c){_0x510abc=_0x510abc-0x0;let _0x5216db=_0x2b07[_0x510abc];return _0x5216db;};import _0x14308e from'./actioncompressor';import{arePositionsEqual as _0x4fc537,getPositionShiftedBy as _0x5ba88f}from'../utils';import{cloneDeep as _0x49e0ed}from'lodash-es';export default class m extends _0x14308e{[_0x5216('0x6')](_0x12e89a,_0x54aa12){return _0x54aa12[_0x5216('0x2')][0x0]['data']+=_0x12e89a['nodes'][0x0][_0x5216('0x5')],_0x54aa12;}[_0x5216('0x11')](_0x1b94d4){const _0x4acfcc=_0x49e0ed(_0x1b94d4),_0x286923=_0x4acfcc[_0x5216('0x2')][0x0],_0x4f52bb=_0x1b94d4[_0x5216('0x2')][0x0],_0x5aa491=_0x4f52bb[_0x5216('0x5')][Symbol[_0x5216('0x1')]]()[_0x5216('0x8')]()[_0x5216('0x12')],_0x2f924a=_0x5aa491[_0x5216('0xd')];return _0x286923[_0x5216('0x5')]=_0x5aa491,_0x4f52bb[_0x5216('0x5')]=_0x4f52bb[_0x5216('0x5')][_0x5216('0xa')](_0x2f924a),_0x1b94d4['position']=_0x5ba88f(_0x1b94d4['position'],_0x2f924a),_0x4acfcc;}[_0x5216('0x3')](_0x2a0310,_0x1f77b0){if(this[_0x5216('0x9')](_0x2a0310)&&this['_checkOperation'](_0x1f77b0)){const _0x5d7aa8=_0x2a0310[_0x5216('0x2')][0x0]['data'][_0x5216('0xd')],_0x3b7bd0=_0x4fc537(_0x5ba88f(_0x2a0310[_0x5216('0x4')],_0x5d7aa8),_0x1f77b0[_0x5216('0x4')]),_0x10fa8c=_0x2a0310[_0x5216('0x2')][0x0],_0x11d782=_0x1f77b0['nodes'][0x0];return _0x3b7bd0&&this[_0x5216('0xb')](_0x10fa8c,_0x11d782);}return!0x1;}['_compressSingleOperation'](_0x4cbab9){const _0xe671c5={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x5216('0x14')][_0x5216('0x13')](_0x5216('0x7'))['compress'](_0xe671c5,[_0x4cbab9]),_0xe671c5['buffers'][0x0];}[_0x5216('0xc')](_0x448ba1){const _0x4a0077=[];return this[_0x5216('0x14')][_0x5216('0x13')]('InsertOperation')[_0x5216('0x10')](_0x4a0077,_0x448ba1),_0x4a0077[0x0];}[_0x5216('0x9')](_0x1e4003){return'InsertOperation'==_0x1e4003[_0x5216('0xf')]&&0x1==_0x1e4003[_0x5216('0x2')]['length']&&_0x1e4003[_0x5216('0x2')][0x0]['data']&&!_0x1e4003['wasUndone']&&0x1==Array['from'](_0x1e4003[_0x5216('0x2')][0x0]['data'])[_0x5216('0xd')];}['_compareAttributes'](_0x225cc8,_0x24d4b3){const _0x1e5694=Object[_0x5216('0x0')](_0x225cc8[_0x5216('0xe')]||{}),_0x88c92d=Object[_0x5216('0x0')](_0x24d4b3[_0x5216('0xe')]||{});return _0x1e5694[_0x5216('0xd')]===_0x88c92d[_0x5216('0xd')]&&_0x1e5694['every'](_0xc15197=>_0x24d4b3[_0x5216('0xe')][_0xc15197]&&_0x24d4b3['attributes'][_0xc15197]===_0x225cc8[_0x5216('0xe')][_0xc15197]);}}
@@ -0,0 +1,12 @@
1
+ import ActionCompressor from './actioncompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ export default class UserSelectionActionCompressor extends ActionCompressor {
4
+ /**
5
+ * @inheritDoc
6
+ */
7
+ compress(result: CompressedOperationsData, operations: Array<any>): boolean;
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ decompress(result: Array<any>, data: CompressedOperationsData): void;
12
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x46fc=['buffers','_context','MarkerOperation','_compressSingleOperation','__className','toNone','push','decompress','types','end','oldRange','name','startsWith','stickiness','user:','shift','_decompressSingleOperation','start','newRange','compress','_getCompressorByName'];(function(_0x40c028,_0x46fc1f){const _0xe9125c=function(_0x46b2f7){while(--_0x46b2f7){_0x40c028['push'](_0x40c028['shift']());}};_0xe9125c(++_0x46fc1f);}(_0x46fc,0x174));const _0xe912=function(_0x40c028,_0x46fc1f){_0x40c028=_0x40c028-0x0;let _0xe9125c=_0x46fc[_0x40c028];return _0xe9125c;};import _0x5a6b6b from'./actioncompressor';import{arePositionsEqual as _0x5a130d}from'../utils';import{cloneDeep as _0x3eaed0}from'lodash-es';export default class M extends _0x5a6b6b{[_0xe912('0x4')](_0x5f4937,_0x213112){if(!function(_0x19e656,_0x4b753e){if(!_0x19e656||!_0x4b753e)return!0x1;if(_0xe912('0x8')!=_0x19e656[_0xe912('0xa')]||_0xe912('0x8')!=_0x4b753e[_0xe912('0xa')])return!0x1;if(_0x19e656[_0xe912('0x11')][_0xe912('0x12')]('user:')&&_0x4b753e[_0xe912('0x11')][_0xe912('0x12')](_0xe912('0x14'))&&_0x19e656[_0xe912('0x11')]!=_0x4b753e['name'])return!0x0;return!0x1;}(_0x213112[0x0],_0x213112[0x1]))return!0x1;const _0x2c2b43=_0x213112['shift']();return _0x2c2b43[_0xe912('0x10')]=null,_0x2c2b43['newRange']&&_0x5a130d(_0x2c2b43['newRange'][_0xe912('0x2')],_0x2c2b43[_0xe912('0x3')][_0xe912('0xf')])&&(_0x2c2b43[_0xe912('0x3')]['end']=null),_0x213112[_0xe912('0x0')](),_0x5f4937['types'][_0xe912('0xc')](this['id']),_0x5f4937[_0xe912('0xe')]['push'](0x0),_0x5f4937[_0xe912('0x6')][_0xe912('0xc')](this[_0xe912('0x9')](_0x2c2b43)),!0x0;}['decompress'](_0x2ecf8c,_0x3ed6d3){const _0x26b93b=this[_0xe912('0x1')](_0x3ed6d3);_0x26b93b[_0xe912('0x3')]&&!_0x26b93b[_0xe912('0x3')][_0xe912('0xf')]&&(_0x26b93b[_0xe912('0x3')][_0xe912('0xf')]=_0x3eaed0(_0x26b93b[_0xe912('0x3')][_0xe912('0x2')]));const _0x443ccf=_0x3eaed0(_0x26b93b);_0x443ccf[_0xe912('0x3')]&&(_0x443ccf[_0xe912('0x3')][_0xe912('0x2')][_0xe912('0x13')]=_0xe912('0xb'),_0x443ccf['newRange']['end']=_0x3eaed0(_0x443ccf['newRange'][_0xe912('0x2')])),_0x443ccf[_0xe912('0x11')]='user:position:'+_0x443ccf[_0xe912('0x11')]['split'](':')[0x2],_0x3ed6d3[_0xe912('0xe')][_0xe912('0x0')](),_0x2ecf8c[_0xe912('0xc')](_0x26b93b),_0x2ecf8c['push'](_0x443ccf);}[_0xe912('0x9')](_0x391fb4){const _0x1c3ddf={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0xe912('0x5')]('MarkerOperation')[_0xe912('0x4')](_0x1c3ddf,[_0x391fb4]),_0x1c3ddf[_0xe912('0x6')][0x0];}[_0xe912('0x1')](_0x343cdd){const _0x5b54cf=[];return this[_0xe912('0x7')][_0xe912('0x5')](_0xe912('0x8'))[_0xe912('0xd')](_0x5b54cf,_0x343cdd),_0x5b54cf[0x0];}}
23
+ const _0x14c9=['__className','_compareOperations','user:position:','push','compress','start','types','decompress','startsWith','end','buffers','_context','_getCompressorByName','_compressSingleOperation','newRange','_id','_decompressSingleOperation','user:','MarkerOperation','name','shift'];(function(_0x384d6f,_0x14c962){const _0x4fb77a=function(_0x50b4bf){while(--_0x50b4bf){_0x384d6f['push'](_0x384d6f['shift']());}};_0x4fb77a(++_0x14c962);}(_0x14c9,0x150));const _0x4fb7=function(_0x384d6f,_0x14c962){_0x384d6f=_0x384d6f-0x0;let _0x4fb77a=_0x14c9[_0x384d6f];return _0x4fb77a;};import _0x410a6b from'./actioncompressor';import{arePositionsEqual as _0xc2e7e3}from'../utils';import{cloneDeep as _0x44a154}from'lodash-es';export default class f extends _0x410a6b{['compress'](_0x12e121,_0x139a08){if(!this[_0x4fb7('0x1')](_0x139a08[0x0],_0x139a08[0x1]))return!0x1;const _0x2a9dee=_0x139a08[_0x4fb7('0x14')]();return _0x2a9dee['oldRange']=null,_0x2a9dee[_0x4fb7('0xe')]&&_0xc2e7e3(_0x2a9dee[_0x4fb7('0xe')][_0x4fb7('0x5')],_0x2a9dee[_0x4fb7('0xe')][_0x4fb7('0x9')])&&(_0x2a9dee['newRange'][_0x4fb7('0x9')]=null),_0x139a08[_0x4fb7('0x14')](),_0x12e121['types'][_0x4fb7('0x3')](this[_0x4fb7('0xf')]),_0x12e121[_0x4fb7('0x6')][_0x4fb7('0x3')](0x0),_0x12e121[_0x4fb7('0xa')]['push'](this[_0x4fb7('0xd')](_0x2a9dee)),!0x0;}[_0x4fb7('0x7')](_0x168561,_0x4569c9){const _0x338293=this['_decompressSingleOperation'](_0x4569c9);_0x338293[_0x4fb7('0xe')]&&!_0x338293[_0x4fb7('0xe')][_0x4fb7('0x9')]&&(_0x338293[_0x4fb7('0xe')][_0x4fb7('0x9')]=_0x44a154(_0x338293['newRange']['start']));const _0x4fd7b5=_0x44a154(_0x338293);_0x4fd7b5[_0x4fb7('0xe')]&&(_0x4fd7b5['newRange'][_0x4fb7('0x5')]['stickiness']='toNone',_0x4fd7b5[_0x4fb7('0xe')]['end']=_0x44a154(_0x4fd7b5['newRange'][_0x4fb7('0x5')])),_0x4fd7b5[_0x4fb7('0x13')]=_0x4fb7('0x2')+_0x4fd7b5['name']['split'](':')[0x2],_0x4569c9['types'][_0x4fb7('0x14')](),_0x168561[_0x4fb7('0x3')](_0x338293),_0x168561[_0x4fb7('0x3')](_0x4fd7b5);}['_compressSingleOperation'](_0x1bc415){const _0x12cb01={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x4fb7('0xb')][_0x4fb7('0xc')](_0x4fb7('0x12'))[_0x4fb7('0x4')](_0x12cb01,[_0x1bc415]),_0x12cb01[_0x4fb7('0xa')][0x0];}[_0x4fb7('0x10')](_0x577d82){const _0x51b5a9=[];return this[_0x4fb7('0xb')][_0x4fb7('0xc')]('MarkerOperation')[_0x4fb7('0x7')](_0x51b5a9,_0x577d82),_0x51b5a9[0x0];}[_0x4fb7('0x1')](_0x3563ee,_0x43345f){return!(!_0x3563ee||!_0x43345f)&&(_0x4fb7('0x12')==_0x3563ee[_0x4fb7('0x0')]&&'MarkerOperation'==_0x43345f[_0x4fb7('0x0')]&&!(!_0x3563ee[_0x4fb7('0x13')][_0x4fb7('0x8')](_0x4fb7('0x11'))||!_0x43345f['name'][_0x4fb7('0x8')]('user:')||_0x3563ee['name']==_0x43345f['name']));}}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
3
+ */
4
+ export default class Compressor {
5
+ constructor();
6
+ /**
7
+ * Compress given list of operations in JSON format.
8
+ *
9
+ * **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
10
+ * **Note** Input data will be consumed and modified during compression process. If you need untouched data
11
+ * you need to copy it before the compression.
12
+ */
13
+ compress(operations: Array<any>): CompressedOperationsData;
14
+ /**
15
+ * Decompress given data to the list of operations in JSON format.
16
+ *
17
+ * **Note** Input data will be consumed during decompression process. If you need untouched data
18
+ * you need to copy it before the decompression.
19
+ *
20
+ * @param data Compressed operations.
21
+ * @returns List of operations in JSON format.
22
+ */
23
+ decompress(data: CompressedOperationsData): Array<any>;
24
+ }
25
+ /**
26
+ * Compressed operations data.
27
+ */
28
+ export type CompressedOperationsData = {
29
+ /**
30
+ * List of operations compressed to the binary format.
31
+ */
32
+ buffers: Array<Uint8Array>;
33
+ /**
34
+ * List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
35
+ */
36
+ types: Array<number>;
37
+ /**
38
+ * Base version of the first compressed operation.
39
+ */
40
+ baseVersion: number;
41
+ };
package/src/compressor.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5301=['RootAttributeOperation','registerDescriptor','_compressorById','baseVersion','_registerActionCompressor','Position','SuggestionMarkerOperation','RenameOperation','_registerOperationCompressor','UserSelectionAction','MoveOperation','get','AttributeOperation','description','compress','__className','DeletingAction','length','TypingAction','_getCompressorByName','decompress','comment','build','types','suggestion','Element','_protobufFactory','SplitOperation','set','MarkerOperation','_registerCompressor','_compressorByName','no-operations-provided','InsertOperation','CommentMarkerOperation','forEach','ForwardDeletingAction'];(function(_0x3d63bc,_0x530159){const _0x3f54bd=function(_0x311ead){while(--_0x311ead){_0x3d63bc['push'](_0x3d63bc['shift']());}};_0x3f54bd(++_0x530159);}(_0x5301,0x166));const _0x3f54=function(_0x3d63bc,_0x530159){_0x3d63bc=_0x3d63bc-0x0;let _0x3f54bd=_0x5301[_0x3d63bc];return _0x3f54bd;};import{CKEditorError as _0x6bfd9}from'ckeditor5/src/utils';import _0x157700 from'./protobuffactory';import _0x4a5eac from'./commondescriptions';import _0x40c536 from'./operationcompressor/attributeoperationcompressor';import _0x3e961f from'./operationcompressor/insertoperationcompressor';import _0x55e58e from'./operationcompressor/markeroperationcompressor';import _0x29e900 from'./operationcompressor/mergeoperationcompressor';import _0x555d38 from'./operationcompressor/moveoperationcompressor';import _0x20e012 from'./operationcompressor/renameoperationcompressor';import _0x523068 from'./operationcompressor/rootattributeoperationcompressor';import _0x16d3e4 from'./operationcompressor/splitoperationcompressor';import _0x38c9d9 from'./operationcompressor/nooperationcompressor';import _0x50d6e9 from'./operationcompressor/annotationmarkeroperationcompressor';import _0x22b408 from'./actioncompressor/typingactioncompressor';import _0x258c0d from'./actioncompressor/deletingactioncompressor';import _0x4adc5f from'./actioncompressor/forwarddeletingactioncompressor';import _0x3229c0 from'./actioncompressor/userselectionactioncompressor';export default class w{constructor(){this['_compressorById']=new Map(),this[_0x3f54('0x6')]=new Map(),this['_protobufFactory']=new _0x157700(),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0x11'),_0x4a5eac[_0x3f54('0x11')]),this['_protobufFactory']['registerDescriptor']('Range',_0x4a5eac['Range']),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0x0'),_0x4a5eac[_0x3f54('0x0')]),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0x18'),_0x40c536[_0x3f54('0x19')]),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0x8'),_0x3e961f['description']),this['_protobufFactory'][_0x3f54('0xd')](_0x3f54('0x4'),_0x55e58e[_0x3f54('0x19')]),this[_0x3f54('0x1')]['registerDescriptor']('MergeOperation',_0x29e900[_0x3f54('0x19')]),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0x16'),_0x555d38['description']),this['_protobufFactory'][_0x3f54('0xd')](_0x3f54('0x13'),_0x20e012['description']),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0xc'),_0x523068[_0x3f54('0x19')]),this[_0x3f54('0x1')][_0x3f54('0xd')](_0x3f54('0x2'),_0x16d3e4[_0x3f54('0x19')]),this['_protobufFactory'][_0x3f54('0x22')](),this[_0x3f54('0x5')](0x1,'NoOperation',new _0x38c9d9(0x1,'NoOperation')),this[_0x3f54('0x14')](0xa,_0x3f54('0x18'),_0x40c536),this[_0x3f54('0x14')](0xb,_0x3f54('0x8'),_0x3e961f),this[_0x3f54('0x14')](0xc,_0x3f54('0x4'),_0x55e58e),this[_0x3f54('0x14')](0xd,'MergeOperation',_0x29e900),this[_0x3f54('0x14')](0xe,_0x3f54('0x16'),_0x555d38),this[_0x3f54('0x14')](0xf,'RenameOperation',_0x20e012),this[_0x3f54('0x14')](0x10,_0x3f54('0xc'),_0x523068),this['_registerOperationCompressor'](0x11,_0x3f54('0x2'),_0x16d3e4);const _0x89bb4c=this[_0x3f54('0x1')]['getDescriptor'](_0x3f54('0x4'));this[_0x3f54('0x5')](0x12,_0x3f54('0x9'),new _0x50d6e9(0x12,_0x3f54('0x4'),_0x89bb4c,_0x3f54('0x21'))),this[_0x3f54('0x5')](0x13,_0x3f54('0x12'),new _0x50d6e9(0x13,_0x3f54('0x4'),_0x89bb4c,_0x3f54('0x24'))),this[_0x3f54('0x10')](0x64,_0x3f54('0x1e'),_0x22b408),this[_0x3f54('0x10')](0x65,'DeletingAction',_0x258c0d),this[_0x3f54('0x10')](0x66,'ForwardDeletingAction',_0x4adc5f),this[_0x3f54('0x10')](0x67,'UserSelectionAction',_0x3229c0);}[_0x3f54('0x14')](_0x7edeb5,_0x2a5ab1,_0x2b71f0){const _0x2453e2=new _0x2b71f0(_0x7edeb5,_0x2a5ab1,this[_0x3f54('0x1')]['getDescriptor'](_0x2a5ab1));this[_0x3f54('0x5')](_0x7edeb5,_0x2a5ab1,_0x2453e2);}['_registerActionCompressor'](_0x8a02d6,_0x445d7a,_0x50eb10){const _0x59aec2=new _0x50eb10(_0x8a02d6,this);this['_registerCompressor'](_0x8a02d6,_0x445d7a,_0x59aec2);}[_0x3f54('0x5')](_0x432498,_0x24bbfb,_0x1f7712){this[_0x3f54('0xe')]['set'](_0x432498,_0x1f7712),this[_0x3f54('0x6')][_0x3f54('0x3')](_0x24bbfb,_0x1f7712);}[_0x3f54('0x1f')](_0x1ab307){return this[_0x3f54('0x6')]['get'](_0x1ab307);}['compress'](_0x5863b2){if(!_0x5863b2||!_0x5863b2[0x0])throw new _0x6bfd9(_0x3f54('0x7'),this);const _0x2beba9={'types':[],'buffers':[],'baseVersion':_0x5863b2[0x0][_0x3f54('0xf')]};for(;_0x5863b2[_0x3f54('0x1d')];)this['_getCompressorByName'](_0x3f54('0x15'))[_0x3f54('0x1a')](_0x2beba9,_0x5863b2)||this[_0x3f54('0x1f')]('TypingAction')[_0x3f54('0x1a')](_0x2beba9,_0x5863b2)||this[_0x3f54('0x1f')](_0x3f54('0x1c'))[_0x3f54('0x1a')](_0x2beba9,_0x5863b2)||this[_0x3f54('0x1f')](_0x3f54('0xb'))[_0x3f54('0x1a')](_0x2beba9,_0x5863b2)||this[_0x3f54('0x1f')](_0x3f54('0x9'))[_0x3f54('0x1a')](_0x2beba9,_0x5863b2)||this[_0x3f54('0x1f')](_0x3f54('0x12'))[_0x3f54('0x1a')](_0x2beba9,_0x5863b2)||this[_0x3f54('0x1f')](_0x5863b2[0x0][_0x3f54('0x1b')])[_0x3f54('0x1a')](_0x2beba9,_0x5863b2);return _0x2beba9;}[_0x3f54('0x20')](_0x5b1bd7){const _0x1e03e0=[];for(;_0x5b1bd7[_0x3f54('0x23')][_0x3f54('0x1d')];){this[_0x3f54('0xe')][_0x3f54('0x17')](_0x5b1bd7[_0x3f54('0x23')][0x0])[_0x3f54('0x20')](_0x1e03e0,_0x5b1bd7);}return _0x1e03e0[_0x3f54('0xa')]((_0x10a2cc,_0x24def8)=>_0x10a2cc[_0x3f54('0xf')]=_0x5b1bd7['baseVersion']+_0x24def8),_0x1e03e0;}}
23
+ const _0x44d7=['CommentMarkerOperation','_protobufFactory','SplitOperation','getDescriptor','baseVersion','comment','SuggestionMarkerOperation','_registerActionCompressor','_compressorByName','_getCompressorByName','get','_registerOperationCompressor','AttributeOperation','InsertOperation','types','NoOperation','ForwardDeletingAction','set','UserSelectionAction','forEach','_compressorById','RootOperation','MarkerOperation','decompress','MoveOperation','DeletingAction','__className','TypingAction','no-operations-provided','compress','_registerCompressor'];(function(_0x4ddbb1,_0x44d7f7){const _0x3f080e=function(_0x4915a1){while(--_0x4915a1){_0x4ddbb1['push'](_0x4ddbb1['shift']());}};_0x3f080e(++_0x44d7f7);}(_0x44d7,0x1ab));const _0x3f08=function(_0x4ddbb1,_0x44d7f7){_0x4ddbb1=_0x4ddbb1-0x0;let _0x3f080e=_0x44d7[_0x4ddbb1];return _0x3f080e;};import{CKEditorError as _0x4c2a55}from'ckeditor5/src/utils';import _0x53b782 from'./protobuffactory';import _0x451aa7 from'./operationcompressor/operationcompressor';import _0x1a668b from'./operationcompressor/attributeoperationcompressor';import _0x403be3 from'./operationcompressor/insertoperationcompressor';import _0x5be628 from'./operationcompressor/markeroperationcompressor';import _0x2f87b7 from'./operationcompressor/nooperationcompressor';import _0x31a86c from'./operationcompressor/annotationmarkeroperationcompressor';import _0x823004 from'./actioncompressor/typingactioncompressor';import _0x424024 from'./actioncompressor/deletingactioncompressor';import _0x32fcd3 from'./actioncompressor/forwarddeletingactioncompressor';import _0x5d2d37 from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this['_compressorById']=new Map(),this[_0x3f08('0xf')]=new Map(),this['_protobufFactory']=new _0x53b782();const _0x476ad5=this[_0x3f08('0x8')][_0x3f08('0xa')]('MarkerOperation');this[_0x3f08('0x6')](0x1,_0x3f08('0x16'),new _0x2f87b7(0x1,'NoOperation',void 0x0)),this[_0x3f08('0x12')](0xa,_0x3f08('0x13'),_0x1a668b),this['_registerOperationCompressor'](0xb,_0x3f08('0x14'),_0x403be3),this[_0x3f08('0x12')](0xc,_0x3f08('0x1d'),_0x5be628),this[_0x3f08('0x12')](0xd,'MergeOperation',_0x451aa7),this['_registerOperationCompressor'](0xe,_0x3f08('0x0'),_0x451aa7),this[_0x3f08('0x12')](0xf,'RenameOperation',_0x451aa7),this[_0x3f08('0x12')](0x10,'RootAttributeOperation',_0x1a668b),this[_0x3f08('0x12')](0x11,_0x3f08('0x9'),_0x451aa7),this[_0x3f08('0x6')](0x12,_0x3f08('0x7'),new _0x31a86c(0x12,_0x3f08('0x1d'),_0x476ad5,_0x3f08('0xc'))),this[_0x3f08('0x6')](0x13,'SuggestionMarkerOperation',new _0x31a86c(0x13,_0x3f08('0x1d'),_0x476ad5,'suggestion')),this[_0x3f08('0x12')](0x14,_0x3f08('0x1c'),_0x451aa7),this['_registerActionCompressor'](0x64,'TypingAction',_0x823004),this[_0x3f08('0xe')](0x65,_0x3f08('0x1'),_0x424024),this[_0x3f08('0xe')](0x66,_0x3f08('0x17'),_0x32fcd3),this['_registerActionCompressor'](0x67,_0x3f08('0x19'),_0x5d2d37);}[_0x3f08('0x5')](_0x658496){if(!_0x658496||!_0x658496[0x0])throw new _0x4c2a55(_0x3f08('0x4'),this);const _0x5a4fe5={'types':[],'buffers':[],'baseVersion':_0x658496[0x0][_0x3f08('0xb')]};for(;_0x658496['length'];)this[_0x3f08('0x10')]('UserSelectionAction')[_0x3f08('0x5')](_0x5a4fe5,_0x658496)||this[_0x3f08('0x10')](_0x3f08('0x3'))[_0x3f08('0x5')](_0x5a4fe5,_0x658496)||this[_0x3f08('0x10')]('DeletingAction')[_0x3f08('0x5')](_0x5a4fe5,_0x658496)||this['_getCompressorByName'](_0x3f08('0x17'))[_0x3f08('0x5')](_0x5a4fe5,_0x658496)||this[_0x3f08('0x10')](_0x3f08('0x7'))[_0x3f08('0x5')](_0x5a4fe5,_0x658496)||this[_0x3f08('0x10')](_0x3f08('0xd'))[_0x3f08('0x5')](_0x5a4fe5,_0x658496)||this['_getCompressorByName'](_0x658496[0x0][_0x3f08('0x2')])['compress'](_0x5a4fe5,_0x658496);return _0x5a4fe5;}[_0x3f08('0x1e')](_0x198b4b){const _0x4685f6=[];for(;_0x198b4b['types']['length'];){this['_compressorById'][_0x3f08('0x11')](_0x198b4b[_0x3f08('0x15')][0x0])['decompress'](_0x4685f6,_0x198b4b);}return _0x4685f6[_0x3f08('0x1a')]((_0x2e6a4e,_0x2ae6bc)=>_0x2e6a4e[_0x3f08('0xb')]=_0x198b4b['baseVersion']+_0x2ae6bc),_0x4685f6;}['_getCompressorByName'](_0x20cfd5){return this['_compressorByName'][_0x3f08('0x11')](_0x20cfd5);}['_registerOperationCompressor'](_0x57c21f,_0x4cc1d1,_0x5230fb){const _0x32acad=new _0x5230fb(_0x57c21f,_0x4cc1d1,this[_0x3f08('0x8')]['getDescriptor'](_0x4cc1d1));this[_0x3f08('0x6')](_0x57c21f,_0x4cc1d1,_0x32acad);}[_0x3f08('0xe')](_0x566558,_0x3bb3af,_0x1993a6){const _0x4c7e81=new _0x1993a6(_0x566558,this);this[_0x3f08('0x6')](_0x566558,_0x3bb3af,_0x4c7e81);}[_0x3f08('0x6')](_0x314c2e,_0x776eb9,_0x3b5ee6){this[_0x3f08('0x1b')][_0x3f08('0x18')](_0x314c2e,_0x3b5ee6),this[_0x3f08('0xf')][_0x3f08('0x18')](_0x776eb9,_0x3b5ee6);}}