@ckeditor/ckeditor5-revision-history 48.5.0-alpha.3 → 48.5.0-alpha.4

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 (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -20,11 +20,11 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{CKEditorError as _0xf2df99,Collection as _0x1b928b,ElementReplacer as _0x178f0c,FocusTracker as _0x4d9461,KeystrokeHandler as _0x2ceefc,ObservableMixin as _0x591c98,ResizeObserver as _0x1e29b3,logWarning as _0x2e1924,scrollViewportToShowTarget as _0x6eee20,uid as _0x3a243d}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x4c4837,isEqual as _0x330946,set as _0x6d3aed,unset as _0x4f3c57}from'es-toolkit/compat';import{Command as _0x18a40f,Editor as _0xb27820,ElementApiMixin as _0x34e3e6,PendingActions as _0x4e8f00,Plugin as _0x245d60}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x8c2f21,PillView as _0x2190ec,Users as _0x124f7c,getMarkerDomElement as _0xf9a4c5,reRootOperation as _0x568fec,reRootPosition as _0x543b7d,reRootRange as _0x399603,sanitizeEditorConfig as _0x2d7eba}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x5b0952,ModelElement as _0x33393c,ModelRange as _0x4a1c21,ModelText as _0x39f156,ViewAttributeElement as _0x175cb2,ViewContainerElement as _0x1cb690,ViewDocumentFragment as _0x1675a3,ViewElement as _0x1a33c3,ViewEmptyElement as _0x4091aa,ViewRawElement as _0x7dd57b,ViewText as _0x2cedf2,ViewUIElement as _0x339ddb}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0x3e7cc1,IconChevronUp as _0x56cdc6,IconHistory as _0x5bf3c2,IconSparkle as _0x32cbb7,IconThreeVerticalDots as _0x9592c1,IconUndo as _0x329eec,IconUser as _0x5991e0}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0xd98ee5,ButtonView as _0x3cad3d,ContextualBalloon as _0x2fe268,CssTransitionDisablerMixin as _0x3231bb,EditorUI as _0x4d2c08,IconView as _0x203f2d,InlineEditableUIView as _0x356c60,LabeledFieldView as tt,ListItemView as it,ListView as et,MenuBarMenuListItemButtonView as st,MenuBarMenuListItemView as nt,MenuBarMenuListView as ot,MenuBarMenuView as rt,StickyPanelView as at,ToolbarSeparatorView as ht,ToolbarView as ct,UIModel as lt,View as ut,addListToDropdown as dt,createDropdown as ft,createLabeledInputText as vt,normalizeToolbarConfig as gt,submitHandler as mt}from'@ckeditor/ckeditor5-ui';import{DateTime as _t}from'luxon';const wt=/* #__PURE__ -- @preserve */
24
- _0x591c98();var pt=class extends wt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x25a374){super(),this['id']=_0x25a374['id']||_0x3a243d(),this['creator']=_0x25a374['creator']||null,this['authors']=_0x25a374['authors']||[],this['diffData']=_0x25a374['diffData']||null,this['toVersion']=_0x25a374['toVersion']||0x0,this['fromVersion']=_0x25a374['fromVersion']||0x0,this['set']('name',_0x25a374['name']||''),this['set']('createdAt',_0x25a374['createdAt']||new Date()),this['set']('attributes',_0x25a374['attributes']||{});}setName(_0x2e9325){this['_update']({'name':_0x2e9325});}setAttribute(_0x374e12,_0x471770){const _0x595877=_0x4c4837(this['attributes']);_0x6d3aed(_0x595877,_0x374e12,_0x471770),this['_update']({'attributes':_0x595877});}removeAttribute(_0x50712a){const _0x375797=_0x4c4837(this['attributes']);_0x4f3c57(_0x375797,_0x50712a),this['_update']({'attributes':_0x375797});}_update(_0x4f0dfb,_0x10ed9d=!0x1){let _0x298224=!0x1;const _0x1fa197={'id':this['id']};for(const _0x2efc38 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x50242a=_0x4f0dfb[_0x2efc38];void 0x0!==_0x50242a&&_0x50242a!==this[_0x2efc38]&&(this[_0x2efc38]=_0x50242a,_0x1fa197[_0x2efc38]=_0x50242a,_0x298224=!0x0);}_0x298224&&(_0x1fa197['authors']&&(_0x1fa197['authorsIds']=_0x1fa197['authors']['map'](_0x4ca5e5=>_0x4ca5e5['id']),delete _0x1fa197['authors']),this['fire']('_update',_0x1fa197,_0x10ed9d));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x1a902c=>_0x1a902c['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},yt=class extends _0x245d60{['_revisions'];static get requires(){return[_0x124f7c];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x1b8a6a){super(_0x1b8a6a),this['_revisions']=new _0x1b928b();}afterInit(){!async function(_0x237dde){const _0x312900='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x55b238=0xeb829,_0x449747=0x79410,_0x1a3e4a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x1a1cb2(_0xbac3c3){const _0x5e8f06=new window['Promise'](_0x183578=>{_0xbac3c3['once']('ready',_0x183578);}),_0xdc0a7b=window['Date']['now'](),_0x3130d9=_0xbac3c3['config']['get']('licenseKey');async function _0x5a37b9(){let _0x4e9b7c,_0x2d440a=null,_0x5a8f69=null;try{return'GPL'==_0x3130d9?'NotAllowed':(_0x4e9b7c=_0x14592e(),_0x4e9b7c?(_0x4e9b7c['usageEndpoint']&&(_0x5a8f69=_0x324e4a(_0x4e9b7c['usageEndpoint'],_0x4e9b7c['jti'])),await _0x4350be()?_0x4c7844()?_0x327bb1()?'Expired':_0x55a2c5()?('evaluation'==_0x4e9b7c['licenseType']&&(_0x2d440a=_0xaf17b7('EvaluationLimit')),await _0x5bdf1c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x327bb1(){const _0x2ead91=['evaluation','trial']['includes'](_0x4e9b7c['licenseType'])?_0xdc0a7b/0x3e8:0xe10*_0x449747;return _0x4e9b7c['exp']<_0x2ead91;}function _0x4c7844(){const _0x424689=_0x4e9b7c['features'];if(!_0x424689)return!0x1;if(_0x424689['includes']('*'))return!0x0;if(_0x424689['includes']('RH'))return!0x0;if(_0x424689['includes']('RRH')){if(_0x551525())return!0x0;if(_0x30cf61()||_0x112e1a())return!0x0;}return!0x1;}function _0x55a2c5(){const _0x5d17f6=_0x4e9b7c['licensedHosts'];if(!_0x5d17f6||0x0==_0x5d17f6['length'])return!0x0;const {hostname:_0x15c2b4}=new URL(window['location']['href']);if(_0x5d17f6['includes'](_0x15c2b4))return!0x0;const _0x345b6a=_0x15c2b4['split']('.');return _0x5d17f6['filter'](_0x3cd2aa=>_0x3cd2aa['includes']('*'))['map'](_0x1aaa45=>_0x1aaa45['split']('.'))['filter'](_0x211348=>_0x211348['length']<=_0x345b6a['length'])['map'](_0xd094db=>Array(_0x345b6a['length']-_0xd094db['length'])['fill']('*'===_0xd094db[0x0]?'*':'')['concat'](_0xd094db))['some'](_0xef117=>_0x345b6a['every']((_0x191f7c,_0x3e38e0)=>_0xef117[_0x3e38e0]===_0x191f7c||'*'===_0xef117[_0x3e38e0]));}function _0x5bdf1c(){return _0x2d440a&&_0x5a8f69?new window['Promise']((_0x5de2a3,_0x216e32)=>{_0x2d440a['then'](_0x5de2a3,_0x216e32),_0x5a8f69['then'](_0x4de2d0=>{'Valid'!=_0x4de2d0&&_0x5de2a3(_0x4de2d0);},_0x216e32);}):_0x2d440a||_0x5a8f69||'Valid';}}function _0x324e4a(_0xbe2b46,_0x50e140){return new window['Promise'](_0x1ad21b=>{if(_0x46e08a())return _0x1ad21b('Valid');_0x4872c0(),_0xbac3c3['decorate']('_sendUsageRequest');let _0x439f35=!0x1;const _0x5292b5=_0x3a243d();function _0x5da31b(_0x48a10d){return!!_0x48a10d&&('object'==typeof _0x48a10d||'function'==typeof _0x48a10d)&&'function'==typeof _0x48a10d['then']&&'function'==typeof _0x48a10d['catch'];}function _0x47271d(_0x4fc90d){_0x1b1c94(_0x4fc90d)['then'](_0x517c80=>_0x517c80&&'ok'==_0x517c80['status']?_0xe50427(_0x41ef5c(_0x5292b5+_0x50e140))!=_0x517c80['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x50d268=>(_0x3a8bf7(),_0x50d268),()=>{const _0xcdc6f2=_0xc51213();return null==_0xcdc6f2?(_0x3a8bf7(),'Valid'):_0xdc0a7b-_0xcdc6f2>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1ad21b)['catch'](()=>{_0x1ad21b('UsageLimit');});const _0x1f8d70=0x36ee80;function _0x3a8bf7(){const _0x5a8704='llct-'+_0xe50427(_0x41ef5c(_0xbe2b46)),_0x4d84e0=_0x241a27(_0xe50427(window['Math']['ceil'](_0xdc0a7b/_0x1f8d70)));window['localStorage']['setItem'](_0x5a8704,_0x4d84e0);}function _0xc51213(){const _0x230632='llct-'+_0xe50427(_0x41ef5c(_0xbe2b46)),_0x593ecc=window['localStorage']['getItem'](_0x230632);return _0x593ecc?window['parseInt'](_0x241a27(_0x593ecc),0x10)*_0x1f8d70:null;}function _0x1b1c94(_0x4e2a13){return new window['Promise']((_0x166b7f,_0xdeba50)=>{_0x4e2a13['then'](_0x166b7f,_0xdeba50),window['setTimeout'](_0xdeba50,0x1d4c0);});}}_0xbac3c3['on']('_sendUsageRequest',(_0x31bec2,_0x15db79)=>{if(_0x15db79[0x0]!=_0xbe2b46)return _0x1ad21b('UsageLimit');_0x15db79[0x1]={..._0x15db79[0x1],'requestId':_0x5292b5};},{'priority':'high'}),_0xbac3c3['on']('_sendUsageRequest',_0x568f6b=>{_0x5da31b(_0x568f6b['return'])&&(_0x439f35=!0x0,_0x47271d(_0x568f6b['return']));},{'priority':'low'}),_0x5e8f06['then'](()=>{_0x439f35||_0x1ad21b('UsageLimit');});});function _0x46e08a(){return'auto'==_0xbac3c3['editing']['view']['_overlayModeHint'];}function _0x4872c0(){_0xbac3c3['editing']['view']['_overlayModeHint']='auto';}}function _0xaf17b7(_0x25dc0e){const _0x5c111c=[new window['Promise'](_0x1175e4=>setTimeout(_0x1175e4,0x93ecc)),_0x5e8f06['then'](()=>new window['Promise'](_0x36a978=>{const _0x3db9d8=0x7,_0x17daf4=_0x237dde['_revisions'];function _0x1c4f9b(){_0x17daf4['length']>=_0x3db9d8&&_0x36a978();}_0x1c4f9b(),_0x17daf4['on']('add',_0x1c4f9b);})),new window['Promise'](_0x30436e=>{function _0x35a318(){for(const _0x420e0a in window)if(window['Number']['isNaN'](window['Number'](_0x420e0a))&&window[_0x420e0a]==_0x55b238)return _0x30436e();'destroyed'!=_0xbac3c3['state']&&window['setTimeout'](_0x35a318,0x1388);}_0xc463f5('RevisionViewer')&&_0x35a318();})];return window['Promise']['race'](_0x5c111c)['then'](()=>_0x25dc0e);}async function _0x489613(){if(await _0x5e8f06,_0xc463f5('RevisionViewer')){const _0x3c80a5=_0x237dde['getRevision'](0x0),_0x4bfaa9=_0x237dde['getEarlierVisibleRevision'](_0x3c80a5['id']),_0x7145a=_0x9f7575('RevisionViewer');return await _0x7145a['compare'](_0x3c80a5['id'],_0x4bfaa9?_0x4bfaa9['id']:null,!0x0),_0x7145a['unbind']('isEnabled'),_0x7145a['isEnabled']=!0x1,_0x7145a['compare']=_0x42a577,void(_0x7145a['_getDiff']=_0x42a577);}if(_0xc463f5('RevisionTracker')){const _0x19606e=_0x9f7575('RevisionTracker');_0x19606e['unbind']('isEnabled'),_0x19606e['isEnabled']=!0x1,_0x19606e['update']=_0x42a577,_0x19606e['saveRevision']=_0x42a577;}_0xbac3c3['model']['change']=_0x42a577,_0xbac3c3['model']['enqueueChange']=_0x42a577,_0xbac3c3['enableReadOnlyMode']('model');}function _0x551525(){return _0xc463f5('WebSocketGateway')&&'connected'==_0x9f7575('WebSocketGateway')['state'];}function _0x30cf61(){return _0xc463f5('RevisionViewerIntegration');}function _0x112e1a(){return _0xc463f5('TrackChangesDataGetter');}function _0x505624(_0x4e05b8){const _0x5c7ac0=_0x37853a();_0xbac3c3[_0x5c7ac0]='revisionHistoryLicenseKey'+_0x4e05b8,_0x4e05b8['endsWith']('Limit')&&(window[_0x37853a()]=_0x55b238),'Valid'!=_0x4e05b8&&_0x489613();}function _0x37853a(){const _0x1deab6=window['String'](window['performance']['now']())['replace']('.','');let _0x5b0bfa='N';for(let _0x10ef74=0x0;_0x10ef74<_0x1deab6['length'];_0x10ef74+=0x2){let _0x3eb614=window['parseInt'](_0x1deab6['substring'](_0x10ef74,_0x10ef74+0x2));_0x3eb614>=0x3e&&(_0x3eb614-=0x3e),_0x5b0bfa+=_0x312900[_0x3eb614];}return _0x5b0bfa;}function _0x14592e(){const _0x90b0f4=_0x3130d9['split']('.');if(0x3!=_0x90b0f4['length'])return null;return _0x320a07(_0x90b0f4[0x1]);function _0x320a07(_0x271d4b){const _0x434fd9=_0xf38ef5(_0x271d4b);return _0x434fd9&&_0x2ff7c5()?_0x434fd9:null;function _0x2ff7c5(){const _0x255ea2=_0x434fd9['jti'],_0x4fb736=window['parseInt'](_0x255ea2['substring'](_0x255ea2['length']-0x8),0x10),_0x48a86f={..._0x434fd9,'jti':_0x255ea2['substring'](0x0,_0x255ea2['length']-0x8)};return delete _0x48a86f['vc'],_0x41ef5c(_0x48a86f)==_0x4fb736;}}}async function _0x4350be(){let _0x284444=!0x0;try{const [_0x4da17,_0x269794,_0x1b2ee3]=_0x3130d9['split']('.');return _0x22720c(_0x4da17),await _0x2a1232(_0x4da17,_0x269794,_0x1b2ee3),_0x284444;}catch{return!0x1;}function _0x22720c(_0x5a4b05){const _0x3ee516=_0xf38ef5(_0x5a4b05);_0x3ee516&&'ES256'==_0x3ee516['alg']||(_0x284444=!0x1);}async function _0x2a1232(_0x409063,_0xb0489d,_0x388a7e){const _0x15b799=window['Uint8Array']['from'](_0x5a7ebd(_0x388a7e),_0x498df9=>_0x498df9['charCodeAt'](0x0)),_0x493c6e=new window['TextEncoder']()['encode'](_0x409063+'.'+_0xb0489d),_0x13f224=window['crypto']['subtle'];if(!_0x13f224)return;const _0x540896=await _0x13f224['importKey']('jwk',_0x1a3e4a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x13f224['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x540896,_0x15b799,_0x493c6e)||(_0x284444=!0x1);}}function _0xf38ef5(_0x552002){return _0x552002['startsWith']('ey')?JSON['parse'](_0x5a7ebd(_0x552002)):null;}function _0x5a7ebd(_0xb1a7f0){return window['atob'](_0xb1a7f0['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x41ef5c(_0x45d2fd){let _0x4f1c71=0x1505;function _0x13e6bc(_0x79ddae){for(let _0xb2fede=0x0;_0xb2fede<_0x79ddae['length'];_0xb2fede++){const _0x17f3c6=_0x79ddae['charCodeAt'](_0xb2fede);_0x4f1c71=(_0x4f1c71<<0x5)+_0x4f1c71+_0x17f3c6,_0x4f1c71&=_0x4f1c71;}}function _0x1e30ba(_0x281468){Array['isArray'](_0x281468)?_0x281468['forEach'](_0x1e30ba):_0x281468&&'object'==typeof _0x281468?Object['entries'](_0x281468)['sort']()['forEach'](([_0x36f37e,_0x33fbf5])=>{_0x13e6bc(_0x36f37e),_0x1e30ba(_0x33fbf5);}):_0x13e6bc(window['String'](_0x281468));}return _0x1e30ba(_0x45d2fd),_0x4f1c71>>>0x0;}function _0xe50427(_0x4147f6){return _0x4147f6['toString'](0x10)['padStart'](0x8,'0');}function _0x241a27(_0x502a8b){return _0x502a8b['split']('')['reverse']()['join']('');}function _0xc463f5(_0x12a282){return _0xbac3c3['plugins']['has'](_0x12a282);}function _0x9f7575(_0x708d3b){return _0xbac3c3['plugins']['get'](_0x708d3b);}function _0x42a577(){}_0x505624(await _0x5a37b9());}_0x1a1cb2(_0x237dde['editor']);}(this);}createRevision(_0x49c1cb){const _0x1cb487=this['editor']['plugins']['get']('Users');return new pt({'id':_0x49c1cb['id'],'name':_0x49c1cb['name'],'creator':_0x49c1cb['creatorId']?_0x1cb487['getUser'](_0x49c1cb['creatorId']):null,'diffData':_0x49c1cb['diffData']||_0x49c1cb['data'],'authors':_0x49c1cb['authorsIds']['map'](_0x402ac5=>_0x1cb487['getUser'](_0x402ac5)),'createdAt':new Date(_0x49c1cb['createdAt']),'attributes':_0x49c1cb['attributes'],'fromVersion':_0x49c1cb['fromVersion'],'toVersion':_0x49c1cb['toVersion']});}['addRevision'](_0x4e5296,_0x205641=0x0){this['_revisions']['add'](_0x4e5296,_0x205641);}getRevision(_0x94c40f){return this['_revisions']['get'](_0x94c40f);}getRevisions(_0xaf7d95={'toJSON':!0x1}){const _0x1c9d31=Array['from'](this['_revisions']);return _0x1c9d31['reverse'](),_0xaf7d95['toJSON']?_0x1c9d31['map'](_0x3a1dac=>_0x3a1dac['toJSON']()):_0x1c9d31;}getIndex(_0xf05d03){return this['_revisions']['getIndex'](_0xf05d03);}getEarlierVisibleRevision(_0x185a61){const [,_0x5db430]=this['getRevisionsIterator'](_0x185a61,{'direction':'earlier'});return _0x5db430;}getLaterVisibleRevision(_0x1f69cc){const [,_0x4097c1]=this['getRevisionsIterator'](_0x1f69cc,{'direction':'later'});return _0x4097c1;}getRevisionsInDiff(_0x4694c9){const _0x262238=[];for(const _0x5425c7 of this['getRevisionsIterator'](_0x4694c9['newRevisionId']))if(_0x262238['push'](_0x5425c7),_0x5425c7['id']===_0x4694c9['oldRevisionId'])break;return _0x262238;}*getRevisionsIterator(_0x221811,{direction:_0x5a61bb='earlier',filter:_0x13ac6e=()=>!0x0}={}){const _0x16fb37='earlier'===_0x5a61bb?0x1:-0x1;let _0x721aa4=this['_revisions']['get'](_0x221811),_0x308589=this['getIndex'](_0x721aa4);for(yield _0x721aa4;_0x721aa4;){if(_0x308589+=_0x16fb37,_0x721aa4=this['getRevision'](_0x308589),!_0x721aa4)return;_0x13ac6e(_0x721aa4)&&(yield _0x721aa4);}}},bt=class extends _0x245d60{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x1cb690,'c'],[_0x175cb2,'a'],[_0x4091aa,'e'],[_0x7dd57b,'r'],[_0x339ddb,'u']]);_typeCharToViewClass=new Map([['c',_0x1cb690],['a',_0x175cb2],['e',_0x4091aa],['r',_0x7dd57b],['u',_0x339ddb]]);async loadRevisionData(_0x2ef8ae,_0x27de32){if(_0x2ef8ae['diffData']||!_0x27de32)return;const _0x293f58=this['editor']['config']['get']('collaboration.channelId');_0x2ef8ae['diffData']=(await _0x27de32['getRevision']({'channelId':_0x293f58,'revisionId':_0x2ef8ae['id']}))['diffData'];}getRevisionDocumentData(_0x4c4443){const _0x4e0c85={};for(const _0x747380 in _0x4c4443['diffData']){if(_0x4c4443['diffData'][_0x747380]['attachChange']&&!_0x4c4443['diffData'][_0x747380]['attachChange']['isAttached'])continue;const _0x8fbd6b=this['_removeRevisionMarkers'](JSON['parse'](_0x4c4443['diffData'][_0x747380]['insertions'])),_0xaa9c93=this['editor']['editing']['view']['document'],_0x222b57=new _0x1675a3(_0xaa9c93,_0x8fbd6b['map'](_0x5c158f=>this['_getViewFromDiffObj'](_0x5c158f,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x4e0c85[_0x747380]=this['editor']['data']['processor']['toData'](_0x222b57),this['editor']['data']['processor']['useFillerType']('default');}return _0x4e0c85;}getRevisionRootsAttributes(_0x4d8097){const _0x162d90={};for(const _0x3b1090 in _0x4d8097['diffData'])_0x4d8097['diffData'][_0x3b1090]['attachChange']&&!_0x4d8097['diffData'][_0x3b1090]['attachChange']['isAttached']||(_0x162d90[_0x3b1090]=_0x4d8097['diffData'][_0x3b1090]['attributesAfter']||{});return _0x162d90;}getRevisionRootsModelElements(_0x2aa909){const _0x154789={};for(const _0x446765 in _0x2aa909['diffData']){if(_0x2aa909['diffData'][_0x446765]['attachChange']&&!_0x2aa909['diffData'][_0x446765]['attachChange']['isAttached'])continue;const _0x141245=_0x2aa909['diffData'][_0x446765]['rootElementName'];_0x141245&&(_0x154789[_0x446765]=_0x141245);}return _0x154789;}_getTypeCharForViewElement(_0x4d4a78){return this['_viewClassToTypeChar']['get'](_0x4d4a78['constructor']);}_getViewFromDiffObj(_0x14a031,_0x10ea59){const _0x3ebee7=this['editor']['editing']['view']['document'];if('string'==typeof _0x14a031)return new _0x2cedf2(_0x3ebee7,_0x14a031);{let _0x1f2eaa,_0x36ca63;_0x36ca63='u'==_0x14a031['type']||'r'==_0x14a031['type']?[]:_0x14a031['children']['map'](_0x700f6a=>this['_getViewFromDiffObj'](_0x700f6a,_0x10ea59));const _0x409110=this['_typeCharToViewClass']['get'](_0x14a031['type'])||_0x1a33c3,_0x36ed01=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x1f2eaa=new _0x409110(_0x3ebee7,_0x14a031['name'],_0x14a031['attributes'],_0x36ca63),'u'==_0x14a031['type']&&_0x14a031['children'][0x0]){const _0x808e24=_0x14a031['children'][0x0];if(_0x1f2eaa['render']=function(_0x28dba6){const _0x2b7413=_0x28dba6['createElement']('div');return _0x2b7413['innerHTML']=_0x808e24,_0x2b7413['childNodes'][0x0];},_0x10ea59){const _0x2e3f26=new _0x1675a3(_0x3ebee7);_0x2e3f26['_appendChild'](_0x1f2eaa);const _0x4a2af0=Array['from'](_0x36ed01['viewChildrenToDom'](_0x2e3f26,{'bind':!0x1})),_0x59b2df=_0x36ed01['domDocument']['createElement']('div');_0x59b2df['append'](..._0x4a2af0),_0x1f2eaa=Array['from'](_0x36ed01['domChildrenToView'](_0x59b2df))[0x0];}}else{if('r'==_0x14a031['type']&&_0x14a031['children'][0x0]){const _0x2a9ad6=_0x14a031['children'][0x0];if(_0x1f2eaa['render']=function(_0x22d844){_0x22d844['innerHTML']=_0x2a9ad6;},_0x10ea59){const _0x188fac=new _0x1675a3(_0x3ebee7);_0x188fac['_appendChild'](_0x1f2eaa);const _0x79cd89=Array['from'](_0x36ed01['viewChildrenToDom'](_0x188fac,{'bind':!0x1})),_0x61388d=_0x36ed01['domDocument']['createElement']('div');_0x61388d['append'](..._0x79cd89);const _0x3f0868=Array['from'](_0x36ed01['domChildrenToView'](_0x61388d));_0x3f0868['length']>0x1?_0x1f2eaa['_appendChild'](_0x3f0868):_0x1f2eaa=_0x3f0868[0x0];}}}if(_0x14a031['customProperties']){for(const [_0x2a83d3,_0x4fe1fe]of _0x14a031['customProperties'])_0x1f2eaa['_setCustomProperty'](_0x2a83d3,_0x4fe1fe);}const _0x3f9bfb=void 0x0===_0x14a031['fillerOffset']?null:_0x14a031['fillerOffset'];return null!==_0x3f9bfb&&(_0x1f2eaa['getFillerOffset']=()=>_0x3f9bfb),_0x1f2eaa;}}_makeModelFromViewString(_0x350efb,_0x2a33fb){const _0x2ccda2=JSON['parse'](_0x350efb),_0xf734ff=this['editor']['editing']['view']['document'],_0x4be62d=new _0x1675a3(_0xf734ff,_0x2ccda2['map'](_0x333804=>this['_getViewFromDiffObj'](_0x333804,!0x0))),_0x86bdd6=this['editor']['data']['toModel'](_0x4be62d,_0x2a33fb);return _0x86bdd6['name']=_0x2a33fb,_0x86bdd6;}['_removeRevisionMarkers'](_0x1b98c0){return(_0x1b98c0=_0x1b98c0['filter'](_0x117cb7=>!_0x117cb7['name']||'revision-start'!==_0x117cb7['name']&&'revision-end'!==_0x117cb7['name']))['forEach'](_0x13ce67=>{'string'!=typeof _0x13ce67&&(_0x13ce67['children']=this['_removeRevisionMarkers'](_0x13ce67['children']),_0x13ce67['attributes']=_0x13ce67['attributes']['filter'](_0x141c7a=>!_0x141c7a[0x0]['startsWith']('data-revision-')));}),_0x1b98c0;}};function Rt(_0x5dd755,_0x503a5c,_0x54c50f){const t=_0x5dd755['t'];switch(_0x503a5c){case'Revision\x20history':return t('Revision\x20history');case'Open\x20revision\x20history':return t('Open\x20revision\x20history');case'Restored':return t('Restored');case'Empty\x20document':return t('Empty\x20document');case'Initial\x20revision':return t('Initial\x20revision');case'Suggested\x20by':return t('Suggested\x20by');case'Added\x20by':return t('Added\x20by');case'Removed\x20by':return t('Removed\x20by');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Compare\x20against\x20selected':return t('Compare\x20against\x20selected');case'Name\x20this\x20revision':return t('Name\x20this\x20revision');case'Restore\x20this\x20revision':return t('Restore\x20this\x20revision');case'Back\x20to\x20editing':return t('Back\x20to\x20editing');case'Loading...':return t('Loading...');case'No\x20changes':return t('No\x20changes');case'NUMBER_OF_CHANGES':return t({'string':'%0\x20change','plural':'%0\x20changes','id':'NUMBER_OF_CHANGES'},_0x54c50f);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x54c50f);case'Show\x20previous\x20change':return t('Show\x20previous\x20change');case'Show\x20next\x20change':return t('Show\x20next\x20change');case'EDIT_X_OF_Y_REVISIONS':return t({'string':'Edit','id':'EDIT_X_OF_Y_REVISIONS'});case'Total':return t('Total');case'Revision\x20creator':return t('Revision\x20creator');case'Revision\x20author':return t('Revision\x20author');case'Revision\x20name':return t('Revision\x20name');case'Save\x20current\x20revision':return t('Save\x20current\x20revision');case'Accept':return t('Accept');case'Save':return t('Save');case'Cancel':return t('Cancel');case'Name\x20of\x20the\x20revision':return t('Name\x20of\x20the\x20revision');case'optional':return t('optional');case'PENDING_ACTION_REVISION_HISTORY':return t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'The\x20revision\x20name\x20cannot\x20be\x20empty.':return t('The\x20revision\x20name\x20cannot\x20be\x20empty.');case'Enter\x20the\x20revision\x20name':return t('Enter\x20the\x20revision\x20name');case'REVISION_AI_SOURCE_PILL_LABEL':return t({'string':'Includes\x20AI\x20suggestions','id':'REVISION_AI_SOURCE_PILL_LABEL'});case'AI_SOURCE_REVISION_TOOLTIP':return t({'string':'This\x20revision\x20contains\x20AI-assisted\x20suggestions.','id':'AI_SOURCE_REVISION_TOOLTIP'});case'AI_SOURCE_CHANGE_TOOLTIP':return t({'string':'This\x20change\x20was\x20suggested\x20using\x20AI.','id':'AI_SOURCE_CHANGE_TOOLTIP'});case'AI_SOURCE_ADDED_BY':return t({'string':'Added\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_ADDED_BY'},_0x54c50f);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x54c50f);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x54c50f);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var kt=class extends _0x245d60{['licenseKey'];_licenseKeyCheckInterval;currentRevision=null;repository;adapter=null;_revisionDataBuilder;['_source'];_initialRevisionId;_bufferedUpdates;_utils;_pendingAction;_continueCurrentRevision;_startingVersion;_loadedStateData;static get['pluginName'](){return'RevisionTracker';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x124f7c,yt,bt,_0x4e8f00];}constructor(_0x4b8b39){super(_0x4b8b39),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new At(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0xeb09ff=_0x3a243d();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0xeb09ff},this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['set']('_isPendingUpdate',!0x1),this['editor']['config']['define']('revisionHistory.resumeUnsavedRevision',!0x0),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'});}init(){this['_setConversion'](),this['editor']['data']['on']('ready',()=>{const _0x324711=this['repository']['getRevision'](0x0),_0x31606a=_0x324711&&null===_0x324711['creator']?_0x324711:null;if(this['_continueCurrentRevision']=!!_0x31606a&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x271783=this['_source']['getCurrentRevisionId'](),_0x1e09d4=this['repository']['getRevision'](_0x271783);if(_0x1e09d4)this['_startingVersion']=_0x1e09d4['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x3b0a58=this['_source']['history']['_operations']['find'](_0x506655=>!_0x506655['_isInit']),_0x2053bc=_0x3b0a58?_0x3b0a58['baseVersion']:this['_source']['history']['version'];_0x324711?(_0x324711['toVersion']<_0x2053bc&&_0x324711['_update']({'toVersion':_0x2053bc}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x31606a['id'],this['_startingVersion']=_0x31606a['fromVersion']):(this['_startingVersion']=_0x324711['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x2053bc,this['_continueCurrentRevision']=!0x1);}}else _0x31606a&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x31606a['toVersion'],this['editor']['model']['document']['history']['version']),_0x31606a['fromVersion']===_0x31606a['toVersion']?(0x0!==_0x31606a['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x31606a['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x31606a['id'],this['_startingVersion']=_0x31606a['fromVersion'])),this['_continueCurrentRevision']||(this['_startingVersion']=this['editor']['model']['document']['version']);this['_revisionDataBuilder']['init'](this['_source']['history']),this['_createInitialRevision'](this['_startingVersion']),this['_createCurrentRevision'](this['_startingVersion']),this['adapter']&&this['sendBufferedUpdates']();}),this['bind']('isReady')['to'](this,'_isPendingUpdate',_0x3e99b9=>!_0x3e99b9),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x18242e=[this['editor']];for(const _0x4cb0a3 of _0x18242e){let _0x112c7e;for(const _0x240ebc in _0x4cb0a3){const _0x341c8c=_0x240ebc,_0x34841d=_0x4cb0a3[_0x341c8c];if('revisionHistoryLicenseKeyValid'==_0x34841d||'revisionHistoryLicenseKeyInvalid'==_0x34841d||'revisionHistoryLicenseKeyExpired'==_0x34841d||'revisionHistoryLicenseKeyDomainLimit'==_0x34841d||'revisionHistoryLicenseKeyNotAllowed'==_0x34841d||'revisionHistoryLicenseKeyEvaluationLimit'==_0x34841d||'revisionHistoryLicenseKeyUsageLimit'==_0x34841d){delete _0x4cb0a3[_0x341c8c],_0x112c7e=_0x34841d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x112c7e&&_0x4cb0a3['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x112c7e&&_0x4cb0a3['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x112c7e&&_0x4cb0a3['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x112c7e&&_0x4cb0a3['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x112c7e&&_0x4cb0a3['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x112c7e&&_0x4cb0a3['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x42dd72=this['repository']['getRevision'](0x0),_0x422f16=await this['getRevisionDocumentData'](_0x42dd72),_0x84e8f3=await this['getRevisionRootsAttributes'](_0x42dd72),_0x3dd44c=this['_utils']['getRevisionRootsModelElements'](_0x42dd72);this['_replaceEditorDataWithRevisionData'](_0x422f16,_0x84e8f3,_0x3dd44c);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x55cd96){this['_source']=_0x55cd96;}async update(){const _0x320fbb=await this['_source']['getLatestVersion']();if(_0x320fbb>this['currentRevision']['toVersion']){await this['_loadState']();const _0xfe7cfa=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x320fbb});_0xfe7cfa['authors']=_0xfe7cfa['authorsIds']['map'](_0x1d47e4=>this['editor']['plugins']['get']('Users')['getUser'](_0x1d47e4)),this['currentRevision']['_update'](_0xfe7cfa);}}async['saveRevision'](_0x1d59d4={},_0x57316b=null){const _0x2fe00d=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x57316b>this['currentRevision']['toVersion']&&(_0x57316b=null),null===_0x57316b&&(_0x57316b=await this['_source']['getLatestVersion']());const _0x51d997=this['_getFromVersion'](_0x57316b),_0x515294=this['buildRevisionData']({'from':_0x51d997,'to':_0x57316b});if(this['currentRevision']['toVersion']<_0x57316b){const _0x51578b=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x57316b,'to':_0x57316b});_0x51578b['authors']=[],_0x51578b['authorsIds']=[],_0x51578b['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x51578b,!0x0),delete _0x51578b['authors'],_0x2fe00d['push'](_0x51578b);}const _0x58d824={..._0x1d59d4,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x1d59d4['name']||null,'id':_0x1d59d4['id']||_0x3a243d(),..._0x515294,'attributes':{..._0x1d59d4['attributes'],..._0x515294['attributes']}},_0x13cbce=this['addRevisionData'](_0x58d824);_0x2fe00d['push'](_0x58d824);const _0x156c01=this['repository']['getIndex'](_0x13cbce);if(0x0!==_0x156c01){const _0x24f075=this['repository']['getRevision'](_0x156c01-0x1);if(_0x24f075['fromVersion']!==_0x57316b){const _0x532c20=this['_revisionDataBuilder']['getData'](_0x57316b,_0x24f075['toVersion']),_0x3119b2={'id':_0x24f075['id'],'diffData':_0x532c20['diffData'],'authorsIds':_0x532c20['authorsIds'],'authors':_0x532c20['authorsIds']['map'](_0x242ba8=>this['editor']['plugins']['get']('Users')['getUser'](_0x242ba8)),'fromVersion':_0x57316b};this['_stampAiAttribute'](_0x3119b2,_0x24f075,!!_0x532c20['hasAIChanges']),_0x24f075===this['currentRevision']&&(_0x3119b2['createdAt']=new Date(_0x58d824['createdAt']['getTime']()+0xa)),_0x24f075['_update'](_0x3119b2,!0x0),delete _0x3119b2['authors'],_0x2fe00d['push'](_0x3119b2);}}if(this['adapter']){for(const _0x41cb34 of _0x2fe00d)this['_bufferUpdate'](_0x41cb34['id'],_0x41cb34,!0x0);this['sendBufferedUpdates']();}return _0x13cbce;}addRevisionData(_0x271202){const _0x35710c=this['repository']['createRevision'](_0x271202);return this['adapter']&&_0x35710c['on']('_update',(_0x4f3bfb,_0x36b5f9,_0x11829c)=>{_0x11829c||(this['_bufferUpdate'](_0x36b5f9['id'],_0x36b5f9,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x35710c,this['_findInsertionIndex'](_0x35710c)),_0x35710c;}async getRevisionDocumentData(_0x2342bd){return await this['_utils']['loadRevisionData'](_0x2342bd,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x2342bd);}async getRevisionRootsAttributes(_0x59a3bd){return await this['_utils']['loadRevisionData'](_0x59a3bd,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x59a3bd);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x4d6bb0=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0xb6fab3=0x0;_0xb6fab3<_0x4d6bb0['length'];_0xb6fab3++){const _0x58ed7c=_0x4d6bb0[_0xb6fab3];let _0x44b919=!0x1;for(const _0x1756d0 of Object['keys'](_0x58ed7c))void 0x0===_0x58ed7c[_0x1756d0]?delete _0x58ed7c[_0x1756d0]:'id'!==_0x1756d0&&(_0x44b919=!0x0);_0x44b919||(_0x4d6bb0[_0xb6fab3]=null);}if(_0x4d6bb0=_0x4d6bb0['filter'](_0x546b84=>null!==_0x546b84),!_0x4d6bb0['length'])return;for(let _0x5a4700=0x0;_0x5a4700<_0x4d6bb0['length'];_0x5a4700++){const _0x49dee3=_0x4d6bb0[_0x5a4700];void 0x0!==_0x49dee3['fromVersion']&&void 0x0===_0x49dee3['toVersion']&&(_0x49dee3['toVersion']=this['repository']['getRevision'](_0x49dee3['id'])['toVersion']),void 0x0!==_0x49dee3['toVersion']&&void 0x0===_0x49dee3['fromVersion']&&(_0x49dee3['fromVersion']=this['repository']['getRevision'](_0x49dee3['id'])['fromVersion']);}const _0x37a520=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x4d6bb0,_0x37a520)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x49d799=>{if(_0x49d799){for(const _0xd867c2 of _0x49d799)this['setRevisionData']({'id':_0xd867c2['id'],'createdAt':_0xd867c2['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x1a018b,_0x1a0945,_0x50ee33){if(_0x50ee33===(!!_0x1a0945&&!!_0x1a0945['attributes']['@ai']))return;const _0x275a5a={..._0x1a0945?_0x1a0945['attributes']:{},..._0x1a018b['attributes']};_0x50ee33?_0x275a5a['@ai']=!0x0:delete _0x275a5a['@ai'],_0x1a018b['attributes']=_0x275a5a;}buildRevisionData({revision:_0x4a0f6b=null,from:_0x5caf91=null,to:_0x573876=null}){_0x5caf91=null!==_0x5caf91?_0x5caf91:_0x4a0f6b['fromVersion'],_0x573876=null!==_0x573876?_0x573876:_0x4a0f6b['toVersion'];const _0x14d3f2=this['_revisionDataBuilder']['getData'](_0x5caf91,_0x573876),_0x53227d={'diffData':_0x14d3f2['diffData'],'authorsIds':_0x14d3f2['authorsIds'],'fromVersion':_0x5caf91,'toVersion':_0x573876};if(this['_stampAiAttribute'](_0x53227d,_0x4a0f6b,!!_0x14d3f2['hasAIChanges']),!_0x4a0f6b||_0x573876!==_0x4a0f6b['toVersion']){const _0x526af3=_0x573876-0x1,_0x48a6d1=this['_source']['history']['getOperation'](_0x526af3);_0x53227d['createdAt']=_0x48a6d1&&_0x48a6d1['createdAt']||new Date();}if(this['_loadedStateData']&&_0x5caf91===this['_loadedStateData']['fromVersion']){for(const _0x3c939c of this['_loadedStateData']['authors'])_0x53227d['authorsIds']['includes'](_0x3c939c['id'])||_0x53227d['authorsIds']['push'](_0x3c939c['id']);}return _0x53227d;}_bufferUpdate(_0x26d78d,_0x57ba6a,_0x4f148f){if(this['_bufferedUpdates']['has'](_0x26d78d)){const _0x4aaef4=this['_bufferedUpdates']['get'](_0x26d78d);_0x57ba6a=_0x4f148f?{..._0x4aaef4,..._0x57ba6a}:{..._0x57ba6a,..._0x4aaef4};}this['_bufferedUpdates']['set'](_0x26d78d,_0x57ba6a);}setRevisionData(_0x22f66c){const _0x27156b=this['repository']['getRevision'](_0x22f66c['id']);if(_0x22f66c['createdAt']&&(_0x22f66c['createdAt']=new Date(_0x22f66c['createdAt'])),_0x22f66c['authorsIds']){const _0x5edfa1=this['editor']['plugins']['get']('Users');_0x22f66c['authors']=_0x22f66c['authorsIds']['map'](_0x5c35e5=>_0x5edfa1['getUser'](_0x5c35e5));}_0x27156b['_update'](_0x22f66c,!0x0);}_createInitialRevision(_0x7c8a3){const _0x13c88c=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x13c88c)this['_initialRevisionId']=_0x13c88c['id'];else{const _0x15b86e=!this['editor']['model']['document']['roots']['find'](_0x2fb0fb=>this['editor']['model']['hasContent'](_0x2fb0fb)),_0x334f86=this['editor']['plugins']['get']('Users')['me']['id'],_0xc00bd9=Rt(this['editor']['locale'],_0x15b86e?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x7c8a3,'to':_0x7c8a3,'id':this['_initialRevisionId'],'name':_0xc00bd9,'creatorId':_0x334f86});}}_createCurrentRevision(_0x6efce){const _0x51580a=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x51580a),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x6efce,'to':_0x6efce,'id':_0x51580a,'name':'','creatorId':null}));}async _loadState(){this['_continueCurrentRevision']&&!this['_loadedStateData']&&(await this['_utils']['loadRevisionData'](this['currentRevision'],this['adapter']),this['_revisionDataBuilder']['loadState'](this['currentRevision']),this['_loadedStateData']={'fromVersion':this['currentRevision']['fromVersion'],'authors':this['currentRevision']['authors']['slice']()});}_replaceEditorDataWithRevisionData(_0x6ee5ff,_0x20bc73,_0x143be6){const _0x26a053={},_0x8dece6={},_0x1b457c={},_0x2d9d88=this['editor']['config']['get']('roots')||{};for(const [_0x1d5c0c,_0x2930d0]of Object['entries'](_0x2d9d88))_0x2930d0['lazyLoad']||(_0x26a053[_0x1d5c0c]=_0x2930d0['initialData']??'',_0x8dece6[_0x1d5c0c]=_0x2930d0['modelAttributes']||{},_0x2930d0['modelElement']&&(_0x1b457c[_0x1d5c0c]=_0x2930d0['modelElement']));for(const _0x93721 of this['editor']['model']['document']['getRootNames']())_0x26a053[_0x93721]??='',_0x8dece6[_0x93721]??={};let _0x212478=!0x1;const _0x47c775=Object['keys'](_0x26a053),_0x1df89f=Object['keys'](_0x6ee5ff);for(const _0x56c9bb of _0x47c775){if(_0x26a053[_0x56c9bb]!==_0x6ee5ff[_0x56c9bb]&&''!==_0x26a053[_0x56c9bb]['trim']()){_0x212478=!0x0;break;}if(!_0x330946(_0x8dece6[_0x56c9bb],_0x20bc73[_0x56c9bb])&&Object['keys'](_0x8dece6[_0x56c9bb])['length']>0x0){_0x212478=!0x0;break;}const _0x22f3f9=_0x1b457c[_0x56c9bb],_0x234629=_0x143be6[_0x56c9bb];if(_0x22f3f9&&_0x234629&&_0x22f3f9!==_0x234629){_0x212478=!0x0;break;}}_0x212478||(_0x212478=_0x1df89f['some'](_0x2dafbd=>!this['editor']['model']['document']['getRoot'](_0x2dafbd))),_0x212478&&_0x2e1924('editor-initial-data-replaced-with-revision-data',{'editorData':_0x26a053,'editorRootsAttributes':_0x8dece6,'editorRootsModelElements':_0x1b457c,'revisionData':_0x6ee5ff,'revisionRootsAttributes':_0x20bc73,'revisionRootsModelElements':_0x143be6});for(const [_0x2d03ec,_0x496a67]of Object['entries'](_0x6ee5ff))this['editor']['config']['set']('roots.'+_0x2d03ec+'.initialData',_0x496a67);for(const [_0x6c6844,_0x4f0e09]of Object['entries'](_0x20bc73))this['editor']['config']['set']('roots.'+_0x6c6844+'.modelAttributes',_0x4f0e09);const _0x213fe9=this['editor']['model']['document'];for(const [_0x58a1a1,_0x40224f]of Object['entries'](_0x143be6)){this['editor']['config']['set']('roots.'+_0x58a1a1+'.modelElement',_0x40224f);const _0x18f740=_0x213fe9['getRoot'](_0x58a1a1);_0x18f740&&_0x18f740['name']!==_0x40224f&&(_0x213fe9['roots']['remove'](_0x58a1a1),_0x213fe9['createRoot'](_0x40224f,_0x58a1a1));}}_addPendingAction(){if(!this['_pendingAction']){const _0x3c0c7d=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x3c0c7d['add'](Rt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x32b5c9){const _0x241d64=this['repository']['getRevisions']();_0x241d64['reverse']();let _0x375e93=0x0;for(;_0x375e93<_0x241d64['length'];){const _0x59ff7c=_0x241d64[_0x375e93];if(_0x59ff7c===this['currentRevision']){_0x375e93++;continue;}if(_0x59ff7c['id']===this['_initialRevisionId'])break;const _0x4244ca=_0x32b5c9['toVersion']-_0x59ff7c['toVersion']||_0x32b5c9['fromVersion']-_0x59ff7c['fromVersion'];if(_0x4244ca>0x0)break;if(_0x4244ca<0x0)_0x375e93++;else{if(!_0x32b5c9['creator']&&_0x59ff7c['creator'])break;if(_0x59ff7c['creator']||!_0x32b5c9['creator']){if(_0x32b5c9['createdAt']>_0x59ff7c['createdAt'])break;_0x375e93++;}else _0x375e93++;}}return _0x375e93;}_getFromVersion(_0x2565e9){const _0x41e6cc=this['repository']['getRevisions']();_0x41e6cc['reverse'](),_0x41e6cc['shift']();const _0x59dc59=_0x41e6cc['find'](_0x450262=>_0x450262['toVersion']<=_0x2565e9)['toVersion'];return _0x59dc59<this['_startingVersion']?this['_startingVersion']:_0x59dc59;}['_makeRevision']({name:_0x406edb,from:_0x761be0,to:_0x3e0241,creatorId:_0x453606,id:_0xfb00b9}){const _0x22f326=this['buildRevisionData']({'from':_0x761be0,'to':_0x3e0241});_0x22f326['name']=_0x406edb,_0x22f326['creatorId']=_0x453606,_0x22f326['id']=_0xfb00b9;const _0x44f317=this['addRevisionData'](_0x22f326);return this['adapter']&&this['_bufferUpdate'](_0x22f326['id'],_0x22f326,!0x0),_0x44f317;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},At=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x28f16e){this['editor']=_0x28f16e,this['_savedMetaData']=new Map(),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_markers']=new Map(),this['_diffRoots']=new Map(),this['_diffRootsAttributes']=new Map(),this['_baseRoots']=new Map(),this['_baseRootsAttributes']=new Map(),this['_idsRoots']=new Map(),this['_baseIdsRoots']=new Map(),this['_touched']=new Map(),this['_touchedMarkers']=new Map(),this['_aiTouchedMarkers']=new Map(),this['_touchedRoots']=new Map(),this['_revisionId']=0x1;}init(_0x6b66e8){this['source']=_0x6b66e8;const _0x2eb4f1=new Map(),_0x19ccef=new Map(),_0x48ee59=this['editor']['model']['document']['roots']['map'](_0x1edc90=>_0x1edc90['rootName']);for(const _0x3c8730 of _0x48ee59){const _0x37f9ca=this['editor']['model']['document']['getRoot'](_0x3c8730),_0x1a9fc2=It(_0x37f9ca);_0x2eb4f1['set'](_0x3c8730,_0x1a9fc2),_0x19ccef['set'](_0x3c8730,Object['fromEntries'](_0x37f9ca['getAttributes']()));}const _0x3161b9=Array['from'](this['editor']['model']['markers'])['map'](_0x7cfc77=>[_0x7cfc77['name'],_0x7cfc77['getRange']()]),_0x2ef5cf=this['source']['version'];this['_saveMetaData'](_0x2ef5cf,_0x2eb4f1,_0x3161b9,_0x19ccef),this['_startingRevisionId']=this['_revisionId'];const _0x44e3e5=new Map(),_0x587d9c=new Map();for(const _0x331c7c of _0x48ee59){const _0x40c365=St(_0x331c7c,this['editor']['model']['document']['getRoot'](_0x331c7c)['name']);_0x44e3e5['set'](_0x331c7c,_0x40c365),_0x587d9c['set'](_0x331c7c,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x44e3e5,[],_0x587d9c);}getData(_0x343282,_0x281d36){if(this['_lastFrom']===_0x343282&&this['_lastTo']<=_0x281d36)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x281d36,!0x0);else{if(!this['_savedMetaData']['has'](_0x343282)){const _0x4fb4f0=this['_getPreviousFrom'](_0x343282);this['_calculateMetaData'](_0x4fb4f0,_0x343282,!0x1);}this['_calculateMetaData'](_0x343282,_0x281d36,!0x0);}return this['_lastFrom']=_0x343282,this['_lastTo']=_0x281d36,this['_getState']();}loadState(_0x2410ff){if(!this['_savedMetaData']['has'](_0x2410ff['fromVersion'])){const _0x1bf1a9=this['_getPreviousFrom'](_0x2410ff['fromVersion']);this['_calculateMetaData'](_0x1bf1a9,_0x2410ff['fromVersion'],!0x1);}this['_calculateMetaData'](_0x2410ff['fromVersion'],_0x2410ff['toVersion'],!0x1);const _0x439cfb=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x2410ff['fromVersion'],this['_lastTo']=_0x2410ff['toVersion'];for(const _0x11815e in _0x2410ff['diffData']){const _0x2a3dcd=_0x2410ff['diffData'][_0x11815e]['attachChange'],_0x3730db=_0x4c4837(_0x2410ff['diffData'][_0x11815e]['attributesBefore'])||{},_0xfb9e6f=_0x2410ff['diffData'][_0x11815e],_0x560b57=_0x439cfb['_makeModelFromViewString'](_0xfb9e6f['deletions'],_0xfb9e6f['rootElementName']||'$root');_0x560b57['rootName']=_0x11815e,_0x560b57['_isAttached']=!_0x2a3dcd||!_0x2a3dcd['isAttached'],_0x560b57['isAttached']=()=>_0x560b57['_isAttached'],this['_baseRoots']['set'](_0x11815e,_0x560b57),this['_baseRootsAttributes']['set'](_0x11815e,_0x3730db),_0x2a3dcd&&this['_touchedRoots']['set'](_0x11815e,_0x2a3dcd);const _0x137044=this['_makeIdsRoot'](_0x560b57);this['_baseIdsRoots']['set'](_0x11815e,_0x137044);for(const [_0x2a4fc2,_0x3238d9]of _0x560b57['markers']){if(!_0x2a4fc2['startsWith']('revision:'))continue;const _0x17645e=_0x2a4fc2['split'](':')[0x2],_0x5036ec=_0xfb9e6f['aiSources']?.[_0x2a4fc2]||null;for(const _0x5cfd9b of _0x3238d9['getWalker']({'singleCharacters':!0x0})){const _0x692ac3=this['_getVidAttributeName'](_0x5cfd9b),_0x3ae4ae='elementEnd'==_0x5cfd9b['type']?_0x5cfd9b['previousPosition']['path']['slice'](0x0,-0x1):_0x5cfd9b['previousPosition']['path'],_0x5a2525=_0x137044['getNodeByPath'](_0x3ae4ae)['getAttribute'](_0x692ac3);this['_touched']['set'](_0x5a2525,{'userId':_0x17645e,'aiSource':_0x5036ec});}_0x560b57['markers']['delete'](_0x2a4fc2);}}this['_startingRevisionId']=this['_revisionId'];const _0x5a5dc6=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x49c02e=>!this['_touched']['has'](_0x49c02e));let _0x1113ae=0x0;const _0x17439d=new Map();for(const _0x25736c in _0x2410ff['diffData']){const _0x540057=_0x2410ff['diffData'][_0x25736c]['attachChange'],_0x344e54=_0x4c4837(_0x2410ff['diffData'][_0x25736c]['attributesAfter'])||{},_0x59520b=_0x2410ff['diffData'][_0x25736c],_0x227fde=_0x439cfb['_makeModelFromViewString'](_0x59520b['insertions'],_0x59520b['rootElementName']||'$root');_0x227fde['rootName']=_0x25736c,_0x227fde['_isAttached']=!_0x540057||_0x540057['isAttached'],_0x227fde['isAttached']=()=>_0x227fde['_isAttached'],this['_diffRoots']['set'](_0x25736c,_0x227fde),this['_diffRootsAttributes']['set'](_0x25736c,_0x344e54);const _0x28b081=this['_makeIdsRoot'](_0x227fde,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x25736c,_0x28b081),_0x17439d['set'](_0x25736c,_0x227fde['isAttached']()?_0x344e54:{});for(const [_0x2d522f,_0x5910a4]of _0x227fde['markers']){if(!_0x2d522f['startsWith']('revision:'))continue;const _0x9a2a58=_0x2d522f['split'](':')[0x2],_0xcee5c9=_0x59520b['aiSources']?.[_0x2d522f]||null;for(const _0x47bdb7 of _0x5910a4['getWalker']({'singleCharacters':!0x0})){const _0xd2e7d5=this['_getVidAttributeName'](_0x47bdb7),_0x34daa3=this['_revisionId']++,_0x5da2ea='elementEnd'==_0x47bdb7['type']?_0x47bdb7['previousPosition']['path']['slice'](0x0,-0x1):_0x47bdb7['previousPosition']['path'];_0x28b081['getNodeByPath'](_0x5da2ea)['_setAttribute'](_0xd2e7d5,_0x34daa3),this['_touched']['set'](_0x34daa3,{'userId':_0x9a2a58,'aiSource':_0xcee5c9});}_0x227fde['markers']['delete'](_0x2d522f);}for(const _0x5db9db of this['editor']['model']['createRangeIn'](_0x227fde)['getWalker']({'singleCharacters':!0x0})){const _0x39af9a=this['_getVidAttributeName'](_0x5db9db),_0x239e28='elementEnd'==_0x5db9db['type']?_0x5db9db['previousPosition']['path']['slice'](0x0,-0x1):_0x5db9db['previousPosition']['path'],_0x25d389=_0x28b081['getNodeByPath'](_0x239e28);_0x25d389['getAttribute'](_0x39af9a)>0x0||_0x25d389['_setAttribute'](_0x39af9a,_0x5a5dc6[_0x1113ae++]);}for(const [_0x1a8b2d,_0x4b7437]of _0x227fde['markers'])_0x1a8b2d['startsWith']('revision:')||this['_markers']['set'](_0x1a8b2d,_0x4b7437);}const {roots:_0x103285}=this['_savedMetaData']['get'](_0x2410ff['fromVersion']),{roots:_0x4340f2}=this['_savedMetaData']['get'](_0x2410ff['toVersion']),_0x332eb4=It(_0x103285['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x332eb4),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x332eb4,Number['NEGATIVE_INFINITY']));const _0x2d5b05=It(_0x4340f2['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x2d5b05),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x2d5b05));const _0x5b5484=Array['from'](this['_diffRoots'])['map'](([_0xc5806,_0x5e816a])=>[_0xc5806,It(_0x5e816a)]);this['_saveMetaData'](this['_lastTo'],_0x5b5484,this['_markers'],_0x17439d);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x469097,_0x2dead1,_0x5f205d,_0x6b0e66){const _0x1d8fe1=new Map(_0x2dead1),_0x505446=new Map(_0x4c4837(_0x6b0e66)),_0x290309=new Map();for(const [_0x4291dc,_0x46f37b]of _0x5f205d)_0x290309['set'](_0x4291dc,{'start':_0x46f37b['start']['clone'](),'end':_0x46f37b['end']['clone'](),'rootName':_0x46f37b['root']['rootName']});this['_savedMetaData']['set'](_0x469097,{'roots':_0x1d8fe1,'markers':_0x290309,'rootsAttributes':_0x505446});}_removeMetaData(_0x1aaa3b){this['_savedMetaData']['delete'](_0x1aaa3b);}_reset(){this['_touched']['clear'](),this['_touchedMarkers']['clear'](),this['_aiTouchedMarkers']['clear'](),this['_touchedRoots']['clear'](),this['_diffRoots']['clear'](),this['_diffRootsAttributes']['clear'](),this['_baseRoots']['clear'](),this['_baseRootsAttributes']['clear'](),this['_idsRoots']['clear'](),this['_baseIdsRoots']['clear'](),this['_markers']['clear'](),this['_revisionId']=0x1,this['_startingRevisionId']=this['_revisionId'];}_makeIdsRoot(_0xbfa2cf,_0xc3d9a6=null){let _0x29750f=null;_0xbfa2cf['is']('documentFragment')||(_0x29750f=new _0x33393c(_0xbfa2cf['name'],{'vid_start':null===_0xc3d9a6?this['_revisionId']++:_0xc3d9a6++}));const _0x182a9c=[];for(const _0x4e61bb of _0xbfa2cf['getChildren']())if(_0x4e61bb['is']('element')){_0x182a9c['push'](this['_makeIdsRoot'](_0x4e61bb,_0xc3d9a6));const _0x3ffb52=_0x182a9c[_0x182a9c['length']-0x1];null!==_0xc3d9a6&&(_0xc3d9a6=_0x3ffb52['is']('element','$text')?_0x3ffb52['getAttribute']('vid')+0x1:_0x3ffb52['getAttribute']('vid_end')+0x1);}else{for(let _0x3633f3=0x0;_0x3633f3<_0x4e61bb['offsetSize'];_0x3633f3++)_0x182a9c['push'](new _0x33393c('$text',{'vid':null===_0xc3d9a6?this['_revisionId']++:_0xc3d9a6++}));}if(_0xbfa2cf['is']('documentFragment')){const _0x257158=St(_0xbfa2cf['rootName'],_0xbfa2cf['name']);return _0x257158['_insertChild'](0x0,_0x182a9c),_0x257158;}return _0x29750f['_setAttribute']('vid_end',null===_0xc3d9a6?this['_revisionId']++:_0xc3d9a6),_0x29750f['_insertChild'](0x0,_0x182a9c),_0x29750f;}_calculateMetaData(_0x360c52,_0x566321,_0x4ebe97){this['_reset']();const {roots:_0x199f58,markers:_0x536635,rootsAttributes:_0x317589}=this['_savedMetaData']['get'](_0x360c52);this['_baseRoots']=new Map(_0x199f58),this['_baseRootsAttributes']=new Map(_0x4c4837(_0x317589));for(const [_0x21981e,_0x579841]of this['_baseRoots'])if('$graveyard'!==_0x21981e&&(this['_diffRoots']['set'](_0x21981e,It(_0x579841)),this['_diffRootsAttributes']=new Map(_0x4c4837(_0x317589)),_0x4ebe97)){const _0xf0d987=this['_revisionId'];this['_idsRoots']['set'](_0x21981e,this['_makeIdsRoot'](_0x579841)),this['_baseIdsRoots']['set'](_0x21981e,this['_makeIdsRoot'](_0x579841,_0xf0d987));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',It(this['_baseRoots']['get']('$graveyard'))),_0x4ebe97&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x34a5c5,_0x38edfd]of _0x536635){const _0x1a638c=this['_baseRoots']['get'](_0x38edfd['rootName']),_0x206e2d=this['_diffRoots']['get'](_0x38edfd['rootName']),_0x1d19c6=new _0x4a1c21(_0x543b7d(_0x38edfd['start'],_0x1a638c),_0x543b7d(_0x38edfd['end'],_0x1a638c)),_0x5bdc28=_0x399603(_0x1d19c6,_0x206e2d);_0x1a638c['markers']['set'](_0x34a5c5,_0x1d19c6),this['_markers']['set'](_0x34a5c5,_0x5bdc28);}this['_applyOperations'](_0x360c52,_0x566321,_0x4ebe97);}_applyOperations(_0x17d75d,_0x4ec120,_0x49c8d2){for(const _0x2571b2 of this['source']['getOperations'](_0x17d75d,_0x4ec120))this['_handleOperation'](_0x2571b2,_0x49c8d2);for(const _0x4eb6ea of this['_diffRoots']['values']())_0x4eb6ea['markers']['clear']();for(const [_0xa536ec,_0x5bab93]of this['_markers'])this['_diffRoots']['get'](_0x5bab93['root']['rootName'])['markers']['set'](_0xa536ec,_0x5bab93['clone']());const _0x7e170f=new Map(),_0x2add05=new Map();for(const [_0x1fd9e6,_0x312190]of this['_diffRoots'])_0x7e170f['set'](_0x1fd9e6,It(_0x312190)),_0x2add05['set'](_0x1fd9e6,this['_diffRootsAttributes']['get'](_0x1fd9e6));this['_saveMetaData'](_0x4ec120,_0x7e170f,this['_markers'],_0x2add05);}_getPreviousFrom(_0x5f5c25){const _0x22be90=Array['from'](this['_savedMetaData']['keys']());_0x22be90['sort']((_0x3373b8,_0x756e3e)=>_0x3373b8-_0x756e3e),_0x22be90['reverse']();for(const _0x46251c of _0x22be90)if(_0x46251c<_0x5f5c25)return _0x46251c;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x56c3d8,_0x46d617){const _0x48f3a8=Array['from'](_0x46d617['markers'])['map'](([_0x658585,_0x11402b])=>[_0x658585,_0x399603(_0x11402b,_0x56c3d8)]);_0x56c3d8['markers']=new Map(_0x48f3a8);}_transformMarkers(_0x5888c6){for(const _0x47eb5f of this['_markers']['values']()){const _0x1889b2=_0x47eb5f['getTransformedByOperation'](_0x5888c6),_0x145e36=_0x4a1c21['_createFromRanges'](_0x1889b2);_0x47eb5f['start']=_0x145e36['start'],_0x47eb5f['end']=_0x145e36['end'];}}_handleOperation(_0x456314,_0x557e85){if('addRoot'!=_0x456314['type']&&'detachRoot'!=_0x456314['type']){if('insert'==_0x456314['type']){const _0x405e69=_0x456314['position']['root'],_0x4c91e1=_0x405e69['rootName'],_0x222b61=_0x405e69['name'];this['_diffRoots']['has'](_0x4c91e1)||(this['_diffRoots']['set'](_0x4c91e1,St(_0x4c91e1,_0x222b61,!0x0)),this['_diffRootsAttributes']['set'](_0x4c91e1,{}),_0x557e85&&this['_idsRoots']['set'](_0x4c91e1,St(_0x4c91e1,_0x222b61,!0x0)));}else{if('addRootAttribute'==_0x456314['type']||'removeRootAttribute'==_0x456314['type']||'changeRootAttribute'==_0x456314['type'])return void this['_handleRootAttributeOperation'](_0x456314);'marker'==_0x456314['type']&&this['_handleMarkerOperation'](_0x456314);}if('marker'!==_0x456314['type']){const _0x2450e5=this['_cloneOperation'](_0x456314,this['_diffRoots']);_0x2450e5['_execute'](),this['_transformMarkers'](_0x2450e5);}if(_0x557e85)switch(_0x456314['type']){case'insert':this['_handleInsertOperation'](_0x456314);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x456314);break;case'merge':this['_handleMergeOperation'](_0x456314);break;case'split':this['_handleSplitOperation'](_0x456314);}}else this['_handleRootOperation'](_0x456314,_0x557e85);}_cloneOperation(_0x4a7cdf,_0x56ec9e){const _0x1def20=_0x4a7cdf['clone']();return _0x1def20['_authorId']=_0x4a7cdf['_authorId'],_0x1def20['_aiSource']=_0x4a7cdf['_aiSource'],_0x1def20['baseVersion']=null,_0x568fec(_0x1def20,_0x56ec9e),_0x1def20;}_getBaseVids(_0x12ad11){return _0x12ad11['map'](_0x371730=>{const _0x2a6ef0=this['_getVidAttributeName'](_0x371730);return Number(_0x371730['item']['getAttribute'](_0x2a6ef0));});}_generateTape(_0x302ce9,_0x20d16a){if(_0x302ce9['is']('element','$text'))_0x20d16a['push']({'item':_0x302ce9,'type':'text'});else{_0x302ce9['is']('element')&&_0x20d16a['push']({'item':_0x302ce9,'type':'elementStart'});for(const _0x2cb706 of _0x302ce9['getChildren']())this['_generateTape'](_0x2cb706,_0x20d16a);_0x302ce9['is']('element')&&_0x20d16a['push']({'item':_0x302ce9,'type':'elementEnd'});}return _0x20d16a;}_getState(){const _0x57eeae=new Map(this['_touched']),_0x3e1fb0=new Map(_0x57eeae),_0x1e31b4=new Map(),_0x43a832={'insertions':{},'deletions':{}},_0x530515={'insertions':{},'deletions':{}},_0x89fc0=new Map(),_0x1c50ac=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x4fe931=new Map();_0x1c50ac['delete']('$graveyard');for(const _0x102d0c of _0x1c50ac){const _0x199f44=(this['_diffRoots']['get'](_0x102d0c)??this['_baseRoots']['get'](_0x102d0c))['name'],_0x7a1c2e=this['_diffRoots']['get'](_0x102d0c)||St(_0x102d0c,_0x199f44,!0x1),_0x3237d7=this['_baseRoots']['get'](_0x102d0c)||St(_0x102d0c,_0x199f44,!0x1);_0x7a1c2e['isAttached']()||_0x3237d7['isAttached']()?(_0x4fe931['set'](_0x102d0c,_0x199f44),_0x43a832['insertions'][_0x102d0c]=It(_0x7a1c2e),_0x43a832['deletions'][_0x102d0c]=It(_0x3237d7),this['_copyMarkers'](_0x43a832['deletions'][_0x102d0c],_0x3237d7),this['_copyMarkers'](_0x43a832['insertions'][_0x102d0c],_0x7a1c2e),_0x530515['insertions'][_0x102d0c]=this['_generateTape'](this['_idsRoots']['get'](_0x102d0c),[]),_0x530515['deletions'][_0x102d0c]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x102d0c)||St(_0x102d0c,_0x199f44,!0x1),[])):_0x1c50ac['delete'](_0x102d0c);}for(const _0x1b467c of _0x1c50ac){const _0x49c125=_0x530515['insertions'][_0x1b467c];for(const _0x94e14e of _0x49c125){const _0x123319=this['_getVidAttributeName'](_0x94e14e),_0x26ff9c=_0x94e14e['item']['getAttribute'](_0x123319);_0x3e1fb0['delete'](_0x26ff9c),_0x26ff9c>=this['_startingRevisionId']&&_0x1e31b4['set'](_0x26ff9c,_0x57eeae['get'](_0x26ff9c));}}for(const _0xe1c971 of _0x1c50ac){const _0x150c66=_0x530515['insertions'][_0xe1c971],_0x40c5b7=this['_getBaseVids'](_0x530515['deletions'][_0xe1c971]);let _0x32343d=0x0;for(const _0xc6d663 of _0x150c66){const _0x31c02b=this['_getVidAttributeName'](_0xc6d663),_0x25d05b=_0xc6d663['item']['getAttribute'](_0x31c02b);if(!_0x1e31b4['has'](_0x25d05b)&&!_0x89fc0['has'](_0x25d05b)){if(_0x3e1fb0['has'](_0x25d05b))_0x32343d++;else{if(_0x25d05b!=_0x40c5b7[_0x32343d]){const _0x43a513=_0x57eeae['get'](_0x25d05b)||_0x57eeae['get'](_0x40c5b7[_0x32343d]);for(;_0x25d05b!=_0x40c5b7[_0x32343d];)_0x3e1fb0['has'](_0x40c5b7[_0x32343d])||(_0x89fc0['set'](_0x40c5b7[_0x32343d],_0x43a513),_0x57eeae['set'](_0x40c5b7[_0x32343d],_0x43a513)),_0x32343d++;}_0x32343d++;}}}}for(const _0x4a45ef of _0x1c50ac){const _0x26694a=_0x530515['insertions'][_0x4a45ef];for(const _0x392635 of _0x26694a){const _0x34e951=this['_getVidAttributeName'](_0x392635),_0x4161a0=_0x392635['item']['getAttribute'](_0x34e951);if(_0x89fc0['has'](_0x4161a0)){const _0x3c4a21=_0x89fc0['get'](_0x4161a0);_0x3e1fb0['has'](_0x4161a0)||_0x3e1fb0['set'](_0x4161a0,{..._0x3c4a21}),_0x1e31b4['set'](_0x4161a0,{..._0x3c4a21});}}}for(const _0x45fa58 of _0x3e1fb0['keys']())_0x45fa58>=this['_startingRevisionId']&&_0x3e1fb0['delete'](_0x45fa58);const _0x737f3f=new Map();for(const _0x263cc1 of _0x1c50ac){let _0x118534=_0x530515['insertions'][_0x263cc1];for(const _0x7b1891 of _0x118534)if(_0x7b1891['item']['is']('element','tableCell')){const _0x3e24d7=this['_getVidAttributeName'](_0x7b1891),_0x467990=_0x7b1891['item']['getAttribute'](_0x3e24d7);if(_0x1e31b4['has'](_0x467990)){const _0x2f9102=_0x7b1891['item']['parent']['parent']['getAttribute']('vid_start'),_0x405caf=_0x1e31b4['get'](_0x467990),_0x37621c=_0x737f3f['get'](_0x2f9102)||{'users':new Set(),'aiSource':null};_0x37621c['users']['add'](_0x405caf['userId']),_0x37621c['aiSource']=_0x37621c['aiSource']||_0x405caf['aiSource']||null,_0x737f3f['set'](_0x2f9102,_0x37621c);}}_0x118534=_0x530515['deletions'][_0x263cc1];for(const _0x5806a8 of _0x118534)if(_0x5806a8['item']['is']('element','tableCell')){const _0x47310b=this['_getVidAttributeName'](_0x5806a8),_0x53436b=_0x5806a8['item']['getAttribute'](_0x47310b);if(_0x3e1fb0['has'](_0x53436b)){const _0x3bda05=_0x5806a8['item']['parent']['parent']['getAttribute']('vid_start'),_0x5b97d3=_0x3e1fb0['get'](_0x53436b),_0x54b1bd=_0x737f3f['get'](_0x3bda05)||{'users':new Set(),'aiSource':null};_0x54b1bd['users']['add'](_0x5b97d3['userId']),_0x54b1bd['aiSource']=_0x54b1bd['aiSource']||_0x5b97d3['aiSource']||null,_0x737f3f['set'](_0x3bda05,_0x54b1bd);}}for(const _0x50afdd of _0x737f3f['keys']())(_0x1e31b4['has'](_0x50afdd)||_0x3e1fb0['has'](_0x50afdd))&&_0x737f3f['delete'](_0x50afdd);}for(const _0x53bf47 of _0x1c50ac){const _0x4e88d3=_0x530515['insertions'][_0x53bf47];let _0x2086f0=null,_0x50560f=null,_0x2fb88=null;for(const _0x33b217 of _0x4e88d3){const _0x45ed31=this['_getVidAttributeName'](_0x33b217),_0x107c04=_0x33b217['item']['getAttribute'](_0x45ed31),_0xaf0995=_0x737f3f['get'](_0x107c04);if(_0xaf0995&&'elementStart'==_0x33b217['type']&&(_0x2086f0=Array['from'](_0xaf0995['users'])[0x0],_0x50560f=_0xaf0995['aiSource'],_0x2fb88=_0x33b217['item']['getAttribute']('vid_end')),_0x2086f0){const _0x856bb4=_0x50560f||_0x3e1fb0['get'](_0x107c04)?.['aiSource']||null,_0x65e206=_0x50560f||_0x1e31b4['get'](_0x107c04)?.['aiSource']||null;_0x3e1fb0['set'](_0x107c04,{'userId':_0x2086f0,'aiSource':_0x856bb4}),_0x1e31b4['set'](_0x107c04,{'userId':_0x2086f0,'aiSource':_0x65e206});}_0x107c04==_0x2fb88&&(_0x2086f0=null,_0x2fb88=null);}}const _0x4cb232={},_0x5f0cd2=new Set();for(const _0x45436a of _0x1c50ac){const _0x53bd21=_0x43a832['deletions'][_0x45436a],_0x3e9c4=_0x43a832['insertions'][_0x45436a];for(const {userId:_0x5d7296}of this['_touchedMarkers']['values']())null!==_0x5d7296&&_0x5f0cd2['add'](_0x5d7296);for(const {userId:_0x143f0e}of this['_touchedRoots']['values']())null!==_0x143f0e&&_0x5f0cd2['add'](_0x143f0e);const _0x5f2bf8={};this['_markChanges'](_0x3e9c4,_0x530515['insertions'][_0x45436a],_0x1e31b4,'insertion',_0x5f0cd2,_0x5f2bf8),this['_markChanges'](_0x53bd21,_0x530515['deletions'][_0x45436a],_0x3e1fb0,'deletion',_0x5f0cd2,_0x5f2bf8),this['_collectSuggestionAiSources'](_0x3e9c4,_0x5f2bf8),this['_collectSuggestionAiSources'](_0x53bd21,_0x5f2bf8),_0x4cb232[_0x45436a]={'insertions':this['_prepareViewToSave'](_0x3e9c4),'deletions':this['_prepareViewToSave'](_0x53bd21),'attachChange':this['_touchedRoots']['get'](_0x45436a)||null,'attributesBefore':_0x4c4837(this['_baseRootsAttributes']['get'](_0x45436a))||{},'attributesAfter':_0x4c4837(this['_diffRootsAttributes']['get'](_0x45436a)),'rootElementName':_0x4fe931['get'](_0x45436a),'aiSources':_0x5f2bf8};}const _0x2cd6be=Array['from'](_0x1e31b4['values']())['some'](_0x6f2a25=>!(!_0x6f2a25||!_0x6f2a25['aiSource']))||Array['from'](_0x3e1fb0['values']())['some'](_0x727d29=>!(!_0x727d29||!_0x727d29['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x156afc=>this['_aiTouchedMarkers']['has'](_0x156afc));return{'diffData':_0x4cb232,'authorsIds':Array['from'](_0x5f0cd2),'hasAIChanges':_0x2cd6be};}_collectSuggestionAiSources(_0x5b7d26,_0x403df6){const _0x220729=_0x5b7d26['markers'];for(const _0x14e167 of _0x220729['keys']()){if(!_0x14e167['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x14e167))continue;const _0xaab142=this['_aiTouchedMarkers']['get'](_0x14e167);_0xaab142&&(_0x403df6[_0x14e167]=_0xaab142);}}_processRootBeforeSave(_0x33e997){for(const [,_0x1f1cff]of _0x33e997['markers']){const _0x4297ca=_0x1f1cff['start']['getAncestors']()['filter'](_0x3cda94=>'tableCell'==_0x3cda94['name']);for(const _0x1c144c of _0x4297ca)0x1==_0x1c144c['childCount']&&_0x1c144c['getChild'](0x0)['is']('element','paragraph')&&_0x1c144c['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x65b342){this['_processRootBeforeSave'](_0x65b342);const _0x34ecf2=this['editor']['data']['toView'](_0x65b342,{}),_0x4e1748=Array['from'](_0x34ecf2['getChildren']())['map'](_0x58d90e=>this['_getViewJson'](_0x58d90e));return JSON['stringify'](_0x4e1748);}_getViewJson(_0x203146){if(_0x203146['is']('$text'))return _0x203146['data'];{const _0x290eae=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x1abe54=_0x203146,_0x21181d=this['editor']['data']['htmlProcessor']['domConverter'],_0x380005={'type':_0x290eae['_getTypeCharForViewElement'](_0x1abe54),'name':_0x1abe54['name'],'attributes':Array['from'](_0x1abe54['getAttributes']()),'children':Array['from'](_0x1abe54['getChildren']())['map'](_0x4c3d0b=>this['_getViewJson'](_0x4c3d0b))};if(_0x203146['is']('uiElement')&&'$comment'!=_0x203146['name']){const _0x200353=_0x203146['render'](_0x21181d['domDocument'],_0x21181d);_0x380005['children']['push'](_0x200353['outerHTML']);}else{if(_0x203146['is']('rawElement')){const _0x346ea2=_0x21181d['domDocument']['createElement'](_0x1abe54['name']);_0x203146['render'](_0x346ea2,_0x21181d),_0x380005['children']['push'](_0x346ea2['innerHTML']);}}const _0x132ba4=Array['from'](_0x1abe54['getCustomProperties']());_0x132ba4['length']>0x0&&(_0x380005['customProperties']=_0x132ba4);const _0x5eb6e7=_0x1abe54['getFillerOffset']();return null!==_0x5eb6e7&&(_0x380005['fillerOffset']=_0x5eb6e7),_0x380005;}}['_markChanges'](_0x55ca41,_0xbd4cad,_0xc41b36,_0x93cf3b,_0x307d72,_0x47e191){let _0x15a653=null,_0x161718=null,_0x367f05=0x0;const _0x4c9400=this['editor']['model'];for(let _0x21bca2=0x0;_0x21bca2<_0xbd4cad['length'];_0x21bca2++){const _0x43bc19=this['_getVidAttributeName'](_0xbd4cad[_0x21bca2]),_0x17de54=_0xbd4cad[_0x21bca2]['item']['getAttribute'](_0x43bc19),_0x59d0b3=_0xc41b36['get'](_0x17de54),_0x258cac=_0x21bca2==_0xbd4cad['length']-0x1;!_0x15a653&&_0x59d0b3&&(_0x15a653=_0x59d0b3,_0x161718=_0xbd4cad[_0x21bca2]);const _0x40902d=!!_0x15a653&&!!_0x59d0b3&&_0x59d0b3['userId']!=_0x15a653['userId'],_0x34aad6=!!_0x15a653&&!!_0x59d0b3&&_0x59d0b3['aiSource']!=_0x15a653['aiSource'];_0x15a653&&(!_0x59d0b3||_0x40902d||_0x34aad6)&&(_0x47534d(_0x59d0b3,Et(_0x161718,_0x55ca41,_0x4c9400),Et(_0xbd4cad[_0x21bca2],_0x55ca41,_0x4c9400)),_0x15a653=_0x59d0b3||null,_0x161718=_0x59d0b3?_0xbd4cad[_0x21bca2]:null),_0x15a653&&_0x258cac&&_0x47534d(_0x59d0b3,Et(_0x161718,_0x55ca41,_0x4c9400),Ot(_0xbd4cad[_0x21bca2],_0x55ca41,_0x4c9400));}function _0x47534d(_0x198782,_0x329186,_0x35e822){const _0x4f73e4=_0x15a653['userId'],_0x2f50e9=_0x15a653['aiSource'],_0x8a1c36='revision:'+_0x93cf3b+':'+_0x4f73e4+':'+_0x367f05++,_0x1cca34=_0x4c9400['createRange'](_0x329186,_0x35e822);_0x55ca41['markers']['set'](_0x8a1c36,_0x1cca34),_0x2f50e9&&(_0x47e191[_0x8a1c36]=_0x2f50e9),null!==_0x4f73e4&&_0x307d72['add'](_0x4f73e4);}}_getVidAttributeName(_0x2c3d11){switch(_0x2c3d11['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x4c22db){const _0x41b829=this['_idsRoots']['get'](_0x4c22db['position']['root']['rootName']),_0xcafb63=_0x543b7d(_0x4c22db['position'],_0x41b829),_0x47d33c=null===_0x4c22db['_authorId']?null:_0x4c22db['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2840ac=_0x4c22db['_aiSource']||null,_0x4cc7d5=_0xcafb63['parent'],_0x19c4b2=this['_revisionId'],_0x32d12e=[];for(const _0x26713f of _0x4c22db['nodes'])if(_0x26713f['is']('element'))_0x32d12e['push'](this['_makeIdsRoot'](_0x26713f));else{for(let _0x2d2e1f=0x0;_0x2d2e1f<_0x26713f['offsetSize'];_0x2d2e1f++)_0x32d12e['push'](new _0x33393c('$text',{'vid':this['_revisionId']++}));}const _0x1a2d2c=this['_revisionId'];for(let _0x532a81=_0x19c4b2;_0x532a81<_0x1a2d2c;_0x532a81++)this['_touched']['set'](_0x532a81,{'userId':_0x47d33c,'aiSource':_0x2840ac});_0x4cc7d5['_insertChild'](_0xcafb63['offset'],_0x32d12e);}_setTouched(_0x55e52b,_0x53e02d,_0xcc3dc0){this['_touched']['set'](_0x55e52b,{'userId':_0x53e02d,'aiSource':_0xcc3dc0||this['_touched']['get'](_0x55e52b)?.['aiSource']||null});}_handleMoveOperation(_0x12ef71){(_0x12ef71=this['_cloneOperation'](_0x12ef71,this['_idsRoots']))['_execute']();const _0x3f644b=null===_0x12ef71['_authorId']?null:_0x12ef71['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xfa959e=_0x12ef71['_aiSource']||null,_0x4e6feb=_0x12ef71['getMovedRangeStart'](),_0x34579a=_0x4e6feb['parent'],_0x5b31d0=_0x4e6feb['offset'],_0x4a6bf5=(_0xedb959,_0x3abc56,_0x5b136c)=>{for(let _0x590e0b=_0x3abc56;_0x590e0b<_0x5b136c;_0x590e0b++){const _0x46e376=_0xedb959['getChild'](_0x590e0b);_0x46e376['is']('element','$text')?this['_setTouched'](_0x46e376['getAttribute']('vid'),_0x3f644b,_0xfa959e):(this['_setTouched'](_0x46e376['getAttribute']('vid_start'),_0x3f644b,_0xfa959e),_0x4a6bf5(_0x46e376,0x0,_0x46e376['childCount']),this['_setTouched'](_0x46e376['getAttribute']('vid_end'),_0x3f644b,_0xfa959e));}};_0x4a6bf5(_0x34579a,_0x5b31d0,_0x5b31d0+_0x12ef71['howMany']);}_handleMergeOperation(_0x1ef71a){const _0x106c63=null===(_0x1ef71a=this['_cloneOperation'](_0x1ef71a,this['_idsRoots']))['_authorId']?null:_0x1ef71a['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x355af1=_0x1ef71a['_aiSource']||null,_0x15ee32=_0x1ef71a['targetPosition']['parent'],_0x144771=_0x1ef71a['sourcePosition']['parent'],_0x314ad5=_0x15ee32['getAttribute']('vid_end'),_0x447c31=_0x144771['getAttribute']('vid_start');_0x15ee32['_setAttribute']('vid_end',_0x144771['getAttribute']('vid_end')),_0x144771['_setAttribute']('vid_end',_0x314ad5),this['_setTouched'](_0x447c31,_0x106c63,_0x355af1),this['_setTouched'](_0x314ad5,_0x106c63,_0x355af1),_0x1ef71a['_execute']();}_handleSplitOperation(_0x41b58e){const _0x4053a5=null===(_0x41b58e=this['_cloneOperation'](_0x41b58e,this['_idsRoots']))['_authorId']?null:_0x41b58e['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x5abd82=_0x41b58e['_aiSource']||null,_0xa00a2b=_0x41b58e['graveyardPosition'],_0x5b8e7b=_0x41b58e['splitPosition']['parent'];_0x41b58e['_execute']();const _0x2c1e52=_0x5b8e7b['getAttribute']('vid_end'),_0x16e118=_0x41b58e['insertionPosition']['nodeAfter'];if(_0xa00a2b){const _0x6b6a8a=_0x16e118['getAttribute']('vid_end'),_0x5c4fcb=_0x5b8e7b['getAttribute']('vid_end');_0x5b8e7b['_setAttribute']('vid_end',_0x6b6a8a),_0x16e118['_setAttribute']('vid_end',_0x5c4fcb),this['_setTouched'](_0x5b8e7b['getAttribute']('vid_end'),_0x4053a5,_0x5abd82),this['_setTouched'](_0x16e118['getAttribute']('vid_start'),_0x4053a5,_0x5abd82);}else{const _0x216355=this['_revisionId']++,_0x50254b=this['_revisionId']++;_0x5b8e7b['_setAttribute']('vid_end',_0x216355),_0x16e118['_setAttribute']('vid_start',_0x50254b),_0x16e118['_setAttribute']('vid_end',_0x2c1e52),this['_setTouched'](_0x216355,_0x4053a5,_0x5abd82),this['_setTouched'](_0x50254b,_0x4053a5,_0x5abd82);}}_handleMarkerOperation(_0x512b25){if(!_0x512b25['affectsData'])return;const _0x4f933d=(_0x512b25=this['_cloneOperation'](_0x512b25,this['_diffRoots']))['oldRange']?_0x512b25['oldRange']['root']:null,_0x32ee5f=_0x512b25['newRange']?_0x512b25['newRange']['root']:null;_0x4f933d&&this['_markers']['delete'](_0x512b25['name']),_0x32ee5f&&this['_markers']['set'](_0x512b25['name'],_0x512b25['newRange']['clone']());const _0x3c632a=null===_0x512b25['_authorId']?null:_0x512b25['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xadad73=_0x512b25['name'];if(_0x512b25['_aiSource']&&this['_aiTouchedMarkers']['set'](_0xadad73,_0x512b25['_aiSource']),!this['_touchedMarkers']['has'](_0xadad73))return void this['_touchedMarkers']['set'](_0xadad73,{'range':_0x512b25['oldRange'],'userId':_0x3c632a});const _0x1d2707=this['_touchedMarkers']['get'](_0xadad73),_0x3f8f58=_0x1d2707['range'],_0x2da896=_0x512b25['newRange'];null==_0x3f8f58&&null==_0x2da896||_0x3f8f58&&_0x2da896&&_0x3f8f58['isEqual'](_0x2da896)?this['_touchedMarkers']['delete'](_0x512b25['name']):_0x1d2707['userId']=_0x3c632a;}_handleRootOperation(_0xb86e2,_0x3272b4){this['_diffRoots']['has'](_0xb86e2['rootName'])?this['_diffRoots']['get'](_0xb86e2['rootName'])['_isAttached']=_0xb86e2['isAdd']:(this['_diffRoots']['set'](_0xb86e2['rootName'],St(_0xb86e2['rootName'],_0xb86e2['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0xb86e2['rootName'],{}),_0x3272b4&&this['_idsRoots']['set'](_0xb86e2['rootName'],St(_0xb86e2['rootName'],_0xb86e2['elementName'],!0x0)));const _0x38ffab=null===_0xb86e2['_authorId']?null:_0xb86e2['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2b27c4=this['_touchedRoots']['get'](_0xb86e2['rootName']);_0x2b27c4&&_0x2b27c4['userId']===_0x38ffab?this['_touchedRoots']['delete'](_0xb86e2['rootName']):this['_touchedRoots']['set'](_0xb86e2['rootName'],{'userId':_0x38ffab,'isAttached':_0xb86e2['isAdd']});}_handleRootAttributeOperation(_0x4d6826){const _0x317fdf=this['_diffRootsAttributes']['get'](_0x4d6826['root']['rootName']);null===_0x4d6826['newValue']?delete _0x317fdf[_0x4d6826['key']]:_0x317fdf[_0x4d6826['key']]=_0x4d6826['newValue'];}};function It(_0x166bcf){const _0x2663cf=St(_0x166bcf['rootName'],_0x166bcf['name'],_0x166bcf['isAttached']());for(const _0x37eacf of _0x166bcf['getChildren']()){const _0x50cd3e=_0x37eacf['_clone'](!0x0);_0x2663cf['_appendChild'](_0x50cd3e);}return _0x2663cf;}function St(_0x2bd0b2,_0x1a313e,_0x13c916=!0x0){const _0x24ffc3=new _0x5b0952();return _0x24ffc3['rootName']=_0x2bd0b2,_0x24ffc3['name']=_0x1a313e,_0x24ffc3['_isAttached']=_0x13c916,_0x24ffc3['isAttached']=()=>_0x24ffc3['_isAttached'],_0x24ffc3;}function Et(_0x20da2e,_0x5b8bbf,_0xcc8e79){const _0x2bc14a='elementEnd'==_0x20da2e['type']?_0xcc8e79['createPositionAt'](_0x20da2e['item'],'end'):_0xcc8e79['createPositionBefore'](_0x20da2e['item']);return _0xcc8e79['createPositionFromPath'](_0x5b8bbf,_0x2bc14a['path'],_0x2bc14a['stickiness']);}function Ot(_0x30ce44,_0x18cbc6,_0x16279d){const _0xca99c6='elementStart'==_0x30ce44['type']?_0x16279d['createPositionAt'](_0x30ce44['item'],0x0):_0x16279d['createPositionAfter'](_0x30ce44['item']);return _0x16279d['createPositionFromPath'](_0x18cbc6,_0xca99c6['path'],_0xca99c6['stickiness']);}const Ct=/* #__PURE__ -- @preserve */
25
- _0x3231bb(ut);var Nt=class extends Ct{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x451e31,_0x180ebb){super(_0x451e31),this['focusTracker']=new _0x4d9461(),this['keystrokes']=new _0x2ceefc(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x180ebb),this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-revision-history-save-revision-form','ck-responsive-form'],'tabindex':'-1'},'children':[this['revisionNameInputView']]}),this['initializeCssTransitionDisablerMixin']();}['render'](){super['render'](),mt({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x40c8a8=_0xe3428e=>_0xe3428e['stopPropagation']();this['keystrokes']['set']('arrowright',_0x40c8a8),this['keystrokes']['set']('arrowleft',_0x40c8a8),this['keystrokes']['set']('arrowup',_0x40c8a8),this['keystrokes']['set']('arrowdown',_0x40c8a8);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x417896){this['revisionNameInputView']['fieldView']['element']['value']=_0x417896['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x3916b4){const _0x5e3267=new tt(this['locale'],vt),_0x555ae=_0x5e3267['fieldView'];_0x555ae['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x4d812c=Rt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x3916b4&&(_0x4d812c+='\x20('+Rt(this['locale'],'optional')+')'),(_0x5e3267['label']=_0x4d812c,_0x555ae['on']('input',()=>{this['revisionNameInputValue']=_0x555ae['element']['value']['trim']();}),_0x5e3267);}},xt=class extends _0x245d60{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[kt];}['_saveRevisionFormView'];init(){const _0x96ddc4=this['editor'],_0x4f95f2=_0x96ddc4['plugins']['get']('RevisionTracker');_0x96ddc4['ui']['componentFactory']['add']('revisionHistory',_0x100e01=>{const _0x4c9f1c=ft(_0x100e01),_0x4b547d=_0x4c9f1c['panelView']['children'],_0x1e1c65=new et(_0x100e01),_0x353fbd=new it(_0x100e01),_0xd8b759=this['_createSaveRevisionButton'](_0x3cad3d),_0x2cc924=new it(_0x100e01),_0x2bad23=this['_createOpenRevisionButton'](_0x3cad3d);return _0x4c9f1c['bind']('isEnabled')['to'](_0x4f95f2,'isReady',_0x4f95f2,'isEnabled',_0x96ddc4,'isReadOnly',(_0x3e2de3,_0x18c360,_0x18dd4e)=>_0x3e2de3&&_0x18c360&&!_0x18dd4e),_0x4c9f1c['buttonView']['set']({'icon':_0x5bf3c2,'label':Rt(_0x100e01,'Revision\x20history'),'tooltip':!0x0}),_0xd8b759['set']({'withText':!0x0,'role':'menuitem'}),_0x2bad23['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x2bad23,'execute',()=>{_0x4c9f1c['isOpen']=!0x1,_0x96ddc4['editing']['view']['focus']();},{'priority':'low'}),_0x353fbd['children']['add'](_0xd8b759),_0x2cc924['children']['add'](_0x2bad23),_0x1e1c65['role']='menu',_0x1e1c65['items']['addMany']([_0x353fbd,_0x2cc924]),_0x4b547d['add'](_0x1e1c65),_0x4c9f1c;}),_0x96ddc4['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x1c153b=this['editor'],_0x175540=_0x1c153b['locale'],_0x3fc621=_0x1c153b['plugins']['get']('RevisionTracker'),_0x3f8f56=new rt(_0x175540),_0x17fef5=new ot(_0x175540);_0x3f8f56['bind']('isEnabled')['to'](_0x3fc621,'isReady',_0x3fc621,'isEnabled',_0x1c153b,'isReadOnly',(_0x324e1b,_0x3e6158,_0xd64f90)=>_0x324e1b&&_0x3e6158&&!_0xd64f90),_0x3f8f56['buttonView']['set']({'icon':_0x5bf3c2,'label':Rt(_0x175540,'Revision\x20history')});const _0x553b5b=new nt(_0x175540,_0x3f8f56),_0x3396da=this['_createSaveRevisionButton'](st);_0x3396da['delegate']('execute')['to'](_0x3f8f56),_0x553b5b['children']['add'](_0x3396da),_0x17fef5['items']['add'](_0x553b5b);const _0x809be9=new nt(_0x175540,_0x3f8f56),_0x1c8aae=this['_createOpenRevisionButton'](st);return _0x1c8aae['delegate']('execute')['to'](_0x3f8f56),_0x809be9['children']['add'](_0x1c8aae),_0x17fef5['items']['add'](_0x809be9),_0x3f8f56['panelView']['children']['add'](_0x17fef5),_0x3f8f56;}_createSaveRevisionButton(_0x48a00b){const _0x324213=this['editor'],_0x4f1249=_0x324213['plugins']['get']('RevisionTracker'),_0x43756a=new _0x48a00b(_0x324213['locale']);return _0x43756a['set']({'label':Rt(_0x324213['locale'],'Save\x20current\x20revision')}),_0x43756a['bind']('isEnabled')['to'](_0x4f1249,'isReady',_0x4f1249,'isEnabled',_0x324213,'isReadOnly',(_0x92c0e4,_0x1207c9,_0x5dcc34)=>_0x92c0e4&&_0x1207c9&&!_0x5dcc34),this['listenTo'](_0x43756a,'execute',()=>{this['_showDialog']();}),_0x43756a;}_createOpenRevisionButton(_0x4788ff){const _0xa9b23=this['editor'],_0x3baeae=_0xa9b23['plugins']['get']('RevisionTracker'),_0x307bc9=new _0x4788ff(_0xa9b23['locale']);return _0x307bc9['set']({'label':Rt(_0xa9b23['locale'],'Open\x20revision\x20history')}),_0x307bc9['bind']('isEnabled')['to'](_0x3baeae,'isReady',_0xa9b23,'isReadOnly',(_0x3fa099,_0x39f2b1)=>_0x3fa099&&!_0x39f2b1),this['listenTo'](_0x307bc9,'execute',()=>{_0xa9b23['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x307bc9;}['_showDialog'](){const _0x2833e2=this['editor'],_0x5c9f2c=_0x2833e2['locale'],_0x419373=_0x2833e2['plugins']['get']('Dialog'),_0x4f5b8f=_0x2833e2['plugins']['get']('RevisionTracker');function _0x57d5a3(_0x5016e7){_0x2833e2['config']['get']('revisionHistory.requireRevisionName')&&''===_0x5016e7['revisionName']?_0x5016e7['revisionNameInputView']['errorText']=Rt(_0x5c9f2c,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x2833e2['plugins']['get'](kt)['saveRevision']({'name':_0x5016e7['revisionName']}),_0x419373['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x57d5a3(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x419373['show']({'id':'revisionSave','title':Rt(_0x5c9f2c,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':Rt(_0x2833e2['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x419373['hide']()},{'label':Rt(_0x2833e2['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x159598){_0x159598['bind']('isEnabled')['to'](_0x4f5b8f,'isReady',_0x4f5b8f,'isEnabled',_0x2833e2,'isReadOnly',(_0x26ccf5,_0x4ec068,_0x3878e9)=>_0x26ccf5&&_0x4ec068&&!_0x3878e9);},'onExecute':()=>_0x57d5a3(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0x4dd078=this['editor'],_0x2f59a0=_0x4dd078['locale'];this['_saveRevisionFormView']=new Nt(_0x2f59a0,_0x4dd078['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Dt=class extends ut{['changeId'];['_model'];constructor(_0x1a32db,_0x469838,_0x64df02=!0x1){super(_0x1a32db),this['_model']=_0x469838,this['changeId']=_0x469838['id'];const _0x2b6c2d=this['bindTemplate'],_0x2c0735=_0x64df02&&!!_0x469838['data']['aiSource'],_0x1fdcbf=_0x2c0735?this['_createAiIconView'](_0x1a32db):null;this['set']('type',_0x469838['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x2b6c2d['to']('type',_0x5057cb=>'ck-revision-change__'+_0x5057cb),..._0x2c0735?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x2c0735?[this['_createAiDescriptionView'](_0x1a32db,_0x469838),_0x1fdcbf]:this['_getDescriptionChildren'](_0x1a32db,_0x469838)}]});}_getDescriptionChildren(_0x3e0c03,_0x199fb2){let _0x5e7752='Removed\x20by';return _0x199fb2['data']['isSuggestion']?_0x5e7752='Suggested\x20by':'add'==_0x199fb2['type']&&(_0x5e7752='Added\x20by'),[this['_createLabel'](Rt(_0x3e0c03,_0x5e7752)),{'text':'\x20'+_0x199fb2['author']['name']}];}_createAiDescriptionView(_0x486a89,_0x1f6870){let _0x30b33f='AI_SOURCE_REMOVED_BY';_0x1f6870['data']['isSuggestion']?_0x30b33f='AI_SOURCE_SUGGESTED_BY':'add'==_0x1f6870['type']&&(_0x30b33f='AI_SOURCE_ADDED_BY');const _0x1ed2b3=new ut(_0x486a89);return _0x1ed2b3['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x1ed2b3['render'](),_0x1ed2b3['element']['innerHTML']=Rt(_0x486a89,_0x30b33f,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+Rt(_0x486a89,'AI_SOURCE_AI')+'</span>']),_0x1ed2b3['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x1f6870['author']['name'],_0x1ed2b3;}_createLabel(_0xbff96f){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0xbff96f}]};}_createAiIconView(_0x100866){const _0x5c8050=new _0x203f2d();return _0x5c8050['content']=_0x32cbb7,_0x5c8050['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':Rt(_0x100866,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x5c8050;}['focus'](){this['element']['focus']();}};const Vt=/* #__PURE__ -- @preserve */
26
- _0x591c98();var Tt=class extends Vt{['id'];author;type;data;rootName;constructor(_0x392f5b){super(),this['id']=_0x392f5b['id']||_0x3a243d(),this['author']=_0x392f5b['author'],this['type']=_0x392f5b['type'],this['data']=_0x392f5b['data']||{},this['rootName']=_0x392f5b['rootName'],this['set']('createdAt',_0x392f5b['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Mt=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x1363bb,_0xe835aa){this['newRevisionId']=_0x1363bb,this['oldRevisionId']=_0xe835aa,this['changes']=new _0x1b928b();}_setChanges(_0x54fe89){for(const _0x172f7f of _0x54fe89)this['changes']['add'](_0x172f7f);}},Ht=class extends _0x245d60{repository;adapter=null;_getVisibleCommentThreadIds=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];_showCommentHighlights;static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x124f7c,_0x2fe268,yt,bt];}constructor(_0x1a9377){super(_0x1a9377),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['set']('activeChange',null),this['set']('activeView',null),this['_activeViewTarget']=null,this['set']('diff',null),this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['on']('change:isEnabled',(_0xf50aec,_0x5d70b6,_0x5b2728)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x1d73ad=>{for(const _0x12eead of this['editor']['editing']['view']['document']['roots'])_0x5b2728?_0x1d73ad['removeClass']('ck-editor__editable__overlay',_0x12eead):_0x1d73ad['addClass']('ck-editor__editable__overlay',_0x12eead);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x623861=>null!==_0x623861),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x404ad8,_0x4c6316,_0x570f53)=>_0x404ad8&&_0x570f53?_0x4c6316['changes']['getIndex'](_0x570f53):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0xb70d8,_0x3511c8)=>_0xb70d8?_0x3511c8['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x2fe268),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x193ab0=this['editor'],_0x170dd6=new Ft(_0x193ab0,{'direction':'backward'}),_0xf0afae=new Ft(_0x193ab0,{'direction':'forward'});_0x193ab0['commands']['add']('showPreviousChange',_0x170dd6),_0x193ab0['commands']['add']('showNextChange',_0xf0afae),_0x193ab0['commands']['add']('restoreRevision',new Lt(_0x193ab0)),this['on']('change:numberOfChanges',()=>{_0x170dd6['refresh'](),_0xf0afae['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x193ab0['enableReadOnlyMode']('revision-viewer'),_0x193ab0['plugins']['has']('WidgetToolbarRepository')&&_0x193ab0['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x557a8a){return await this['_utils']['loadRevisionData'](_0x557a8a,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x557a8a);}async getRevisionRootsAttributes(_0x46ae95){return await this['_utils']['loadRevisionData'](_0x46ae95,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x46ae95);}async['compare'](_0x16bea5,_0x1e2880,_0x8aba04=!0x1){if(!this['isEnabled'])return;const _0xca187=this['diff'],_0x3e2898=this['repository'],_0x4830df='string'==typeof _0x16bea5?_0x3e2898['getRevision'](_0x16bea5):_0x16bea5,_0x556cb3='string'==typeof _0x1e2880?_0x3e2898['getRevision'](_0x1e2880):_0x1e2880,_0x705a45=_0x4830df['id'],_0x23b6b7=_0x556cb3?_0x556cb3['id']:null;if(!_0x8aba04&&this['diff']&&this['diff']['newRevisionId']===_0x705a45&&this['diff']['oldRevisionId']===_0x23b6b7)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Mt(_0x705a45,_0x23b6b7);const _0x219f9e=this['_getRevisionsRange'](_0x4830df,_0x556cb3,!0x0)['map'](_0x4e7ede=>this['_utils']['loadRevisionData'](_0x4e7ede,this['adapter']));return _0x219f9e['push'](new Promise(_0x513b88=>{setTimeout(_0x513b88,0x14);})),Promise['all'](_0x219f9e)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x45586b=this['_getDiff'](_0x705a45,_0x23b6b7);this['_cleanUpCommentMarkers'](_0x45586b);for(const _0x33dd4a of _0x45586b['changes'])this['_changeIdToChange']['set'](_0x33dd4a['id'],_0x33dd4a);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x2db3e9=>{for(const _0x334ded of this['editor']['model']['document']['getRootNames']())_0x2db3e9['detachRoot'](_0x334ded);for(const _0x210cad of Object['keys'](_0x45586b['model'])){const _0x129e06=_0x45586b['model'][_0x210cad]['name'],_0x508df6=_0x2db3e9['addRoot'](_0x210cad,_0x129e06);for(const _0x42a499 of Object['keys'](_0x45586b['attributes'][_0x210cad]))_0x2db3e9['setAttribute'](_0x42a499,_0x45586b['attributes'][_0x210cad][_0x42a499],_0x508df6);_0x2db3e9['insert'](_0x45586b['model'][_0x210cad],_0x508df6,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x45586b['changes'])),this['isReady']=!0x0;})['catch'](_0x56e741=>{console['error'](_0x56e741),this['_cleanUp'](),_0xca187&&(this['diff']=_0xca187),this['isReady']=!0x0;});}addRevisionData(_0x480757,_0x2277c9){const _0x438155=this['repository']['createRevision'](_0x480757);return _0x438155['on']('_update',(_0x40def5,_0x50476f,_0x286a80)=>_0x2277c9(_0x50476f,_0x286a80,_0x438155)),this['repository']['addRevision'](_0x438155),_0x438155;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x113645=>{for(const _0x590389 of this['editor']['model']['document']['getRootNames']())_0x113645['detachRoot'](_0x590389);});}_cleanUpCommentMarkers(_0x147a77){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x4b763c=this['_getVisibleCommentThreadIds']();for(const _0x5b89a4 of Object['values'](_0x147a77['model']))for(const _0x479a07 of Array['from'](_0x5b89a4['markers']['keys']()))_0x479a07['startsWith']('revision-comment:')&&!_0x4b763c['has'](Pt(_0x479a07))&&_0x5b89a4['markers']['delete'](_0x479a07);}_sortAndFilterDiffChanges(_0x476c60){const _0x5ed7f0=[],_0x4dcd6a=new Map();for(const _0x44df27 of this['editor']['model']['document']['getRootNames']()){const _0x132565=this['editor']['editing']['view']['getDomRoot'](_0x44df27);if(!_0x132565)continue;const _0x4305c9=_0x132565['getClientRects']()['item'](0x0);_0x4305c9&&(_0x5ed7f0['push'](_0x44df27),_0x4dcd6a['set'](_0x44df27,_0x4305c9));}return _0x5ed7f0['sort']((_0x160e79,_0x2a7aba)=>{const _0x14cc61=_0x4dcd6a['get'](_0x160e79),_0x348399=_0x4dcd6a['get'](_0x2a7aba);return _0x14cc61['y']-_0x348399['y']||_0x14cc61['x']-_0x348399['x'];}),(_0x476c60=_0x476c60['filter'](_0x478b51=>_0x5ed7f0['includes'](_0x478b51['rootName'])))['sort']((_0x396561,_0x4288e0)=>_0x5ed7f0['indexOf'](_0x396561['rootName'])-_0x5ed7f0['indexOf'](_0x4288e0['rootName'])),_0x476c60;}['_makeTape'](_0x63e71d,_0x4c9c5c={}){const _0x55e0cf=Array['from'](_0x63e71d['markers'])['filter'](([_0x5427ef,_0x409b05])=>_0x5427ef['startsWith']('revision:')&&!_0x409b05['isCollapsed']),_0x177d41=Array['from'](this['editor']['model']['createRangeIn'](_0x63e71d)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x55e0cf['length'])for(const _0x211e77 of _0x177d41){const [_0x2976f9,_0x4056d2]=_0x55e0cf[0x0],[,_0xa3330d,_0x1df2e1]=_0x2976f9['split'](':'),_0xbda463=_0x4c9c5c[_0x2976f9]||null;if(_0x4056d2['end']['isEqual'](_0x211e77['nextPosition'])&&_0x55e0cf['shift'](),(_0x211e77['previousPosition']['isEqual'](_0x4056d2['start'])||_0x211e77['previousPosition']['isAfter'](_0x4056d2['start']))&&('insertion'==_0xa3330d?_0x211e77['isAdded']={'userId':_0x1df2e1,'aiSource':_0xbda463}:'deletion'==_0xa3330d&&(_0x211e77['isRemoved']={'userId':_0x1df2e1,'aiSource':_0xbda463})),0x0==_0x55e0cf['length'])break;}return _0x177d41;}_refreshStartEndIndex(_0x48ceda){const _0x1a4ecd=new Map();for(let _0x4f2a5c=0x0;_0x4f2a5c<_0x48ceda['length'];_0x4f2a5c++)'text'===_0x48ceda[_0x4f2a5c]['type']?(_0x48ceda[_0x4f2a5c]['item']['startIndex']=_0x4f2a5c,_0x48ceda[_0x4f2a5c]['item']['endIndex']=_0x4f2a5c):('elementStart'===_0x48ceda[_0x4f2a5c]['type']?_0x48ceda[_0x4f2a5c]['item']['startIndex']=_0x4f2a5c:'elementEnd'===_0x48ceda[_0x4f2a5c]['type']&&(_0x48ceda[_0x4f2a5c]['item']['endIndex']=_0x4f2a5c),_0x1a4ecd['set'](_0x48ceda[_0x4f2a5c]['id'],_0x4f2a5c));for(const _0x40ba68 of _0x1a4ecd['values']())'elementStart'===_0x48ceda[_0x40ba68]['type']?_0x48ceda[_0x40ba68]['item']['endIndex']=_0x1a4ecd['get'](_0x48ceda[_0x40ba68]['pairId']):'elementEnd'===_0x48ceda[_0x40ba68]['type']&&(_0x48ceda[_0x40ba68]['item']['startIndex']=_0x1a4ecd['get'](_0x48ceda[_0x40ba68]['pairId']));}['_processTape'](_0x469528){for(let _0x36fa4f=0x0;_0x36fa4f<_0x469528['length'];_0x36fa4f++){if('elementStart'===_0x469528[_0x36fa4f]['type'])_0x469528[_0x36fa4f]['item']['startIndex']=_0x36fa4f;else{if('elementEnd'===_0x469528[_0x36fa4f]['type']){_0x469528[_0x36fa4f]['item']['endIndex']=_0x36fa4f;const _0x3d7f9f=_0x469528[_0x36fa4f]['item']['startIndex'];_0x469528[_0x3d7f9f]['pairId']=_0x469528[_0x36fa4f]['id'],_0x469528[_0x36fa4f]['pairId']=_0x469528[_0x3d7f9f]['id'];}else _0x469528[_0x36fa4f]['item']['startIndex']=_0x36fa4f,_0x469528[_0x36fa4f]['item']['endIndex']=_0x36fa4f,_0x469528[_0x36fa4f]['pairId']=null;}_0x469528[_0x36fa4f]['markersStart']||(_0x469528[_0x36fa4f]['markersStart']=[],_0x469528[_0x36fa4f]['markersEnd']=[]);}}_markInsertions(_0x566818,_0x41eb94){const _0x3f6ba5=_0x566818['filter'](_0x201992=>!_0x201992['isAdded']);for(let _0xe0daef=0x0;_0xe0daef<_0x41eb94['length'];_0xe0daef++)_0x41eb94[_0xe0daef]['isAdded']&&(_0x3f6ba5[_0xe0daef]['isAdded']=_0x41eb94[_0xe0daef]['isAdded']);}_getDiff(_0x423099,_0x4d1fc6=null){const _0x5f1191=this['repository']['getRevision'](_0x423099),_0x3dec57=_0x4d1fc6?this['repository']['getRevision'](_0x4d1fc6):null,_0x591805=this['_getRevisionsRange'](_0x5f1191,_0x3dec57),_0x1e8ab7=_0x591805[_0x591805['length']-0x1],_0x422b0e=new Map(),_0x309b4f={'model':{},'attributes':{},'changes':[]},_0x322d72=new Set(),_0x1dddbc=new Map();for(let _0x3c3e5d=_0x591805['length']-0x1;_0x3c3e5d>=0x0;_0x3c3e5d--){const _0x4235a2=_0x591805[_0x3c3e5d];for(const _0x4ca13b of Object['keys'](_0x4235a2['diffData']))if(_0x4235a2['diffData'][_0x4ca13b]['attachChange']){const _0x5b39f0=_0x4235a2['diffData'][_0x4ca13b]['attachChange'];_0x5b39f0['isAttached']?(_0x322d72['add'](_0x4ca13b),_0x1dddbc['has'](_0x4ca13b)&&_0x1dddbc['get'](_0x4ca13b)['userId']==_0x5b39f0['userId']?_0x1dddbc['delete'](_0x4ca13b):_0x1dddbc['set'](_0x4ca13b,_0x5b39f0)):_0x1dddbc['has'](_0x4ca13b)?(_0x322d72['delete'](_0x4ca13b),_0x1dddbc['delete'](_0x4ca13b)):(_0x322d72['add'](_0x4ca13b),_0x1dddbc['set'](_0x4ca13b,_0x5b39f0));}else _0x322d72['add'](_0x4ca13b);}for(const _0x1239ea of _0x322d72){const _0x9057f5=_0x1dddbc['has'](_0x1239ea)&&!_0x1dddbc['get'](_0x1239ea)['isAttached'];let _0x3f4bc4=_0x9057f5?_0x591805['length']-0x1:0x0;const _0x5c3983=_0x9057f5?-0x1:0x1;for(;_0x591805[_0x3f4bc4];){const _0xb9a9c3=_0x591805[_0x3f4bc4];if(_0xb9a9c3['diffData'][_0x1239ea]){const _0x5276d3=_0x9057f5?_0xb9a9c3['diffData'][_0x1239ea]['attributesBefore']:_0xb9a9c3['diffData'][_0x1239ea]['attributesAfter'];_0x309b4f['attributes'][_0x1239ea]=_0x5276d3?_0x4c4837(_0x5276d3):{};break;}_0x3f4bc4+=_0x5c3983;}}for(const _0x6b1e09 of _0x591805){_0x6b1e09['model']={};for(const _0x3e1606 of _0x6b1e09['authors'])_0x422b0e['set'](_0x3e1606['id'],_0x3e1606);for(const _0x42c89e of _0x322d72){const _0x559077=_0x6b1e09['diffData'][_0x42c89e]?_0x6b1e09['diffData'][_0x42c89e]['insertions']:'[]',_0x56f64a=_0x6b1e09['diffData'][_0x42c89e]?_0x6b1e09['diffData'][_0x42c89e]['deletions']:'[]',_0x505dc6=_0x6b1e09['diffData'][_0x42c89e]?.['rootElementName']||'$root';_0x6b1e09['model'][_0x42c89e]={'insertions':this['_utils']['_makeModelFromViewString'](_0x559077,_0x505dc6),'deletions':this['_utils']['_makeModelFromViewString'](_0x56f64a,_0x505dc6)};}}for(const _0x4431a1 of _0x322d72){let _0x1e7ff4=null,_0x1ee623=0x0;const _0x1dc296=_0x591805['map'](_0xf615d0=>_0xf615d0['diffData'][_0x4431a1]?.['rootElementName'])['find'](_0x550e79=>void 0x0!==_0x550e79)||'$root',_0x2c48ee=new Map(Array['from'](_0x5f1191['model'][_0x4431a1]['insertions']['markers'])['filter'](([_0x3007f2])=>!_0x3007f2['startsWith']('revision:')));let _0x1785c1=0x0;for(const _0x2bb0bd of _0x591805){const _0xbced01=_0x2bb0bd['diffData'][_0x4431a1]?.['aiSources']||{},_0x5627fb=this['_makeTape'](_0x2bb0bd['model'][_0x4431a1]['insertions'],_0xbced01);_0x2bb0bd==_0x5f1191?(_0x1e7ff4=_0x5627fb,_0x1ee623=_0x1e7ff4['length'],_0x1e7ff4['forEach'](_0x2fe71f=>{_0x2fe71f['id']=_0x1785c1++;}),this['_processTape'](_0x1e7ff4)):this['_markInsertions'](_0x1e7ff4,_0x5627fb);const _0x4b5a1a=_0x1e7ff4['filter'](_0x5b3ceb=>!_0x5b3ceb['isAdded'])['map'](_0x37aee2=>_0x37aee2['id']);let _0x5a1234=0x0;const _0x47ffc9=this['_makeTape'](_0x2bb0bd['model'][_0x4431a1]['deletions'],_0xbced01);_0x47ffc9['forEach'](_0x5e3a85=>{_0x5e3a85['isRemoved']?_0x5e3a85['id']=_0x1ee623++:_0x5e3a85['id']=_0x4b5a1a[_0x5a1234++];}),this['_processTape'](_0x47ffc9),this['_setDistance'](_0x1e7ff4,'isAdded'),this['_setDistance'](_0x47ffc9,'isRemoved'),_0x2bb0bd==_0x5f1191&&this['_markMarkers'](_0x1e7ff4,_0x2c48ee),_0x1e7ff4=this['_joinTapes'](_0x1e7ff4,_0x47ffc9),this['_refreshStartEndIndex'](_0x1e7ff4),this['_setDistance'](_0x1e7ff4,'isRemoved');}_0x1e7ff4=_0x1e7ff4['filter'](_0x2942a2=>!(_0x2942a2['isAdded']&&_0x2942a2['isRemoved']));const _0x44af5d=new Map(_0x1e8ab7['model'][_0x4431a1]['deletions']['markers']),_0x5f46a0=new Set(_0x2c48ee['keys']());for(const _0x4cf37f of _0x44af5d['keys']())_0x5f46a0['delete'](_0x4cf37f);const _0x53230a=Object['assign']({},..._0x591805['map'](_0x42b9d5=>_0x42b9d5['diffData'][_0x4431a1]?.['aiSources']));this['_markSuggestions'](_0x1e7ff4,_0x5f46a0,_0x53230a),this['_fixObsoleteTags'](_0x1e7ff4),_0x1e7ff4=this['_removeMissingPairs'](_0x1e7ff4),_0x1e7ff4=this['_markMismatchedRemovedTags'](_0x1e7ff4),_0x1e7ff4=this['_removeUnsupportedChanges'](_0x1e7ff4);const {root:_0x145242,changes:_0x5e5f77}=this['_makeModelFromTape'](_0x1e7ff4,_0x422b0e,_0x4431a1,_0x1dc296);_0x309b4f['model'][_0x4431a1]=_0x145242;const _0x3ca823=_0x1dddbc['get'](_0x4431a1);if(_0x3ca823){const _0x3580a0=_0x422b0e['get'](_0x3ca823['userId']),_0x45e06a=new Tt({'author':_0x3580a0,'type':_0x3ca823['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x4431a1});_0x5e5f77['unshift'](_0x45e06a),_0x309b4f['attributes'][_0x4431a1]['revisionHistoryAttachChange']=_0x45e06a['id'];}_0x309b4f['changes']=_0x309b4f['changes']['concat'](_0x5e5f77);}return _0x309b4f;}['_markMarkers'](_0x33bbd5,_0x4cb0b0){for(let _0x36e7c8=0x0;_0x36e7c8<_0x33bbd5['length'];_0x36e7c8++)for(const [_0x2041fa,_0x3160df]of _0x4cb0b0)!_0x3160df['isCollapsed']&&_0x3160df['start']['isEqual'](_0x33bbd5[_0x36e7c8]['previousPosition'])&&_0x33bbd5[_0x36e7c8]['markersStart']['push'](_0x2041fa),_0x3160df['end']['isEqual'](_0x33bbd5[_0x36e7c8]['nextPosition'])&&_0x33bbd5[_0x36e7c8]['markersEnd']['push'](_0x2041fa);}['_joinTapes'](_0x480a68,_0x527ebd){let _0x18f346=[],_0x5ce1e1=0x0,_0x37933c=0x0;for(;_0x5ce1e1<_0x480a68['length']||_0x37933c<_0x527ebd['length'];){const _0x31fef5=_0x480a68[_0x5ce1e1]||{},_0x15f5a6=_0x527ebd[_0x37933c]||{};if(_0x31fef5['id']==_0x15f5a6['id'])_0x5ce1e1++,_0x37933c++,_0x18f346['push'](_0x31fef5);else{if(_0x15f5a6['isRemoved']&&_0x31fef5['isAdded']){const {commonTape:_0x47aa20,iEnd:_0x3d4f4c,jEnd:_0x1890f8}=this['_threeWayMerge'](_0x480a68,_0x5ce1e1,_0x527ebd,_0x37933c);_0x18f346=_0x18f346['concat'](_0x47aa20),_0x5ce1e1=_0x3d4f4c,_0x37933c=_0x1890f8;}else _0x15f5a6['isRemoved']?(_0x37933c++,_0x18f346['push'](_0x15f5a6)):(_0x5ce1e1++,_0x18f346['push'](_0x31fef5));}}return _0x18f346;}_markSuggestions(_0x322393,_0x3fc7c4,_0xf21d3b){const _0x4465a2=[];for(let _0x20805e=0x0;_0x20805e<_0x322393['length'];_0x20805e++){for(let _0x5bf277=0x0;_0x5bf277<_0x322393[_0x20805e]['markersStart']['length'];_0x5bf277++){const _0x11a713=_0x322393[_0x20805e]['markersStart'][_0x5bf277];if(!_0x3fc7c4['has'](_0x11a713))continue;const {group:_0x2aa208,type:_0x8a3828,authorId:_0x531093}=_0x425555(_0x11a713);if('revision-suggestion'!=_0x2aa208||'insertion'!=_0x8a3828&&'deletion'!=_0x8a3828)continue;const _0x1b01aa=_0xf21d3b['suggestion:'+_0x11a713['slice'](0x14)]||null;_0x4465a2['unshift']({'type':_0x8a3828,'name':_0x11a713,'userId':_0x531093,'aiSource':_0x1b01aa}),_0x322393[_0x20805e]['markersStart']['splice'](_0x5bf277,0x1),_0x5bf277--;}_0x3471f2(_0x322393[_0x20805e]);for(let _0x3b0432=0x0;_0x3b0432<_0x322393[_0x20805e]['markersEnd']['length'];_0x3b0432++){const _0x5f11e5=_0x322393[_0x20805e]['markersEnd'][_0x3b0432];if(!_0x3fc7c4['has'](_0x5f11e5))continue;const {group:_0x467066,type:_0x1e2a42}=_0x425555(_0x5f11e5);if('revision-suggestion'!=_0x467066||'insertion'!=_0x1e2a42&&'deletion'!=_0x1e2a42)continue;_0x322393[_0x20805e]['markersEnd']['splice'](_0x3b0432,0x1),_0x3b0432--;const _0x2ef786=_0x4465a2['findIndex'](_0x42387e=>_0x42387e['name']==_0x5f11e5);_0x2ef786>-0x1&&_0x4465a2['splice'](_0x2ef786,0x1);}}function _0x425555(_0x25459e){const _0x5cfab5=_0x25459e['split'](':');return{'group':_0x5cfab5[0x0],'type':_0x5cfab5[0x1],'subType':_0x5cfab5['length']>=0x5?_0x5cfab5[0x2]:null,'id':_0x5cfab5['length']<0x5?_0x5cfab5[0x2]:_0x5cfab5[0x3],'authorId':_0x5cfab5['length']<0x5?_0x5cfab5[0x3]:_0x5cfab5[0x4],'markerCount':0x6==_0x5cfab5['length']?_0x5cfab5[0x5]:null};}function _0x3471f2(_0x1fc81c){for(let _0x3fabf6=0x0;_0x3fabf6<_0x4465a2['length'];_0x3fabf6++){if(_0x1fc81c['isAdded']&&'insertion'==_0x4465a2[_0x3fabf6]['type']&&_0x1fc81c['isAdded']['userId']==_0x4465a2[_0x3fabf6]['userId'])return _0x1fc81c['isAddSuggestion']={..._0x4465a2[_0x3fabf6],'aiSource':_0x1fc81c['isAdded']['aiSource']||_0x4465a2[_0x3fabf6]['aiSource']},void delete _0x1fc81c['isAdded'];if(!_0x1fc81c['isAdded']&&!_0x1fc81c['isRemoved']&&'deletion'==_0x4465a2[_0x3fabf6]['type'])return void(_0x1fc81c['isRemoveSuggestion']=_0x4465a2[_0x3fabf6]);}}}_setDistance(_0x281610,_0x2383f7){let _0x58366c=0x0,_0x255d7c=!0x1;const _0x2ac573=new Map();for(const _0x21d3ae of _0x281610)_0x21d3ae[_0x2383f7]?_0x255d7c&&(_0x58366c++,_0x255d7c=!0x1):(_0x58366c++,_0x255d7c=!0x0),_0x2ac573['set'](_0x21d3ae['id'],_0x58366c);for(let _0x185cf5=0x0;_0x185cf5<_0x281610['length'];_0x185cf5++){if('isRemoved'==_0x2383f7&&_0x281610[_0x185cf5]['isAdded']||'isAdded'==_0x2383f7&&_0x281610[_0x185cf5]['isRemoved'])continue;if('text'==_0x281610[_0x185cf5]['type']){_0x281610[_0x185cf5]['distance']=0x0;continue;}const _0x33954c=_0x2ac573['get'](_0x281610[_0x185cf5]['pairId']),_0x51561a=_0x2ac573['get'](_0x281610[_0x185cf5]['id']);_0x281610[_0x185cf5]['distance']=_0x33954c-_0x51561a;}}_getRevisionsRange(_0x23530f,_0x54879a,_0x25ab53=!0x1){const _0x213989=[];let _0x1442e2=this['repository']['getIndex'](_0x23530f),_0x1cfc6f=this['repository']['getIndex'](_0x54879a);for(-0x1==_0x1cfc6f&&(_0x1cfc6f=this['repository']['_revisions']['length'],_0x25ab53=!0x1);_0x1442e2<_0x1cfc6f;)_0x213989['push'](this['repository']['getRevision'](_0x1442e2)),_0x1442e2++;return _0x25ab53&&_0x213989['push'](this['repository']['getRevision'](_0x1442e2)),_0x213989;}_threeWayMerge(_0x3c4d8f,_0x21850d,_0x511de4,_0x23efc4){const _0x3127bb=this['editor']['model']['schema'];let _0x2fcb0d=_0x21850d;for(;_0x3c4d8f[_0x2fcb0d]&&_0x3c4d8f[_0x2fcb0d]['isAdded'];)_0x2fcb0d++;let _0x4f1248=_0x23efc4;for(;_0x511de4[_0x4f1248]&&_0x511de4[_0x4f1248]['isRemoved'];)_0x4f1248++;_0x2b7371(_0x3c4d8f,_0x21850d,_0x2fcb0d),_0x2b7371(_0x511de4,_0x23efc4,_0x4f1248);const _0x31e049=_0x511de4['slice'](_0x23efc4,_0x4f1248)['concat'](_0x3c4d8f['slice'](_0x21850d,_0x2fcb0d));return _0x31e049['sort']((_0x2f121e,_0x5e11bd)=>_0x2f121e['side']!=_0x5e11bd['side']?_0x2f121e['side']-_0x5e11bd['side']:_0x2f121e['level']!=_0x5e11bd['level']?_0x2f121e['level']-_0x5e11bd['level']:_0x2f121e['distance']!=_0x5e11bd['distance']?_0x5e11bd['distance']-_0x2f121e['distance']:!!_0x2f121e['isAdded']!=!!_0x5e11bd['isAdded']?-0x1==_0x2f121e['side']||0x0==_0x2f121e['side']?_0x2f121e['isAdded']?-0x1:0x1:_0x2f121e['isAdded']?0x1:-0x1:_0x2f121e['index']-_0x5e11bd['index']),{'commonTape':_0x31e049,'iEnd':_0x2fcb0d,'jEnd':_0x4f1248};function _0x2b7371(_0x5d7937,_0x424cec,_0x3e657d){let _0x5d78fc=-0x1,_0x58b9e2=Number['POSITIVE_INFINITY'],_0x473b7e=!0x0;for(let _0xe8cc19=_0x424cec;_0xe8cc19<_0x3e657d;_0xe8cc19++)if(_0x3127bb['isInline'](_0x5d7937[_0xe8cc19]['item'])||(_0x473b7e=!0x1),_0x5d7937[_0xe8cc19]['item']['startIndex']<_0x424cec&&(_0x5d78fc=_0xe8cc19),_0x5d7937[_0xe8cc19]['item']['endIndex']>=_0x3e657d){_0x58b9e2=_0xe8cc19;break;}_0x473b7e&&(_0x5d78fc=_0x3e657d-0x1);for(let _0x456d84=_0x424cec;_0x456d84<_0x3e657d;_0x456d84++)_0x5d7937[_0x456d84]['side']=_0x456d84<=_0x5d78fc?-0x1:_0x456d84<_0x58b9e2?0x0:0x1,_0x5d7937[_0x456d84]['index']=_0x456d84;let _0x35e4e2=0x0;for(let _0x40d595=_0x424cec;_0x40d595<=_0x5d78fc;_0x40d595++)0x0==_0x5d7937[_0x40d595]['distance']?_0x5d7937[_0x40d595]['level']=_0x35e4e2:(_0x35e4e2++,_0x5d7937[_0x40d595]['level']=_0x35e4e2,_0x35e4e2++);for(let _0x554b67=_0x424cec;_0x554b67<_0x3e657d;_0x554b67++)0x0==_0x5d7937[_0x554b67]['side']&&(_0x5d7937[_0x554b67]['level']=_0x35e4e2);_0x35e4e2=0x0;for(let _0x1fa63b=_0x3e657d-0x1;_0x1fa63b>=_0x58b9e2;_0x1fa63b--)0x0==_0x5d7937[_0x1fa63b]['distance']?_0x5d7937[_0x1fa63b]['level']=_0x35e4e2:(_0x35e4e2--,_0x5d7937[_0x1fa63b]['level']=_0x35e4e2,_0x35e4e2--);}}_fixObsoleteTags(_0x4c80d6){const _0x5bdae8=new Map(),_0x980471=this['editor']['model']['schema'];for(let _0x16df41=0x1;_0x16df41<_0x4c80d6['length'];_0x16df41++){let _0x356e8b,_0x16fc46,_0x591d08;const _0x415d73=_0x4c80d6[_0x16df41],_0x18b4a0=_0x4c80d6[_0x16df41-0x1];if('text'==_0x415d73['type'])continue;if(_0x415d73['type']!=_0x18b4a0['type'])continue;if(!_0x980471['isBlock'](_0x18b4a0['item'])||_0x980471['isLimit'](_0x18b4a0['item']))continue;if(!_0x980471['isBlock'](_0x415d73['item'])||_0x980471['isLimit'](_0x415d73['item']))continue;if((_0x4c80d6[_0x16df41]['isAdded']||_0x4c80d6[_0x16df41]['isAddSuggestion'])&&_0x4c80d6[_0x16df41-0x1]['isRemoved'])_0x356e8b=_0x4c80d6[_0x16df41],_0x16fc46=_0x4c80d6[_0x16df41-0x1],_0x591d08=_0x16df41-0x1;else{if(!_0x4c80d6[_0x16df41]['isRemoved']||!_0x4c80d6[_0x16df41-0x1]['isAdded']&&!_0x4c80d6[_0x16df41-0x1]['isAddSuggestion'])continue;_0x356e8b=_0x4c80d6[_0x16df41-0x1],_0x16fc46=_0x4c80d6[_0x16df41],_0x591d08=_0x16df41;}const _0x59d601=_0x356e8b['level']==_0x16fc46['level'],_0x59d78a=Math['abs'](_0x356e8b['level'])<Math['abs'](_0x16fc46['level'])&&0x0==_0x16fc46['distance'];(_0x59d601||_0x59d78a)&&(_0x5bdae8['set'](_0x16fc46['id'],_0x356e8b['id']),_0x4c80d6['splice'](_0x591d08,0x1),_0x16df41--,_0x356e8b['isAdded']=!0x1);}for(let _0x52df3b=0x0;_0x52df3b<_0x4c80d6['length'];_0x52df3b++)_0x5bdae8['has'](_0x4c80d6[_0x52df3b]['pairId'])&&(_0x4c80d6[_0x52df3b]['pairId']=_0x5bdae8['get'](_0x4c80d6[_0x52df3b]['pairId']));}['_removeMissingPairs'](_0x539b5a){const _0x1c4e85=new Set(_0x539b5a['map'](_0x30dc1b=>_0x30dc1b['id']));for(let _0x15a9c8=0x0;_0x15a9c8<_0x539b5a['length'];_0x15a9c8++)_0x1c4e85['has'](_0x539b5a[_0x15a9c8]['pairId'])||0x0==_0x539b5a[_0x15a9c8]['distance']||(_0x539b5a[_0x15a9c8]['isIncorrect']=!0x0);return _0x539b5a['filter'](_0x10e8e8=>!_0x10e8e8['isIncorrect']);}_markMismatchedRemovedTags(_0x5a8fbf){const _0x282f14=new Set();for(let _0x586bc5=0x0;_0x586bc5<_0x5a8fbf['length'];_0x586bc5++){if(_0x282f14['has'](_0x5a8fbf[_0x586bc5]['id'])&&_0x5a8fbf[_0x586bc5]['isRemoved']&&(_0x5a8fbf[_0x586bc5]['isIncorrect']=!0x0),_0x5a8fbf[_0x586bc5]['isIncorrect'])continue;if(0x0==_0x5a8fbf[_0x586bc5]['distance'])continue;if('elementStart'!=_0x5a8fbf[_0x586bc5]['type'])continue;if(null==_0x5a8fbf[_0x586bc5]['pairId'])continue;let _0x3dd37c=_0x586bc5+0x1,_0xbde2a4=0x0;for(;_0x5a8fbf[_0x3dd37c]['id']!=_0x5a8fbf[_0x586bc5]['pairId'];)'elementStart'==_0x5a8fbf[_0x3dd37c]['type']?_0xbde2a4++:'elementEnd'==_0x5a8fbf[_0x3dd37c]['type']&&_0xbde2a4--,_0x3dd37c++;if(0x0!=_0xbde2a4){if(_0x5a8fbf[_0x586bc5]['isRemoved'])_0x5a8fbf[_0x586bc5]['isIncorrect']=!0x0;else{for(;_0x3dd37c!=_0x586bc5;)_0x5a8fbf[_0x3dd37c]['isRemoved']&&0x0!=_0x5a8fbf[_0x3dd37c]['distance']&&(_0x5a8fbf[_0x3dd37c]['isIncorrect']=!0x0,_0x282f14['add'](_0x5a8fbf[_0x3dd37c]['pairId'])),_0x3dd37c--;}}}return _0x5a8fbf['filter'](_0x38ff38=>!_0x38ff38['isIncorrect']);}_removeUnsupportedChanges(_0x2f673d){const _0x5c4aa7=this['editor']['model']['schema'];for(let _0x5eb1e5=0x0;_0x5eb1e5<_0x2f673d['length'];_0x5eb1e5++){if(!(_0x2f673d[_0x5eb1e5]['isAdded']||_0x2f673d[_0x5eb1e5]['isAddSuggestion']||_0x2f673d[_0x5eb1e5]['isRemoved']||_0x2f673d[_0x5eb1e5]['isRemoveSuggestion']))continue;if(0x0==_0x2f673d[_0x5eb1e5]['distance'])continue;const _0x564d3a=_0x2f673d[_0x5eb1e5]['item'];_0x5c4aa7['isBlock'](_0x564d3a)||_0x5c4aa7['isLimit'](_0x564d3a)||(_0x2f673d[_0x5eb1e5]['isAdded']&&delete _0x2f673d[_0x5eb1e5]['isAdded'],_0x2f673d[_0x5eb1e5]['isAddSuggestion']&&delete _0x2f673d[_0x5eb1e5]['isAddSuggestion'],_0x2f673d[_0x5eb1e5]['isRemoveSuggestion']&&delete _0x2f673d[_0x5eb1e5]['isRemoveSuggestion'],_0x2f673d[_0x5eb1e5]['isRemoved']&&(_0x2f673d[_0x5eb1e5]['isIncorrect']=!0x0));}return _0x2f673d['filter'](_0x1d0403=>!_0x1d0403['isIncorrect']);}['_makeModelFromTape'](_0x555b44,_0x51697a,_0x4fa16e,_0x1b4acc){const _0x33f1a3=new _0x5b0952(),_0x17785c=[],_0x12a519=new Map(),_0x1a68ae=this['editor']['model'],_0x1def61=_0x1a68ae['schema'],_0x56d873=[_0x33f1a3],_0x1d588d={},_0x472d1={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x33f1a3['name']=_0x1b4acc;let _0x138078=null;const _0x489385=[0x0];for(let _0x49aae5=0x0;_0x49aae5<_0x555b44['length'];_0x49aae5++)if('elementStart'===_0x555b44[_0x49aae5]['type']){_0x555b44[_0x49aae5]['previousPosition']=_0x1a68ae['createPositionFromPath'](_0x33f1a3,_0x489385);const _0x5f5c4c=new _0x33393c(_0x555b44[_0x49aae5]['item']['name'],_0x555b44[_0x49aae5]['item']['getAttributes']());_0x56d873[0x0]['_appendChild'](_0x5f5c4c),_0x489385['push'](0x0),_0x56d873['unshift'](_0x5f5c4c),_0x555b44[_0x49aae5]['nextPosition']=_0x1a68ae['createPositionFromPath'](_0x33f1a3,_0x489385);}else'elementEnd'===_0x555b44[_0x49aae5]['type']?(_0x56d873['shift'](),_0x555b44[_0x49aae5]['previousPosition']=_0x1a68ae['createPositionFromPath'](_0x33f1a3,_0x489385),_0x489385['pop'](),_0x489385[_0x489385['length']-0x1]++,_0x555b44[_0x49aae5]['nextPosition']=_0x1a68ae['createPositionFromPath'](_0x33f1a3,_0x489385)):(_0x555b44[_0x49aae5]['previousPosition']=_0x1a68ae['createPositionFromPath'](_0x33f1a3,_0x489385),_0x138078?_0x138078['_data']+=_0x555b44[_0x49aae5]['item']['data']:_0x138078=new _0x39f156(_0x555b44[_0x49aae5]['item']['data'],_0x555b44[_0x49aae5]['item']['getAttributes']()),_0x555b44[_0x49aae5+0x1]&&'text'===_0x555b44[_0x49aae5+0x1]['type']&&_0x26a8e6(_0x138078,_0x555b44[_0x49aae5+0x1]['item'])||(_0x56d873[0x0]['_appendChild'](_0x138078),_0x138078=null),_0x489385[_0x489385['length']-0x1]+=_0x555b44[_0x49aae5]['item']['offsetSize'],_0x555b44[_0x49aae5]['nextPosition']=_0x1a68ae['createPositionFromPath'](_0x33f1a3,_0x489385));for(let _0x593da5=0x0;_0x593da5<_0x555b44['length'];_0x593da5++){const _0x3b488c=_0x555b44[_0x593da5]['previousPosition'],_0x3eb25c=_0x555b44[_0x593da5]['nextPosition'];for(const _0x4f29f6 of _0x555b44[_0x593da5]['markersStart'])_0x12a519['set'](_0x4f29f6,{'start':_0x3b488c,'end':null});_0x5dfa06('isRemoveSuggestion',_0x593da5,_0x3b488c,_0x3eb25c),_0x5dfa06('isAddSuggestion',_0x593da5,_0x3b488c,_0x3eb25c),_0x5dfa06('isRemoved',_0x593da5,_0x3b488c,_0x3eb25c),_0x5dfa06('isAdded',_0x593da5,_0x3b488c,_0x3eb25c);for(const _0x40d170 of _0x555b44[_0x593da5]['markersEnd']){const _0x1ba619=_0x12a519['get'](_0x40d170);_0x1ba619?_0x1ba619['end']=_0x3eb25c:_0x12a519['set'](_0x40d170,{'start':_0x3eb25c,'end':_0x3eb25c});}}for(const [_0x10a814,_0x2d810e]of _0x12a519){const _0x171147=this['editor']['model']['createRange'](_0x2d810e['start'],_0x2d810e['end']);_0x33f1a3['markers']['set'](_0x10a814,_0x171147);}return _0x17785c['sort']((_0xb4f009,_0x559fb6)=>{const _0x4a8ef7=_0x33f1a3['markers']['get']('revision:'+_0xb4f009['id']),_0x251d72=_0x33f1a3['markers']['get']('revision:'+_0x559fb6['id']);return _0x4a8ef7['start']['isBefore'](_0x251d72['start'])?-0x1:_0x4a8ef7['start']['isAfter'](_0x251d72['start'])?0x1:_0x4a8ef7['end']['isBefore'](_0x251d72['end'])?-0x1:_0x4a8ef7['end']['isAfter'](_0x251d72['end'])?0x1:'add'===_0xb4f009['type']?-0x1:0x1;}),{'root':_0x33f1a3,'changes':_0x17785c};function _0x5dfa06(_0x2c79a1,_0x44fde0,_0x434a19,_0x4f0b4c){const _0x3ce3fb=!!_0x555b44[_0x44fde0][_0x2c79a1],_0x4224cf=_0x3ce3fb?_0x555b44[_0x44fde0][_0x2c79a1]['userId']:null,_0x2b986e=_0x3ce3fb&&_0x555b44[_0x44fde0][_0x2c79a1]['aiSource']||null,_0x1981a8=_0x44fde0===_0x555b44['length']-0x1,_0x550ca0=_0x472d1[_0x2c79a1][0x0],_0x5abf73=_0x1def61['isObject'](_0x555b44[_0x44fde0]['item']);!_0x1d588d[_0x2c79a1]&&_0x3ce3fb?_0x1d588d[_0x2c79a1]={'start':_0x434a19,'tapeItem':_0x555b44[_0x44fde0],'userId':_0x4224cf,'aiSource':_0x2b986e,'type':_0x2c79a1}:_0x1d588d[_0x2c79a1]&&!_0x3ce3fb?(_0x1d588d[_0x2c79a1]['end']=_0x434a19,_0x4171a0(_0x1d588d[_0x2c79a1]),_0x1d588d[_0x2c79a1]=null):_0x1d588d[_0x2c79a1]&&_0x3ce3fb&&(_0x1d588d[_0x2c79a1]['userId']!==_0x4224cf||_0x1d588d[_0x2c79a1]['aiSource']!==_0x2b986e)&&(_0x1d588d[_0x2c79a1]['end']=_0x434a19,_0x550ca0&&_0x550ca0['userId']===_0x1d588d[_0x2c79a1]['userId']?_0x550ca0['change']['aiSource']=_0x550ca0['change']['aiSource']||_0x1d588d[_0x2c79a1]['aiSource']:_0x4171a0(_0x1d588d[_0x2c79a1]),_0x1d588d[_0x2c79a1]={'start':_0x434a19,'tapeItem':_0x555b44[_0x44fde0],'userId':_0x4224cf,'aiSource':_0x2b986e,'type':_0x2c79a1}),_0x1d588d[_0x2c79a1]&&_0x5abf73&&('elementStart'!==_0x555b44[_0x44fde0]['type']||_0x550ca0&&_0x550ca0['userId']===_0x4224cf||_0x472d1[_0x2c79a1]['unshift']({'userId':_0x4224cf,'object':_0x555b44[_0x44fde0]['item'],'change':_0x1d588d[_0x2c79a1]}),'elementEnd'===_0x555b44[_0x44fde0]['type']&&_0x550ca0&&_0x550ca0['object']===_0x555b44[_0x44fde0]['item']&&(_0x472d1[_0x2c79a1]['shift'](),_0x1d588d[_0x2c79a1]=_0x550ca0['change'])),_0x1d588d[_0x2c79a1]&&_0x1981a8&&(_0x1d588d[_0x2c79a1]['end']=_0x4f0b4c,_0x4171a0(_0x1d588d[_0x2c79a1]),_0x1d588d[_0x2c79a1]=null);}function _0x4171a0({start:_0x3e25fc,end:_0x2917a0,tapeItem:_0x139a1b,userId:_0x411e8d,aiSource:_0x572624,type:_0x2a37a5}){const _0x23c942=_0x139a1b['item'],_0x58f3ac=_0x1a68ae['schema']['isBlock'](_0x23c942)&&!_0x1a68ae['schema']['isLimit'](_0x23c942),_0x60264f=_0x3e25fc['nodeAfter']==_0x2917a0['parent']&&_0x2917a0['isAtStart'];if(_0x58f3ac&&_0x60264f)return;const _0x311b9b=_0x1a68ae['createRange'](_0x3e25fc,_0x2917a0),_0x4d4a08=_0x51697a['get'](_0x411e8d),_0x252ba9=new Tt({'author':_0x4d4a08,'type':'isAdded'==_0x2a37a5||'isAddSuggestion'==_0x2a37a5?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x2a37a5||'isRemoveSuggestion'==_0x2a37a5,'aiSource':_0x572624||null},'createdAt':new Date(),'rootName':_0x4fa16e});_0x17785c['push'](_0x252ba9),_0x33f1a3['markers']['set']('revision:'+_0x252ba9['id'],_0x311b9b);}function _0x26a8e6(_0x13db15,_0x44c062){const _0x34f883=_0x13db15['getAttributes'](),_0x26efa9=_0x44c062['getAttributes']();for(const _0x303da2 of _0x34f883){if(_0x303da2[0x1]!==_0x44c062['getAttribute'](_0x303da2[0x0]))return!0x1;_0x26efa9['next']();}return _0x26efa9['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x3f7740=>{const _0x13647d=_0x3f7740['markerName']['split'](':')[0x1],_0x551a5d=this['_getChangeFromId'](_0x13647d);if(!_0x551a5d)return null;const _0x5d91c7='add'==_0x551a5d['type']?'insertion':'deletion',_0x5d0b73=['ck-suggestion-marker','ck-suggestion-marker-'+_0x5d91c7];return _0x551a5d['data']['isSuggestion']&&_0x5d0b73['push']('ck-suggestion-marker-'+_0x5d91c7+'-new'),this['activeChange']==_0x551a5d&&_0x5d0b73['push']('ck-suggestion-marker--active'),{'classes':_0x5d0b73,'attributes':{'data-change-id':_0x13647d}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x54e587=>{_0x54e587['on']('element:pre',(_0x1bf738,_0x29b003,_0x26e768)=>{const _0x3c216a=_0x29b003['viewItem']['getChild'](0x0);if(!_0x3c216a||!_0x3c216a['is']('element','code'))return;if(!_0x26e768['consumable']['consume'](_0x3c216a,{'attributes':['vid_start','vid_end']}))return;const _0x1b02e1=_0x29b003['modelRange']['start']['nodeAfter'];_0x26e768['writer']['setAttribute']('vid_start',_0x3c216a['getAttribute']('vid_start'),_0x1b02e1),_0x26e768['writer']['setAttribute']('vid_end',_0x3c216a['getAttribute']('vid_end'),_0x1b02e1);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x304b8e=>{_0x304b8e['on']('element',(_0x2c777b,_0x454cc8,_0x1bd55a)=>{if(!_0x1bd55a['consumable']['consume'](_0x454cc8['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x454cc8['modelRange']['isCollapsed'])return;const _0x4786d9=_0x454cc8['modelRange']['start']['nodeAfter'];_0x4786d9['hasAttribute']('vid_start')||_0x4786d9['hasAttribute']('vid')||(_0x1bd55a['writer']['setAttribute']('vid_start',_0x454cc8['viewItem']['getAttribute']('vid_start'),_0x4786d9),_0x1bd55a['writer']['setAttribute']('vid_end',_0x454cc8['viewItem']['getAttribute']('vid_end'),_0x4786d9));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x27c3e1=>_0x27c3e1['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x485d53,[,_0x466601])=>{['vid_start','vid_end','vid']['includes'](_0x466601)&&(_0x485d53['return']=!0x0,_0x485d53['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0xbd1dcf=>{_0xbd1dcf['on']('attribute:vid',(_0x4fc041,_0x685349,_0x186f7d)=>{if('\x20'!=_0x685349['item']['data']||_0x685349['item']['parent']['maxOffset']>0x1)return;if(!_0x186f7d['consumable']['consume'](_0x685349['item'],_0x4fc041['name']))return;const _0x79c9f0=_0x186f7d['writer'],_0x23f47a=_0x186f7d['mapper']['toViewRange'](_0x685349['range']);_0x79c9f0['wrap'](_0x23f47a,_0x79c9f0['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x599b87){const _0x56c9c0=_0x599b87['plugins']['get']('RevisionViewer');return(_0x15f3d8,_0x3c14c6,_0x4e8087)=>{const _0x555b95=_0x3c14c6['markerName']['split'](':')[0x1],_0x32920b=_0x56c9c0['_getChangeFromId'](_0x555b95);if(!_0x32920b)return null;const _0x92b975='add'==_0x32920b['type']?'split':'merge';if(!_0x4e8087['consumable']['test'](_0x3c14c6['markerRange'],_0x15f3d8['name']))return;const _0x3976b1=_0x3c14c6['markerRange']['getWalker'](),_0x5c3e75=_0x3c14c6['markerRange']['start'],_0x154f2d=_0x599b87['model']['schema'];let _0x38f385=null,_0x2d0844=null,_0xc6ca06=!0x1,_0x53122c=!0x1;for(const _0x27cae9 of _0x3976b1){const _0x1b087a=_0x27cae9['item'];_0xc6ca06=_0xc6ca06||_0x154f2d['isContent'](_0x1b087a);const _0x161155=_0x4e8087['mapper']['toViewElement'](_0x1b087a);if(_0x161155&&_0x161155['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x27cae9['type']&&(_0x154f2d['isBlock'](_0x1b087a)&&!_0x154f2d['isLimit'](_0x1b087a)&&(_0x1b087a['nextSibling']||_0x5c3e75['isAtEnd']?_0x38f385&&_0x38f385['parent']==_0x1b087a||(_0x38f385=_0x1b087a,_0x2ee608(_0x27cae9['previousPosition']),_0x53122c=!0x0):_0x2d0844=_0x2d0844||_0x27cae9['previousPosition']));}function _0x2ee608(_0x3d0fce){const _0x393be0=_0x4e8087['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x92b975}),_0x516a60=_0x4e8087['mapper']['toViewPosition'](_0x3d0fce);_0x32920b['data']['isSuggestion']&&_0x4e8087['writer']['addClass']('ck-suggestion-marker-'+_0x92b975+'-new',_0x393be0),_0x56c9c0['activeChange']==_0x32920b&&_0x4e8087['writer']['addClass']('ck-suggestion-marker--active',_0x393be0),_0x4e8087['writer']['insert'](_0x516a60,_0x393be0),_0x4e8087['mapper']['bindElementToMarker'](_0x393be0,_0x3c14c6['markerName']);}_0xc6ca06||_0x53122c||!_0x2d0844||_0x2ee608(_0x2d0844);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x4dffb0,_0x40e849,_0x46724f)=>{const _0x1ff1c8=_0x46724f['mapper']['markerNameToElements'](_0x40e849['markerName']);if(_0x1ff1c8){for(const _0x3716d5 of _0x1ff1c8)(_0x3716d5['hasClass']('ck-suggestion-marker-split')||_0x3716d5['hasClass']('ck-suggestion-marker-merge'))&&(_0x46724f['mapper']['unbindElementFromMarkerName'](_0x3716d5,_0x40e849['markerName']),_0x46724f['writer']['remove'](_0x3716d5));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x3ef719,_0x43dec1,_0x52c7b7)=>{const _0x2195ae=_0x43dec1['markerName']['split'](':')[0x1],_0x14db0c=this['_getChangeFromId'](_0x2195ae);if(!_0x14db0c)return null;const _0x283b07='add'==_0x14db0c['type']?'split':'merge';if(_0x52c7b7['consumable']['test'](_0x43dec1['markerRange'],_0x3ef719['name']))for(const _0x312b1f of _0x43dec1['markerRange']['getItems']()){if(!_0x312b1f['is']('element','softBreak'))continue;const _0x882249=_0x52c7b7['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x283b07}),_0x1730ed=_0x52c7b7['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x312b1f));_0x14db0c['data']['isSuggestion']&&_0x52c7b7['writer']['addClass']('ck-suggestion-marker-'+_0x283b07+'-new',_0x882249),this['activeChange']==_0x14db0c&&_0x52c7b7['writer']['addClass']('ck-suggestion-marker--active',_0x882249),_0x52c7b7['writer']['insert'](_0x1730ed,_0x882249),_0x52c7b7['mapper']['bindElementToMarker'](_0x882249,_0x43dec1['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x4c55c4=>{for(const _0x562d84 of this['editor']['model']['document']['getRootNames']()){const _0x248cd1=this['editor']['model']['document']['getRoot'](_0x562d84),_0x216aa6=this['editor']['editing']['view']['document']['getRoot'](_0x562d84);if(_0x216aa6){const _0x37a476=_0x248cd1['getAttribute']('revisionHistoryAttachChange');if(_0x4c55c4['removeAttribute']('data-change-id',_0x216aa6),_0x4c55c4['removeClass']('ck-revision-history-root-add',_0x216aa6),_0x4c55c4['removeClass']('ck-revision-history-root-remove',_0x216aa6),_0x4c55c4['removeClass']('ck-revision-history-root--active',_0x216aa6),_0x37a476){const _0x4eb502=this['_getChangeFromId'](_0x37a476);if(!_0x4eb502)return null;_0x4c55c4['setAttribute']('data-change-id',_0x37a476,_0x216aa6),_0x4c55c4['addClass']('ck-revision-history-root-'+_0x4eb502['type'],_0x216aa6),this['activeChange']==_0x4eb502&&_0x4c55c4['addClass']('ck-revision-history-root--active',_0x216aa6);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x42947d=>'revision-comment:'+_0x42947d,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x384671=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Pt(_0x384671['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x51aa73=>'revision-suggestion:'+_0x51aa73,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x5c6f6a=>({'name':'suggestion:'+_0x5c6f6a,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x2c649c=>{const _0x2fbba4=_0x2c649c['markerName']['split'](':')[0x1];return'insertion'!=_0x2fbba4&&'deletion'!=_0x2fbba4?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x2fbba4]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Ut(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Ut(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x2255e3,_0x4b5972,_0x335278)=>{const _0x3b27d9=_0x335278['mapper']['markerNameToElements'](_0x4b5972['markerName']);if(_0x3b27d9){for(const _0x5dd5d7 of _0x3b27d9)_0x5dd5d7['is']('uiElement')&&(_0x335278['mapper']['unbindElementFromMarkerName'](_0x5dd5d7,_0x4b5972['markerName']),_0x335278['writer']['remove'](_0x5dd5d7));}},{'priority':'high'});}_getChangeFromId(_0x3b049c){return this['_changeIdToChange']['get'](_0x3b049c);}_getViewForChange(_0x6ff1cc){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Dt(this['editor']['locale'],_0x6ff1cc,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x2fa484,_0x1dd862,_0x365769,_0x38b1cb)=>{_0x38b1cb&&this['_balloon']['remove'](_0x38b1cb),_0x365769&&(this['_balloon']['add']({'view':_0x365769,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x5e0721=this['editor']['editing'],_0x8606af=this['_getChangeFromId'](_0x365769['changeId']);let _0x4fcbf5;if(_0x8606af['data']['isOnRoot']){const _0x54226b=_0x5e0721['view']['getDomRoot'](_0x8606af['rootName']);_0x4fcbf5=Array['from'](_0x54226b['getClientRects']());}else{const _0x1e3200=this['editor']['model']['markers']['get']('revision:'+_0x365769['changeId']);_0x4fcbf5=Array['from'](_0x5e0721['mapper']['markerNameToElements'](_0x1e3200['name']))['map'](_0x29c21c=>_0x5e0721['view']['domConverter']['mapViewToDom'](_0x29c21c))['map'](_0x4de16f=>Array['from'](_0x4de16f['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x4fcbf5['find'](_0x7aee9f=>_0x7aee9f['top']-0x3<=this['_activeViewTarget']['y']&&_0x7aee9f['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x7aee9f['left']-0x3<=this['_activeViewTarget']['x']&&_0x7aee9f['right']+0x3>=this['_activeViewTarget']['x'])||_0x4fcbf5[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x4801cb,_0xc5e903,_0x41f690,_0x39f261)=>{this['activeView']=_0x41f690?this['_getViewForChange'](_0x41f690):null,this['editor']['model']['change'](()=>{const _0x22fead=this['editor']['editing'];_0x39f261&&(_0x39f261['data']['isOnRoot']?_0x22fead['view']['change'](_0x56d667=>{_0x56d667['removeClass']('ck-revision-history-root--active',_0x22fead['view']['document']['getRoot'](_0x39f261['rootName']));}):_0x22fead['reconvertMarker']('revision:'+_0x39f261['id'])),_0x41f690&&(_0x41f690['data']['isOnRoot']?_0x22fead['view']['change'](_0x4f786f=>{_0x4f786f['addClass']('ck-revision-history-root--active',_0x22fead['view']['document']['getRoot'](_0x41f690['rootName']));}):_0x22fead['reconvertMarker']('revision:'+_0x41f690['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0xb9e0a6,_0x17f2f5)=>{if(this['activeChange'])return;const _0x13d337=this['_findChangeIdFromDomTarget'](_0x17f2f5['target']),_0x37069b=this['_changeIdToChange']['get'](_0x13d337);_0x37069b?(this['_activeViewTarget']={'x':_0x17f2f5['domEvent']['x'],'y':_0x17f2f5['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x37069b)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x1012b5,_0xf693e3)=>{const _0x3a9d74=this['_findChangeIdFromDomTarget'](_0xf693e3['target']),_0x100b5d=this['_changeIdToChange']['get'](_0x3a9d74);_0x100b5d?(this['_activeViewTarget']={'x':_0xf693e3['domEvent']['x'],'y':_0xf693e3['domEvent']['y']},_0x100b5d===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x100b5d):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x217494){do{const _0x1c15cb=_0x217494['getAttribute']('data-change-id');if(_0x1c15cb)return _0x1c15cb;_0x217494=_0x217494['parent'];}while(_0x217494);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x5c04bb=>{for(const _0x408455 of this['editor']['model']['markers'])_0x5c04bb['removeMarker'](_0x408455);});}};function Pt(_0x415517){return _0x415517['split'](':')[0x1];}function Ut(_0xa63b3d,_0x32ea57){return(_0x29e365,_0xb8da15,_0x2e521d)=>{if(!_0x2e521d['consumable']['test'](_0xb8da15['markerRange'],_0x29e365['name']))return;const _0x3a4d22=_0xb8da15['markerRange']['getWalker'](),_0x1ba1c0=_0xb8da15['markerRange']['start'],_0x470753=_0xa63b3d['model']['schema'];let _0x144ee8=null,_0x389c8d=null,_0x2e0c87=!0x1,_0x5d31f9=!0x1;for(const _0x29bac8 of _0x3a4d22){const _0x48fcc4=_0x29bac8['item'];_0x2e0c87=_0x2e0c87||_0x470753['isContent'](_0x48fcc4);const _0xdab3e0=_0x2e521d['mapper']['toViewElement'](_0x48fcc4);if(_0xdab3e0&&_0xdab3e0['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x29bac8['type']&&(_0x470753['isBlock'](_0x48fcc4)&&!_0x470753['isLimit'](_0x48fcc4)&&(_0x48fcc4['nextSibling']||_0x1ba1c0['isAtEnd']?_0x144ee8&&_0x144ee8['parent']==_0x48fcc4||(_0x144ee8=_0x48fcc4,_0x2ac383(_0x29bac8['previousPosition']),_0x5d31f9=!0x0):_0x389c8d=_0x389c8d||_0x29bac8['previousPosition']));}function _0x2ac383(_0x1171fe){const _0x21fe8b=_0x2e521d['mapper']['toViewPosition'](_0x1171fe),_0x4b3fa3=_0x2e521d['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x32ea57});_0x2e521d['writer']['insert'](_0x21fe8b,_0x4b3fa3),_0x2e521d['mapper']['bindElementToMarker'](_0x4b3fa3,_0xb8da15['markerName']);}_0x2e0c87||_0x5d31f9||!_0x389c8d||_0x2ac383(_0x389c8d);};}var Lt=class extends _0x18a40f{constructor(_0x499b69){super(_0x499b69);const _0x2a6935=_0x499b69['plugins']['get'](Ht);this['affectsData']=!0x1,this['listenTo'](_0x2a6935,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x2a6935,'change:isEnabled',()=>this['refresh']());}execute(){const _0x3cd89b=this['editor'],_0x1d207a=_0x3cd89b['plugins']['get'](Ht),_0x4f18bb=_0x1d207a['isReady']?_0x1d207a['diff']['newRevisionId']:null;_0x3cd89b['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x4f18bb);}['refresh'](){const {isReady:_0x2d54fe,isEnabled:_0x2412d3,repository:_0x2c90d3,diff:_0x36eec9}=this['editor']['plugins']['get'](Ht),_0x2c1b61=_0x36eec9&&_0x2c90d3['getLaterVisibleRevision'](_0x36eec9['newRevisionId']);this['isEnabled']=_0x2d54fe&&_0x2412d3&&Boolean(_0x2c1b61);}},Ft=class extends _0x18a40f{_step;constructor(_0x1ddf55,{direction:_0x56c405}){super(_0x1ddf55);const _0x100999=_0x1ddf55['plugins']['get'](Ht);this['affectsData']=!0x1,this['_step']='forward'===_0x56c405?0x1:-0x1,this['listenTo'](_0x100999,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x100999,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x100999,'change:activeChange',()=>this['refresh']());}execute(){const _0x13a05b=this['editor'],_0x20d9d3=_0x13a05b['plugins']['get'](Ht),{isNavigationMode:_0x2b3a2e,currentChangeNumber:_0x71f461}=_0x20d9d3;let _0x190a2c;if(_0x20d9d3['activeChange']=_0x2b3a2e?_0x20d9d3['diff']['changes']['get'](_0x71f461+this['_step']):_0x20d9d3['diff']['changes']['first'],_0x20d9d3['activeChange']['data']['isOnRoot'])_0x190a2c=_0x13a05b['editing']['view']['getDomRoot'](_0x20d9d3['activeChange']['rootName']);else{const _0x21f79c=_0x13a05b['model']['markers']['get']('revision:'+_0x20d9d3['activeChange']['id']);_0x190a2c=_0xf9a4c5(_0x13a05b['editing'],_0x21f79c);}_0x6eee20({'target':_0x190a2c,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x35e016,currentChangeNumber:_0x302681,numberOfChanges:_0x3cdd3c,isReady:_0x37410f,isEnabled:_0x1352c9}=this['editor']['plugins']['get'](Ht);this['isEnabled']=!!(_0x1352c9&&_0x37410f&&_0x3cdd3c)&&(!_0x35e016||(0x1===this['_step']?_0x302681<_0x3cdd3c-0x1:_0x302681>0x0));}},$t=class extends ut{constructor(_0x10d543){super(_0x10d543);const _0x1c2a42=this['bindTemplate'],_0xc25921=new _0x3cad3d(_0x10d543),_0x4ac650=new _0x3cad3d(_0x10d543);this['set']('isNavigationMode',!0x1),this['set']('isReady',!0x1),this['set']('currentChangeNumber',0x0),this['set']('numberOfChanges',0x0),this['set']('isForwardNavigationEnabled',!0x1),this['set']('isBackwardNavigationEnabled',!0x1),this['bind']('_isStatusLabelVisible')['to'](this,'isReady',this,'numberOfChanges',(_0x2f5818,_0x1309df)=>_0x2f5818&&_0x1309df>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x1d48e0,_0x2fd678,_0x4fc9d0,_0x372e75)=>{if(!_0x1d48e0)return Rt(_0x10d543,'Loading...');if(!_0x4fc9d0)return Rt(_0x10d543,'No\x20changes');const _0x2a4572=Rt(_0x10d543,'NUMBER_OF_CHANGES',_0x4fc9d0);return _0x372e75?Rt(_0x10d543,'X_OF_Y_CHANGES',[_0x2fd678+0x1,_0x4fc9d0]):_0x2a4572;}),_0xc25921['set']({'label':Rt(_0x10d543,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x56cdc6}),_0x4ac650['set']({'label':Rt(_0x10d543,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x3e7cc1}),_0xc25921['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x4ac650['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0xc25921['on']('execute',()=>this['fire']('execute','backward')),_0x4ac650['on']('execute',()=>this['fire']('execute','forward')),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-ui','ck-revision-history-ui__changes-navigation']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__wrapper']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__label',_0x1c2a42['if']('_isStatusLabelVisible','ck-hidden',_0x4b0180=>!_0x4b0180)]},'children':[{'text':_0x1c2a42['to']('isNavigationMode',_0x3ede3a=>_0x3ede3a?Rt(_0x10d543,'EDIT_X_OF_Y_REVISIONS')+':\x20':Rt(_0x10d543,'Total')+':\x20')}]},{'text':_0x1c2a42['to']('_statusText')}]},new ht(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0xc25921,_0x4ac650]}]});}};const Bt='ck-editor__editable__loading-overlay';var jt=class extends _0x245d60{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x102258=this['editor']['editing']['view'];_0x102258['change'](_0x55322e=>{for(const _0x1feb1c of _0x102258['document']['roots'])_0x55322e['addClass'](Bt,_0x1feb1c);});}['hide'](){const _0x16c374=this['editor']['editing']['view'];_0x16c374['change'](_0x5c9a09=>{for(const _0x4dbab7 of _0x16c374['document']['roots'])_0x5c9a09['removeClass'](Bt,_0x4dbab7);});}},Gt=class extends _0x245d60{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ht,jt];}init(){const _0x52da68=this['editor'],_0x2a0bf6=_0x52da68['plugins']['get'](Ht),_0x325e49=_0x52da68['plugins']['get'](jt);_0x52da68['ui']['componentFactory']['add']('exitToEditing',_0x42201f=>{const _0x62a32e=new _0x3cad3d(_0x42201f);return _0x62a32e['set']({'label':Rt(_0x42201f,'Back\x20to\x20editing'),'icon':_0x329eec,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x62a32e,'execute',()=>{_0x52da68['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x62a32e;}),_0x52da68['ui']['componentFactory']['add']('restoreRevision',_0x341635=>{const _0x549fdf=new _0x3cad3d(_0x341635);return _0x549fdf['set']({'label':Rt(_0x341635,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x549fdf['bind']('isEnabled')['to'](_0x52da68['commands']['get']('restoreRevision')),this['listenTo'](_0x549fdf,'execute',()=>_0x52da68['execute']('restoreRevision')),_0x549fdf;}),_0x52da68['ui']['componentFactory']['add']('changesNavigation',_0x266ab7=>{const _0x326859=new $t(_0x266ab7),_0x31b39b=_0x52da68['commands']['get']('showPreviousChange'),_0x4f9c10=_0x52da68['commands']['get']('showNextChange');return _0x326859['bind']('isBackwardNavigationEnabled')['to'](_0x31b39b,'isEnabled'),_0x326859['bind']('isForwardNavigationEnabled')['to'](_0x4f9c10,'isEnabled'),_0x326859['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x2a0bf6),this['listenTo'](_0x326859,'execute',(_0xbce2f9,_0x523014)=>{_0x52da68['execute']('forward'===_0x523014?'showNextChange':'showPreviousChange');}),_0x326859;}),_0x325e49['show'](),_0x2a0bf6['on']('change:isReady',(_0x9f84ac,_0x136c7a,_0x5732dd)=>{_0x5732dd?_0x325e49['hide']():_0x325e49['show']();});}},Kt=class extends tt{['_resizeObserver']=null;constructor(_0x297f9e,_0x55cb44){super(_0x297f9e,_0x55cb44);const _0x353e5f=this['bindTemplate'];this['set']({'label':Rt(_0x297f9e,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=Rt(_0x297f9e,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x353e5f['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x1e29b3(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x1a7d4a=this['fieldView']['element'];this['_tooltipString']=_0x1a7d4a['scrollWidth']>_0x1a7d4a['clientWidth']&&_0x1a7d4a['value']||'';}},qt=class extends ut{constructor(_0x7289cd,_0x45e156,_0x4f1c68){super(_0x7289cd);const _0x1fb16b=new _0x203f2d();_0x1fb16b['set']({'content':_0x5991e0,'viewBox':'0\x200\x2011\x2010'});const _0x18a3d7=['ck','ck-revision-history-sidebar__revision-author'];_0x4f1c68&&_0x18a3d7['push']('ck-revision-history-sidebar__revision-author_creator');const _0x2ef1ae=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':Rt(_0x7289cd,_0x4f1c68?'Revision\x20creator':'Revision\x20author')},'children':[_0x1fb16b,_0x45e156['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x18a3d7},'children':_0x2ef1ae});}};function Yt(_0x57378b,_0xc02f12){const _0x2af2b0=_0x57378b['bindTemplate'],_0x1ac2ef=_0x57378b['locale'],_0x3fd8bd=ft(_0x1ac2ef);_0x3fd8bd['panelPosition']='sw';const _0x18c3cb=function(_0x3923d6,_0x558f11){const _0x568368=function(_0x45cc47,_0x17a933){const _0x3526a0=_0x45cc47['locale'],_0x2f2db6={'Compare\x20against\x20selected':Rt(_0x3526a0,'Compare\x20against\x20selected'),'Name\x20this\x20revision':Rt(_0x3526a0,'Name\x20this\x20revision'),'Restore\x20this\x20revision':Rt(_0x3526a0,'Restore\x20this\x20revision')};return _0x17a933['map'](_0x316b40=>{const _0x2ead13=_0x2f2db6[_0x316b40['name']];return _0x2ead13&&_0x2ead13!==_0x316b40['name']&&(_0x316b40['name']=_0x2ead13),_0x316b40;});}(_0x3923d6,_0x558f11),_0x4accb0=new _0x1b928b();for(const _0x44fe1d of _0x568368){const _0x4d5fde={'type':'button','model':new lt({'label':_0x44fe1d['name'],'class':_0x44fe1d['class'],'withText':!0x0,'role':'menuitem','_action':_0x44fe1d['action']})};_0x4d5fde['model']['bind']('isEnabled')['to'](_0x3923d6,'isActionsDropdownOpen',_0xb2be18=>'function'!=typeof _0x44fe1d['isEnabled']||(!_0xb2be18||_0x44fe1d['isEnabled'](_0x3923d6))),_0x4accb0['add'](_0x4d5fde);}return _0x4accb0;}(_0x57378b,_0xc02f12);return _0x57378b['bind']('isActionsDropdownOpen')['to'](_0x3fd8bd,'isOpen'),_0x3fd8bd['buttonView']['set']({'label':Rt(_0x1ac2ef,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x9592c1}),_0x3fd8bd['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x2af2b0['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x2af2b0['to'](_0x4465ae=>_0x4465ae['stopPropagation']())}}),_0x3fd8bd['on']('execute',_0x59eda0=>{_0x57378b['isReady']&&'function'==typeof _0x59eda0['source']['_action']&&_0x59eda0['source']['_action'](_0x57378b);}),dt(_0x3fd8bd,_0x18c3cb,{'role':'menu'}),_0x3fd8bd['listenTo'](_0x57378b,'change:isActionsDropdownOpen',(_0x36a6e5,_0x21a250,_0x3b3b9b)=>{if(_0x3b3b9b)for(const _0xde3ccd of _0x3fd8bd['listView']['items']){const _0x255699=_0xde3ccd['children']['first'],_0x4a534b=_0xc02f12['find'](_0x4542a2=>_0x4542a2['action']===_0x255699['_action'])['isVisible'];_0xde3ccd['isVisible']=void 0x0===_0x4a534b||_0x4a534b(_0x57378b);}}),_0x3fd8bd;}const Jt=/* #__PURE__ -- @preserve */
27
- _0x8c2f21(ut);var Wt=class extends Jt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0xd54cbd,_0xfe73ba,_0x2a5254,_0x5d17ea,_0x2dc1ac=!0x1){super(_0xd54cbd);const _0x129e49=this['bindTemplate'],_0x521acb=function(_0x3bf2cd,_0xd3315a){const _0x7cbe3c=Array['from'](_0xd3315a['authors'])['filter'](_0x4aa2b0=>_0x4aa2b0!=_0xd3315a['creator']);return _0xd3315a['creator']&&_0x7cbe3c['unshift'](_0xd3315a['creator']),_0x7cbe3c['map'](_0x5179f6=>new qt(_0x3bf2cd,_0x5179f6,_0x5179f6==_0xd3315a['creator']));}(_0xd54cbd,_0xfe73ba);this['id']=_0xfe73ba['id'],this['_revision']=_0xfe73ba,this['_requireRevisionName']=_0x5d17ea,this['bind']('_isAiGenerated')['to'](_0xfe73ba,'attributes',_0x47b59e=>!(!_0x47b59e||!_0x47b59e['@ai'])),this['bind']('name','createdAt')['to'](_0xfe73ba),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x57a8a5=>{return _0x2d5ff7=_0xd54cbd['uiLanguage'],(_0x215f07=_0x57a8a5)['toLocaleDateString'](_0x2d5ff7,{'month':'long','day':'numeric'})+',\x20'+_0x215f07['toLocaleTimeString'](_0x2d5ff7,{'hour':'numeric','minute':'numeric'});var _0x2d5ff7,_0x215f07;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new Kt(_0xd54cbd,vt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x1ed033=>_0x1ed033||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x445a8f,_0xe84ea6)=>_0x445a8f&&_0xe84ea6),this['revisionActionsView']=_0x2a5254&&_0x2a5254['length']?Yt(this,_0x2a5254):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x2dc1ac?this['_createAiPillView'](_0xd54cbd):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x129e49['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x129e49['if']('isEnabled','ck-disabled',_0x34be67=>!_0x34be67),_0x129e49['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x129e49['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x129e49['if']('isActionsDropdownOpen','ck-revision-history-sidebar__actions_dropdown_open')]},'children':[this['revisionNameView'],{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision__date']},'children':[{'text':_0x129e49['to']('_createdAtFormatted')}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision__controls-wrapper']},'children':[{'tag':'ul','attributes':{'class':['ck','ck-revision-history-sidebar__revision-authors']},'children':_0x521acb}]},..._0x2dc1ac?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x129e49['if']('_isAiGenerated','ck-hidden',_0x10701b=>!_0x10701b)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x129e49['to'](_0x3a2a8e=>{_0x3a2a8e['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x21feaa){const _0x3b012d=new _0x2190ec(_0x21feaa);return _0x3b012d['set']({'icon':_0x32cbb7,'label':Rt(_0x21feaa,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':Rt(_0x21feaa,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','class':'ck-pill_ai'}),_0x3b012d['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x3b012d;}['render'](){super['render']();const _0x14065e=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x14065e,'change',()=>{this['_requireRevisionName']&&!_0x14065e['value']||this['fire']('setName',{'id':this['id'],'name':_0x14065e['value']}),_0x14065e['value']||(_0x14065e['value']=this['name']?this['name']:this['_createdAtFormatted']);});}select(){this['isSelected']=!0x0;}deselect(){this['isSelected']=!0x1;}highlight(){this['isHighlighted']=!0x0;}unhighlight(){this['isHighlighted']=!0x1;}};function Xt(_0x1f5c67,_0x32ba87){const _0x285e87=_t['fromJSDate'](_0x1f5c67)['setLocale'](_0x32ba87),_0x5aaf42=_t['local'](),_0x143681=_0x5aaf42['minus']({'days':0x1})['startOf']('day');let _0x244eba,_0x594e56;return _0x285e87['hasSame'](_0x5aaf42,'day')?(_0x244eba=_0x285e87['startOf']('day')['toJSDate'](),_0x594e56=_0x285e87['toRelativeCalendar']()):_0x285e87['hasSame'](_0x143681,'day')?(_0x244eba=_0x143681['toJSDate'](),_0x594e56=_0x285e87['toRelativeCalendar']()):_0x285e87['hasSame'](_0x5aaf42,'week')?(_0x244eba=_0x285e87['startOf']('week')['toJSDate'](),_0x594e56=_0x285e87['weekdayLong']||''):_0x285e87['hasSame'](_0x5aaf42,'year')?(_0x244eba=_0x285e87['startOf']('month')['toJSDate'](),_0x594e56=_0x285e87['monthLong']||''):(_0x244eba=_0x285e87['startOf']('year')['toJSDate'](),_0x594e56=String(_0x285e87['year'])),{'startDate':_0x244eba,'localizedPeriodName':_0x594e56};}var Qt=class extends ut{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x2ff87d,_0x5d6ea9,_0xa81eec,_0x2d40fd,_0x150c29){super(_0x2ff87d);const _0x1e7ceb=Xt(_0x5d6ea9,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x5d6ea9,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0xa81eec,this['_requireRevisionName']=_0x2d40fd,this['_showAISource']=_0x150c29,this['revisionViews']['delegate']('select')['to'](this),this['revisionViews']['delegate']('setName')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period']},'children':[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__label']},'children':[{'text':_0x1e7ceb}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x5ab8cd){const _0x482541=new Wt(this['locale'],_0x5ab8cd,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0x482541);}['removeRevision'](_0x4621e9){const _0x145476=this['revisionViews']['find'](_0x52bd5f=>_0x52bd5f['id']===_0x4621e9['id']);this['revisionViews']['remove'](_0x145476);}},zt=class extends ut{constructor(_0x948b86){super(_0x948b86);const _0x633906=new _0x203f2d();_0x633906['content']=_0x5bf3c2,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x633906,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[Rt(_0x948b86,'Revision\x20history')]}]});}},Zt=class extends ut{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x2f60ed,_0x16da22,_0x1efb58,_0x5f18fa,_0x34ac6f){super(_0x2f60ed);const _0x4fed8b=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x16da22,this['_revisionActions']=_0x1efb58,this['_requireRevisionName']=_0x5f18fa,this['_showAISource']=_0x34ac6f,this['on']('select',(_0x59afbc,_0x2f7d11)=>{this['fire']('revisionSelected',_0x2f7d11);}),this['on']('setName',(_0x244720,_0x495bbb)=>{this['fire']('revisionSetName',_0x495bbb);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new zt(_0x2f60ed),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x4fed8b['if']('isEnabled','ck-disabled',_0x4b7c13=>!_0x4b7c13)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x4af579 of this['_revisions'])this['_addRevision'](_0x4af579);this['_revisions']['on']('add',(_0x29783f,_0x905608)=>{this['_addRevision'](_0x905608);}),this['_revisions']['on']('remove',(_0x47d337,_0x22f192)=>{this['_removeRevision'](_0x22f192);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x33de21=>_0x33de21['revisionViews']['map'](_0x16407a=>_0x16407a))['flat']();}selectRevision(_0x27663b){for(const _0x56eb4a of this['revisionViews'])_0x27663b&&_0x27663b['id']===_0x56eb4a['id']?_0x56eb4a['select']():_0x56eb4a['deselect']();}highlightRevisions(_0x57cfd9){for(const _0x279053 of this['revisionViews'])_0x57cfd9['some'](({id:_0x528576})=>_0x528576===_0x279053['id'])?_0x279053['highlight']():_0x279053['unhighlight']();}['_addRevision'](_0x393850){const _0x29a250=Xt(_0x393850['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x1ca0da=this['_getTimePeriodViewByStartDate'](_0x29a250);_0x1ca0da||(_0x1ca0da=new Qt(this['locale'],_0x29a250,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x1ca0da)),_0x1ca0da['addRevision'](_0x393850);}['_removeRevision'](_0x5b1763){const _0x5c55bb=Xt(_0x5b1763['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x5c55bb)['removeRevision'](_0x5b1763);}_getTimePeriodViewByStartDate(_0x48bea2){return this['timePeriodViews']['find'](_0x578bcf=>_0x578bcf['startDate']['getTime']()===_0x48bea2['getTime']());}},ti=class RevisionsSidebar extends _0x245d60{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
23
+ import{CKEditorError as _0x1f314d,Collection as _0x5d63ac,ElementReplacer as _0x501994,FocusTracker as _0x1d942c,KeystrokeHandler as _0x382620,ObservableMixin as _0x15441c,ResizeObserver as _0x51ad7d,logWarning as _0x282e5f,scrollViewportToShowTarget as _0x5b1f25,uid as _0x1cb26b}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x2e1942,isEqual as _0x4c14f1,set as _0x24ed09,unset as _0x11d3f2}from'es-toolkit/compat';import{Command as _0x265df5,Editor as _0x140042,ElementApiMixin as _0x32922a,PendingActions as _0x83e39c,Plugin as _0x2dd53f}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x2b4c5c,PillView as _0x456423,Users as _0x3002ea,getMarkerDomElement as _0x5cabcc,reRootOperation as _0x22c2f9,reRootPosition as _0x1cef80,reRootRange as _0xc7b39b,sanitizeEditorConfig as _0x5c59b1}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x1c4681,ModelElement as _0x524633,ModelRange as _0x49ff12,ModelText as _0x26249d,ViewAttributeElement as _0x1333cc,ViewContainerElement as _0x204fa7,ViewDocumentFragment as _0x5dc85d,ViewElement as _0xc55704,ViewEmptyElement as _0x11cb1f,ViewRawElement as _0x1c3a68,ViewText as _0x2d3251,ViewUIElement as _0x4af6dc}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0xb2d7ef,IconChevronUp as _0xaa8312,IconHistory as _0x4d55b6,IconSparkle as _0x29e5ea,IconThreeVerticalDots as _0x1ed1ba,IconUndo as _0x38ee45,IconUser as _0x2dbbaa}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x1c0ab2,ButtonView as _0x264e1e,ContextualBalloon as _0x221f96,CssTransitionDisablerMixin as _0x273b3b,EditorUI as _0x44fd65,IconView as _0x105ea5,InlineEditableUIView as _0x1eb7a0,LabeledFieldView as tt,ListItemView as it,ListView as et,MenuBarMenuListItemButtonView as st,MenuBarMenuListItemView as nt,MenuBarMenuListView as ot,MenuBarMenuView as rt,StickyPanelView as at,ToolbarSeparatorView as ht,ToolbarView as ct,UIModel as lt,View as ut,addListToDropdown as dt,createDropdown as ft,createLabeledInputText as vt,normalizeToolbarConfig as gt,submitHandler as mt}from'@ckeditor/ckeditor5-ui';import{DateTime as _t}from'luxon';const wt=/* #__PURE__ -- @preserve */
24
+ _0x15441c();var pt=class extends wt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x3440d0){super(),this['id']=_0x3440d0['id']||_0x1cb26b(),this['creator']=_0x3440d0['creator']||null,this['authors']=_0x3440d0['authors']||[],this['diffData']=_0x3440d0['diffData']||null,this['toVersion']=_0x3440d0['toVersion']||0x0,this['fromVersion']=_0x3440d0['fromVersion']||0x0,this['set']('name',_0x3440d0['name']||''),this['set']('createdAt',_0x3440d0['createdAt']||new Date()),this['set']('attributes',_0x3440d0['attributes']||{});}setName(_0x449fc1){this['_update']({'name':_0x449fc1});}setAttribute(_0x4a3193,_0x4cba90){const _0x2dc7fb=_0x2e1942(this['attributes']);_0x24ed09(_0x2dc7fb,_0x4a3193,_0x4cba90),this['_update']({'attributes':_0x2dc7fb});}removeAttribute(_0x106483){const _0x541f9b=_0x2e1942(this['attributes']);_0x11d3f2(_0x541f9b,_0x106483),this['_update']({'attributes':_0x541f9b});}_update(_0x5a4137,_0x103e1a=!0x1){let _0x5b2087=!0x1;const _0x4f4f4c={'id':this['id']};for(const _0x51bd8e of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x1ef192=_0x5a4137[_0x51bd8e];void 0x0!==_0x1ef192&&_0x1ef192!==this[_0x51bd8e]&&(this[_0x51bd8e]=_0x1ef192,_0x4f4f4c[_0x51bd8e]=_0x1ef192,_0x5b2087=!0x0);}_0x5b2087&&(_0x4f4f4c['authors']&&(_0x4f4f4c['authorsIds']=_0x4f4f4c['authors']['map'](_0x4a6dcb=>_0x4a6dcb['id']),delete _0x4f4f4c['authors']),this['fire']('_update',_0x4f4f4c,_0x103e1a));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x8f4ff4=>_0x8f4ff4['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},yt=class extends _0x2dd53f{['_revisions'];static get requires(){return[_0x3002ea];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x516bcd){super(_0x516bcd),this['_revisions']=new _0x5d63ac();}afterInit(){!async function(_0x3bb5f8){const _0x312e28='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x354785=0xeb829,_0x5927ab=0x79428,_0x4c9281={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x409a62(_0x53ea31){const _0x3044e4=new window['Promise'](_0x47d433=>{_0x53ea31['once']('ready',_0x47d433);}),_0x403dbd=window['Date']['now'](),_0x56b12a=_0x53ea31['config']['get']('licenseKey');async function _0x4a08cd(){let _0x24e3da,_0x44c9ac=null,_0x4b3de9=null;try{return'GPL'==_0x56b12a?'NotAllowed':(_0x24e3da=_0x108b1b(),_0x24e3da?(_0x24e3da['usageEndpoint']&&(_0x4b3de9=_0x5d4c9e(_0x24e3da['usageEndpoint'],_0x24e3da['jti'])),await _0x119233()?_0x387933()?_0x4f09e5()?'Expired':_0x1d8702()?('evaluation'==_0x24e3da['licenseType']&&(_0x44c9ac=_0x1bb47e('EvaluationLimit')),await _0xa2f230()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x4f09e5(){const _0xa85cab=['evaluation','trial']['includes'](_0x24e3da['licenseType'])?_0x403dbd/0x3e8:0xe10*_0x5927ab;return _0x24e3da['exp']<_0xa85cab;}function _0x387933(){const _0x462b02=_0x24e3da['features'];if(!_0x462b02)return!0x1;if(_0x462b02['includes']('*'))return!0x0;if(_0x462b02['includes']('RH'))return!0x0;if(_0x462b02['includes']('RRH')){if(_0x476f74())return!0x0;if(_0x3b2587()||_0x3363a3())return!0x0;}return!0x1;}function _0x1d8702(){const _0x4cd530=_0x24e3da['licensedHosts'];if(!_0x4cd530||0x0==_0x4cd530['length'])return!0x0;const {hostname:_0x4b804a}=new URL(window['location']['href']);if(_0x4cd530['includes'](_0x4b804a))return!0x0;const _0x18f6fb=_0x4b804a['split']('.');return _0x4cd530['filter'](_0x28057=>_0x28057['includes']('*'))['map'](_0x33f9b3=>_0x33f9b3['split']('.'))['filter'](_0x252090=>_0x252090['length']<=_0x18f6fb['length'])['map'](_0xb138b8=>Array(_0x18f6fb['length']-_0xb138b8['length'])['fill']('*'===_0xb138b8[0x0]?'*':'')['concat'](_0xb138b8))['some'](_0x3e47c3=>_0x18f6fb['every']((_0x5099d4,_0x3f76e9)=>_0x3e47c3[_0x3f76e9]===_0x5099d4||'*'===_0x3e47c3[_0x3f76e9]));}function _0xa2f230(){return _0x44c9ac&&_0x4b3de9?new window['Promise']((_0x3c6fea,_0xfa2502)=>{_0x44c9ac['then'](_0x3c6fea,_0xfa2502),_0x4b3de9['then'](_0x257e68=>{'Valid'!=_0x257e68&&_0x3c6fea(_0x257e68);},_0xfa2502);}):_0x44c9ac||_0x4b3de9||'Valid';}}function _0x5d4c9e(_0x4f61ac,_0x3dcb10){return new window['Promise'](_0x2948be=>{if(_0x1e4775())return _0x2948be('Valid');_0x1ef4bc(),_0x53ea31['decorate']('_sendUsageRequest');let _0x2f3385=!0x1;const _0x46eee4=_0x1cb26b();function _0x1aa367(_0x187eb2){return!!_0x187eb2&&('object'==typeof _0x187eb2||'function'==typeof _0x187eb2)&&'function'==typeof _0x187eb2['then']&&'function'==typeof _0x187eb2['catch'];}function _0x344b8e(_0x542341){_0x4d8030(_0x542341)['then'](_0x5c540b=>_0x5c540b&&'ok'==_0x5c540b['status']?_0x3bf5c2(_0x5bae57(_0x46eee4+_0x3dcb10))!=_0x5c540b['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x305720=>(_0x58f53c(),_0x305720),()=>{const _0x1d3469=_0x3a924c();return null==_0x1d3469?(_0x58f53c(),'Valid'):_0x403dbd-_0x1d3469>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2948be)['catch'](()=>{_0x2948be('UsageLimit');});const _0x5e5bca=0x36ee80;function _0x58f53c(){const _0x48c0ba='llct-'+_0x3bf5c2(_0x5bae57(_0x4f61ac)),_0x2d47cf=_0x473d36(_0x3bf5c2(window['Math']['ceil'](_0x403dbd/_0x5e5bca)));window['localStorage']['setItem'](_0x48c0ba,_0x2d47cf);}function _0x3a924c(){const _0x486832='llct-'+_0x3bf5c2(_0x5bae57(_0x4f61ac)),_0x514b4b=window['localStorage']['getItem'](_0x486832);return _0x514b4b?window['parseInt'](_0x473d36(_0x514b4b),0x10)*_0x5e5bca:null;}function _0x4d8030(_0x43ad24){return new window['Promise']((_0x28b13d,_0x42739a)=>{_0x43ad24['then'](_0x28b13d,_0x42739a),window['setTimeout'](_0x42739a,0x1d4c0);});}}_0x53ea31['on']('_sendUsageRequest',(_0x2e536f,_0x1c131a)=>{if(_0x1c131a[0x0]!=_0x4f61ac)return _0x2948be('UsageLimit');_0x1c131a[0x1]={..._0x1c131a[0x1],'requestId':_0x46eee4};},{'priority':'high'}),_0x53ea31['on']('_sendUsageRequest',_0x3edb5f=>{_0x1aa367(_0x3edb5f['return'])&&(_0x2f3385=!0x0,_0x344b8e(_0x3edb5f['return']));},{'priority':'low'}),_0x3044e4['then'](()=>{_0x2f3385||_0x2948be('UsageLimit');});});function _0x1e4775(){return'auto'==_0x53ea31['editing']['view']['_overlayModeHint'];}function _0x1ef4bc(){_0x53ea31['editing']['view']['_overlayModeHint']='auto';}}function _0x1bb47e(_0x28fa14){const _0x348518=[new window['Promise'](_0x2884d4=>setTimeout(_0x2884d4,0x93ecc)),_0x3044e4['then'](()=>new window['Promise'](_0x327451=>{const _0x48505b=0x7,_0x4881a2=_0x3bb5f8['_revisions'];function _0x301f4c(){_0x4881a2['length']>=_0x48505b&&_0x327451();}_0x301f4c(),_0x4881a2['on']('add',_0x301f4c);})),new window['Promise'](_0x59a8cf=>{function _0x39cf82(){for(const _0x414261 in window)if(window['Number']['isNaN'](window['Number'](_0x414261))&&window[_0x414261]==_0x354785)return _0x59a8cf();'destroyed'!=_0x53ea31['state']&&window['setTimeout'](_0x39cf82,0x1388);}_0x58393f('RevisionViewer')&&_0x39cf82();})];return window['Promise']['race'](_0x348518)['then'](()=>_0x28fa14);}async function _0x3ba875(){if(await _0x3044e4,_0x58393f('RevisionViewer')){const _0x2751e1=_0x3bb5f8['getRevision'](0x0),_0x4b4662=_0x3bb5f8['getEarlierVisibleRevision'](_0x2751e1['id']),_0x515075=_0x28c59c('RevisionViewer');return await _0x515075['compare'](_0x2751e1['id'],_0x4b4662?_0x4b4662['id']:null,!0x0),_0x515075['unbind']('isEnabled'),_0x515075['isEnabled']=!0x1,_0x515075['compare']=_0xed4402,void(_0x515075['_getDiff']=_0xed4402);}if(_0x58393f('RevisionTracker')){const _0x414611=_0x28c59c('RevisionTracker');_0x414611['unbind']('isEnabled'),_0x414611['isEnabled']=!0x1,_0x414611['update']=_0xed4402,_0x414611['saveRevision']=_0xed4402;}_0x53ea31['model']['change']=_0xed4402,_0x53ea31['model']['enqueueChange']=_0xed4402,_0x53ea31['enableReadOnlyMode']('model');}function _0x476f74(){return _0x58393f('WebSocketGateway')&&'connected'==_0x28c59c('WebSocketGateway')['state'];}function _0x3b2587(){return _0x58393f('RevisionViewerIntegration');}function _0x3363a3(){return _0x58393f('TrackChangesDataGetter');}function _0x455015(_0x217de5){const _0x5978fd=_0x35c767();_0x53ea31[_0x5978fd]='revisionHistoryLicenseKey'+_0x217de5,_0x217de5['endsWith']('Limit')&&(window[_0x35c767()]=_0x354785),'Valid'!=_0x217de5&&_0x3ba875();}function _0x35c767(){const _0x1a4a87=window['String'](window['performance']['now']())['replace']('.','');let _0x2c7705='N';for(let _0x3c67af=0x0;_0x3c67af<_0x1a4a87['length'];_0x3c67af+=0x2){let _0x4f2754=window['parseInt'](_0x1a4a87['substring'](_0x3c67af,_0x3c67af+0x2));_0x4f2754>=0x3e&&(_0x4f2754-=0x3e),_0x2c7705+=_0x312e28[_0x4f2754];}return _0x2c7705;}function _0x108b1b(){const _0x28eb10=_0x56b12a['split']('.');if(0x3!=_0x28eb10['length'])return null;return _0x2653e1(_0x28eb10[0x1]);function _0x2653e1(_0x196a6c){const _0x553fce=_0x4f69ce(_0x196a6c);return _0x553fce&&_0x51f8f1()?_0x553fce:null;function _0x51f8f1(){const _0x5907be=_0x553fce['jti'],_0xc54dac=window['parseInt'](_0x5907be['substring'](_0x5907be['length']-0x8),0x10),_0x4d05fa={..._0x553fce,'jti':_0x5907be['substring'](0x0,_0x5907be['length']-0x8)};return delete _0x4d05fa['vc'],_0x5bae57(_0x4d05fa)==_0xc54dac;}}}async function _0x119233(){let _0x322d54=!0x0;try{const [_0x7e8c7,_0x196380,_0x2809d6]=_0x56b12a['split']('.');return _0x1c145c(_0x7e8c7),await _0x5e5cdc(_0x7e8c7,_0x196380,_0x2809d6),_0x322d54;}catch{return!0x1;}function _0x1c145c(_0x44c3de){const _0x5b18f6=_0x4f69ce(_0x44c3de);_0x5b18f6&&'ES256'==_0x5b18f6['alg']||(_0x322d54=!0x1);}async function _0x5e5cdc(_0x16a572,_0x349097,_0x12cb34){const _0xa684d3=window['Uint8Array']['from'](_0x26f26d(_0x12cb34),_0x15a5a8=>_0x15a5a8['charCodeAt'](0x0)),_0x25f8dc=new window['TextEncoder']()['encode'](_0x16a572+'.'+_0x349097),_0x1c75b1=window['crypto']['subtle'];if(!_0x1c75b1)return;const _0x37b972=await _0x1c75b1['importKey']('jwk',_0x4c9281,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x1c75b1['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x37b972,_0xa684d3,_0x25f8dc)||(_0x322d54=!0x1);}}function _0x4f69ce(_0x5d3a92){return _0x5d3a92['startsWith']('ey')?JSON['parse'](_0x26f26d(_0x5d3a92)):null;}function _0x26f26d(_0x261efc){return window['atob'](_0x261efc['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5bae57(_0x410644){let _0x4bb7ce=0x1505;function _0x21f281(_0x557f32){for(let _0x174818=0x0;_0x174818<_0x557f32['length'];_0x174818++){const _0x2b9021=_0x557f32['charCodeAt'](_0x174818);_0x4bb7ce=(_0x4bb7ce<<0x5)+_0x4bb7ce+_0x2b9021,_0x4bb7ce&=_0x4bb7ce;}}function _0x3bd97d(_0x563094){Array['isArray'](_0x563094)?_0x563094['forEach'](_0x3bd97d):_0x563094&&'object'==typeof _0x563094?Object['entries'](_0x563094)['sort']()['forEach'](([_0x45a936,_0x512867])=>{_0x21f281(_0x45a936),_0x3bd97d(_0x512867);}):_0x21f281(window['String'](_0x563094));}return _0x3bd97d(_0x410644),_0x4bb7ce>>>0x0;}function _0x3bf5c2(_0x476498){return _0x476498['toString'](0x10)['padStart'](0x8,'0');}function _0x473d36(_0x4ba18a){return _0x4ba18a['split']('')['reverse']()['join']('');}function _0x58393f(_0x42a3f2){return _0x53ea31['plugins']['has'](_0x42a3f2);}function _0x28c59c(_0x2bb0c2){return _0x53ea31['plugins']['get'](_0x2bb0c2);}function _0xed4402(){}_0x455015(await _0x4a08cd());}_0x409a62(_0x3bb5f8['editor']);}(this);}createRevision(_0x5524ec){const _0x39607f=this['editor']['plugins']['get']('Users');return new pt({'id':_0x5524ec['id'],'name':_0x5524ec['name'],'creator':_0x5524ec['creatorId']?_0x39607f['getUser'](_0x5524ec['creatorId']):null,'diffData':_0x5524ec['diffData']||_0x5524ec['data'],'authors':_0x5524ec['authorsIds']['map'](_0x3b26ab=>_0x39607f['getUser'](_0x3b26ab)),'createdAt':new Date(_0x5524ec['createdAt']),'attributes':_0x5524ec['attributes'],'fromVersion':_0x5524ec['fromVersion'],'toVersion':_0x5524ec['toVersion']});}['addRevision'](_0x256e70,_0x230a02=0x0){this['_revisions']['add'](_0x256e70,_0x230a02);}getRevision(_0x4dff79){return this['_revisions']['get'](_0x4dff79);}getRevisions(_0x4dcaa8={'toJSON':!0x1}){const _0x264c61=Array['from'](this['_revisions']);return _0x264c61['reverse'](),_0x4dcaa8['toJSON']?_0x264c61['map'](_0x3581d0=>_0x3581d0['toJSON']()):_0x264c61;}getIndex(_0x34b834){return this['_revisions']['getIndex'](_0x34b834);}getEarlierVisibleRevision(_0x22896c){const [,_0xab6a4b]=this['getRevisionsIterator'](_0x22896c,{'direction':'earlier'});return _0xab6a4b;}getLaterVisibleRevision(_0x30431b){const [,_0x361590]=this['getRevisionsIterator'](_0x30431b,{'direction':'later'});return _0x361590;}getRevisionsInDiff(_0x31044f){const _0xa2016e=[];for(const _0x1246ab of this['getRevisionsIterator'](_0x31044f['newRevisionId']))if(_0xa2016e['push'](_0x1246ab),_0x1246ab['id']===_0x31044f['oldRevisionId'])break;return _0xa2016e;}*getRevisionsIterator(_0x1b4048,{direction:_0x59db49='earlier',filter:_0x1a35fc=()=>!0x0}={}){const _0x310985='earlier'===_0x59db49?0x1:-0x1;let _0x2ad9c5=this['_revisions']['get'](_0x1b4048),_0x5c4fbb=this['getIndex'](_0x2ad9c5);for(yield _0x2ad9c5;_0x2ad9c5;){if(_0x5c4fbb+=_0x310985,_0x2ad9c5=this['getRevision'](_0x5c4fbb),!_0x2ad9c5)return;_0x1a35fc(_0x2ad9c5)&&(yield _0x2ad9c5);}}},bt=class extends _0x2dd53f{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x204fa7,'c'],[_0x1333cc,'a'],[_0x11cb1f,'e'],[_0x1c3a68,'r'],[_0x4af6dc,'u']]);_typeCharToViewClass=new Map([['c',_0x204fa7],['a',_0x1333cc],['e',_0x11cb1f],['r',_0x1c3a68],['u',_0x4af6dc]]);async loadRevisionData(_0x10cc38,_0x4365a2){if(_0x10cc38['diffData']||!_0x4365a2)return;const _0xf511fb=this['editor']['config']['get']('collaboration.channelId');_0x10cc38['diffData']=(await _0x4365a2['getRevision']({'channelId':_0xf511fb,'revisionId':_0x10cc38['id']}))['diffData'];}getRevisionDocumentData(_0x10038b){const _0x33500f={};for(const _0x4bf08b in _0x10038b['diffData']){if(_0x10038b['diffData'][_0x4bf08b]['attachChange']&&!_0x10038b['diffData'][_0x4bf08b]['attachChange']['isAttached'])continue;const _0xd3cc4a=this['_removeRevisionMarkers'](JSON['parse'](_0x10038b['diffData'][_0x4bf08b]['insertions'])),_0x394196=this['editor']['editing']['view']['document'],_0x33938a=new _0x5dc85d(_0x394196,_0xd3cc4a['map'](_0x28b4a2=>this['_getViewFromDiffObj'](_0x28b4a2,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x33500f[_0x4bf08b]=this['editor']['data']['processor']['toData'](_0x33938a),this['editor']['data']['processor']['useFillerType']('default');}return _0x33500f;}getRevisionRootsAttributes(_0x59ec9a){const _0x427ae0={};for(const _0x454787 in _0x59ec9a['diffData'])_0x59ec9a['diffData'][_0x454787]['attachChange']&&!_0x59ec9a['diffData'][_0x454787]['attachChange']['isAttached']||(_0x427ae0[_0x454787]=_0x59ec9a['diffData'][_0x454787]['attributesAfter']||{});return _0x427ae0;}getRevisionRootsModelElements(_0x5113c7){const _0x15be4e={};for(const _0xe444c4 in _0x5113c7['diffData']){if(_0x5113c7['diffData'][_0xe444c4]['attachChange']&&!_0x5113c7['diffData'][_0xe444c4]['attachChange']['isAttached'])continue;const _0x4f569b=_0x5113c7['diffData'][_0xe444c4]['rootElementName'];_0x4f569b&&(_0x15be4e[_0xe444c4]=_0x4f569b);}return _0x15be4e;}_getTypeCharForViewElement(_0x18ff98){return this['_viewClassToTypeChar']['get'](_0x18ff98['constructor']);}_getViewFromDiffObj(_0x38e677,_0x37432d){const _0x3c751f=this['editor']['editing']['view']['document'];if('string'==typeof _0x38e677)return new _0x2d3251(_0x3c751f,_0x38e677);{let _0x2f118e,_0x4a0874;_0x4a0874='u'==_0x38e677['type']||'r'==_0x38e677['type']?[]:_0x38e677['children']['map'](_0x1113a8=>this['_getViewFromDiffObj'](_0x1113a8,_0x37432d));const _0x367d84=this['_typeCharToViewClass']['get'](_0x38e677['type'])||_0xc55704,_0x5364c6=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x2f118e=new _0x367d84(_0x3c751f,_0x38e677['name'],_0x38e677['attributes'],_0x4a0874),'u'==_0x38e677['type']&&_0x38e677['children'][0x0]){const _0x247c79=_0x38e677['children'][0x0];if(_0x2f118e['render']=function(_0x109169){const _0x1d232b=_0x109169['createElement']('div');return _0x1d232b['innerHTML']=_0x247c79,_0x1d232b['childNodes'][0x0];},_0x37432d){const _0x300ff8=new _0x5dc85d(_0x3c751f);_0x300ff8['_appendChild'](_0x2f118e);const _0x295acc=Array['from'](_0x5364c6['viewChildrenToDom'](_0x300ff8,{'bind':!0x1})),_0x60217b=_0x5364c6['domDocument']['createElement']('div');_0x60217b['append'](..._0x295acc),_0x2f118e=Array['from'](_0x5364c6['domChildrenToView'](_0x60217b))[0x0];}}else{if('r'==_0x38e677['type']&&_0x38e677['children'][0x0]){const _0x3bbb53=_0x38e677['children'][0x0];if(_0x2f118e['render']=function(_0x55e657){_0x55e657['innerHTML']=_0x3bbb53;},_0x37432d){const _0x455f83=new _0x5dc85d(_0x3c751f);_0x455f83['_appendChild'](_0x2f118e);const _0x37ba00=Array['from'](_0x5364c6['viewChildrenToDom'](_0x455f83,{'bind':!0x1})),_0x3d9a01=_0x5364c6['domDocument']['createElement']('div');_0x3d9a01['append'](..._0x37ba00);const _0x17151a=Array['from'](_0x5364c6['domChildrenToView'](_0x3d9a01));_0x17151a['length']>0x1?_0x2f118e['_appendChild'](_0x17151a):_0x2f118e=_0x17151a[0x0];}}}if(_0x38e677['customProperties']){for(const [_0x44b8d0,_0x5d045a]of _0x38e677['customProperties'])_0x2f118e['_setCustomProperty'](_0x44b8d0,_0x5d045a);}const _0x3e9d08=void 0x0===_0x38e677['fillerOffset']?null:_0x38e677['fillerOffset'];return null!==_0x3e9d08&&(_0x2f118e['getFillerOffset']=()=>_0x3e9d08),_0x2f118e;}}_makeModelFromViewString(_0x2c7f61,_0x27d74b){const _0x48a7f4=JSON['parse'](_0x2c7f61),_0x7bd378=this['editor']['editing']['view']['document'],_0x4192cc=new _0x5dc85d(_0x7bd378,_0x48a7f4['map'](_0x171bb9=>this['_getViewFromDiffObj'](_0x171bb9,!0x0))),_0x11dd0b=this['editor']['data']['toModel'](_0x4192cc,_0x27d74b);return _0x11dd0b['name']=_0x27d74b,_0x11dd0b;}['_removeRevisionMarkers'](_0x1a56fd){return(_0x1a56fd=_0x1a56fd['filter'](_0x444050=>!_0x444050['name']||'revision-start'!==_0x444050['name']&&'revision-end'!==_0x444050['name']))['forEach'](_0x2f1afc=>{'string'!=typeof _0x2f1afc&&(_0x2f1afc['children']=this['_removeRevisionMarkers'](_0x2f1afc['children']),_0x2f1afc['attributes']=_0x2f1afc['attributes']['filter'](_0x1c9d62=>!_0x1c9d62[0x0]['startsWith']('data-revision-')));}),_0x1a56fd;}};function Rt(_0x36b6dd,_0x436180,_0x179009){const t=_0x36b6dd['t'];switch(_0x436180){case'Revision\x20history':return t('Revision\x20history');case'Open\x20revision\x20history':return t('Open\x20revision\x20history');case'Restored':return t('Restored');case'Empty\x20document':return t('Empty\x20document');case'Initial\x20revision':return t('Initial\x20revision');case'Suggested\x20by':return t('Suggested\x20by');case'Added\x20by':return t('Added\x20by');case'Removed\x20by':return t('Removed\x20by');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Compare\x20against\x20selected':return t('Compare\x20against\x20selected');case'Name\x20this\x20revision':return t('Name\x20this\x20revision');case'Restore\x20this\x20revision':return t('Restore\x20this\x20revision');case'Back\x20to\x20editing':return t('Back\x20to\x20editing');case'Loading...':return t('Loading...');case'No\x20changes':return t('No\x20changes');case'NUMBER_OF_CHANGES':return t({'string':'%0\x20change','plural':'%0\x20changes','id':'NUMBER_OF_CHANGES'},_0x179009);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x179009);case'Show\x20previous\x20change':return t('Show\x20previous\x20change');case'Show\x20next\x20change':return t('Show\x20next\x20change');case'EDIT_X_OF_Y_REVISIONS':return t({'string':'Edit','id':'EDIT_X_OF_Y_REVISIONS'});case'Total':return t('Total');case'Revision\x20creator':return t('Revision\x20creator');case'Revision\x20author':return t('Revision\x20author');case'Revision\x20name':return t('Revision\x20name');case'Save\x20current\x20revision':return t('Save\x20current\x20revision');case'Accept':return t('Accept');case'Save':return t('Save');case'Cancel':return t('Cancel');case'Name\x20of\x20the\x20revision':return t('Name\x20of\x20the\x20revision');case'optional':return t('optional');case'PENDING_ACTION_REVISION_HISTORY':return t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'The\x20revision\x20name\x20cannot\x20be\x20empty.':return t('The\x20revision\x20name\x20cannot\x20be\x20empty.');case'Enter\x20the\x20revision\x20name':return t('Enter\x20the\x20revision\x20name');case'REVISION_AI_SOURCE_PILL_LABEL':return t({'string':'Includes\x20AI\x20suggestions','id':'REVISION_AI_SOURCE_PILL_LABEL'});case'AI_SOURCE_REVISION_TOOLTIP':return t({'string':'This\x20revision\x20contains\x20AI-assisted\x20suggestions.','id':'AI_SOURCE_REVISION_TOOLTIP'});case'AI_SOURCE_CHANGE_TOOLTIP':return t({'string':'This\x20change\x20was\x20suggested\x20using\x20AI.','id':'AI_SOURCE_CHANGE_TOOLTIP'});case'AI_SOURCE_ADDED_BY':return t({'string':'Added\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_ADDED_BY'},_0x179009);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x179009);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x179009);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var kt=class extends _0x2dd53f{['licenseKey'];_licenseKeyCheckInterval;currentRevision=null;repository;adapter=null;_revisionDataBuilder;['_source'];_initialRevisionId;_bufferedUpdates;_utils;_pendingAction;_continueCurrentRevision;_startingVersion;_loadedStateData;static get['pluginName'](){return'RevisionTracker';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x3002ea,yt,bt,_0x83e39c];}constructor(_0x48fc2c){super(_0x48fc2c),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new At(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x34dd24=_0x1cb26b();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x34dd24},this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['set']('_isPendingUpdate',!0x1),this['editor']['config']['define']('revisionHistory.resumeUnsavedRevision',!0x0),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'});}init(){this['_setConversion'](),this['editor']['data']['on']('ready',()=>{const _0x3e6b77=this['repository']['getRevision'](0x0),_0x348fe3=_0x3e6b77&&null===_0x3e6b77['creator']?_0x3e6b77:null;if(this['_continueCurrentRevision']=!!_0x348fe3&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x5c12f4=this['_source']['getCurrentRevisionId'](),_0x4dad5f=this['repository']['getRevision'](_0x5c12f4);if(_0x4dad5f)this['_startingVersion']=_0x4dad5f['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x52b0a1=this['_source']['history']['_operations']['find'](_0x2f4b3e=>!_0x2f4b3e['_isInit']),_0x3c3ee1=_0x52b0a1?_0x52b0a1['baseVersion']:this['_source']['history']['version'];_0x3e6b77?(_0x3e6b77['toVersion']<_0x3c3ee1&&_0x3e6b77['_update']({'toVersion':_0x3c3ee1}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x348fe3['id'],this['_startingVersion']=_0x348fe3['fromVersion']):(this['_startingVersion']=_0x3e6b77['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x3c3ee1,this['_continueCurrentRevision']=!0x1);}}else _0x348fe3&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x348fe3['toVersion'],this['editor']['model']['document']['history']['version']),_0x348fe3['fromVersion']===_0x348fe3['toVersion']?(0x0!==_0x348fe3['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x348fe3['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x348fe3['id'],this['_startingVersion']=_0x348fe3['fromVersion'])),this['_continueCurrentRevision']||(this['_startingVersion']=this['editor']['model']['document']['version']);this['_revisionDataBuilder']['init'](this['_source']['history']),this['_createInitialRevision'](this['_startingVersion']),this['_createCurrentRevision'](this['_startingVersion']),this['adapter']&&this['sendBufferedUpdates']();}),this['bind']('isReady')['to'](this,'_isPendingUpdate',_0x2774d6=>!_0x2774d6),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x5d878d=[this['editor']];for(const _0x2c64da of _0x5d878d){let _0x38f880;for(const _0xd3cdef in _0x2c64da){const _0x11a4d2=_0xd3cdef,_0x1a4dfd=_0x2c64da[_0x11a4d2];if('revisionHistoryLicenseKeyValid'==_0x1a4dfd||'revisionHistoryLicenseKeyInvalid'==_0x1a4dfd||'revisionHistoryLicenseKeyExpired'==_0x1a4dfd||'revisionHistoryLicenseKeyDomainLimit'==_0x1a4dfd||'revisionHistoryLicenseKeyNotAllowed'==_0x1a4dfd||'revisionHistoryLicenseKeyEvaluationLimit'==_0x1a4dfd||'revisionHistoryLicenseKeyUsageLimit'==_0x1a4dfd){delete _0x2c64da[_0x11a4d2],_0x38f880=_0x1a4dfd,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x38f880&&_0x2c64da['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x38f880&&_0x2c64da['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x38f880&&_0x2c64da['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x38f880&&_0x2c64da['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x38f880&&_0x2c64da['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x38f880&&_0x2c64da['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x2acc77=this['repository']['getRevision'](0x0),_0x53119e=await this['getRevisionDocumentData'](_0x2acc77),_0x46af87=await this['getRevisionRootsAttributes'](_0x2acc77),_0x5bac75=this['_utils']['getRevisionRootsModelElements'](_0x2acc77);this['_replaceEditorDataWithRevisionData'](_0x53119e,_0x46af87,_0x5bac75);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x337be3){this['_source']=_0x337be3;}async update(){const _0x4c36d1=await this['_source']['getLatestVersion']();if(_0x4c36d1>this['currentRevision']['toVersion']){await this['_loadState']();const _0x24ed30=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x4c36d1});_0x24ed30['authors']=_0x24ed30['authorsIds']['map'](_0x1f4826=>this['editor']['plugins']['get']('Users')['getUser'](_0x1f4826)),this['currentRevision']['_update'](_0x24ed30);}}async['saveRevision'](_0x16b6fb={},_0x3b368b=null){const _0x3884bb=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x3b368b>this['currentRevision']['toVersion']&&(_0x3b368b=null),null===_0x3b368b&&(_0x3b368b=await this['_source']['getLatestVersion']());const _0x12e9f4=this['_getFromVersion'](_0x3b368b),_0x4d255d=this['buildRevisionData']({'from':_0x12e9f4,'to':_0x3b368b});if(this['currentRevision']['toVersion']<_0x3b368b){const _0x48a6a0=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x3b368b,'to':_0x3b368b});_0x48a6a0['authors']=[],_0x48a6a0['authorsIds']=[],_0x48a6a0['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x48a6a0,!0x0),delete _0x48a6a0['authors'],_0x3884bb['push'](_0x48a6a0);}const _0x4e45c3={..._0x16b6fb,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x16b6fb['name']||null,'id':_0x16b6fb['id']||_0x1cb26b(),..._0x4d255d,'attributes':{..._0x16b6fb['attributes'],..._0x4d255d['attributes']}},_0x51fd82=this['addRevisionData'](_0x4e45c3);_0x3884bb['push'](_0x4e45c3);const _0x19487b=this['repository']['getIndex'](_0x51fd82);if(0x0!==_0x19487b){const _0x303fde=this['repository']['getRevision'](_0x19487b-0x1);if(_0x303fde['fromVersion']!==_0x3b368b){const _0x39832f=this['_revisionDataBuilder']['getData'](_0x3b368b,_0x303fde['toVersion']),_0x3608ab={'id':_0x303fde['id'],'diffData':_0x39832f['diffData'],'authorsIds':_0x39832f['authorsIds'],'authors':_0x39832f['authorsIds']['map'](_0x7d5c2b=>this['editor']['plugins']['get']('Users')['getUser'](_0x7d5c2b)),'fromVersion':_0x3b368b};this['_stampAiAttribute'](_0x3608ab,_0x303fde,!!_0x39832f['hasAIChanges']),_0x303fde===this['currentRevision']&&(_0x3608ab['createdAt']=new Date(_0x4e45c3['createdAt']['getTime']()+0xa)),_0x303fde['_update'](_0x3608ab,!0x0),delete _0x3608ab['authors'],_0x3884bb['push'](_0x3608ab);}}if(this['adapter']){for(const _0x1c7389 of _0x3884bb)this['_bufferUpdate'](_0x1c7389['id'],_0x1c7389,!0x0);this['sendBufferedUpdates']();}return _0x51fd82;}addRevisionData(_0x31235e){const _0x5d3d06=this['repository']['createRevision'](_0x31235e);return this['adapter']&&_0x5d3d06['on']('_update',(_0x31176a,_0x53a61a,_0x34f85a)=>{_0x34f85a||(this['_bufferUpdate'](_0x53a61a['id'],_0x53a61a,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x5d3d06,this['_findInsertionIndex'](_0x5d3d06)),_0x5d3d06;}async getRevisionDocumentData(_0x1898c6){return await this['_utils']['loadRevisionData'](_0x1898c6,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x1898c6);}async getRevisionRootsAttributes(_0x2f2fef){return await this['_utils']['loadRevisionData'](_0x2f2fef,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x2f2fef);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x568f65=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x915805=0x0;_0x915805<_0x568f65['length'];_0x915805++){const _0x4852bc=_0x568f65[_0x915805];let _0x5659c7=!0x1;for(const _0x57b89b of Object['keys'](_0x4852bc))void 0x0===_0x4852bc[_0x57b89b]?delete _0x4852bc[_0x57b89b]:'id'!==_0x57b89b&&(_0x5659c7=!0x0);_0x5659c7||(_0x568f65[_0x915805]=null);}if(_0x568f65=_0x568f65['filter'](_0x195583=>null!==_0x195583),!_0x568f65['length'])return;for(let _0x417aa3=0x0;_0x417aa3<_0x568f65['length'];_0x417aa3++){const _0xc40670=_0x568f65[_0x417aa3];void 0x0!==_0xc40670['fromVersion']&&void 0x0===_0xc40670['toVersion']&&(_0xc40670['toVersion']=this['repository']['getRevision'](_0xc40670['id'])['toVersion']),void 0x0!==_0xc40670['toVersion']&&void 0x0===_0xc40670['fromVersion']&&(_0xc40670['fromVersion']=this['repository']['getRevision'](_0xc40670['id'])['fromVersion']);}const _0x2510aa=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x568f65,_0x2510aa)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x499777=>{if(_0x499777){for(const _0x49e166 of _0x499777)this['setRevisionData']({'id':_0x49e166['id'],'createdAt':_0x49e166['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0xca948e,_0xdbf562,_0xba8758){if(_0xba8758===(!!_0xdbf562&&!!_0xdbf562['attributes']['@ai']))return;const _0x4d42d3={..._0xdbf562?_0xdbf562['attributes']:{},..._0xca948e['attributes']};_0xba8758?_0x4d42d3['@ai']=!0x0:delete _0x4d42d3['@ai'],_0xca948e['attributes']=_0x4d42d3;}buildRevisionData({revision:_0x48fa11=null,from:_0xd8f8f7=null,to:_0x3ad4b2=null}){_0xd8f8f7=null!==_0xd8f8f7?_0xd8f8f7:_0x48fa11['fromVersion'],_0x3ad4b2=null!==_0x3ad4b2?_0x3ad4b2:_0x48fa11['toVersion'];const _0x414ff5=this['_revisionDataBuilder']['getData'](_0xd8f8f7,_0x3ad4b2),_0x4070ad={'diffData':_0x414ff5['diffData'],'authorsIds':_0x414ff5['authorsIds'],'fromVersion':_0xd8f8f7,'toVersion':_0x3ad4b2};if(this['_stampAiAttribute'](_0x4070ad,_0x48fa11,!!_0x414ff5['hasAIChanges']),!_0x48fa11||_0x3ad4b2!==_0x48fa11['toVersion']){const _0x11e3e1=_0x3ad4b2-0x1,_0x5bd00f=this['_source']['history']['getOperation'](_0x11e3e1);_0x4070ad['createdAt']=_0x5bd00f&&_0x5bd00f['createdAt']||new Date();}if(this['_loadedStateData']&&_0xd8f8f7===this['_loadedStateData']['fromVersion']){for(const _0x113cc4 of this['_loadedStateData']['authors'])_0x4070ad['authorsIds']['includes'](_0x113cc4['id'])||_0x4070ad['authorsIds']['push'](_0x113cc4['id']);}return _0x4070ad;}_bufferUpdate(_0x27522f,_0x45e846,_0x4bd99b){if(this['_bufferedUpdates']['has'](_0x27522f)){const _0x2b1b47=this['_bufferedUpdates']['get'](_0x27522f);_0x45e846=_0x4bd99b?{..._0x2b1b47,..._0x45e846}:{..._0x45e846,..._0x2b1b47};}this['_bufferedUpdates']['set'](_0x27522f,_0x45e846);}setRevisionData(_0x2759bd){const _0x4a26e5=this['repository']['getRevision'](_0x2759bd['id']);if(_0x2759bd['createdAt']&&(_0x2759bd['createdAt']=new Date(_0x2759bd['createdAt'])),_0x2759bd['authorsIds']){const _0x14a991=this['editor']['plugins']['get']('Users');_0x2759bd['authors']=_0x2759bd['authorsIds']['map'](_0x5bd2da=>_0x14a991['getUser'](_0x5bd2da));}_0x4a26e5['_update'](_0x2759bd,!0x0);}_createInitialRevision(_0x693209){const _0x1003d4=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x1003d4)this['_initialRevisionId']=_0x1003d4['id'];else{const _0x225d4c=!this['editor']['model']['document']['roots']['find'](_0x459a5c=>this['editor']['model']['hasContent'](_0x459a5c)),_0x5d79be=this['editor']['plugins']['get']('Users')['me']['id'],_0xbcbee8=Rt(this['editor']['locale'],_0x225d4c?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x693209,'to':_0x693209,'id':this['_initialRevisionId'],'name':_0xbcbee8,'creatorId':_0x5d79be});}}_createCurrentRevision(_0x37a983){const _0x25f343=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x25f343),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x37a983,'to':_0x37a983,'id':_0x25f343,'name':'','creatorId':null}));}async _loadState(){this['_continueCurrentRevision']&&!this['_loadedStateData']&&(await this['_utils']['loadRevisionData'](this['currentRevision'],this['adapter']),this['_revisionDataBuilder']['loadState'](this['currentRevision']),this['_loadedStateData']={'fromVersion':this['currentRevision']['fromVersion'],'authors':this['currentRevision']['authors']['slice']()});}_replaceEditorDataWithRevisionData(_0x252eb0,_0x314bba,_0x126828){const _0x2ce4c5={},_0x35a2a8={},_0x1f1732={},_0x7c157a=this['editor']['config']['get']('roots')||{};for(const [_0x17a58e,_0xee15d7]of Object['entries'](_0x7c157a))_0xee15d7['lazyLoad']||(_0x2ce4c5[_0x17a58e]=_0xee15d7['initialData']??'',_0x35a2a8[_0x17a58e]=_0xee15d7['modelAttributes']||{},_0xee15d7['modelElement']&&(_0x1f1732[_0x17a58e]=_0xee15d7['modelElement']));for(const _0x6583ff of this['editor']['model']['document']['getRootNames']())_0x2ce4c5[_0x6583ff]??='',_0x35a2a8[_0x6583ff]??={};let _0x56455c=!0x1;const _0x19c7b4=Object['keys'](_0x2ce4c5),_0x262da1=Object['keys'](_0x252eb0);for(const _0x3fc7ad of _0x19c7b4){if(_0x2ce4c5[_0x3fc7ad]!==_0x252eb0[_0x3fc7ad]&&''!==_0x2ce4c5[_0x3fc7ad]['trim']()){_0x56455c=!0x0;break;}if(!_0x4c14f1(_0x35a2a8[_0x3fc7ad],_0x314bba[_0x3fc7ad])&&Object['keys'](_0x35a2a8[_0x3fc7ad])['length']>0x0){_0x56455c=!0x0;break;}const _0x59d2d9=_0x1f1732[_0x3fc7ad],_0x5006a3=_0x126828[_0x3fc7ad];if(_0x59d2d9&&_0x5006a3&&_0x59d2d9!==_0x5006a3){_0x56455c=!0x0;break;}}_0x56455c||(_0x56455c=_0x262da1['some'](_0x59204e=>!this['editor']['model']['document']['getRoot'](_0x59204e))),_0x56455c&&_0x282e5f('editor-initial-data-replaced-with-revision-data',{'editorData':_0x2ce4c5,'editorRootsAttributes':_0x35a2a8,'editorRootsModelElements':_0x1f1732,'revisionData':_0x252eb0,'revisionRootsAttributes':_0x314bba,'revisionRootsModelElements':_0x126828});for(const [_0x20e7aa,_0x1b19f6]of Object['entries'](_0x252eb0))this['editor']['config']['set']('roots.'+_0x20e7aa+'.initialData',_0x1b19f6);for(const [_0x386176,_0x16d592]of Object['entries'](_0x314bba))this['editor']['config']['set']('roots.'+_0x386176+'.modelAttributes',_0x16d592);const _0x29fea7=this['editor']['model']['document'];for(const [_0x559e4b,_0xbd1933]of Object['entries'](_0x126828)){this['editor']['config']['set']('roots.'+_0x559e4b+'.modelElement',_0xbd1933);const _0x4e24f9=_0x29fea7['getRoot'](_0x559e4b);_0x4e24f9&&_0x4e24f9['name']!==_0xbd1933&&(_0x29fea7['roots']['remove'](_0x559e4b),_0x29fea7['createRoot'](_0xbd1933,_0x559e4b));}}_addPendingAction(){if(!this['_pendingAction']){const _0x315f93=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x315f93['add'](Rt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x10ec0e){const _0x24bf1b=this['repository']['getRevisions']();_0x24bf1b['reverse']();let _0x27b27e=0x0;for(;_0x27b27e<_0x24bf1b['length'];){const _0x2753dd=_0x24bf1b[_0x27b27e];if(_0x2753dd===this['currentRevision']){_0x27b27e++;continue;}if(_0x2753dd['id']===this['_initialRevisionId'])break;const _0x3027bc=_0x10ec0e['toVersion']-_0x2753dd['toVersion']||_0x10ec0e['fromVersion']-_0x2753dd['fromVersion'];if(_0x3027bc>0x0)break;if(_0x3027bc<0x0)_0x27b27e++;else{if(!_0x10ec0e['creator']&&_0x2753dd['creator'])break;if(_0x2753dd['creator']||!_0x10ec0e['creator']){if(_0x10ec0e['createdAt']>_0x2753dd['createdAt'])break;_0x27b27e++;}else _0x27b27e++;}}return _0x27b27e;}_getFromVersion(_0x1c4264){const _0x2dbf5c=this['repository']['getRevisions']();_0x2dbf5c['reverse'](),_0x2dbf5c['shift']();const _0x4fbf8a=_0x2dbf5c['find'](_0x22d1b4=>_0x22d1b4['toVersion']<=_0x1c4264)['toVersion'];return _0x4fbf8a<this['_startingVersion']?this['_startingVersion']:_0x4fbf8a;}['_makeRevision']({name:_0x6abb59,from:_0x2d9d34,to:_0x4a896d,creatorId:_0x219660,id:_0x3dcb57}){const _0x1b136f=this['buildRevisionData']({'from':_0x2d9d34,'to':_0x4a896d});_0x1b136f['name']=_0x6abb59,_0x1b136f['creatorId']=_0x219660,_0x1b136f['id']=_0x3dcb57;const _0xb08dd1=this['addRevisionData'](_0x1b136f);return this['adapter']&&this['_bufferUpdate'](_0x1b136f['id'],_0x1b136f,!0x0),_0xb08dd1;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},At=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x2a12e0){this['editor']=_0x2a12e0,this['_savedMetaData']=new Map(),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_markers']=new Map(),this['_diffRoots']=new Map(),this['_diffRootsAttributes']=new Map(),this['_baseRoots']=new Map(),this['_baseRootsAttributes']=new Map(),this['_idsRoots']=new Map(),this['_baseIdsRoots']=new Map(),this['_touched']=new Map(),this['_touchedMarkers']=new Map(),this['_aiTouchedMarkers']=new Map(),this['_touchedRoots']=new Map(),this['_revisionId']=0x1;}init(_0x5933e2){this['source']=_0x5933e2;const _0x91289a=new Map(),_0x12415b=new Map(),_0x140538=this['editor']['model']['document']['roots']['map'](_0x34a0fe=>_0x34a0fe['rootName']);for(const _0xd7af32 of _0x140538){const _0x46e9aa=this['editor']['model']['document']['getRoot'](_0xd7af32),_0xc68bcf=It(_0x46e9aa);_0x91289a['set'](_0xd7af32,_0xc68bcf),_0x12415b['set'](_0xd7af32,Object['fromEntries'](_0x46e9aa['getAttributes']()));}const _0x1a0b3d=Array['from'](this['editor']['model']['markers'])['map'](_0x4dca7e=>[_0x4dca7e['name'],_0x4dca7e['getRange']()]),_0x47760e=this['source']['version'];this['_saveMetaData'](_0x47760e,_0x91289a,_0x1a0b3d,_0x12415b),this['_startingRevisionId']=this['_revisionId'];const _0x435021=new Map(),_0x39e22f=new Map();for(const _0x572499 of _0x140538){const _0x3cb0b8=St(_0x572499,this['editor']['model']['document']['getRoot'](_0x572499)['name']);_0x435021['set'](_0x572499,_0x3cb0b8),_0x39e22f['set'](_0x572499,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x435021,[],_0x39e22f);}getData(_0x11b046,_0x884b82){if(this['_lastFrom']===_0x11b046&&this['_lastTo']<=_0x884b82)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x884b82,!0x0);else{if(!this['_savedMetaData']['has'](_0x11b046)){const _0x52f0d4=this['_getPreviousFrom'](_0x11b046);this['_calculateMetaData'](_0x52f0d4,_0x11b046,!0x1);}this['_calculateMetaData'](_0x11b046,_0x884b82,!0x0);}return this['_lastFrom']=_0x11b046,this['_lastTo']=_0x884b82,this['_getState']();}loadState(_0x5ee96f){if(!this['_savedMetaData']['has'](_0x5ee96f['fromVersion'])){const _0x4fdb68=this['_getPreviousFrom'](_0x5ee96f['fromVersion']);this['_calculateMetaData'](_0x4fdb68,_0x5ee96f['fromVersion'],!0x1);}this['_calculateMetaData'](_0x5ee96f['fromVersion'],_0x5ee96f['toVersion'],!0x1);const _0x68f08=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x5ee96f['fromVersion'],this['_lastTo']=_0x5ee96f['toVersion'];for(const _0x415dd6 in _0x5ee96f['diffData']){const _0x28a6a5=_0x5ee96f['diffData'][_0x415dd6]['attachChange'],_0x1f4177=_0x2e1942(_0x5ee96f['diffData'][_0x415dd6]['attributesBefore'])||{},_0x30ba7d=_0x5ee96f['diffData'][_0x415dd6],_0x2989ad=_0x68f08['_makeModelFromViewString'](_0x30ba7d['deletions'],_0x30ba7d['rootElementName']||'$root');_0x2989ad['rootName']=_0x415dd6,_0x2989ad['_isAttached']=!_0x28a6a5||!_0x28a6a5['isAttached'],_0x2989ad['isAttached']=()=>_0x2989ad['_isAttached'],this['_baseRoots']['set'](_0x415dd6,_0x2989ad),this['_baseRootsAttributes']['set'](_0x415dd6,_0x1f4177),_0x28a6a5&&this['_touchedRoots']['set'](_0x415dd6,_0x28a6a5);const _0x595ccc=this['_makeIdsRoot'](_0x2989ad);this['_baseIdsRoots']['set'](_0x415dd6,_0x595ccc);for(const [_0x56eb2f,_0xf9cf34]of _0x2989ad['markers']){if(!_0x56eb2f['startsWith']('revision:'))continue;const _0xbe4af=_0x56eb2f['split'](':')[0x2],_0xd184e4=_0x30ba7d['aiSources']?.[_0x56eb2f]||null;for(const _0x23ad2f of _0xf9cf34['getWalker']({'singleCharacters':!0x0})){const _0x3260f9=this['_getVidAttributeName'](_0x23ad2f),_0x2894e6='elementEnd'==_0x23ad2f['type']?_0x23ad2f['previousPosition']['path']['slice'](0x0,-0x1):_0x23ad2f['previousPosition']['path'],_0xafa9e5=_0x595ccc['getNodeByPath'](_0x2894e6)['getAttribute'](_0x3260f9);this['_touched']['set'](_0xafa9e5,{'userId':_0xbe4af,'aiSource':_0xd184e4});}_0x2989ad['markers']['delete'](_0x56eb2f);}}this['_startingRevisionId']=this['_revisionId'];const _0x48c95e=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x47cc38=>!this['_touched']['has'](_0x47cc38));let _0x54407c=0x0;const _0x1ec854=new Map();for(const _0x3355ba in _0x5ee96f['diffData']){const _0x54b29c=_0x5ee96f['diffData'][_0x3355ba]['attachChange'],_0x2574cc=_0x2e1942(_0x5ee96f['diffData'][_0x3355ba]['attributesAfter'])||{},_0x4263b2=_0x5ee96f['diffData'][_0x3355ba],_0x492bfd=_0x68f08['_makeModelFromViewString'](_0x4263b2['insertions'],_0x4263b2['rootElementName']||'$root');_0x492bfd['rootName']=_0x3355ba,_0x492bfd['_isAttached']=!_0x54b29c||_0x54b29c['isAttached'],_0x492bfd['isAttached']=()=>_0x492bfd['_isAttached'],this['_diffRoots']['set'](_0x3355ba,_0x492bfd),this['_diffRootsAttributes']['set'](_0x3355ba,_0x2574cc);const _0x3460f5=this['_makeIdsRoot'](_0x492bfd,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x3355ba,_0x3460f5),_0x1ec854['set'](_0x3355ba,_0x492bfd['isAttached']()?_0x2574cc:{});for(const [_0x14e7f7,_0x238ad3]of _0x492bfd['markers']){if(!_0x14e7f7['startsWith']('revision:'))continue;const _0x3e89e7=_0x14e7f7['split'](':')[0x2],_0xdeba24=_0x4263b2['aiSources']?.[_0x14e7f7]||null;for(const _0x566b9b of _0x238ad3['getWalker']({'singleCharacters':!0x0})){const _0x4cd2ea=this['_getVidAttributeName'](_0x566b9b),_0x17cf53=this['_revisionId']++,_0x563253='elementEnd'==_0x566b9b['type']?_0x566b9b['previousPosition']['path']['slice'](0x0,-0x1):_0x566b9b['previousPosition']['path'];_0x3460f5['getNodeByPath'](_0x563253)['_setAttribute'](_0x4cd2ea,_0x17cf53),this['_touched']['set'](_0x17cf53,{'userId':_0x3e89e7,'aiSource':_0xdeba24});}_0x492bfd['markers']['delete'](_0x14e7f7);}for(const _0x17af32 of this['editor']['model']['createRangeIn'](_0x492bfd)['getWalker']({'singleCharacters':!0x0})){const _0x250f9e=this['_getVidAttributeName'](_0x17af32),_0x1a8252='elementEnd'==_0x17af32['type']?_0x17af32['previousPosition']['path']['slice'](0x0,-0x1):_0x17af32['previousPosition']['path'],_0x3d0193=_0x3460f5['getNodeByPath'](_0x1a8252);_0x3d0193['getAttribute'](_0x250f9e)>0x0||_0x3d0193['_setAttribute'](_0x250f9e,_0x48c95e[_0x54407c++]);}for(const [_0x2c35a9,_0x11ff9b]of _0x492bfd['markers'])_0x2c35a9['startsWith']('revision:')||this['_markers']['set'](_0x2c35a9,_0x11ff9b);}const {roots:_0x331a5b}=this['_savedMetaData']['get'](_0x5ee96f['fromVersion']),{roots:_0x4fe4ae}=this['_savedMetaData']['get'](_0x5ee96f['toVersion']),_0x3734d6=It(_0x331a5b['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x3734d6),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x3734d6,Number['NEGATIVE_INFINITY']));const _0x2315d1=It(_0x4fe4ae['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x2315d1),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x2315d1));const _0x39cdac=Array['from'](this['_diffRoots'])['map'](([_0xb2a28a,_0x1449ff])=>[_0xb2a28a,It(_0x1449ff)]);this['_saveMetaData'](this['_lastTo'],_0x39cdac,this['_markers'],_0x1ec854);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x5893c0,_0x89b041,_0x25560a,_0x3a827b){const _0x2c8fa=new Map(_0x89b041),_0x191aec=new Map(_0x2e1942(_0x3a827b)),_0x48128a=new Map();for(const [_0x3b6ee3,_0x1c4f8a]of _0x25560a)_0x48128a['set'](_0x3b6ee3,{'start':_0x1c4f8a['start']['clone'](),'end':_0x1c4f8a['end']['clone'](),'rootName':_0x1c4f8a['root']['rootName']});this['_savedMetaData']['set'](_0x5893c0,{'roots':_0x2c8fa,'markers':_0x48128a,'rootsAttributes':_0x191aec});}_removeMetaData(_0x199a17){this['_savedMetaData']['delete'](_0x199a17);}_reset(){this['_touched']['clear'](),this['_touchedMarkers']['clear'](),this['_aiTouchedMarkers']['clear'](),this['_touchedRoots']['clear'](),this['_diffRoots']['clear'](),this['_diffRootsAttributes']['clear'](),this['_baseRoots']['clear'](),this['_baseRootsAttributes']['clear'](),this['_idsRoots']['clear'](),this['_baseIdsRoots']['clear'](),this['_markers']['clear'](),this['_revisionId']=0x1,this['_startingRevisionId']=this['_revisionId'];}_makeIdsRoot(_0x3fceea,_0x32e1fe=null){let _0x435efb=null;_0x3fceea['is']('documentFragment')||(_0x435efb=new _0x524633(_0x3fceea['name'],{'vid_start':null===_0x32e1fe?this['_revisionId']++:_0x32e1fe++}));const _0x394f6a=[];for(const _0x28ba86 of _0x3fceea['getChildren']())if(_0x28ba86['is']('element')){_0x394f6a['push'](this['_makeIdsRoot'](_0x28ba86,_0x32e1fe));const _0x1ea746=_0x394f6a[_0x394f6a['length']-0x1];null!==_0x32e1fe&&(_0x32e1fe=_0x1ea746['is']('element','$text')?_0x1ea746['getAttribute']('vid')+0x1:_0x1ea746['getAttribute']('vid_end')+0x1);}else{for(let _0x1d3583=0x0;_0x1d3583<_0x28ba86['offsetSize'];_0x1d3583++)_0x394f6a['push'](new _0x524633('$text',{'vid':null===_0x32e1fe?this['_revisionId']++:_0x32e1fe++}));}if(_0x3fceea['is']('documentFragment')){const _0x9861e4=St(_0x3fceea['rootName'],_0x3fceea['name']);return _0x9861e4['_insertChild'](0x0,_0x394f6a),_0x9861e4;}return _0x435efb['_setAttribute']('vid_end',null===_0x32e1fe?this['_revisionId']++:_0x32e1fe),_0x435efb['_insertChild'](0x0,_0x394f6a),_0x435efb;}_calculateMetaData(_0x3fc78c,_0x56a800,_0x544814){this['_reset']();const {roots:_0x5a6105,markers:_0x523578,rootsAttributes:_0xb15641}=this['_savedMetaData']['get'](_0x3fc78c);this['_baseRoots']=new Map(_0x5a6105),this['_baseRootsAttributes']=new Map(_0x2e1942(_0xb15641));for(const [_0x583601,_0x37ea86]of this['_baseRoots'])if('$graveyard'!==_0x583601&&(this['_diffRoots']['set'](_0x583601,It(_0x37ea86)),this['_diffRootsAttributes']=new Map(_0x2e1942(_0xb15641)),_0x544814)){const _0x542750=this['_revisionId'];this['_idsRoots']['set'](_0x583601,this['_makeIdsRoot'](_0x37ea86)),this['_baseIdsRoots']['set'](_0x583601,this['_makeIdsRoot'](_0x37ea86,_0x542750));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',It(this['_baseRoots']['get']('$graveyard'))),_0x544814&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x21117a,_0x38d044]of _0x523578){const _0x4505f9=this['_baseRoots']['get'](_0x38d044['rootName']),_0x144bea=this['_diffRoots']['get'](_0x38d044['rootName']),_0x18aaf8=new _0x49ff12(_0x1cef80(_0x38d044['start'],_0x4505f9),_0x1cef80(_0x38d044['end'],_0x4505f9)),_0x2e1f21=_0xc7b39b(_0x18aaf8,_0x144bea);_0x4505f9['markers']['set'](_0x21117a,_0x18aaf8),this['_markers']['set'](_0x21117a,_0x2e1f21);}this['_applyOperations'](_0x3fc78c,_0x56a800,_0x544814);}_applyOperations(_0x5cd763,_0x2a9fee,_0x11c0c2){for(const _0x3379ea of this['source']['getOperations'](_0x5cd763,_0x2a9fee))this['_handleOperation'](_0x3379ea,_0x11c0c2);for(const _0x4ba06d of this['_diffRoots']['values']())_0x4ba06d['markers']['clear']();for(const [_0x361c0d,_0x4113e3]of this['_markers'])this['_diffRoots']['get'](_0x4113e3['root']['rootName'])['markers']['set'](_0x361c0d,_0x4113e3['clone']());const _0x3bf1b6=new Map(),_0x2112ff=new Map();for(const [_0x28102a,_0x518e0c]of this['_diffRoots'])_0x3bf1b6['set'](_0x28102a,It(_0x518e0c)),_0x2112ff['set'](_0x28102a,this['_diffRootsAttributes']['get'](_0x28102a));this['_saveMetaData'](_0x2a9fee,_0x3bf1b6,this['_markers'],_0x2112ff);}_getPreviousFrom(_0x2c3e04){const _0x29e241=Array['from'](this['_savedMetaData']['keys']());_0x29e241['sort']((_0x4aa302,_0x40dfd9)=>_0x4aa302-_0x40dfd9),_0x29e241['reverse']();for(const _0x48daaa of _0x29e241)if(_0x48daaa<_0x2c3e04)return _0x48daaa;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x453e6e,_0x1a4481){const _0x845015=Array['from'](_0x1a4481['markers'])['map'](([_0x278f2e,_0x1c9f75])=>[_0x278f2e,_0xc7b39b(_0x1c9f75,_0x453e6e)]);_0x453e6e['markers']=new Map(_0x845015);}_transformMarkers(_0x41177c){for(const _0x24d9ae of this['_markers']['values']()){const _0x3352cc=_0x24d9ae['getTransformedByOperation'](_0x41177c),_0x272b66=_0x49ff12['_createFromRanges'](_0x3352cc);_0x24d9ae['start']=_0x272b66['start'],_0x24d9ae['end']=_0x272b66['end'];}}_handleOperation(_0x1604df,_0x2b9507){if('addRoot'!=_0x1604df['type']&&'detachRoot'!=_0x1604df['type']){if('insert'==_0x1604df['type']){const _0x3657f8=_0x1604df['position']['root'],_0x3dd31e=_0x3657f8['rootName'],_0x2928d2=_0x3657f8['name'];this['_diffRoots']['has'](_0x3dd31e)||(this['_diffRoots']['set'](_0x3dd31e,St(_0x3dd31e,_0x2928d2,!0x0)),this['_diffRootsAttributes']['set'](_0x3dd31e,{}),_0x2b9507&&this['_idsRoots']['set'](_0x3dd31e,St(_0x3dd31e,_0x2928d2,!0x0)));}else{if('addRootAttribute'==_0x1604df['type']||'removeRootAttribute'==_0x1604df['type']||'changeRootAttribute'==_0x1604df['type'])return void this['_handleRootAttributeOperation'](_0x1604df);'marker'==_0x1604df['type']&&this['_handleMarkerOperation'](_0x1604df);}if('marker'!==_0x1604df['type']){const _0x1087fa=this['_cloneOperation'](_0x1604df,this['_diffRoots']);_0x1087fa['_execute'](),this['_transformMarkers'](_0x1087fa);}if(_0x2b9507)switch(_0x1604df['type']){case'insert':this['_handleInsertOperation'](_0x1604df);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x1604df);break;case'merge':this['_handleMergeOperation'](_0x1604df);break;case'split':this['_handleSplitOperation'](_0x1604df);}}else this['_handleRootOperation'](_0x1604df,_0x2b9507);}_cloneOperation(_0x1b6caf,_0x261914){const _0x518040=_0x1b6caf['clone']();return _0x518040['_authorId']=_0x1b6caf['_authorId'],_0x518040['_aiSource']=_0x1b6caf['_aiSource'],_0x518040['baseVersion']=null,_0x22c2f9(_0x518040,_0x261914),_0x518040;}_getBaseVids(_0x255cff){return _0x255cff['map'](_0x2bbd8d=>{const _0xd96d73=this['_getVidAttributeName'](_0x2bbd8d);return Number(_0x2bbd8d['item']['getAttribute'](_0xd96d73));});}_generateTape(_0x41a333,_0x1a81a3){if(_0x41a333['is']('element','$text'))_0x1a81a3['push']({'item':_0x41a333,'type':'text'});else{_0x41a333['is']('element')&&_0x1a81a3['push']({'item':_0x41a333,'type':'elementStart'});for(const _0xf5d85b of _0x41a333['getChildren']())this['_generateTape'](_0xf5d85b,_0x1a81a3);_0x41a333['is']('element')&&_0x1a81a3['push']({'item':_0x41a333,'type':'elementEnd'});}return _0x1a81a3;}_getState(){const _0x10e959=new Map(this['_touched']),_0x342c46=new Map(_0x10e959),_0x5092aa=new Map(),_0x592bdc={'insertions':{},'deletions':{}},_0xe84068={'insertions':{},'deletions':{}},_0x25cece=new Map(),_0x38565a=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x111fe3=new Map();_0x38565a['delete']('$graveyard');for(const _0x1ceba2 of _0x38565a){const _0x473ad3=(this['_diffRoots']['get'](_0x1ceba2)??this['_baseRoots']['get'](_0x1ceba2))['name'],_0x1f3ca7=this['_diffRoots']['get'](_0x1ceba2)||St(_0x1ceba2,_0x473ad3,!0x1),_0x4430c0=this['_baseRoots']['get'](_0x1ceba2)||St(_0x1ceba2,_0x473ad3,!0x1);_0x1f3ca7['isAttached']()||_0x4430c0['isAttached']()?(_0x111fe3['set'](_0x1ceba2,_0x473ad3),_0x592bdc['insertions'][_0x1ceba2]=It(_0x1f3ca7),_0x592bdc['deletions'][_0x1ceba2]=It(_0x4430c0),this['_copyMarkers'](_0x592bdc['deletions'][_0x1ceba2],_0x4430c0),this['_copyMarkers'](_0x592bdc['insertions'][_0x1ceba2],_0x1f3ca7),_0xe84068['insertions'][_0x1ceba2]=this['_generateTape'](this['_idsRoots']['get'](_0x1ceba2),[]),_0xe84068['deletions'][_0x1ceba2]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x1ceba2)||St(_0x1ceba2,_0x473ad3,!0x1),[])):_0x38565a['delete'](_0x1ceba2);}for(const _0x3a723f of _0x38565a){const _0x5c1d22=_0xe84068['insertions'][_0x3a723f];for(const _0x22e235 of _0x5c1d22){const _0x31e366=this['_getVidAttributeName'](_0x22e235),_0x3224c4=_0x22e235['item']['getAttribute'](_0x31e366);_0x342c46['delete'](_0x3224c4),_0x3224c4>=this['_startingRevisionId']&&_0x5092aa['set'](_0x3224c4,_0x10e959['get'](_0x3224c4));}}for(const _0x4414e7 of _0x38565a){const _0x17a7d6=_0xe84068['insertions'][_0x4414e7],_0x9a82e5=this['_getBaseVids'](_0xe84068['deletions'][_0x4414e7]);let _0x53193d=0x0;for(const _0x3be85e of _0x17a7d6){const _0x57ebc6=this['_getVidAttributeName'](_0x3be85e),_0x28caf8=_0x3be85e['item']['getAttribute'](_0x57ebc6);if(!_0x5092aa['has'](_0x28caf8)&&!_0x25cece['has'](_0x28caf8)){if(_0x342c46['has'](_0x28caf8))_0x53193d++;else{if(_0x28caf8!=_0x9a82e5[_0x53193d]){const _0x20b845=_0x10e959['get'](_0x28caf8)||_0x10e959['get'](_0x9a82e5[_0x53193d]);for(;_0x28caf8!=_0x9a82e5[_0x53193d];)_0x342c46['has'](_0x9a82e5[_0x53193d])||(_0x25cece['set'](_0x9a82e5[_0x53193d],_0x20b845),_0x10e959['set'](_0x9a82e5[_0x53193d],_0x20b845)),_0x53193d++;}_0x53193d++;}}}}for(const _0x3cb93b of _0x38565a){const _0x3641aa=_0xe84068['insertions'][_0x3cb93b];for(const _0x574349 of _0x3641aa){const _0x47925c=this['_getVidAttributeName'](_0x574349),_0x54726a=_0x574349['item']['getAttribute'](_0x47925c);if(_0x25cece['has'](_0x54726a)){const _0x1d43ea=_0x25cece['get'](_0x54726a);_0x342c46['has'](_0x54726a)||_0x342c46['set'](_0x54726a,{..._0x1d43ea}),_0x5092aa['set'](_0x54726a,{..._0x1d43ea});}}}for(const _0x26ae2e of _0x342c46['keys']())_0x26ae2e>=this['_startingRevisionId']&&_0x342c46['delete'](_0x26ae2e);const _0x42f316=new Map();for(const _0x5a5dcc of _0x38565a){let _0x583f0f=_0xe84068['insertions'][_0x5a5dcc];for(const _0x3c1517 of _0x583f0f)if(_0x3c1517['item']['is']('element','tableCell')){const _0x416ae7=this['_getVidAttributeName'](_0x3c1517),_0x1608ff=_0x3c1517['item']['getAttribute'](_0x416ae7);if(_0x5092aa['has'](_0x1608ff)){const _0xa9c1dd=_0x3c1517['item']['parent']['parent']['getAttribute']('vid_start'),_0x242138=_0x5092aa['get'](_0x1608ff),_0x17dada=_0x42f316['get'](_0xa9c1dd)||{'users':new Set(),'aiSource':null};_0x17dada['users']['add'](_0x242138['userId']),_0x17dada['aiSource']=_0x17dada['aiSource']||_0x242138['aiSource']||null,_0x42f316['set'](_0xa9c1dd,_0x17dada);}}_0x583f0f=_0xe84068['deletions'][_0x5a5dcc];for(const _0x2ce689 of _0x583f0f)if(_0x2ce689['item']['is']('element','tableCell')){const _0x4203a=this['_getVidAttributeName'](_0x2ce689),_0x12977b=_0x2ce689['item']['getAttribute'](_0x4203a);if(_0x342c46['has'](_0x12977b)){const _0x2aabf2=_0x2ce689['item']['parent']['parent']['getAttribute']('vid_start'),_0x30e6ed=_0x342c46['get'](_0x12977b),_0x5988a9=_0x42f316['get'](_0x2aabf2)||{'users':new Set(),'aiSource':null};_0x5988a9['users']['add'](_0x30e6ed['userId']),_0x5988a9['aiSource']=_0x5988a9['aiSource']||_0x30e6ed['aiSource']||null,_0x42f316['set'](_0x2aabf2,_0x5988a9);}}for(const _0xdd2f02 of _0x42f316['keys']())(_0x5092aa['has'](_0xdd2f02)||_0x342c46['has'](_0xdd2f02))&&_0x42f316['delete'](_0xdd2f02);}for(const _0x54d147 of _0x38565a){const _0x510741=_0xe84068['insertions'][_0x54d147];let _0x2f29eb=null,_0xc955c9=null,_0xd016e8=null;for(const _0xb187c7 of _0x510741){const _0x2d5950=this['_getVidAttributeName'](_0xb187c7),_0x5e6f2d=_0xb187c7['item']['getAttribute'](_0x2d5950),_0x27277d=_0x42f316['get'](_0x5e6f2d);if(_0x27277d&&'elementStart'==_0xb187c7['type']&&(_0x2f29eb=Array['from'](_0x27277d['users'])[0x0],_0xc955c9=_0x27277d['aiSource'],_0xd016e8=_0xb187c7['item']['getAttribute']('vid_end')),_0x2f29eb){const _0x3502ed=_0xc955c9||_0x342c46['get'](_0x5e6f2d)?.['aiSource']||null,_0x250a7c=_0xc955c9||_0x5092aa['get'](_0x5e6f2d)?.['aiSource']||null;_0x342c46['set'](_0x5e6f2d,{'userId':_0x2f29eb,'aiSource':_0x3502ed}),_0x5092aa['set'](_0x5e6f2d,{'userId':_0x2f29eb,'aiSource':_0x250a7c});}_0x5e6f2d==_0xd016e8&&(_0x2f29eb=null,_0xd016e8=null);}}const _0x36995b={},_0x3a3ca3=new Set();for(const _0x504ef6 of _0x38565a){const _0x2b7fcb=_0x592bdc['deletions'][_0x504ef6],_0x4fde78=_0x592bdc['insertions'][_0x504ef6];for(const {userId:_0x22ead3}of this['_touchedMarkers']['values']())null!==_0x22ead3&&_0x3a3ca3['add'](_0x22ead3);for(const {userId:_0x4bf17c}of this['_touchedRoots']['values']())null!==_0x4bf17c&&_0x3a3ca3['add'](_0x4bf17c);const _0x527557={};this['_markChanges'](_0x4fde78,_0xe84068['insertions'][_0x504ef6],_0x5092aa,'insertion',_0x3a3ca3,_0x527557),this['_markChanges'](_0x2b7fcb,_0xe84068['deletions'][_0x504ef6],_0x342c46,'deletion',_0x3a3ca3,_0x527557),this['_collectSuggestionAiSources'](_0x4fde78,_0x527557),this['_collectSuggestionAiSources'](_0x2b7fcb,_0x527557),_0x36995b[_0x504ef6]={'insertions':this['_prepareViewToSave'](_0x4fde78),'deletions':this['_prepareViewToSave'](_0x2b7fcb),'attachChange':this['_touchedRoots']['get'](_0x504ef6)||null,'attributesBefore':_0x2e1942(this['_baseRootsAttributes']['get'](_0x504ef6))||{},'attributesAfter':_0x2e1942(this['_diffRootsAttributes']['get'](_0x504ef6)),'rootElementName':_0x111fe3['get'](_0x504ef6),'aiSources':_0x527557};}const _0x196a45=Array['from'](_0x5092aa['values']())['some'](_0x2935e2=>!(!_0x2935e2||!_0x2935e2['aiSource']))||Array['from'](_0x342c46['values']())['some'](_0xec9ba9=>!(!_0xec9ba9||!_0xec9ba9['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x35aea4=>this['_aiTouchedMarkers']['has'](_0x35aea4));return{'diffData':_0x36995b,'authorsIds':Array['from'](_0x3a3ca3),'hasAIChanges':_0x196a45};}_collectSuggestionAiSources(_0x48d135,_0x19ee85){const _0x223a25=_0x48d135['markers'];for(const _0x11936d of _0x223a25['keys']()){if(!_0x11936d['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x11936d))continue;const _0x4ad965=this['_aiTouchedMarkers']['get'](_0x11936d);_0x4ad965&&(_0x19ee85[_0x11936d]=_0x4ad965);}}_processRootBeforeSave(_0x28e0f2){for(const [,_0x49f332]of _0x28e0f2['markers']){const _0x401210=_0x49f332['start']['getAncestors']()['filter'](_0x2e050f=>'tableCell'==_0x2e050f['name']);for(const _0x14e6bb of _0x401210)0x1==_0x14e6bb['childCount']&&_0x14e6bb['getChild'](0x0)['is']('element','paragraph')&&_0x14e6bb['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x325f05){this['_processRootBeforeSave'](_0x325f05);const _0x9d9b0b=this['editor']['data']['toView'](_0x325f05,{}),_0x3eeb47=Array['from'](_0x9d9b0b['getChildren']())['map'](_0x587bc2=>this['_getViewJson'](_0x587bc2));return JSON['stringify'](_0x3eeb47);}_getViewJson(_0x114254){if(_0x114254['is']('$text'))return _0x114254['data'];{const _0x2bf99c=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x211097=_0x114254,_0x9b744c=this['editor']['data']['htmlProcessor']['domConverter'],_0x24706f={'type':_0x2bf99c['_getTypeCharForViewElement'](_0x211097),'name':_0x211097['name'],'attributes':Array['from'](_0x211097['getAttributes']()),'children':Array['from'](_0x211097['getChildren']())['map'](_0x534b13=>this['_getViewJson'](_0x534b13))};if(_0x114254['is']('uiElement')&&'$comment'!=_0x114254['name']){const _0x225412=_0x114254['render'](_0x9b744c['domDocument'],_0x9b744c);_0x24706f['children']['push'](_0x225412['outerHTML']);}else{if(_0x114254['is']('rawElement')){const _0x355a75=_0x9b744c['domDocument']['createElement'](_0x211097['name']);_0x114254['render'](_0x355a75,_0x9b744c),_0x24706f['children']['push'](_0x355a75['innerHTML']);}}const _0x1be41=Array['from'](_0x211097['getCustomProperties']());_0x1be41['length']>0x0&&(_0x24706f['customProperties']=_0x1be41);const _0x27cadf=_0x211097['getFillerOffset']();return null!==_0x27cadf&&(_0x24706f['fillerOffset']=_0x27cadf),_0x24706f;}}['_markChanges'](_0x4448ae,_0x4f0e12,_0x42326b,_0x128d23,_0x3e0bb0,_0x254a4a){let _0x4b2743=null,_0x133ba9=null,_0x24ebd6=0x0;const _0xca39ee=this['editor']['model'];for(let _0x5403c5=0x0;_0x5403c5<_0x4f0e12['length'];_0x5403c5++){const _0x1e4c15=this['_getVidAttributeName'](_0x4f0e12[_0x5403c5]),_0x51760b=_0x4f0e12[_0x5403c5]['item']['getAttribute'](_0x1e4c15),_0x599033=_0x42326b['get'](_0x51760b),_0x3ae254=_0x5403c5==_0x4f0e12['length']-0x1;!_0x4b2743&&_0x599033&&(_0x4b2743=_0x599033,_0x133ba9=_0x4f0e12[_0x5403c5]);const _0x1799fa=!!_0x4b2743&&!!_0x599033&&_0x599033['userId']!=_0x4b2743['userId'],_0x4c5b=!!_0x4b2743&&!!_0x599033&&_0x599033['aiSource']!=_0x4b2743['aiSource'];_0x4b2743&&(!_0x599033||_0x1799fa||_0x4c5b)&&(_0xc0cf29(_0x599033,Et(_0x133ba9,_0x4448ae,_0xca39ee),Et(_0x4f0e12[_0x5403c5],_0x4448ae,_0xca39ee)),_0x4b2743=_0x599033||null,_0x133ba9=_0x599033?_0x4f0e12[_0x5403c5]:null),_0x4b2743&&_0x3ae254&&_0xc0cf29(_0x599033,Et(_0x133ba9,_0x4448ae,_0xca39ee),Ot(_0x4f0e12[_0x5403c5],_0x4448ae,_0xca39ee));}function _0xc0cf29(_0xa3a206,_0x1f4a97,_0x360efb){const _0x3ec235=_0x4b2743['userId'],_0x55f7a0=_0x4b2743['aiSource'],_0x18e5dd='revision:'+_0x128d23+':'+_0x3ec235+':'+_0x24ebd6++,_0x19827d=_0xca39ee['createRange'](_0x1f4a97,_0x360efb);_0x4448ae['markers']['set'](_0x18e5dd,_0x19827d),_0x55f7a0&&(_0x254a4a[_0x18e5dd]=_0x55f7a0),null!==_0x3ec235&&_0x3e0bb0['add'](_0x3ec235);}}_getVidAttributeName(_0x416481){switch(_0x416481['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x37462f){const _0x4873f1=this['_idsRoots']['get'](_0x37462f['position']['root']['rootName']),_0x1a91c7=_0x1cef80(_0x37462f['position'],_0x4873f1),_0xab29f5=null===_0x37462f['_authorId']?null:_0x37462f['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x19cc31=_0x37462f['_aiSource']||null,_0x823ea=_0x1a91c7['parent'],_0x13fc70=this['_revisionId'],_0x3da203=[];for(const _0x40efe7 of _0x37462f['nodes'])if(_0x40efe7['is']('element'))_0x3da203['push'](this['_makeIdsRoot'](_0x40efe7));else{for(let _0x388599=0x0;_0x388599<_0x40efe7['offsetSize'];_0x388599++)_0x3da203['push'](new _0x524633('$text',{'vid':this['_revisionId']++}));}const _0x4f75ce=this['_revisionId'];for(let _0x37d012=_0x13fc70;_0x37d012<_0x4f75ce;_0x37d012++)this['_touched']['set'](_0x37d012,{'userId':_0xab29f5,'aiSource':_0x19cc31});_0x823ea['_insertChild'](_0x1a91c7['offset'],_0x3da203);}_setTouched(_0x320f1f,_0x29ced0,_0x61c889){this['_touched']['set'](_0x320f1f,{'userId':_0x29ced0,'aiSource':_0x61c889||this['_touched']['get'](_0x320f1f)?.['aiSource']||null});}_handleMoveOperation(_0x36a6cd){(_0x36a6cd=this['_cloneOperation'](_0x36a6cd,this['_idsRoots']))['_execute']();const _0x18f9c2=null===_0x36a6cd['_authorId']?null:_0x36a6cd['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4f0e81=_0x36a6cd['_aiSource']||null,_0x565ff4=_0x36a6cd['getMovedRangeStart'](),_0x30e6a6=_0x565ff4['parent'],_0x5cbe70=_0x565ff4['offset'],_0x54351f=(_0x35fdf5,_0x2e732f,_0x53fff6)=>{for(let _0x52306b=_0x2e732f;_0x52306b<_0x53fff6;_0x52306b++){const _0x22e24d=_0x35fdf5['getChild'](_0x52306b);_0x22e24d['is']('element','$text')?this['_setTouched'](_0x22e24d['getAttribute']('vid'),_0x18f9c2,_0x4f0e81):(this['_setTouched'](_0x22e24d['getAttribute']('vid_start'),_0x18f9c2,_0x4f0e81),_0x54351f(_0x22e24d,0x0,_0x22e24d['childCount']),this['_setTouched'](_0x22e24d['getAttribute']('vid_end'),_0x18f9c2,_0x4f0e81));}};_0x54351f(_0x30e6a6,_0x5cbe70,_0x5cbe70+_0x36a6cd['howMany']);}_handleMergeOperation(_0x4d33b9){const _0x304917=null===(_0x4d33b9=this['_cloneOperation'](_0x4d33b9,this['_idsRoots']))['_authorId']?null:_0x4d33b9['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x1f02da=_0x4d33b9['_aiSource']||null,_0x2b08d3=_0x4d33b9['targetPosition']['parent'],_0x582e2a=_0x4d33b9['sourcePosition']['parent'],_0x3c292c=_0x2b08d3['getAttribute']('vid_end'),_0x4309e1=_0x582e2a['getAttribute']('vid_start');_0x2b08d3['_setAttribute']('vid_end',_0x582e2a['getAttribute']('vid_end')),_0x582e2a['_setAttribute']('vid_end',_0x3c292c),this['_setTouched'](_0x4309e1,_0x304917,_0x1f02da),this['_setTouched'](_0x3c292c,_0x304917,_0x1f02da),_0x4d33b9['_execute']();}_handleSplitOperation(_0xd7225b){const _0x3ebc30=null===(_0xd7225b=this['_cloneOperation'](_0xd7225b,this['_idsRoots']))['_authorId']?null:_0xd7225b['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x3f3673=_0xd7225b['_aiSource']||null,_0x16564d=_0xd7225b['graveyardPosition'],_0x2636dc=_0xd7225b['splitPosition']['parent'];_0xd7225b['_execute']();const _0x8c620d=_0x2636dc['getAttribute']('vid_end'),_0x55ccfd=_0xd7225b['insertionPosition']['nodeAfter'];if(_0x16564d){const _0x3a973f=_0x55ccfd['getAttribute']('vid_end'),_0x3d6948=_0x2636dc['getAttribute']('vid_end');_0x2636dc['_setAttribute']('vid_end',_0x3a973f),_0x55ccfd['_setAttribute']('vid_end',_0x3d6948),this['_setTouched'](_0x2636dc['getAttribute']('vid_end'),_0x3ebc30,_0x3f3673),this['_setTouched'](_0x55ccfd['getAttribute']('vid_start'),_0x3ebc30,_0x3f3673);}else{const _0x3a93f1=this['_revisionId']++,_0x2463d5=this['_revisionId']++;_0x2636dc['_setAttribute']('vid_end',_0x3a93f1),_0x55ccfd['_setAttribute']('vid_start',_0x2463d5),_0x55ccfd['_setAttribute']('vid_end',_0x8c620d),this['_setTouched'](_0x3a93f1,_0x3ebc30,_0x3f3673),this['_setTouched'](_0x2463d5,_0x3ebc30,_0x3f3673);}}_handleMarkerOperation(_0x14a453){if(!_0x14a453['affectsData'])return;const _0x4e0f6e=(_0x14a453=this['_cloneOperation'](_0x14a453,this['_diffRoots']))['oldRange']?_0x14a453['oldRange']['root']:null,_0x56a416=_0x14a453['newRange']?_0x14a453['newRange']['root']:null;_0x4e0f6e&&this['_markers']['delete'](_0x14a453['name']),_0x56a416&&this['_markers']['set'](_0x14a453['name'],_0x14a453['newRange']['clone']());const _0x306b02=null===_0x14a453['_authorId']?null:_0x14a453['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x10c8db=_0x14a453['name'];if(_0x14a453['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x10c8db,_0x14a453['_aiSource']),!this['_touchedMarkers']['has'](_0x10c8db))return void this['_touchedMarkers']['set'](_0x10c8db,{'range':_0x14a453['oldRange'],'userId':_0x306b02});const _0x369a04=this['_touchedMarkers']['get'](_0x10c8db),_0x27950c=_0x369a04['range'],_0x1ceb8e=_0x14a453['newRange'];null==_0x27950c&&null==_0x1ceb8e||_0x27950c&&_0x1ceb8e&&_0x27950c['isEqual'](_0x1ceb8e)?this['_touchedMarkers']['delete'](_0x14a453['name']):_0x369a04['userId']=_0x306b02;}_handleRootOperation(_0x5e69c6,_0x5daaeb){this['_diffRoots']['has'](_0x5e69c6['rootName'])?this['_diffRoots']['get'](_0x5e69c6['rootName'])['_isAttached']=_0x5e69c6['isAdd']:(this['_diffRoots']['set'](_0x5e69c6['rootName'],St(_0x5e69c6['rootName'],_0x5e69c6['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x5e69c6['rootName'],{}),_0x5daaeb&&this['_idsRoots']['set'](_0x5e69c6['rootName'],St(_0x5e69c6['rootName'],_0x5e69c6['elementName'],!0x0)));const _0x157220=null===_0x5e69c6['_authorId']?null:_0x5e69c6['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x141f69=this['_touchedRoots']['get'](_0x5e69c6['rootName']);_0x141f69&&_0x141f69['userId']===_0x157220?this['_touchedRoots']['delete'](_0x5e69c6['rootName']):this['_touchedRoots']['set'](_0x5e69c6['rootName'],{'userId':_0x157220,'isAttached':_0x5e69c6['isAdd']});}_handleRootAttributeOperation(_0x415d29){const _0x5877cd=this['_diffRootsAttributes']['get'](_0x415d29['root']['rootName']);null===_0x415d29['newValue']?delete _0x5877cd[_0x415d29['key']]:_0x5877cd[_0x415d29['key']]=_0x415d29['newValue'];}};function It(_0x59d2eb){const _0x2e8114=St(_0x59d2eb['rootName'],_0x59d2eb['name'],_0x59d2eb['isAttached']());for(const _0x5d313e of _0x59d2eb['getChildren']()){const _0x15d7af=_0x5d313e['_clone'](!0x0);_0x2e8114['_appendChild'](_0x15d7af);}return _0x2e8114;}function St(_0x416159,_0x4ca28c,_0x2dc1a7=!0x0){const _0x109935=new _0x1c4681();return _0x109935['rootName']=_0x416159,_0x109935['name']=_0x4ca28c,_0x109935['_isAttached']=_0x2dc1a7,_0x109935['isAttached']=()=>_0x109935['_isAttached'],_0x109935;}function Et(_0x3f0dcf,_0x3d2d9d,_0x4f0fc6){const _0x120b02='elementEnd'==_0x3f0dcf['type']?_0x4f0fc6['createPositionAt'](_0x3f0dcf['item'],'end'):_0x4f0fc6['createPositionBefore'](_0x3f0dcf['item']);return _0x4f0fc6['createPositionFromPath'](_0x3d2d9d,_0x120b02['path'],_0x120b02['stickiness']);}function Ot(_0xf08d03,_0x51e929,_0x4ec74e){const _0x5e24f2='elementStart'==_0xf08d03['type']?_0x4ec74e['createPositionAt'](_0xf08d03['item'],0x0):_0x4ec74e['createPositionAfter'](_0xf08d03['item']);return _0x4ec74e['createPositionFromPath'](_0x51e929,_0x5e24f2['path'],_0x5e24f2['stickiness']);}const Ct=/* #__PURE__ -- @preserve */
25
+ _0x273b3b(ut);var Nt=class extends Ct{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x1aca11,_0x4249fc){super(_0x1aca11),this['focusTracker']=new _0x1d942c(),this['keystrokes']=new _0x382620(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x4249fc),this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-revision-history-save-revision-form','ck-responsive-form'],'tabindex':'-1'},'children':[this['revisionNameInputView']]}),this['initializeCssTransitionDisablerMixin']();}['render'](){super['render'](),mt({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x5b930d=_0xda7cdc=>_0xda7cdc['stopPropagation']();this['keystrokes']['set']('arrowright',_0x5b930d),this['keystrokes']['set']('arrowleft',_0x5b930d),this['keystrokes']['set']('arrowup',_0x5b930d),this['keystrokes']['set']('arrowdown',_0x5b930d);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x5d480a){this['revisionNameInputView']['fieldView']['element']['value']=_0x5d480a['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0xb5cbb4){const _0x1540b4=new tt(this['locale'],vt),_0xea77a8=_0x1540b4['fieldView'];_0xea77a8['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x4da196=Rt(this['locale'],'Name\x20of\x20the\x20revision');return!_0xb5cbb4&&(_0x4da196+='\x20('+Rt(this['locale'],'optional')+')'),(_0x1540b4['label']=_0x4da196,_0xea77a8['on']('input',()=>{this['revisionNameInputValue']=_0xea77a8['element']['value']['trim']();}),_0x1540b4);}},xt=class extends _0x2dd53f{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[kt];}['_saveRevisionFormView'];init(){const _0x428817=this['editor'],_0x41aa9d=_0x428817['plugins']['get']('RevisionTracker');_0x428817['ui']['componentFactory']['add']('revisionHistory',_0xcfe37=>{const _0x27e3bd=ft(_0xcfe37),_0x5cded3=_0x27e3bd['panelView']['children'],_0x4b909b=new et(_0xcfe37),_0x59abac=new it(_0xcfe37),_0x439516=this['_createSaveRevisionButton'](_0x264e1e),_0x1a77ba=new it(_0xcfe37),_0x3f2c5b=this['_createOpenRevisionButton'](_0x264e1e);return _0x27e3bd['bind']('isEnabled')['to'](_0x41aa9d,'isReady',_0x41aa9d,'isEnabled',_0x428817,'isReadOnly',(_0x3d7fe2,_0x526bd1,_0x26aee3)=>_0x3d7fe2&&_0x526bd1&&!_0x26aee3),_0x27e3bd['buttonView']['set']({'icon':_0x4d55b6,'label':Rt(_0xcfe37,'Revision\x20history'),'tooltip':!0x0}),_0x439516['set']({'withText':!0x0,'role':'menuitem'}),_0x3f2c5b['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x3f2c5b,'execute',()=>{_0x27e3bd['isOpen']=!0x1,_0x428817['editing']['view']['focus']();},{'priority':'low'}),_0x59abac['children']['add'](_0x439516),_0x1a77ba['children']['add'](_0x3f2c5b),_0x4b909b['role']='menu',_0x4b909b['items']['addMany']([_0x59abac,_0x1a77ba]),_0x5cded3['add'](_0x4b909b),_0x27e3bd;}),_0x428817['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x5ccc3b=this['editor'],_0x35666d=_0x5ccc3b['locale'],_0xa1c231=_0x5ccc3b['plugins']['get']('RevisionTracker'),_0x4d15b9=new rt(_0x35666d),_0x4f9fe4=new ot(_0x35666d);_0x4d15b9['bind']('isEnabled')['to'](_0xa1c231,'isReady',_0xa1c231,'isEnabled',_0x5ccc3b,'isReadOnly',(_0x44e152,_0x1f90c4,_0x41476d)=>_0x44e152&&_0x1f90c4&&!_0x41476d),_0x4d15b9['buttonView']['set']({'icon':_0x4d55b6,'label':Rt(_0x35666d,'Revision\x20history')});const _0x17f0bd=new nt(_0x35666d,_0x4d15b9),_0x5386ad=this['_createSaveRevisionButton'](st);_0x5386ad['delegate']('execute')['to'](_0x4d15b9),_0x17f0bd['children']['add'](_0x5386ad),_0x4f9fe4['items']['add'](_0x17f0bd);const _0x3590be=new nt(_0x35666d,_0x4d15b9),_0x10878a=this['_createOpenRevisionButton'](st);return _0x10878a['delegate']('execute')['to'](_0x4d15b9),_0x3590be['children']['add'](_0x10878a),_0x4f9fe4['items']['add'](_0x3590be),_0x4d15b9['panelView']['children']['add'](_0x4f9fe4),_0x4d15b9;}_createSaveRevisionButton(_0x13c64a){const _0x45970a=this['editor'],_0x6dca1b=_0x45970a['plugins']['get']('RevisionTracker'),_0x3d3a91=new _0x13c64a(_0x45970a['locale']);return _0x3d3a91['set']({'label':Rt(_0x45970a['locale'],'Save\x20current\x20revision')}),_0x3d3a91['bind']('isEnabled')['to'](_0x6dca1b,'isReady',_0x6dca1b,'isEnabled',_0x45970a,'isReadOnly',(_0x15181f,_0x17d27a,_0x5d9a52)=>_0x15181f&&_0x17d27a&&!_0x5d9a52),this['listenTo'](_0x3d3a91,'execute',()=>{this['_showDialog']();}),_0x3d3a91;}_createOpenRevisionButton(_0x562bcb){const _0x3c0f36=this['editor'],_0x14a427=_0x3c0f36['plugins']['get']('RevisionTracker'),_0x3ec26b=new _0x562bcb(_0x3c0f36['locale']);return _0x3ec26b['set']({'label':Rt(_0x3c0f36['locale'],'Open\x20revision\x20history')}),_0x3ec26b['bind']('isEnabled')['to'](_0x14a427,'isReady',_0x3c0f36,'isReadOnly',(_0xb2dd09,_0x1f4cbd)=>_0xb2dd09&&!_0x1f4cbd),this['listenTo'](_0x3ec26b,'execute',()=>{_0x3c0f36['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x3ec26b;}['_showDialog'](){const _0x18deaf=this['editor'],_0x3419a6=_0x18deaf['locale'],_0x480d80=_0x18deaf['plugins']['get']('Dialog'),_0x7aee5d=_0x18deaf['plugins']['get']('RevisionTracker');function _0x37fe2e(_0x35cf22){_0x18deaf['config']['get']('revisionHistory.requireRevisionName')&&''===_0x35cf22['revisionName']?_0x35cf22['revisionNameInputView']['errorText']=Rt(_0x3419a6,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x18deaf['plugins']['get'](kt)['saveRevision']({'name':_0x35cf22['revisionName']}),_0x480d80['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x37fe2e(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x480d80['show']({'id':'revisionSave','title':Rt(_0x3419a6,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':Rt(_0x18deaf['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x480d80['hide']()},{'label':Rt(_0x18deaf['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x41b41c){_0x41b41c['bind']('isEnabled')['to'](_0x7aee5d,'isReady',_0x7aee5d,'isEnabled',_0x18deaf,'isReadOnly',(_0x257d34,_0x5051e9,_0x3057da)=>_0x257d34&&_0x5051e9&&!_0x3057da);},'onExecute':()=>_0x37fe2e(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0x48bb77=this['editor'],_0x2d9615=_0x48bb77['locale'];this['_saveRevisionFormView']=new Nt(_0x2d9615,_0x48bb77['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Dt=class extends ut{['changeId'];['_model'];constructor(_0x3431af,_0x33fc05,_0x4b6b67=!0x1){super(_0x3431af),this['_model']=_0x33fc05,this['changeId']=_0x33fc05['id'];const _0x4769f0=this['bindTemplate'],_0x28315e=_0x4b6b67&&!!_0x33fc05['data']['aiSource'],_0x302b56=_0x28315e?this['_createAiIconView'](_0x3431af):null;this['set']('type',_0x33fc05['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x4769f0['to']('type',_0xe38df2=>'ck-revision-change__'+_0xe38df2),..._0x28315e?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x28315e?[this['_createAiDescriptionView'](_0x3431af,_0x33fc05),_0x302b56]:this['_getDescriptionChildren'](_0x3431af,_0x33fc05)}]});}_getDescriptionChildren(_0x4c58c0,_0x123a6d){let _0x1d14e5='Removed\x20by';return _0x123a6d['data']['isSuggestion']?_0x1d14e5='Suggested\x20by':'add'==_0x123a6d['type']&&(_0x1d14e5='Added\x20by'),[this['_createLabel'](Rt(_0x4c58c0,_0x1d14e5)),{'text':'\x20'+_0x123a6d['author']['name']}];}_createAiDescriptionView(_0x549e95,_0x3688cb){let _0x4f7be1='AI_SOURCE_REMOVED_BY';_0x3688cb['data']['isSuggestion']?_0x4f7be1='AI_SOURCE_SUGGESTED_BY':'add'==_0x3688cb['type']&&(_0x4f7be1='AI_SOURCE_ADDED_BY');const _0x390084=new ut(_0x549e95);return _0x390084['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x390084['render'](),_0x390084['element']['innerHTML']=Rt(_0x549e95,_0x4f7be1,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+Rt(_0x549e95,'AI_SOURCE_AI')+'</span>']),_0x390084['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x3688cb['author']['name'],_0x390084;}_createLabel(_0x303bfe){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x303bfe}]};}_createAiIconView(_0x27160f){const _0x10847f=new _0x105ea5();return _0x10847f['content']=_0x29e5ea,_0x10847f['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':Rt(_0x27160f,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x10847f;}['focus'](){this['element']['focus']();}};const Vt=/* #__PURE__ -- @preserve */
26
+ _0x15441c();var Tt=class extends Vt{['id'];author;type;data;rootName;constructor(_0x47adc0){super(),this['id']=_0x47adc0['id']||_0x1cb26b(),this['author']=_0x47adc0['author'],this['type']=_0x47adc0['type'],this['data']=_0x47adc0['data']||{},this['rootName']=_0x47adc0['rootName'],this['set']('createdAt',_0x47adc0['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Mt=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0xfa165e,_0xc5da05){this['newRevisionId']=_0xfa165e,this['oldRevisionId']=_0xc5da05,this['changes']=new _0x5d63ac();}_setChanges(_0x2d3160){for(const _0x212286 of _0x2d3160)this['changes']['add'](_0x212286);}},Ht=class extends _0x2dd53f{repository;adapter=null;_getVisibleCommentThreadIds=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];_showCommentHighlights;static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x3002ea,_0x221f96,yt,bt];}constructor(_0x37414c){super(_0x37414c),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['set']('activeChange',null),this['set']('activeView',null),this['_activeViewTarget']=null,this['set']('diff',null),this['set']('isReady',!0x1),this['set']('isEnabled',!0x0),this['on']('change:isEnabled',(_0x5c1628,_0x715cc0,_0x804015)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x479a6a=>{for(const _0xbfb86d of this['editor']['editing']['view']['document']['roots'])_0x804015?_0x479a6a['removeClass']('ck-editor__editable__overlay',_0xbfb86d):_0x479a6a['addClass']('ck-editor__editable__overlay',_0xbfb86d);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x23400a=>null!==_0x23400a),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x1bae07,_0x320907,_0xf815a2)=>_0x1bae07&&_0xf815a2?_0x320907['changes']['getIndex'](_0xf815a2):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x495d1e,_0x198fc0)=>_0x495d1e?_0x198fc0['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x221f96),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0xb35df4=this['editor'],_0x51dc20=new Ft(_0xb35df4,{'direction':'backward'}),_0x52a26b=new Ft(_0xb35df4,{'direction':'forward'});_0xb35df4['commands']['add']('showPreviousChange',_0x51dc20),_0xb35df4['commands']['add']('showNextChange',_0x52a26b),_0xb35df4['commands']['add']('restoreRevision',new Lt(_0xb35df4)),this['on']('change:numberOfChanges',()=>{_0x51dc20['refresh'](),_0x52a26b['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0xb35df4['enableReadOnlyMode']('revision-viewer'),_0xb35df4['plugins']['has']('WidgetToolbarRepository')&&_0xb35df4['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x14532d){return await this['_utils']['loadRevisionData'](_0x14532d,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x14532d);}async getRevisionRootsAttributes(_0xc34d8e){return await this['_utils']['loadRevisionData'](_0xc34d8e,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0xc34d8e);}async['compare'](_0x44c2c6,_0x3c80e0,_0x26671f=!0x1){if(!this['isEnabled'])return;const _0x13912e=this['diff'],_0x2a8e24=this['repository'],_0x2fe9a9='string'==typeof _0x44c2c6?_0x2a8e24['getRevision'](_0x44c2c6):_0x44c2c6,_0x4dd424='string'==typeof _0x3c80e0?_0x2a8e24['getRevision'](_0x3c80e0):_0x3c80e0,_0x38c778=_0x2fe9a9['id'],_0x49bf1f=_0x4dd424?_0x4dd424['id']:null;if(!_0x26671f&&this['diff']&&this['diff']['newRevisionId']===_0x38c778&&this['diff']['oldRevisionId']===_0x49bf1f)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Mt(_0x38c778,_0x49bf1f);const _0x9ac74a=this['_getRevisionsRange'](_0x2fe9a9,_0x4dd424,!0x0)['map'](_0x48783e=>this['_utils']['loadRevisionData'](_0x48783e,this['adapter']));return _0x9ac74a['push'](new Promise(_0x58cff7=>{setTimeout(_0x58cff7,0x14);})),Promise['all'](_0x9ac74a)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x43977c=this['_getDiff'](_0x38c778,_0x49bf1f);this['_cleanUpCommentMarkers'](_0x43977c);for(const _0x46e43e of _0x43977c['changes'])this['_changeIdToChange']['set'](_0x46e43e['id'],_0x46e43e);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x58ffa8=>{for(const _0x500fee of this['editor']['model']['document']['getRootNames']())_0x58ffa8['detachRoot'](_0x500fee);for(const _0x41e7f0 of Object['keys'](_0x43977c['model'])){const _0x36c744=_0x43977c['model'][_0x41e7f0]['name'],_0x525306=_0x58ffa8['addRoot'](_0x41e7f0,_0x36c744);for(const _0x401e22 of Object['keys'](_0x43977c['attributes'][_0x41e7f0]))_0x58ffa8['setAttribute'](_0x401e22,_0x43977c['attributes'][_0x41e7f0][_0x401e22],_0x525306);_0x58ffa8['insert'](_0x43977c['model'][_0x41e7f0],_0x525306,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x43977c['changes'])),this['isReady']=!0x0;})['catch'](_0x103514=>{console['error'](_0x103514),this['_cleanUp'](),_0x13912e&&(this['diff']=_0x13912e),this['isReady']=!0x0;});}addRevisionData(_0x2628a9,_0x4b4a34){const _0x1cfae2=this['repository']['createRevision'](_0x2628a9);return _0x1cfae2['on']('_update',(_0x511139,_0x44edf3,_0x466cbd)=>_0x4b4a34(_0x44edf3,_0x466cbd,_0x1cfae2)),this['repository']['addRevision'](_0x1cfae2),_0x1cfae2;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0xafda10=>{for(const _0x17a4d8 of this['editor']['model']['document']['getRootNames']())_0xafda10['detachRoot'](_0x17a4d8);});}_cleanUpCommentMarkers(_0xce2055){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x32c669=this['_getVisibleCommentThreadIds']();for(const _0x7ff7cb of Object['values'](_0xce2055['model']))for(const _0xe00c79 of Array['from'](_0x7ff7cb['markers']['keys']()))_0xe00c79['startsWith']('revision-comment:')&&!_0x32c669['has'](Pt(_0xe00c79))&&_0x7ff7cb['markers']['delete'](_0xe00c79);}_sortAndFilterDiffChanges(_0x27f896){const _0x1136d5=[],_0x4adddc=new Map();for(const _0x3461e7 of this['editor']['model']['document']['getRootNames']()){const _0x2212b4=this['editor']['editing']['view']['getDomRoot'](_0x3461e7);if(!_0x2212b4)continue;const _0x34d51d=_0x2212b4['getClientRects']()['item'](0x0);_0x34d51d&&(_0x1136d5['push'](_0x3461e7),_0x4adddc['set'](_0x3461e7,_0x34d51d));}return _0x1136d5['sort']((_0x4ae305,_0xe69aa0)=>{const _0x801ad=_0x4adddc['get'](_0x4ae305),_0x3bc2c2=_0x4adddc['get'](_0xe69aa0);return _0x801ad['y']-_0x3bc2c2['y']||_0x801ad['x']-_0x3bc2c2['x'];}),(_0x27f896=_0x27f896['filter'](_0x2bfd61=>_0x1136d5['includes'](_0x2bfd61['rootName'])))['sort']((_0x115f61,_0x165ad7)=>_0x1136d5['indexOf'](_0x115f61['rootName'])-_0x1136d5['indexOf'](_0x165ad7['rootName'])),_0x27f896;}['_makeTape'](_0x57a4fa,_0x53aee1={}){const _0x4e8b99=Array['from'](_0x57a4fa['markers'])['filter'](([_0x53d942,_0x3e9df6])=>_0x53d942['startsWith']('revision:')&&!_0x3e9df6['isCollapsed']),_0x530102=Array['from'](this['editor']['model']['createRangeIn'](_0x57a4fa)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x4e8b99['length'])for(const _0x586c9e of _0x530102){const [_0x2c2b44,_0x56a064]=_0x4e8b99[0x0],[,_0x4e1be2,_0x1190e2]=_0x2c2b44['split'](':'),_0xf12d1e=_0x53aee1[_0x2c2b44]||null;if(_0x56a064['end']['isEqual'](_0x586c9e['nextPosition'])&&_0x4e8b99['shift'](),(_0x586c9e['previousPosition']['isEqual'](_0x56a064['start'])||_0x586c9e['previousPosition']['isAfter'](_0x56a064['start']))&&('insertion'==_0x4e1be2?_0x586c9e['isAdded']={'userId':_0x1190e2,'aiSource':_0xf12d1e}:'deletion'==_0x4e1be2&&(_0x586c9e['isRemoved']={'userId':_0x1190e2,'aiSource':_0xf12d1e})),0x0==_0x4e8b99['length'])break;}return _0x530102;}_refreshStartEndIndex(_0x1e7f65){const _0x5e7b7c=new Map();for(let _0x3b9e4b=0x0;_0x3b9e4b<_0x1e7f65['length'];_0x3b9e4b++)'text'===_0x1e7f65[_0x3b9e4b]['type']?(_0x1e7f65[_0x3b9e4b]['item']['startIndex']=_0x3b9e4b,_0x1e7f65[_0x3b9e4b]['item']['endIndex']=_0x3b9e4b):('elementStart'===_0x1e7f65[_0x3b9e4b]['type']?_0x1e7f65[_0x3b9e4b]['item']['startIndex']=_0x3b9e4b:'elementEnd'===_0x1e7f65[_0x3b9e4b]['type']&&(_0x1e7f65[_0x3b9e4b]['item']['endIndex']=_0x3b9e4b),_0x5e7b7c['set'](_0x1e7f65[_0x3b9e4b]['id'],_0x3b9e4b));for(const _0xaf8bcf of _0x5e7b7c['values']())'elementStart'===_0x1e7f65[_0xaf8bcf]['type']?_0x1e7f65[_0xaf8bcf]['item']['endIndex']=_0x5e7b7c['get'](_0x1e7f65[_0xaf8bcf]['pairId']):'elementEnd'===_0x1e7f65[_0xaf8bcf]['type']&&(_0x1e7f65[_0xaf8bcf]['item']['startIndex']=_0x5e7b7c['get'](_0x1e7f65[_0xaf8bcf]['pairId']));}['_processTape'](_0x117153){for(let _0x54720b=0x0;_0x54720b<_0x117153['length'];_0x54720b++){if('elementStart'===_0x117153[_0x54720b]['type'])_0x117153[_0x54720b]['item']['startIndex']=_0x54720b;else{if('elementEnd'===_0x117153[_0x54720b]['type']){_0x117153[_0x54720b]['item']['endIndex']=_0x54720b;const _0x1acd82=_0x117153[_0x54720b]['item']['startIndex'];_0x117153[_0x1acd82]['pairId']=_0x117153[_0x54720b]['id'],_0x117153[_0x54720b]['pairId']=_0x117153[_0x1acd82]['id'];}else _0x117153[_0x54720b]['item']['startIndex']=_0x54720b,_0x117153[_0x54720b]['item']['endIndex']=_0x54720b,_0x117153[_0x54720b]['pairId']=null;}_0x117153[_0x54720b]['markersStart']||(_0x117153[_0x54720b]['markersStart']=[],_0x117153[_0x54720b]['markersEnd']=[]);}}_markInsertions(_0x59c711,_0x1adfd8){const _0x2e8cb5=_0x59c711['filter'](_0x2f3769=>!_0x2f3769['isAdded']);for(let _0x5d6136=0x0;_0x5d6136<_0x1adfd8['length'];_0x5d6136++)_0x1adfd8[_0x5d6136]['isAdded']&&(_0x2e8cb5[_0x5d6136]['isAdded']=_0x1adfd8[_0x5d6136]['isAdded']);}_getDiff(_0x656078,_0x2007b1=null){const _0x10dc06=this['repository']['getRevision'](_0x656078),_0x5b7dce=_0x2007b1?this['repository']['getRevision'](_0x2007b1):null,_0x2de8fd=this['_getRevisionsRange'](_0x10dc06,_0x5b7dce),_0x4e7252=_0x2de8fd[_0x2de8fd['length']-0x1],_0x226a68=new Map(),_0x40f6c7={'model':{},'attributes':{},'changes':[]},_0x22c00e=new Set(),_0x75d836=new Map();for(let _0x2eb600=_0x2de8fd['length']-0x1;_0x2eb600>=0x0;_0x2eb600--){const _0xb6ade6=_0x2de8fd[_0x2eb600];for(const _0x531580 of Object['keys'](_0xb6ade6['diffData']))if(_0xb6ade6['diffData'][_0x531580]['attachChange']){const _0x58365e=_0xb6ade6['diffData'][_0x531580]['attachChange'];_0x58365e['isAttached']?(_0x22c00e['add'](_0x531580),_0x75d836['has'](_0x531580)&&_0x75d836['get'](_0x531580)['userId']==_0x58365e['userId']?_0x75d836['delete'](_0x531580):_0x75d836['set'](_0x531580,_0x58365e)):_0x75d836['has'](_0x531580)?(_0x22c00e['delete'](_0x531580),_0x75d836['delete'](_0x531580)):(_0x22c00e['add'](_0x531580),_0x75d836['set'](_0x531580,_0x58365e));}else _0x22c00e['add'](_0x531580);}for(const _0x30dbf7 of _0x22c00e){const _0x8ef84e=_0x75d836['has'](_0x30dbf7)&&!_0x75d836['get'](_0x30dbf7)['isAttached'];let _0x251e4d=_0x8ef84e?_0x2de8fd['length']-0x1:0x0;const _0x2e381f=_0x8ef84e?-0x1:0x1;for(;_0x2de8fd[_0x251e4d];){const _0x23db51=_0x2de8fd[_0x251e4d];if(_0x23db51['diffData'][_0x30dbf7]){const _0x50cb7d=_0x8ef84e?_0x23db51['diffData'][_0x30dbf7]['attributesBefore']:_0x23db51['diffData'][_0x30dbf7]['attributesAfter'];_0x40f6c7['attributes'][_0x30dbf7]=_0x50cb7d?_0x2e1942(_0x50cb7d):{};break;}_0x251e4d+=_0x2e381f;}}for(const _0x2f9f95 of _0x2de8fd){_0x2f9f95['model']={};for(const _0x388bec of _0x2f9f95['authors'])_0x226a68['set'](_0x388bec['id'],_0x388bec);for(const _0x49542a of _0x22c00e){const _0x57c8f8=_0x2f9f95['diffData'][_0x49542a]?_0x2f9f95['diffData'][_0x49542a]['insertions']:'[]',_0x296136=_0x2f9f95['diffData'][_0x49542a]?_0x2f9f95['diffData'][_0x49542a]['deletions']:'[]',_0x9c6578=_0x2f9f95['diffData'][_0x49542a]?.['rootElementName']||'$root';_0x2f9f95['model'][_0x49542a]={'insertions':this['_utils']['_makeModelFromViewString'](_0x57c8f8,_0x9c6578),'deletions':this['_utils']['_makeModelFromViewString'](_0x296136,_0x9c6578)};}}for(const _0x5edbd9 of _0x22c00e){let _0x42171e=null,_0x4c8b1d=0x0;const _0xdb2327=_0x2de8fd['map'](_0x58893b=>_0x58893b['diffData'][_0x5edbd9]?.['rootElementName'])['find'](_0x507ced=>void 0x0!==_0x507ced)||'$root',_0x499b6c=new Map(Array['from'](_0x10dc06['model'][_0x5edbd9]['insertions']['markers'])['filter'](([_0x3678ab])=>!_0x3678ab['startsWith']('revision:')));let _0x436b48=0x0;for(const _0x83d037 of _0x2de8fd){const _0x3d22a5=_0x83d037['diffData'][_0x5edbd9]?.['aiSources']||{},_0x2995bd=this['_makeTape'](_0x83d037['model'][_0x5edbd9]['insertions'],_0x3d22a5);_0x83d037==_0x10dc06?(_0x42171e=_0x2995bd,_0x4c8b1d=_0x42171e['length'],_0x42171e['forEach'](_0x2c6352=>{_0x2c6352['id']=_0x436b48++;}),this['_processTape'](_0x42171e)):this['_markInsertions'](_0x42171e,_0x2995bd);const _0x1dad86=_0x42171e['filter'](_0x5a96cd=>!_0x5a96cd['isAdded'])['map'](_0x40a813=>_0x40a813['id']);let _0x17f0e7=0x0;const _0x53da45=this['_makeTape'](_0x83d037['model'][_0x5edbd9]['deletions'],_0x3d22a5);_0x53da45['forEach'](_0x315457=>{_0x315457['isRemoved']?_0x315457['id']=_0x4c8b1d++:_0x315457['id']=_0x1dad86[_0x17f0e7++];}),this['_processTape'](_0x53da45),this['_setDistance'](_0x42171e,'isAdded'),this['_setDistance'](_0x53da45,'isRemoved'),_0x83d037==_0x10dc06&&this['_markMarkers'](_0x42171e,_0x499b6c),_0x42171e=this['_joinTapes'](_0x42171e,_0x53da45),this['_refreshStartEndIndex'](_0x42171e),this['_setDistance'](_0x42171e,'isRemoved');}_0x42171e=_0x42171e['filter'](_0x4345f8=>!(_0x4345f8['isAdded']&&_0x4345f8['isRemoved']));const _0x551406=new Map(_0x4e7252['model'][_0x5edbd9]['deletions']['markers']),_0x385ea0=new Set(_0x499b6c['keys']());for(const _0x2a7c81 of _0x551406['keys']())_0x385ea0['delete'](_0x2a7c81);const _0x1914fa=Object['assign']({},..._0x2de8fd['map'](_0x56cced=>_0x56cced['diffData'][_0x5edbd9]?.['aiSources']));this['_markSuggestions'](_0x42171e,_0x385ea0,_0x1914fa),this['_fixObsoleteTags'](_0x42171e),_0x42171e=this['_removeMissingPairs'](_0x42171e),_0x42171e=this['_markMismatchedRemovedTags'](_0x42171e),_0x42171e=this['_removeUnsupportedChanges'](_0x42171e);const {root:_0x4fc2a9,changes:_0x48e0a9}=this['_makeModelFromTape'](_0x42171e,_0x226a68,_0x5edbd9,_0xdb2327);_0x40f6c7['model'][_0x5edbd9]=_0x4fc2a9;const _0x4c1715=_0x75d836['get'](_0x5edbd9);if(_0x4c1715){const _0x26561b=_0x226a68['get'](_0x4c1715['userId']),_0xde443=new Tt({'author':_0x26561b,'type':_0x4c1715['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x5edbd9});_0x48e0a9['unshift'](_0xde443),_0x40f6c7['attributes'][_0x5edbd9]['revisionHistoryAttachChange']=_0xde443['id'];}_0x40f6c7['changes']=_0x40f6c7['changes']['concat'](_0x48e0a9);}return _0x40f6c7;}['_markMarkers'](_0x40ed15,_0x3274d6){for(let _0x31fae9=0x0;_0x31fae9<_0x40ed15['length'];_0x31fae9++)for(const [_0x2989c8,_0x40d837]of _0x3274d6)!_0x40d837['isCollapsed']&&_0x40d837['start']['isEqual'](_0x40ed15[_0x31fae9]['previousPosition'])&&_0x40ed15[_0x31fae9]['markersStart']['push'](_0x2989c8),_0x40d837['end']['isEqual'](_0x40ed15[_0x31fae9]['nextPosition'])&&_0x40ed15[_0x31fae9]['markersEnd']['push'](_0x2989c8);}['_joinTapes'](_0xff333b,_0x238250){let _0x589af3=[],_0x21cdf4=0x0,_0x68671a=0x0;for(;_0x21cdf4<_0xff333b['length']||_0x68671a<_0x238250['length'];){const _0x37e95a=_0xff333b[_0x21cdf4]||{},_0x23c7ac=_0x238250[_0x68671a]||{};if(_0x37e95a['id']==_0x23c7ac['id'])_0x21cdf4++,_0x68671a++,_0x589af3['push'](_0x37e95a);else{if(_0x23c7ac['isRemoved']&&_0x37e95a['isAdded']){const {commonTape:_0x5cd0ff,iEnd:_0x5b7d37,jEnd:_0x5e7887}=this['_threeWayMerge'](_0xff333b,_0x21cdf4,_0x238250,_0x68671a);_0x589af3=_0x589af3['concat'](_0x5cd0ff),_0x21cdf4=_0x5b7d37,_0x68671a=_0x5e7887;}else _0x23c7ac['isRemoved']?(_0x68671a++,_0x589af3['push'](_0x23c7ac)):(_0x21cdf4++,_0x589af3['push'](_0x37e95a));}}return _0x589af3;}_markSuggestions(_0x598a22,_0x9f7089,_0x4ca45a){const _0x5c3088=[];for(let _0x5c423e=0x0;_0x5c423e<_0x598a22['length'];_0x5c423e++){for(let _0x617d05=0x0;_0x617d05<_0x598a22[_0x5c423e]['markersStart']['length'];_0x617d05++){const _0x2d7ab1=_0x598a22[_0x5c423e]['markersStart'][_0x617d05];if(!_0x9f7089['has'](_0x2d7ab1))continue;const {group:_0x36a344,type:_0x310913,authorId:_0x50b859}=_0x5e531a(_0x2d7ab1);if('revision-suggestion'!=_0x36a344||'insertion'!=_0x310913&&'deletion'!=_0x310913)continue;const _0x530eda=_0x4ca45a['suggestion:'+_0x2d7ab1['slice'](0x14)]||null;_0x5c3088['unshift']({'type':_0x310913,'name':_0x2d7ab1,'userId':_0x50b859,'aiSource':_0x530eda}),_0x598a22[_0x5c423e]['markersStart']['splice'](_0x617d05,0x1),_0x617d05--;}_0x54b00e(_0x598a22[_0x5c423e]);for(let _0x443227=0x0;_0x443227<_0x598a22[_0x5c423e]['markersEnd']['length'];_0x443227++){const _0x303be3=_0x598a22[_0x5c423e]['markersEnd'][_0x443227];if(!_0x9f7089['has'](_0x303be3))continue;const {group:_0x210f65,type:_0x4e3cc2}=_0x5e531a(_0x303be3);if('revision-suggestion'!=_0x210f65||'insertion'!=_0x4e3cc2&&'deletion'!=_0x4e3cc2)continue;_0x598a22[_0x5c423e]['markersEnd']['splice'](_0x443227,0x1),_0x443227--;const _0x5019b4=_0x5c3088['findIndex'](_0x66637d=>_0x66637d['name']==_0x303be3);_0x5019b4>-0x1&&_0x5c3088['splice'](_0x5019b4,0x1);}}function _0x5e531a(_0x2647cd){const _0x3132a7=_0x2647cd['split'](':');return{'group':_0x3132a7[0x0],'type':_0x3132a7[0x1],'subType':_0x3132a7['length']>=0x5?_0x3132a7[0x2]:null,'id':_0x3132a7['length']<0x5?_0x3132a7[0x2]:_0x3132a7[0x3],'authorId':_0x3132a7['length']<0x5?_0x3132a7[0x3]:_0x3132a7[0x4],'markerCount':0x6==_0x3132a7['length']?_0x3132a7[0x5]:null};}function _0x54b00e(_0x382dea){for(let _0x3b75dc=0x0;_0x3b75dc<_0x5c3088['length'];_0x3b75dc++){if(_0x382dea['isAdded']&&'insertion'==_0x5c3088[_0x3b75dc]['type']&&_0x382dea['isAdded']['userId']==_0x5c3088[_0x3b75dc]['userId'])return _0x382dea['isAddSuggestion']={..._0x5c3088[_0x3b75dc],'aiSource':_0x382dea['isAdded']['aiSource']||_0x5c3088[_0x3b75dc]['aiSource']},void delete _0x382dea['isAdded'];if(!_0x382dea['isAdded']&&!_0x382dea['isRemoved']&&'deletion'==_0x5c3088[_0x3b75dc]['type'])return void(_0x382dea['isRemoveSuggestion']=_0x5c3088[_0x3b75dc]);}}}_setDistance(_0x23ae90,_0x1ef04f){let _0x1fe18f=0x0,_0x4b65b1=!0x1;const _0x5484b2=new Map();for(const _0x3f9263 of _0x23ae90)_0x3f9263[_0x1ef04f]?_0x4b65b1&&(_0x1fe18f++,_0x4b65b1=!0x1):(_0x1fe18f++,_0x4b65b1=!0x0),_0x5484b2['set'](_0x3f9263['id'],_0x1fe18f);for(let _0x3a56bc=0x0;_0x3a56bc<_0x23ae90['length'];_0x3a56bc++){if('isRemoved'==_0x1ef04f&&_0x23ae90[_0x3a56bc]['isAdded']||'isAdded'==_0x1ef04f&&_0x23ae90[_0x3a56bc]['isRemoved'])continue;if('text'==_0x23ae90[_0x3a56bc]['type']){_0x23ae90[_0x3a56bc]['distance']=0x0;continue;}const _0x2aa889=_0x5484b2['get'](_0x23ae90[_0x3a56bc]['pairId']),_0x1f1a88=_0x5484b2['get'](_0x23ae90[_0x3a56bc]['id']);_0x23ae90[_0x3a56bc]['distance']=_0x2aa889-_0x1f1a88;}}_getRevisionsRange(_0x23c2dd,_0x565a2e,_0x7e0c5b=!0x1){const _0x33022c=[];let _0x40d117=this['repository']['getIndex'](_0x23c2dd),_0xdf9b5a=this['repository']['getIndex'](_0x565a2e);for(-0x1==_0xdf9b5a&&(_0xdf9b5a=this['repository']['_revisions']['length'],_0x7e0c5b=!0x1);_0x40d117<_0xdf9b5a;)_0x33022c['push'](this['repository']['getRevision'](_0x40d117)),_0x40d117++;return _0x7e0c5b&&_0x33022c['push'](this['repository']['getRevision'](_0x40d117)),_0x33022c;}_threeWayMerge(_0x23c9ff,_0x23e975,_0x5273b2,_0x37e1a9){const _0x48932e=this['editor']['model']['schema'];let _0x4edb2a=_0x23e975;for(;_0x23c9ff[_0x4edb2a]&&_0x23c9ff[_0x4edb2a]['isAdded'];)_0x4edb2a++;let _0xa90ae6=_0x37e1a9;for(;_0x5273b2[_0xa90ae6]&&_0x5273b2[_0xa90ae6]['isRemoved'];)_0xa90ae6++;_0x250259(_0x23c9ff,_0x23e975,_0x4edb2a),_0x250259(_0x5273b2,_0x37e1a9,_0xa90ae6);const _0x18114d=_0x5273b2['slice'](_0x37e1a9,_0xa90ae6)['concat'](_0x23c9ff['slice'](_0x23e975,_0x4edb2a));return _0x18114d['sort']((_0x8d54a2,_0x4ecd11)=>_0x8d54a2['side']!=_0x4ecd11['side']?_0x8d54a2['side']-_0x4ecd11['side']:_0x8d54a2['level']!=_0x4ecd11['level']?_0x8d54a2['level']-_0x4ecd11['level']:_0x8d54a2['distance']!=_0x4ecd11['distance']?_0x4ecd11['distance']-_0x8d54a2['distance']:!!_0x8d54a2['isAdded']!=!!_0x4ecd11['isAdded']?-0x1==_0x8d54a2['side']||0x0==_0x8d54a2['side']?_0x8d54a2['isAdded']?-0x1:0x1:_0x8d54a2['isAdded']?0x1:-0x1:_0x8d54a2['index']-_0x4ecd11['index']),{'commonTape':_0x18114d,'iEnd':_0x4edb2a,'jEnd':_0xa90ae6};function _0x250259(_0x489f42,_0x578fd5,_0x2b94ad){let _0x2d1124=-0x1,_0x23dbf1=Number['POSITIVE_INFINITY'],_0x4430c5=!0x0;for(let _0x4d67a6=_0x578fd5;_0x4d67a6<_0x2b94ad;_0x4d67a6++)if(_0x48932e['isInline'](_0x489f42[_0x4d67a6]['item'])||(_0x4430c5=!0x1),_0x489f42[_0x4d67a6]['item']['startIndex']<_0x578fd5&&(_0x2d1124=_0x4d67a6),_0x489f42[_0x4d67a6]['item']['endIndex']>=_0x2b94ad){_0x23dbf1=_0x4d67a6;break;}_0x4430c5&&(_0x2d1124=_0x2b94ad-0x1);for(let _0x51ac0d=_0x578fd5;_0x51ac0d<_0x2b94ad;_0x51ac0d++)_0x489f42[_0x51ac0d]['side']=_0x51ac0d<=_0x2d1124?-0x1:_0x51ac0d<_0x23dbf1?0x0:0x1,_0x489f42[_0x51ac0d]['index']=_0x51ac0d;let _0x3ac126=0x0;for(let _0x2dd2ad=_0x578fd5;_0x2dd2ad<=_0x2d1124;_0x2dd2ad++)0x0==_0x489f42[_0x2dd2ad]['distance']?_0x489f42[_0x2dd2ad]['level']=_0x3ac126:(_0x3ac126++,_0x489f42[_0x2dd2ad]['level']=_0x3ac126,_0x3ac126++);for(let _0x3e94f9=_0x578fd5;_0x3e94f9<_0x2b94ad;_0x3e94f9++)0x0==_0x489f42[_0x3e94f9]['side']&&(_0x489f42[_0x3e94f9]['level']=_0x3ac126);_0x3ac126=0x0;for(let _0x4ca952=_0x2b94ad-0x1;_0x4ca952>=_0x23dbf1;_0x4ca952--)0x0==_0x489f42[_0x4ca952]['distance']?_0x489f42[_0x4ca952]['level']=_0x3ac126:(_0x3ac126--,_0x489f42[_0x4ca952]['level']=_0x3ac126,_0x3ac126--);}}_fixObsoleteTags(_0xa659bd){const _0x3938d2=new Map(),_0x4365e7=this['editor']['model']['schema'];for(let _0x17070f=0x1;_0x17070f<_0xa659bd['length'];_0x17070f++){let _0x2cb025,_0x2558e2,_0xdf71d1;const _0x202ac2=_0xa659bd[_0x17070f],_0x415524=_0xa659bd[_0x17070f-0x1];if('text'==_0x202ac2['type'])continue;if(_0x202ac2['type']!=_0x415524['type'])continue;if(!_0x4365e7['isBlock'](_0x415524['item'])||_0x4365e7['isLimit'](_0x415524['item']))continue;if(!_0x4365e7['isBlock'](_0x202ac2['item'])||_0x4365e7['isLimit'](_0x202ac2['item']))continue;if((_0xa659bd[_0x17070f]['isAdded']||_0xa659bd[_0x17070f]['isAddSuggestion'])&&_0xa659bd[_0x17070f-0x1]['isRemoved'])_0x2cb025=_0xa659bd[_0x17070f],_0x2558e2=_0xa659bd[_0x17070f-0x1],_0xdf71d1=_0x17070f-0x1;else{if(!_0xa659bd[_0x17070f]['isRemoved']||!_0xa659bd[_0x17070f-0x1]['isAdded']&&!_0xa659bd[_0x17070f-0x1]['isAddSuggestion'])continue;_0x2cb025=_0xa659bd[_0x17070f-0x1],_0x2558e2=_0xa659bd[_0x17070f],_0xdf71d1=_0x17070f;}const _0x2b04fb=_0x2cb025['level']==_0x2558e2['level'],_0x1fa23b=Math['abs'](_0x2cb025['level'])<Math['abs'](_0x2558e2['level'])&&0x0==_0x2558e2['distance'];(_0x2b04fb||_0x1fa23b)&&(_0x3938d2['set'](_0x2558e2['id'],_0x2cb025['id']),_0xa659bd['splice'](_0xdf71d1,0x1),_0x17070f--,_0x2cb025['isAdded']=!0x1);}for(let _0xa09e93=0x0;_0xa09e93<_0xa659bd['length'];_0xa09e93++)_0x3938d2['has'](_0xa659bd[_0xa09e93]['pairId'])&&(_0xa659bd[_0xa09e93]['pairId']=_0x3938d2['get'](_0xa659bd[_0xa09e93]['pairId']));}['_removeMissingPairs'](_0xf903ec){const _0x704efa=new Set(_0xf903ec['map'](_0x2e9170=>_0x2e9170['id']));for(let _0x36e067=0x0;_0x36e067<_0xf903ec['length'];_0x36e067++)_0x704efa['has'](_0xf903ec[_0x36e067]['pairId'])||0x0==_0xf903ec[_0x36e067]['distance']||(_0xf903ec[_0x36e067]['isIncorrect']=!0x0);return _0xf903ec['filter'](_0x4f0209=>!_0x4f0209['isIncorrect']);}_markMismatchedRemovedTags(_0x51ba73){const _0x3f4f53=new Set();for(let _0x3df746=0x0;_0x3df746<_0x51ba73['length'];_0x3df746++){if(_0x3f4f53['has'](_0x51ba73[_0x3df746]['id'])&&_0x51ba73[_0x3df746]['isRemoved']&&(_0x51ba73[_0x3df746]['isIncorrect']=!0x0),_0x51ba73[_0x3df746]['isIncorrect'])continue;if(0x0==_0x51ba73[_0x3df746]['distance'])continue;if('elementStart'!=_0x51ba73[_0x3df746]['type'])continue;if(null==_0x51ba73[_0x3df746]['pairId'])continue;let _0x461e60=_0x3df746+0x1,_0xa059f8=0x0;for(;_0x51ba73[_0x461e60]['id']!=_0x51ba73[_0x3df746]['pairId'];)'elementStart'==_0x51ba73[_0x461e60]['type']?_0xa059f8++:'elementEnd'==_0x51ba73[_0x461e60]['type']&&_0xa059f8--,_0x461e60++;if(0x0!=_0xa059f8){if(_0x51ba73[_0x3df746]['isRemoved'])_0x51ba73[_0x3df746]['isIncorrect']=!0x0;else{for(;_0x461e60!=_0x3df746;)_0x51ba73[_0x461e60]['isRemoved']&&0x0!=_0x51ba73[_0x461e60]['distance']&&(_0x51ba73[_0x461e60]['isIncorrect']=!0x0,_0x3f4f53['add'](_0x51ba73[_0x461e60]['pairId'])),_0x461e60--;}}}return _0x51ba73['filter'](_0x24779a=>!_0x24779a['isIncorrect']);}_removeUnsupportedChanges(_0x222707){const _0x5e86a8=this['editor']['model']['schema'];for(let _0x3b5027=0x0;_0x3b5027<_0x222707['length'];_0x3b5027++){if(!(_0x222707[_0x3b5027]['isAdded']||_0x222707[_0x3b5027]['isAddSuggestion']||_0x222707[_0x3b5027]['isRemoved']||_0x222707[_0x3b5027]['isRemoveSuggestion']))continue;if(0x0==_0x222707[_0x3b5027]['distance'])continue;const _0x5f2162=_0x222707[_0x3b5027]['item'];_0x5e86a8['isBlock'](_0x5f2162)||_0x5e86a8['isLimit'](_0x5f2162)||(_0x222707[_0x3b5027]['isAdded']&&delete _0x222707[_0x3b5027]['isAdded'],_0x222707[_0x3b5027]['isAddSuggestion']&&delete _0x222707[_0x3b5027]['isAddSuggestion'],_0x222707[_0x3b5027]['isRemoveSuggestion']&&delete _0x222707[_0x3b5027]['isRemoveSuggestion'],_0x222707[_0x3b5027]['isRemoved']&&(_0x222707[_0x3b5027]['isIncorrect']=!0x0));}return _0x222707['filter'](_0x4e8b02=>!_0x4e8b02['isIncorrect']);}['_makeModelFromTape'](_0x49f6ea,_0x38fc6c,_0x55baf1,_0x12d045){const _0x168b96=new _0x1c4681(),_0x364c23=[],_0x5a2505=new Map(),_0x2630c9=this['editor']['model'],_0x296c1c=_0x2630c9['schema'],_0x56151f=[_0x168b96],_0x51e873={},_0x5ca1f1={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x168b96['name']=_0x12d045;let _0x3445ed=null;const _0x13d31d=[0x0];for(let _0x4acf58=0x0;_0x4acf58<_0x49f6ea['length'];_0x4acf58++)if('elementStart'===_0x49f6ea[_0x4acf58]['type']){_0x49f6ea[_0x4acf58]['previousPosition']=_0x2630c9['createPositionFromPath'](_0x168b96,_0x13d31d);const _0x4fe362=new _0x524633(_0x49f6ea[_0x4acf58]['item']['name'],_0x49f6ea[_0x4acf58]['item']['getAttributes']());_0x56151f[0x0]['_appendChild'](_0x4fe362),_0x13d31d['push'](0x0),_0x56151f['unshift'](_0x4fe362),_0x49f6ea[_0x4acf58]['nextPosition']=_0x2630c9['createPositionFromPath'](_0x168b96,_0x13d31d);}else'elementEnd'===_0x49f6ea[_0x4acf58]['type']?(_0x56151f['shift'](),_0x49f6ea[_0x4acf58]['previousPosition']=_0x2630c9['createPositionFromPath'](_0x168b96,_0x13d31d),_0x13d31d['pop'](),_0x13d31d[_0x13d31d['length']-0x1]++,_0x49f6ea[_0x4acf58]['nextPosition']=_0x2630c9['createPositionFromPath'](_0x168b96,_0x13d31d)):(_0x49f6ea[_0x4acf58]['previousPosition']=_0x2630c9['createPositionFromPath'](_0x168b96,_0x13d31d),_0x3445ed?_0x3445ed['_data']+=_0x49f6ea[_0x4acf58]['item']['data']:_0x3445ed=new _0x26249d(_0x49f6ea[_0x4acf58]['item']['data'],_0x49f6ea[_0x4acf58]['item']['getAttributes']()),_0x49f6ea[_0x4acf58+0x1]&&'text'===_0x49f6ea[_0x4acf58+0x1]['type']&&_0x4ba8d3(_0x3445ed,_0x49f6ea[_0x4acf58+0x1]['item'])||(_0x56151f[0x0]['_appendChild'](_0x3445ed),_0x3445ed=null),_0x13d31d[_0x13d31d['length']-0x1]+=_0x49f6ea[_0x4acf58]['item']['offsetSize'],_0x49f6ea[_0x4acf58]['nextPosition']=_0x2630c9['createPositionFromPath'](_0x168b96,_0x13d31d));for(let _0x22b4c1=0x0;_0x22b4c1<_0x49f6ea['length'];_0x22b4c1++){const _0x16a597=_0x49f6ea[_0x22b4c1]['previousPosition'],_0x130214=_0x49f6ea[_0x22b4c1]['nextPosition'];for(const _0x197769 of _0x49f6ea[_0x22b4c1]['markersStart'])_0x5a2505['set'](_0x197769,{'start':_0x16a597,'end':null});_0x1049ab('isRemoveSuggestion',_0x22b4c1,_0x16a597,_0x130214),_0x1049ab('isAddSuggestion',_0x22b4c1,_0x16a597,_0x130214),_0x1049ab('isRemoved',_0x22b4c1,_0x16a597,_0x130214),_0x1049ab('isAdded',_0x22b4c1,_0x16a597,_0x130214);for(const _0x437013 of _0x49f6ea[_0x22b4c1]['markersEnd']){const _0x3bb08a=_0x5a2505['get'](_0x437013);_0x3bb08a?_0x3bb08a['end']=_0x130214:_0x5a2505['set'](_0x437013,{'start':_0x130214,'end':_0x130214});}}for(const [_0xb637df,_0x45b728]of _0x5a2505){const _0xc1556c=this['editor']['model']['createRange'](_0x45b728['start'],_0x45b728['end']);_0x168b96['markers']['set'](_0xb637df,_0xc1556c);}return _0x364c23['sort']((_0x2d55ee,_0xb80201)=>{const _0x299a86=_0x168b96['markers']['get']('revision:'+_0x2d55ee['id']),_0x42da45=_0x168b96['markers']['get']('revision:'+_0xb80201['id']);return _0x299a86['start']['isBefore'](_0x42da45['start'])?-0x1:_0x299a86['start']['isAfter'](_0x42da45['start'])?0x1:_0x299a86['end']['isBefore'](_0x42da45['end'])?-0x1:_0x299a86['end']['isAfter'](_0x42da45['end'])?0x1:'add'===_0x2d55ee['type']?-0x1:0x1;}),{'root':_0x168b96,'changes':_0x364c23};function _0x1049ab(_0x5c9d8b,_0xae1895,_0x206379,_0x24ee9b){const _0x2cc9a7=!!_0x49f6ea[_0xae1895][_0x5c9d8b],_0x41a721=_0x2cc9a7?_0x49f6ea[_0xae1895][_0x5c9d8b]['userId']:null,_0x10c1a8=_0x2cc9a7&&_0x49f6ea[_0xae1895][_0x5c9d8b]['aiSource']||null,_0x325d68=_0xae1895===_0x49f6ea['length']-0x1,_0x21d410=_0x5ca1f1[_0x5c9d8b][0x0],_0x211223=_0x296c1c['isObject'](_0x49f6ea[_0xae1895]['item']);!_0x51e873[_0x5c9d8b]&&_0x2cc9a7?_0x51e873[_0x5c9d8b]={'start':_0x206379,'tapeItem':_0x49f6ea[_0xae1895],'userId':_0x41a721,'aiSource':_0x10c1a8,'type':_0x5c9d8b}:_0x51e873[_0x5c9d8b]&&!_0x2cc9a7?(_0x51e873[_0x5c9d8b]['end']=_0x206379,_0x545526(_0x51e873[_0x5c9d8b]),_0x51e873[_0x5c9d8b]=null):_0x51e873[_0x5c9d8b]&&_0x2cc9a7&&(_0x51e873[_0x5c9d8b]['userId']!==_0x41a721||_0x51e873[_0x5c9d8b]['aiSource']!==_0x10c1a8)&&(_0x51e873[_0x5c9d8b]['end']=_0x206379,_0x21d410&&_0x21d410['userId']===_0x51e873[_0x5c9d8b]['userId']?_0x21d410['change']['aiSource']=_0x21d410['change']['aiSource']||_0x51e873[_0x5c9d8b]['aiSource']:_0x545526(_0x51e873[_0x5c9d8b]),_0x51e873[_0x5c9d8b]={'start':_0x206379,'tapeItem':_0x49f6ea[_0xae1895],'userId':_0x41a721,'aiSource':_0x10c1a8,'type':_0x5c9d8b}),_0x51e873[_0x5c9d8b]&&_0x211223&&('elementStart'!==_0x49f6ea[_0xae1895]['type']||_0x21d410&&_0x21d410['userId']===_0x41a721||_0x5ca1f1[_0x5c9d8b]['unshift']({'userId':_0x41a721,'object':_0x49f6ea[_0xae1895]['item'],'change':_0x51e873[_0x5c9d8b]}),'elementEnd'===_0x49f6ea[_0xae1895]['type']&&_0x21d410&&_0x21d410['object']===_0x49f6ea[_0xae1895]['item']&&(_0x5ca1f1[_0x5c9d8b]['shift'](),_0x51e873[_0x5c9d8b]=_0x21d410['change'])),_0x51e873[_0x5c9d8b]&&_0x325d68&&(_0x51e873[_0x5c9d8b]['end']=_0x24ee9b,_0x545526(_0x51e873[_0x5c9d8b]),_0x51e873[_0x5c9d8b]=null);}function _0x545526({start:_0x1efaaf,end:_0x19bfc3,tapeItem:_0x5ba3ed,userId:_0x55f8a9,aiSource:_0xdb6c73,type:_0x5bbf20}){const _0x4b6ff2=_0x5ba3ed['item'],_0x126d3a=_0x2630c9['schema']['isBlock'](_0x4b6ff2)&&!_0x2630c9['schema']['isLimit'](_0x4b6ff2),_0x276241=_0x1efaaf['nodeAfter']==_0x19bfc3['parent']&&_0x19bfc3['isAtStart'];if(_0x126d3a&&_0x276241)return;const _0x3c2515=_0x2630c9['createRange'](_0x1efaaf,_0x19bfc3),_0x49b629=_0x38fc6c['get'](_0x55f8a9),_0x523973=new Tt({'author':_0x49b629,'type':'isAdded'==_0x5bbf20||'isAddSuggestion'==_0x5bbf20?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x5bbf20||'isRemoveSuggestion'==_0x5bbf20,'aiSource':_0xdb6c73||null},'createdAt':new Date(),'rootName':_0x55baf1});_0x364c23['push'](_0x523973),_0x168b96['markers']['set']('revision:'+_0x523973['id'],_0x3c2515);}function _0x4ba8d3(_0x390372,_0x52c1f2){const _0x1473b7=_0x390372['getAttributes'](),_0x1a9d15=_0x52c1f2['getAttributes']();for(const _0x41e709 of _0x1473b7){if(_0x41e709[0x1]!==_0x52c1f2['getAttribute'](_0x41e709[0x0]))return!0x1;_0x1a9d15['next']();}return _0x1a9d15['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x53a44f=>{const _0x50ece1=_0x53a44f['markerName']['split'](':')[0x1],_0x4907d2=this['_getChangeFromId'](_0x50ece1);if(!_0x4907d2)return null;const _0x48725d='add'==_0x4907d2['type']?'insertion':'deletion',_0x16848a=['ck-suggestion-marker','ck-suggestion-marker-'+_0x48725d];return _0x4907d2['data']['isSuggestion']&&_0x16848a['push']('ck-suggestion-marker-'+_0x48725d+'-new'),this['activeChange']==_0x4907d2&&_0x16848a['push']('ck-suggestion-marker--active'),{'classes':_0x16848a,'attributes':{'data-change-id':_0x50ece1}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x1f27a5=>{_0x1f27a5['on']('element:pre',(_0x257fb3,_0x5992ac,_0x27948)=>{const _0x2a7764=_0x5992ac['viewItem']['getChild'](0x0);if(!_0x2a7764||!_0x2a7764['is']('element','code'))return;if(!_0x27948['consumable']['consume'](_0x2a7764,{'attributes':['vid_start','vid_end']}))return;const _0x152db1=_0x5992ac['modelRange']['start']['nodeAfter'];_0x27948['writer']['setAttribute']('vid_start',_0x2a7764['getAttribute']('vid_start'),_0x152db1),_0x27948['writer']['setAttribute']('vid_end',_0x2a7764['getAttribute']('vid_end'),_0x152db1);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0xe6504=>{_0xe6504['on']('element',(_0x52f609,_0x36812a,_0x59613f)=>{if(!_0x59613f['consumable']['consume'](_0x36812a['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x36812a['modelRange']['isCollapsed'])return;const _0x3dd278=_0x36812a['modelRange']['start']['nodeAfter'];_0x3dd278['hasAttribute']('vid_start')||_0x3dd278['hasAttribute']('vid')||(_0x59613f['writer']['setAttribute']('vid_start',_0x36812a['viewItem']['getAttribute']('vid_start'),_0x3dd278),_0x59613f['writer']['setAttribute']('vid_end',_0x36812a['viewItem']['getAttribute']('vid_end'),_0x3dd278));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x55b88d=>_0x55b88d['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x2b8b50,[,_0x48ae2c])=>{['vid_start','vid_end','vid']['includes'](_0x48ae2c)&&(_0x2b8b50['return']=!0x0,_0x2b8b50['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x5db759=>{_0x5db759['on']('attribute:vid',(_0x8b6535,_0xd1bc84,_0x183b42)=>{if('\x20'!=_0xd1bc84['item']['data']||_0xd1bc84['item']['parent']['maxOffset']>0x1)return;if(!_0x183b42['consumable']['consume'](_0xd1bc84['item'],_0x8b6535['name']))return;const _0x337cd8=_0x183b42['writer'],_0x38e11d=_0x183b42['mapper']['toViewRange'](_0xd1bc84['range']);_0x337cd8['wrap'](_0x38e11d,_0x337cd8['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x6ad1c7){const _0x5984c8=_0x6ad1c7['plugins']['get']('RevisionViewer');return(_0x5223ce,_0x41c510,_0x10ea1b)=>{const _0x4a4305=_0x41c510['markerName']['split'](':')[0x1],_0x55f4b0=_0x5984c8['_getChangeFromId'](_0x4a4305);if(!_0x55f4b0)return null;const _0x4dfa24='add'==_0x55f4b0['type']?'split':'merge';if(!_0x10ea1b['consumable']['test'](_0x41c510['markerRange'],_0x5223ce['name']))return;const _0x4e1417=_0x41c510['markerRange']['getWalker'](),_0x5b6229=_0x41c510['markerRange']['start'],_0x1f8709=_0x6ad1c7['model']['schema'];let _0x33c645=null,_0x140260=null,_0xf8cfb2=!0x1,_0x317496=!0x1;for(const _0x502483 of _0x4e1417){const _0x4d959=_0x502483['item'];_0xf8cfb2=_0xf8cfb2||_0x1f8709['isContent'](_0x4d959);const _0xc0ca10=_0x10ea1b['mapper']['toViewElement'](_0x4d959);if(_0xc0ca10&&_0xc0ca10['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x502483['type']&&(_0x1f8709['isBlock'](_0x4d959)&&!_0x1f8709['isLimit'](_0x4d959)&&(_0x4d959['nextSibling']||_0x5b6229['isAtEnd']?_0x33c645&&_0x33c645['parent']==_0x4d959||(_0x33c645=_0x4d959,_0x39d7ff(_0x502483['previousPosition']),_0x317496=!0x0):_0x140260=_0x140260||_0x502483['previousPosition']));}function _0x39d7ff(_0x54d9b4){const _0x3df690=_0x10ea1b['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x4dfa24}),_0x3ec6d1=_0x10ea1b['mapper']['toViewPosition'](_0x54d9b4);_0x55f4b0['data']['isSuggestion']&&_0x10ea1b['writer']['addClass']('ck-suggestion-marker-'+_0x4dfa24+'-new',_0x3df690),_0x5984c8['activeChange']==_0x55f4b0&&_0x10ea1b['writer']['addClass']('ck-suggestion-marker--active',_0x3df690),_0x10ea1b['writer']['insert'](_0x3ec6d1,_0x3df690),_0x10ea1b['mapper']['bindElementToMarker'](_0x3df690,_0x41c510['markerName']);}_0xf8cfb2||_0x317496||!_0x140260||_0x39d7ff(_0x140260);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x4d4a2f,_0x567c59,_0x19d32b)=>{const _0x6b8691=_0x19d32b['mapper']['markerNameToElements'](_0x567c59['markerName']);if(_0x6b8691){for(const _0x3915a3 of _0x6b8691)(_0x3915a3['hasClass']('ck-suggestion-marker-split')||_0x3915a3['hasClass']('ck-suggestion-marker-merge'))&&(_0x19d32b['mapper']['unbindElementFromMarkerName'](_0x3915a3,_0x567c59['markerName']),_0x19d32b['writer']['remove'](_0x3915a3));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x5261f9,_0x484c12,_0x57aba2)=>{const _0x4677cc=_0x484c12['markerName']['split'](':')[0x1],_0x24ad15=this['_getChangeFromId'](_0x4677cc);if(!_0x24ad15)return null;const _0x465c83='add'==_0x24ad15['type']?'split':'merge';if(_0x57aba2['consumable']['test'](_0x484c12['markerRange'],_0x5261f9['name']))for(const _0x344378 of _0x484c12['markerRange']['getItems']()){if(!_0x344378['is']('element','softBreak'))continue;const _0x4d11c9=_0x57aba2['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x465c83}),_0x45b0ac=_0x57aba2['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x344378));_0x24ad15['data']['isSuggestion']&&_0x57aba2['writer']['addClass']('ck-suggestion-marker-'+_0x465c83+'-new',_0x4d11c9),this['activeChange']==_0x24ad15&&_0x57aba2['writer']['addClass']('ck-suggestion-marker--active',_0x4d11c9),_0x57aba2['writer']['insert'](_0x45b0ac,_0x4d11c9),_0x57aba2['mapper']['bindElementToMarker'](_0x4d11c9,_0x484c12['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x13a22c=>{for(const _0x2383e8 of this['editor']['model']['document']['getRootNames']()){const _0x513ff=this['editor']['model']['document']['getRoot'](_0x2383e8),_0xc21e9a=this['editor']['editing']['view']['document']['getRoot'](_0x2383e8);if(_0xc21e9a){const _0x32b68c=_0x513ff['getAttribute']('revisionHistoryAttachChange');if(_0x13a22c['removeAttribute']('data-change-id',_0xc21e9a),_0x13a22c['removeClass']('ck-revision-history-root-add',_0xc21e9a),_0x13a22c['removeClass']('ck-revision-history-root-remove',_0xc21e9a),_0x13a22c['removeClass']('ck-revision-history-root--active',_0xc21e9a),_0x32b68c){const _0x203147=this['_getChangeFromId'](_0x32b68c);if(!_0x203147)return null;_0x13a22c['setAttribute']('data-change-id',_0x32b68c,_0xc21e9a),_0x13a22c['addClass']('ck-revision-history-root-'+_0x203147['type'],_0xc21e9a),this['activeChange']==_0x203147&&_0x13a22c['addClass']('ck-revision-history-root--active',_0xc21e9a);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x4d885f=>'revision-comment:'+_0x4d885f,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x325336=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Pt(_0x325336['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x2d3895=>'revision-suggestion:'+_0x2d3895,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x21b0d5=>({'name':'suggestion:'+_0x21b0d5,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x4f6338=>{const _0x3892fa=_0x4f6338['markerName']['split'](':')[0x1];return'insertion'!=_0x3892fa&&'deletion'!=_0x3892fa?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x3892fa]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Ut(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Ut(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x15971d,_0x3f3034,_0x6413b9)=>{const _0x1e5537=_0x6413b9['mapper']['markerNameToElements'](_0x3f3034['markerName']);if(_0x1e5537){for(const _0xc39315 of _0x1e5537)_0xc39315['is']('uiElement')&&(_0x6413b9['mapper']['unbindElementFromMarkerName'](_0xc39315,_0x3f3034['markerName']),_0x6413b9['writer']['remove'](_0xc39315));}},{'priority':'high'});}_getChangeFromId(_0x39a7c0){return this['_changeIdToChange']['get'](_0x39a7c0);}_getViewForChange(_0x36f746){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Dt(this['editor']['locale'],_0x36f746,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x529cd2,_0x473b29,_0x4d8860,_0x103c8b)=>{_0x103c8b&&this['_balloon']['remove'](_0x103c8b),_0x4d8860&&(this['_balloon']['add']({'view':_0x4d8860,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x47e200=this['editor']['editing'],_0xdb3c33=this['_getChangeFromId'](_0x4d8860['changeId']);let _0x6ec2bb;if(_0xdb3c33['data']['isOnRoot']){const _0x3128a8=_0x47e200['view']['getDomRoot'](_0xdb3c33['rootName']);_0x6ec2bb=Array['from'](_0x3128a8['getClientRects']());}else{const _0x32bc5a=this['editor']['model']['markers']['get']('revision:'+_0x4d8860['changeId']);_0x6ec2bb=Array['from'](_0x47e200['mapper']['markerNameToElements'](_0x32bc5a['name']))['map'](_0x28dfdc=>_0x47e200['view']['domConverter']['mapViewToDom'](_0x28dfdc))['map'](_0x13272f=>Array['from'](_0x13272f['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x6ec2bb['find'](_0x376f35=>_0x376f35['top']-0x3<=this['_activeViewTarget']['y']&&_0x376f35['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x376f35['left']-0x3<=this['_activeViewTarget']['x']&&_0x376f35['right']+0x3>=this['_activeViewTarget']['x'])||_0x6ec2bb[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x2bdec1,_0x4f66f1,_0x3a9130,_0x100f0f)=>{this['activeView']=_0x3a9130?this['_getViewForChange'](_0x3a9130):null,this['editor']['model']['change'](()=>{const _0x4ab83d=this['editor']['editing'];_0x100f0f&&(_0x100f0f['data']['isOnRoot']?_0x4ab83d['view']['change'](_0x34c3f5=>{_0x34c3f5['removeClass']('ck-revision-history-root--active',_0x4ab83d['view']['document']['getRoot'](_0x100f0f['rootName']));}):_0x4ab83d['reconvertMarker']('revision:'+_0x100f0f['id'])),_0x3a9130&&(_0x3a9130['data']['isOnRoot']?_0x4ab83d['view']['change'](_0x176c95=>{_0x176c95['addClass']('ck-revision-history-root--active',_0x4ab83d['view']['document']['getRoot'](_0x3a9130['rootName']));}):_0x4ab83d['reconvertMarker']('revision:'+_0x3a9130['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x3d819b,_0x2bb23b)=>{if(this['activeChange'])return;const _0x49b88d=this['_findChangeIdFromDomTarget'](_0x2bb23b['target']),_0x41973d=this['_changeIdToChange']['get'](_0x49b88d);_0x41973d?(this['_activeViewTarget']={'x':_0x2bb23b['domEvent']['x'],'y':_0x2bb23b['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x41973d)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x4d12b3,_0x8fabe1)=>{const _0x453ce5=this['_findChangeIdFromDomTarget'](_0x8fabe1['target']),_0x1e2d85=this['_changeIdToChange']['get'](_0x453ce5);_0x1e2d85?(this['_activeViewTarget']={'x':_0x8fabe1['domEvent']['x'],'y':_0x8fabe1['domEvent']['y']},_0x1e2d85===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x1e2d85):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x13c762){do{const _0x4eeccd=_0x13c762['getAttribute']('data-change-id');if(_0x4eeccd)return _0x4eeccd;_0x13c762=_0x13c762['parent'];}while(_0x13c762);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x2d73ef=>{for(const _0x8a164f of this['editor']['model']['markers'])_0x2d73ef['removeMarker'](_0x8a164f);});}};function Pt(_0x24b9e1){return _0x24b9e1['split'](':')[0x1];}function Ut(_0x32b421,_0x5b24b6){return(_0x4568a7,_0x446602,_0x5373ef)=>{if(!_0x5373ef['consumable']['test'](_0x446602['markerRange'],_0x4568a7['name']))return;const _0x2cad54=_0x446602['markerRange']['getWalker'](),_0x4da953=_0x446602['markerRange']['start'],_0xf5197=_0x32b421['model']['schema'];let _0x552434=null,_0x1fb939=null,_0x3f7710=!0x1,_0x341e12=!0x1;for(const _0x5b6f55 of _0x2cad54){const _0x298839=_0x5b6f55['item'];_0x3f7710=_0x3f7710||_0xf5197['isContent'](_0x298839);const _0x27eed5=_0x5373ef['mapper']['toViewElement'](_0x298839);if(_0x27eed5&&_0x27eed5['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x5b6f55['type']&&(_0xf5197['isBlock'](_0x298839)&&!_0xf5197['isLimit'](_0x298839)&&(_0x298839['nextSibling']||_0x4da953['isAtEnd']?_0x552434&&_0x552434['parent']==_0x298839||(_0x552434=_0x298839,_0x39c785(_0x5b6f55['previousPosition']),_0x341e12=!0x0):_0x1fb939=_0x1fb939||_0x5b6f55['previousPosition']));}function _0x39c785(_0x4e3b47){const _0xceea61=_0x5373ef['mapper']['toViewPosition'](_0x4e3b47),_0x3a3214=_0x5373ef['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x5b24b6});_0x5373ef['writer']['insert'](_0xceea61,_0x3a3214),_0x5373ef['mapper']['bindElementToMarker'](_0x3a3214,_0x446602['markerName']);}_0x3f7710||_0x341e12||!_0x1fb939||_0x39c785(_0x1fb939);};}var Lt=class extends _0x265df5{constructor(_0x467445){super(_0x467445);const _0x2996f3=_0x467445['plugins']['get'](Ht);this['affectsData']=!0x1,this['listenTo'](_0x2996f3,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x2996f3,'change:isEnabled',()=>this['refresh']());}execute(){const _0x617cc8=this['editor'],_0xa5332a=_0x617cc8['plugins']['get'](Ht),_0x7908f9=_0xa5332a['isReady']?_0xa5332a['diff']['newRevisionId']:null;_0x617cc8['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x7908f9);}['refresh'](){const {isReady:_0x209a0b,isEnabled:_0x56715e,repository:_0x323fba,diff:_0x5de14b}=this['editor']['plugins']['get'](Ht),_0x570693=_0x5de14b&&_0x323fba['getLaterVisibleRevision'](_0x5de14b['newRevisionId']);this['isEnabled']=_0x209a0b&&_0x56715e&&Boolean(_0x570693);}},Ft=class extends _0x265df5{_step;constructor(_0x15258a,{direction:_0x177965}){super(_0x15258a);const _0x5a3964=_0x15258a['plugins']['get'](Ht);this['affectsData']=!0x1,this['_step']='forward'===_0x177965?0x1:-0x1,this['listenTo'](_0x5a3964,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x5a3964,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x5a3964,'change:activeChange',()=>this['refresh']());}execute(){const _0x38529c=this['editor'],_0x2a498c=_0x38529c['plugins']['get'](Ht),{isNavigationMode:_0xcb4c42,currentChangeNumber:_0x4d51cc}=_0x2a498c;let _0x1ccc8a;if(_0x2a498c['activeChange']=_0xcb4c42?_0x2a498c['diff']['changes']['get'](_0x4d51cc+this['_step']):_0x2a498c['diff']['changes']['first'],_0x2a498c['activeChange']['data']['isOnRoot'])_0x1ccc8a=_0x38529c['editing']['view']['getDomRoot'](_0x2a498c['activeChange']['rootName']);else{const _0x50e6cf=_0x38529c['model']['markers']['get']('revision:'+_0x2a498c['activeChange']['id']);_0x1ccc8a=_0x5cabcc(_0x38529c['editing'],_0x50e6cf);}_0x5b1f25({'target':_0x1ccc8a,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x364ad0,currentChangeNumber:_0x31dd6e,numberOfChanges:_0x5e0269,isReady:_0x5df5ac,isEnabled:_0x1da5e7}=this['editor']['plugins']['get'](Ht);this['isEnabled']=!!(_0x1da5e7&&_0x5df5ac&&_0x5e0269)&&(!_0x364ad0||(0x1===this['_step']?_0x31dd6e<_0x5e0269-0x1:_0x31dd6e>0x0));}},$t=class extends ut{constructor(_0xd72735){super(_0xd72735);const _0x29575e=this['bindTemplate'],_0x31fe68=new _0x264e1e(_0xd72735),_0x1d9050=new _0x264e1e(_0xd72735);this['set']('isNavigationMode',!0x1),this['set']('isReady',!0x1),this['set']('currentChangeNumber',0x0),this['set']('numberOfChanges',0x0),this['set']('isForwardNavigationEnabled',!0x1),this['set']('isBackwardNavigationEnabled',!0x1),this['bind']('_isStatusLabelVisible')['to'](this,'isReady',this,'numberOfChanges',(_0x22527b,_0x543a3e)=>_0x22527b&&_0x543a3e>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x3d2172,_0x223a24,_0x23f557,_0x46409c)=>{if(!_0x3d2172)return Rt(_0xd72735,'Loading...');if(!_0x23f557)return Rt(_0xd72735,'No\x20changes');const _0x3c9b45=Rt(_0xd72735,'NUMBER_OF_CHANGES',_0x23f557);return _0x46409c?Rt(_0xd72735,'X_OF_Y_CHANGES',[_0x223a24+0x1,_0x23f557]):_0x3c9b45;}),_0x31fe68['set']({'label':Rt(_0xd72735,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0xaa8312}),_0x1d9050['set']({'label':Rt(_0xd72735,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0xb2d7ef}),_0x31fe68['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x1d9050['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x31fe68['on']('execute',()=>this['fire']('execute','backward')),_0x1d9050['on']('execute',()=>this['fire']('execute','forward')),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-ui','ck-revision-history-ui__changes-navigation']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__wrapper']},'children':[{'tag':'span','attributes':{'class':['ck-revision-history-ui__changes-navigation__label',_0x29575e['if']('_isStatusLabelVisible','ck-hidden',_0x352128=>!_0x352128)]},'children':[{'text':_0x29575e['to']('isNavigationMode',_0x1faa61=>_0x1faa61?Rt(_0xd72735,'EDIT_X_OF_Y_REVISIONS')+':\x20':Rt(_0xd72735,'Total')+':\x20')}]},{'text':_0x29575e['to']('_statusText')}]},new ht(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x31fe68,_0x1d9050]}]});}};const Bt='ck-editor__editable__loading-overlay';var jt=class extends _0x2dd53f{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x491a70=this['editor']['editing']['view'];_0x491a70['change'](_0x4dc962=>{for(const _0xdcf979 of _0x491a70['document']['roots'])_0x4dc962['addClass'](Bt,_0xdcf979);});}['hide'](){const _0x5120c5=this['editor']['editing']['view'];_0x5120c5['change'](_0x481bb3=>{for(const _0x5423d6 of _0x5120c5['document']['roots'])_0x481bb3['removeClass'](Bt,_0x5423d6);});}},Gt=class extends _0x2dd53f{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ht,jt];}init(){const _0x2fcc02=this['editor'],_0x609d22=_0x2fcc02['plugins']['get'](Ht),_0x1a1cd7=_0x2fcc02['plugins']['get'](jt);_0x2fcc02['ui']['componentFactory']['add']('exitToEditing',_0x3a8980=>{const _0x3a5bcf=new _0x264e1e(_0x3a8980);return _0x3a5bcf['set']({'label':Rt(_0x3a8980,'Back\x20to\x20editing'),'icon':_0x38ee45,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x3a5bcf,'execute',()=>{_0x2fcc02['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x3a5bcf;}),_0x2fcc02['ui']['componentFactory']['add']('restoreRevision',_0x2bfbad=>{const _0x33f640=new _0x264e1e(_0x2bfbad);return _0x33f640['set']({'label':Rt(_0x2bfbad,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x33f640['bind']('isEnabled')['to'](_0x2fcc02['commands']['get']('restoreRevision')),this['listenTo'](_0x33f640,'execute',()=>_0x2fcc02['execute']('restoreRevision')),_0x33f640;}),_0x2fcc02['ui']['componentFactory']['add']('changesNavigation',_0x29104d=>{const _0x1503c1=new $t(_0x29104d),_0x262589=_0x2fcc02['commands']['get']('showPreviousChange'),_0x4d85f6=_0x2fcc02['commands']['get']('showNextChange');return _0x1503c1['bind']('isBackwardNavigationEnabled')['to'](_0x262589,'isEnabled'),_0x1503c1['bind']('isForwardNavigationEnabled')['to'](_0x4d85f6,'isEnabled'),_0x1503c1['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x609d22),this['listenTo'](_0x1503c1,'execute',(_0x2b1b56,_0x26a9be)=>{_0x2fcc02['execute']('forward'===_0x26a9be?'showNextChange':'showPreviousChange');}),_0x1503c1;}),_0x1a1cd7['show'](),_0x609d22['on']('change:isReady',(_0x4da7c8,_0x5681e4,_0x3a1237)=>{_0x3a1237?_0x1a1cd7['hide']():_0x1a1cd7['show']();});}},Kt=class extends tt{['_resizeObserver']=null;constructor(_0x971438,_0x547761){super(_0x971438,_0x547761);const _0x1c5f1f=this['bindTemplate'];this['set']({'label':Rt(_0x971438,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=Rt(_0x971438,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x1c5f1f['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x51ad7d(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x29c457=this['fieldView']['element'];this['_tooltipString']=_0x29c457['scrollWidth']>_0x29c457['clientWidth']&&_0x29c457['value']||'';}},qt=class extends ut{constructor(_0xb67b5d,_0x342093,_0xaa7a15){super(_0xb67b5d);const _0x1c530d=new _0x105ea5();_0x1c530d['set']({'content':_0x2dbbaa,'viewBox':'0\x200\x2011\x2010'});const _0x3f5f24=['ck','ck-revision-history-sidebar__revision-author'];_0xaa7a15&&_0x3f5f24['push']('ck-revision-history-sidebar__revision-author_creator');const _0x4d942c=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':Rt(_0xb67b5d,_0xaa7a15?'Revision\x20creator':'Revision\x20author')},'children':[_0x1c530d,_0x342093['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x3f5f24},'children':_0x4d942c});}};function Yt(_0x35fda5,_0x4e7ddb){const _0x20fe1a=_0x35fda5['bindTemplate'],_0x2ae755=_0x35fda5['locale'],_0x14966e=ft(_0x2ae755);_0x14966e['panelPosition']='sw';const _0x276970=function(_0x5a64a9,_0x5952b8){const _0xb92c6a=function(_0x3271b4,_0x2bba0a){const _0x4fa3d9=_0x3271b4['locale'],_0xae0de1={'Compare\x20against\x20selected':Rt(_0x4fa3d9,'Compare\x20against\x20selected'),'Name\x20this\x20revision':Rt(_0x4fa3d9,'Name\x20this\x20revision'),'Restore\x20this\x20revision':Rt(_0x4fa3d9,'Restore\x20this\x20revision')};return _0x2bba0a['map'](_0x17134a=>{const _0x1e1f77=_0xae0de1[_0x17134a['name']];return _0x1e1f77&&_0x1e1f77!==_0x17134a['name']&&(_0x17134a['name']=_0x1e1f77),_0x17134a;});}(_0x5a64a9,_0x5952b8),_0x1a2ef7=new _0x5d63ac();for(const _0x3757c1 of _0xb92c6a){const _0x372d5d={'type':'button','model':new lt({'label':_0x3757c1['name'],'class':_0x3757c1['class'],'withText':!0x0,'role':'menuitem','_action':_0x3757c1['action']})};_0x372d5d['model']['bind']('isEnabled')['to'](_0x5a64a9,'isActionsDropdownOpen',_0x342fe7=>'function'!=typeof _0x3757c1['isEnabled']||(!_0x342fe7||_0x3757c1['isEnabled'](_0x5a64a9))),_0x1a2ef7['add'](_0x372d5d);}return _0x1a2ef7;}(_0x35fda5,_0x4e7ddb);return _0x35fda5['bind']('isActionsDropdownOpen')['to'](_0x14966e,'isOpen'),_0x14966e['buttonView']['set']({'label':Rt(_0x2ae755,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x1ed1ba}),_0x14966e['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x20fe1a['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x20fe1a['to'](_0x4f3efc=>_0x4f3efc['stopPropagation']())}}),_0x14966e['on']('execute',_0x5bcde0=>{_0x35fda5['isReady']&&'function'==typeof _0x5bcde0['source']['_action']&&_0x5bcde0['source']['_action'](_0x35fda5);}),dt(_0x14966e,_0x276970,{'role':'menu'}),_0x14966e['listenTo'](_0x35fda5,'change:isActionsDropdownOpen',(_0x5e4561,_0x45fdf3,_0x298686)=>{if(_0x298686)for(const _0x176a6a of _0x14966e['listView']['items']){const _0x4ed2b4=_0x176a6a['children']['first'],_0x3fbb74=_0x4e7ddb['find'](_0x2256ff=>_0x2256ff['action']===_0x4ed2b4['_action'])['isVisible'];_0x176a6a['isVisible']=void 0x0===_0x3fbb74||_0x3fbb74(_0x35fda5);}}),_0x14966e;}const Jt=/* #__PURE__ -- @preserve */
27
+ _0x2b4c5c(ut);var Wt=class extends Jt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0x44d4f3,_0x4b4263,_0xfecc72,_0x1e9a54,_0x4afbd9=!0x1){super(_0x44d4f3);const _0x37c092=this['bindTemplate'],_0x14572d=function(_0x5c76d1,_0x1ddcf5){const _0x3cfd42=Array['from'](_0x1ddcf5['authors'])['filter'](_0x5c0dd5=>_0x5c0dd5!=_0x1ddcf5['creator']);return _0x1ddcf5['creator']&&_0x3cfd42['unshift'](_0x1ddcf5['creator']),_0x3cfd42['map'](_0x32eeec=>new qt(_0x5c76d1,_0x32eeec,_0x32eeec==_0x1ddcf5['creator']));}(_0x44d4f3,_0x4b4263);this['id']=_0x4b4263['id'],this['_revision']=_0x4b4263,this['_requireRevisionName']=_0x1e9a54,this['bind']('_isAiGenerated')['to'](_0x4b4263,'attributes',_0x551123=>!(!_0x551123||!_0x551123['@ai'])),this['bind']('name','createdAt')['to'](_0x4b4263),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x1b8bda=>{return _0x449ee3=_0x44d4f3['uiLanguage'],(_0x32435d=_0x1b8bda)['toLocaleDateString'](_0x449ee3,{'month':'long','day':'numeric'})+',\x20'+_0x32435d['toLocaleTimeString'](_0x449ee3,{'hour':'numeric','minute':'numeric'});var _0x449ee3,_0x32435d;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new Kt(_0x44d4f3,vt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x1b4d15=>_0x1b4d15||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x271393,_0x2fbf5f)=>_0x271393&&_0x2fbf5f),this['revisionActionsView']=_0xfecc72&&_0xfecc72['length']?Yt(this,_0xfecc72):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x4afbd9?this['_createAiPillView'](_0x44d4f3):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x37c092['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x37c092['if']('isEnabled','ck-disabled',_0x443530=>!_0x443530),_0x37c092['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x37c092['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x37c092['if']('isActionsDropdownOpen','ck-revision-history-sidebar__actions_dropdown_open')]},'children':[this['revisionNameView'],{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision__date']},'children':[{'text':_0x37c092['to']('_createdAtFormatted')}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision__controls-wrapper']},'children':[{'tag':'ul','attributes':{'class':['ck','ck-revision-history-sidebar__revision-authors']},'children':_0x14572d}]},..._0x4afbd9?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x37c092['if']('_isAiGenerated','ck-hidden',_0x33f21e=>!_0x33f21e)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x37c092['to'](_0x40a1ed=>{_0x40a1ed['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x4a539c){const _0x5b713f=new _0x456423(_0x4a539c);return _0x5b713f['set']({'icon':_0x29e5ea,'label':Rt(_0x4a539c,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':Rt(_0x4a539c,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','class':'ck-pill_ai'}),_0x5b713f['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x5b713f;}['render'](){super['render']();const _0x469d47=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x469d47,'change',()=>{this['_requireRevisionName']&&!_0x469d47['value']||this['fire']('setName',{'id':this['id'],'name':_0x469d47['value']}),_0x469d47['value']||(_0x469d47['value']=this['name']?this['name']:this['_createdAtFormatted']);});}select(){this['isSelected']=!0x0;}deselect(){this['isSelected']=!0x1;}highlight(){this['isHighlighted']=!0x0;}unhighlight(){this['isHighlighted']=!0x1;}};function Xt(_0x297dbc,_0x3ca425){const _0xe547ec=_t['fromJSDate'](_0x297dbc)['setLocale'](_0x3ca425),_0x17b534=_t['local'](),_0x56b929=_0x17b534['minus']({'days':0x1})['startOf']('day');let _0x4d8b22,_0x487ce9;return _0xe547ec['hasSame'](_0x17b534,'day')?(_0x4d8b22=_0xe547ec['startOf']('day')['toJSDate'](),_0x487ce9=_0xe547ec['toRelativeCalendar']()):_0xe547ec['hasSame'](_0x56b929,'day')?(_0x4d8b22=_0x56b929['toJSDate'](),_0x487ce9=_0xe547ec['toRelativeCalendar']()):_0xe547ec['hasSame'](_0x17b534,'week')?(_0x4d8b22=_0xe547ec['startOf']('week')['toJSDate'](),_0x487ce9=_0xe547ec['weekdayLong']||''):_0xe547ec['hasSame'](_0x17b534,'year')?(_0x4d8b22=_0xe547ec['startOf']('month')['toJSDate'](),_0x487ce9=_0xe547ec['monthLong']||''):(_0x4d8b22=_0xe547ec['startOf']('year')['toJSDate'](),_0x487ce9=String(_0xe547ec['year'])),{'startDate':_0x4d8b22,'localizedPeriodName':_0x487ce9};}var Qt=class extends ut{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x5a7428,_0x29067b,_0xd0cdc1,_0x263a7,_0x4b7cb2){super(_0x5a7428);const _0x5123d5=Xt(_0x29067b,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x29067b,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0xd0cdc1,this['_requireRevisionName']=_0x263a7,this['_showAISource']=_0x4b7cb2,this['revisionViews']['delegate']('select')['to'](this),this['revisionViews']['delegate']('setName')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period']},'children':[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__label']},'children':[{'text':_0x5123d5}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x243f7d){const _0x3babcc=new Wt(this['locale'],_0x243f7d,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0x3babcc);}['removeRevision'](_0x2cd963){const _0x7660bc=this['revisionViews']['find'](_0x45aef4=>_0x45aef4['id']===_0x2cd963['id']);this['revisionViews']['remove'](_0x7660bc);}},zt=class extends ut{constructor(_0x2b8638){super(_0x2b8638);const _0x229d1c=new _0x105ea5();_0x229d1c['content']=_0x4d55b6,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x229d1c,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[Rt(_0x2b8638,'Revision\x20history')]}]});}},Zt=class extends ut{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x48bb09,_0x35f657,_0x4abf3d,_0x46e51a,_0x4d5518){super(_0x48bb09);const _0x2f5c01=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x35f657,this['_revisionActions']=_0x4abf3d,this['_requireRevisionName']=_0x46e51a,this['_showAISource']=_0x4d5518,this['on']('select',(_0x533d2c,_0x1cf341)=>{this['fire']('revisionSelected',_0x1cf341);}),this['on']('setName',(_0x10bb7d,_0x283e79)=>{this['fire']('revisionSetName',_0x283e79);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new zt(_0x48bb09),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x2f5c01['if']('isEnabled','ck-disabled',_0x516d24=>!_0x516d24)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x2cacad of this['_revisions'])this['_addRevision'](_0x2cacad);this['_revisions']['on']('add',(_0xee6fb5,_0x369ae6)=>{this['_addRevision'](_0x369ae6);}),this['_revisions']['on']('remove',(_0x3941d4,_0x1074b2)=>{this['_removeRevision'](_0x1074b2);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x39d07d=>_0x39d07d['revisionViews']['map'](_0x33c563=>_0x33c563))['flat']();}selectRevision(_0x4720bf){for(const _0x196adf of this['revisionViews'])_0x4720bf&&_0x4720bf['id']===_0x196adf['id']?_0x196adf['select']():_0x196adf['deselect']();}highlightRevisions(_0x24d179){for(const _0x3962bc of this['revisionViews'])_0x24d179['some'](({id:_0x51a0bb})=>_0x51a0bb===_0x3962bc['id'])?_0x3962bc['highlight']():_0x3962bc['unhighlight']();}['_addRevision'](_0x1ec507){const _0x172ed0=Xt(_0x1ec507['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x421876=this['_getTimePeriodViewByStartDate'](_0x172ed0);_0x421876||(_0x421876=new Qt(this['locale'],_0x172ed0,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x421876)),_0x421876['addRevision'](_0x1ec507);}['_removeRevision'](_0x417ee5){const _0x4a813f=Xt(_0x417ee5['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x4a813f)['removeRevision'](_0x417ee5);}_getTimePeriodViewByStartDate(_0x58dd6a){return this['timePeriodViews']['find'](_0x48eafa=>_0x48eafa['startDate']['getTime']()===_0x58dd6a['getTime']());}},ti=class RevisionsSidebar extends _0x2dd53f{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
28
28
  ((()=>['compareAgainstSelected','restoreRevision','nameRevision'])());static availableRevisionActions=/* #__PURE__ -- @preserve */
29
- ii();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ht];}constructor(_0xe97cf8){super(_0xe97cf8),this['_revisionViewer']=_0xe97cf8['plugins']['get'](Ht),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x1b898e=this['_revisionsRepository']['_revisions'],_0x572d86=this['_createRevisionActions'](),_0xe0244c=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new Zt(this['editor']['locale'],_0x1b898e,_0x572d86,this['editor']['config']['get']('revisionHistory.requireRevisionName'),'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_sidebarView']['on']('revisionSelected',this['_handleRevisionSelected']['bind'](this)),this['_sidebarView']['on']('revisionSetName',this['_handleRevisionSetName']['bind'](this)),this['_sidebarView']['bind']('isEnabled')['to'](this['_revisionViewer']),this['_sidebarView']['timePeriodViews']['on']('add',(_0x3a8724,_0xebebc3)=>{_0xebebc3['revisionViews']['on']('add',(_0x5aed90,_0x56b141)=>{_0x56b141['bind']('isEnabled','isReady')['to'](this['_revisionViewer']);});}),this['_sidebarView']['render'](),this['listenTo'](this['editor']['data'],'ready',this['_handleEditorDataReady']['bind'](this)),this['listenTo'](this['_revisionViewer'],'change:diff',this['_handleDiffChange']['bind'](this)),_0xe0244c['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x30692b=this['_revisionsRepository']['getRevision'](0x0);if(_0x30692b){const _0x4f12e6=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x30692b['id']);this['_revisionViewer']['compare'](_0x30692b,_0x4f12e6);}}_handleRevisionSelected(_0x3f58dd,_0x57ff66){const _0x458c20=this['_revisionsRepository']['getRevision'](_0x57ff66['id']),_0x338b60=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x458c20['id']);this['_revisionViewer']['compare'](_0x458c20,_0x338b60);}_handleRevisionSetName(_0x22fa36,_0x4373b6){this['_revisionsRepository']['getRevision'](_0x4373b6['id'])['setName'](_0x4373b6['name']);}['_handleDiffChange'](_0x3d8d29,_0x239d2d,_0x4c5780){const _0x487dde=this['_revisionsRepository']['getRevisionsInDiff'](_0x4c5780);_0x487dde['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x487dde),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x487dde[0x0]));}_createRevisionActions(){const _0x15167b=this['editor'],_0x16a9c9=RevisionsSidebar['availableRevisionActions'],_0x21c24e=_0x15167b['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x21c24e['length'])return _0x21c24e['map'](_0x2b5d31=>{const _0x24d288='string'==typeof _0x2b5d31?Object['assign']({},_0x16a9c9[_0x2b5d31]):_0x2b5d31;return _0x24d288['action']=_0x24d288['action']['bind'](this,_0x15167b),_0x24d288['isVisible']&&(_0x24d288['isVisible']=_0x24d288['isVisible']['bind'](this,_0x15167b)),_0x24d288;});}};function ii(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0xb139d6},_0x3e6ab5)=>{const _0x3a5ce8=_0xb139d6['get'](Ht),_0x316fa2=_0x3a5ce8['repository'];let _0x1ab68c=_0x3a5ce8['diff']['newRevisionId'],_0x50e8a9=_0x3e6ab5['id'];_0x316fa2['getIndex'](_0x1ab68c)>_0x316fa2['getIndex'](_0x50e8a9)&&([_0x1ab68c,_0x50e8a9]=[_0x50e8a9,_0x1ab68c]),_0x3a5ce8['compare'](_0x1ab68c,_0x50e8a9);},'isVisible':({plugins:_0x376cd0},_0x750e9b)=>{const _0x5f226d=_0x376cd0['get'](Ht);return!(_0x5f226d['repository']['getRevisionsInDiff'](_0x5f226d['diff'])['length']>0x2)&&!_0x750e9b['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x5d6ce2,{id:_0x4ef251})=>{_0x5d6ce2['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x4ef251);},'isVisible':({plugins:_0x13208a},_0x1402b9)=>!!_0x13208a['get'](Ht)['repository']['getLaterVisibleRevision'](_0x1402b9['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x561620},{id:_0x186919,revisionNameView:_0x5f4ee1})=>{const _0x4f0c3b=_0x561620['get'](Ht),_0x337223=_0x4f0c3b['repository']['getEarlierVisibleRevision'](_0x186919);_0x4f0c3b['compare'](_0x186919,_0x337223),_0x5f4ee1['focus'](),_0x5f4ee1['fieldView']['select']();}}};}var ei=class extends _0x4d2c08{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x2ac16b,_0x46aa10){super(_0x2ac16b),this['_view']=_0x46aa10,this['_toolbarConfig']=gt(_0x2ac16b['config']['get']('toolbar')),this['_elementReplacer']=new _0x178f0c();}get element(){return this['view']['element'];}init(_0x3d15ee){const _0x41aa9e=this['editor'],_0x559925=this['view'],_0x238824=_0x41aa9e['editing']['view'],_0x288752=_0x559925['editable'];_0x288752['name']=_0x238824['document']['getRoot']()['rootName'],_0x559925['render']();const _0x1461a4=_0x288752['element'];this['setEditableElement'](_0x288752['name'],_0x1461a4),_0x559925['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x238824['attachDomRoot'](_0x1461a4),this['_elementReplacer']['replace'](_0x3d15ee,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x43d814=this['view'],_0x10a7d3=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x10a7d3['detachDomRoot'](_0x43d814['editable']['name']),_0x43d814['destroy']();}_initToolbar(){const _0x3307b3=this['view'];_0x3307b3['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x3307b3['stickyPanel']['limiterElement']=_0x3307b3['element'],_0x3307b3['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x57ac13})=>_0x57ac13),_0x3307b3['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x3307b3['toolbar']);}},si=class extends _0xd98ee5{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x2d4131,_0x1426ee,_0x5cc365={}){super(_0x2d4131),this['stickyPanel']=new at(_0x2d4131),this['toolbar']=new ct(_0x2d4131,{'shouldGroupWhenFull':_0x5cc365['shouldToolbarGroupWhenFull']}),this['_editable']=new _0x356c60(_0x2d4131,_0x1426ee);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const ni=/* #__PURE__ -- @preserve */
30
- _0x34e3e6(_0xb27820);var oi=class extends ni{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x2edc15,_0x1f56f9){super(_0x1f56f9),this['sourceElement']=_0x2edc15,this['model']['document']['createRoot']();const _0x3df2ce=new si(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new ei(this,_0x3df2ce);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x499a0a,_0x35fe56){const _0x208e27=new this(_0x499a0a,_0x35fe56);return await _0x208e27['initPlugins'](),await _0x208e27['ui']['init'](_0x499a0a),await _0x208e27['data']['init'](_0x208e27['config']['get']('initialData')||''),_0x208e27['fire']('ready'),_0x208e27;}};const ri=['RevisionHistoryUI','RestrictedEditingMode'];var ai=class extends _0x245d60{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe85e10){super(_0xe85e10),this['result']='end',_0xe85e10['editing']['view']['_overlayModeHint']='auto',_0xe85e10['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},hi=class extends _0x245d60{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[kt,xt];}constructor(_0x247f29){if(super(_0x247f29),!this['editor']['config']['get']('revisionHistory'))throw new _0xf2df99('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x4aa434=>this['_showRevisionViewer']({..._0x4aa434,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x1d81d6=>this['_closeRevisionViewer'](_0x1d81d6)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x32ed3a=>this['_restoreRevision'](_0x32ed3a)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x3dff0d){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x3dff0d;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x175fe2){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x175fe2);}getRevision(_0xac8f6f){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0xac8f6f);}getRevisions(_0x4681dd){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x4681dd||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x468955=this['editor'],_0x7d6e42=_0x2d7eba(_0x468955,ri),_0x351163=_0x468955['plugins']['get']('RevisionTracker'),_0x84f72e=_0x468955['plugins']['get'](_0x124f7c)['users'];return _0x7d6e42['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x7d6e42['lazyRoots'],(_0x7d6e42['plugins']['push'](ai,Ht,Gt,class RevisionViewerInit extends _0x245d60{static get requires(){return[Ht,_0x124f7c];}init(){const _0x134b22=this['editor']['plugins']['get'](_0x124f7c);for(const _0x3caebc of _0x84f72e)_0x3caebc['isAnonymous']||_0x134b22['getUser'](_0x3caebc['id'])||_0x134b22['addUser'](_0x3caebc);const _0x20708b=_0x351163['repository']['getRevisions']();let _0x3c1d40=null;const _0x26e9e0=this['editor']['plugins']['get']('RevisionViewer');if(_0x26e9e0['adapter']=_0x351163['adapter'],_0x26e9e0['bind']('isEnabled')['to'](_0x351163),_0x468955['plugins']['has']('CommentsRepository')){const _0x1161ac=_0x468955['plugins']['get']('CommentsRepository');_0x26e9e0['_getVisibleCommentThreadIds']=()=>new Set(_0x1161ac['getCommentThreads']()['filter'](_0xca8a70=>!_0xca8a70['isResolved'])['map'](_0xe9cc12=>_0xe9cc12['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x468955,'isReadOnly',_0x3dcd6a=>!_0x3dcd6a);for(const _0x175562 of _0x20708b){const _0x122f78=null===_0x175562['creator'];if(_0x122f78&&_0x175562['toVersion']===_0x175562['fromVersion'])continue;const _0x9de72a=_0x175562['toJSON']();_0x26e9e0['addRevisionData'](_0x9de72a,(_0x5cb904,_0x4fe658,_0x5534a5)=>{if(_0x122f78){if(_0x3c1d40)_0x3c1d40['_update'](_0x5cb904,_0x4fe658);else{if(!_0x4fe658){const _0x227c39=_0x5534a5['toJSON']();_0x227c39['id']=_0x3a243d(),_0x351163['saveRevision'](_0x227c39,_0x5534a5['toVersion'])['then'](_0xba4afa=>{_0x3c1d40=_0xba4afa;});}}}else _0x175562['_update'](_0x5cb904,_0x4fe658);});}}},ti),_0x7d6e42);}['_enhanceShowRevisionViewerCallback'](){const _0x521832=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x4cbf55=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x4cbf55['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x5c8413=this['editor']['plugins']['get']('Dialog');_0x5c8413['isOpen']&&_0x5c8413['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0xc63fb0=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x158687 of _0xc63fb0)_0x158687['class']=_0x158687['class']?_0x158687['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x484574=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x484574&&_0x484574['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x23582d=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x23582d&&_0x23582d['setAttribute']('tabindex','-1');}}const _0x50e061=this['_getRevisionViewerEditorConfig']();return _0x521832(_0x50e061)['then'](_0x2502d3=>(this['_viewerEditor']=_0x2502d3,this['editor']['plugins']['has']('Annotations')&&this['editor']['plugins']['get']('Annotations')['refreshVisibility'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']='none'),_0x2502d3))['catch'](_0x1a46fb=>(console['error'](_0x1a46fb),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x10d584=this['editor']['config']['get']('revisionHistory')['closeRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.closeRevisionViewerCallback',()=>{if(this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']=''),this['editor']['plugins']['has']('AITabs')){const _0x34b9c1=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x3ab3f8 of _0x34b9c1)_0x3ab3f8['class']='ck-tab-panel_disabled'===_0x3ab3f8['class']?'':_0x3ab3f8['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x22bc69=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x22bc69&&_0x22bc69['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x7d90d=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x7d90d&&_0x7d90d['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x10d584(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x4ea41a=this['editor']['plugins']['get']('Annotations');_0x4ea41a['refreshVisibility'](),_0x4ea41a['refreshPositioning']();}});});}['_showRevisionViewer'](_0xf29431){const _0x7bd561=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x165fc7=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x1602c8=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return oi['create'](_0x1602c8,_0xf29431)['then'](_0x2019d2=>(_0x165fc7['style']['display']='block',_0x7bd561['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x2019d2));}['_closeRevisionViewer'](_0x2b911b){const _0x277181=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x277181['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x2b911b['destroy']();}async _restoreRevision(_0x1c3567){const _0x32aeba=this['editor'],_0x368aa2=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x158f4e=_0x32aeba['plugins']['get']('RevisionTracker'),_0x40f132=_0x32aeba['plugins']['get']('RevisionHistoryUtils'),_0x18bb3a=_0x368aa2['repository']['getRevision'](_0x1c3567);let _0x2629e5,_0x3755e9,_0x4c472c;try{await _0x40f132['loadRevisionData'](_0x18bb3a,this['adapter']),_0x2629e5=_0x40f132['getRevisionDocumentData'](_0x18bb3a),_0x3755e9=_0x40f132['getRevisionRootsAttributes'](_0x18bb3a);}catch(_0x266925){return void console['error'](_0x266925);}_0x32aeba['model']['change'](_0x323bce=>{for(const _0x1fecb7 of Array['from'](_0x32aeba['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x323bce['removeMarker'](_0x1fecb7);}),_0x368aa2['isReady']=!0x1,_0x32aeba['model']['enqueueChange'](_0x38b243=>{_0x38b243['setSelection'](null),_0x38b243['removeSelectionAttribute'](_0x32aeba['model']['document']['selection']['getAttributeKeys']());const _0x398249=Object['keys'](_0x2629e5);for(const _0x357703 of _0x32aeba['model']['document']['roots'])'$graveyard'!=_0x357703['rootName']&&_0x357703['isAttached']()&&!_0x398249['includes'](_0x357703['rootName'])&&_0x38b243['detachRoot'](_0x357703);for(const _0x182fc of _0x398249){let _0x59c387=_0x32aeba['model']['document']['getRoot'](_0x182fc);if(!_0x59c387||!_0x59c387['isAttached']()){const _0x19ab08=_0x18bb3a['diffData']?.[_0x182fc]?.['rootElementName']||'$root';_0x59c387=_0x38b243['addRoot'](_0x182fc,_0x19ab08);}const _0x2ad446=_0x3755e9[_0x182fc],_0x481a74=Object['keys'](_0x2ad446),_0x225646=_0x2629e5[_0x182fc];for(const _0x4dc595 of _0x59c387['getAttributeKeys']())_0x481a74['includes'](_0x4dc595)||_0x38b243['removeAttribute'](_0x4dc595,_0x59c387);for(const _0x132e14 of _0x481a74)_0x38b243['setAttribute'](_0x132e14,_0x3755e9[_0x182fc][_0x132e14],_0x59c387);_0x38b243['remove'](_0x38b243['createRangeIn'](_0x59c387)),_0x38b243['insert'](_0x32aeba['data']['parse'](_0x225646,_0x59c387),_0x59c387,0x0);}});const _0x4c5797=Rt(_0x32aeba['locale'],'Restored');if(_0x18bb3a['name'])_0x4c472c=-0x1==_0x18bb3a['name']['indexOf'](_0x4c5797)?_0x4c5797+':\x20'+_0x18bb3a['name']:_0x18bb3a['name'];else _0x4c472c=_0x4c5797+':\x20'+(_0x18bb3a['createdAt']['toLocaleDateString'](_0x32aeba['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x18bb3a['createdAt']['toLocaleTimeString'](_0x32aeba['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x158f4e['saveRevision']({'name':_0x4c472c}),_0x368aa2['isReady']=!0x0,_0x32aeba['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Lt as RestoreRevisionCommand,pt as Revision,hi as RevisionHistory,xt as RevisionHistoryUI,bt as RevisionHistoryUtils,kt as RevisionTracker,Ht as RevisionViewer,oi as RevisionViewerEditor,ai as RevisionViewerIntegration,jt as RevisionViewerLoadingOverlay,Gt as RevisionViewerUI,yt as RevisionsRepository,ti as RevisionsSidebar,Ft as ShowChangeCommand};
29
+ ii();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Ht];}constructor(_0x30deef){super(_0x30deef),this['_revisionViewer']=_0x30deef['plugins']['get'](Ht),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x469a55=this['_revisionsRepository']['_revisions'],_0x4978d7=this['_createRevisionActions'](),_0x2de3ed=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new Zt(this['editor']['locale'],_0x469a55,_0x4978d7,this['editor']['config']['get']('revisionHistory.requireRevisionName'),'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_sidebarView']['on']('revisionSelected',this['_handleRevisionSelected']['bind'](this)),this['_sidebarView']['on']('revisionSetName',this['_handleRevisionSetName']['bind'](this)),this['_sidebarView']['bind']('isEnabled')['to'](this['_revisionViewer']),this['_sidebarView']['timePeriodViews']['on']('add',(_0x503db0,_0x23f42a)=>{_0x23f42a['revisionViews']['on']('add',(_0x161a61,_0x192176)=>{_0x192176['bind']('isEnabled','isReady')['to'](this['_revisionViewer']);});}),this['_sidebarView']['render'](),this['listenTo'](this['editor']['data'],'ready',this['_handleEditorDataReady']['bind'](this)),this['listenTo'](this['_revisionViewer'],'change:diff',this['_handleDiffChange']['bind'](this)),_0x2de3ed['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x4095d5=this['_revisionsRepository']['getRevision'](0x0);if(_0x4095d5){const _0x493ec0=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x4095d5['id']);this['_revisionViewer']['compare'](_0x4095d5,_0x493ec0);}}_handleRevisionSelected(_0x33af78,_0x292e87){const _0x5090ac=this['_revisionsRepository']['getRevision'](_0x292e87['id']),_0x38f790=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x5090ac['id']);this['_revisionViewer']['compare'](_0x5090ac,_0x38f790);}_handleRevisionSetName(_0x207a91,_0x12cd17){this['_revisionsRepository']['getRevision'](_0x12cd17['id'])['setName'](_0x12cd17['name']);}['_handleDiffChange'](_0x19b04f,_0x466a8b,_0x3d7c91){const _0xb54757=this['_revisionsRepository']['getRevisionsInDiff'](_0x3d7c91);_0xb54757['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0xb54757),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0xb54757[0x0]));}_createRevisionActions(){const _0x5119ac=this['editor'],_0x2657e0=RevisionsSidebar['availableRevisionActions'],_0x28fcdc=_0x5119ac['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x28fcdc['length'])return _0x28fcdc['map'](_0x1617db=>{const _0x159a49='string'==typeof _0x1617db?Object['assign']({},_0x2657e0[_0x1617db]):_0x1617db;return _0x159a49['action']=_0x159a49['action']['bind'](this,_0x5119ac),_0x159a49['isVisible']&&(_0x159a49['isVisible']=_0x159a49['isVisible']['bind'](this,_0x5119ac)),_0x159a49;});}};function ii(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x1b2ed1},_0x15dcd8)=>{const _0x17deeb=_0x1b2ed1['get'](Ht),_0x16c9aa=_0x17deeb['repository'];let _0x275d21=_0x17deeb['diff']['newRevisionId'],_0x1ec54a=_0x15dcd8['id'];_0x16c9aa['getIndex'](_0x275d21)>_0x16c9aa['getIndex'](_0x1ec54a)&&([_0x275d21,_0x1ec54a]=[_0x1ec54a,_0x275d21]),_0x17deeb['compare'](_0x275d21,_0x1ec54a);},'isVisible':({plugins:_0x1350e9},_0x53d1f3)=>{const _0x28cd96=_0x1350e9['get'](Ht);return!(_0x28cd96['repository']['getRevisionsInDiff'](_0x28cd96['diff'])['length']>0x2)&&!_0x53d1f3['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x27940a,{id:_0xea4fee})=>{_0x27940a['config']['get']('revisionHistory')['restoreRevisionCallback'](_0xea4fee);},'isVisible':({plugins:_0x448198},_0x1be5cb)=>!!_0x448198['get'](Ht)['repository']['getLaterVisibleRevision'](_0x1be5cb['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x17338e},{id:_0xf7cdf4,revisionNameView:_0x4f50cf})=>{const _0x248f51=_0x17338e['get'](Ht),_0x5d4d55=_0x248f51['repository']['getEarlierVisibleRevision'](_0xf7cdf4);_0x248f51['compare'](_0xf7cdf4,_0x5d4d55),_0x4f50cf['focus'](),_0x4f50cf['fieldView']['select']();}}};}var ei=class extends _0x44fd65{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x1cac97,_0x5c9396){super(_0x1cac97),this['_view']=_0x5c9396,this['_toolbarConfig']=gt(_0x1cac97['config']['get']('toolbar')),this['_elementReplacer']=new _0x501994();}get element(){return this['view']['element'];}init(_0x55add6){const _0x4a95ac=this['editor'],_0x133fbf=this['view'],_0x52182c=_0x4a95ac['editing']['view'],_0xcd60d2=_0x133fbf['editable'];_0xcd60d2['name']=_0x52182c['document']['getRoot']()['rootName'],_0x133fbf['render']();const _0x4f36b8=_0xcd60d2['element'];this['setEditableElement'](_0xcd60d2['name'],_0x4f36b8),_0x133fbf['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x52182c['attachDomRoot'](_0x4f36b8),this['_elementReplacer']['replace'](_0x55add6,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x40a602=this['view'],_0x127899=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x127899['detachDomRoot'](_0x40a602['editable']['name']),_0x40a602['destroy']();}_initToolbar(){const _0x52d525=this['view'];_0x52d525['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x52d525['stickyPanel']['limiterElement']=_0x52d525['element'],_0x52d525['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x48caf7})=>_0x48caf7),_0x52d525['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x52d525['toolbar']);}},si=class extends _0x1c0ab2{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x1cf777,_0x431724,_0x2e3af6={}){super(_0x1cf777),this['stickyPanel']=new at(_0x1cf777),this['toolbar']=new ct(_0x1cf777,{'shouldGroupWhenFull':_0x2e3af6['shouldToolbarGroupWhenFull']}),this['_editable']=new _0x1eb7a0(_0x1cf777,_0x431724);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const ni=/* #__PURE__ -- @preserve */
30
+ _0x32922a(_0x140042);var oi=class extends ni{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x53331d,_0x3e7398){super(_0x3e7398),this['sourceElement']=_0x53331d,this['model']['document']['createRoot']();const _0x3e104f=new si(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new ei(this,_0x3e104f);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x358cd8,_0x3e0fc3){const _0x45aed3=new this(_0x358cd8,_0x3e0fc3);return await _0x45aed3['initPlugins'](),await _0x45aed3['ui']['init'](_0x358cd8),await _0x45aed3['data']['init'](_0x45aed3['config']['get']('initialData')||''),_0x45aed3['fire']('ready'),_0x45aed3;}};const ri=['RevisionHistoryUI','RestrictedEditingMode'];var ai=class extends _0x2dd53f{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf20f34){super(_0xf20f34),this['result']='end',_0xf20f34['editing']['view']['_overlayModeHint']='auto',_0xf20f34['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},hi=class extends _0x2dd53f{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[kt,xt];}constructor(_0x426768){if(super(_0x426768),!this['editor']['config']['get']('revisionHistory'))throw new _0x1f314d('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x39b33e=>this['_showRevisionViewer']({..._0x39b33e,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x294200=>this['_closeRevisionViewer'](_0x294200)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x1f4008=>this['_restoreRevision'](_0x1f4008)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x1cfc1e){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x1cfc1e;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x403719){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x403719);}getRevision(_0x4ce4fc){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x4ce4fc);}getRevisions(_0x496eaf){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x496eaf||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x5823b5=this['editor'],_0x5e98af=_0x5c59b1(_0x5823b5,ri),_0x10e025=_0x5823b5['plugins']['get']('RevisionTracker'),_0x4a5c83=_0x5823b5['plugins']['get'](_0x3002ea)['users'];return _0x5e98af['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x5e98af['lazyRoots'],(_0x5e98af['plugins']['push'](ai,Ht,Gt,class RevisionViewerInit extends _0x2dd53f{static get requires(){return[Ht,_0x3002ea];}init(){const _0x30de57=this['editor']['plugins']['get'](_0x3002ea);for(const _0x55d3df of _0x4a5c83)_0x55d3df['isAnonymous']||_0x30de57['getUser'](_0x55d3df['id'])||_0x30de57['addUser'](_0x55d3df);const _0x43e397=_0x10e025['repository']['getRevisions']();let _0x368871=null;const _0x2a12a3=this['editor']['plugins']['get']('RevisionViewer');if(_0x2a12a3['adapter']=_0x10e025['adapter'],_0x2a12a3['bind']('isEnabled')['to'](_0x10e025),_0x5823b5['plugins']['has']('CommentsRepository')){const _0x58691e=_0x5823b5['plugins']['get']('CommentsRepository');_0x2a12a3['_getVisibleCommentThreadIds']=()=>new Set(_0x58691e['getCommentThreads']()['filter'](_0x5ce51f=>!_0x5ce51f['isResolved'])['map'](_0x38a20d=>_0x38a20d['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x5823b5,'isReadOnly',_0x23584f=>!_0x23584f);for(const _0x33ea7c of _0x43e397){const _0x3d2b45=null===_0x33ea7c['creator'];if(_0x3d2b45&&_0x33ea7c['toVersion']===_0x33ea7c['fromVersion'])continue;const _0xa75a14=_0x33ea7c['toJSON']();_0x2a12a3['addRevisionData'](_0xa75a14,(_0x4719c2,_0x2eb5a0,_0x231349)=>{if(_0x3d2b45){if(_0x368871)_0x368871['_update'](_0x4719c2,_0x2eb5a0);else{if(!_0x2eb5a0){const _0x11f5b5=_0x231349['toJSON']();_0x11f5b5['id']=_0x1cb26b(),_0x10e025['saveRevision'](_0x11f5b5,_0x231349['toVersion'])['then'](_0x3894c7=>{_0x368871=_0x3894c7;});}}}else _0x33ea7c['_update'](_0x4719c2,_0x2eb5a0);});}}},ti),_0x5e98af);}['_enhanceShowRevisionViewerCallback'](){const _0x2e0af8=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x4074f7=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x4074f7['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x39a760=this['editor']['plugins']['get']('Dialog');_0x39a760['isOpen']&&_0x39a760['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x491ff0=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x18a65b of _0x491ff0)_0x18a65b['class']=_0x18a65b['class']?_0x18a65b['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x13bad0=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x13bad0&&_0x13bad0['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x231c54=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x231c54&&_0x231c54['setAttribute']('tabindex','-1');}}const _0x4ce400=this['_getRevisionViewerEditorConfig']();return _0x2e0af8(_0x4ce400)['then'](_0x1f9ed6=>(this['_viewerEditor']=_0x1f9ed6,this['editor']['plugins']['has']('Annotations')&&this['editor']['plugins']['get']('Annotations')['refreshVisibility'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']='none'),_0x1f9ed6))['catch'](_0x51ad90=>(console['error'](_0x51ad90),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x3eb659=this['editor']['config']['get']('revisionHistory')['closeRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.closeRevisionViewerCallback',()=>{if(this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('DocumentOutline')&&(this['editor']['plugins']['get']('DocumentOutlineUI')['view']['element']['style']['display']=''),this['editor']['plugins']['has']('AITabs')){const _0x119923=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x6b8bb3 of _0x119923)_0x6b8bb3['class']='ck-tab-panel_disabled'===_0x6b8bb3['class']?'':_0x6b8bb3['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x547308=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x547308&&_0x547308['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x42def8=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x42def8&&_0x42def8['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x3eb659(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x4b42a6=this['editor']['plugins']['get']('Annotations');_0x4b42a6['refreshVisibility'](),_0x4b42a6['refreshPositioning']();}});});}['_showRevisionViewer'](_0x128e6d){const _0x380e0b=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x456e00=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x4dbf8b=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return oi['create'](_0x4dbf8b,_0x128e6d)['then'](_0x2c2186=>(_0x456e00['style']['display']='block',_0x380e0b['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x2c2186));}['_closeRevisionViewer'](_0x4218be){const _0x19f512=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x19f512['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x4218be['destroy']();}async _restoreRevision(_0xb0725){const _0x39f9cd=this['editor'],_0x50cabb=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0xaf4efd=_0x39f9cd['plugins']['get']('RevisionTracker'),_0x4fb6aa=_0x39f9cd['plugins']['get']('RevisionHistoryUtils'),_0xd169bf=_0x50cabb['repository']['getRevision'](_0xb0725);let _0x1c2655,_0x46aa3b,_0x30a6dd;try{await _0x4fb6aa['loadRevisionData'](_0xd169bf,this['adapter']),_0x1c2655=_0x4fb6aa['getRevisionDocumentData'](_0xd169bf),_0x46aa3b=_0x4fb6aa['getRevisionRootsAttributes'](_0xd169bf);}catch(_0x56a189){return void console['error'](_0x56a189);}_0x39f9cd['model']['change'](_0x3b39d0=>{for(const _0xe782ec of Array['from'](_0x39f9cd['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x3b39d0['removeMarker'](_0xe782ec);}),_0x50cabb['isReady']=!0x1,_0x39f9cd['model']['enqueueChange'](_0x5e0c62=>{_0x5e0c62['setSelection'](null),_0x5e0c62['removeSelectionAttribute'](_0x39f9cd['model']['document']['selection']['getAttributeKeys']());const _0x2a04cd=Object['keys'](_0x1c2655);for(const _0x287c4a of _0x39f9cd['model']['document']['roots'])'$graveyard'!=_0x287c4a['rootName']&&_0x287c4a['isAttached']()&&!_0x2a04cd['includes'](_0x287c4a['rootName'])&&_0x5e0c62['detachRoot'](_0x287c4a);for(const _0x41c6ed of _0x2a04cd){let _0x4dd12b=_0x39f9cd['model']['document']['getRoot'](_0x41c6ed);if(!_0x4dd12b||!_0x4dd12b['isAttached']()){const _0xa7308f=_0xd169bf['diffData']?.[_0x41c6ed]?.['rootElementName']||'$root';_0x4dd12b=_0x5e0c62['addRoot'](_0x41c6ed,_0xa7308f);}const _0x21719f=_0x46aa3b[_0x41c6ed],_0x52fd23=Object['keys'](_0x21719f),_0xb51f8f=_0x1c2655[_0x41c6ed];for(const _0x471520 of _0x4dd12b['getAttributeKeys']())_0x52fd23['includes'](_0x471520)||_0x5e0c62['removeAttribute'](_0x471520,_0x4dd12b);for(const _0x4f3e6e of _0x52fd23)_0x5e0c62['setAttribute'](_0x4f3e6e,_0x46aa3b[_0x41c6ed][_0x4f3e6e],_0x4dd12b);_0x5e0c62['remove'](_0x5e0c62['createRangeIn'](_0x4dd12b)),_0x5e0c62['insert'](_0x39f9cd['data']['parse'](_0xb51f8f,_0x4dd12b),_0x4dd12b,0x0);}});const _0x3a4a1a=Rt(_0x39f9cd['locale'],'Restored');if(_0xd169bf['name'])_0x30a6dd=-0x1==_0xd169bf['name']['indexOf'](_0x3a4a1a)?_0x3a4a1a+':\x20'+_0xd169bf['name']:_0xd169bf['name'];else _0x30a6dd=_0x3a4a1a+':\x20'+(_0xd169bf['createdAt']['toLocaleDateString'](_0x39f9cd['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0xd169bf['createdAt']['toLocaleTimeString'](_0x39f9cd['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0xaf4efd['saveRevision']({'name':_0x30a6dd}),_0x50cabb['isReady']=!0x0,_0x39f9cd['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Lt as RestoreRevisionCommand,pt as Revision,hi as RevisionHistory,xt as RevisionHistoryUI,bt as RevisionHistoryUtils,kt as RevisionTracker,Ht as RevisionViewer,oi as RevisionViewerEditor,ai as RevisionViewerIntegration,jt as RevisionViewerLoadingOverlay,Gt as RevisionViewerUI,yt as RevisionsRepository,ti as RevisionsSidebar,Ft as ShowChangeCommand};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-revision-history",
3
- "version": "48.5.0-alpha.3",
3
+ "version": "48.5.0-alpha.4",
4
4
  "description": "Document revision history feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -34,15 +34,15 @@
34
34
  "./package.json": "./package.json"
35
35
  },
36
36
  "dependencies": {
37
- "@ckeditor/ckeditor5-autosave": "48.5.0-alpha.3",
38
- "@ckeditor/ckeditor5-collaboration-core": "48.5.0-alpha.3",
39
- "@ckeditor/ckeditor5-comments": "48.5.0-alpha.3",
40
- "@ckeditor/ckeditor5-core": "48.5.0-alpha.3",
41
- "@ckeditor/ckeditor5-engine": "48.5.0-alpha.3",
42
- "@ckeditor/ckeditor5-icons": "48.5.0-alpha.3",
43
- "@ckeditor/ckeditor5-ui": "48.5.0-alpha.3",
44
- "@ckeditor/ckeditor5-utils": "48.5.0-alpha.3",
45
- "@ckeditor/ckeditor5-widget": "48.5.0-alpha.3",
37
+ "@ckeditor/ckeditor5-autosave": "48.5.0-alpha.4",
38
+ "@ckeditor/ckeditor5-collaboration-core": "48.5.0-alpha.4",
39
+ "@ckeditor/ckeditor5-comments": "48.5.0-alpha.4",
40
+ "@ckeditor/ckeditor5-core": "48.5.0-alpha.4",
41
+ "@ckeditor/ckeditor5-engine": "48.5.0-alpha.4",
42
+ "@ckeditor/ckeditor5-icons": "48.5.0-alpha.4",
43
+ "@ckeditor/ckeditor5-ui": "48.5.0-alpha.4",
44
+ "@ckeditor/ckeditor5-utils": "48.5.0-alpha.4",
45
+ "@ckeditor/ckeditor5-widget": "48.5.0-alpha.4",
46
46
  "@types/luxon": "3.6.2",
47
47
  "es-toolkit": "1.45.1",
48
48
  "luxon": "3.6.1"