@ckeditor/ckeditor5-revision-history
Version:
Document revision history feature for CKEditor 5.
23 lines • 8.97 kB
JavaScript
/*
* 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 _0x5df829=_0x87dd;(function(_0x3a030e,_0x5352c0){const _0x35d43a=_0x87dd,_0x503f1b=_0x3a030e();while(!![]){try{const _0x59a365=parseInt(_0x35d43a(0xb6))/0x1*(parseInt(_0x35d43a(0xa0))/0x2)+-parseInt(_0x35d43a(0xa7))/0x3+-parseInt(_0x35d43a(0xae))/0x4+parseInt(_0x35d43a(0xb4))/0x5+parseInt(_0x35d43a(0x8c))/0x6+parseInt(_0x35d43a(0x7a))/0x7*(parseInt(_0x35d43a(0xac))/0x8)+-parseInt(_0x35d43a(0x94))/0x9*(parseInt(_0x35d43a(0xa4))/0xa);if(_0x59a365===_0x5352c0)break;else _0x503f1b['push'](_0x503f1b['shift']());}catch(_0x349ece){_0x503f1b['push'](_0x503f1b['shift']());}}}(_0x9c07,0x43964));import{Plugin as _0x22c8df}from'ckeditor5/src/core.js';function _0x87dd(_0x2214c5,_0x37213c){const _0x9c07e8=_0x9c07();return _0x87dd=function(_0x87dd71,_0x1e1443){_0x87dd71=_0x87dd71-0x74;let _0x3b5337=_0x9c07e8[_0x87dd71];return _0x3b5337;},_0x87dd(_0x2214c5,_0x37213c);}import{ViewDocumentFragment as _0x42f8ee,ViewText as _0x30eba9,ViewElement as _0x3bcb77,ViewContainerElement as _0x3a3107,ViewAttributeElement as _0x3e1052,ViewEmptyElement as _0x1a8ec0,ViewRawElement as _0x4982b0,ViewUIElement as _0x73320d}from'ckeditor5/src/engine.js';function _0x9c07(){const _0x13b5ed=['_typeCharToViewClass','getFillerOffset','editing','391454VLtWyX','editor','data','innerHTML','from','document','getRevisionRootsAttributes','filter','customProperties','length','revision-end','_viewClassToTypeChar','config','revision-start','map','attributes','string','_makeModelFromViewString','1735080jEFbhs','render','domConverter','parse','default','forEach','pluginName','toData','27pFeXpa','_appendChild','isPremiumPlugin','children','viewChildrenToDom','name','view','domChildrenToView','getRevision','_removeRevisionMarkers','childNodes','isAttached','771698MPunZM','htmlProcessor','createElement','get','2488270xLZSjy','loadRevisionData','isOfficialPlugin','683586DZyVxT','insertions','processor','fillerOffset','toModel','56rFDFAE','constructor','449472ELihSV','attachChange','attributesAfter','div','RevisionHistoryUtils','_setCustomProperty','1485320VnyzYs','data-revision-','1uFrRnP','type','diffData','useFillerType','domDocument','marked','_getViewFromDiffObj','_getTypeCharForViewElement','append','getRevisionDocumentData','collaboration.channelId','startsWith'];_0x9c07=function(){return _0x13b5ed;};return _0x9c07();}export class RevisionHistoryUtils extends _0x22c8df{static get[_0x5df829(0x92)](){const _0x42d68d=_0x5df829;return _0x42d68d(0xb2);}static get[_0x5df829(0xa6)](){return!0x0;}static get[_0x5df829(0x96)](){return!0x0;}[_0x5df829(0x85)]=new Map([[_0x3a3107,'c'],[_0x3e1052,'a'],[_0x1a8ec0,'e'],[_0x4982b0,'r'],[_0x73320d,'u']]);[_0x5df829(0x77)]=new Map([['c',_0x3a3107],['a',_0x3e1052],['e',_0x1a8ec0],['r',_0x4982b0],['u',_0x73320d]]);async[_0x5df829(0xa5)](_0x301722,_0x14315a){const _0x33185a=_0x5df829;if(_0x301722[_0x33185a(0xb8)]||!_0x14315a)return;const _0x508594=this[_0x33185a(0x7b)][_0x33185a(0x86)][_0x33185a(0xa3)](_0x33185a(0x75)),_0x9bb74e=await _0x14315a[_0x33185a(0x9c)]({'channelId':_0x508594,'revisionId':_0x301722['id']});_0x301722[_0x33185a(0xb8)]=_0x9bb74e[_0x33185a(0xb8)];}[_0x5df829(0x74)](_0x2fb29e){const _0x52fb9a=_0x5df829,_0xa98cd8={};for(const _0x12bf64 in _0x2fb29e[_0x52fb9a(0xb8)]){if(_0x2fb29e[_0x52fb9a(0xb8)][_0x12bf64][_0x52fb9a(0xaf)]&&!_0x2fb29e[_0x52fb9a(0xb8)][_0x12bf64][_0x52fb9a(0xaf)][_0x52fb9a(0x9f)])continue;const _0x59fa2b=this[_0x52fb9a(0x9d)](JSON[_0x52fb9a(0x8f)](_0x2fb29e[_0x52fb9a(0xb8)][_0x12bf64][_0x52fb9a(0xa8)])),_0x13127e=this[_0x52fb9a(0x7b)][_0x52fb9a(0x79)][_0x52fb9a(0x9a)][_0x52fb9a(0x7f)],_0x108c66=new _0x42f8ee(_0x13127e,_0x59fa2b[_0x52fb9a(0x88)](_0xee7f5=>this[_0x52fb9a(0xbc)](_0xee7f5,!0x1)));this[_0x52fb9a(0x7b)][_0x52fb9a(0x7c)][_0x52fb9a(0xa9)][_0x52fb9a(0xb9)](_0x52fb9a(0xbb)),_0xa98cd8[_0x12bf64]=this[_0x52fb9a(0x7b)][_0x52fb9a(0x7c)][_0x52fb9a(0xa9)][_0x52fb9a(0x93)](_0x108c66),this[_0x52fb9a(0x7b)][_0x52fb9a(0x7c)][_0x52fb9a(0xa9)][_0x52fb9a(0xb9)](_0x52fb9a(0x90));}return _0xa98cd8;}[_0x5df829(0x80)](_0x473f74){const _0x28b0eb=_0x5df829,_0x3d8586={};for(const _0x3a4ac3 in _0x473f74[_0x28b0eb(0xb8)])_0x473f74[_0x28b0eb(0xb8)][_0x3a4ac3][_0x28b0eb(0xaf)]&&!_0x473f74[_0x28b0eb(0xb8)][_0x3a4ac3][_0x28b0eb(0xaf)][_0x28b0eb(0x9f)]||(_0x3d8586[_0x3a4ac3]=_0x473f74[_0x28b0eb(0xb8)][_0x3a4ac3][_0x28b0eb(0xb0)]||{});return _0x3d8586;}[_0x5df829(0xbd)](_0x24f903){const _0x2b159f=_0x5df829;return this[_0x2b159f(0x85)][_0x2b159f(0xa3)](_0x24f903[_0x2b159f(0xad)]);}[_0x5df829(0xbc)](_0xf54e92,_0x1209ca){const _0x5428ac=_0x5df829,_0x1cff6c=this[_0x5428ac(0x7b)][_0x5428ac(0x79)][_0x5428ac(0x9a)][_0x5428ac(0x7f)];if(_0x5428ac(0x8a)==typeof _0xf54e92)return new _0x30eba9(_0x1cff6c,_0xf54e92);{let _0x1d3aa9,_0x3dcd42;_0x3dcd42='u'==_0xf54e92[_0x5428ac(0xb7)]||'r'==_0xf54e92[_0x5428ac(0xb7)]?[]:_0xf54e92[_0x5428ac(0x97)][_0x5428ac(0x88)](_0x235903=>this[_0x5428ac(0xbc)](_0x235903,_0x1209ca));const _0x3bd184=this[_0x5428ac(0x77)][_0x5428ac(0xa3)](_0xf54e92[_0x5428ac(0xb7)])||_0x3bcb77,_0x453d6a=this[_0x5428ac(0x7b)][_0x5428ac(0x7c)][_0x5428ac(0xa1)][_0x5428ac(0x8e)];if(_0x1d3aa9=new _0x3bd184(_0x1cff6c,_0xf54e92[_0x5428ac(0x99)],_0xf54e92[_0x5428ac(0x89)],_0x3dcd42),'u'==_0xf54e92[_0x5428ac(0xb7)]&&_0xf54e92[_0x5428ac(0x97)][0x0]){const _0x540fa5=_0xf54e92[_0x5428ac(0x97)][0x0];if(_0x1d3aa9[_0x5428ac(0x8d)]=function(_0x4b0bf9){const _0x1605a5=_0x5428ac,_0x14b335=_0x4b0bf9[_0x1605a5(0xa2)](_0x1605a5(0xb1));return _0x14b335[_0x1605a5(0x7d)]=_0x540fa5,_0x14b335[_0x1605a5(0x9e)][0x0];},_0x1209ca){const _0x10d833=new _0x42f8ee(_0x1cff6c);_0x10d833[_0x5428ac(0x95)](_0x1d3aa9);const _0x5bfb18=Array[_0x5428ac(0x7e)](_0x453d6a[_0x5428ac(0x98)](_0x10d833,{'bind':!0x1})),_0xa02958=_0x453d6a[_0x5428ac(0xba)][_0x5428ac(0xa2)](_0x5428ac(0xb1));_0xa02958[_0x5428ac(0xbe)](..._0x5bfb18),_0x1d3aa9=Array[_0x5428ac(0x7e)](_0x453d6a[_0x5428ac(0x9b)](_0xa02958))[0x0];}}else{if('r'==_0xf54e92[_0x5428ac(0xb7)]&&_0xf54e92[_0x5428ac(0x97)][0x0]){const _0x5be13e=_0xf54e92[_0x5428ac(0x97)][0x0];if(_0x1d3aa9[_0x5428ac(0x8d)]=function(_0x1b3fb9){const _0x5daf66=_0x5428ac;_0x1b3fb9[_0x5daf66(0x7d)]=_0x5be13e;},_0x1209ca){const _0x55206a=new _0x42f8ee(_0x1cff6c);_0x55206a[_0x5428ac(0x95)](_0x1d3aa9);const _0x5e93c2=Array[_0x5428ac(0x7e)](_0x453d6a[_0x5428ac(0x98)](_0x55206a,{'bind':!0x1})),_0x37eb06=_0x453d6a[_0x5428ac(0xba)][_0x5428ac(0xa2)](_0x5428ac(0xb1));_0x37eb06[_0x5428ac(0xbe)](..._0x5e93c2);const _0x2f1e57=Array[_0x5428ac(0x7e)](_0x453d6a[_0x5428ac(0x9b)](_0x37eb06));_0x2f1e57[_0x5428ac(0x83)]>0x1?_0x1d3aa9[_0x5428ac(0x95)](_0x2f1e57):_0x1d3aa9=_0x2f1e57[0x0];}}}if(_0xf54e92[_0x5428ac(0x82)]){for(const [_0x4b34b5,_0xdc56ad]of _0xf54e92[_0x5428ac(0x82)])_0x1d3aa9[_0x5428ac(0xb3)](_0x4b34b5,_0xdc56ad);}const _0x2567af=void 0x0===_0xf54e92[_0x5428ac(0xaa)]?null:_0xf54e92[_0x5428ac(0xaa)];return null!==_0x2567af&&(_0x1d3aa9[_0x5428ac(0x78)]=()=>_0x2567af),_0x1d3aa9;}}[_0x5df829(0x8b)](_0xdd30ad){const _0x394f8a=_0x5df829,_0x26451b=JSON[_0x394f8a(0x8f)](_0xdd30ad),_0x59ff96=this[_0x394f8a(0x7b)][_0x394f8a(0x79)][_0x394f8a(0x9a)][_0x394f8a(0x7f)],_0x44cff3=new _0x42f8ee(_0x59ff96,_0x26451b[_0x394f8a(0x88)](_0x68a6b5=>this[_0x394f8a(0xbc)](_0x68a6b5,!0x0)));return this[_0x394f8a(0x7b)][_0x394f8a(0x7c)][_0x394f8a(0xab)](_0x44cff3);}[_0x5df829(0x9d)](_0x26b2bd){const _0x52593b=_0x5df829;return(_0x26b2bd=_0x26b2bd[_0x52593b(0x81)](_0x134bba=>!_0x134bba[_0x52593b(0x99)]||_0x52593b(0x87)!==_0x134bba[_0x52593b(0x99)]&&_0x52593b(0x84)!==_0x134bba[_0x52593b(0x99)]))[_0x52593b(0x91)](_0x3d1c96=>{const _0x5ede0c=_0x52593b;_0x5ede0c(0x8a)!=typeof _0x3d1c96&&(_0x3d1c96[_0x5ede0c(0x97)]=this[_0x5ede0c(0x9d)](_0x3d1c96[_0x5ede0c(0x97)]),_0x3d1c96[_0x5ede0c(0x89)]=_0x3d1c96[_0x5ede0c(0x89)][_0x5ede0c(0x81)](_0x3946f9=>!_0x3946f9[0x0][_0x5ede0c(0x76)](_0x5ede0c(0xb5))));}),_0x26b2bd;}}