@ckeditor/ckeditor5-revision-history 49.0.0-alpha.8 → 49.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/index.js +7 -7
  2. package/dist/translations/af.umd.js +1 -1
  3. package/dist/translations/ar.umd.js +1 -1
  4. package/dist/translations/ast.umd.js +1 -1
  5. package/dist/translations/az.umd.js +1 -1
  6. package/dist/translations/be.umd.js +1 -1
  7. package/dist/translations/bg.umd.js +1 -1
  8. package/dist/translations/bn.umd.js +1 -1
  9. package/dist/translations/bs.umd.js +1 -1
  10. package/dist/translations/ca.umd.js +1 -1
  11. package/dist/translations/cs.umd.js +1 -1
  12. package/dist/translations/da.umd.js +1 -1
  13. package/dist/translations/de-ch.umd.js +1 -1
  14. package/dist/translations/de.umd.js +1 -1
  15. package/dist/translations/el.umd.js +1 -1
  16. package/dist/translations/en-au.umd.js +1 -1
  17. package/dist/translations/en-gb.umd.js +1 -1
  18. package/dist/translations/en.umd.js +1 -1
  19. package/dist/translations/eo.umd.js +1 -1
  20. package/dist/translations/es-co.umd.js +1 -1
  21. package/dist/translations/es.umd.js +1 -1
  22. package/dist/translations/et.umd.js +1 -1
  23. package/dist/translations/eu.umd.js +1 -1
  24. package/dist/translations/fa.umd.js +1 -1
  25. package/dist/translations/fi.umd.js +1 -1
  26. package/dist/translations/fr.umd.js +1 -1
  27. package/dist/translations/gl.umd.js +1 -1
  28. package/dist/translations/gu.umd.js +1 -1
  29. package/dist/translations/he.umd.js +1 -1
  30. package/dist/translations/hi.umd.js +1 -1
  31. package/dist/translations/hr.umd.js +1 -1
  32. package/dist/translations/hu.umd.js +1 -1
  33. package/dist/translations/hy.umd.js +1 -1
  34. package/dist/translations/id.umd.js +1 -1
  35. package/dist/translations/it.umd.js +1 -1
  36. package/dist/translations/ja.umd.js +1 -1
  37. package/dist/translations/jv.umd.js +1 -1
  38. package/dist/translations/kk.umd.js +1 -1
  39. package/dist/translations/km.umd.js +1 -1
  40. package/dist/translations/kn.umd.js +1 -1
  41. package/dist/translations/ko.umd.js +1 -1
  42. package/dist/translations/ku.umd.js +1 -1
  43. package/dist/translations/lt.umd.js +1 -1
  44. package/dist/translations/lv.umd.js +1 -1
  45. package/dist/translations/ms.umd.js +1 -1
  46. package/dist/translations/nb.umd.js +1 -1
  47. package/dist/translations/ne.umd.js +1 -1
  48. package/dist/translations/nl.umd.js +1 -1
  49. package/dist/translations/no.umd.js +1 -1
  50. package/dist/translations/oc.umd.js +1 -1
  51. package/dist/translations/pl.umd.js +1 -1
  52. package/dist/translations/pt-br.umd.js +1 -1
  53. package/dist/translations/pt.umd.js +1 -1
  54. package/dist/translations/ro.umd.js +1 -1
  55. package/dist/translations/ru.umd.js +1 -1
  56. package/dist/translations/si.umd.js +1 -1
  57. package/dist/translations/sk.umd.js +1 -1
  58. package/dist/translations/sl.umd.js +1 -1
  59. package/dist/translations/sq.umd.js +1 -1
  60. package/dist/translations/sr-latn.umd.js +1 -1
  61. package/dist/translations/sr.umd.js +1 -1
  62. package/dist/translations/sv.umd.js +1 -1
  63. package/dist/translations/th.umd.js +1 -1
  64. package/dist/translations/ti.umd.js +1 -1
  65. package/dist/translations/tk.umd.js +1 -1
  66. package/dist/translations/tr.umd.js +1 -1
  67. package/dist/translations/tt.umd.js +1 -1
  68. package/dist/translations/ug.umd.js +1 -1
  69. package/dist/translations/uk.umd.js +1 -1
  70. package/dist/translations/ur.umd.js +1 -1
  71. package/dist/translations/uz.umd.js +1 -1
  72. package/dist/translations/vi.umd.js +1 -1
  73. package/dist/translations/zh-cn.umd.js +1 -1
  74. package/dist/translations/zh.umd.js +1 -1
  75. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -20,11 +20,11 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{CKEditorError as _0x3aa143,Collection as _0x465b45,ElementReplacer as _0x382013,FocusTracker as _0x15d970,KeystrokeHandler as _0x4c2e20,ObservableMixin as _0x3de40c,ResizeObserver as _0x1c4e44,logWarning as _0x142e95,scrollViewportToShowTarget as _0x3df991,trustedHtml as _0x584809,uid as _0x30d584}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x5026b6,isEqual as _0x56d9bf,set as _0x3b12fd,unset as _0x254ea2}from'es-toolkit/compat';import{Command as _0x299289,Editor as _0x106ed9,ElementApiMixin as _0x26e01a,PendingActions as _0x1f7195,Plugin as _0xc8641b}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x499a42,PillView as _0x281423,Users as _0x1ee77a,getMarkerDomElement as _0x317404,reRootOperation as _0x1879a6,reRootPosition as _0x4ebc80,reRootRange as _0x13a931,sanitizeEditorConfig as _0x4dfb55}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x3bf08d,ModelElement as _0x784835,ModelRange as _0x5eaef2,ModelText as _0x35947c,ViewAttributeElement as _0x2fd0da,ViewContainerElement as _0x45ab41,ViewDocumentFragment as _0x281805,ViewElement as _0x3bf840,ViewEmptyElement as _0x1aa111,ViewRawElement as _0x3ace2e,ViewText as _0x326d1c,ViewUIElement as _0x319d44}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0xbe7fe1,IconChevronUp as _0xfe4f10,IconHistory as _0x36b259,IconSparkle as _0x5f4ca4,IconThreeVerticalDots as _0x35f8f0,IconUndo as _0x492213,IconUser as _0x43403f}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0xc58078,ButtonView as _0x38f053,ContextualBalloon as _0x6c1757,CssTransitionDisablerMixin as _0x596546,EditorUI as _0x337f72,IconView as _0x9832c,InlineEditableUIView as tt,LabeledFieldView as it,ListItemView as et,ListView as st,MenuBarMenuListItemButtonView as nt,MenuBarMenuListItemView as ot,MenuBarMenuListView as rt,MenuBarMenuView as at,StickyPanelView as ht,ToolbarSeparatorView as ct,ToolbarView as lt,UIModel as ut,View as dt,addListToDropdown as ft,createDropdown as vt,createLabeledInputText as gt,normalizeToolbarConfig as mt,submitHandler as _t}from'@ckeditor/ckeditor5-ui';import{DateTime as wt}from'luxon';const pt=/* #__PURE__ -- @preserve */
24
- _0x3de40c();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x26ab6b){super(),this['id']=_0x26ab6b['id']||_0x30d584(),this['creator']=_0x26ab6b['creator']||null,this['authors']=_0x26ab6b['authors']||[],this['diffData']=_0x26ab6b['diffData']||null,this['toVersion']=_0x26ab6b['toVersion']||0x0,this['fromVersion']=_0x26ab6b['fromVersion']||0x0,this['set']('name',_0x26ab6b['name']||''),this['set']('createdAt',_0x26ab6b['createdAt']||new Date()),this['set']('attributes',_0x26ab6b['attributes']||{});}setName(_0x13facd){this['_update']({'name':_0x13facd});}setAttribute(_0x425646,_0x1f4981){const _0x5c1f56=_0x5026b6(this['attributes']);_0x3b12fd(_0x5c1f56,_0x425646,_0x1f4981),this['_update']({'attributes':_0x5c1f56});}removeAttribute(_0x3beb79){const _0x4edf54=_0x5026b6(this['attributes']);_0x254ea2(_0x4edf54,_0x3beb79),this['_update']({'attributes':_0x4edf54});}_update(_0x4841b3,_0x4efffb=!0x1){let _0x518a73=!0x1;const _0x329f45={'id':this['id']};for(const _0x569044 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x3f88bb=_0x4841b3[_0x569044];void 0x0!==_0x3f88bb&&_0x3f88bb!==this[_0x569044]&&(this[_0x569044]=_0x3f88bb,_0x329f45[_0x569044]=_0x3f88bb,_0x518a73=!0x0);}_0x518a73&&(_0x329f45['authors']&&(_0x329f45['authorsIds']=_0x329f45['authors']['map'](_0x523146=>_0x523146['id']),delete _0x329f45['authors']),this['fire']('_update',_0x329f45,_0x4efffb));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x4dfc6=>_0x4dfc6['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0xc8641b{['_revisions'];static get requires(){return[_0x1ee77a];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x1883c7){super(_0x1883c7),this['_revisions']=new _0x465b45();}afterInit(){!async function(_0x3d77b2){const _0x49eee9='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x4073fa=0xeb829,_0x3fe463=0x797b8,_0x15e62c={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0xfe612f(_0x4cbf0c){const _0x15423d=new window['Promise'](_0x5121fc=>{_0x4cbf0c['once']('ready',_0x5121fc);}),_0xa1a30c=window['Date']['now'](),_0xe52c01=_0x4cbf0c['config']['get']('licenseKey');async function _0x49150a(){let _0x4dcd02,_0x2f01f4=null,_0x5751dc=null;try{return'GPL'==_0xe52c01?'NotAllowed':(_0x4dcd02=_0x850fe0(),_0x4dcd02?(_0x4dcd02['usageEndpoint']&&(_0x5751dc=_0x3ba81c(_0x4dcd02['usageEndpoint'],_0x4dcd02['jti'])),await _0x44d192()?_0x23ca66()?_0x4c7d05()?'Expired':_0x193fc6()?('evaluation'==_0x4dcd02['licenseType']&&(_0x2f01f4=_0x2a1d21('EvaluationLimit')),await _0x3bedba()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x4c7d05(){const _0x337ec7=['evaluation','trial']['includes'](_0x4dcd02['licenseType'])?_0xa1a30c/0x3e8:0xe10*_0x3fe463;return _0x4dcd02['exp']<_0x337ec7;}function _0x23ca66(){const _0x51bd5e=_0x4dcd02['features'];if(!_0x51bd5e)return!0x1;if(_0x51bd5e['includes']('*'))return!0x0;if(_0x51bd5e['includes']('RH'))return!0x0;if(_0x51bd5e['includes']('RRH')){if(_0x26261a())return!0x0;if(_0x153354()||_0x547893())return!0x0;}return!0x1;}function _0x193fc6(){const _0x12053d=_0x4dcd02['licensedHosts'];if(!_0x12053d||0x0==_0x12053d['length'])return!0x0;const {hostname:_0x2c2477}=new URL(window['location']['href']);if(_0x12053d['includes'](_0x2c2477))return!0x0;const _0x3267be=_0x2c2477['split']('.');return _0x12053d['filter'](_0x17cf75=>_0x17cf75['includes']('*'))['map'](_0x1b7052=>_0x1b7052['split']('.'))['filter'](_0xb0e024=>_0xb0e024['length']<=_0x3267be['length'])['map'](_0x2d895b=>Array(_0x3267be['length']-_0x2d895b['length'])['fill']('*'===_0x2d895b[0x0]?'*':'')['concat'](_0x2d895b))['some'](_0x3af42c=>_0x3267be['every']((_0x42a8e3,_0x48c9e8)=>_0x3af42c[_0x48c9e8]===_0x42a8e3||'*'===_0x3af42c[_0x48c9e8]));}function _0x3bedba(){return _0x2f01f4&&_0x5751dc?new window['Promise']((_0x5ef33d,_0x3a2c15)=>{_0x2f01f4['then'](_0x5ef33d,_0x3a2c15),_0x5751dc['then'](_0x3be1b3=>{'Valid'!=_0x3be1b3&&_0x5ef33d(_0x3be1b3);},_0x3a2c15);}):_0x2f01f4||_0x5751dc||'Valid';}}function _0x3ba81c(_0x434767,_0x1e426f){return new window['Promise'](_0x1d9d00=>{if(_0x3d185d())return _0x1d9d00('Valid');_0x31745a(),_0x4cbf0c['decorate']('_sendUsageRequest');let _0x321d75=!0x1;const _0x58cec9=_0x30d584();function _0x35dbab(_0x1b8495){return!!_0x1b8495&&('object'==typeof _0x1b8495||'function'==typeof _0x1b8495)&&'function'==typeof _0x1b8495['then']&&'function'==typeof _0x1b8495['catch'];}function _0x3cddf6(_0x10aa7c){_0x18263d(_0x10aa7c)['then'](_0x28ecef=>_0x28ecef&&'ok'==_0x28ecef['status']?_0x58358b(_0x259c73(_0x58cec9+_0x1e426f))!=_0x28ecef['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1c3729=>(_0x2b8d8c(),_0x1c3729),()=>{const _0x4d2264=_0xf00f81();return null==_0x4d2264?(_0x2b8d8c(),'Valid'):_0xa1a30c-_0x4d2264>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1d9d00)['catch'](()=>{_0x1d9d00('UsageLimit');});const _0x4e2651=0x36ee80;function _0x2b8d8c(){const _0x2e923f='llct-'+_0x58358b(_0x259c73(_0x434767)),_0x5ebfe1=_0xb5424(_0x58358b(window['Math']['ceil'](_0xa1a30c/_0x4e2651)));window['localStorage']['setItem'](_0x2e923f,_0x5ebfe1);}function _0xf00f81(){const _0x1110e9='llct-'+_0x58358b(_0x259c73(_0x434767)),_0xe592a0=window['localStorage']['getItem'](_0x1110e9);return _0xe592a0?window['parseInt'](_0xb5424(_0xe592a0),0x10)*_0x4e2651:null;}function _0x18263d(_0x11336d){return new window['Promise']((_0x5d0156,_0x3d72d9)=>{_0x11336d['then'](_0x5d0156,_0x3d72d9),window['setTimeout'](_0x3d72d9,0x1d4c0);});}}_0x4cbf0c['on']('_sendUsageRequest',(_0x8d1e39,_0xb6e08a)=>{if(_0xb6e08a[0x0]!=_0x434767)return _0x1d9d00('UsageLimit');_0xb6e08a[0x1]={..._0xb6e08a[0x1],'requestId':_0x58cec9};},{'priority':'high'}),_0x4cbf0c['on']('_sendUsageRequest',_0x55e5f7=>{_0x35dbab(_0x55e5f7['return'])&&(_0x321d75=!0x0,_0x3cddf6(_0x55e5f7['return']));},{'priority':'low'}),_0x15423d['then'](()=>{_0x321d75||_0x1d9d00('UsageLimit');});});function _0x3d185d(){return'auto'==_0x4cbf0c['editing']['view']['_overlayModeHint'];}function _0x31745a(){_0x4cbf0c['editing']['view']['_overlayModeHint']='auto';}}function _0x2a1d21(_0x505bbf){const _0x289ebe=[new window['Promise'](_0x3582f5=>setTimeout(_0x3582f5,0x93ecc)),_0x15423d['then'](()=>new window['Promise'](_0x1163fe=>{const _0x15c5f3=0x7,_0x2724b2=_0x3d77b2['_revisions'];function _0xf8f282(){_0x2724b2['length']>=_0x15c5f3&&_0x1163fe();}_0xf8f282(),_0x2724b2['on']('add',_0xf8f282);})),new window['Promise'](_0x223f27=>{function _0x1e505c(){for(const _0x1613bf in window)if(window['Number']['isNaN'](window['Number'](_0x1613bf))&&window[_0x1613bf]==_0x4073fa)return _0x223f27();'destroyed'!=_0x4cbf0c['state']&&window['setTimeout'](_0x1e505c,0x1388);}_0x53546e('RevisionViewer')&&_0x1e505c();})];return window['Promise']['race'](_0x289ebe)['then'](()=>_0x505bbf);}async function _0x57d8cb(){if(await _0x15423d,_0x53546e('RevisionViewer')){const _0x2c6788=_0x3d77b2['getRevision'](0x0),_0x2dc638=_0x3d77b2['getEarlierVisibleRevision'](_0x2c6788['id']),_0x10af56=_0x3060ab('RevisionViewer');return await _0x10af56['compare'](_0x2c6788['id'],_0x2dc638?_0x2dc638['id']:null,!0x0),_0x10af56['unbind']('isEnabled'),_0x10af56['isEnabled']=!0x1,_0x10af56['compare']=_0x5b8283,void(_0x10af56['_getDiff']=_0x5b8283);}if(_0x53546e('RevisionTracker')){const _0x27ff2a=_0x3060ab('RevisionTracker');_0x27ff2a['unbind']('isEnabled'),_0x27ff2a['isEnabled']=!0x1,_0x27ff2a['update']=_0x5b8283,_0x27ff2a['saveRevision']=_0x5b8283;}_0x4cbf0c['model']['change']=_0x5b8283,_0x4cbf0c['model']['enqueueChange']=_0x5b8283,_0x4cbf0c['enableReadOnlyMode']('model');}function _0x26261a(){return _0x53546e('WebSocketGateway')&&'connected'==_0x3060ab('WebSocketGateway')['state'];}function _0x153354(){return _0x53546e('RevisionViewerIntegration');}function _0x547893(){return _0x53546e('TrackChangesDataGetter');}function _0x339084(_0x318f3e){const _0x13a69c=_0x4c5538();_0x4cbf0c[_0x13a69c]='revisionHistoryLicenseKey'+_0x318f3e,_0x318f3e['endsWith']('Limit')&&(window[_0x4c5538()]=_0x4073fa),'Valid'!=_0x318f3e&&_0x57d8cb();}function _0x4c5538(){const _0x192a95=window['String'](window['performance']['now']())['replace']('.','');let _0x3fa434='N';for(let _0x1e5919=0x0;_0x1e5919<_0x192a95['length'];_0x1e5919+=0x2){let _0xd9b395=window['parseInt'](_0x192a95['substring'](_0x1e5919,_0x1e5919+0x2));_0xd9b395>=0x3e&&(_0xd9b395-=0x3e),_0x3fa434+=_0x49eee9[_0xd9b395];}return _0x3fa434;}function _0x850fe0(){const _0x4525db=_0xe52c01['split']('.');if(0x3!=_0x4525db['length'])return null;return _0x23fe36(_0x4525db[0x1]);function _0x23fe36(_0x386a49){const _0x364894=_0xa3cf72(_0x386a49);return _0x364894&&_0x574ce6()?_0x364894:null;function _0x574ce6(){const _0x4af07c=_0x364894['jti'],_0xe8155a=window['parseInt'](_0x4af07c['substring'](_0x4af07c['length']-0x8),0x10),_0x236257={..._0x364894,'jti':_0x4af07c['substring'](0x0,_0x4af07c['length']-0x8)};return delete _0x236257['vc'],_0x259c73(_0x236257)==_0xe8155a;}}}async function _0x44d192(){let _0x72ab54=!0x0;try{const [_0x2f48cc,_0x1fac07,_0x33e7ae]=_0xe52c01['split']('.');return _0x5ad64f(_0x2f48cc),await _0x4f7ecc(_0x2f48cc,_0x1fac07,_0x33e7ae),_0x72ab54;}catch{return!0x1;}function _0x5ad64f(_0x5bf83d){const _0x3cbe6c=_0xa3cf72(_0x5bf83d);_0x3cbe6c&&'ES256'==_0x3cbe6c['alg']||(_0x72ab54=!0x1);}async function _0x4f7ecc(_0x2f2381,_0x3f5b6b,_0x9dc275){const _0x32ac37=window['Uint8Array']['from'](_0x1dc1bf(_0x9dc275),_0x1e9026=>_0x1e9026['charCodeAt'](0x0)),_0x532534=new window['TextEncoder']()['encode'](_0x2f2381+'.'+_0x3f5b6b),_0x3175ad=window['crypto']['subtle'];if(!_0x3175ad)return;const _0x28272d=await _0x3175ad['importKey']('jwk',_0x15e62c,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3175ad['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x28272d,_0x32ac37,_0x532534)||(_0x72ab54=!0x1);}}function _0xa3cf72(_0x475128){return _0x475128['startsWith']('ey')?JSON['parse'](_0x1dc1bf(_0x475128)):null;}function _0x1dc1bf(_0x1cfef4){return window['atob'](_0x1cfef4['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x259c73(_0x342d36){let _0x3ce435=0x1505;function _0x532863(_0x325caa){for(let _0x34bfd7=0x0;_0x34bfd7<_0x325caa['length'];_0x34bfd7++){const _0x4815ec=_0x325caa['charCodeAt'](_0x34bfd7);_0x3ce435=(_0x3ce435<<0x5)+_0x3ce435+_0x4815ec,_0x3ce435&=_0x3ce435;}}function _0x49fe49(_0x2b51c3){Array['isArray'](_0x2b51c3)?_0x2b51c3['forEach'](_0x49fe49):_0x2b51c3&&'object'==typeof _0x2b51c3?Object['entries'](_0x2b51c3)['sort']()['forEach'](([_0xe9784c,_0x5a6b5b])=>{_0x532863(_0xe9784c),_0x49fe49(_0x5a6b5b);}):_0x532863(window['String'](_0x2b51c3));}return _0x49fe49(_0x342d36),_0x3ce435>>>0x0;}function _0x58358b(_0xace139){return _0xace139['toString'](0x10)['padStart'](0x8,'0');}function _0xb5424(_0x2eaf1c){return _0x2eaf1c['split']('')['reverse']()['join']('');}function _0x53546e(_0x344c5d){return _0x4cbf0c['plugins']['has'](_0x344c5d);}function _0x3060ab(_0x2a9b5a){return _0x4cbf0c['plugins']['get'](_0x2a9b5a);}function _0x5b8283(){}_0x339084(await _0x49150a());}_0xfe612f(_0x3d77b2['editor']);}(this);}createRevision(_0x1937dd){const _0x2731a7=this['editor']['plugins']['get']('Users');return new yt({'id':_0x1937dd['id'],'name':_0x1937dd['name'],'creator':_0x1937dd['creatorId']?_0x2731a7['getUser'](_0x1937dd['creatorId']):null,'diffData':_0x1937dd['diffData']||_0x1937dd['data'],'authors':_0x1937dd['authorsIds']['map'](_0x2454d3=>_0x2731a7['getUser'](_0x2454d3)),'createdAt':new Date(_0x1937dd['createdAt']),'attributes':_0x1937dd['attributes'],'fromVersion':_0x1937dd['fromVersion'],'toVersion':_0x1937dd['toVersion']});}['addRevision'](_0x1a3786,_0x29c893=0x0){this['_revisions']['add'](_0x1a3786,_0x29c893);}getRevision(_0x19ebd4){return this['_revisions']['get'](_0x19ebd4);}getRevisions(_0x12ba13={'toJSON':!0x1}){const _0x4416eb=Array['from'](this['_revisions']);return _0x4416eb['reverse'](),_0x12ba13['toJSON']?_0x4416eb['map'](_0x51ffeb=>_0x51ffeb['toJSON']()):_0x4416eb;}getIndex(_0x3f6386){return this['_revisions']['getIndex'](_0x3f6386);}getEarlierVisibleRevision(_0x3a2300){const [,_0x250bf8]=this['getRevisionsIterator'](_0x3a2300,{'direction':'earlier'});return _0x250bf8;}getLaterVisibleRevision(_0x27e603){const [,_0xe6954f]=this['getRevisionsIterator'](_0x27e603,{'direction':'later'});return _0xe6954f;}getRevisionsInDiff(_0x40e62a){const _0x414e51=[];for(const _0x112791 of this['getRevisionsIterator'](_0x40e62a['newRevisionId']))if(_0x414e51['push'](_0x112791),_0x112791['id']===_0x40e62a['oldRevisionId'])break;return _0x414e51;}*getRevisionsIterator(_0x25ef4f,{direction:_0x13e667='earlier',filter:_0x360b85=()=>!0x0}={}){const _0x23aeeb='earlier'===_0x13e667?0x1:-0x1;let _0x17d702=this['_revisions']['get'](_0x25ef4f),_0x36e70b=this['getIndex'](_0x17d702);for(yield _0x17d702;_0x17d702;){if(_0x36e70b+=_0x23aeeb,_0x17d702=this['getRevision'](_0x36e70b),!_0x17d702)return;_0x360b85(_0x17d702)&&(yield _0x17d702);}}},Rt=class extends _0xc8641b{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x45ab41,'c'],[_0x2fd0da,'a'],[_0x1aa111,'e'],[_0x3ace2e,'r'],[_0x319d44,'u']]);_typeCharToViewClass=new Map([['c',_0x45ab41],['a',_0x2fd0da],['e',_0x1aa111],['r',_0x3ace2e],['u',_0x319d44]]);async loadRevisionData(_0x2d2691,_0x1e2a57){if(_0x2d2691['diffData']||!_0x1e2a57)return;const _0x3d81b3=this['editor']['config']['get']('collaboration.channelId');_0x2d2691['diffData']=(await _0x1e2a57['getRevision']({'channelId':_0x3d81b3,'revisionId':_0x2d2691['id']}))['diffData'];}getRevisionDocumentData(_0xf517ef){const _0x38fb73={};for(const _0xb83875 in _0xf517ef['diffData']){if(_0xf517ef['diffData'][_0xb83875]['attachChange']&&!_0xf517ef['diffData'][_0xb83875]['attachChange']['isAttached'])continue;const _0x1a594f=this['_removeRevisionMarkers'](JSON['parse'](_0xf517ef['diffData'][_0xb83875]['insertions'])),_0x35662f=this['editor']['editing']['view']['document'],_0x51d933=new _0x281805(_0x35662f,_0x1a594f['map'](_0x5da751=>this['_getViewFromDiffObj'](_0x5da751,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x38fb73[_0xb83875]=this['editor']['data']['processor']['toData'](_0x51d933),this['editor']['data']['processor']['useFillerType']('default');}return _0x38fb73;}getRevisionRootsAttributes(_0x1eafe5){const _0x2c02fd={};for(const _0x2cd4c6 in _0x1eafe5['diffData'])_0x1eafe5['diffData'][_0x2cd4c6]['attachChange']&&!_0x1eafe5['diffData'][_0x2cd4c6]['attachChange']['isAttached']||(_0x2c02fd[_0x2cd4c6]=_0x1eafe5['diffData'][_0x2cd4c6]['attributesAfter']||{});return _0x2c02fd;}getRevisionRootsModelElements(_0x251f2d){const _0x365633={};for(const _0x8d1c7a in _0x251f2d['diffData']){if(_0x251f2d['diffData'][_0x8d1c7a]['attachChange']&&!_0x251f2d['diffData'][_0x8d1c7a]['attachChange']['isAttached'])continue;const _0x3e47dd=_0x251f2d['diffData'][_0x8d1c7a]['rootElementName'];_0x3e47dd&&(_0x365633[_0x8d1c7a]=_0x3e47dd);}return _0x365633;}_getTypeCharForViewElement(_0x2dd363){return this['_viewClassToTypeChar']['get'](_0x2dd363['constructor']);}_getViewFromDiffObj(_0x83635,_0x22cd90){const _0x4e0f29=this['editor']['editing']['view']['document'];if('string'==typeof _0x83635)return new _0x326d1c(_0x4e0f29,_0x83635);{let _0x1e6401,_0x9c082d;_0x9c082d='u'==_0x83635['type']||'r'==_0x83635['type']?[]:_0x83635['children']['map'](_0x257722=>this['_getViewFromDiffObj'](_0x257722,_0x22cd90));const _0x1f1b8b=this['_typeCharToViewClass']['get'](_0x83635['type'])||_0x3bf840,_0x5b6889=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x1e6401=new _0x1f1b8b(_0x4e0f29,_0x83635['name'],_0x83635['attributes'],_0x9c082d),'u'==_0x83635['type']&&_0x83635['children'][0x0]){const _0x4b04de=_0x83635['children'][0x0];if(_0x1e6401['render']=function(_0x576e12){const _0x14fcba=_0x576e12['createElement']('div');return _0x14fcba['innerHTML']=_0x584809(_0x4b04de),_0x14fcba['childNodes'][0x0];},_0x22cd90){const _0x232879=new _0x281805(_0x4e0f29);_0x232879['_appendChild'](_0x1e6401);const _0x21c1a4=Array['from'](_0x5b6889['viewChildrenToDom'](_0x232879,{'bind':!0x1})),_0x49bebf=_0x5b6889['domDocument']['createElement']('div');_0x49bebf['append'](..._0x21c1a4),_0x1e6401=Array['from'](_0x5b6889['domChildrenToView'](_0x49bebf))[0x0];}}else{if('r'==_0x83635['type']&&_0x83635['children'][0x0]){const _0x477183=_0x83635['children'][0x0];if(_0x1e6401['render']=function(_0x20fda8){_0x20fda8['innerHTML']=_0x584809(_0x477183);},_0x22cd90){const _0x39da51=new _0x281805(_0x4e0f29);_0x39da51['_appendChild'](_0x1e6401);const _0x43d7bf=Array['from'](_0x5b6889['viewChildrenToDom'](_0x39da51,{'bind':!0x1})),_0x559b09=_0x5b6889['domDocument']['createElement']('div');_0x559b09['append'](..._0x43d7bf);const _0x44e61c=Array['from'](_0x5b6889['domChildrenToView'](_0x559b09));_0x44e61c['length']>0x1?_0x1e6401['_appendChild'](_0x44e61c):_0x1e6401=_0x44e61c[0x0];}}}if(_0x83635['customProperties']){for(const [_0x3d3b2d,_0x1862d8]of _0x83635['customProperties'])_0x1e6401['_setCustomProperty'](_0x3d3b2d,_0x1862d8);}const _0xd02ff1=void 0x0===_0x83635['fillerOffset']?null:_0x83635['fillerOffset'];return null!==_0xd02ff1&&(_0x1e6401['getFillerOffset']=()=>_0xd02ff1),_0x1e6401;}}_makeModelFromViewString(_0x14d0f6,_0x3cc7a0){const _0x5f477b=JSON['parse'](_0x14d0f6),_0x9da561=this['editor']['editing']['view']['document'],_0x34f2c7=new _0x281805(_0x9da561,_0x5f477b['map'](_0x47eb09=>this['_getViewFromDiffObj'](_0x47eb09,!0x0))),_0x358f76=this['editor']['data']['toModel'](_0x34f2c7,_0x3cc7a0);return _0x358f76['name']=_0x3cc7a0,_0x358f76;}['_removeRevisionMarkers'](_0x5bf2b1){return(_0x5bf2b1=_0x5bf2b1['filter'](_0x63c48d=>!_0x63c48d['name']||'revision-start'!==_0x63c48d['name']&&'revision-end'!==_0x63c48d['name']))['forEach'](_0x39f3ca=>{'string'!=typeof _0x39f3ca&&(_0x39f3ca['children']=this['_removeRevisionMarkers'](_0x39f3ca['children']),_0x39f3ca['attributes']=_0x39f3ca['attributes']['filter'](_0x181874=>!_0x181874[0x0]['startsWith']('data-revision-')));}),_0x5bf2b1;}};function kt(_0x29061a,_0x34c572,_0x5b2772){const t=_0x29061a['t'];switch(_0x34c572){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'},_0x5b2772);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x5b2772);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'},_0x5b2772);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x5b2772);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x5b2772);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0xc8641b{['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[_0x1ee77a,bt,Rt,_0x1f7195];}constructor(_0x2559d9){super(_0x2559d9),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new It(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x20a675=_0x30d584();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x20a675},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 _0xec8786=this['repository']['getRevision'](0x0),_0x2ca557=_0xec8786&&null===_0xec8786['creator']?_0xec8786:null;if(this['_continueCurrentRevision']=!!_0x2ca557&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x1363ba=this['_source']['getCurrentRevisionId'](),_0x18bd44=this['repository']['getRevision'](_0x1363ba);if(_0x18bd44)this['_startingVersion']=_0x18bd44['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x14a64f=this['_source']['history']['_operations']['find'](_0x2dd22f=>!_0x2dd22f['_isInit']),_0x2dfff3=_0x14a64f?_0x14a64f['baseVersion']:this['_source']['history']['version'];_0xec8786?(_0xec8786['toVersion']<_0x2dfff3&&_0xec8786['_update']({'toVersion':_0x2dfff3}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x2ca557['id'],this['_startingVersion']=_0x2ca557['fromVersion']):(this['_startingVersion']=_0xec8786['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x2dfff3,this['_continueCurrentRevision']=!0x1);}}else _0x2ca557&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x2ca557['toVersion'],this['editor']['model']['document']['history']['version']),_0x2ca557['fromVersion']===_0x2ca557['toVersion']?(0x0!==_0x2ca557['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x2ca557['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x2ca557['id'],this['_startingVersion']=_0x2ca557['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',_0x3804b3=>!_0x3804b3),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x159ded=[this['editor']];for(const _0x4a8909 of _0x159ded){let _0x4daca2;for(const _0x22e7a8 in _0x4a8909){const _0x122020=_0x22e7a8,_0x20934b=_0x4a8909[_0x122020];if('revisionHistoryLicenseKeyValid'==_0x20934b||'revisionHistoryLicenseKeyInvalid'==_0x20934b||'revisionHistoryLicenseKeyExpired'==_0x20934b||'revisionHistoryLicenseKeyDomainLimit'==_0x20934b||'revisionHistoryLicenseKeyNotAllowed'==_0x20934b||'revisionHistoryLicenseKeyEvaluationLimit'==_0x20934b||'revisionHistoryLicenseKeyUsageLimit'==_0x20934b){delete _0x4a8909[_0x122020],_0x4daca2=_0x20934b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x4daca2&&_0x4a8909['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x4daca2&&_0x4a8909['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x4daca2&&_0x4a8909['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x4daca2&&_0x4a8909['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x4daca2&&_0x4a8909['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x4daca2&&_0x4a8909['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x5340ed=this['repository']['getRevision'](0x0),_0x3e401c=await this['getRevisionDocumentData'](_0x5340ed),_0x26d905=await this['getRevisionRootsAttributes'](_0x5340ed),_0x58a47d=this['_utils']['getRevisionRootsModelElements'](_0x5340ed);this['_replaceEditorDataWithRevisionData'](_0x3e401c,_0x26d905,_0x58a47d);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x2c7551){this['_source']=_0x2c7551;}async update(){const _0x581ecb=await this['_source']['getLatestVersion']();if(_0x581ecb>this['currentRevision']['toVersion']){await this['_loadState']();const _0x3a7554=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x581ecb});_0x3a7554['authors']=_0x3a7554['authorsIds']['map'](_0x3148f3=>this['editor']['plugins']['get']('Users')['getUser'](_0x3148f3)),this['currentRevision']['_update'](_0x3a7554);}}async['saveRevision'](_0x33aa72={},_0x2d1abf=null){const _0x40c41b=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x2d1abf>this['currentRevision']['toVersion']&&(_0x2d1abf=null),null===_0x2d1abf&&(_0x2d1abf=await this['_source']['getLatestVersion']());const _0x715c7b=this['_getFromVersion'](_0x2d1abf),_0xab9758=this['buildRevisionData']({'from':_0x715c7b,'to':_0x2d1abf});if(this['currentRevision']['toVersion']<_0x2d1abf){const _0x4a9c45=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x2d1abf,'to':_0x2d1abf});_0x4a9c45['authors']=[],_0x4a9c45['authorsIds']=[],_0x4a9c45['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x4a9c45,!0x0),delete _0x4a9c45['authors'],_0x40c41b['push'](_0x4a9c45);}const _0x5636f9={..._0x33aa72,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x33aa72['name']||null,'id':_0x33aa72['id']||_0x30d584(),..._0xab9758,'attributes':{..._0x33aa72['attributes'],..._0xab9758['attributes']}},_0x4f5701=this['addRevisionData'](_0x5636f9);_0x40c41b['push'](_0x5636f9);const _0x30d848=this['repository']['getIndex'](_0x4f5701);if(0x0!==_0x30d848){const _0x57692d=this['repository']['getRevision'](_0x30d848-0x1);if(_0x57692d['fromVersion']!==_0x2d1abf){const _0x62a098=this['_revisionDataBuilder']['getData'](_0x2d1abf,_0x57692d['toVersion']),_0x2945ef={'id':_0x57692d['id'],'diffData':_0x62a098['diffData'],'authorsIds':_0x62a098['authorsIds'],'authors':_0x62a098['authorsIds']['map'](_0x1c10a2=>this['editor']['plugins']['get']('Users')['getUser'](_0x1c10a2)),'fromVersion':_0x2d1abf};this['_stampAiAttribute'](_0x2945ef,_0x57692d,!!_0x62a098['hasAIChanges']),_0x57692d===this['currentRevision']&&(_0x2945ef['createdAt']=new Date(_0x5636f9['createdAt']['getTime']()+0xa)),_0x57692d['_update'](_0x2945ef,!0x0),delete _0x2945ef['authors'],_0x40c41b['push'](_0x2945ef);}}if(this['adapter']){for(const _0x11296f of _0x40c41b)this['_bufferUpdate'](_0x11296f['id'],_0x11296f,!0x0);this['sendBufferedUpdates']();}return _0x4f5701;}addRevisionData(_0x15309c){const _0x2c50e6=this['repository']['createRevision'](_0x15309c);return this['adapter']&&_0x2c50e6['on']('_update',(_0x4faa4b,_0x1fb4b5,_0x25fd44)=>{_0x25fd44||(this['_bufferUpdate'](_0x1fb4b5['id'],_0x1fb4b5,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x2c50e6,this['_findInsertionIndex'](_0x2c50e6)),_0x2c50e6;}async getRevisionDocumentData(_0x404f40){return await this['_utils']['loadRevisionData'](_0x404f40,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x404f40);}async getRevisionRootsAttributes(_0x14f7c3){return await this['_utils']['loadRevisionData'](_0x14f7c3,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x14f7c3);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x20efa6=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x35f7aa=0x0;_0x35f7aa<_0x20efa6['length'];_0x35f7aa++){const _0x1cbe28=_0x20efa6[_0x35f7aa];let _0x3f54e7=!0x1;for(const _0x1828a3 of Object['keys'](_0x1cbe28))void 0x0===_0x1cbe28[_0x1828a3]?delete _0x1cbe28[_0x1828a3]:'id'!==_0x1828a3&&(_0x3f54e7=!0x0);_0x3f54e7||(_0x20efa6[_0x35f7aa]=null);}if(_0x20efa6=_0x20efa6['filter'](_0x4cd0bf=>null!==_0x4cd0bf),!_0x20efa6['length'])return;for(let _0x3862ae=0x0;_0x3862ae<_0x20efa6['length'];_0x3862ae++){const _0x59f776=_0x20efa6[_0x3862ae];void 0x0!==_0x59f776['fromVersion']&&void 0x0===_0x59f776['toVersion']&&(_0x59f776['toVersion']=this['repository']['getRevision'](_0x59f776['id'])['toVersion']),void 0x0!==_0x59f776['toVersion']&&void 0x0===_0x59f776['fromVersion']&&(_0x59f776['fromVersion']=this['repository']['getRevision'](_0x59f776['id'])['fromVersion']);}const _0x11263a=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x20efa6,_0x11263a)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x243206=>{if(_0x243206){for(const _0x3f6dc3 of _0x243206)this['setRevisionData']({'id':_0x3f6dc3['id'],'createdAt':_0x3f6dc3['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x33c150,_0x56842e,_0x55f4fc){if(_0x55f4fc===(!!_0x56842e&&!!_0x56842e['attributes']['@ai']))return;const _0x28302f={..._0x56842e?_0x56842e['attributes']:{},..._0x33c150['attributes']};_0x55f4fc?_0x28302f['@ai']=!0x0:delete _0x28302f['@ai'],_0x33c150['attributes']=_0x28302f;}buildRevisionData({revision:_0x1eb24d=null,from:_0x393873=null,to:_0xdba5e2=null}){_0x393873=null!==_0x393873?_0x393873:_0x1eb24d['fromVersion'],_0xdba5e2=null!==_0xdba5e2?_0xdba5e2:_0x1eb24d['toVersion'];const _0x1b09e2=this['_revisionDataBuilder']['getData'](_0x393873,_0xdba5e2),_0x535c20={'diffData':_0x1b09e2['diffData'],'authorsIds':_0x1b09e2['authorsIds'],'fromVersion':_0x393873,'toVersion':_0xdba5e2};if(this['_stampAiAttribute'](_0x535c20,_0x1eb24d,!!_0x1b09e2['hasAIChanges']),!_0x1eb24d||_0xdba5e2!==_0x1eb24d['toVersion']){const _0x25c0ac=_0xdba5e2-0x1,_0x1151ad=this['_source']['history']['getOperation'](_0x25c0ac);_0x535c20['createdAt']=_0x1151ad&&_0x1151ad['createdAt']||new Date();}if(this['_loadedStateData']&&_0x393873===this['_loadedStateData']['fromVersion']){for(const _0x14924b of this['_loadedStateData']['authors'])_0x535c20['authorsIds']['includes'](_0x14924b['id'])||_0x535c20['authorsIds']['push'](_0x14924b['id']);}return _0x535c20;}_bufferUpdate(_0xacd789,_0xa6a4c7,_0x2ffd28){if(this['_bufferedUpdates']['has'](_0xacd789)){const _0x332d7b=this['_bufferedUpdates']['get'](_0xacd789);_0xa6a4c7=_0x2ffd28?{..._0x332d7b,..._0xa6a4c7}:{..._0xa6a4c7,..._0x332d7b};}this['_bufferedUpdates']['set'](_0xacd789,_0xa6a4c7);}setRevisionData(_0x5e566a){const _0x246b90=this['repository']['getRevision'](_0x5e566a['id']);if(_0x5e566a['createdAt']&&(_0x5e566a['createdAt']=new Date(_0x5e566a['createdAt'])),_0x5e566a['authorsIds']){const _0x20dbed=this['editor']['plugins']['get']('Users');_0x5e566a['authors']=_0x5e566a['authorsIds']['map'](_0x5e50ae=>_0x20dbed['getUser'](_0x5e50ae));}_0x246b90['_update'](_0x5e566a,!0x0);}_createInitialRevision(_0x39c562){const _0x5b1669=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x5b1669)this['_initialRevisionId']=_0x5b1669['id'];else{const _0x52d2d0=!this['editor']['model']['document']['roots']['find'](_0x332088=>this['editor']['model']['hasContent'](_0x332088)),_0x37b999=this['editor']['plugins']['get']('Users')['me']['id'],_0x1c3a15=kt(this['editor']['locale'],_0x52d2d0?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x39c562,'to':_0x39c562,'id':this['_initialRevisionId'],'name':_0x1c3a15,'creatorId':_0x37b999});}}_createCurrentRevision(_0x413f7a){const _0x478c7e=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x478c7e),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x413f7a,'to':_0x413f7a,'id':_0x478c7e,'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(_0x9251ae,_0x26aed8,_0x5569e4){const _0x118ca6={},_0x1dd4f5={},_0x584a55={},_0x2c5162=this['editor']['config']['get']('roots')||{};for(const [_0x5bf9bb,_0x416c9f]of Object['entries'](_0x2c5162))_0x416c9f['lazyLoad']||(_0x118ca6[_0x5bf9bb]=_0x416c9f['initialData']??'',_0x1dd4f5[_0x5bf9bb]=_0x416c9f['modelAttributes']||{},_0x416c9f['modelElement']&&(_0x584a55[_0x5bf9bb]=_0x416c9f['modelElement']));for(const _0x484f6c of this['editor']['model']['document']['getRootNames']())_0x118ca6[_0x484f6c]??='',_0x1dd4f5[_0x484f6c]??={};let _0x262a9f=!0x1;const _0x387c6a=Object['keys'](_0x118ca6),_0x32b7ba=Object['keys'](_0x9251ae);for(const _0x4175e3 of _0x387c6a){if(_0x118ca6[_0x4175e3]!==_0x9251ae[_0x4175e3]&&''!==_0x118ca6[_0x4175e3]['trim']()){_0x262a9f=!0x0;break;}if(!_0x56d9bf(_0x1dd4f5[_0x4175e3],_0x26aed8[_0x4175e3])&&Object['keys'](_0x1dd4f5[_0x4175e3])['length']>0x0){_0x262a9f=!0x0;break;}const _0x11b9c2=_0x584a55[_0x4175e3],_0x42c295=_0x5569e4[_0x4175e3];if(_0x11b9c2&&_0x42c295&&_0x11b9c2!==_0x42c295){_0x262a9f=!0x0;break;}}_0x262a9f||(_0x262a9f=_0x32b7ba['some'](_0x22efb3=>!this['editor']['model']['document']['getRoot'](_0x22efb3))),_0x262a9f&&_0x142e95('editor-initial-data-replaced-with-revision-data',{'editorData':_0x118ca6,'editorRootsAttributes':_0x1dd4f5,'editorRootsModelElements':_0x584a55,'revisionData':_0x9251ae,'revisionRootsAttributes':_0x26aed8,'revisionRootsModelElements':_0x5569e4});for(const [_0x2b8091,_0xf4286d]of Object['entries'](_0x9251ae))this['editor']['config']['set']('roots.'+_0x2b8091+'.initialData',_0xf4286d);for(const [_0x5f1859,_0x10b99b]of Object['entries'](_0x26aed8))this['editor']['config']['set']('roots.'+_0x5f1859+'.modelAttributes',_0x10b99b);const _0x4b233a=this['editor']['model']['document'];for(const [_0x3d019b,_0x1926a1]of Object['entries'](_0x5569e4)){this['editor']['config']['set']('roots.'+_0x3d019b+'.modelElement',_0x1926a1);const _0x9db2d3=_0x4b233a['getRoot'](_0x3d019b);_0x9db2d3&&_0x9db2d3['name']!==_0x1926a1&&(_0x4b233a['roots']['remove'](_0x3d019b),_0x4b233a['createRoot'](_0x1926a1,_0x3d019b));}}_addPendingAction(){if(!this['_pendingAction']){const _0x2b65e8=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x2b65e8['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x3c62cd){const _0xd7a93=this['repository']['getRevisions']();_0xd7a93['reverse']();let _0x419c6f=0x0;for(;_0x419c6f<_0xd7a93['length'];){const _0x4d7720=_0xd7a93[_0x419c6f];if(_0x4d7720===this['currentRevision']){_0x419c6f++;continue;}if(_0x4d7720['id']===this['_initialRevisionId'])break;const _0x4d2ee7=_0x3c62cd['toVersion']-_0x4d7720['toVersion']||_0x3c62cd['fromVersion']-_0x4d7720['fromVersion'];if(_0x4d2ee7>0x0)break;if(_0x4d2ee7<0x0)_0x419c6f++;else{if(!_0x3c62cd['creator']&&_0x4d7720['creator'])break;if(_0x4d7720['creator']||!_0x3c62cd['creator']){if(_0x3c62cd['createdAt']>_0x4d7720['createdAt'])break;_0x419c6f++;}else _0x419c6f++;}}return _0x419c6f;}_getFromVersion(_0xddb096){const _0x4f2e90=this['repository']['getRevisions']();_0x4f2e90['reverse'](),_0x4f2e90['shift']();const _0x57b3b2=_0x4f2e90['find'](_0x4614f6=>_0x4614f6['toVersion']<=_0xddb096)['toVersion'];return _0x57b3b2<this['_startingVersion']?this['_startingVersion']:_0x57b3b2;}['_makeRevision']({name:_0x1193f5,from:_0x3b04b5,to:_0x19c923,creatorId:_0x4f0571,id:_0x3eaebb}){const _0x4bb21d=this['buildRevisionData']({'from':_0x3b04b5,'to':_0x19c923});_0x4bb21d['name']=_0x1193f5,_0x4bb21d['creatorId']=_0x4f0571,_0x4bb21d['id']=_0x3eaebb;const _0x3c488f=this['addRevisionData'](_0x4bb21d);return this['adapter']&&this['_bufferUpdate'](_0x4bb21d['id'],_0x4bb21d,!0x0),_0x3c488f;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},It=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x2b1f0b){this['editor']=_0x2b1f0b,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(_0x2f84a1){this['source']=_0x2f84a1;const _0x35b5a1=new Map(),_0x291411=new Map(),_0x48e5dd=this['editor']['model']['document']['roots']['map'](_0x363510=>_0x363510['rootName']);for(const _0x41c340 of _0x48e5dd){const _0x46a8f6=this['editor']['model']['document']['getRoot'](_0x41c340),_0x586a60=St(_0x46a8f6);_0x35b5a1['set'](_0x41c340,_0x586a60),_0x291411['set'](_0x41c340,Object['fromEntries'](_0x46a8f6['getAttributes']()));}const _0x4f8a2f=Array['from'](this['editor']['model']['markers'])['map'](_0x3ca6d3=>[_0x3ca6d3['name'],_0x3ca6d3['getRange']()]),_0x291458=this['source']['version'];this['_saveMetaData'](_0x291458,_0x35b5a1,_0x4f8a2f,_0x291411),this['_startingRevisionId']=this['_revisionId'];const _0x46b903=new Map(),_0x302a27=new Map();for(const _0x3a6027 of _0x48e5dd){const _0x25df89=Et(_0x3a6027,this['editor']['model']['document']['getRoot'](_0x3a6027)['name']);_0x46b903['set'](_0x3a6027,_0x25df89),_0x302a27['set'](_0x3a6027,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x46b903,[],_0x302a27);}getData(_0x37d699,_0x35aee8){if(this['_lastFrom']===_0x37d699&&this['_lastTo']<=_0x35aee8)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x35aee8,!0x0);else{if(!this['_savedMetaData']['has'](_0x37d699)){const _0x46d7bf=this['_getPreviousFrom'](_0x37d699);this['_calculateMetaData'](_0x46d7bf,_0x37d699,!0x1);}this['_calculateMetaData'](_0x37d699,_0x35aee8,!0x0);}return this['_lastFrom']=_0x37d699,this['_lastTo']=_0x35aee8,this['_getState']();}loadState(_0x15fdda){if(!this['_savedMetaData']['has'](_0x15fdda['fromVersion'])){const _0x3ab8cc=this['_getPreviousFrom'](_0x15fdda['fromVersion']);this['_calculateMetaData'](_0x3ab8cc,_0x15fdda['fromVersion'],!0x1);}this['_calculateMetaData'](_0x15fdda['fromVersion'],_0x15fdda['toVersion'],!0x1);const _0x5a6e86=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x15fdda['fromVersion'],this['_lastTo']=_0x15fdda['toVersion'];for(const _0x30deeb in _0x15fdda['diffData']){const _0x3ae218=_0x15fdda['diffData'][_0x30deeb]['attachChange'],_0x1957fd=_0x5026b6(_0x15fdda['diffData'][_0x30deeb]['attributesBefore'])||{},_0x58e60f=_0x15fdda['diffData'][_0x30deeb],_0x34a0e3=_0x5a6e86['_makeModelFromViewString'](_0x58e60f['deletions'],_0x58e60f['rootElementName']||'$root');_0x34a0e3['rootName']=_0x30deeb,_0x34a0e3['_isAttached']=!_0x3ae218||!_0x3ae218['isAttached'],_0x34a0e3['isAttached']=()=>_0x34a0e3['_isAttached'],this['_baseRoots']['set'](_0x30deeb,_0x34a0e3),this['_baseRootsAttributes']['set'](_0x30deeb,_0x1957fd),_0x3ae218&&this['_touchedRoots']['set'](_0x30deeb,_0x3ae218);const _0x419953=this['_makeIdsRoot'](_0x34a0e3);this['_baseIdsRoots']['set'](_0x30deeb,_0x419953);for(const [_0x318308,_0x49c309]of _0x34a0e3['markers']){if(!_0x318308['startsWith']('revision:'))continue;const _0x2be411=_0x318308['split'](':')[0x2],_0x56100f=_0x58e60f['aiSources']?.[_0x318308]||null;for(const _0x6e7ba1 of _0x49c309['getWalker']({'singleCharacters':!0x0})){const _0x200b7d=this['_getVidAttributeName'](_0x6e7ba1),_0x4751e4='elementEnd'==_0x6e7ba1['type']?_0x6e7ba1['previousPosition']['path']['slice'](0x0,-0x1):_0x6e7ba1['previousPosition']['path'],_0x4916eb=_0x419953['getNodeByPath'](_0x4751e4)['getAttribute'](_0x200b7d);this['_touched']['set'](_0x4916eb,{'userId':_0x2be411,'aiSource':_0x56100f});}_0x34a0e3['markers']['delete'](_0x318308);}}this['_startingRevisionId']=this['_revisionId'];const _0xe84bb5=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x55edf5=>!this['_touched']['has'](_0x55edf5));let _0x48440a=0x0;const _0x5cdf8d=new Map();for(const _0x14b39b in _0x15fdda['diffData']){const _0x6010d4=_0x15fdda['diffData'][_0x14b39b]['attachChange'],_0x13e8fd=_0x5026b6(_0x15fdda['diffData'][_0x14b39b]['attributesAfter'])||{},_0x45c167=_0x15fdda['diffData'][_0x14b39b],_0x156804=_0x5a6e86['_makeModelFromViewString'](_0x45c167['insertions'],_0x45c167['rootElementName']||'$root');_0x156804['rootName']=_0x14b39b,_0x156804['_isAttached']=!_0x6010d4||_0x6010d4['isAttached'],_0x156804['isAttached']=()=>_0x156804['_isAttached'],this['_diffRoots']['set'](_0x14b39b,_0x156804),this['_diffRootsAttributes']['set'](_0x14b39b,_0x13e8fd);const _0x4b6575=this['_makeIdsRoot'](_0x156804,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x14b39b,_0x4b6575),_0x5cdf8d['set'](_0x14b39b,_0x156804['isAttached']()?_0x13e8fd:{});for(const [_0x14842e,_0x24d1c9]of _0x156804['markers']){if(!_0x14842e['startsWith']('revision:'))continue;const _0x915726=_0x14842e['split'](':')[0x2],_0xe616af=_0x45c167['aiSources']?.[_0x14842e]||null;for(const _0x4dd2d5 of _0x24d1c9['getWalker']({'singleCharacters':!0x0})){const _0x55a98f=this['_getVidAttributeName'](_0x4dd2d5),_0x1af382=this['_revisionId']++,_0x1082d4='elementEnd'==_0x4dd2d5['type']?_0x4dd2d5['previousPosition']['path']['slice'](0x0,-0x1):_0x4dd2d5['previousPosition']['path'];_0x4b6575['getNodeByPath'](_0x1082d4)['_setAttribute'](_0x55a98f,_0x1af382),this['_touched']['set'](_0x1af382,{'userId':_0x915726,'aiSource':_0xe616af});}_0x156804['markers']['delete'](_0x14842e);}for(const _0x43a4f5 of this['editor']['model']['createRangeIn'](_0x156804)['getWalker']({'singleCharacters':!0x0})){const _0x5c0f11=this['_getVidAttributeName'](_0x43a4f5),_0x5d5379='elementEnd'==_0x43a4f5['type']?_0x43a4f5['previousPosition']['path']['slice'](0x0,-0x1):_0x43a4f5['previousPosition']['path'],_0x53523b=_0x4b6575['getNodeByPath'](_0x5d5379);_0x53523b['getAttribute'](_0x5c0f11)>0x0||_0x53523b['_setAttribute'](_0x5c0f11,_0xe84bb5[_0x48440a++]);}for(const [_0x12b521,_0x3bf9a0]of _0x156804['markers'])_0x12b521['startsWith']('revision:')||this['_markers']['set'](_0x12b521,_0x3bf9a0);}const {roots:_0x4939ea}=this['_savedMetaData']['get'](_0x15fdda['fromVersion']),{roots:_0x19ad02}=this['_savedMetaData']['get'](_0x15fdda['toVersion']),_0x410487=St(_0x4939ea['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x410487),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x410487,Number['NEGATIVE_INFINITY']));const _0x1f3e66=St(_0x19ad02['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x1f3e66),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x1f3e66));const _0x8cc235=Array['from'](this['_diffRoots'])['map'](([_0x31212b,_0x1fdf05])=>[_0x31212b,St(_0x1fdf05)]);this['_saveMetaData'](this['_lastTo'],_0x8cc235,this['_markers'],_0x5cdf8d);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x94023d,_0x5323ef,_0x182c25,_0x8d45c7){const _0x1dd6e9=new Map(_0x5323ef),_0xf4b6ff=new Map(_0x5026b6(_0x8d45c7)),_0x4fc7a5=new Map();for(const [_0x227d12,_0x452bbd]of _0x182c25)_0x4fc7a5['set'](_0x227d12,{'start':_0x452bbd['start']['clone'](),'end':_0x452bbd['end']['clone'](),'rootName':_0x452bbd['root']['rootName']});this['_savedMetaData']['set'](_0x94023d,{'roots':_0x1dd6e9,'markers':_0x4fc7a5,'rootsAttributes':_0xf4b6ff});}_removeMetaData(_0x588590){this['_savedMetaData']['delete'](_0x588590);}_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(_0x1a2af7,_0x4075ff=null){let _0x1ac37d=null;_0x1a2af7['is']('documentFragment')||(_0x1ac37d=new _0x784835(_0x1a2af7['name'],{'vid_start':null===_0x4075ff?this['_revisionId']++:_0x4075ff++}));const _0x2855f1=[];for(const _0x14b448 of _0x1a2af7['getChildren']())if(_0x14b448['is']('element')){_0x2855f1['push'](this['_makeIdsRoot'](_0x14b448,_0x4075ff));const _0x41230b=_0x2855f1[_0x2855f1['length']-0x1];null!==_0x4075ff&&(_0x4075ff=_0x41230b['is']('element','$text')?_0x41230b['getAttribute']('vid')+0x1:_0x41230b['getAttribute']('vid_end')+0x1);}else{for(let _0x405bee=0x0;_0x405bee<_0x14b448['offsetSize'];_0x405bee++)_0x2855f1['push'](new _0x784835('$text',{'vid':null===_0x4075ff?this['_revisionId']++:_0x4075ff++}));}if(_0x1a2af7['is']('documentFragment')){const _0x77acf1=Et(_0x1a2af7['rootName'],_0x1a2af7['name']);return _0x77acf1['_insertChild'](0x0,_0x2855f1),_0x77acf1;}return _0x1ac37d['_setAttribute']('vid_end',null===_0x4075ff?this['_revisionId']++:_0x4075ff),_0x1ac37d['_insertChild'](0x0,_0x2855f1),_0x1ac37d;}_calculateMetaData(_0x23f65b,_0x47d9f5,_0x1520ce){this['_reset']();const {roots:_0x6eb614,markers:_0x46d82a,rootsAttributes:_0x6f49ee}=this['_savedMetaData']['get'](_0x23f65b);this['_baseRoots']=new Map(_0x6eb614),this['_baseRootsAttributes']=new Map(_0x5026b6(_0x6f49ee));for(const [_0x27f560,_0x7002af]of this['_baseRoots'])if('$graveyard'!==_0x27f560&&(this['_diffRoots']['set'](_0x27f560,St(_0x7002af)),this['_diffRootsAttributes']=new Map(_0x5026b6(_0x6f49ee)),_0x1520ce)){const _0x38e47e=this['_revisionId'];this['_idsRoots']['set'](_0x27f560,this['_makeIdsRoot'](_0x7002af)),this['_baseIdsRoots']['set'](_0x27f560,this['_makeIdsRoot'](_0x7002af,_0x38e47e));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x1520ce&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x4a018c,_0x45900e]of _0x46d82a){const _0x489be9=this['_baseRoots']['get'](_0x45900e['rootName']),_0x2cb886=this['_diffRoots']['get'](_0x45900e['rootName']),_0x31604a=new _0x5eaef2(_0x4ebc80(_0x45900e['start'],_0x489be9),_0x4ebc80(_0x45900e['end'],_0x489be9)),_0x1a1f60=_0x13a931(_0x31604a,_0x2cb886);_0x489be9['markers']['set'](_0x4a018c,_0x31604a),this['_markers']['set'](_0x4a018c,_0x1a1f60);}this['_applyOperations'](_0x23f65b,_0x47d9f5,_0x1520ce);}_applyOperations(_0xa6e85a,_0x53193a,_0x1c67aa){for(const _0x5402ef of this['source']['getOperations'](_0xa6e85a,_0x53193a))this['_handleOperation'](_0x5402ef,_0x1c67aa);for(const _0x4af486 of this['_diffRoots']['values']())_0x4af486['markers']['clear']();for(const [_0x111a1c,_0x33e44b]of this['_markers'])this['_diffRoots']['get'](_0x33e44b['root']['rootName'])['markers']['set'](_0x111a1c,_0x33e44b['clone']());const _0x1e9949=new Map(),_0x2ff6c2=new Map();for(const [_0x52f494,_0x3f4433]of this['_diffRoots'])_0x1e9949['set'](_0x52f494,St(_0x3f4433)),_0x2ff6c2['set'](_0x52f494,this['_diffRootsAttributes']['get'](_0x52f494));this['_saveMetaData'](_0x53193a,_0x1e9949,this['_markers'],_0x2ff6c2);}_getPreviousFrom(_0xdbb55e){const _0x35e68d=Array['from'](this['_savedMetaData']['keys']());_0x35e68d['sort']((_0x3830e7,_0x579224)=>_0x3830e7-_0x579224),_0x35e68d['reverse']();for(const _0x3358aa of _0x35e68d)if(_0x3358aa<_0xdbb55e)return _0x3358aa;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x1d62ba,_0xf492fa){const _0x376f94=Array['from'](_0xf492fa['markers'])['map'](([_0x15b634,_0x44237a])=>[_0x15b634,_0x13a931(_0x44237a,_0x1d62ba)]);_0x1d62ba['markers']=new Map(_0x376f94);}_transformMarkers(_0x44319d){for(const _0x5c0ddb of this['_markers']['values']()){const _0x21851c=_0x5c0ddb['getTransformedByOperation'](_0x44319d),_0x368c6c=_0x5eaef2['_createFromRanges'](_0x21851c);_0x5c0ddb['start']=_0x368c6c['start'],_0x5c0ddb['end']=_0x368c6c['end'];}}_handleOperation(_0x393e3a,_0x24dd42){if('addRoot'!=_0x393e3a['type']&&'detachRoot'!=_0x393e3a['type']){if('insert'==_0x393e3a['type']){const _0x1c2139=_0x393e3a['position']['root'],_0x3ea3cb=_0x1c2139['rootName'],_0x53e37f=_0x1c2139['name'];this['_diffRoots']['has'](_0x3ea3cb)||(this['_diffRoots']['set'](_0x3ea3cb,Et(_0x3ea3cb,_0x53e37f,!0x0)),this['_diffRootsAttributes']['set'](_0x3ea3cb,{}),_0x24dd42&&this['_idsRoots']['set'](_0x3ea3cb,Et(_0x3ea3cb,_0x53e37f,!0x0)));}else{if('addRootAttribute'==_0x393e3a['type']||'removeRootAttribute'==_0x393e3a['type']||'changeRootAttribute'==_0x393e3a['type'])return void this['_handleRootAttributeOperation'](_0x393e3a);'marker'==_0x393e3a['type']&&this['_handleMarkerOperation'](_0x393e3a);}if('marker'!==_0x393e3a['type']){const _0x1bbd63=this['_cloneOperation'](_0x393e3a,this['_diffRoots']);_0x1bbd63['_execute'](),this['_transformMarkers'](_0x1bbd63);}if(_0x24dd42)switch(_0x393e3a['type']){case'insert':this['_handleInsertOperation'](_0x393e3a);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x393e3a);break;case'merge':this['_handleMergeOperation'](_0x393e3a);break;case'split':this['_handleSplitOperation'](_0x393e3a);}}else this['_handleRootOperation'](_0x393e3a,_0x24dd42);}_cloneOperation(_0x474b65,_0x46679e){const _0x3d4b48=_0x474b65['clone']();return _0x3d4b48['_authorId']=_0x474b65['_authorId'],_0x3d4b48['_aiSource']=_0x474b65['_aiSource'],_0x3d4b48['baseVersion']=null,_0x1879a6(_0x3d4b48,_0x46679e),_0x3d4b48;}_getBaseVids(_0x102fbe){return _0x102fbe['map'](_0x57bef4=>{const _0x21fde3=this['_getVidAttributeName'](_0x57bef4);return Number(_0x57bef4['item']['getAttribute'](_0x21fde3));});}_generateTape(_0x313ea6,_0x2edab0){if(_0x313ea6['is']('element','$text'))_0x2edab0['push']({'item':_0x313ea6,'type':'text'});else{_0x313ea6['is']('element')&&_0x2edab0['push']({'item':_0x313ea6,'type':'elementStart'});for(const _0x48e08d of _0x313ea6['getChildren']())this['_generateTape'](_0x48e08d,_0x2edab0);_0x313ea6['is']('element')&&_0x2edab0['push']({'item':_0x313ea6,'type':'elementEnd'});}return _0x2edab0;}_getState(){const _0x559e87=new Map(this['_touched']),_0x6cdcee=new Map(_0x559e87),_0x1ec3a5=new Map(),_0x1eaf45={'insertions':{},'deletions':{}},_0x56bfec={'insertions':{},'deletions':{}},_0x20e4e0=new Map(),_0xde3a2e=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x12fa88=new Map();_0xde3a2e['delete']('$graveyard');for(const _0x1475d1 of _0xde3a2e){const _0xc6a64a=(this['_diffRoots']['get'](_0x1475d1)??this['_baseRoots']['get'](_0x1475d1))['name'],_0x24eef1=this['_diffRoots']['get'](_0x1475d1)||Et(_0x1475d1,_0xc6a64a,!0x1),_0x2a3c81=this['_baseRoots']['get'](_0x1475d1)||Et(_0x1475d1,_0xc6a64a,!0x1);_0x24eef1['isAttached']()||_0x2a3c81['isAttached']()?(_0x12fa88['set'](_0x1475d1,_0xc6a64a),_0x1eaf45['insertions'][_0x1475d1]=St(_0x24eef1),_0x1eaf45['deletions'][_0x1475d1]=St(_0x2a3c81),this['_copyMarkers'](_0x1eaf45['deletions'][_0x1475d1],_0x2a3c81),this['_copyMarkers'](_0x1eaf45['insertions'][_0x1475d1],_0x24eef1),_0x56bfec['insertions'][_0x1475d1]=this['_generateTape'](this['_idsRoots']['get'](_0x1475d1),[]),_0x56bfec['deletions'][_0x1475d1]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x1475d1)||Et(_0x1475d1,_0xc6a64a,!0x1),[])):_0xde3a2e['delete'](_0x1475d1);}for(const _0x118a1a of _0xde3a2e){const _0x1eabd1=_0x56bfec['insertions'][_0x118a1a];for(const _0x23a2ab of _0x1eabd1){const _0x1c2c24=this['_getVidAttributeName'](_0x23a2ab),_0x264393=_0x23a2ab['item']['getAttribute'](_0x1c2c24);_0x6cdcee['delete'](_0x264393),_0x264393>=this['_startingRevisionId']&&_0x1ec3a5['set'](_0x264393,_0x559e87['get'](_0x264393));}}for(const _0x2a9333 of _0xde3a2e){const _0x493724=_0x56bfec['insertions'][_0x2a9333],_0x5a2a27=this['_getBaseVids'](_0x56bfec['deletions'][_0x2a9333]);let _0x4afaf7=0x0;for(const _0x3f41de of _0x493724){const _0x44cc1e=this['_getVidAttributeName'](_0x3f41de),_0x3a50cf=_0x3f41de['item']['getAttribute'](_0x44cc1e);if(!_0x1ec3a5['has'](_0x3a50cf)&&!_0x20e4e0['has'](_0x3a50cf)){if(_0x6cdcee['has'](_0x3a50cf))_0x4afaf7++;else{if(_0x3a50cf!=_0x5a2a27[_0x4afaf7]){const _0x19a07e=_0x559e87['get'](_0x3a50cf)||_0x559e87['get'](_0x5a2a27[_0x4afaf7]);for(;_0x3a50cf!=_0x5a2a27[_0x4afaf7];)_0x6cdcee['has'](_0x5a2a27[_0x4afaf7])||(_0x20e4e0['set'](_0x5a2a27[_0x4afaf7],_0x19a07e),_0x559e87['set'](_0x5a2a27[_0x4afaf7],_0x19a07e)),_0x4afaf7++;}_0x4afaf7++;}}}}for(const _0x324f24 of _0xde3a2e){const _0x4e7d90=_0x56bfec['insertions'][_0x324f24];for(const _0x378e4a of _0x4e7d90){const _0x3cd009=this['_getVidAttributeName'](_0x378e4a),_0x3818ed=_0x378e4a['item']['getAttribute'](_0x3cd009);if(_0x20e4e0['has'](_0x3818ed)){const _0x10e62a=_0x20e4e0['get'](_0x3818ed);_0x6cdcee['has'](_0x3818ed)||_0x6cdcee['set'](_0x3818ed,{..._0x10e62a}),_0x1ec3a5['set'](_0x3818ed,{..._0x10e62a});}}}for(const _0x43befe of _0x6cdcee['keys']())_0x43befe>=this['_startingRevisionId']&&_0x6cdcee['delete'](_0x43befe);const _0x32bc69=new Map();for(const _0x5feb09 of _0xde3a2e){let _0x10ab4e=_0x56bfec['insertions'][_0x5feb09];for(const _0x5d0677 of _0x10ab4e)if(_0x5d0677['item']['is']('element','tableCell')){const _0x123fee=this['_getVidAttributeName'](_0x5d0677),_0x1562cc=_0x5d0677['item']['getAttribute'](_0x123fee);if(_0x1ec3a5['has'](_0x1562cc)){const _0x24c099=_0x5d0677['item']['parent']['parent']['getAttribute']('vid_start'),_0xa25c08=_0x1ec3a5['get'](_0x1562cc),_0x1f7a99=_0x32bc69['get'](_0x24c099)||{'users':new Set(),'aiSource':null};_0x1f7a99['users']['add'](_0xa25c08['userId']),_0x1f7a99['aiSource']=_0x1f7a99['aiSource']||_0xa25c08['aiSource']||null,_0x32bc69['set'](_0x24c099,_0x1f7a99);}}_0x10ab4e=_0x56bfec['deletions'][_0x5feb09];for(const _0x470e85 of _0x10ab4e)if(_0x470e85['item']['is']('element','tableCell')){const _0x5154c6=this['_getVidAttributeName'](_0x470e85),_0x132c03=_0x470e85['item']['getAttribute'](_0x5154c6);if(_0x6cdcee['has'](_0x132c03)){const _0x526f60=_0x470e85['item']['parent']['parent']['getAttribute']('vid_start'),_0x31c26f=_0x6cdcee['get'](_0x132c03),_0x4176bf=_0x32bc69['get'](_0x526f60)||{'users':new Set(),'aiSource':null};_0x4176bf['users']['add'](_0x31c26f['userId']),_0x4176bf['aiSource']=_0x4176bf['aiSource']||_0x31c26f['aiSource']||null,_0x32bc69['set'](_0x526f60,_0x4176bf);}}for(const _0x5655f3 of _0x32bc69['keys']())(_0x1ec3a5['has'](_0x5655f3)||_0x6cdcee['has'](_0x5655f3))&&_0x32bc69['delete'](_0x5655f3);}for(const _0xab6805 of _0xde3a2e){const _0x9c882c=_0x56bfec['insertions'][_0xab6805];let _0xa538f8=null,_0x157fa3=null,_0x168d4c=null;for(const _0x4ac166 of _0x9c882c){const _0x573a7d=this['_getVidAttributeName'](_0x4ac166),_0x53f66a=_0x4ac166['item']['getAttribute'](_0x573a7d),_0x34ccdc=_0x32bc69['get'](_0x53f66a);if(_0x34ccdc&&'elementStart'==_0x4ac166['type']&&(_0xa538f8=Array['from'](_0x34ccdc['users'])[0x0],_0x157fa3=_0x34ccdc['aiSource'],_0x168d4c=_0x4ac166['item']['getAttribute']('vid_end')),_0xa538f8){const _0x527882=_0x157fa3||_0x6cdcee['get'](_0x53f66a)?.['aiSource']||null,_0x5cc678=_0x157fa3||_0x1ec3a5['get'](_0x53f66a)?.['aiSource']||null;_0x6cdcee['set'](_0x53f66a,{'userId':_0xa538f8,'aiSource':_0x527882}),_0x1ec3a5['set'](_0x53f66a,{'userId':_0xa538f8,'aiSource':_0x5cc678});}_0x53f66a==_0x168d4c&&(_0xa538f8=null,_0x168d4c=null);}}const _0x156834={},_0x42c471=new Set();for(const _0x460c4d of _0xde3a2e){const _0x45a5ec=_0x1eaf45['deletions'][_0x460c4d],_0x13a110=_0x1eaf45['insertions'][_0x460c4d];for(const {userId:_0x4d2d93}of this['_touchedMarkers']['values']())null!==_0x4d2d93&&_0x42c471['add'](_0x4d2d93);for(const {userId:_0xfe7793}of this['_touchedRoots']['values']())null!==_0xfe7793&&_0x42c471['add'](_0xfe7793);const _0x324e35={};this['_markChanges'](_0x13a110,_0x56bfec['insertions'][_0x460c4d],_0x1ec3a5,'insertion',_0x42c471,_0x324e35),this['_markChanges'](_0x45a5ec,_0x56bfec['deletions'][_0x460c4d],_0x6cdcee,'deletion',_0x42c471,_0x324e35),this['_collectSuggestionAiSources'](_0x13a110,_0x324e35),this['_collectSuggestionAiSources'](_0x45a5ec,_0x324e35),_0x156834[_0x460c4d]={'insertions':this['_prepareViewToSave'](_0x13a110),'deletions':this['_prepareViewToSave'](_0x45a5ec),'attachChange':this['_touchedRoots']['get'](_0x460c4d)||null,'attributesBefore':_0x5026b6(this['_baseRootsAttributes']['get'](_0x460c4d))||{},'attributesAfter':_0x5026b6(this['_diffRootsAttributes']['get'](_0x460c4d)),'rootElementName':_0x12fa88['get'](_0x460c4d),'aiSources':_0x324e35};}const _0x1ef3cf=Array['from'](_0x1ec3a5['values']())['some'](_0x52c816=>!(!_0x52c816||!_0x52c816['aiSource']))||Array['from'](_0x6cdcee['values']())['some'](_0x554319=>!(!_0x554319||!_0x554319['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x4ebeb0=>this['_aiTouchedMarkers']['has'](_0x4ebeb0));return{'diffData':_0x156834,'authorsIds':Array['from'](_0x42c471),'hasAIChanges':_0x1ef3cf};}_collectSuggestionAiSources(_0x21fce9,_0x5696b5){const _0x2fd766=_0x21fce9['markers'];for(const _0x5215dd of _0x2fd766['keys']()){if(!_0x5215dd['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x5215dd))continue;const _0x28f8fe=this['_aiTouchedMarkers']['get'](_0x5215dd);_0x28f8fe&&(_0x5696b5[_0x5215dd]=_0x28f8fe);}}_processRootBeforeSave(_0x3741c8){for(const [,_0x12944b]of _0x3741c8['markers']){const _0x4b70fc=_0x12944b['start']['getAncestors']()['filter'](_0x5c7df5=>'tableCell'==_0x5c7df5['name']);for(const _0x504f9f of _0x4b70fc)0x1==_0x504f9f['childCount']&&_0x504f9f['getChild'](0x0)['is']('element','paragraph')&&_0x504f9f['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x4e1c1a){this['_processRootBeforeSave'](_0x4e1c1a);const _0x2a9666=this['editor']['data']['toView'](_0x4e1c1a,{}),_0x1bcb9c=Array['from'](_0x2a9666['getChildren']())['map'](_0x309bfb=>this['_getViewJson'](_0x309bfb));return JSON['stringify'](_0x1bcb9c);}_getViewJson(_0x2febf4){if(_0x2febf4['is']('$text'))return _0x2febf4['data'];{const _0x3d48a4=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x33f03b=_0x2febf4,_0x386e37=this['editor']['data']['htmlProcessor']['domConverter'],_0x253ac3={'type':_0x3d48a4['_getTypeCharForViewElement'](_0x33f03b),'name':_0x33f03b['name'],'attributes':Array['from'](_0x33f03b['getAttributes']()),'children':Array['from'](_0x33f03b['getChildren']())['map'](_0x3d2147=>this['_getViewJson'](_0x3d2147))};if(_0x2febf4['is']('uiElement')&&'$comment'!=_0x2febf4['name']){const _0x1562f9=_0x2febf4['render'](_0x386e37['domDocument'],_0x386e37);_0x253ac3['children']['push'](_0x1562f9['outerHTML']);}else{if(_0x2febf4['is']('rawElement')){const _0x5011e7=_0x386e37['domDocument']['createElement'](_0x33f03b['name']);_0x2febf4['render'](_0x5011e7,_0x386e37),_0x253ac3['children']['push'](_0x5011e7['innerHTML']);}}const _0x3f61ab=Array['from'](_0x33f03b['getCustomProperties']());_0x3f61ab['length']>0x0&&(_0x253ac3['customProperties']=_0x3f61ab);const _0x2d863a=_0x33f03b['getFillerOffset']();return null!==_0x2d863a&&(_0x253ac3['fillerOffset']=_0x2d863a),_0x253ac3;}}['_markChanges'](_0x4293a0,_0x117e8e,_0x41474c,_0xb6b8f0,_0x1d0ced,_0x1d17eb){let _0x6a5494=null,_0x4368a0=null,_0x3a3b32=0x0;const _0xa42e37=this['editor']['model'];for(let _0x20ee12=0x0;_0x20ee12<_0x117e8e['length'];_0x20ee12++){const _0x490144=this['_getVidAttributeName'](_0x117e8e[_0x20ee12]),_0x5f352a=_0x117e8e[_0x20ee12]['item']['getAttribute'](_0x490144),_0x5be16c=_0x41474c['get'](_0x5f352a),_0x591271=_0x20ee12==_0x117e8e['length']-0x1;!_0x6a5494&&_0x5be16c&&(_0x6a5494=_0x5be16c,_0x4368a0=_0x117e8e[_0x20ee12]);const _0x39cfba=!!_0x6a5494&&!!_0x5be16c&&_0x5be16c['userId']!=_0x6a5494['userId'],_0x3d08d4=!!_0x6a5494&&!!_0x5be16c&&_0x5be16c['aiSource']!=_0x6a5494['aiSource'];_0x6a5494&&(!_0x5be16c||_0x39cfba||_0x3d08d4)&&(_0x979ff9(_0x5be16c,Ot(_0x4368a0,_0x4293a0,_0xa42e37),Ot(_0x117e8e[_0x20ee12],_0x4293a0,_0xa42e37)),_0x6a5494=_0x5be16c||null,_0x4368a0=_0x5be16c?_0x117e8e[_0x20ee12]:null),_0x6a5494&&_0x591271&&_0x979ff9(_0x5be16c,Ot(_0x4368a0,_0x4293a0,_0xa42e37),Ct(_0x117e8e[_0x20ee12],_0x4293a0,_0xa42e37));}function _0x979ff9(_0x27aba2,_0x1a3495,_0x440f5c){const _0x3c5412=_0x6a5494['userId'],_0xd38bbd=_0x6a5494['aiSource'],_0x1a5330='revision:'+_0xb6b8f0+':'+_0x3c5412+':'+_0x3a3b32++,_0x2fafdb=_0xa42e37['createRange'](_0x1a3495,_0x440f5c);_0x4293a0['markers']['set'](_0x1a5330,_0x2fafdb),_0xd38bbd&&(_0x1d17eb[_0x1a5330]=_0xd38bbd),null!==_0x3c5412&&_0x1d0ced['add'](_0x3c5412);}}_getVidAttributeName(_0x2d553f){switch(_0x2d553f['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x4f6044){const _0x1d4357=this['_idsRoots']['get'](_0x4f6044['position']['root']['rootName']),_0x2cd13f=_0x4ebc80(_0x4f6044['position'],_0x1d4357),_0x39af27=null===_0x4f6044['_authorId']?null:_0x4f6044['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2a3e1f=_0x4f6044['_aiSource']||null,_0x5929a7=_0x2cd13f['parent'],_0x40917f=this['_revisionId'],_0x166026=[];for(const _0x144ddf of _0x4f6044['nodes'])if(_0x144ddf['is']('element'))_0x166026['push'](this['_makeIdsRoot'](_0x144ddf));else{for(let _0x5199fc=0x0;_0x5199fc<_0x144ddf['offsetSize'];_0x5199fc++)_0x166026['push'](new _0x784835('$text',{'vid':this['_revisionId']++}));}const _0x3a7a0a=this['_revisionId'];for(let _0x404954=_0x40917f;_0x404954<_0x3a7a0a;_0x404954++)this['_touched']['set'](_0x404954,{'userId':_0x39af27,'aiSource':_0x2a3e1f});_0x5929a7['_insertChild'](_0x2cd13f['offset'],_0x166026);}_setTouched(_0x30320d,_0x3c9b22,_0x10cc63){this['_touched']['set'](_0x30320d,{'userId':_0x3c9b22,'aiSource':_0x10cc63||this['_touched']['get'](_0x30320d)?.['aiSource']||null});}_handleMoveOperation(_0xb9809c){(_0xb9809c=this['_cloneOperation'](_0xb9809c,this['_idsRoots']))['_execute']();const _0x40131e=null===_0xb9809c['_authorId']?null:_0xb9809c['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x17d4bf=_0xb9809c['_aiSource']||null,_0x468f3d=_0xb9809c['getMovedRangeStart'](),_0x333828=_0x468f3d['parent'],_0x54d4d3=_0x468f3d['offset'],_0x835a2a=(_0x3571af,_0x3236ba,_0x3ed37a)=>{for(let _0x3608a7=_0x3236ba;_0x3608a7<_0x3ed37a;_0x3608a7++){const _0x4d2a25=_0x3571af['getChild'](_0x3608a7);_0x4d2a25['is']('element','$text')?this['_setTouched'](_0x4d2a25['getAttribute']('vid'),_0x40131e,_0x17d4bf):(this['_setTouched'](_0x4d2a25['getAttribute']('vid_start'),_0x40131e,_0x17d4bf),_0x835a2a(_0x4d2a25,0x0,_0x4d2a25['childCount']),this['_setTouched'](_0x4d2a25['getAttribute']('vid_end'),_0x40131e,_0x17d4bf));}};_0x835a2a(_0x333828,_0x54d4d3,_0x54d4d3+_0xb9809c['howMany']);}_handleMergeOperation(_0xf8e071){const _0x76e455=null===(_0xf8e071=this['_cloneOperation'](_0xf8e071,this['_idsRoots']))['_authorId']?null:_0xf8e071['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x1cabcb=_0xf8e071['_aiSource']||null,_0x41407c=_0xf8e071['targetPosition']['parent'],_0x2adbb4=_0xf8e071['sourcePosition']['parent'],_0x59d96e=_0x41407c['getAttribute']('vid_end'),_0x1d4d2c=_0x2adbb4['getAttribute']('vid_start');_0x41407c['_setAttribute']('vid_end',_0x2adbb4['getAttribute']('vid_end')),_0x2adbb4['_setAttribute']('vid_end',_0x59d96e),this['_setTouched'](_0x1d4d2c,_0x76e455,_0x1cabcb),this['_setTouched'](_0x59d96e,_0x76e455,_0x1cabcb),_0xf8e071['_execute']();}_handleSplitOperation(_0x200b7a){const _0x4604e5=null===(_0x200b7a=this['_cloneOperation'](_0x200b7a,this['_idsRoots']))['_authorId']?null:_0x200b7a['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xcc1590=_0x200b7a['_aiSource']||null,_0x2e93bc=_0x200b7a['graveyardPosition'],_0x3904da=_0x200b7a['splitPosition']['parent'];_0x200b7a['_execute']();const _0x317be7=_0x3904da['getAttribute']('vid_end'),_0x282e06=_0x200b7a['insertionPosition']['nodeAfter'];if(_0x2e93bc){const _0x2a9c69=_0x282e06['getAttribute']('vid_end'),_0xf1895e=_0x3904da['getAttribute']('vid_end');_0x3904da['_setAttribute']('vid_end',_0x2a9c69),_0x282e06['_setAttribute']('vid_end',_0xf1895e),this['_setTouched'](_0x3904da['getAttribute']('vid_end'),_0x4604e5,_0xcc1590),this['_setTouched'](_0x282e06['getAttribute']('vid_start'),_0x4604e5,_0xcc1590);}else{const _0x4cb80d=this['_revisionId']++,_0xcb6bfe=this['_revisionId']++;_0x3904da['_setAttribute']('vid_end',_0x4cb80d),_0x282e06['_setAttribute']('vid_start',_0xcb6bfe),_0x282e06['_setAttribute']('vid_end',_0x317be7),this['_setTouched'](_0x4cb80d,_0x4604e5,_0xcc1590),this['_setTouched'](_0xcb6bfe,_0x4604e5,_0xcc1590);}}_handleMarkerOperation(_0x2012fb){if(!_0x2012fb['affectsData'])return;const _0x135b4e=(_0x2012fb=this['_cloneOperation'](_0x2012fb,this['_diffRoots']))['oldRange']?_0x2012fb['oldRange']['root']:null,_0x1dc1ea=_0x2012fb['newRange']?_0x2012fb['newRange']['root']:null;_0x135b4e&&this['_markers']['delete'](_0x2012fb['name']),_0x1dc1ea&&this['_markers']['set'](_0x2012fb['name'],_0x2012fb['newRange']['clone']());const _0x34cca8=null===_0x2012fb['_authorId']?null:_0x2012fb['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4215f8=_0x2012fb['name'];if(_0x2012fb['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x4215f8,_0x2012fb['_aiSource']),!this['_touchedMarkers']['has'](_0x4215f8))return void this['_touchedMarkers']['set'](_0x4215f8,{'range':_0x2012fb['oldRange'],'userId':_0x34cca8});const _0x21d8f2=this['_touchedMarkers']['get'](_0x4215f8),_0x495b61=_0x21d8f2['range'],_0x3b2315=_0x2012fb['newRange'];null==_0x495b61&&null==_0x3b2315||_0x495b61&&_0x3b2315&&_0x495b61['isEqual'](_0x3b2315)?this['_touchedMarkers']['delete'](_0x2012fb['name']):_0x21d8f2['userId']=_0x34cca8;}_handleRootOperation(_0x59d9df,_0x50a841){this['_diffRoots']['has'](_0x59d9df['rootName'])?this['_diffRoots']['get'](_0x59d9df['rootName'])['_isAttached']=_0x59d9df['isAdd']:(this['_diffRoots']['set'](_0x59d9df['rootName'],Et(_0x59d9df['rootName'],_0x59d9df['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x59d9df['rootName'],{}),_0x50a841&&this['_idsRoots']['set'](_0x59d9df['rootName'],Et(_0x59d9df['rootName'],_0x59d9df['elementName'],!0x0)));const _0x148ff2=null===_0x59d9df['_authorId']?null:_0x59d9df['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xce5597=this['_touchedRoots']['get'](_0x59d9df['rootName']);_0xce5597&&_0xce5597['userId']===_0x148ff2?this['_touchedRoots']['delete'](_0x59d9df['rootName']):this['_touchedRoots']['set'](_0x59d9df['rootName'],{'userId':_0x148ff2,'isAttached':_0x59d9df['isAdd']});}_handleRootAttributeOperation(_0x283442){const _0x5f10df=this['_diffRootsAttributes']['get'](_0x283442['root']['rootName']);null===_0x283442['newValue']?delete _0x5f10df[_0x283442['key']]:_0x5f10df[_0x283442['key']]=_0x283442['newValue'];}};function St(_0x555c5e){const _0x47adc6=Et(_0x555c5e['rootName'],_0x555c5e['name'],_0x555c5e['isAttached']());for(const _0x54b80f of _0x555c5e['getChildren']()){const _0x329fcb=_0x54b80f['_clone'](!0x0);_0x47adc6['_appendChild'](_0x329fcb);}return _0x47adc6;}function Et(_0x1687bc,_0xd269b6,_0x47623b=!0x0){const _0x5a7bda=new _0x3bf08d();return _0x5a7bda['rootName']=_0x1687bc,_0x5a7bda['name']=_0xd269b6,_0x5a7bda['_isAttached']=_0x47623b,_0x5a7bda['isAttached']=()=>_0x5a7bda['_isAttached'],_0x5a7bda;}function Ot(_0x16af0b,_0x2a4dc2,_0x38c244){const _0x5808b2='elementEnd'==_0x16af0b['type']?_0x38c244['createPositionAt'](_0x16af0b['item'],'end'):_0x38c244['createPositionBefore'](_0x16af0b['item']);return _0x38c244['createPositionFromPath'](_0x2a4dc2,_0x5808b2['path'],_0x5808b2['stickiness']);}function Ct(_0x294baf,_0x2e4e8b,_0x448f6d){const _0x5947ff='elementStart'==_0x294baf['type']?_0x448f6d['createPositionAt'](_0x294baf['item'],0x0):_0x448f6d['createPositionAfter'](_0x294baf['item']);return _0x448f6d['createPositionFromPath'](_0x2e4e8b,_0x5947ff['path'],_0x5947ff['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
25
- _0x596546(dt);var xt=class extends Nt{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x5c044a,_0x3fa38f){super(_0x5c044a),this['focusTracker']=new _0x15d970(),this['keystrokes']=new _0x4c2e20(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x3fa38f),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'](),_t({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x2ed946=_0x3f834b=>_0x3f834b['stopPropagation']();this['keystrokes']['set']('arrowright',_0x2ed946),this['keystrokes']['set']('arrowleft',_0x2ed946),this['keystrokes']['set']('arrowup',_0x2ed946),this['keystrokes']['set']('arrowdown',_0x2ed946);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x241976){this['revisionNameInputView']['fieldView']['element']['value']=_0x241976['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x360c09){const _0x28c276=new it(this['locale'],gt),_0x3fe6b2=_0x28c276['fieldView'];_0x3fe6b2['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x1afc6e=kt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x360c09&&(_0x1afc6e+='\x20('+kt(this['locale'],'optional')+')'),(_0x28c276['label']=_0x1afc6e,_0x3fe6b2['on']('input',()=>{this['revisionNameInputValue']=_0x3fe6b2['element']['value']['trim']();}),_0x28c276);}},Dt=class extends _0xc8641b{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At];}['_saveRevisionFormView'];init(){const _0x20ed67=this['editor'],_0x36dce4=_0x20ed67['plugins']['get']('RevisionTracker');_0x20ed67['ui']['componentFactory']['add']('revisionHistory',_0xc6ccca=>{const _0x257dde=vt(_0xc6ccca),_0x4b585c=_0x257dde['panelView']['children'],_0x34c506=new st(_0xc6ccca),_0x184d0e=new et(_0xc6ccca),_0x3d7477=this['_createSaveRevisionButton'](_0x38f053),_0x3051aa=new et(_0xc6ccca),_0x760650=this['_createOpenRevisionButton'](_0x38f053);return _0x257dde['bind']('isEnabled')['to'](_0x36dce4,'isReady',_0x36dce4,'isEnabled',_0x20ed67,'isReadOnly',(_0x597ba1,_0x4b52e8,_0x32ed17)=>_0x597ba1&&_0x4b52e8&&!_0x32ed17),_0x257dde['buttonView']['set']({'icon':_0x36b259,'label':kt(_0xc6ccca,'Revision\x20history'),'tooltip':!0x0}),_0x3d7477['set']({'withText':!0x0,'role':'menuitem'}),_0x760650['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x760650,'execute',()=>{_0x257dde['isOpen']=!0x1,_0x20ed67['editing']['view']['focus']();},{'priority':'low'}),_0x184d0e['children']['add'](_0x3d7477),_0x3051aa['children']['add'](_0x760650),_0x34c506['role']='menu',_0x34c506['items']['addMany']([_0x184d0e,_0x3051aa]),_0x4b585c['add'](_0x34c506),_0x257dde;}),_0x20ed67['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x5cd92f=this['editor'],_0x113015=_0x5cd92f['locale'],_0x1af036=_0x5cd92f['plugins']['get']('RevisionTracker'),_0x30d027=new at(_0x113015),_0x2096d8=new rt(_0x113015);_0x30d027['bind']('isEnabled')['to'](_0x1af036,'isReady',_0x1af036,'isEnabled',_0x5cd92f,'isReadOnly',(_0x52b946,_0x2233b4,_0x491805)=>_0x52b946&&_0x2233b4&&!_0x491805),_0x30d027['buttonView']['set']({'icon':_0x36b259,'label':kt(_0x113015,'Revision\x20history')});const _0x28a6a0=new ot(_0x113015,_0x30d027),_0x1bb080=this['_createSaveRevisionButton'](nt);_0x1bb080['delegate']('execute')['to'](_0x30d027),_0x28a6a0['children']['add'](_0x1bb080),_0x2096d8['items']['add'](_0x28a6a0);const _0x508f46=new ot(_0x113015,_0x30d027),_0x2052e0=this['_createOpenRevisionButton'](nt);return _0x2052e0['delegate']('execute')['to'](_0x30d027),_0x508f46['children']['add'](_0x2052e0),_0x2096d8['items']['add'](_0x508f46),_0x30d027['panelView']['children']['add'](_0x2096d8),_0x30d027;}_createSaveRevisionButton(_0x514e8a){const _0x393db9=this['editor'],_0x354f55=_0x393db9['plugins']['get']('RevisionTracker'),_0x36a5c8=new _0x514e8a(_0x393db9['locale']);return _0x36a5c8['set']({'label':kt(_0x393db9['locale'],'Save\x20current\x20revision')}),_0x36a5c8['bind']('isEnabled')['to'](_0x354f55,'isReady',_0x354f55,'isEnabled',_0x393db9,'isReadOnly',(_0x2c2d1c,_0x4f17c1,_0x20f677)=>_0x2c2d1c&&_0x4f17c1&&!_0x20f677),this['listenTo'](_0x36a5c8,'execute',()=>{this['_showDialog']();}),_0x36a5c8;}_createOpenRevisionButton(_0x298487){const _0x5d27de=this['editor'],_0x2c83fc=_0x5d27de['plugins']['get']('RevisionTracker'),_0x46e031=new _0x298487(_0x5d27de['locale']);return _0x46e031['set']({'label':kt(_0x5d27de['locale'],'Open\x20revision\x20history')}),_0x46e031['bind']('isEnabled')['to'](_0x2c83fc,'isReady',_0x5d27de,'isReadOnly',(_0x1be0bd,_0x4dd633)=>_0x1be0bd&&!_0x4dd633),this['listenTo'](_0x46e031,'execute',()=>{_0x5d27de['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x46e031;}['_showDialog'](){const _0x1316cf=this['editor'],_0x2c3415=_0x1316cf['locale'],_0x35baf2=_0x1316cf['plugins']['get']('Dialog'),_0x4b8a37=_0x1316cf['plugins']['get']('RevisionTracker');function _0x27ff4e(_0x1d7ddb){_0x1316cf['config']['get']('revisionHistory.requireRevisionName')&&''===_0x1d7ddb['revisionName']?_0x1d7ddb['revisionNameInputView']['errorText']=kt(_0x2c3415,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x1316cf['plugins']['get'](At)['saveRevision']({'name':_0x1d7ddb['revisionName']}),_0x35baf2['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x27ff4e(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x35baf2['show']({'id':'revisionSave','title':kt(_0x2c3415,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':kt(_0x1316cf['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x35baf2['hide']()},{'label':kt(_0x1316cf['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x13af00){_0x13af00['bind']('isEnabled')['to'](_0x4b8a37,'isReady',_0x4b8a37,'isEnabled',_0x1316cf,'isReadOnly',(_0x4cdb2a,_0x3bf8a9,_0x1c3665)=>_0x4cdb2a&&_0x3bf8a9&&!_0x1c3665);},'onExecute':()=>_0x27ff4e(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0x106596=this['editor'],_0x1580a1=_0x106596['locale'];this['_saveRevisionFormView']=new xt(_0x1580a1,_0x106596['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Vt=class extends dt{['changeId'];['_model'];constructor(_0x3417b6,_0xdea7a9,_0xb899a8=!0x1){super(_0x3417b6),this['_model']=_0xdea7a9,this['changeId']=_0xdea7a9['id'];const _0x750c=this['bindTemplate'],_0x16e088=_0xb899a8&&!!_0xdea7a9['data']['aiSource'],_0x5e0300=_0x16e088?this['_createAiIconView'](_0x3417b6):null;this['set']('type',_0xdea7a9['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x750c['to']('type',_0x28b851=>'ck-revision-change__'+_0x28b851),..._0x16e088?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x16e088?[this['_createAiDescriptionView'](_0x3417b6,_0xdea7a9),_0x5e0300]:this['_getDescriptionChildren'](_0x3417b6,_0xdea7a9)}]});}_getDescriptionChildren(_0x3b0ea8,_0x4aa216){let _0x2343f6='Removed\x20by';return _0x4aa216['data']['isSuggestion']?_0x2343f6='Suggested\x20by':'add'==_0x4aa216['type']&&(_0x2343f6='Added\x20by'),[this['_createLabel'](kt(_0x3b0ea8,_0x2343f6)),{'text':'\x20'+_0x4aa216['author']['name']}];}_createAiDescriptionView(_0x26be43,_0x24932a){let _0x35265e='AI_SOURCE_REMOVED_BY';_0x24932a['data']['isSuggestion']?_0x35265e='AI_SOURCE_SUGGESTED_BY':'add'==_0x24932a['type']&&(_0x35265e='AI_SOURCE_ADDED_BY');const _0x4b451f=new dt(_0x26be43);return _0x4b451f['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x4b451f['render'](),_0x4b451f['element']['innerHTML']=_0x584809(kt(_0x26be43,_0x35265e,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+kt(_0x26be43,'AI_SOURCE_AI')+'</span>'])),_0x4b451f['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x24932a['author']['name'],_0x4b451f;}_createLabel(_0xbd622){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0xbd622}]};}_createAiIconView(_0x530043){const _0x8a4257=new _0x9832c();return _0x8a4257['content']=_0x5f4ca4,_0x8a4257['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':kt(_0x530043,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x8a4257;}['focus'](){this['element']['focus']();}};const Tt=/* #__PURE__ -- @preserve */
26
- _0x3de40c();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x56438a){super(),this['id']=_0x56438a['id']||_0x30d584(),this['author']=_0x56438a['author'],this['type']=_0x56438a['type'],this['data']=_0x56438a['data']||{},this['rootName']=_0x56438a['rootName'],this['set']('createdAt',_0x56438a['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ht=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x4a8775,_0x1ff767){this['newRevisionId']=_0x4a8775,this['oldRevisionId']=_0x1ff767,this['changes']=new _0x465b45();}_setChanges(_0x3b5cb1){for(const _0x5b24d5 of _0x3b5cb1)this['changes']['add'](_0x5b24d5);}},Pt=class extends _0xc8641b{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[_0x1ee77a,_0x6c1757,bt,Rt];}constructor(_0x4b2fcc){super(_0x4b2fcc),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',(_0x4e0bd0,_0x2b5459,_0x5e90a1)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x10d82e=>{for(const _0x1293b9 of this['editor']['editing']['view']['document']['roots'])_0x5e90a1?_0x10d82e['removeClass']('ck-editor__editable__overlay',_0x1293b9):_0x10d82e['addClass']('ck-editor__editable__overlay',_0x1293b9);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x1dc78d=>null!==_0x1dc78d),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x1350a6,_0x49e5e6,_0x1c26f5)=>_0x1350a6&&_0x1c26f5?_0x49e5e6['changes']['getIndex'](_0x1c26f5):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x3f1652,_0x52d711)=>_0x3f1652?_0x52d711['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x6c1757),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x18f7be=this['editor'],_0x409e20=new $t(_0x18f7be,{'direction':'backward'}),_0x3d1d46=new $t(_0x18f7be,{'direction':'forward'});_0x18f7be['commands']['add']('showPreviousChange',_0x409e20),_0x18f7be['commands']['add']('showNextChange',_0x3d1d46),_0x18f7be['commands']['add']('restoreRevision',new Ft(_0x18f7be)),this['on']('change:numberOfChanges',()=>{_0x409e20['refresh'](),_0x3d1d46['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x18f7be['enableReadOnlyMode']('revision-viewer'),_0x18f7be['plugins']['has']('WidgetToolbarRepository')&&_0x18f7be['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0xa8d9e6){return await this['_utils']['loadRevisionData'](_0xa8d9e6,this['adapter']),this['_utils']['getRevisionDocumentData'](_0xa8d9e6);}async getRevisionRootsAttributes(_0x1252c2){return await this['_utils']['loadRevisionData'](_0x1252c2,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x1252c2);}async['compare'](_0x21786a,_0x306f0a,_0x23e11b=!0x1){if(!this['isEnabled'])return;const _0x290bca=this['diff'],_0x515c0c=this['repository'],_0xcf49b7='string'==typeof _0x21786a?_0x515c0c['getRevision'](_0x21786a):_0x21786a,_0x353fe5='string'==typeof _0x306f0a?_0x515c0c['getRevision'](_0x306f0a):_0x306f0a,_0x58f024=_0xcf49b7['id'],_0xfa2744=_0x353fe5?_0x353fe5['id']:null;if(!_0x23e11b&&this['diff']&&this['diff']['newRevisionId']===_0x58f024&&this['diff']['oldRevisionId']===_0xfa2744)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x58f024,_0xfa2744);const _0x3002e0=this['_getRevisionsRange'](_0xcf49b7,_0x353fe5,!0x0)['map'](_0x44776e=>this['_utils']['loadRevisionData'](_0x44776e,this['adapter']));return _0x3002e0['push'](new Promise(_0x5c8757=>{setTimeout(_0x5c8757,0x14);})),Promise['all'](_0x3002e0)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x430b40=this['_getDiff'](_0x58f024,_0xfa2744);this['_cleanUpCommentMarkers'](_0x430b40);for(const _0x190fcd of _0x430b40['changes'])this['_changeIdToChange']['set'](_0x190fcd['id'],_0x190fcd);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0xae692a=>{for(const _0x54c18c of this['editor']['model']['document']['getRootNames']())_0xae692a['detachRoot'](_0x54c18c);for(const _0x5cb364 of Object['keys'](_0x430b40['model'])){const _0x203416=_0x430b40['model'][_0x5cb364]['name'],_0x1256ee=_0xae692a['addRoot'](_0x5cb364,_0x203416);for(const _0xa4c313 of Object['keys'](_0x430b40['attributes'][_0x5cb364]))_0xae692a['setAttribute'](_0xa4c313,_0x430b40['attributes'][_0x5cb364][_0xa4c313],_0x1256ee);_0xae692a['insert'](_0x430b40['model'][_0x5cb364],_0x1256ee,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x430b40['changes'])),this['isReady']=!0x0;})['catch'](_0x3380cc=>{console['error'](_0x3380cc),this['_cleanUp'](),_0x290bca&&(this['diff']=_0x290bca),this['isReady']=!0x0;});}addRevisionData(_0x418989,_0x53597e){const _0x4fa28d=this['repository']['createRevision'](_0x418989);return _0x4fa28d['on']('_update',(_0x3fa7f8,_0x95ee7e,_0x5492c0)=>_0x53597e(_0x95ee7e,_0x5492c0,_0x4fa28d)),this['repository']['addRevision'](_0x4fa28d),_0x4fa28d;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x148975=>{for(const _0x1decf7 of this['editor']['model']['document']['getRootNames']())_0x148975['detachRoot'](_0x1decf7);});}_cleanUpCommentMarkers(_0x238b67){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0xbe62c4=this['_getVisibleCommentThreadIds']();for(const _0x2a76f9 of Object['values'](_0x238b67['model']))for(const _0x3e8899 of Array['from'](_0x2a76f9['markers']['keys']()))_0x3e8899['startsWith']('revision-comment:')&&!_0xbe62c4['has'](Ut(_0x3e8899))&&_0x2a76f9['markers']['delete'](_0x3e8899);}_sortAndFilterDiffChanges(_0x1b2d6e){const _0x440123=[],_0x1431e8=new Map();for(const _0x5f4a7f of this['editor']['model']['document']['getRootNames']()){const _0x338e3b=this['editor']['editing']['view']['getDomRoot'](_0x5f4a7f);if(!_0x338e3b)continue;const _0x288a90=_0x338e3b['getClientRects']()['item'](0x0);_0x288a90&&(_0x440123['push'](_0x5f4a7f),_0x1431e8['set'](_0x5f4a7f,_0x288a90));}return _0x440123['sort']((_0x2738f0,_0x4bab41)=>{const _0x465644=_0x1431e8['get'](_0x2738f0),_0x305096=_0x1431e8['get'](_0x4bab41);return _0x465644['y']-_0x305096['y']||_0x465644['x']-_0x305096['x'];}),(_0x1b2d6e=_0x1b2d6e['filter'](_0x497e35=>_0x440123['includes'](_0x497e35['rootName'])))['sort']((_0x5e3bd2,_0x18fb26)=>_0x440123['indexOf'](_0x5e3bd2['rootName'])-_0x440123['indexOf'](_0x18fb26['rootName'])),_0x1b2d6e;}['_makeTape'](_0x19133e,_0x399e7f={}){const _0xa62ea6=Array['from'](_0x19133e['markers'])['filter'](([_0x2ee81b,_0xe4b710])=>_0x2ee81b['startsWith']('revision:')&&!_0xe4b710['isCollapsed']),_0xbd62eb=Array['from'](this['editor']['model']['createRangeIn'](_0x19133e)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0xa62ea6['length'])for(const _0x3f6504 of _0xbd62eb){const [_0x3c4067,_0x44c581]=_0xa62ea6[0x0],[,_0x58434f,_0x14d27e]=_0x3c4067['split'](':'),_0x2d6a7f=_0x399e7f[_0x3c4067]||null;if(_0x44c581['end']['isEqual'](_0x3f6504['nextPosition'])&&_0xa62ea6['shift'](),(_0x3f6504['previousPosition']['isEqual'](_0x44c581['start'])||_0x3f6504['previousPosition']['isAfter'](_0x44c581['start']))&&('insertion'==_0x58434f?_0x3f6504['isAdded']={'userId':_0x14d27e,'aiSource':_0x2d6a7f}:'deletion'==_0x58434f&&(_0x3f6504['isRemoved']={'userId':_0x14d27e,'aiSource':_0x2d6a7f})),0x0==_0xa62ea6['length'])break;}return _0xbd62eb;}_refreshStartEndIndex(_0x376689){const _0x4fe3c8=new Map();for(let _0x31bf5b=0x0;_0x31bf5b<_0x376689['length'];_0x31bf5b++)'text'===_0x376689[_0x31bf5b]['type']?(_0x376689[_0x31bf5b]['item']['startIndex']=_0x31bf5b,_0x376689[_0x31bf5b]['item']['endIndex']=_0x31bf5b):('elementStart'===_0x376689[_0x31bf5b]['type']?_0x376689[_0x31bf5b]['item']['startIndex']=_0x31bf5b:'elementEnd'===_0x376689[_0x31bf5b]['type']&&(_0x376689[_0x31bf5b]['item']['endIndex']=_0x31bf5b),_0x4fe3c8['set'](_0x376689[_0x31bf5b]['id'],_0x31bf5b));for(const _0xc909a2 of _0x4fe3c8['values']())'elementStart'===_0x376689[_0xc909a2]['type']?_0x376689[_0xc909a2]['item']['endIndex']=_0x4fe3c8['get'](_0x376689[_0xc909a2]['pairId']):'elementEnd'===_0x376689[_0xc909a2]['type']&&(_0x376689[_0xc909a2]['item']['startIndex']=_0x4fe3c8['get'](_0x376689[_0xc909a2]['pairId']));}['_processTape'](_0xc96708){for(let _0x5eb614=0x0;_0x5eb614<_0xc96708['length'];_0x5eb614++){if('elementStart'===_0xc96708[_0x5eb614]['type'])_0xc96708[_0x5eb614]['item']['startIndex']=_0x5eb614;else{if('elementEnd'===_0xc96708[_0x5eb614]['type']){_0xc96708[_0x5eb614]['item']['endIndex']=_0x5eb614;const _0xfe5741=_0xc96708[_0x5eb614]['item']['startIndex'];_0xc96708[_0xfe5741]['pairId']=_0xc96708[_0x5eb614]['id'],_0xc96708[_0x5eb614]['pairId']=_0xc96708[_0xfe5741]['id'];}else _0xc96708[_0x5eb614]['item']['startIndex']=_0x5eb614,_0xc96708[_0x5eb614]['item']['endIndex']=_0x5eb614,_0xc96708[_0x5eb614]['pairId']=null;}_0xc96708[_0x5eb614]['markersStart']||(_0xc96708[_0x5eb614]['markersStart']=[],_0xc96708[_0x5eb614]['markersEnd']=[]);}}_markInsertions(_0x231a21,_0x4cbaf9){const _0x1c6eca=_0x231a21['filter'](_0x45432e=>!_0x45432e['isAdded']);for(let _0x3ee548=0x0;_0x3ee548<_0x4cbaf9['length'];_0x3ee548++)_0x4cbaf9[_0x3ee548]['isAdded']&&(_0x1c6eca[_0x3ee548]['isAdded']=_0x4cbaf9[_0x3ee548]['isAdded']);}_getDiff(_0x2c7efc,_0x32bc40=null){const _0x3bf193=this['repository']['getRevision'](_0x2c7efc),_0x542fb0=_0x32bc40?this['repository']['getRevision'](_0x32bc40):null,_0x345baa=this['_getRevisionsRange'](_0x3bf193,_0x542fb0),_0x4e3e89=_0x345baa[_0x345baa['length']-0x1],_0x10dc1a=new Map(),_0x3df12e={'model':{},'attributes':{},'changes':[]},_0x4d7849=new Set(),_0x1cc255=new Map();for(let _0x1a6cef=_0x345baa['length']-0x1;_0x1a6cef>=0x0;_0x1a6cef--){const _0x1584fc=_0x345baa[_0x1a6cef];for(const _0x322866 of Object['keys'](_0x1584fc['diffData']))if(_0x1584fc['diffData'][_0x322866]['attachChange']){const _0x48d36e=_0x1584fc['diffData'][_0x322866]['attachChange'];_0x48d36e['isAttached']?(_0x4d7849['add'](_0x322866),_0x1cc255['has'](_0x322866)&&_0x1cc255['get'](_0x322866)['userId']==_0x48d36e['userId']?_0x1cc255['delete'](_0x322866):_0x1cc255['set'](_0x322866,_0x48d36e)):_0x1cc255['has'](_0x322866)?(_0x4d7849['delete'](_0x322866),_0x1cc255['delete'](_0x322866)):(_0x4d7849['add'](_0x322866),_0x1cc255['set'](_0x322866,_0x48d36e));}else _0x4d7849['add'](_0x322866);}for(const _0x10a8ab of _0x4d7849){const _0x4cb504=_0x1cc255['has'](_0x10a8ab)&&!_0x1cc255['get'](_0x10a8ab)['isAttached'];let _0x3654f8=_0x4cb504?_0x345baa['length']-0x1:0x0;const _0x430621=_0x4cb504?-0x1:0x1;for(;_0x345baa[_0x3654f8];){const _0x2167f7=_0x345baa[_0x3654f8];if(_0x2167f7['diffData'][_0x10a8ab]){const _0x33e538=_0x4cb504?_0x2167f7['diffData'][_0x10a8ab]['attributesBefore']:_0x2167f7['diffData'][_0x10a8ab]['attributesAfter'];_0x3df12e['attributes'][_0x10a8ab]=_0x33e538?_0x5026b6(_0x33e538):{};break;}_0x3654f8+=_0x430621;}}for(const _0x3ab1fc of _0x345baa){_0x3ab1fc['model']={};for(const _0x51bac8 of _0x3ab1fc['authors'])_0x10dc1a['set'](_0x51bac8['id'],_0x51bac8);for(const _0xc32a11 of _0x4d7849){const _0x294384=_0x3ab1fc['diffData'][_0xc32a11]?_0x3ab1fc['diffData'][_0xc32a11]['insertions']:'[]',_0x1178b1=_0x3ab1fc['diffData'][_0xc32a11]?_0x3ab1fc['diffData'][_0xc32a11]['deletions']:'[]',_0x4e356d=_0x3ab1fc['diffData'][_0xc32a11]?.['rootElementName']||'$root';_0x3ab1fc['model'][_0xc32a11]={'insertions':this['_utils']['_makeModelFromViewString'](_0x294384,_0x4e356d),'deletions':this['_utils']['_makeModelFromViewString'](_0x1178b1,_0x4e356d)};}}for(const _0x484c67 of _0x4d7849){let _0x10c2f7=null,_0x17f727=0x0;const _0x3f87b4=_0x345baa['map'](_0x51dbe3=>_0x51dbe3['diffData'][_0x484c67]?.['rootElementName'])['find'](_0x4beac8=>void 0x0!==_0x4beac8)||'$root',_0x5e0edb=new Map(Array['from'](_0x3bf193['model'][_0x484c67]['insertions']['markers'])['filter'](([_0x151bb0])=>!_0x151bb0['startsWith']('revision:')));let _0x5c0362=0x0;for(const _0x1fe950 of _0x345baa){const _0x53827b=_0x1fe950['diffData'][_0x484c67]?.['aiSources']||{},_0x40e0d5=this['_makeTape'](_0x1fe950['model'][_0x484c67]['insertions'],_0x53827b);_0x1fe950==_0x3bf193?(_0x10c2f7=_0x40e0d5,_0x17f727=_0x10c2f7['length'],_0x10c2f7['forEach'](_0x56e97d=>{_0x56e97d['id']=_0x5c0362++;}),this['_processTape'](_0x10c2f7)):this['_markInsertions'](_0x10c2f7,_0x40e0d5);const _0x159e7a=_0x10c2f7['filter'](_0x32ab34=>!_0x32ab34['isAdded'])['map'](_0x14c538=>_0x14c538['id']);let _0xc8d8a7=0x0;const _0x21bad1=this['_makeTape'](_0x1fe950['model'][_0x484c67]['deletions'],_0x53827b);_0x21bad1['forEach'](_0x1d54d6=>{_0x1d54d6['isRemoved']?_0x1d54d6['id']=_0x17f727++:_0x1d54d6['id']=_0x159e7a[_0xc8d8a7++];}),this['_processTape'](_0x21bad1),this['_setDistance'](_0x10c2f7,'isAdded'),this['_setDistance'](_0x21bad1,'isRemoved'),_0x1fe950==_0x3bf193&&this['_markMarkers'](_0x10c2f7,_0x5e0edb),_0x10c2f7=this['_joinTapes'](_0x10c2f7,_0x21bad1),this['_refreshStartEndIndex'](_0x10c2f7),this['_setDistance'](_0x10c2f7,'isRemoved');}_0x10c2f7=_0x10c2f7['filter'](_0x5bd60a=>!(_0x5bd60a['isAdded']&&_0x5bd60a['isRemoved']));const _0x553554=new Map(_0x4e3e89['model'][_0x484c67]['deletions']['markers']),_0x2c095e=new Set(_0x5e0edb['keys']());for(const _0x523863 of _0x553554['keys']())_0x2c095e['delete'](_0x523863);const _0x1b068b=Object['assign']({},..._0x345baa['map'](_0x4c65b0=>_0x4c65b0['diffData'][_0x484c67]?.['aiSources']));this['_markSuggestions'](_0x10c2f7,_0x2c095e,_0x1b068b),this['_fixObsoleteTags'](_0x10c2f7),_0x10c2f7=this['_removeMissingPairs'](_0x10c2f7),_0x10c2f7=this['_markMismatchedRemovedTags'](_0x10c2f7),_0x10c2f7=this['_removeUnsupportedChanges'](_0x10c2f7);const {root:_0x29bca2,changes:_0x46ca3b}=this['_makeModelFromTape'](_0x10c2f7,_0x10dc1a,_0x484c67,_0x3f87b4);_0x3df12e['model'][_0x484c67]=_0x29bca2;const _0x1573f0=_0x1cc255['get'](_0x484c67);if(_0x1573f0){const _0x5d2fd8=_0x10dc1a['get'](_0x1573f0['userId']),_0xe8faa9=new Mt({'author':_0x5d2fd8,'type':_0x1573f0['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x484c67});_0x46ca3b['unshift'](_0xe8faa9),_0x3df12e['attributes'][_0x484c67]['revisionHistoryAttachChange']=_0xe8faa9['id'];}_0x3df12e['changes']=_0x3df12e['changes']['concat'](_0x46ca3b);}return _0x3df12e;}['_markMarkers'](_0x4f7985,_0x2f200e){for(let _0xe10b24=0x0;_0xe10b24<_0x4f7985['length'];_0xe10b24++)for(const [_0x3368a7,_0x11b727]of _0x2f200e)!_0x11b727['isCollapsed']&&_0x11b727['start']['isEqual'](_0x4f7985[_0xe10b24]['previousPosition'])&&_0x4f7985[_0xe10b24]['markersStart']['push'](_0x3368a7),_0x11b727['end']['isEqual'](_0x4f7985[_0xe10b24]['nextPosition'])&&_0x4f7985[_0xe10b24]['markersEnd']['push'](_0x3368a7);}['_joinTapes'](_0x2392d0,_0x1ccd77){let _0x1a6462=[],_0x238ea3=0x0,_0x17b975=0x0;for(;_0x238ea3<_0x2392d0['length']||_0x17b975<_0x1ccd77['length'];){const _0x5c1f30=_0x2392d0[_0x238ea3]||{},_0x2e00e0=_0x1ccd77[_0x17b975]||{};if(_0x5c1f30['id']==_0x2e00e0['id'])_0x238ea3++,_0x17b975++,_0x1a6462['push'](_0x5c1f30);else{if(_0x2e00e0['isRemoved']&&_0x5c1f30['isAdded']){const {commonTape:_0x49edbd,iEnd:_0x1cbf65,jEnd:_0x46c8db}=this['_threeWayMerge'](_0x2392d0,_0x238ea3,_0x1ccd77,_0x17b975);_0x1a6462=_0x1a6462['concat'](_0x49edbd),_0x238ea3=_0x1cbf65,_0x17b975=_0x46c8db;}else _0x2e00e0['isRemoved']?(_0x17b975++,_0x1a6462['push'](_0x2e00e0)):(_0x238ea3++,_0x1a6462['push'](_0x5c1f30));}}return _0x1a6462;}_markSuggestions(_0x1e72ac,_0x1f4094,_0x2168d3){const _0x48d25c=[];for(let _0x469914=0x0;_0x469914<_0x1e72ac['length'];_0x469914++){for(let _0x1054ca=0x0;_0x1054ca<_0x1e72ac[_0x469914]['markersStart']['length'];_0x1054ca++){const _0x225e24=_0x1e72ac[_0x469914]['markersStart'][_0x1054ca];if(!_0x1f4094['has'](_0x225e24))continue;const {group:_0x7a5618,type:_0x58e25b,authorId:_0x50bfa9}=_0x190d09(_0x225e24);if('revision-suggestion'!=_0x7a5618||'insertion'!=_0x58e25b&&'deletion'!=_0x58e25b)continue;const _0x347818=_0x2168d3['suggestion:'+_0x225e24['slice'](0x14)]||null;_0x48d25c['unshift']({'type':_0x58e25b,'name':_0x225e24,'userId':_0x50bfa9,'aiSource':_0x347818}),_0x1e72ac[_0x469914]['markersStart']['splice'](_0x1054ca,0x1),_0x1054ca--;}_0x10080a(_0x1e72ac[_0x469914]);for(let _0x2ec662=0x0;_0x2ec662<_0x1e72ac[_0x469914]['markersEnd']['length'];_0x2ec662++){const _0x18572b=_0x1e72ac[_0x469914]['markersEnd'][_0x2ec662];if(!_0x1f4094['has'](_0x18572b))continue;const {group:_0x1a7885,type:_0x337e4c}=_0x190d09(_0x18572b);if('revision-suggestion'!=_0x1a7885||'insertion'!=_0x337e4c&&'deletion'!=_0x337e4c)continue;_0x1e72ac[_0x469914]['markersEnd']['splice'](_0x2ec662,0x1),_0x2ec662--;const _0x4c8f75=_0x48d25c['findIndex'](_0x429b07=>_0x429b07['name']==_0x18572b);_0x4c8f75>-0x1&&_0x48d25c['splice'](_0x4c8f75,0x1);}}function _0x190d09(_0x398f58){const _0x4bae17=_0x398f58['split'](':');return{'group':_0x4bae17[0x0],'type':_0x4bae17[0x1],'subType':_0x4bae17['length']>=0x5?_0x4bae17[0x2]:null,'id':_0x4bae17['length']<0x5?_0x4bae17[0x2]:_0x4bae17[0x3],'authorId':_0x4bae17['length']<0x5?_0x4bae17[0x3]:_0x4bae17[0x4],'markerCount':0x6==_0x4bae17['length']?_0x4bae17[0x5]:null};}function _0x10080a(_0x54804d){for(let _0x566d03=0x0;_0x566d03<_0x48d25c['length'];_0x566d03++){if(_0x54804d['isAdded']&&'insertion'==_0x48d25c[_0x566d03]['type']&&_0x54804d['isAdded']['userId']==_0x48d25c[_0x566d03]['userId'])return _0x54804d['isAddSuggestion']={..._0x48d25c[_0x566d03],'aiSource':_0x54804d['isAdded']['aiSource']||_0x48d25c[_0x566d03]['aiSource']},void delete _0x54804d['isAdded'];if(!_0x54804d['isAdded']&&!_0x54804d['isRemoved']&&'deletion'==_0x48d25c[_0x566d03]['type'])return void(_0x54804d['isRemoveSuggestion']=_0x48d25c[_0x566d03]);}}}_setDistance(_0x450e1a,_0xc3033c){let _0x2d9e84=0x0,_0x5dcbf8=!0x1;const _0x45b0b8=new Map();for(const _0x1f1d8f of _0x450e1a)_0x1f1d8f[_0xc3033c]?_0x5dcbf8&&(_0x2d9e84++,_0x5dcbf8=!0x1):(_0x2d9e84++,_0x5dcbf8=!0x0),_0x45b0b8['set'](_0x1f1d8f['id'],_0x2d9e84);for(let _0x17d08a=0x0;_0x17d08a<_0x450e1a['length'];_0x17d08a++){if('isRemoved'==_0xc3033c&&_0x450e1a[_0x17d08a]['isAdded']||'isAdded'==_0xc3033c&&_0x450e1a[_0x17d08a]['isRemoved'])continue;if('text'==_0x450e1a[_0x17d08a]['type']){_0x450e1a[_0x17d08a]['distance']=0x0;continue;}const _0x633098=_0x45b0b8['get'](_0x450e1a[_0x17d08a]['pairId']),_0x43e5d0=_0x45b0b8['get'](_0x450e1a[_0x17d08a]['id']);_0x450e1a[_0x17d08a]['distance']=_0x633098-_0x43e5d0;}}_getRevisionsRange(_0x55f3b5,_0x46d531,_0x464d45=!0x1){const _0x1c4bad=[];let _0xcac296=this['repository']['getIndex'](_0x55f3b5),_0x6f3fa8=this['repository']['getIndex'](_0x46d531);for(-0x1==_0x6f3fa8&&(_0x6f3fa8=this['repository']['_revisions']['length'],_0x464d45=!0x1);_0xcac296<_0x6f3fa8;)_0x1c4bad['push'](this['repository']['getRevision'](_0xcac296)),_0xcac296++;return _0x464d45&&_0x1c4bad['push'](this['repository']['getRevision'](_0xcac296)),_0x1c4bad;}_threeWayMerge(_0x5a75ce,_0x51aeb2,_0x4ccbb9,_0x45534c){const _0x506501=this['editor']['model']['schema'];let _0x1b8712=_0x51aeb2;for(;_0x5a75ce[_0x1b8712]&&_0x5a75ce[_0x1b8712]['isAdded'];)_0x1b8712++;let _0x2487d3=_0x45534c;for(;_0x4ccbb9[_0x2487d3]&&_0x4ccbb9[_0x2487d3]['isRemoved'];)_0x2487d3++;_0x2592e4(_0x5a75ce,_0x51aeb2,_0x1b8712),_0x2592e4(_0x4ccbb9,_0x45534c,_0x2487d3);const _0x15f3a3=_0x4ccbb9['slice'](_0x45534c,_0x2487d3)['concat'](_0x5a75ce['slice'](_0x51aeb2,_0x1b8712));return _0x15f3a3['sort']((_0x3846ec,_0x33c386)=>_0x3846ec['side']!=_0x33c386['side']?_0x3846ec['side']-_0x33c386['side']:_0x3846ec['level']!=_0x33c386['level']?_0x3846ec['level']-_0x33c386['level']:_0x3846ec['distance']!=_0x33c386['distance']?_0x33c386['distance']-_0x3846ec['distance']:!!_0x3846ec['isAdded']!=!!_0x33c386['isAdded']?-0x1==_0x3846ec['side']||0x0==_0x3846ec['side']?_0x3846ec['isAdded']?-0x1:0x1:_0x3846ec['isAdded']?0x1:-0x1:_0x3846ec['index']-_0x33c386['index']),{'commonTape':_0x15f3a3,'iEnd':_0x1b8712,'jEnd':_0x2487d3};function _0x2592e4(_0x1e6162,_0x3dc61e,_0x18be9e){let _0x1dad78=-0x1,_0x17b064=Number['POSITIVE_INFINITY'],_0x94ce4=!0x0;for(let _0x36adfb=_0x3dc61e;_0x36adfb<_0x18be9e;_0x36adfb++)if(_0x506501['isInline'](_0x1e6162[_0x36adfb]['item'])||(_0x94ce4=!0x1),_0x1e6162[_0x36adfb]['item']['startIndex']<_0x3dc61e&&(_0x1dad78=_0x36adfb),_0x1e6162[_0x36adfb]['item']['endIndex']>=_0x18be9e){_0x17b064=_0x36adfb;break;}_0x94ce4&&(_0x1dad78=_0x18be9e-0x1);for(let _0x39671a=_0x3dc61e;_0x39671a<_0x18be9e;_0x39671a++)_0x1e6162[_0x39671a]['side']=_0x39671a<=_0x1dad78?-0x1:_0x39671a<_0x17b064?0x0:0x1,_0x1e6162[_0x39671a]['index']=_0x39671a;let _0x37595f=0x0;for(let _0x2870a6=_0x3dc61e;_0x2870a6<=_0x1dad78;_0x2870a6++)0x0==_0x1e6162[_0x2870a6]['distance']?_0x1e6162[_0x2870a6]['level']=_0x37595f:(_0x37595f++,_0x1e6162[_0x2870a6]['level']=_0x37595f,_0x37595f++);for(let _0x9014ff=_0x3dc61e;_0x9014ff<_0x18be9e;_0x9014ff++)0x0==_0x1e6162[_0x9014ff]['side']&&(_0x1e6162[_0x9014ff]['level']=_0x37595f);_0x37595f=0x0;for(let _0x35727a=_0x18be9e-0x1;_0x35727a>=_0x17b064;_0x35727a--)0x0==_0x1e6162[_0x35727a]['distance']?_0x1e6162[_0x35727a]['level']=_0x37595f:(_0x37595f--,_0x1e6162[_0x35727a]['level']=_0x37595f,_0x37595f--);}}_fixObsoleteTags(_0x69762e){const _0x411863=new Map(),_0x2de382=this['editor']['model']['schema'];for(let _0x4240fc=0x1;_0x4240fc<_0x69762e['length'];_0x4240fc++){let _0x24c492,_0x3c7f28,_0x46e58f;const _0x43b582=_0x69762e[_0x4240fc],_0x50c2de=_0x69762e[_0x4240fc-0x1];if('text'==_0x43b582['type'])continue;if(_0x43b582['type']!=_0x50c2de['type'])continue;if(!_0x2de382['isBlock'](_0x50c2de['item'])||_0x2de382['isLimit'](_0x50c2de['item']))continue;if(!_0x2de382['isBlock'](_0x43b582['item'])||_0x2de382['isLimit'](_0x43b582['item']))continue;if((_0x69762e[_0x4240fc]['isAdded']||_0x69762e[_0x4240fc]['isAddSuggestion'])&&_0x69762e[_0x4240fc-0x1]['isRemoved'])_0x24c492=_0x69762e[_0x4240fc],_0x3c7f28=_0x69762e[_0x4240fc-0x1],_0x46e58f=_0x4240fc-0x1;else{if(!_0x69762e[_0x4240fc]['isRemoved']||!_0x69762e[_0x4240fc-0x1]['isAdded']&&!_0x69762e[_0x4240fc-0x1]['isAddSuggestion'])continue;_0x24c492=_0x69762e[_0x4240fc-0x1],_0x3c7f28=_0x69762e[_0x4240fc],_0x46e58f=_0x4240fc;}const _0x508adb=_0x24c492['level']==_0x3c7f28['level'],_0x4dffb9=Math['abs'](_0x24c492['level'])<Math['abs'](_0x3c7f28['level'])&&0x0==_0x3c7f28['distance'];(_0x508adb||_0x4dffb9)&&(_0x411863['set'](_0x3c7f28['id'],_0x24c492['id']),_0x69762e['splice'](_0x46e58f,0x1),_0x4240fc--,_0x24c492['isAdded']=!0x1);}for(let _0x155ea9=0x0;_0x155ea9<_0x69762e['length'];_0x155ea9++)_0x411863['has'](_0x69762e[_0x155ea9]['pairId'])&&(_0x69762e[_0x155ea9]['pairId']=_0x411863['get'](_0x69762e[_0x155ea9]['pairId']));}['_removeMissingPairs'](_0x1ba6b2){const _0x1a584d=new Set(_0x1ba6b2['map'](_0x1f397c=>_0x1f397c['id']));for(let _0x5e678e=0x0;_0x5e678e<_0x1ba6b2['length'];_0x5e678e++)_0x1a584d['has'](_0x1ba6b2[_0x5e678e]['pairId'])||0x0==_0x1ba6b2[_0x5e678e]['distance']||(_0x1ba6b2[_0x5e678e]['isIncorrect']=!0x0);return _0x1ba6b2['filter'](_0x57a8e4=>!_0x57a8e4['isIncorrect']);}_markMismatchedRemovedTags(_0x297f69){const _0x2d7d12=new Set();for(let _0x397122=0x0;_0x397122<_0x297f69['length'];_0x397122++){if(_0x2d7d12['has'](_0x297f69[_0x397122]['id'])&&_0x297f69[_0x397122]['isRemoved']&&(_0x297f69[_0x397122]['isIncorrect']=!0x0),_0x297f69[_0x397122]['isIncorrect'])continue;if(0x0==_0x297f69[_0x397122]['distance'])continue;if('elementStart'!=_0x297f69[_0x397122]['type'])continue;if(null==_0x297f69[_0x397122]['pairId'])continue;let _0x315a65=_0x397122+0x1,_0x1c632b=0x0;for(;_0x297f69[_0x315a65]['id']!=_0x297f69[_0x397122]['pairId'];)'elementStart'==_0x297f69[_0x315a65]['type']?_0x1c632b++:'elementEnd'==_0x297f69[_0x315a65]['type']&&_0x1c632b--,_0x315a65++;if(0x0!=_0x1c632b){if(_0x297f69[_0x397122]['isRemoved'])_0x297f69[_0x397122]['isIncorrect']=!0x0;else{for(;_0x315a65!=_0x397122;)_0x297f69[_0x315a65]['isRemoved']&&0x0!=_0x297f69[_0x315a65]['distance']&&(_0x297f69[_0x315a65]['isIncorrect']=!0x0,_0x2d7d12['add'](_0x297f69[_0x315a65]['pairId'])),_0x315a65--;}}}return _0x297f69['filter'](_0x9381cf=>!_0x9381cf['isIncorrect']);}_removeUnsupportedChanges(_0x454d14){const _0x1f6af7=this['editor']['model']['schema'];for(let _0x5f1bb1=0x0;_0x5f1bb1<_0x454d14['length'];_0x5f1bb1++){if(!(_0x454d14[_0x5f1bb1]['isAdded']||_0x454d14[_0x5f1bb1]['isAddSuggestion']||_0x454d14[_0x5f1bb1]['isRemoved']||_0x454d14[_0x5f1bb1]['isRemoveSuggestion']))continue;if(0x0==_0x454d14[_0x5f1bb1]['distance'])continue;const _0x4335f2=_0x454d14[_0x5f1bb1]['item'];_0x1f6af7['isBlock'](_0x4335f2)||_0x1f6af7['isLimit'](_0x4335f2)||(_0x454d14[_0x5f1bb1]['isAdded']&&delete _0x454d14[_0x5f1bb1]['isAdded'],_0x454d14[_0x5f1bb1]['isAddSuggestion']&&delete _0x454d14[_0x5f1bb1]['isAddSuggestion'],_0x454d14[_0x5f1bb1]['isRemoveSuggestion']&&delete _0x454d14[_0x5f1bb1]['isRemoveSuggestion'],_0x454d14[_0x5f1bb1]['isRemoved']&&(_0x454d14[_0x5f1bb1]['isIncorrect']=!0x0));}return _0x454d14['filter'](_0x1537a8=>!_0x1537a8['isIncorrect']);}['_makeModelFromTape'](_0x4dcb7f,_0xa3b87a,_0x341bdd,_0x2ebce2){const _0x4cc43e=new _0x3bf08d(),_0x1c0842=[],_0x43d6d8=new Map(),_0x481464=this['editor']['model'],_0xf844b4=_0x481464['schema'],_0x4d6caf=[_0x4cc43e],_0x4dc030={},_0x2f3fc7={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x4cc43e['name']=_0x2ebce2;let _0x30e791=null;const _0x3f7892=[0x0];for(let _0xe0be52=0x0;_0xe0be52<_0x4dcb7f['length'];_0xe0be52++)if('elementStart'===_0x4dcb7f[_0xe0be52]['type']){_0x4dcb7f[_0xe0be52]['previousPosition']=_0x481464['createPositionFromPath'](_0x4cc43e,_0x3f7892);const _0x3abb09=new _0x784835(_0x4dcb7f[_0xe0be52]['item']['name'],_0x4dcb7f[_0xe0be52]['item']['getAttributes']());_0x4d6caf[0x0]['_appendChild'](_0x3abb09),_0x3f7892['push'](0x0),_0x4d6caf['unshift'](_0x3abb09),_0x4dcb7f[_0xe0be52]['nextPosition']=_0x481464['createPositionFromPath'](_0x4cc43e,_0x3f7892);}else'elementEnd'===_0x4dcb7f[_0xe0be52]['type']?(_0x4d6caf['shift'](),_0x4dcb7f[_0xe0be52]['previousPosition']=_0x481464['createPositionFromPath'](_0x4cc43e,_0x3f7892),_0x3f7892['pop'](),_0x3f7892[_0x3f7892['length']-0x1]++,_0x4dcb7f[_0xe0be52]['nextPosition']=_0x481464['createPositionFromPath'](_0x4cc43e,_0x3f7892)):(_0x4dcb7f[_0xe0be52]['previousPosition']=_0x481464['createPositionFromPath'](_0x4cc43e,_0x3f7892),_0x30e791?_0x30e791['_data']+=_0x4dcb7f[_0xe0be52]['item']['data']:_0x30e791=new _0x35947c(_0x4dcb7f[_0xe0be52]['item']['data'],_0x4dcb7f[_0xe0be52]['item']['getAttributes']()),_0x4dcb7f[_0xe0be52+0x1]&&'text'===_0x4dcb7f[_0xe0be52+0x1]['type']&&_0x1e5ec5(_0x30e791,_0x4dcb7f[_0xe0be52+0x1]['item'])||(_0x4d6caf[0x0]['_appendChild'](_0x30e791),_0x30e791=null),_0x3f7892[_0x3f7892['length']-0x1]+=_0x4dcb7f[_0xe0be52]['item']['offsetSize'],_0x4dcb7f[_0xe0be52]['nextPosition']=_0x481464['createPositionFromPath'](_0x4cc43e,_0x3f7892));for(let _0x131167=0x0;_0x131167<_0x4dcb7f['length'];_0x131167++){const _0x3728eb=_0x4dcb7f[_0x131167]['previousPosition'],_0x41b544=_0x4dcb7f[_0x131167]['nextPosition'];for(const _0x59c860 of _0x4dcb7f[_0x131167]['markersStart'])_0x43d6d8['set'](_0x59c860,{'start':_0x3728eb,'end':null});_0x586d72('isRemoveSuggestion',_0x131167,_0x3728eb,_0x41b544),_0x586d72('isAddSuggestion',_0x131167,_0x3728eb,_0x41b544),_0x586d72('isRemoved',_0x131167,_0x3728eb,_0x41b544),_0x586d72('isAdded',_0x131167,_0x3728eb,_0x41b544);for(const _0x58d688 of _0x4dcb7f[_0x131167]['markersEnd']){const _0x380c26=_0x43d6d8['get'](_0x58d688);_0x380c26?_0x380c26['end']=_0x41b544:_0x43d6d8['set'](_0x58d688,{'start':_0x41b544,'end':_0x41b544});}}for(const [_0x1d7c62,_0x59e790]of _0x43d6d8){const _0x4a052d=this['editor']['model']['createRange'](_0x59e790['start'],_0x59e790['end']);_0x4cc43e['markers']['set'](_0x1d7c62,_0x4a052d);}return _0x1c0842['sort']((_0x5de55d,_0x3c71b6)=>{const _0x4bc2ba=_0x4cc43e['markers']['get']('revision:'+_0x5de55d['id']),_0xdc6cb6=_0x4cc43e['markers']['get']('revision:'+_0x3c71b6['id']);return _0x4bc2ba['start']['isBefore'](_0xdc6cb6['start'])?-0x1:_0x4bc2ba['start']['isAfter'](_0xdc6cb6['start'])?0x1:_0x4bc2ba['end']['isBefore'](_0xdc6cb6['end'])?-0x1:_0x4bc2ba['end']['isAfter'](_0xdc6cb6['end'])?0x1:'add'===_0x5de55d['type']?-0x1:0x1;}),{'root':_0x4cc43e,'changes':_0x1c0842};function _0x586d72(_0x41d61b,_0x1ec697,_0x2eddf5,_0x374d6f){const _0x128a66=!!_0x4dcb7f[_0x1ec697][_0x41d61b],_0x507774=_0x128a66?_0x4dcb7f[_0x1ec697][_0x41d61b]['userId']:null,_0x261d58=_0x128a66&&_0x4dcb7f[_0x1ec697][_0x41d61b]['aiSource']||null,_0x2a136a=_0x1ec697===_0x4dcb7f['length']-0x1,_0xaa6b05=_0x2f3fc7[_0x41d61b][0x0],_0xda8a64=_0xf844b4['isObject'](_0x4dcb7f[_0x1ec697]['item']);!_0x4dc030[_0x41d61b]&&_0x128a66?_0x4dc030[_0x41d61b]={'start':_0x2eddf5,'tapeItem':_0x4dcb7f[_0x1ec697],'userId':_0x507774,'aiSource':_0x261d58,'type':_0x41d61b}:_0x4dc030[_0x41d61b]&&!_0x128a66?(_0x4dc030[_0x41d61b]['end']=_0x2eddf5,_0x2ef956(_0x4dc030[_0x41d61b]),_0x4dc030[_0x41d61b]=null):_0x4dc030[_0x41d61b]&&_0x128a66&&(_0x4dc030[_0x41d61b]['userId']!==_0x507774||_0x4dc030[_0x41d61b]['aiSource']!==_0x261d58)&&(_0x4dc030[_0x41d61b]['end']=_0x2eddf5,_0xaa6b05&&_0xaa6b05['userId']===_0x4dc030[_0x41d61b]['userId']?_0xaa6b05['change']['aiSource']=_0xaa6b05['change']['aiSource']||_0x4dc030[_0x41d61b]['aiSource']:_0x2ef956(_0x4dc030[_0x41d61b]),_0x4dc030[_0x41d61b]={'start':_0x2eddf5,'tapeItem':_0x4dcb7f[_0x1ec697],'userId':_0x507774,'aiSource':_0x261d58,'type':_0x41d61b}),_0x4dc030[_0x41d61b]&&_0xda8a64&&('elementStart'!==_0x4dcb7f[_0x1ec697]['type']||_0xaa6b05&&_0xaa6b05['userId']===_0x507774||_0x2f3fc7[_0x41d61b]['unshift']({'userId':_0x507774,'object':_0x4dcb7f[_0x1ec697]['item'],'change':_0x4dc030[_0x41d61b]}),'elementEnd'===_0x4dcb7f[_0x1ec697]['type']&&_0xaa6b05&&_0xaa6b05['object']===_0x4dcb7f[_0x1ec697]['item']&&(_0x2f3fc7[_0x41d61b]['shift'](),_0x4dc030[_0x41d61b]=_0xaa6b05['change'])),_0x4dc030[_0x41d61b]&&_0x2a136a&&(_0x4dc030[_0x41d61b]['end']=_0x374d6f,_0x2ef956(_0x4dc030[_0x41d61b]),_0x4dc030[_0x41d61b]=null);}function _0x2ef956({start:_0x1871b2,end:_0x1bec26,tapeItem:_0xe2f3a0,userId:_0x3d5438,aiSource:_0x3b765f,type:_0x3e236a}){const _0x4d6507=_0xe2f3a0['item'],_0x307347=_0x481464['schema']['isBlock'](_0x4d6507)&&!_0x481464['schema']['isLimit'](_0x4d6507),_0x162555=_0x1871b2['nodeAfter']==_0x1bec26['parent']&&_0x1bec26['isAtStart'];if(_0x307347&&_0x162555)return;const _0x5c2289=_0x481464['createRange'](_0x1871b2,_0x1bec26),_0x4e3e54=_0xa3b87a['get'](_0x3d5438),_0x3da4d8=new Mt({'author':_0x4e3e54,'type':'isAdded'==_0x3e236a||'isAddSuggestion'==_0x3e236a?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x3e236a||'isRemoveSuggestion'==_0x3e236a,'aiSource':_0x3b765f||null},'createdAt':new Date(),'rootName':_0x341bdd});_0x1c0842['push'](_0x3da4d8),_0x4cc43e['markers']['set']('revision:'+_0x3da4d8['id'],_0x5c2289);}function _0x1e5ec5(_0x731982,_0x438393){const _0x2f5bc2=_0x731982['getAttributes'](),_0x50483a=_0x438393['getAttributes']();for(const _0x27168f of _0x2f5bc2){if(_0x27168f[0x1]!==_0x438393['getAttribute'](_0x27168f[0x0]))return!0x1;_0x50483a['next']();}return _0x50483a['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x4a2f43=>{const _0x532fc6=_0x4a2f43['markerName']['split'](':')[0x1],_0x35fefe=this['_getChangeFromId'](_0x532fc6);if(!_0x35fefe)return null;const _0x16fe88='add'==_0x35fefe['type']?'insertion':'deletion',_0x16b34e=['ck-suggestion-marker','ck-suggestion-marker-'+_0x16fe88];return _0x35fefe['data']['isSuggestion']&&_0x16b34e['push']('ck-suggestion-marker-'+_0x16fe88+'-new'),this['activeChange']==_0x35fefe&&_0x16b34e['push']('ck-suggestion-marker--active'),{'classes':_0x16b34e,'attributes':{'data-change-id':_0x532fc6}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x4b9058=>{_0x4b9058['on']('element:pre',(_0x23b252,_0x3438d8,_0x5a7c31)=>{const _0x3b7087=_0x3438d8['viewItem']['getChild'](0x0);if(!_0x3b7087||!_0x3b7087['is']('element','code'))return;if(!_0x5a7c31['consumable']['consume'](_0x3b7087,{'attributes':['vid_start','vid_end']}))return;const _0x3e22ea=_0x3438d8['modelRange']['start']['nodeAfter'];_0x5a7c31['writer']['setAttribute']('vid_start',_0x3b7087['getAttribute']('vid_start'),_0x3e22ea),_0x5a7c31['writer']['setAttribute']('vid_end',_0x3b7087['getAttribute']('vid_end'),_0x3e22ea);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x580dd8=>{_0x580dd8['on']('element',(_0x82483a,_0x321bad,_0x170872)=>{if(!_0x170872['consumable']['consume'](_0x321bad['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x321bad['modelRange']['isCollapsed'])return;const _0x66065d=_0x321bad['modelRange']['start']['nodeAfter'];_0x66065d['hasAttribute']('vid_start')||_0x66065d['hasAttribute']('vid')||(_0x170872['writer']['setAttribute']('vid_start',_0x321bad['viewItem']['getAttribute']('vid_start'),_0x66065d),_0x170872['writer']['setAttribute']('vid_end',_0x321bad['viewItem']['getAttribute']('vid_end'),_0x66065d));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x1efd48=>_0x1efd48['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x33e1c3,[,_0x1f6bd9])=>{['vid_start','vid_end','vid']['includes'](_0x1f6bd9)&&(_0x33e1c3['return']=!0x0,_0x33e1c3['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x8d7b0f=>{_0x8d7b0f['on']('attribute:vid',(_0x36c968,_0x30ccc4,_0x3d4900)=>{if('\x20'!=_0x30ccc4['item']['data']||_0x30ccc4['item']['parent']['maxOffset']>0x1)return;if(!_0x3d4900['consumable']['consume'](_0x30ccc4['item'],_0x36c968['name']))return;const _0x1bffe6=_0x3d4900['writer'],_0x58a9e7=_0x3d4900['mapper']['toViewRange'](_0x30ccc4['range']);_0x1bffe6['wrap'](_0x58a9e7,_0x1bffe6['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x5771ca){const _0x9e10a8=_0x5771ca['plugins']['get']('RevisionViewer');return(_0x3a899b,_0x35fe34,_0x202b2a)=>{const _0x42c202=_0x35fe34['markerName']['split'](':')[0x1],_0x101552=_0x9e10a8['_getChangeFromId'](_0x42c202);if(!_0x101552)return null;const _0x4c39c7='add'==_0x101552['type']?'split':'merge';if(!_0x202b2a['consumable']['test'](_0x35fe34['markerRange'],_0x3a899b['name']))return;const _0x5bd0e8=_0x35fe34['markerRange']['getWalker'](),_0x52a707=_0x35fe34['markerRange']['start'],_0x2bb155=_0x5771ca['model']['schema'];let _0x47270c=null,_0x17c27c=null,_0xdc2bc1=!0x1,_0x1b2ac1=!0x1;for(const _0x46ac9a of _0x5bd0e8){const _0x7b57a=_0x46ac9a['item'];_0xdc2bc1=_0xdc2bc1||_0x2bb155['isContent'](_0x7b57a);const _0x224adf=_0x202b2a['mapper']['toViewElement'](_0x7b57a);if(_0x224adf&&_0x224adf['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x46ac9a['type']&&(_0x2bb155['isBlock'](_0x7b57a)&&!_0x2bb155['isLimit'](_0x7b57a)&&(_0x7b57a['nextSibling']||_0x52a707['isAtEnd']?_0x47270c&&_0x47270c['parent']==_0x7b57a||(_0x47270c=_0x7b57a,_0x149833(_0x46ac9a['previousPosition']),_0x1b2ac1=!0x0):_0x17c27c=_0x17c27c||_0x46ac9a['previousPosition']));}function _0x149833(_0x191f6e){const _0x1f469a=_0x202b2a['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x4c39c7}),_0x51d4cd=_0x202b2a['mapper']['toViewPosition'](_0x191f6e);_0x101552['data']['isSuggestion']&&_0x202b2a['writer']['addClass']('ck-suggestion-marker-'+_0x4c39c7+'-new',_0x1f469a),_0x9e10a8['activeChange']==_0x101552&&_0x202b2a['writer']['addClass']('ck-suggestion-marker--active',_0x1f469a),_0x202b2a['writer']['insert'](_0x51d4cd,_0x1f469a),_0x202b2a['mapper']['bindElementToMarker'](_0x1f469a,_0x35fe34['markerName']);}_0xdc2bc1||_0x1b2ac1||!_0x17c27c||_0x149833(_0x17c27c);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x54f5a5,_0x571f70,_0x23893e)=>{const _0x434f91=_0x23893e['mapper']['markerNameToElements'](_0x571f70['markerName']);if(_0x434f91){for(const _0x2efdc6 of _0x434f91)(_0x2efdc6['hasClass']('ck-suggestion-marker-split')||_0x2efdc6['hasClass']('ck-suggestion-marker-merge'))&&(_0x23893e['mapper']['unbindElementFromMarkerName'](_0x2efdc6,_0x571f70['markerName']),_0x23893e['writer']['remove'](_0x2efdc6));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x52b907,_0x573e84,_0x16c5d1)=>{const _0x3631ba=_0x573e84['markerName']['split'](':')[0x1],_0x11a069=this['_getChangeFromId'](_0x3631ba);if(!_0x11a069)return null;const _0x40f53d='add'==_0x11a069['type']?'split':'merge';if(_0x16c5d1['consumable']['test'](_0x573e84['markerRange'],_0x52b907['name']))for(const _0x45fbbd of _0x573e84['markerRange']['getItems']()){if(!_0x45fbbd['is']('element','softBreak'))continue;const _0x4723ab=_0x16c5d1['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x40f53d}),_0x2691b9=_0x16c5d1['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x45fbbd));_0x11a069['data']['isSuggestion']&&_0x16c5d1['writer']['addClass']('ck-suggestion-marker-'+_0x40f53d+'-new',_0x4723ab),this['activeChange']==_0x11a069&&_0x16c5d1['writer']['addClass']('ck-suggestion-marker--active',_0x4723ab),_0x16c5d1['writer']['insert'](_0x2691b9,_0x4723ab),_0x16c5d1['mapper']['bindElementToMarker'](_0x4723ab,_0x573e84['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x33061f=>{for(const _0x104d3a of this['editor']['model']['document']['getRootNames']()){const _0x9ea8d0=this['editor']['model']['document']['getRoot'](_0x104d3a),_0x116ebd=this['editor']['editing']['view']['document']['getRoot'](_0x104d3a);if(_0x116ebd){const _0x365971=_0x9ea8d0['getAttribute']('revisionHistoryAttachChange');if(_0x33061f['removeAttribute']('data-change-id',_0x116ebd),_0x33061f['removeClass']('ck-revision-history-root-add',_0x116ebd),_0x33061f['removeClass']('ck-revision-history-root-remove',_0x116ebd),_0x33061f['removeClass']('ck-revision-history-root--active',_0x116ebd),_0x365971){const _0x218192=this['_getChangeFromId'](_0x365971);if(!_0x218192)return null;_0x33061f['setAttribute']('data-change-id',_0x365971,_0x116ebd),_0x33061f['addClass']('ck-revision-history-root-'+_0x218192['type'],_0x116ebd),this['activeChange']==_0x218192&&_0x33061f['addClass']('ck-revision-history-root--active',_0x116ebd);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x4ee36b=>'revision-comment:'+_0x4ee36b,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x2ab8f6=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x2ab8f6['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x973271=>'revision-suggestion:'+_0x973271,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x4aa302=>({'name':'suggestion:'+_0x4aa302,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x1c0073=>{const _0x3f808c=_0x1c0073['markerName']['split'](':')[0x1];return'insertion'!=_0x3f808c&&'deletion'!=_0x3f808c?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x3f808c]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Lt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Lt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x324e92,_0x333b5d,_0x5e6f5e)=>{const _0x48075f=_0x5e6f5e['mapper']['markerNameToElements'](_0x333b5d['markerName']);if(_0x48075f){for(const _0x28586d of _0x48075f)_0x28586d['is']('uiElement')&&(_0x5e6f5e['mapper']['unbindElementFromMarkerName'](_0x28586d,_0x333b5d['markerName']),_0x5e6f5e['writer']['remove'](_0x28586d));}},{'priority':'high'});}_getChangeFromId(_0x1a8184){return this['_changeIdToChange']['get'](_0x1a8184);}_getViewForChange(_0x152019){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x152019,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x5e0474,_0x3e68b6,_0x18f801,_0x51b1c5)=>{_0x51b1c5&&this['_balloon']['remove'](_0x51b1c5),_0x18f801&&(this['_balloon']['add']({'view':_0x18f801,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x3038f7=this['editor']['editing'],_0x1c257f=this['_getChangeFromId'](_0x18f801['changeId']);let _0x20dda2;if(_0x1c257f['data']['isOnRoot']){const _0xce7ebd=_0x3038f7['view']['getDomRoot'](_0x1c257f['rootName']);_0x20dda2=Array['from'](_0xce7ebd['getClientRects']());}else{const _0x14a04a=this['editor']['model']['markers']['get']('revision:'+_0x18f801['changeId']);_0x20dda2=Array['from'](_0x3038f7['mapper']['markerNameToElements'](_0x14a04a['name']))['map'](_0x4ce085=>_0x3038f7['view']['domConverter']['mapViewToDom'](_0x4ce085))['map'](_0x54f1a4=>Array['from'](_0x54f1a4['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x20dda2['find'](_0x14de9a=>_0x14de9a['top']-0x3<=this['_activeViewTarget']['y']&&_0x14de9a['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x14de9a['left']-0x3<=this['_activeViewTarget']['x']&&_0x14de9a['right']+0x3>=this['_activeViewTarget']['x'])||_0x20dda2[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x30040c,_0x4179a2,_0x322915,_0x2923a8)=>{this['activeView']=_0x322915?this['_getViewForChange'](_0x322915):null,this['editor']['model']['change'](()=>{const _0x342616=this['editor']['editing'];_0x2923a8&&(_0x2923a8['data']['isOnRoot']?_0x342616['view']['change'](_0x31fe92=>{_0x31fe92['removeClass']('ck-revision-history-root--active',_0x342616['view']['document']['getRoot'](_0x2923a8['rootName']));}):_0x342616['reconvertMarker']('revision:'+_0x2923a8['id'])),_0x322915&&(_0x322915['data']['isOnRoot']?_0x342616['view']['change'](_0x16cf41=>{_0x16cf41['addClass']('ck-revision-history-root--active',_0x342616['view']['document']['getRoot'](_0x322915['rootName']));}):_0x342616['reconvertMarker']('revision:'+_0x322915['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x111f16,_0x450c85)=>{if(this['activeChange'])return;const _0x232f20=this['_findChangeIdFromDomTarget'](_0x450c85['target']),_0x4eb382=this['_changeIdToChange']['get'](_0x232f20);_0x4eb382?(this['_activeViewTarget']={'x':_0x450c85['domEvent']['x'],'y':_0x450c85['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x4eb382)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x324643,_0x57caab)=>{const _0x1fa5ce=this['_findChangeIdFromDomTarget'](_0x57caab['target']),_0x16bd18=this['_changeIdToChange']['get'](_0x1fa5ce);_0x16bd18?(this['_activeViewTarget']={'x':_0x57caab['domEvent']['x'],'y':_0x57caab['domEvent']['y']},_0x16bd18===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x16bd18):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x52a599){do{const _0x22754e=_0x52a599['getAttribute']('data-change-id');if(_0x22754e)return _0x22754e;_0x52a599=_0x52a599['parent'];}while(_0x52a599);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x289c0b=>{for(const _0x5a6dde of this['editor']['model']['markers'])_0x289c0b['removeMarker'](_0x5a6dde);});}};function Ut(_0x1cf1d1){return _0x1cf1d1['split'](':')[0x1];}function Lt(_0x17980e,_0x1e4f9b){return(_0x1d3444,_0x3d449f,_0xb7b14f)=>{if(!_0xb7b14f['consumable']['test'](_0x3d449f['markerRange'],_0x1d3444['name']))return;const _0x2f4454=_0x3d449f['markerRange']['getWalker'](),_0x33308a=_0x3d449f['markerRange']['start'],_0x230555=_0x17980e['model']['schema'];let _0x5f03a0=null,_0x5f56a7=null,_0x4e34d9=!0x1,_0x273d88=!0x1;for(const _0x3e3470 of _0x2f4454){const _0x4d5985=_0x3e3470['item'];_0x4e34d9=_0x4e34d9||_0x230555['isContent'](_0x4d5985);const _0x3c8b62=_0xb7b14f['mapper']['toViewElement'](_0x4d5985);if(_0x3c8b62&&_0x3c8b62['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x3e3470['type']&&(_0x230555['isBlock'](_0x4d5985)&&!_0x230555['isLimit'](_0x4d5985)&&(_0x4d5985['nextSibling']||_0x33308a['isAtEnd']?_0x5f03a0&&_0x5f03a0['parent']==_0x4d5985||(_0x5f03a0=_0x4d5985,_0x2c6c72(_0x3e3470['previousPosition']),_0x273d88=!0x0):_0x5f56a7=_0x5f56a7||_0x3e3470['previousPosition']));}function _0x2c6c72(_0x5f1cbb){const _0x13d73f=_0xb7b14f['mapper']['toViewPosition'](_0x5f1cbb),_0x4f3024=_0xb7b14f['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x1e4f9b});_0xb7b14f['writer']['insert'](_0x13d73f,_0x4f3024),_0xb7b14f['mapper']['bindElementToMarker'](_0x4f3024,_0x3d449f['markerName']);}_0x4e34d9||_0x273d88||!_0x5f56a7||_0x2c6c72(_0x5f56a7);};}var Ft=class extends _0x299289{constructor(_0x66ab2e){super(_0x66ab2e);const _0x5e1e05=_0x66ab2e['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x5e1e05,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x5e1e05,'change:isEnabled',()=>this['refresh']());}execute(){const _0x2e6e89=this['editor'],_0xba479f=_0x2e6e89['plugins']['get'](Pt),_0x59c59f=_0xba479f['isReady']?_0xba479f['diff']['newRevisionId']:null;_0x2e6e89['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x59c59f);}['refresh'](){const {isReady:_0x9d16be,isEnabled:_0x24f2ef,repository:_0x450654,diff:_0x1a2920}=this['editor']['plugins']['get'](Pt),_0x7471e5=_0x1a2920&&_0x450654['getLaterVisibleRevision'](_0x1a2920['newRevisionId']);this['isEnabled']=_0x9d16be&&_0x24f2ef&&Boolean(_0x7471e5);}},$t=class extends _0x299289{_step;constructor(_0x384832,{direction:_0x3b3b74}){super(_0x384832);const _0x353279=_0x384832['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x3b3b74?0x1:-0x1,this['listenTo'](_0x353279,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x353279,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x353279,'change:activeChange',()=>this['refresh']());}execute(){const _0x4208f2=this['editor'],_0x537b0a=_0x4208f2['plugins']['get'](Pt),{isNavigationMode:_0x55e1f5,currentChangeNumber:_0xb8bec4}=_0x537b0a;let _0x1c20f9;if(_0x537b0a['activeChange']=_0x55e1f5?_0x537b0a['diff']['changes']['get'](_0xb8bec4+this['_step']):_0x537b0a['diff']['changes']['first'],_0x537b0a['activeChange']['data']['isOnRoot'])_0x1c20f9=_0x4208f2['editing']['view']['getDomRoot'](_0x537b0a['activeChange']['rootName']);else{const _0x157ee4=_0x4208f2['model']['markers']['get']('revision:'+_0x537b0a['activeChange']['id']);_0x1c20f9=_0x317404(_0x4208f2['editing'],_0x157ee4);}_0x3df991({'target':_0x1c20f9,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x4f063d,currentChangeNumber:_0x498518,numberOfChanges:_0xeb0721,isReady:_0xe0c267,isEnabled:_0x4ba372}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0x4ba372&&_0xe0c267&&_0xeb0721)&&(!_0x4f063d||(0x1===this['_step']?_0x498518<_0xeb0721-0x1:_0x498518>0x0));}},Bt=class extends dt{constructor(_0x5d5f80){super(_0x5d5f80);const _0x559751=this['bindTemplate'],_0x14a119=new _0x38f053(_0x5d5f80),_0x1854f0=new _0x38f053(_0x5d5f80);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',(_0x59a4a3,_0x45c4ac)=>_0x59a4a3&&_0x45c4ac>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x49ebec,_0x1ce7e9,_0xe144f0,_0x3563b6)=>{if(!_0x49ebec)return kt(_0x5d5f80,'Loading...');if(!_0xe144f0)return kt(_0x5d5f80,'No\x20changes');const _0x4082a6=kt(_0x5d5f80,'NUMBER_OF_CHANGES',_0xe144f0);return _0x3563b6?kt(_0x5d5f80,'X_OF_Y_CHANGES',[_0x1ce7e9+0x1,_0xe144f0]):_0x4082a6;}),_0x14a119['set']({'label':kt(_0x5d5f80,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0xfe4f10}),_0x1854f0['set']({'label':kt(_0x5d5f80,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0xbe7fe1}),_0x14a119['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x1854f0['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x14a119['on']('execute',()=>this['fire']('execute','backward')),_0x1854f0['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',_0x559751['if']('_isStatusLabelVisible','ck-hidden',_0x1cab96=>!_0x1cab96)]},'children':[{'text':_0x559751['to']('isNavigationMode',_0x2f49a8=>_0x2f49a8?kt(_0x5d5f80,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x5d5f80,'Total')+':\x20')}]},{'text':_0x559751['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x14a119,_0x1854f0]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0xc8641b{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x4365c2=this['editor']['editing']['view'];_0x4365c2['change'](_0x5b6fff=>{for(const _0x4a962a of _0x4365c2['document']['roots'])_0x5b6fff['addClass'](jt,_0x4a962a);});}['hide'](){const _0xf02934=this['editor']['editing']['view'];_0xf02934['change'](_0x38efc2=>{for(const _0x4ad464 of _0xf02934['document']['roots'])_0x38efc2['removeClass'](jt,_0x4ad464);});}},Kt=class extends _0xc8641b{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0x2512cf=this['editor'],_0x333ee0=_0x2512cf['plugins']['get'](Pt),_0x57214b=_0x2512cf['plugins']['get'](Gt);_0x2512cf['ui']['componentFactory']['add']('exitToEditing',_0x57ca00=>{const _0x131b42=new _0x38f053(_0x57ca00);return _0x131b42['set']({'label':kt(_0x57ca00,'Back\x20to\x20editing'),'icon':_0x492213,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x131b42,'execute',()=>{_0x2512cf['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x131b42;}),_0x2512cf['ui']['componentFactory']['add']('restoreRevision',_0x225463=>{const _0x5c066e=new _0x38f053(_0x225463);return _0x5c066e['set']({'label':kt(_0x225463,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x5c066e['bind']('isEnabled')['to'](_0x2512cf['commands']['get']('restoreRevision')),this['listenTo'](_0x5c066e,'execute',()=>_0x2512cf['execute']('restoreRevision')),_0x5c066e;}),_0x2512cf['ui']['componentFactory']['add']('changesNavigation',_0x4e890a=>{const _0x17c226=new Bt(_0x4e890a),_0x528f09=_0x2512cf['commands']['get']('showPreviousChange'),_0x578585=_0x2512cf['commands']['get']('showNextChange');return _0x17c226['bind']('isBackwardNavigationEnabled')['to'](_0x528f09,'isEnabled'),_0x17c226['bind']('isForwardNavigationEnabled')['to'](_0x578585,'isEnabled'),_0x17c226['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x333ee0),this['listenTo'](_0x17c226,'execute',(_0x4abb5,_0x263f9f)=>{_0x2512cf['execute']('forward'===_0x263f9f?'showNextChange':'showPreviousChange');}),_0x17c226;}),_0x57214b['show'](),_0x333ee0['on']('change:isReady',(_0x4e9c90,_0x4ce378,_0x1c350f)=>{_0x1c350f?_0x57214b['hide']():_0x57214b['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x36af8a,_0x4cb1e7){super(_0x36af8a,_0x4cb1e7);const _0x4b302e=this['bindTemplate'];this['set']({'label':kt(_0x36af8a,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x36af8a,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x4b302e['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x1c4e44(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x4665d8=this['fieldView']['element'];this['_tooltipString']=_0x4665d8['scrollWidth']>_0x4665d8['clientWidth']&&_0x4665d8['value']||'';}},Yt=class extends dt{constructor(_0x4726d7,_0x5e6315,_0x40179a){super(_0x4726d7);const _0x39874f=new _0x9832c();_0x39874f['set']({'content':_0x43403f,'viewBox':'0\x200\x2011\x2010'});const _0xbf8d63=['ck','ck-revision-history-sidebar__revision-author'];_0x40179a&&_0xbf8d63['push']('ck-revision-history-sidebar__revision-author_creator');const _0x3c9cc3=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0x4726d7,_0x40179a?'Revision\x20creator':'Revision\x20author')},'children':[_0x39874f,_0x5e6315['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0xbf8d63},'children':_0x3c9cc3});}};function Jt(_0x22c323,_0x414fc8){const _0x2d3eac=_0x22c323['bindTemplate'],_0x4aebbd=_0x22c323['locale'],_0x3e1cd5=vt(_0x4aebbd);_0x3e1cd5['panelPosition']='sw';const _0x14b8df=function(_0x5a7930,_0x10c4ec){const _0x47f134=function(_0x361c38,_0x54b29a){const _0x34408f=_0x361c38['locale'],_0x160ae8={'Compare\x20against\x20selected':kt(_0x34408f,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x34408f,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x34408f,'Restore\x20this\x20revision')};return _0x54b29a['map'](_0x242b13=>{const _0x48aa2c=_0x160ae8[_0x242b13['name']];return _0x48aa2c&&_0x48aa2c!==_0x242b13['name']&&(_0x242b13['name']=_0x48aa2c),_0x242b13;});}(_0x5a7930,_0x10c4ec),_0x46801f=new _0x465b45();for(const _0x9254dd of _0x47f134){const _0x32e900={'type':'button','model':new ut({'label':_0x9254dd['name'],'class':_0x9254dd['class'],'withText':!0x0,'role':'menuitem','_action':_0x9254dd['action']})};_0x32e900['model']['bind']('isEnabled')['to'](_0x5a7930,'isActionsDropdownOpen',_0x103301=>'function'!=typeof _0x9254dd['isEnabled']||(!_0x103301||_0x9254dd['isEnabled'](_0x5a7930))),_0x46801f['add'](_0x32e900);}return _0x46801f;}(_0x22c323,_0x414fc8);return _0x22c323['bind']('isActionsDropdownOpen')['to'](_0x3e1cd5,'isOpen'),_0x3e1cd5['buttonView']['set']({'label':kt(_0x4aebbd,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x35f8f0}),_0x3e1cd5['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x2d3eac['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x2d3eac['to'](_0x28cc3d=>_0x28cc3d['stopPropagation']())}}),_0x3e1cd5['on']('execute',_0x5ab385=>{_0x22c323['isReady']&&'function'==typeof _0x5ab385['source']['_action']&&_0x5ab385['source']['_action'](_0x22c323);}),ft(_0x3e1cd5,_0x14b8df,{'role':'menu'}),_0x3e1cd5['listenTo'](_0x22c323,'change:isActionsDropdownOpen',(_0x839470,_0x473442,_0x457bfe)=>{if(_0x457bfe)for(const _0x14bef3 of _0x3e1cd5['listView']['items']){const _0x12532c=_0x14bef3['children']['first'],_0x110bc6=_0x414fc8['find'](_0x597a0c=>_0x597a0c['action']===_0x12532c['_action'])['isVisible'];_0x14bef3['isVisible']=void 0x0===_0x110bc6||_0x110bc6(_0x22c323);}}),_0x3e1cd5;}const Wt=/* #__PURE__ -- @preserve */
27
- _0x499a42(dt);var Xt=class extends Wt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0xc19723,_0x337834,_0x4e68e0,_0x288a12,_0xed89d6=!0x1){super(_0xc19723);const _0x43eb20=this['bindTemplate'],_0x16a421=function(_0x2af44a,_0x49cdb0){const _0x5d1a83=Array['from'](_0x49cdb0['authors'])['filter'](_0x559d5d=>_0x559d5d!=_0x49cdb0['creator']);return _0x49cdb0['creator']&&_0x5d1a83['unshift'](_0x49cdb0['creator']),_0x5d1a83['map'](_0x379b87=>new Yt(_0x2af44a,_0x379b87,_0x379b87==_0x49cdb0['creator']));}(_0xc19723,_0x337834);this['id']=_0x337834['id'],this['_revision']=_0x337834,this['_requireRevisionName']=_0x288a12,this['bind']('_isAiGenerated')['to'](_0x337834,'attributes',_0x6a1a75=>!(!_0x6a1a75||!_0x6a1a75['@ai'])),this['bind']('name','createdAt')['to'](_0x337834),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x351c3f=>{return _0x5281d3=_0xc19723['uiLanguage'],(_0x3ed2c0=_0x351c3f)['toLocaleDateString'](_0x5281d3,{'month':'long','day':'numeric'})+',\x20'+_0x3ed2c0['toLocaleTimeString'](_0x5281d3,{'hour':'numeric','minute':'numeric'});var _0x5281d3,_0x3ed2c0;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new qt(_0xc19723,gt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x311b88=>_0x311b88||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x482693,_0x3b71ee)=>_0x482693&&_0x3b71ee),this['revisionActionsView']=_0x4e68e0&&_0x4e68e0['length']?Jt(this,_0x4e68e0):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0xed89d6?this['_createAiPillView'](_0xc19723):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x43eb20['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x43eb20['if']('isEnabled','ck-disabled',_0x26b4fc=>!_0x26b4fc),_0x43eb20['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x43eb20['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x43eb20['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':_0x43eb20['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':_0x16a421}]},..._0xed89d6?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x43eb20['if']('_isAiGenerated','ck-hidden',_0x3ad6dc=>!_0x3ad6dc)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x43eb20['to'](_0x2a9a33=>{_0x2a9a33['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x590894){const _0x1d2695=new _0x281423(_0x590894);return _0x1d2695['set']({'icon':_0x5f4ca4,'label':kt(_0x590894,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':kt(_0x590894,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','size':'small','class':'ck-pill_ai'}),_0x1d2695['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x1d2695;}['render'](){super['render']();const _0x3b3c97=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x3b3c97,'change',()=>{this['_requireRevisionName']&&!_0x3b3c97['value']||this['fire']('setName',{'id':this['id'],'name':_0x3b3c97['value']}),_0x3b3c97['value']||(_0x3b3c97['value']=this['name']?this['name']:this['_createdAtFormatted']);});}select(){this['isSelected']=!0x0;}deselect(){this['isSelected']=!0x1;}highlight(){this['isHighlighted']=!0x0;}unhighlight(){this['isHighlighted']=!0x1;}};function Qt(_0x1bb5e4,_0x5d7403){const _0x196331=wt['fromJSDate'](_0x1bb5e4)['setLocale'](_0x5d7403),_0x4743f8=wt['local'](),_0x254963=_0x4743f8['minus']({'days':0x1})['startOf']('day');let _0x2d1e28,_0x10d51c;return _0x196331['hasSame'](_0x4743f8,'day')?(_0x2d1e28=_0x196331['startOf']('day')['toJSDate'](),_0x10d51c=_0x196331['toRelativeCalendar']()):_0x196331['hasSame'](_0x254963,'day')?(_0x2d1e28=_0x254963['toJSDate'](),_0x10d51c=_0x196331['toRelativeCalendar']()):_0x196331['hasSame'](_0x4743f8,'week')?(_0x2d1e28=_0x196331['startOf']('week')['toJSDate'](),_0x10d51c=_0x196331['weekdayLong']||''):_0x196331['hasSame'](_0x4743f8,'year')?(_0x2d1e28=_0x196331['startOf']('month')['toJSDate'](),_0x10d51c=_0x196331['monthLong']||''):(_0x2d1e28=_0x196331['startOf']('year')['toJSDate'](),_0x10d51c=String(_0x196331['year'])),{'startDate':_0x2d1e28,'localizedPeriodName':_0x10d51c};}var zt=class extends dt{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x2451f9,_0x486fa3,_0x449053,_0x2c58d9,_0x2b22b6){super(_0x2451f9);const _0x29224f=Qt(_0x486fa3,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x486fa3,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x449053,this['_requireRevisionName']=_0x2c58d9,this['_showAISource']=_0x2b22b6,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':_0x29224f}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x43eeaf){const _0x3e84b3=new Xt(this['locale'],_0x43eeaf,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0x3e84b3);}['removeRevision'](_0x2651b1){const _0x3dcd22=this['revisionViews']['find'](_0x135506=>_0x135506['id']===_0x2651b1['id']);this['revisionViews']['remove'](_0x3dcd22);}},Zt=class extends dt{constructor(_0x1a7509){super(_0x1a7509);const _0x2ec469=new _0x9832c();_0x2ec469['content']=_0x36b259,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x2ec469,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[kt(_0x1a7509,'Revision\x20history')]}]});}},ti=class extends dt{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x5c5259,_0x578a36,_0x80f5fb,_0x7b0495,_0xdcfd90){super(_0x5c5259);const _0x1977c8=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x578a36,this['_revisionActions']=_0x80f5fb,this['_requireRevisionName']=_0x7b0495,this['_showAISource']=_0xdcfd90,this['on']('select',(_0x22bf43,_0x2e86e9)=>{this['fire']('revisionSelected',_0x2e86e9);}),this['on']('setName',(_0x3b9718,_0x49b25d)=>{this['fire']('revisionSetName',_0x49b25d);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Zt(_0x5c5259),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x1977c8['if']('isEnabled','ck-disabled',_0x49ad29=>!_0x49ad29)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x200860 of this['_revisions'])this['_addRevision'](_0x200860);this['_revisions']['on']('add',(_0xf7c5bb,_0x2942a0)=>{this['_addRevision'](_0x2942a0);}),this['_revisions']['on']('remove',(_0x4958f8,_0x4c8634)=>{this['_removeRevision'](_0x4c8634);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x5d6a5a=>_0x5d6a5a['revisionViews']['map'](_0x24d78c=>_0x24d78c))['flat']();}selectRevision(_0x57186a){for(const _0x33f84d of this['revisionViews'])_0x57186a&&_0x57186a['id']===_0x33f84d['id']?_0x33f84d['select']():_0x33f84d['deselect']();}highlightRevisions(_0x536fde){for(const _0x361c69 of this['revisionViews'])_0x536fde['some'](({id:_0x243bef})=>_0x243bef===_0x361c69['id'])?_0x361c69['highlight']():_0x361c69['unhighlight']();}['_addRevision'](_0x55d08c){const _0x4d2bd7=Qt(_0x55d08c['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x4ad1a1=this['_getTimePeriodViewByStartDate'](_0x4d2bd7);_0x4ad1a1||(_0x4ad1a1=new zt(this['locale'],_0x4d2bd7,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x4ad1a1)),_0x4ad1a1['addRevision'](_0x55d08c);}['_removeRevision'](_0x421231){const _0x2a68e6=Qt(_0x421231['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x2a68e6)['removeRevision'](_0x421231);}_getTimePeriodViewByStartDate(_0x226d4d){return this['timePeriodViews']['find'](_0x18c820=>_0x18c820['startDate']['getTime']()===_0x226d4d['getTime']());}},ii=class RevisionsSidebar extends _0xc8641b{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
23
+ import{CKEditorError as _0x8716b1,Collection as _0x393ab3,ElementReplacer as _0x493518,FocusTracker as _0x1f365b,KeystrokeHandler as _0x289644,ObservableMixin as _0x301f59,ResizeObserver as _0x108a54,logWarning as _0x46499c,scrollViewportToShowTarget as _0xe8b9b6,trustedHtml as _0x3ee93e,uid as _0x1502a4}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x2b717e,isEqual as _0x21fb00,set as _0x33aca2,unset as _0x4e2ada}from'es-toolkit/compat';import{Command as _0x83b002,Editor as _0x400523,ElementApiMixin as _0x5c9264,PendingActions as _0x17fbd0,Plugin as _0x15eb24}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x2c1eae,PillView as _0x1892fd,Users as _0x4fd2f9,getMarkerDomElement as _0x1f8b1e,reRootOperation as _0x21af22,reRootPosition as _0x2a2d33,reRootRange as _0x502c59,sanitizeEditorConfig as _0xed521e}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x258ac8,ModelElement as _0x1868f7,ModelRange as _0x191a66,ModelText as _0x3ec4fc,ViewAttributeElement as _0x1fdffa,ViewContainerElement as _0x4dc6ae,ViewDocumentFragment as _0x55900d,ViewElement as _0x41ead9,ViewEmptyElement as _0x46448d,ViewRawElement as _0x1a0c46,ViewText as _0x2f41ca,ViewUIElement as _0x22ec75}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0x18ab4e,IconChevronUp as _0x4ec9c5,IconHistory as _0x74b43d,IconSparkle as _0x525b57,IconThreeVerticalDots as _0x52e55d,IconUndo as _0xe2d6ce,IconUser as _0x25562b}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x26cd40,ButtonView as _0x3e9ea0,ContextualBalloon as _0x11b77b,CssTransitionDisablerMixin as _0x47a750,EditorUI as _0x145983,IconView as _0x57a8a0,InlineEditableUIView as tt,LabeledFieldView as it,ListItemView as et,ListView as st,MenuBarMenuListItemButtonView as nt,MenuBarMenuListItemView as ot,MenuBarMenuListView as rt,MenuBarMenuView as at,StickyPanelView as ht,ToolbarSeparatorView as ct,ToolbarView as lt,UIModel as ut,View as dt,addListToDropdown as ft,createDropdown as vt,createLabeledInputText as gt,normalizeToolbarConfig as mt,submitHandler as _t}from'@ckeditor/ckeditor5-ui';import{DateTime as wt}from'luxon';const pt=/* #__PURE__ -- @preserve */
24
+ _0x301f59();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x279376){super(),this['id']=_0x279376['id']||_0x1502a4(),this['creator']=_0x279376['creator']||null,this['authors']=_0x279376['authors']||[],this['diffData']=_0x279376['diffData']||null,this['toVersion']=_0x279376['toVersion']||0x0,this['fromVersion']=_0x279376['fromVersion']||0x0,this['set']('name',_0x279376['name']||''),this['set']('createdAt',_0x279376['createdAt']||new Date()),this['set']('attributes',_0x279376['attributes']||{});}setName(_0x3442e3){this['_update']({'name':_0x3442e3});}setAttribute(_0x8e17a8,_0x5d5711){const _0x488464=_0x2b717e(this['attributes']);_0x33aca2(_0x488464,_0x8e17a8,_0x5d5711),this['_update']({'attributes':_0x488464});}removeAttribute(_0x32c245){const _0x5cca65=_0x2b717e(this['attributes']);_0x4e2ada(_0x5cca65,_0x32c245),this['_update']({'attributes':_0x5cca65});}_update(_0x18576f,_0x198a21=!0x1){let _0xffac52=!0x1;const _0xfe98c8={'id':this['id']};for(const _0x5e3cd1 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x205339=_0x18576f[_0x5e3cd1];void 0x0!==_0x205339&&_0x205339!==this[_0x5e3cd1]&&(this[_0x5e3cd1]=_0x205339,_0xfe98c8[_0x5e3cd1]=_0x205339,_0xffac52=!0x0);}_0xffac52&&(_0xfe98c8['authors']&&(_0xfe98c8['authorsIds']=_0xfe98c8['authors']['map'](_0x5ce800=>_0x5ce800['id']),delete _0xfe98c8['authors']),this['fire']('_update',_0xfe98c8,_0x198a21));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x4888f2=>_0x4888f2['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0x15eb24{['_revisions'];static get requires(){return[_0x4fd2f9];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x49fc1d){super(_0x49fc1d),this['_revisions']=new _0x393ab3();}afterInit(){!async function(_0x4b5e7a){const _0x305ab8='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x2d8fc3=0xeb829,_0x56b500=0x797d0,_0x2b1556={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x4012f5(_0x27a4b9){const _0x5dece0=new window['Promise'](_0x12e116=>{_0x27a4b9['once']('ready',_0x12e116);}),_0x448fb9=window['Date']['now'](),_0x3852ae=_0x27a4b9['config']['get']('licenseKey');async function _0x196ec5(){let _0x44b86a,_0x56d5b7=null,_0x37e7fa=null;try{return'GPL'==_0x3852ae?'NotAllowed':(_0x44b86a=_0x2638fa(),_0x44b86a?(_0x44b86a['usageEndpoint']&&(_0x37e7fa=_0x544b82(_0x44b86a['usageEndpoint'],_0x44b86a['jti'])),await _0x32f56f()?_0x5220ef()?_0x1754ed()?'Expired':_0x2debdd()?('evaluation'==_0x44b86a['licenseType']&&(_0x56d5b7=_0x565554('EvaluationLimit')),await _0x5273ba()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1754ed(){const _0x5c3566=['evaluation','trial']['includes'](_0x44b86a['licenseType'])?_0x448fb9/0x3e8:0xe10*_0x56b500;return _0x44b86a['exp']<_0x5c3566;}function _0x5220ef(){const _0x5b6b1f=_0x44b86a['features'];if(!_0x5b6b1f)return!0x1;if(_0x5b6b1f['includes']('*'))return!0x0;if(_0x5b6b1f['includes']('RH'))return!0x0;if(_0x5b6b1f['includes']('RRH')){if(_0x578eb8())return!0x0;if(_0x18a0e6()||_0x430911())return!0x0;}return!0x1;}function _0x2debdd(){const _0x3f32ef=_0x44b86a['licensedHosts'];if(!_0x3f32ef||0x0==_0x3f32ef['length'])return!0x0;const {hostname:_0x273b20}=new URL(window['location']['href']);if(_0x3f32ef['includes'](_0x273b20))return!0x0;const _0x14e0af=_0x273b20['split']('.');return _0x3f32ef['filter'](_0x2c5467=>_0x2c5467['includes']('*'))['map'](_0x545237=>_0x545237['split']('.'))['filter'](_0x49e287=>_0x49e287['length']<=_0x14e0af['length'])['map'](_0x2a96c6=>Array(_0x14e0af['length']-_0x2a96c6['length'])['fill']('*'===_0x2a96c6[0x0]?'*':'')['concat'](_0x2a96c6))['some'](_0x1bcb87=>_0x14e0af['every']((_0xf885f7,_0x4d0afa)=>_0x1bcb87[_0x4d0afa]===_0xf885f7||'*'===_0x1bcb87[_0x4d0afa]));}function _0x5273ba(){return _0x56d5b7&&_0x37e7fa?new window['Promise']((_0x110fe7,_0x2d435c)=>{_0x56d5b7['then'](_0x110fe7,_0x2d435c),_0x37e7fa['then'](_0x1af003=>{'Valid'!=_0x1af003&&_0x110fe7(_0x1af003);},_0x2d435c);}):_0x56d5b7||_0x37e7fa||'Valid';}}function _0x544b82(_0x8a4354,_0x1bcafa){return new window['Promise'](_0x3864a9=>{if(_0x218a8())return _0x3864a9('Valid');_0x4fe032(),_0x27a4b9['decorate']('_sendUsageRequest');let _0xd1e9=!0x1;const _0x2b694f=_0x1502a4();function _0x15877d(_0xbbec11){return!!_0xbbec11&&('object'==typeof _0xbbec11||'function'==typeof _0xbbec11)&&'function'==typeof _0xbbec11['then']&&'function'==typeof _0xbbec11['catch'];}function _0x1d6ab6(_0x4db189){_0x7a1a92(_0x4db189)['then'](_0x70d286=>_0x70d286&&'ok'==_0x70d286['status']?_0x5847da(_0x120c0b(_0x2b694f+_0x1bcafa))!=_0x70d286['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4f505c=>(_0x429207(),_0x4f505c),()=>{const _0x31596d=_0x2b6dae();return null==_0x31596d?(_0x429207(),'Valid'):_0x448fb9-_0x31596d>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3864a9)['catch'](()=>{_0x3864a9('UsageLimit');});const _0x3b58ec=0x36ee80;function _0x429207(){const _0x47011b='llct-'+_0x5847da(_0x120c0b(_0x8a4354)),_0x2fce3b=_0x29f3db(_0x5847da(window['Math']['ceil'](_0x448fb9/_0x3b58ec)));window['localStorage']['setItem'](_0x47011b,_0x2fce3b);}function _0x2b6dae(){const _0x5da530='llct-'+_0x5847da(_0x120c0b(_0x8a4354)),_0xa63eac=window['localStorage']['getItem'](_0x5da530);return _0xa63eac?window['parseInt'](_0x29f3db(_0xa63eac),0x10)*_0x3b58ec:null;}function _0x7a1a92(_0xb69347){return new window['Promise']((_0x51280c,_0x5e2ca7)=>{_0xb69347['then'](_0x51280c,_0x5e2ca7),window['setTimeout'](_0x5e2ca7,0x1d4c0);});}}_0x27a4b9['on']('_sendUsageRequest',(_0x12484e,_0x340321)=>{if(_0x340321[0x0]!=_0x8a4354)return _0x3864a9('UsageLimit');_0x340321[0x1]={..._0x340321[0x1],'requestId':_0x2b694f};},{'priority':'high'}),_0x27a4b9['on']('_sendUsageRequest',_0x35eeb0=>{_0x15877d(_0x35eeb0['return'])&&(_0xd1e9=!0x0,_0x1d6ab6(_0x35eeb0['return']));},{'priority':'low'}),_0x5dece0['then'](()=>{_0xd1e9||_0x3864a9('UsageLimit');});});function _0x218a8(){return'auto'==_0x27a4b9['editing']['view']['_overlayModeHint'];}function _0x4fe032(){_0x27a4b9['editing']['view']['_overlayModeHint']='auto';}}function _0x565554(_0x3cab68){const _0x666a1a=[new window['Promise'](_0x3409ca=>setTimeout(_0x3409ca,0x93ecc)),_0x5dece0['then'](()=>new window['Promise'](_0x5ef50a=>{const _0x2ecc4f=0x7,_0x3b5792=_0x4b5e7a['_revisions'];function _0x26fed4(){_0x3b5792['length']>=_0x2ecc4f&&_0x5ef50a();}_0x26fed4(),_0x3b5792['on']('add',_0x26fed4);})),new window['Promise'](_0x143f16=>{function _0x4ac283(){for(const _0x306cb1 in window)if(window['Number']['isNaN'](window['Number'](_0x306cb1))&&window[_0x306cb1]==_0x2d8fc3)return _0x143f16();'destroyed'!=_0x27a4b9['state']&&window['setTimeout'](_0x4ac283,0x1388);}_0x2caf63('RevisionViewer')&&_0x4ac283();})];return window['Promise']['race'](_0x666a1a)['then'](()=>_0x3cab68);}async function _0x177ad8(){if(await _0x5dece0,_0x2caf63('RevisionViewer')){const _0x15c040=_0x4b5e7a['getRevision'](0x0),_0x2fb6e6=_0x4b5e7a['getEarlierVisibleRevision'](_0x15c040['id']),_0x5b588b=_0x203a42('RevisionViewer');return await _0x5b588b['compare'](_0x15c040['id'],_0x2fb6e6?_0x2fb6e6['id']:null,!0x0),_0x5b588b['unbind']('isEnabled'),_0x5b588b['isEnabled']=!0x1,_0x5b588b['compare']=_0x3e63a6,void(_0x5b588b['_getDiff']=_0x3e63a6);}if(_0x2caf63('RevisionTracker')){const _0x41d825=_0x203a42('RevisionTracker');_0x41d825['unbind']('isEnabled'),_0x41d825['isEnabled']=!0x1,_0x41d825['update']=_0x3e63a6,_0x41d825['saveRevision']=_0x3e63a6;}_0x27a4b9['model']['change']=_0x3e63a6,_0x27a4b9['model']['enqueueChange']=_0x3e63a6,_0x27a4b9['enableReadOnlyMode']('model');}function _0x578eb8(){return _0x2caf63('WebSocketGateway')&&'connected'==_0x203a42('WebSocketGateway')['state'];}function _0x18a0e6(){return _0x2caf63('RevisionViewerIntegration');}function _0x430911(){return _0x2caf63('TrackChangesDataGetter');}function _0x3eab2d(_0x32c531){const _0x26a0dc=_0x476a35();_0x27a4b9[_0x26a0dc]='revisionHistoryLicenseKey'+_0x32c531,_0x32c531['endsWith']('Limit')&&(window[_0x476a35()]=_0x2d8fc3),'Valid'!=_0x32c531&&_0x177ad8();}function _0x476a35(){const _0xf8d695=window['String'](window['performance']['now']())['replace']('.','');let _0x10209e='N';for(let _0x1411b8=0x0;_0x1411b8<_0xf8d695['length'];_0x1411b8+=0x2){let _0x5c4b36=window['parseInt'](_0xf8d695['substring'](_0x1411b8,_0x1411b8+0x2));_0x5c4b36>=0x3e&&(_0x5c4b36-=0x3e),_0x10209e+=_0x305ab8[_0x5c4b36];}return _0x10209e;}function _0x2638fa(){const _0x13830c=_0x3852ae['split']('.');if(0x3!=_0x13830c['length'])return null;return _0x144297(_0x13830c[0x1]);function _0x144297(_0x14b9a2){const _0x92e6c4=_0x5c1541(_0x14b9a2);return _0x92e6c4&&_0x55dc6b()?_0x92e6c4:null;function _0x55dc6b(){const _0x30fea2=_0x92e6c4['jti'],_0x23b24b=window['parseInt'](_0x30fea2['substring'](_0x30fea2['length']-0x8),0x10),_0x4455fe={..._0x92e6c4,'jti':_0x30fea2['substring'](0x0,_0x30fea2['length']-0x8)};return delete _0x4455fe['vc'],_0x120c0b(_0x4455fe)==_0x23b24b;}}}async function _0x32f56f(){let _0x31f9b6=!0x0;try{const [_0x5046be,_0x4b5b7a,_0x2e3aad]=_0x3852ae['split']('.');return _0x45b537(_0x5046be),await _0x3bf5d8(_0x5046be,_0x4b5b7a,_0x2e3aad),_0x31f9b6;}catch{return!0x1;}function _0x45b537(_0x3c6845){const _0x432344=_0x5c1541(_0x3c6845);_0x432344&&'ES256'==_0x432344['alg']||(_0x31f9b6=!0x1);}async function _0x3bf5d8(_0x59ffb2,_0x413baf,_0x509bbb){const _0x191fbd=window['Uint8Array']['from'](_0x42a237(_0x509bbb),_0x583b99=>_0x583b99['charCodeAt'](0x0)),_0x4317ad=new window['TextEncoder']()['encode'](_0x59ffb2+'.'+_0x413baf),_0x11c23a=window['crypto']['subtle'];if(!_0x11c23a)return;const _0x2f44fa=await _0x11c23a['importKey']('jwk',_0x2b1556,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x11c23a['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x2f44fa,_0x191fbd,_0x4317ad)||(_0x31f9b6=!0x1);}}function _0x5c1541(_0x26bced){return _0x26bced['startsWith']('ey')?JSON['parse'](_0x42a237(_0x26bced)):null;}function _0x42a237(_0x458251){return window['atob'](_0x458251['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x120c0b(_0x47b54a){let _0xeb3b16=0x1505;function _0x4d8e65(_0x422c93){for(let _0x334718=0x0;_0x334718<_0x422c93['length'];_0x334718++){const _0x5f0a3a=_0x422c93['charCodeAt'](_0x334718);_0xeb3b16=(_0xeb3b16<<0x5)+_0xeb3b16+_0x5f0a3a,_0xeb3b16&=_0xeb3b16;}}function _0x4f7412(_0x8c1c8a){Array['isArray'](_0x8c1c8a)?_0x8c1c8a['forEach'](_0x4f7412):_0x8c1c8a&&'object'==typeof _0x8c1c8a?Object['entries'](_0x8c1c8a)['sort']()['forEach'](([_0x32752d,_0x5758e5])=>{_0x4d8e65(_0x32752d),_0x4f7412(_0x5758e5);}):_0x4d8e65(window['String'](_0x8c1c8a));}return _0x4f7412(_0x47b54a),_0xeb3b16>>>0x0;}function _0x5847da(_0xeb8f0b){return _0xeb8f0b['toString'](0x10)['padStart'](0x8,'0');}function _0x29f3db(_0xbf6805){return _0xbf6805['split']('')['reverse']()['join']('');}function _0x2caf63(_0x5df806){return _0x27a4b9['plugins']['has'](_0x5df806);}function _0x203a42(_0x34781e){return _0x27a4b9['plugins']['get'](_0x34781e);}function _0x3e63a6(){}_0x3eab2d(await _0x196ec5());}_0x4012f5(_0x4b5e7a['editor']);}(this);}createRevision(_0x5f3209){const _0x580c86=this['editor']['plugins']['get']('Users');return new yt({'id':_0x5f3209['id'],'name':_0x5f3209['name'],'creator':_0x5f3209['creatorId']?_0x580c86['getUser'](_0x5f3209['creatorId']):null,'diffData':_0x5f3209['diffData']||_0x5f3209['data'],'authors':_0x5f3209['authorsIds']['map'](_0x372175=>_0x580c86['getUser'](_0x372175)),'createdAt':new Date(_0x5f3209['createdAt']),'attributes':_0x5f3209['attributes'],'fromVersion':_0x5f3209['fromVersion'],'toVersion':_0x5f3209['toVersion']});}['addRevision'](_0x53ea03,_0x2e2299=0x0){this['_revisions']['add'](_0x53ea03,_0x2e2299);}getRevision(_0x17babb){return this['_revisions']['get'](_0x17babb);}getRevisions(_0x310a1e={'toJSON':!0x1}){const _0x58a498=Array['from'](this['_revisions']);return _0x58a498['reverse'](),_0x310a1e['toJSON']?_0x58a498['map'](_0x1107b1=>_0x1107b1['toJSON']()):_0x58a498;}getIndex(_0x9a74cc){return this['_revisions']['getIndex'](_0x9a74cc);}getEarlierVisibleRevision(_0x2aa26a){const [,_0x16f165]=this['getRevisionsIterator'](_0x2aa26a,{'direction':'earlier'});return _0x16f165;}getLaterVisibleRevision(_0xa5af30){const [,_0x186efa]=this['getRevisionsIterator'](_0xa5af30,{'direction':'later'});return _0x186efa;}getRevisionsInDiff(_0x13a27f){const _0x1312d8=[];for(const _0x37e15f of this['getRevisionsIterator'](_0x13a27f['newRevisionId']))if(_0x1312d8['push'](_0x37e15f),_0x37e15f['id']===_0x13a27f['oldRevisionId'])break;return _0x1312d8;}*getRevisionsIterator(_0x1296e5,{direction:_0x4d6aad='earlier',filter:_0x407f68=()=>!0x0}={}){const _0x4cec08='earlier'===_0x4d6aad?0x1:-0x1;let _0x40ffc2=this['_revisions']['get'](_0x1296e5),_0x571f68=this['getIndex'](_0x40ffc2);for(yield _0x40ffc2;_0x40ffc2;){if(_0x571f68+=_0x4cec08,_0x40ffc2=this['getRevision'](_0x571f68),!_0x40ffc2)return;_0x407f68(_0x40ffc2)&&(yield _0x40ffc2);}}},Rt=class extends _0x15eb24{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x4dc6ae,'c'],[_0x1fdffa,'a'],[_0x46448d,'e'],[_0x1a0c46,'r'],[_0x22ec75,'u']]);_typeCharToViewClass=new Map([['c',_0x4dc6ae],['a',_0x1fdffa],['e',_0x46448d],['r',_0x1a0c46],['u',_0x22ec75]]);async loadRevisionData(_0x1afbe6,_0x5e075a){if(_0x1afbe6['diffData']||!_0x5e075a)return;const _0x5862c1=this['editor']['config']['get']('collaboration.channelId');_0x1afbe6['diffData']=(await _0x5e075a['getRevision']({'channelId':_0x5862c1,'revisionId':_0x1afbe6['id']}))['diffData'];}getRevisionDocumentData(_0x98bfd8){const _0x37b341={};for(const _0x220f40 in _0x98bfd8['diffData']){if(_0x98bfd8['diffData'][_0x220f40]['attachChange']&&!_0x98bfd8['diffData'][_0x220f40]['attachChange']['isAttached'])continue;const _0x4e1c4c=this['_removeRevisionMarkers'](JSON['parse'](_0x98bfd8['diffData'][_0x220f40]['insertions'])),_0x56e99b=this['editor']['editing']['view']['document'],_0x296ea6=new _0x55900d(_0x56e99b,_0x4e1c4c['map'](_0x2f6e1c=>this['_getViewFromDiffObj'](_0x2f6e1c,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x37b341[_0x220f40]=this['editor']['data']['processor']['toData'](_0x296ea6),this['editor']['data']['processor']['useFillerType']('default');}return _0x37b341;}getRevisionRootsAttributes(_0x1caf09){const _0x4ae57c={};for(const _0x1109d8 in _0x1caf09['diffData'])_0x1caf09['diffData'][_0x1109d8]['attachChange']&&!_0x1caf09['diffData'][_0x1109d8]['attachChange']['isAttached']||(_0x4ae57c[_0x1109d8]=_0x1caf09['diffData'][_0x1109d8]['attributesAfter']||{});return _0x4ae57c;}getRevisionRootsModelElements(_0x20d7f3){const _0x1031c2={};for(const _0x1e4363 in _0x20d7f3['diffData']){if(_0x20d7f3['diffData'][_0x1e4363]['attachChange']&&!_0x20d7f3['diffData'][_0x1e4363]['attachChange']['isAttached'])continue;const _0xea3cad=_0x20d7f3['diffData'][_0x1e4363]['rootElementName'];_0xea3cad&&(_0x1031c2[_0x1e4363]=_0xea3cad);}return _0x1031c2;}_getTypeCharForViewElement(_0x563658){return this['_viewClassToTypeChar']['get'](_0x563658['constructor']);}_getViewFromDiffObj(_0x2d8a13,_0x5aed75){const _0x29d2ea=this['editor']['editing']['view']['document'];if('string'==typeof _0x2d8a13)return new _0x2f41ca(_0x29d2ea,_0x2d8a13);{let _0x5d6933,_0x8632b8;_0x8632b8='u'==_0x2d8a13['type']||'r'==_0x2d8a13['type']?[]:_0x2d8a13['children']['map'](_0x4bda64=>this['_getViewFromDiffObj'](_0x4bda64,_0x5aed75));const _0x4b7440=this['_typeCharToViewClass']['get'](_0x2d8a13['type'])||_0x41ead9,_0x41b682=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x5d6933=new _0x4b7440(_0x29d2ea,_0x2d8a13['name'],_0x2d8a13['attributes'],_0x8632b8),'u'==_0x2d8a13['type']&&_0x2d8a13['children'][0x0]){const _0x420b58=_0x2d8a13['children'][0x0];if(_0x5d6933['render']=function(_0x3ccbce){const _0x34247d=_0x3ccbce['createElement']('div');return _0x34247d['innerHTML']=_0x3ee93e(_0x420b58),_0x34247d['childNodes'][0x0];},_0x5aed75){const _0x520735=new _0x55900d(_0x29d2ea);_0x520735['_appendChild'](_0x5d6933);const _0x284e5f=Array['from'](_0x41b682['viewChildrenToDom'](_0x520735,{'bind':!0x1})),_0x132a85=_0x41b682['domDocument']['createElement']('div');_0x132a85['append'](..._0x284e5f),_0x5d6933=Array['from'](_0x41b682['domChildrenToView'](_0x132a85))[0x0];}}else{if('r'==_0x2d8a13['type']&&_0x2d8a13['children'][0x0]){const _0x1a5ab4=_0x2d8a13['children'][0x0];if(_0x5d6933['render']=function(_0x2f1c10){_0x2f1c10['innerHTML']=_0x3ee93e(_0x1a5ab4);},_0x5aed75){const _0x2e936c=new _0x55900d(_0x29d2ea);_0x2e936c['_appendChild'](_0x5d6933);const _0x8fffc3=Array['from'](_0x41b682['viewChildrenToDom'](_0x2e936c,{'bind':!0x1})),_0xa4d84d=_0x41b682['domDocument']['createElement']('div');_0xa4d84d['append'](..._0x8fffc3);const _0x1065a6=Array['from'](_0x41b682['domChildrenToView'](_0xa4d84d));_0x1065a6['length']>0x1?_0x5d6933['_appendChild'](_0x1065a6):_0x5d6933=_0x1065a6[0x0];}}}if(_0x2d8a13['customProperties']){for(const [_0x241760,_0x424c28]of _0x2d8a13['customProperties'])_0x5d6933['_setCustomProperty'](_0x241760,_0x424c28);}const _0x3a7d81=void 0x0===_0x2d8a13['fillerOffset']?null:_0x2d8a13['fillerOffset'];return null!==_0x3a7d81&&(_0x5d6933['getFillerOffset']=()=>_0x3a7d81),_0x5d6933;}}_makeModelFromViewString(_0xb2d8ad,_0x15b9ff){const _0x4b7156=JSON['parse'](_0xb2d8ad),_0x213d8b=this['editor']['editing']['view']['document'],_0x5871c2=new _0x55900d(_0x213d8b,_0x4b7156['map'](_0x288dd9=>this['_getViewFromDiffObj'](_0x288dd9,!0x0))),_0x41d0bc=this['editor']['data']['toModel'](_0x5871c2,_0x15b9ff);return _0x41d0bc['name']=_0x15b9ff,_0x41d0bc;}['_removeRevisionMarkers'](_0x5c818d){return(_0x5c818d=_0x5c818d['filter'](_0x51c644=>!_0x51c644['name']||'revision-start'!==_0x51c644['name']&&'revision-end'!==_0x51c644['name']))['forEach'](_0x34338e=>{'string'!=typeof _0x34338e&&(_0x34338e['children']=this['_removeRevisionMarkers'](_0x34338e['children']),_0x34338e['attributes']=_0x34338e['attributes']['filter'](_0x18cbcc=>!_0x18cbcc[0x0]['startsWith']('data-revision-')));}),_0x5c818d;}};function kt(_0x2f9c41,_0x116dbe,_0x10dff3){const t=_0x2f9c41['t'];switch(_0x116dbe){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'},_0x10dff3);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x10dff3);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'},_0x10dff3);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x10dff3);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x10dff3);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0x15eb24{['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[_0x4fd2f9,bt,Rt,_0x17fbd0];}constructor(_0x533337){super(_0x533337),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new It(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x3150c2=_0x1502a4();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x3150c2},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 _0x4e03cb=this['repository']['getRevision'](0x0),_0x4430be=_0x4e03cb&&null===_0x4e03cb['creator']?_0x4e03cb:null;if(this['_continueCurrentRevision']=!!_0x4430be&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x526c51=this['_source']['getCurrentRevisionId'](),_0x25324b=this['repository']['getRevision'](_0x526c51);if(_0x25324b)this['_startingVersion']=_0x25324b['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x41f7ce=this['_source']['history']['_operations']['find'](_0x4dfe9b=>!_0x4dfe9b['_isInit']),_0x24d9b8=_0x41f7ce?_0x41f7ce['baseVersion']:this['_source']['history']['version'];_0x4e03cb?(_0x4e03cb['toVersion']<_0x24d9b8&&_0x4e03cb['_update']({'toVersion':_0x24d9b8}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x4430be['id'],this['_startingVersion']=_0x4430be['fromVersion']):(this['_startingVersion']=_0x4e03cb['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x24d9b8,this['_continueCurrentRevision']=!0x1);}}else _0x4430be&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x4430be['toVersion'],this['editor']['model']['document']['history']['version']),_0x4430be['fromVersion']===_0x4430be['toVersion']?(0x0!==_0x4430be['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x4430be['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x4430be['id'],this['_startingVersion']=_0x4430be['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',_0x552439=>!_0x552439),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x121a95=[this['editor']];for(const _0x4f17d6 of _0x121a95){let _0x50ff0c;for(const _0x2f837c in _0x4f17d6){const _0x5c9f2a=_0x2f837c,_0x2b2ea4=_0x4f17d6[_0x5c9f2a];if('revisionHistoryLicenseKeyValid'==_0x2b2ea4||'revisionHistoryLicenseKeyInvalid'==_0x2b2ea4||'revisionHistoryLicenseKeyExpired'==_0x2b2ea4||'revisionHistoryLicenseKeyDomainLimit'==_0x2b2ea4||'revisionHistoryLicenseKeyNotAllowed'==_0x2b2ea4||'revisionHistoryLicenseKeyEvaluationLimit'==_0x2b2ea4||'revisionHistoryLicenseKeyUsageLimit'==_0x2b2ea4){delete _0x4f17d6[_0x5c9f2a],_0x50ff0c=_0x2b2ea4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x50ff0c&&_0x4f17d6['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x50ff0c&&_0x4f17d6['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x50ff0c&&_0x4f17d6['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x50ff0c&&_0x4f17d6['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x50ff0c&&_0x4f17d6['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x50ff0c&&_0x4f17d6['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x501820=this['repository']['getRevision'](0x0),_0x55b178=await this['getRevisionDocumentData'](_0x501820),_0x18a9a3=await this['getRevisionRootsAttributes'](_0x501820),_0x7effe1=this['_utils']['getRevisionRootsModelElements'](_0x501820);this['_replaceEditorDataWithRevisionData'](_0x55b178,_0x18a9a3,_0x7effe1);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x1acacd){this['_source']=_0x1acacd;}async update(){const _0x2c15af=await this['_source']['getLatestVersion']();if(_0x2c15af>this['currentRevision']['toVersion']){await this['_loadState']();const _0x3d5466=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x2c15af});_0x3d5466['authors']=_0x3d5466['authorsIds']['map'](_0x552e50=>this['editor']['plugins']['get']('Users')['getUser'](_0x552e50)),this['currentRevision']['_update'](_0x3d5466);}}async['saveRevision'](_0x2dd1a1={},_0x2569d4=null){const _0x338ad6=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x2569d4>this['currentRevision']['toVersion']&&(_0x2569d4=null),null===_0x2569d4&&(_0x2569d4=await this['_source']['getLatestVersion']());const _0x27bccb=this['_getFromVersion'](_0x2569d4),_0x1452a7=this['buildRevisionData']({'from':_0x27bccb,'to':_0x2569d4});if(this['currentRevision']['toVersion']<_0x2569d4){const _0x53d2bd=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x2569d4,'to':_0x2569d4});_0x53d2bd['authors']=[],_0x53d2bd['authorsIds']=[],_0x53d2bd['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x53d2bd,!0x0),delete _0x53d2bd['authors'],_0x338ad6['push'](_0x53d2bd);}const _0xa215e5={..._0x2dd1a1,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x2dd1a1['name']||null,'id':_0x2dd1a1['id']||_0x1502a4(),..._0x1452a7,'attributes':{..._0x2dd1a1['attributes'],..._0x1452a7['attributes']}},_0x32b19d=this['addRevisionData'](_0xa215e5);_0x338ad6['push'](_0xa215e5);const _0x32da6d=this['repository']['getIndex'](_0x32b19d);if(0x0!==_0x32da6d){const _0x4e6e2a=this['repository']['getRevision'](_0x32da6d-0x1);if(_0x4e6e2a['fromVersion']!==_0x2569d4){const _0xb276f2=this['_revisionDataBuilder']['getData'](_0x2569d4,_0x4e6e2a['toVersion']),_0x1cedda={'id':_0x4e6e2a['id'],'diffData':_0xb276f2['diffData'],'authorsIds':_0xb276f2['authorsIds'],'authors':_0xb276f2['authorsIds']['map'](_0x2625fc=>this['editor']['plugins']['get']('Users')['getUser'](_0x2625fc)),'fromVersion':_0x2569d4};this['_stampAiAttribute'](_0x1cedda,_0x4e6e2a,!!_0xb276f2['hasAIChanges']),_0x4e6e2a===this['currentRevision']&&(_0x1cedda['createdAt']=new Date(_0xa215e5['createdAt']['getTime']()+0xa)),_0x4e6e2a['_update'](_0x1cedda,!0x0),delete _0x1cedda['authors'],_0x338ad6['push'](_0x1cedda);}}if(this['adapter']){for(const _0x3ad6d2 of _0x338ad6)this['_bufferUpdate'](_0x3ad6d2['id'],_0x3ad6d2,!0x0);this['sendBufferedUpdates']();}return _0x32b19d;}addRevisionData(_0x36e84c){const _0x5449f0=this['repository']['createRevision'](_0x36e84c);return this['adapter']&&_0x5449f0['on']('_update',(_0x1118c0,_0x519b60,_0x21d544)=>{_0x21d544||(this['_bufferUpdate'](_0x519b60['id'],_0x519b60,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x5449f0,this['_findInsertionIndex'](_0x5449f0)),_0x5449f0;}async getRevisionDocumentData(_0x46b8cc){return await this['_utils']['loadRevisionData'](_0x46b8cc,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x46b8cc);}async getRevisionRootsAttributes(_0x23bdcd){return await this['_utils']['loadRevisionData'](_0x23bdcd,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x23bdcd);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x15859e=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x5c230f=0x0;_0x5c230f<_0x15859e['length'];_0x5c230f++){const _0x3612cf=_0x15859e[_0x5c230f];let _0x5eb74a=!0x1;for(const _0x1a7727 of Object['keys'](_0x3612cf))void 0x0===_0x3612cf[_0x1a7727]?delete _0x3612cf[_0x1a7727]:'id'!==_0x1a7727&&(_0x5eb74a=!0x0);_0x5eb74a||(_0x15859e[_0x5c230f]=null);}if(_0x15859e=_0x15859e['filter'](_0x4143c6=>null!==_0x4143c6),!_0x15859e['length'])return;for(let _0x32b450=0x0;_0x32b450<_0x15859e['length'];_0x32b450++){const _0x5411c5=_0x15859e[_0x32b450];void 0x0!==_0x5411c5['fromVersion']&&void 0x0===_0x5411c5['toVersion']&&(_0x5411c5['toVersion']=this['repository']['getRevision'](_0x5411c5['id'])['toVersion']),void 0x0!==_0x5411c5['toVersion']&&void 0x0===_0x5411c5['fromVersion']&&(_0x5411c5['fromVersion']=this['repository']['getRevision'](_0x5411c5['id'])['fromVersion']);}const _0x484dab=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x15859e,_0x484dab)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x29bd7d=>{if(_0x29bd7d){for(const _0x437653 of _0x29bd7d)this['setRevisionData']({'id':_0x437653['id'],'createdAt':_0x437653['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x279a6d,_0x22e398,_0x5bfba8){if(_0x5bfba8===(!!_0x22e398&&!!_0x22e398['attributes']['@ai']))return;const _0x3d8e3b={..._0x22e398?_0x22e398['attributes']:{},..._0x279a6d['attributes']};_0x5bfba8?_0x3d8e3b['@ai']=!0x0:delete _0x3d8e3b['@ai'],_0x279a6d['attributes']=_0x3d8e3b;}buildRevisionData({revision:_0x4722ac=null,from:_0x2b3bf8=null,to:_0x43ac96=null}){_0x2b3bf8=null!==_0x2b3bf8?_0x2b3bf8:_0x4722ac['fromVersion'],_0x43ac96=null!==_0x43ac96?_0x43ac96:_0x4722ac['toVersion'];const _0xfb490f=this['_revisionDataBuilder']['getData'](_0x2b3bf8,_0x43ac96),_0x3384f6={'diffData':_0xfb490f['diffData'],'authorsIds':_0xfb490f['authorsIds'],'fromVersion':_0x2b3bf8,'toVersion':_0x43ac96};if(this['_stampAiAttribute'](_0x3384f6,_0x4722ac,!!_0xfb490f['hasAIChanges']),!_0x4722ac||_0x43ac96!==_0x4722ac['toVersion']){const _0x553167=_0x43ac96-0x1,_0x35cc06=this['_source']['history']['getOperation'](_0x553167);_0x3384f6['createdAt']=_0x35cc06&&_0x35cc06['createdAt']||new Date();}if(this['_loadedStateData']&&_0x2b3bf8===this['_loadedStateData']['fromVersion']){for(const _0x4b905c of this['_loadedStateData']['authors'])_0x3384f6['authorsIds']['includes'](_0x4b905c['id'])||_0x3384f6['authorsIds']['push'](_0x4b905c['id']);}return _0x3384f6;}_bufferUpdate(_0x379ff7,_0x10fb6b,_0x948896){if(this['_bufferedUpdates']['has'](_0x379ff7)){const _0x4c4691=this['_bufferedUpdates']['get'](_0x379ff7);_0x10fb6b=_0x948896?{..._0x4c4691,..._0x10fb6b}:{..._0x10fb6b,..._0x4c4691};}this['_bufferedUpdates']['set'](_0x379ff7,_0x10fb6b);}setRevisionData(_0x9a7da4){const _0x1879e1=this['repository']['getRevision'](_0x9a7da4['id']);if(_0x9a7da4['createdAt']&&(_0x9a7da4['createdAt']=new Date(_0x9a7da4['createdAt'])),_0x9a7da4['authorsIds']){const _0x4ef46=this['editor']['plugins']['get']('Users');_0x9a7da4['authors']=_0x9a7da4['authorsIds']['map'](_0x42db00=>_0x4ef46['getUser'](_0x42db00));}_0x1879e1['_update'](_0x9a7da4,!0x0);}_createInitialRevision(_0x32e788){const _0x4a4206=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x4a4206)this['_initialRevisionId']=_0x4a4206['id'];else{const _0x5f125b=!this['editor']['model']['document']['roots']['find'](_0x28214b=>this['editor']['model']['hasContent'](_0x28214b)),_0x21f4fb=this['editor']['plugins']['get']('Users')['me']['id'],_0x35aa9e=kt(this['editor']['locale'],_0x5f125b?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x32e788,'to':_0x32e788,'id':this['_initialRevisionId'],'name':_0x35aa9e,'creatorId':_0x21f4fb});}}_createCurrentRevision(_0xf4c8d6){const _0x1a9342=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x1a9342),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0xf4c8d6,'to':_0xf4c8d6,'id':_0x1a9342,'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(_0x37e27f,_0x4964d2,_0x2fc8f5){const _0x1057b5={},_0x5934c7={},_0x2d6e8a={},_0x22005b=this['editor']['config']['get']('roots')||{};for(const [_0x426550,_0xc3455e]of Object['entries'](_0x22005b))_0xc3455e['lazyLoad']||(_0x1057b5[_0x426550]=_0xc3455e['initialData']??'',_0x5934c7[_0x426550]=_0xc3455e['modelAttributes']||{},_0xc3455e['modelElement']&&(_0x2d6e8a[_0x426550]=_0xc3455e['modelElement']));for(const _0x25306c of this['editor']['model']['document']['getRootNames']())_0x1057b5[_0x25306c]??='',_0x5934c7[_0x25306c]??={};let _0x4a0226=!0x1;const _0xce66bb=Object['keys'](_0x1057b5),_0x3013b2=Object['keys'](_0x37e27f);for(const _0x4d7ffb of _0xce66bb){if(_0x1057b5[_0x4d7ffb]!==_0x37e27f[_0x4d7ffb]&&''!==_0x1057b5[_0x4d7ffb]['trim']()){_0x4a0226=!0x0;break;}if(!_0x21fb00(_0x5934c7[_0x4d7ffb],_0x4964d2[_0x4d7ffb])&&Object['keys'](_0x5934c7[_0x4d7ffb])['length']>0x0){_0x4a0226=!0x0;break;}const _0x3fc43e=_0x2d6e8a[_0x4d7ffb],_0x12c167=_0x2fc8f5[_0x4d7ffb];if(_0x3fc43e&&_0x12c167&&_0x3fc43e!==_0x12c167){_0x4a0226=!0x0;break;}}_0x4a0226||(_0x4a0226=_0x3013b2['some'](_0x59412a=>!this['editor']['model']['document']['getRoot'](_0x59412a))),_0x4a0226&&_0x46499c('editor-initial-data-replaced-with-revision-data',{'editorData':_0x1057b5,'editorRootsAttributes':_0x5934c7,'editorRootsModelElements':_0x2d6e8a,'revisionData':_0x37e27f,'revisionRootsAttributes':_0x4964d2,'revisionRootsModelElements':_0x2fc8f5});for(const [_0x2d7585,_0x39fc14]of Object['entries'](_0x37e27f))this['editor']['config']['set']('roots.'+_0x2d7585+'.initialData',_0x39fc14);for(const [_0x5b6887,_0x2c78fa]of Object['entries'](_0x4964d2))this['editor']['config']['set']('roots.'+_0x5b6887+'.modelAttributes',_0x2c78fa);const _0x133bf7=this['editor']['model']['document'];for(const [_0x4fe5ac,_0x54b94a]of Object['entries'](_0x2fc8f5)){this['editor']['config']['set']('roots.'+_0x4fe5ac+'.modelElement',_0x54b94a);const _0x278f25=_0x133bf7['getRoot'](_0x4fe5ac);_0x278f25&&_0x278f25['name']!==_0x54b94a&&(_0x133bf7['roots']['remove'](_0x4fe5ac),_0x133bf7['createRoot'](_0x54b94a,_0x4fe5ac));}}_addPendingAction(){if(!this['_pendingAction']){const _0x46a66a=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x46a66a['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x144392){const _0x45603a=this['repository']['getRevisions']();_0x45603a['reverse']();let _0x31a2ad=0x0;for(;_0x31a2ad<_0x45603a['length'];){const _0x53c265=_0x45603a[_0x31a2ad];if(_0x53c265===this['currentRevision']){_0x31a2ad++;continue;}if(_0x53c265['id']===this['_initialRevisionId'])break;const _0x346c66=_0x144392['toVersion']-_0x53c265['toVersion']||_0x144392['fromVersion']-_0x53c265['fromVersion'];if(_0x346c66>0x0)break;if(_0x346c66<0x0)_0x31a2ad++;else{if(!_0x144392['creator']&&_0x53c265['creator'])break;if(_0x53c265['creator']||!_0x144392['creator']){if(_0x144392['createdAt']>_0x53c265['createdAt'])break;_0x31a2ad++;}else _0x31a2ad++;}}return _0x31a2ad;}_getFromVersion(_0x1015e8){const _0x5ed1a5=this['repository']['getRevisions']();_0x5ed1a5['reverse'](),_0x5ed1a5['shift']();const _0x384dbd=_0x5ed1a5['find'](_0x173bc7=>_0x173bc7['toVersion']<=_0x1015e8)['toVersion'];return _0x384dbd<this['_startingVersion']?this['_startingVersion']:_0x384dbd;}['_makeRevision']({name:_0x111158,from:_0x92a406,to:_0x172d6e,creatorId:_0x4b226d,id:_0x23bf73}){const _0x36ccd3=this['buildRevisionData']({'from':_0x92a406,'to':_0x172d6e});_0x36ccd3['name']=_0x111158,_0x36ccd3['creatorId']=_0x4b226d,_0x36ccd3['id']=_0x23bf73;const _0x5c4434=this['addRevisionData'](_0x36ccd3);return this['adapter']&&this['_bufferUpdate'](_0x36ccd3['id'],_0x36ccd3,!0x0),_0x5c4434;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},It=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x49fad9){this['editor']=_0x49fad9,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(_0x47ccc1){this['source']=_0x47ccc1;const _0x137af4=new Map(),_0x123798=new Map(),_0x478d3e=this['editor']['model']['document']['roots']['map'](_0x3149f4=>_0x3149f4['rootName']);for(const _0xd4a22f of _0x478d3e){const _0x4c1b54=this['editor']['model']['document']['getRoot'](_0xd4a22f),_0x45eab2=St(_0x4c1b54);_0x137af4['set'](_0xd4a22f,_0x45eab2),_0x123798['set'](_0xd4a22f,Object['fromEntries'](_0x4c1b54['getAttributes']()));}const _0x1a6e0a=Array['from'](this['editor']['model']['markers'])['map'](_0x229892=>[_0x229892['name'],_0x229892['getRange']()]),_0x3914ad=this['source']['version'];this['_saveMetaData'](_0x3914ad,_0x137af4,_0x1a6e0a,_0x123798),this['_startingRevisionId']=this['_revisionId'];const _0x4573ca=new Map(),_0x1e407e=new Map();for(const _0x13e7db of _0x478d3e){const _0x2866=Et(_0x13e7db,this['editor']['model']['document']['getRoot'](_0x13e7db)['name']);_0x4573ca['set'](_0x13e7db,_0x2866),_0x1e407e['set'](_0x13e7db,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x4573ca,[],_0x1e407e);}getData(_0x259a87,_0x35dee9){if(this['_lastFrom']===_0x259a87&&this['_lastTo']<=_0x35dee9)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x35dee9,!0x0);else{if(!this['_savedMetaData']['has'](_0x259a87)){const _0x2aa792=this['_getPreviousFrom'](_0x259a87);this['_calculateMetaData'](_0x2aa792,_0x259a87,!0x1);}this['_calculateMetaData'](_0x259a87,_0x35dee9,!0x0);}return this['_lastFrom']=_0x259a87,this['_lastTo']=_0x35dee9,this['_getState']();}loadState(_0x208f34){if(!this['_savedMetaData']['has'](_0x208f34['fromVersion'])){const _0x4421c5=this['_getPreviousFrom'](_0x208f34['fromVersion']);this['_calculateMetaData'](_0x4421c5,_0x208f34['fromVersion'],!0x1);}this['_calculateMetaData'](_0x208f34['fromVersion'],_0x208f34['toVersion'],!0x1);const _0x42ed59=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x208f34['fromVersion'],this['_lastTo']=_0x208f34['toVersion'];for(const _0x17bfc1 in _0x208f34['diffData']){const _0x57f597=_0x208f34['diffData'][_0x17bfc1]['attachChange'],_0x191855=_0x2b717e(_0x208f34['diffData'][_0x17bfc1]['attributesBefore'])||{},_0x339e5c=_0x208f34['diffData'][_0x17bfc1],_0x3aff5a=_0x42ed59['_makeModelFromViewString'](_0x339e5c['deletions'],_0x339e5c['rootElementName']||'$root');_0x3aff5a['rootName']=_0x17bfc1,_0x3aff5a['_isAttached']=!_0x57f597||!_0x57f597['isAttached'],_0x3aff5a['isAttached']=()=>_0x3aff5a['_isAttached'],this['_baseRoots']['set'](_0x17bfc1,_0x3aff5a),this['_baseRootsAttributes']['set'](_0x17bfc1,_0x191855),_0x57f597&&this['_touchedRoots']['set'](_0x17bfc1,_0x57f597);const _0x4681d7=this['_makeIdsRoot'](_0x3aff5a);this['_baseIdsRoots']['set'](_0x17bfc1,_0x4681d7);for(const [_0x155307,_0x5131da]of _0x3aff5a['markers']){if(!_0x155307['startsWith']('revision:'))continue;const _0x2e494e=_0x155307['split'](':')[0x2],_0x339828=_0x339e5c['aiSources']?.[_0x155307]||null;for(const _0x215566 of _0x5131da['getWalker']({'singleCharacters':!0x0})){const _0x4d770c=this['_getVidAttributeName'](_0x215566),_0x464795='elementEnd'==_0x215566['type']?_0x215566['previousPosition']['path']['slice'](0x0,-0x1):_0x215566['previousPosition']['path'],_0x107855=_0x4681d7['getNodeByPath'](_0x464795)['getAttribute'](_0x4d770c);this['_touched']['set'](_0x107855,{'userId':_0x2e494e,'aiSource':_0x339828});}_0x3aff5a['markers']['delete'](_0x155307);}}this['_startingRevisionId']=this['_revisionId'];const _0x97cb1d=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x1852be=>!this['_touched']['has'](_0x1852be));let _0x1a8e76=0x0;const _0x509083=new Map();for(const _0x438f42 in _0x208f34['diffData']){const _0x6f51b0=_0x208f34['diffData'][_0x438f42]['attachChange'],_0x19b56b=_0x2b717e(_0x208f34['diffData'][_0x438f42]['attributesAfter'])||{},_0x269f73=_0x208f34['diffData'][_0x438f42],_0xe3ccc0=_0x42ed59['_makeModelFromViewString'](_0x269f73['insertions'],_0x269f73['rootElementName']||'$root');_0xe3ccc0['rootName']=_0x438f42,_0xe3ccc0['_isAttached']=!_0x6f51b0||_0x6f51b0['isAttached'],_0xe3ccc0['isAttached']=()=>_0xe3ccc0['_isAttached'],this['_diffRoots']['set'](_0x438f42,_0xe3ccc0),this['_diffRootsAttributes']['set'](_0x438f42,_0x19b56b);const _0x1bc1a2=this['_makeIdsRoot'](_0xe3ccc0,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x438f42,_0x1bc1a2),_0x509083['set'](_0x438f42,_0xe3ccc0['isAttached']()?_0x19b56b:{});for(const [_0x44f367,_0x493d7f]of _0xe3ccc0['markers']){if(!_0x44f367['startsWith']('revision:'))continue;const _0x5b9601=_0x44f367['split'](':')[0x2],_0x469ac7=_0x269f73['aiSources']?.[_0x44f367]||null;for(const _0x7b2c18 of _0x493d7f['getWalker']({'singleCharacters':!0x0})){const _0x444e63=this['_getVidAttributeName'](_0x7b2c18),_0xe9464=this['_revisionId']++,_0x5912cb='elementEnd'==_0x7b2c18['type']?_0x7b2c18['previousPosition']['path']['slice'](0x0,-0x1):_0x7b2c18['previousPosition']['path'];_0x1bc1a2['getNodeByPath'](_0x5912cb)['_setAttribute'](_0x444e63,_0xe9464),this['_touched']['set'](_0xe9464,{'userId':_0x5b9601,'aiSource':_0x469ac7});}_0xe3ccc0['markers']['delete'](_0x44f367);}for(const _0x409e74 of this['editor']['model']['createRangeIn'](_0xe3ccc0)['getWalker']({'singleCharacters':!0x0})){const _0x53bbb8=this['_getVidAttributeName'](_0x409e74),_0x1ce12d='elementEnd'==_0x409e74['type']?_0x409e74['previousPosition']['path']['slice'](0x0,-0x1):_0x409e74['previousPosition']['path'],_0x5b65ce=_0x1bc1a2['getNodeByPath'](_0x1ce12d);_0x5b65ce['getAttribute'](_0x53bbb8)>0x0||_0x5b65ce['_setAttribute'](_0x53bbb8,_0x97cb1d[_0x1a8e76++]);}for(const [_0x348728,_0x22ee56]of _0xe3ccc0['markers'])_0x348728['startsWith']('revision:')||this['_markers']['set'](_0x348728,_0x22ee56);}const {roots:_0x20b73c}=this['_savedMetaData']['get'](_0x208f34['fromVersion']),{roots:_0x401960}=this['_savedMetaData']['get'](_0x208f34['toVersion']),_0x4a13ea=St(_0x20b73c['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x4a13ea),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x4a13ea,Number['NEGATIVE_INFINITY']));const _0xbc12b1=St(_0x401960['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0xbc12b1),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0xbc12b1));const _0x597b03=Array['from'](this['_diffRoots'])['map'](([_0x45dee5,_0x22114a])=>[_0x45dee5,St(_0x22114a)]);this['_saveMetaData'](this['_lastTo'],_0x597b03,this['_markers'],_0x509083);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x2dd633,_0x1b672b,_0x403830,_0x303604){const _0xb253ed=new Map(_0x1b672b),_0x534777=new Map(_0x2b717e(_0x303604)),_0x2f96f7=new Map();for(const [_0x48626a,_0x4d0fb6]of _0x403830)_0x2f96f7['set'](_0x48626a,{'start':_0x4d0fb6['start']['clone'](),'end':_0x4d0fb6['end']['clone'](),'rootName':_0x4d0fb6['root']['rootName']});this['_savedMetaData']['set'](_0x2dd633,{'roots':_0xb253ed,'markers':_0x2f96f7,'rootsAttributes':_0x534777});}_removeMetaData(_0x3a99bb){this['_savedMetaData']['delete'](_0x3a99bb);}_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(_0x2d4fd6,_0x2d0591=null){let _0x4b2c55=null;_0x2d4fd6['is']('documentFragment')||(_0x4b2c55=new _0x1868f7(_0x2d4fd6['name'],{'vid_start':null===_0x2d0591?this['_revisionId']++:_0x2d0591++}));const _0x23b632=[];for(const _0x433a12 of _0x2d4fd6['getChildren']())if(_0x433a12['is']('element')){_0x23b632['push'](this['_makeIdsRoot'](_0x433a12,_0x2d0591));const _0x5cd69d=_0x23b632[_0x23b632['length']-0x1];null!==_0x2d0591&&(_0x2d0591=_0x5cd69d['is']('element','$text')?_0x5cd69d['getAttribute']('vid')+0x1:_0x5cd69d['getAttribute']('vid_end')+0x1);}else{for(let _0x36e232=0x0;_0x36e232<_0x433a12['offsetSize'];_0x36e232++)_0x23b632['push'](new _0x1868f7('$text',{'vid':null===_0x2d0591?this['_revisionId']++:_0x2d0591++}));}if(_0x2d4fd6['is']('documentFragment')){const _0x3fe6b4=Et(_0x2d4fd6['rootName'],_0x2d4fd6['name']);return _0x3fe6b4['_insertChild'](0x0,_0x23b632),_0x3fe6b4;}return _0x4b2c55['_setAttribute']('vid_end',null===_0x2d0591?this['_revisionId']++:_0x2d0591),_0x4b2c55['_insertChild'](0x0,_0x23b632),_0x4b2c55;}_calculateMetaData(_0x4e01bd,_0x502bb1,_0x395f37){this['_reset']();const {roots:_0x57dddb,markers:_0x43aa07,rootsAttributes:_0x519cf0}=this['_savedMetaData']['get'](_0x4e01bd);this['_baseRoots']=new Map(_0x57dddb),this['_baseRootsAttributes']=new Map(_0x2b717e(_0x519cf0));for(const [_0x4b8955,_0x274a17]of this['_baseRoots'])if('$graveyard'!==_0x4b8955&&(this['_diffRoots']['set'](_0x4b8955,St(_0x274a17)),this['_diffRootsAttributes']=new Map(_0x2b717e(_0x519cf0)),_0x395f37)){const _0x41e1a5=this['_revisionId'];this['_idsRoots']['set'](_0x4b8955,this['_makeIdsRoot'](_0x274a17)),this['_baseIdsRoots']['set'](_0x4b8955,this['_makeIdsRoot'](_0x274a17,_0x41e1a5));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x395f37&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x1b5de8,_0x64288]of _0x43aa07){const _0x2dfe46=this['_baseRoots']['get'](_0x64288['rootName']),_0x45e40a=this['_diffRoots']['get'](_0x64288['rootName']),_0x1299c6=new _0x191a66(_0x2a2d33(_0x64288['start'],_0x2dfe46),_0x2a2d33(_0x64288['end'],_0x2dfe46)),_0x48281f=_0x502c59(_0x1299c6,_0x45e40a);_0x2dfe46['markers']['set'](_0x1b5de8,_0x1299c6),this['_markers']['set'](_0x1b5de8,_0x48281f);}this['_applyOperations'](_0x4e01bd,_0x502bb1,_0x395f37);}_applyOperations(_0x3dbfc6,_0x527fa8,_0x56a34a){for(const _0x470b41 of this['source']['getOperations'](_0x3dbfc6,_0x527fa8))this['_handleOperation'](_0x470b41,_0x56a34a);for(const _0x5664f1 of this['_diffRoots']['values']())_0x5664f1['markers']['clear']();for(const [_0x5a1755,_0x30f143]of this['_markers'])this['_diffRoots']['get'](_0x30f143['root']['rootName'])['markers']['set'](_0x5a1755,_0x30f143['clone']());const _0x4a9b70=new Map(),_0x3ecf56=new Map();for(const [_0x5bcea2,_0xc06e1c]of this['_diffRoots'])_0x4a9b70['set'](_0x5bcea2,St(_0xc06e1c)),_0x3ecf56['set'](_0x5bcea2,this['_diffRootsAttributes']['get'](_0x5bcea2));this['_saveMetaData'](_0x527fa8,_0x4a9b70,this['_markers'],_0x3ecf56);}_getPreviousFrom(_0x5992a5){const _0xe59776=Array['from'](this['_savedMetaData']['keys']());_0xe59776['sort']((_0x4aafb3,_0x37c73a)=>_0x4aafb3-_0x37c73a),_0xe59776['reverse']();for(const _0x6454fd of _0xe59776)if(_0x6454fd<_0x5992a5)return _0x6454fd;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x4b436a,_0x33d7cf){const _0x468043=Array['from'](_0x33d7cf['markers'])['map'](([_0x397d1d,_0xd2e57c])=>[_0x397d1d,_0x502c59(_0xd2e57c,_0x4b436a)]);_0x4b436a['markers']=new Map(_0x468043);}_transformMarkers(_0x4da47d){for(const _0x4b7f07 of this['_markers']['values']()){const _0x42f817=_0x4b7f07['getTransformedByOperation'](_0x4da47d),_0xf4d1dc=_0x191a66['_createFromRanges'](_0x42f817);_0x4b7f07['start']=_0xf4d1dc['start'],_0x4b7f07['end']=_0xf4d1dc['end'];}}_handleOperation(_0x5bc4ef,_0x5b0581){if('addRoot'!=_0x5bc4ef['type']&&'detachRoot'!=_0x5bc4ef['type']){if('insert'==_0x5bc4ef['type']){const _0x4d2633=_0x5bc4ef['position']['root'],_0x25fd1f=_0x4d2633['rootName'],_0x7feffe=_0x4d2633['name'];this['_diffRoots']['has'](_0x25fd1f)||(this['_diffRoots']['set'](_0x25fd1f,Et(_0x25fd1f,_0x7feffe,!0x0)),this['_diffRootsAttributes']['set'](_0x25fd1f,{}),_0x5b0581&&this['_idsRoots']['set'](_0x25fd1f,Et(_0x25fd1f,_0x7feffe,!0x0)));}else{if('addRootAttribute'==_0x5bc4ef['type']||'removeRootAttribute'==_0x5bc4ef['type']||'changeRootAttribute'==_0x5bc4ef['type'])return void this['_handleRootAttributeOperation'](_0x5bc4ef);'marker'==_0x5bc4ef['type']&&this['_handleMarkerOperation'](_0x5bc4ef);}if('marker'!==_0x5bc4ef['type']){const _0x838709=this['_cloneOperation'](_0x5bc4ef,this['_diffRoots']);_0x838709['_execute'](),this['_transformMarkers'](_0x838709);}if(_0x5b0581)switch(_0x5bc4ef['type']){case'insert':this['_handleInsertOperation'](_0x5bc4ef);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x5bc4ef);break;case'merge':this['_handleMergeOperation'](_0x5bc4ef);break;case'split':this['_handleSplitOperation'](_0x5bc4ef);}}else this['_handleRootOperation'](_0x5bc4ef,_0x5b0581);}_cloneOperation(_0x35af9c,_0x4be88c){const _0x3c37d7=_0x35af9c['clone']();return _0x3c37d7['_authorId']=_0x35af9c['_authorId'],_0x3c37d7['_aiSource']=_0x35af9c['_aiSource'],_0x3c37d7['baseVersion']=null,_0x21af22(_0x3c37d7,_0x4be88c),_0x3c37d7;}_getBaseVids(_0x27f4fc){return _0x27f4fc['map'](_0x4b51a1=>{const _0xae76b5=this['_getVidAttributeName'](_0x4b51a1);return Number(_0x4b51a1['item']['getAttribute'](_0xae76b5));});}_generateTape(_0x469a82,_0x54b249){if(_0x469a82['is']('element','$text'))_0x54b249['push']({'item':_0x469a82,'type':'text'});else{_0x469a82['is']('element')&&_0x54b249['push']({'item':_0x469a82,'type':'elementStart'});for(const _0x327c62 of _0x469a82['getChildren']())this['_generateTape'](_0x327c62,_0x54b249);_0x469a82['is']('element')&&_0x54b249['push']({'item':_0x469a82,'type':'elementEnd'});}return _0x54b249;}_getState(){const _0x416d0c=new Map(this['_touched']),_0x1d3ab1=new Map(_0x416d0c),_0x4e7ac5=new Map(),_0x395eef={'insertions':{},'deletions':{}},_0x3e005a={'insertions':{},'deletions':{}},_0x2a14b4=new Map(),_0x10e525=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x18cb7b=new Map();_0x10e525['delete']('$graveyard');for(const _0x18b41d of _0x10e525){const _0xe499d9=(this['_diffRoots']['get'](_0x18b41d)??this['_baseRoots']['get'](_0x18b41d))['name'],_0x10f46e=this['_diffRoots']['get'](_0x18b41d)||Et(_0x18b41d,_0xe499d9,!0x1),_0x6dfa90=this['_baseRoots']['get'](_0x18b41d)||Et(_0x18b41d,_0xe499d9,!0x1);_0x10f46e['isAttached']()||_0x6dfa90['isAttached']()?(_0x18cb7b['set'](_0x18b41d,_0xe499d9),_0x395eef['insertions'][_0x18b41d]=St(_0x10f46e),_0x395eef['deletions'][_0x18b41d]=St(_0x6dfa90),this['_copyMarkers'](_0x395eef['deletions'][_0x18b41d],_0x6dfa90),this['_copyMarkers'](_0x395eef['insertions'][_0x18b41d],_0x10f46e),_0x3e005a['insertions'][_0x18b41d]=this['_generateTape'](this['_idsRoots']['get'](_0x18b41d),[]),_0x3e005a['deletions'][_0x18b41d]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x18b41d)||Et(_0x18b41d,_0xe499d9,!0x1),[])):_0x10e525['delete'](_0x18b41d);}for(const _0x516376 of _0x10e525){const _0x5bda17=_0x3e005a['insertions'][_0x516376];for(const _0xb85b12 of _0x5bda17){const _0x3a9ad6=this['_getVidAttributeName'](_0xb85b12),_0x57f7c9=_0xb85b12['item']['getAttribute'](_0x3a9ad6);_0x1d3ab1['delete'](_0x57f7c9),_0x57f7c9>=this['_startingRevisionId']&&_0x4e7ac5['set'](_0x57f7c9,_0x416d0c['get'](_0x57f7c9));}}for(const _0x53f6f3 of _0x10e525){const _0x1f8ee2=_0x3e005a['insertions'][_0x53f6f3],_0x51dda1=this['_getBaseVids'](_0x3e005a['deletions'][_0x53f6f3]);let _0x2494aa=0x0;for(const _0x3b5312 of _0x1f8ee2){const _0x3c5fe4=this['_getVidAttributeName'](_0x3b5312),_0x3150ef=_0x3b5312['item']['getAttribute'](_0x3c5fe4);if(!_0x4e7ac5['has'](_0x3150ef)&&!_0x2a14b4['has'](_0x3150ef)){if(_0x1d3ab1['has'](_0x3150ef))_0x2494aa++;else{if(_0x3150ef!=_0x51dda1[_0x2494aa]){const _0x464312=_0x416d0c['get'](_0x3150ef)||_0x416d0c['get'](_0x51dda1[_0x2494aa]);for(;_0x3150ef!=_0x51dda1[_0x2494aa];)_0x1d3ab1['has'](_0x51dda1[_0x2494aa])||(_0x2a14b4['set'](_0x51dda1[_0x2494aa],_0x464312),_0x416d0c['set'](_0x51dda1[_0x2494aa],_0x464312)),_0x2494aa++;}_0x2494aa++;}}}}for(const _0x5c5d27 of _0x10e525){const _0x5494b4=_0x3e005a['insertions'][_0x5c5d27];for(const _0x41cb45 of _0x5494b4){const _0xbf4947=this['_getVidAttributeName'](_0x41cb45),_0x443579=_0x41cb45['item']['getAttribute'](_0xbf4947);if(_0x2a14b4['has'](_0x443579)){const _0x1bd5ea=_0x2a14b4['get'](_0x443579);_0x1d3ab1['has'](_0x443579)||_0x1d3ab1['set'](_0x443579,{..._0x1bd5ea}),_0x4e7ac5['set'](_0x443579,{..._0x1bd5ea});}}}for(const _0xab27d0 of _0x1d3ab1['keys']())_0xab27d0>=this['_startingRevisionId']&&_0x1d3ab1['delete'](_0xab27d0);const _0x4fdd42=new Map();for(const _0x2e673b of _0x10e525){let _0x1f84e6=_0x3e005a['insertions'][_0x2e673b];for(const _0xf5d746 of _0x1f84e6)if(_0xf5d746['item']['is']('element','tableCell')){const _0x4a1941=this['_getVidAttributeName'](_0xf5d746),_0x4a2a2a=_0xf5d746['item']['getAttribute'](_0x4a1941);if(_0x4e7ac5['has'](_0x4a2a2a)){const _0x5066d1=_0xf5d746['item']['parent']['parent']['getAttribute']('vid_start'),_0x54102a=_0x4e7ac5['get'](_0x4a2a2a),_0x3392ad=_0x4fdd42['get'](_0x5066d1)||{'users':new Set(),'aiSource':null};_0x3392ad['users']['add'](_0x54102a['userId']),_0x3392ad['aiSource']=_0x3392ad['aiSource']||_0x54102a['aiSource']||null,_0x4fdd42['set'](_0x5066d1,_0x3392ad);}}_0x1f84e6=_0x3e005a['deletions'][_0x2e673b];for(const _0x14c4f3 of _0x1f84e6)if(_0x14c4f3['item']['is']('element','tableCell')){const _0x32682d=this['_getVidAttributeName'](_0x14c4f3),_0x3e053b=_0x14c4f3['item']['getAttribute'](_0x32682d);if(_0x1d3ab1['has'](_0x3e053b)){const _0x3a88eb=_0x14c4f3['item']['parent']['parent']['getAttribute']('vid_start'),_0xd7aff2=_0x1d3ab1['get'](_0x3e053b),_0x460ae8=_0x4fdd42['get'](_0x3a88eb)||{'users':new Set(),'aiSource':null};_0x460ae8['users']['add'](_0xd7aff2['userId']),_0x460ae8['aiSource']=_0x460ae8['aiSource']||_0xd7aff2['aiSource']||null,_0x4fdd42['set'](_0x3a88eb,_0x460ae8);}}for(const _0x257371 of _0x4fdd42['keys']())(_0x4e7ac5['has'](_0x257371)||_0x1d3ab1['has'](_0x257371))&&_0x4fdd42['delete'](_0x257371);}for(const _0x451141 of _0x10e525){const _0x511c2f=_0x3e005a['insertions'][_0x451141];let _0xf25201=null,_0x43b602=null,_0x1a5b81=null;for(const _0x3c35ec of _0x511c2f){const _0x15314d=this['_getVidAttributeName'](_0x3c35ec),_0x3b897a=_0x3c35ec['item']['getAttribute'](_0x15314d),_0x5d832e=_0x4fdd42['get'](_0x3b897a);if(_0x5d832e&&'elementStart'==_0x3c35ec['type']&&(_0xf25201=Array['from'](_0x5d832e['users'])[0x0],_0x43b602=_0x5d832e['aiSource'],_0x1a5b81=_0x3c35ec['item']['getAttribute']('vid_end')),_0xf25201){const _0x4672a7=_0x43b602||_0x1d3ab1['get'](_0x3b897a)?.['aiSource']||null,_0x1aa17f=_0x43b602||_0x4e7ac5['get'](_0x3b897a)?.['aiSource']||null;_0x1d3ab1['set'](_0x3b897a,{'userId':_0xf25201,'aiSource':_0x4672a7}),_0x4e7ac5['set'](_0x3b897a,{'userId':_0xf25201,'aiSource':_0x1aa17f});}_0x3b897a==_0x1a5b81&&(_0xf25201=null,_0x1a5b81=null);}}const _0x29dfe4={},_0x52cbcd=new Set();for(const _0x3eb18e of _0x10e525){const _0x383fb6=_0x395eef['deletions'][_0x3eb18e],_0x64e022=_0x395eef['insertions'][_0x3eb18e];for(const {userId:_0x218511}of this['_touchedMarkers']['values']())null!==_0x218511&&_0x52cbcd['add'](_0x218511);for(const {userId:_0x10f614}of this['_touchedRoots']['values']())null!==_0x10f614&&_0x52cbcd['add'](_0x10f614);const _0x5920be={};this['_markChanges'](_0x64e022,_0x3e005a['insertions'][_0x3eb18e],_0x4e7ac5,'insertion',_0x52cbcd,_0x5920be),this['_markChanges'](_0x383fb6,_0x3e005a['deletions'][_0x3eb18e],_0x1d3ab1,'deletion',_0x52cbcd,_0x5920be),this['_collectSuggestionAiSources'](_0x64e022,_0x5920be),this['_collectSuggestionAiSources'](_0x383fb6,_0x5920be),_0x29dfe4[_0x3eb18e]={'insertions':this['_prepareViewToSave'](_0x64e022),'deletions':this['_prepareViewToSave'](_0x383fb6),'attachChange':this['_touchedRoots']['get'](_0x3eb18e)||null,'attributesBefore':_0x2b717e(this['_baseRootsAttributes']['get'](_0x3eb18e))||{},'attributesAfter':_0x2b717e(this['_diffRootsAttributes']['get'](_0x3eb18e)),'rootElementName':_0x18cb7b['get'](_0x3eb18e),'aiSources':_0x5920be};}const _0x57d93f=Array['from'](_0x4e7ac5['values']())['some'](_0x3c0e8f=>!(!_0x3c0e8f||!_0x3c0e8f['aiSource']))||Array['from'](_0x1d3ab1['values']())['some'](_0x12f813=>!(!_0x12f813||!_0x12f813['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x4c28b=>this['_aiTouchedMarkers']['has'](_0x4c28b));return{'diffData':_0x29dfe4,'authorsIds':Array['from'](_0x52cbcd),'hasAIChanges':_0x57d93f};}_collectSuggestionAiSources(_0x357606,_0x32b733){const _0x4aabf9=_0x357606['markers'];for(const _0x395298 of _0x4aabf9['keys']()){if(!_0x395298['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x395298))continue;const _0x113bed=this['_aiTouchedMarkers']['get'](_0x395298);_0x113bed&&(_0x32b733[_0x395298]=_0x113bed);}}_processRootBeforeSave(_0x5a74b2){for(const [,_0x448ca1]of _0x5a74b2['markers']){const _0x2b625f=_0x448ca1['start']['getAncestors']()['filter'](_0x5c8b7c=>'tableCell'==_0x5c8b7c['name']);for(const _0x4d5e06 of _0x2b625f)0x1==_0x4d5e06['childCount']&&_0x4d5e06['getChild'](0x0)['is']('element','paragraph')&&_0x4d5e06['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x1c879a){this['_processRootBeforeSave'](_0x1c879a);const _0x4b19df=this['editor']['data']['toView'](_0x1c879a,{}),_0x1e61af=Array['from'](_0x4b19df['getChildren']())['map'](_0x15832c=>this['_getViewJson'](_0x15832c));return JSON['stringify'](_0x1e61af);}_getViewJson(_0x1014ff){if(_0x1014ff['is']('$text'))return _0x1014ff['data'];{const _0x5e82cb=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x16a655=_0x1014ff,_0x27d070=this['editor']['data']['htmlProcessor']['domConverter'],_0x119754={'type':_0x5e82cb['_getTypeCharForViewElement'](_0x16a655),'name':_0x16a655['name'],'attributes':Array['from'](_0x16a655['getAttributes']()),'children':Array['from'](_0x16a655['getChildren']())['map'](_0x529001=>this['_getViewJson'](_0x529001))};if(_0x1014ff['is']('uiElement')&&'$comment'!=_0x1014ff['name']){const _0x4be2d8=_0x1014ff['render'](_0x27d070['domDocument'],_0x27d070);_0x119754['children']['push'](_0x4be2d8['outerHTML']);}else{if(_0x1014ff['is']('rawElement')){const _0x2b8019=_0x27d070['domDocument']['createElement'](_0x16a655['name']);_0x1014ff['render'](_0x2b8019,_0x27d070),_0x119754['children']['push'](_0x2b8019['innerHTML']);}}const _0x3f5026=Array['from'](_0x16a655['getCustomProperties']());_0x3f5026['length']>0x0&&(_0x119754['customProperties']=_0x3f5026);const _0x1c2643=_0x16a655['getFillerOffset']();return null!==_0x1c2643&&(_0x119754['fillerOffset']=_0x1c2643),_0x119754;}}['_markChanges'](_0x412153,_0x1f27bd,_0xc6dfe6,_0x6e5ff6,_0x34e2a8,_0xd8f1be){let _0x382d17=null,_0x17a233=null,_0x167483=0x0;const _0x12642a=this['editor']['model'];for(let _0x1068ac=0x0;_0x1068ac<_0x1f27bd['length'];_0x1068ac++){const _0x582e40=this['_getVidAttributeName'](_0x1f27bd[_0x1068ac]),_0x1da40c=_0x1f27bd[_0x1068ac]['item']['getAttribute'](_0x582e40),_0x475ee1=_0xc6dfe6['get'](_0x1da40c),_0x2d0a98=_0x1068ac==_0x1f27bd['length']-0x1;!_0x382d17&&_0x475ee1&&(_0x382d17=_0x475ee1,_0x17a233=_0x1f27bd[_0x1068ac]);const _0x47a5bd=!!_0x382d17&&!!_0x475ee1&&_0x475ee1['userId']!=_0x382d17['userId'],_0x5ac6c6=!!_0x382d17&&!!_0x475ee1&&_0x475ee1['aiSource']!=_0x382d17['aiSource'];_0x382d17&&(!_0x475ee1||_0x47a5bd||_0x5ac6c6)&&(_0x562207(_0x475ee1,Ot(_0x17a233,_0x412153,_0x12642a),Ot(_0x1f27bd[_0x1068ac],_0x412153,_0x12642a)),_0x382d17=_0x475ee1||null,_0x17a233=_0x475ee1?_0x1f27bd[_0x1068ac]:null),_0x382d17&&_0x2d0a98&&_0x562207(_0x475ee1,Ot(_0x17a233,_0x412153,_0x12642a),Ct(_0x1f27bd[_0x1068ac],_0x412153,_0x12642a));}function _0x562207(_0xb55c4b,_0x271593,_0x1e26b6){const _0xbe488c=_0x382d17['userId'],_0x323d5b=_0x382d17['aiSource'],_0x12d4f0='revision:'+_0x6e5ff6+':'+_0xbe488c+':'+_0x167483++,_0x4a23ba=_0x12642a['createRange'](_0x271593,_0x1e26b6);_0x412153['markers']['set'](_0x12d4f0,_0x4a23ba),_0x323d5b&&(_0xd8f1be[_0x12d4f0]=_0x323d5b),null!==_0xbe488c&&_0x34e2a8['add'](_0xbe488c);}}_getVidAttributeName(_0x2e1242){switch(_0x2e1242['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0xba9867){const _0x5d56e6=this['_idsRoots']['get'](_0xba9867['position']['root']['rootName']),_0x979c0b=_0x2a2d33(_0xba9867['position'],_0x5d56e6),_0x39645a=null===_0xba9867['_authorId']?null:_0xba9867['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2695f9=_0xba9867['_aiSource']||null,_0x203b60=_0x979c0b['parent'],_0x1bc202=this['_revisionId'],_0x5aa740=[];for(const _0x2e4025 of _0xba9867['nodes'])if(_0x2e4025['is']('element'))_0x5aa740['push'](this['_makeIdsRoot'](_0x2e4025));else{for(let _0x4a3bb9=0x0;_0x4a3bb9<_0x2e4025['offsetSize'];_0x4a3bb9++)_0x5aa740['push'](new _0x1868f7('$text',{'vid':this['_revisionId']++}));}const _0x2611ae=this['_revisionId'];for(let _0x179a14=_0x1bc202;_0x179a14<_0x2611ae;_0x179a14++)this['_touched']['set'](_0x179a14,{'userId':_0x39645a,'aiSource':_0x2695f9});_0x203b60['_insertChild'](_0x979c0b['offset'],_0x5aa740);}_setTouched(_0x303a77,_0x20c066,_0x5036d4){this['_touched']['set'](_0x303a77,{'userId':_0x20c066,'aiSource':_0x5036d4||this['_touched']['get'](_0x303a77)?.['aiSource']||null});}_handleMoveOperation(_0x19af1c){(_0x19af1c=this['_cloneOperation'](_0x19af1c,this['_idsRoots']))['_execute']();const _0x2810ad=null===_0x19af1c['_authorId']?null:_0x19af1c['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x19d8aa=_0x19af1c['_aiSource']||null,_0x31f33b=_0x19af1c['getMovedRangeStart'](),_0x1f1df3=_0x31f33b['parent'],_0x5218b0=_0x31f33b['offset'],_0x510a9c=(_0x4b2110,_0xb7367d,_0x4d2413)=>{for(let _0x11236c=_0xb7367d;_0x11236c<_0x4d2413;_0x11236c++){const _0x8aa722=_0x4b2110['getChild'](_0x11236c);_0x8aa722['is']('element','$text')?this['_setTouched'](_0x8aa722['getAttribute']('vid'),_0x2810ad,_0x19d8aa):(this['_setTouched'](_0x8aa722['getAttribute']('vid_start'),_0x2810ad,_0x19d8aa),_0x510a9c(_0x8aa722,0x0,_0x8aa722['childCount']),this['_setTouched'](_0x8aa722['getAttribute']('vid_end'),_0x2810ad,_0x19d8aa));}};_0x510a9c(_0x1f1df3,_0x5218b0,_0x5218b0+_0x19af1c['howMany']);}_handleMergeOperation(_0x53ba29){const _0x55c8c6=null===(_0x53ba29=this['_cloneOperation'](_0x53ba29,this['_idsRoots']))['_authorId']?null:_0x53ba29['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xb2c1d3=_0x53ba29['_aiSource']||null,_0x257a57=_0x53ba29['targetPosition']['parent'],_0x389098=_0x53ba29['sourcePosition']['parent'],_0x2af2ef=_0x257a57['getAttribute']('vid_end'),_0x49d718=_0x389098['getAttribute']('vid_start');_0x257a57['_setAttribute']('vid_end',_0x389098['getAttribute']('vid_end')),_0x389098['_setAttribute']('vid_end',_0x2af2ef),this['_setTouched'](_0x49d718,_0x55c8c6,_0xb2c1d3),this['_setTouched'](_0x2af2ef,_0x55c8c6,_0xb2c1d3),_0x53ba29['_execute']();}_handleSplitOperation(_0x26d959){const _0x42c522=null===(_0x26d959=this['_cloneOperation'](_0x26d959,this['_idsRoots']))['_authorId']?null:_0x26d959['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x123765=_0x26d959['_aiSource']||null,_0x2ec026=_0x26d959['graveyardPosition'],_0x1087f9=_0x26d959['splitPosition']['parent'];_0x26d959['_execute']();const _0x9a88e4=_0x1087f9['getAttribute']('vid_end'),_0x3d73cf=_0x26d959['insertionPosition']['nodeAfter'];if(_0x2ec026){const _0x4246d0=_0x3d73cf['getAttribute']('vid_end'),_0x5de1f1=_0x1087f9['getAttribute']('vid_end');_0x1087f9['_setAttribute']('vid_end',_0x4246d0),_0x3d73cf['_setAttribute']('vid_end',_0x5de1f1),this['_setTouched'](_0x1087f9['getAttribute']('vid_end'),_0x42c522,_0x123765),this['_setTouched'](_0x3d73cf['getAttribute']('vid_start'),_0x42c522,_0x123765);}else{const _0x14e390=this['_revisionId']++,_0x3e5ecd=this['_revisionId']++;_0x1087f9['_setAttribute']('vid_end',_0x14e390),_0x3d73cf['_setAttribute']('vid_start',_0x3e5ecd),_0x3d73cf['_setAttribute']('vid_end',_0x9a88e4),this['_setTouched'](_0x14e390,_0x42c522,_0x123765),this['_setTouched'](_0x3e5ecd,_0x42c522,_0x123765);}}_handleMarkerOperation(_0x36a636){if(!_0x36a636['affectsData'])return;const _0x5607db=(_0x36a636=this['_cloneOperation'](_0x36a636,this['_diffRoots']))['oldRange']?_0x36a636['oldRange']['root']:null,_0xf3f60e=_0x36a636['newRange']?_0x36a636['newRange']['root']:null;_0x5607db&&this['_markers']['delete'](_0x36a636['name']),_0xf3f60e&&this['_markers']['set'](_0x36a636['name'],_0x36a636['newRange']['clone']());const _0x5b1715=null===_0x36a636['_authorId']?null:_0x36a636['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x461c09=_0x36a636['name'];if(_0x36a636['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x461c09,_0x36a636['_aiSource']),!this['_touchedMarkers']['has'](_0x461c09))return void this['_touchedMarkers']['set'](_0x461c09,{'range':_0x36a636['oldRange'],'userId':_0x5b1715});const _0x4b66af=this['_touchedMarkers']['get'](_0x461c09),_0x41b22f=_0x4b66af['range'],_0x3921c5=_0x36a636['newRange'];null==_0x41b22f&&null==_0x3921c5||_0x41b22f&&_0x3921c5&&_0x41b22f['isEqual'](_0x3921c5)?this['_touchedMarkers']['delete'](_0x36a636['name']):_0x4b66af['userId']=_0x5b1715;}_handleRootOperation(_0x4f86f4,_0x5ecc54){this['_diffRoots']['has'](_0x4f86f4['rootName'])?this['_diffRoots']['get'](_0x4f86f4['rootName'])['_isAttached']=_0x4f86f4['isAdd']:(this['_diffRoots']['set'](_0x4f86f4['rootName'],Et(_0x4f86f4['rootName'],_0x4f86f4['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x4f86f4['rootName'],{}),_0x5ecc54&&this['_idsRoots']['set'](_0x4f86f4['rootName'],Et(_0x4f86f4['rootName'],_0x4f86f4['elementName'],!0x0)));const _0x71a6a5=null===_0x4f86f4['_authorId']?null:_0x4f86f4['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x39cd33=this['_touchedRoots']['get'](_0x4f86f4['rootName']);_0x39cd33&&_0x39cd33['userId']===_0x71a6a5?this['_touchedRoots']['delete'](_0x4f86f4['rootName']):this['_touchedRoots']['set'](_0x4f86f4['rootName'],{'userId':_0x71a6a5,'isAttached':_0x4f86f4['isAdd']});}_handleRootAttributeOperation(_0x201c35){const _0x26f1ec=this['_diffRootsAttributes']['get'](_0x201c35['root']['rootName']);null===_0x201c35['newValue']?delete _0x26f1ec[_0x201c35['key']]:_0x26f1ec[_0x201c35['key']]=_0x201c35['newValue'];}};function St(_0x5c6001){const _0x1f117c=Et(_0x5c6001['rootName'],_0x5c6001['name'],_0x5c6001['isAttached']());for(const _0x1743b4 of _0x5c6001['getChildren']()){const _0x5d65d4=_0x1743b4['_clone'](!0x0);_0x1f117c['_appendChild'](_0x5d65d4);}return _0x1f117c;}function Et(_0x2d57a6,_0x2d2c75,_0xa6d63f=!0x0){const _0x6b7045=new _0x258ac8();return _0x6b7045['rootName']=_0x2d57a6,_0x6b7045['name']=_0x2d2c75,_0x6b7045['_isAttached']=_0xa6d63f,_0x6b7045['isAttached']=()=>_0x6b7045['_isAttached'],_0x6b7045;}function Ot(_0x4171b6,_0x3a80f8,_0x213da2){const _0x1f663e='elementEnd'==_0x4171b6['type']?_0x213da2['createPositionAt'](_0x4171b6['item'],'end'):_0x213da2['createPositionBefore'](_0x4171b6['item']);return _0x213da2['createPositionFromPath'](_0x3a80f8,_0x1f663e['path'],_0x1f663e['stickiness']);}function Ct(_0x3e8964,_0x2588b7,_0x340dc5){const _0x19ebde='elementStart'==_0x3e8964['type']?_0x340dc5['createPositionAt'](_0x3e8964['item'],0x0):_0x340dc5['createPositionAfter'](_0x3e8964['item']);return _0x340dc5['createPositionFromPath'](_0x2588b7,_0x19ebde['path'],_0x19ebde['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
25
+ _0x47a750(dt);var xt=class extends Nt{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0x5859a9,_0x22d456){super(_0x5859a9),this['focusTracker']=new _0x1f365b(),this['keystrokes']=new _0x289644(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x22d456),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'](),_t({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x39ff5e=_0x2a75a9=>_0x2a75a9['stopPropagation']();this['keystrokes']['set']('arrowright',_0x39ff5e),this['keystrokes']['set']('arrowleft',_0x39ff5e),this['keystrokes']['set']('arrowup',_0x39ff5e),this['keystrokes']['set']('arrowdown',_0x39ff5e);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x2b2d50){this['revisionNameInputView']['fieldView']['element']['value']=_0x2b2d50['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x20dc68){const _0x28f37a=new it(this['locale'],gt),_0xd3f320=_0x28f37a['fieldView'];_0xd3f320['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x439fbb=kt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x20dc68&&(_0x439fbb+='\x20('+kt(this['locale'],'optional')+')'),(_0x28f37a['label']=_0x439fbb,_0xd3f320['on']('input',()=>{this['revisionNameInputValue']=_0xd3f320['element']['value']['trim']();}),_0x28f37a);}},Dt=class extends _0x15eb24{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At];}['_saveRevisionFormView'];init(){const _0x283c6f=this['editor'],_0x2b34ef=_0x283c6f['plugins']['get']('RevisionTracker');_0x283c6f['ui']['componentFactory']['add']('revisionHistory',_0x4f1844=>{const _0x4ce65a=vt(_0x4f1844),_0x2a5d18=_0x4ce65a['panelView']['children'],_0x2fee59=new st(_0x4f1844),_0x2d92da=new et(_0x4f1844),_0x21039b=this['_createSaveRevisionButton'](_0x3e9ea0),_0x28dd43=new et(_0x4f1844),_0x36d418=this['_createOpenRevisionButton'](_0x3e9ea0);return _0x4ce65a['bind']('isEnabled')['to'](_0x2b34ef,'isReady',_0x2b34ef,'isEnabled',_0x283c6f,'isReadOnly',(_0x124ea6,_0x368e57,_0xa2531e)=>_0x124ea6&&_0x368e57&&!_0xa2531e),_0x4ce65a['buttonView']['set']({'icon':_0x74b43d,'label':kt(_0x4f1844,'Revision\x20history'),'tooltip':!0x0}),_0x21039b['set']({'withText':!0x0,'role':'menuitem'}),_0x36d418['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x36d418,'execute',()=>{_0x4ce65a['isOpen']=!0x1,_0x283c6f['editing']['view']['focus']();},{'priority':'low'}),_0x2d92da['children']['add'](_0x21039b),_0x28dd43['children']['add'](_0x36d418),_0x2fee59['role']='menu',_0x2fee59['items']['addMany']([_0x2d92da,_0x28dd43]),_0x2a5d18['add'](_0x2fee59),_0x4ce65a;}),_0x283c6f['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x2ce572=this['editor'],_0x30f72c=_0x2ce572['locale'],_0x1e56b9=_0x2ce572['plugins']['get']('RevisionTracker'),_0x5b0f92=new at(_0x30f72c),_0x3c44f5=new rt(_0x30f72c);_0x5b0f92['bind']('isEnabled')['to'](_0x1e56b9,'isReady',_0x1e56b9,'isEnabled',_0x2ce572,'isReadOnly',(_0x37e4e3,_0x2a039e,_0x23f10b)=>_0x37e4e3&&_0x2a039e&&!_0x23f10b),_0x5b0f92['buttonView']['set']({'icon':_0x74b43d,'label':kt(_0x30f72c,'Revision\x20history')});const _0x313ddf=new ot(_0x30f72c,_0x5b0f92),_0x3a19c2=this['_createSaveRevisionButton'](nt);_0x3a19c2['delegate']('execute')['to'](_0x5b0f92),_0x313ddf['children']['add'](_0x3a19c2),_0x3c44f5['items']['add'](_0x313ddf);const _0x5393fe=new ot(_0x30f72c,_0x5b0f92),_0x3f6f20=this['_createOpenRevisionButton'](nt);return _0x3f6f20['delegate']('execute')['to'](_0x5b0f92),_0x5393fe['children']['add'](_0x3f6f20),_0x3c44f5['items']['add'](_0x5393fe),_0x5b0f92['panelView']['children']['add'](_0x3c44f5),_0x5b0f92;}_createSaveRevisionButton(_0x4e99b0){const _0x3579dd=this['editor'],_0x3df693=_0x3579dd['plugins']['get']('RevisionTracker'),_0x19e853=new _0x4e99b0(_0x3579dd['locale']);return _0x19e853['set']({'label':kt(_0x3579dd['locale'],'Save\x20current\x20revision')}),_0x19e853['bind']('isEnabled')['to'](_0x3df693,'isReady',_0x3df693,'isEnabled',_0x3579dd,'isReadOnly',(_0x5b7c45,_0x27ccd3,_0x59f310)=>_0x5b7c45&&_0x27ccd3&&!_0x59f310),this['listenTo'](_0x19e853,'execute',()=>{this['_showDialog']();}),_0x19e853;}_createOpenRevisionButton(_0x2b2d1f){const _0x163c54=this['editor'],_0x4955bd=_0x163c54['plugins']['get']('RevisionTracker'),_0x2fc73f=new _0x2b2d1f(_0x163c54['locale']);return _0x2fc73f['set']({'label':kt(_0x163c54['locale'],'Open\x20revision\x20history')}),_0x2fc73f['bind']('isEnabled')['to'](_0x4955bd,'isReady',_0x163c54,'isReadOnly',(_0x4106fa,_0x1836cb)=>_0x4106fa&&!_0x1836cb),this['listenTo'](_0x2fc73f,'execute',()=>{_0x163c54['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x2fc73f;}['_showDialog'](){const _0x427116=this['editor'],_0x142e55=_0x427116['locale'],_0x2a05e7=_0x427116['plugins']['get']('Dialog'),_0x2daf2b=_0x427116['plugins']['get']('RevisionTracker');function _0x169c74(_0x1c43af){_0x427116['config']['get']('revisionHistory.requireRevisionName')&&''===_0x1c43af['revisionName']?_0x1c43af['revisionNameInputView']['errorText']=kt(_0x142e55,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x427116['plugins']['get'](At)['saveRevision']({'name':_0x1c43af['revisionName']}),_0x2a05e7['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x169c74(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x2a05e7['show']({'id':'revisionSave','title':kt(_0x142e55,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':kt(_0x427116['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x2a05e7['hide']()},{'label':kt(_0x427116['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0x5c4dd2){_0x5c4dd2['bind']('isEnabled')['to'](_0x2daf2b,'isReady',_0x2daf2b,'isEnabled',_0x427116,'isReadOnly',(_0x146dc0,_0x4bfd88,_0x6987d6)=>_0x146dc0&&_0x4bfd88&&!_0x6987d6);},'onExecute':()=>_0x169c74(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0x34f3b4=this['editor'],_0x14c7fb=_0x34f3b4['locale'];this['_saveRevisionFormView']=new xt(_0x14c7fb,_0x34f3b4['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Vt=class extends dt{['changeId'];['_model'];constructor(_0x53b3a0,_0x2a3873,_0x10fc6c=!0x1){super(_0x53b3a0),this['_model']=_0x2a3873,this['changeId']=_0x2a3873['id'];const _0x2512c6=this['bindTemplate'],_0x30252b=_0x10fc6c&&!!_0x2a3873['data']['aiSource'],_0x315914=_0x30252b?this['_createAiIconView'](_0x53b3a0):null;this['set']('type',_0x2a3873['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x2512c6['to']('type',_0x2d68db=>'ck-revision-change__'+_0x2d68db),..._0x30252b?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x30252b?[this['_createAiDescriptionView'](_0x53b3a0,_0x2a3873),_0x315914]:this['_getDescriptionChildren'](_0x53b3a0,_0x2a3873)}]});}_getDescriptionChildren(_0x47f97c,_0xe597b){let _0x54f077='Removed\x20by';return _0xe597b['data']['isSuggestion']?_0x54f077='Suggested\x20by':'add'==_0xe597b['type']&&(_0x54f077='Added\x20by'),[this['_createLabel'](kt(_0x47f97c,_0x54f077)),{'text':'\x20'+_0xe597b['author']['name']}];}_createAiDescriptionView(_0x3b4dc7,_0x3a5d6d){let _0xaa961a='AI_SOURCE_REMOVED_BY';_0x3a5d6d['data']['isSuggestion']?_0xaa961a='AI_SOURCE_SUGGESTED_BY':'add'==_0x3a5d6d['type']&&(_0xaa961a='AI_SOURCE_ADDED_BY');const _0xe4bac0=new dt(_0x3b4dc7);return _0xe4bac0['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0xe4bac0['render'](),_0xe4bac0['element']['innerHTML']=_0x3ee93e(kt(_0x3b4dc7,_0xaa961a,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+kt(_0x3b4dc7,'AI_SOURCE_AI')+'</span>'])),_0xe4bac0['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x3a5d6d['author']['name'],_0xe4bac0;}_createLabel(_0x3a991f){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x3a991f}]};}_createAiIconView(_0x2a6eaa){const _0x35d914=new _0x57a8a0();return _0x35d914['content']=_0x525b57,_0x35d914['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':kt(_0x2a6eaa,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x35d914;}['focus'](){this['element']['focus']();}};const Tt=/* #__PURE__ -- @preserve */
26
+ _0x301f59();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x4215a7){super(),this['id']=_0x4215a7['id']||_0x1502a4(),this['author']=_0x4215a7['author'],this['type']=_0x4215a7['type'],this['data']=_0x4215a7['data']||{},this['rootName']=_0x4215a7['rootName'],this['set']('createdAt',_0x4215a7['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ht=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x2c553d,_0x30c4e6){this['newRevisionId']=_0x2c553d,this['oldRevisionId']=_0x30c4e6,this['changes']=new _0x393ab3();}_setChanges(_0x2b572c){for(const _0x315e16 of _0x2b572c)this['changes']['add'](_0x315e16);}},Pt=class extends _0x15eb24{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[_0x4fd2f9,_0x11b77b,bt,Rt];}constructor(_0x4421a5){super(_0x4421a5),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',(_0x3a7325,_0x3f72e7,_0x15bfa5)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x4cb871=>{for(const _0x27c8f1 of this['editor']['editing']['view']['document']['roots'])_0x15bfa5?_0x4cb871['removeClass']('ck-editor__editable__overlay',_0x27c8f1):_0x4cb871['addClass']('ck-editor__editable__overlay',_0x27c8f1);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x3fb588=>null!==_0x3fb588),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x5ad14c,_0x2038d8,_0x80dab1)=>_0x5ad14c&&_0x80dab1?_0x2038d8['changes']['getIndex'](_0x80dab1):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x1f9120,_0x31fd9f)=>_0x1f9120?_0x31fd9f['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x11b77b),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x94c1bc=this['editor'],_0x44171a=new $t(_0x94c1bc,{'direction':'backward'}),_0x317789=new $t(_0x94c1bc,{'direction':'forward'});_0x94c1bc['commands']['add']('showPreviousChange',_0x44171a),_0x94c1bc['commands']['add']('showNextChange',_0x317789),_0x94c1bc['commands']['add']('restoreRevision',new Ft(_0x94c1bc)),this['on']('change:numberOfChanges',()=>{_0x44171a['refresh'](),_0x317789['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x94c1bc['enableReadOnlyMode']('revision-viewer'),_0x94c1bc['plugins']['has']('WidgetToolbarRepository')&&_0x94c1bc['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x18d063){return await this['_utils']['loadRevisionData'](_0x18d063,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x18d063);}async getRevisionRootsAttributes(_0x18f65b){return await this['_utils']['loadRevisionData'](_0x18f65b,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x18f65b);}async['compare'](_0x3dbea9,_0x17507b,_0x1412c3=!0x1){if(!this['isEnabled'])return;const _0xa67fc8=this['diff'],_0x482959=this['repository'],_0x37cc58='string'==typeof _0x3dbea9?_0x482959['getRevision'](_0x3dbea9):_0x3dbea9,_0x54956a='string'==typeof _0x17507b?_0x482959['getRevision'](_0x17507b):_0x17507b,_0x54a4c7=_0x37cc58['id'],_0x23ebb1=_0x54956a?_0x54956a['id']:null;if(!_0x1412c3&&this['diff']&&this['diff']['newRevisionId']===_0x54a4c7&&this['diff']['oldRevisionId']===_0x23ebb1)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x54a4c7,_0x23ebb1);const _0x8a750a=this['_getRevisionsRange'](_0x37cc58,_0x54956a,!0x0)['map'](_0x30e07a=>this['_utils']['loadRevisionData'](_0x30e07a,this['adapter']));return _0x8a750a['push'](new Promise(_0x3623dc=>{setTimeout(_0x3623dc,0x14);})),Promise['all'](_0x8a750a)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x4e74ee=this['_getDiff'](_0x54a4c7,_0x23ebb1);this['_cleanUpCommentMarkers'](_0x4e74ee);for(const _0x31f69c of _0x4e74ee['changes'])this['_changeIdToChange']['set'](_0x31f69c['id'],_0x31f69c);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x2c616a=>{for(const _0x983e21 of this['editor']['model']['document']['getRootNames']())_0x2c616a['detachRoot'](_0x983e21);for(const _0x466636 of Object['keys'](_0x4e74ee['model'])){const _0x7ed08e=_0x4e74ee['model'][_0x466636]['name'],_0x419bb3=_0x2c616a['addRoot'](_0x466636,_0x7ed08e);for(const _0x291112 of Object['keys'](_0x4e74ee['attributes'][_0x466636]))_0x2c616a['setAttribute'](_0x291112,_0x4e74ee['attributes'][_0x466636][_0x291112],_0x419bb3);_0x2c616a['insert'](_0x4e74ee['model'][_0x466636],_0x419bb3,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x4e74ee['changes'])),this['isReady']=!0x0;})['catch'](_0x8ba409=>{console['error'](_0x8ba409),this['_cleanUp'](),_0xa67fc8&&(this['diff']=_0xa67fc8),this['isReady']=!0x0;});}addRevisionData(_0x5d7193,_0x215472){const _0x5b386b=this['repository']['createRevision'](_0x5d7193);return _0x5b386b['on']('_update',(_0x2dbd4e,_0x5656eb,_0x3173f2)=>_0x215472(_0x5656eb,_0x3173f2,_0x5b386b)),this['repository']['addRevision'](_0x5b386b),_0x5b386b;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x38d6d7=>{for(const _0x3863d0 of this['editor']['model']['document']['getRootNames']())_0x38d6d7['detachRoot'](_0x3863d0);});}_cleanUpCommentMarkers(_0x20a8e0){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x27e4da=this['_getVisibleCommentThreadIds']();for(const _0x397745 of Object['values'](_0x20a8e0['model']))for(const _0x2bb94d of Array['from'](_0x397745['markers']['keys']()))_0x2bb94d['startsWith']('revision-comment:')&&!_0x27e4da['has'](Ut(_0x2bb94d))&&_0x397745['markers']['delete'](_0x2bb94d);}_sortAndFilterDiffChanges(_0x10f505){const _0x5d6caa=[],_0x18fa75=new Map();for(const _0x5c9dc1 of this['editor']['model']['document']['getRootNames']()){const _0x53d319=this['editor']['editing']['view']['getDomRoot'](_0x5c9dc1);if(!_0x53d319)continue;const _0x2fbb65=_0x53d319['getClientRects']()['item'](0x0);_0x2fbb65&&(_0x5d6caa['push'](_0x5c9dc1),_0x18fa75['set'](_0x5c9dc1,_0x2fbb65));}return _0x5d6caa['sort']((_0x2f938d,_0x3fe39f)=>{const _0x45cb92=_0x18fa75['get'](_0x2f938d),_0x4398f5=_0x18fa75['get'](_0x3fe39f);return _0x45cb92['y']-_0x4398f5['y']||_0x45cb92['x']-_0x4398f5['x'];}),(_0x10f505=_0x10f505['filter'](_0x4667c3=>_0x5d6caa['includes'](_0x4667c3['rootName'])))['sort']((_0x598c10,_0x1926c1)=>_0x5d6caa['indexOf'](_0x598c10['rootName'])-_0x5d6caa['indexOf'](_0x1926c1['rootName'])),_0x10f505;}['_makeTape'](_0x3fccb6,_0x5caed5={}){const _0x2e8417=Array['from'](_0x3fccb6['markers'])['filter'](([_0x1d41d2,_0x5f2499])=>_0x1d41d2['startsWith']('revision:')&&!_0x5f2499['isCollapsed']),_0x51d001=Array['from'](this['editor']['model']['createRangeIn'](_0x3fccb6)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x2e8417['length'])for(const _0x228dce of _0x51d001){const [_0x191003,_0x114b7b]=_0x2e8417[0x0],[,_0x417dbf,_0x34df6d]=_0x191003['split'](':'),_0x4794c2=_0x5caed5[_0x191003]||null;if(_0x114b7b['end']['isEqual'](_0x228dce['nextPosition'])&&_0x2e8417['shift'](),(_0x228dce['previousPosition']['isEqual'](_0x114b7b['start'])||_0x228dce['previousPosition']['isAfter'](_0x114b7b['start']))&&('insertion'==_0x417dbf?_0x228dce['isAdded']={'userId':_0x34df6d,'aiSource':_0x4794c2}:'deletion'==_0x417dbf&&(_0x228dce['isRemoved']={'userId':_0x34df6d,'aiSource':_0x4794c2})),0x0==_0x2e8417['length'])break;}return _0x51d001;}_refreshStartEndIndex(_0x5a705e){const _0x39dfca=new Map();for(let _0x4a0c21=0x0;_0x4a0c21<_0x5a705e['length'];_0x4a0c21++)'text'===_0x5a705e[_0x4a0c21]['type']?(_0x5a705e[_0x4a0c21]['item']['startIndex']=_0x4a0c21,_0x5a705e[_0x4a0c21]['item']['endIndex']=_0x4a0c21):('elementStart'===_0x5a705e[_0x4a0c21]['type']?_0x5a705e[_0x4a0c21]['item']['startIndex']=_0x4a0c21:'elementEnd'===_0x5a705e[_0x4a0c21]['type']&&(_0x5a705e[_0x4a0c21]['item']['endIndex']=_0x4a0c21),_0x39dfca['set'](_0x5a705e[_0x4a0c21]['id'],_0x4a0c21));for(const _0x443f75 of _0x39dfca['values']())'elementStart'===_0x5a705e[_0x443f75]['type']?_0x5a705e[_0x443f75]['item']['endIndex']=_0x39dfca['get'](_0x5a705e[_0x443f75]['pairId']):'elementEnd'===_0x5a705e[_0x443f75]['type']&&(_0x5a705e[_0x443f75]['item']['startIndex']=_0x39dfca['get'](_0x5a705e[_0x443f75]['pairId']));}['_processTape'](_0x578838){for(let _0x2eea93=0x0;_0x2eea93<_0x578838['length'];_0x2eea93++){if('elementStart'===_0x578838[_0x2eea93]['type'])_0x578838[_0x2eea93]['item']['startIndex']=_0x2eea93;else{if('elementEnd'===_0x578838[_0x2eea93]['type']){_0x578838[_0x2eea93]['item']['endIndex']=_0x2eea93;const _0x36dca0=_0x578838[_0x2eea93]['item']['startIndex'];_0x578838[_0x36dca0]['pairId']=_0x578838[_0x2eea93]['id'],_0x578838[_0x2eea93]['pairId']=_0x578838[_0x36dca0]['id'];}else _0x578838[_0x2eea93]['item']['startIndex']=_0x2eea93,_0x578838[_0x2eea93]['item']['endIndex']=_0x2eea93,_0x578838[_0x2eea93]['pairId']=null;}_0x578838[_0x2eea93]['markersStart']||(_0x578838[_0x2eea93]['markersStart']=[],_0x578838[_0x2eea93]['markersEnd']=[]);}}_markInsertions(_0x2f24f3,_0x157911){const _0x4ffe9e=_0x2f24f3['filter'](_0x2feae0=>!_0x2feae0['isAdded']);for(let _0x448b94=0x0;_0x448b94<_0x157911['length'];_0x448b94++)_0x157911[_0x448b94]['isAdded']&&(_0x4ffe9e[_0x448b94]['isAdded']=_0x157911[_0x448b94]['isAdded']);}_getDiff(_0x290284,_0x2f1d25=null){const _0xfcf104=this['repository']['getRevision'](_0x290284),_0x4b7082=_0x2f1d25?this['repository']['getRevision'](_0x2f1d25):null,_0x302dda=this['_getRevisionsRange'](_0xfcf104,_0x4b7082),_0x246ae4=_0x302dda[_0x302dda['length']-0x1],_0x56596f=new Map(),_0x2c9160={'model':{},'attributes':{},'changes':[]},_0x4425a2=new Set(),_0xd09d7c=new Map();for(let _0x44912c=_0x302dda['length']-0x1;_0x44912c>=0x0;_0x44912c--){const _0x5044f1=_0x302dda[_0x44912c];for(const _0x3e3e53 of Object['keys'](_0x5044f1['diffData']))if(_0x5044f1['diffData'][_0x3e3e53]['attachChange']){const _0x21f47c=_0x5044f1['diffData'][_0x3e3e53]['attachChange'];_0x21f47c['isAttached']?(_0x4425a2['add'](_0x3e3e53),_0xd09d7c['has'](_0x3e3e53)&&_0xd09d7c['get'](_0x3e3e53)['userId']==_0x21f47c['userId']?_0xd09d7c['delete'](_0x3e3e53):_0xd09d7c['set'](_0x3e3e53,_0x21f47c)):_0xd09d7c['has'](_0x3e3e53)?(_0x4425a2['delete'](_0x3e3e53),_0xd09d7c['delete'](_0x3e3e53)):(_0x4425a2['add'](_0x3e3e53),_0xd09d7c['set'](_0x3e3e53,_0x21f47c));}else _0x4425a2['add'](_0x3e3e53);}for(const _0x56d053 of _0x4425a2){const _0x2e823a=_0xd09d7c['has'](_0x56d053)&&!_0xd09d7c['get'](_0x56d053)['isAttached'];let _0x46749c=_0x2e823a?_0x302dda['length']-0x1:0x0;const _0x42a90d=_0x2e823a?-0x1:0x1;for(;_0x302dda[_0x46749c];){const _0x29fe32=_0x302dda[_0x46749c];if(_0x29fe32['diffData'][_0x56d053]){const _0xc182bd=_0x2e823a?_0x29fe32['diffData'][_0x56d053]['attributesBefore']:_0x29fe32['diffData'][_0x56d053]['attributesAfter'];_0x2c9160['attributes'][_0x56d053]=_0xc182bd?_0x2b717e(_0xc182bd):{};break;}_0x46749c+=_0x42a90d;}}for(const _0x1ab99a of _0x302dda){_0x1ab99a['model']={};for(const _0x555916 of _0x1ab99a['authors'])_0x56596f['set'](_0x555916['id'],_0x555916);for(const _0x17efb2 of _0x4425a2){const _0x8833e5=_0x1ab99a['diffData'][_0x17efb2]?_0x1ab99a['diffData'][_0x17efb2]['insertions']:'[]',_0x56f6d7=_0x1ab99a['diffData'][_0x17efb2]?_0x1ab99a['diffData'][_0x17efb2]['deletions']:'[]',_0x16f303=_0x1ab99a['diffData'][_0x17efb2]?.['rootElementName']||'$root';_0x1ab99a['model'][_0x17efb2]={'insertions':this['_utils']['_makeModelFromViewString'](_0x8833e5,_0x16f303),'deletions':this['_utils']['_makeModelFromViewString'](_0x56f6d7,_0x16f303)};}}for(const _0x367afa of _0x4425a2){let _0x142029=null,_0xaf4f88=0x0;const _0xd8b790=_0x302dda['map'](_0x574a39=>_0x574a39['diffData'][_0x367afa]?.['rootElementName'])['find'](_0x18246d=>void 0x0!==_0x18246d)||'$root',_0xc1d46a=new Map(Array['from'](_0xfcf104['model'][_0x367afa]['insertions']['markers'])['filter'](([_0x2abd78])=>!_0x2abd78['startsWith']('revision:')));let _0x1eda75=0x0;for(const _0x5cdccf of _0x302dda){const _0x337941=_0x5cdccf['diffData'][_0x367afa]?.['aiSources']||{},_0x153f87=this['_makeTape'](_0x5cdccf['model'][_0x367afa]['insertions'],_0x337941);_0x5cdccf==_0xfcf104?(_0x142029=_0x153f87,_0xaf4f88=_0x142029['length'],_0x142029['forEach'](_0x44ade6=>{_0x44ade6['id']=_0x1eda75++;}),this['_processTape'](_0x142029)):this['_markInsertions'](_0x142029,_0x153f87);const _0x1c6b84=_0x142029['filter'](_0x4b60a8=>!_0x4b60a8['isAdded'])['map'](_0x1496ba=>_0x1496ba['id']);let _0x339356=0x0;const _0xd393d=this['_makeTape'](_0x5cdccf['model'][_0x367afa]['deletions'],_0x337941);_0xd393d['forEach'](_0x3bf532=>{_0x3bf532['isRemoved']?_0x3bf532['id']=_0xaf4f88++:_0x3bf532['id']=_0x1c6b84[_0x339356++];}),this['_processTape'](_0xd393d),this['_setDistance'](_0x142029,'isAdded'),this['_setDistance'](_0xd393d,'isRemoved'),_0x5cdccf==_0xfcf104&&this['_markMarkers'](_0x142029,_0xc1d46a),_0x142029=this['_joinTapes'](_0x142029,_0xd393d),this['_refreshStartEndIndex'](_0x142029),this['_setDistance'](_0x142029,'isRemoved');}_0x142029=_0x142029['filter'](_0xe85b73=>!(_0xe85b73['isAdded']&&_0xe85b73['isRemoved']));const _0x43b8f3=new Map(_0x246ae4['model'][_0x367afa]['deletions']['markers']),_0x543847=new Set(_0xc1d46a['keys']());for(const _0x3a80a7 of _0x43b8f3['keys']())_0x543847['delete'](_0x3a80a7);const _0x390563=Object['assign']({},..._0x302dda['map'](_0x12f5bd=>_0x12f5bd['diffData'][_0x367afa]?.['aiSources']));this['_markSuggestions'](_0x142029,_0x543847,_0x390563),this['_fixObsoleteTags'](_0x142029),_0x142029=this['_removeMissingPairs'](_0x142029),_0x142029=this['_markMismatchedRemovedTags'](_0x142029),_0x142029=this['_removeUnsupportedChanges'](_0x142029);const {root:_0x71a765,changes:_0x369de0}=this['_makeModelFromTape'](_0x142029,_0x56596f,_0x367afa,_0xd8b790);_0x2c9160['model'][_0x367afa]=_0x71a765;const _0x10f163=_0xd09d7c['get'](_0x367afa);if(_0x10f163){const _0x57c1b0=_0x56596f['get'](_0x10f163['userId']),_0xc7c069=new Mt({'author':_0x57c1b0,'type':_0x10f163['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x367afa});_0x369de0['unshift'](_0xc7c069),_0x2c9160['attributes'][_0x367afa]['revisionHistoryAttachChange']=_0xc7c069['id'];}_0x2c9160['changes']=_0x2c9160['changes']['concat'](_0x369de0);}return _0x2c9160;}['_markMarkers'](_0x3d37e9,_0x3f99fe){for(let _0x1a02a7=0x0;_0x1a02a7<_0x3d37e9['length'];_0x1a02a7++)for(const [_0x38b056,_0x4a073d]of _0x3f99fe)!_0x4a073d['isCollapsed']&&_0x4a073d['start']['isEqual'](_0x3d37e9[_0x1a02a7]['previousPosition'])&&_0x3d37e9[_0x1a02a7]['markersStart']['push'](_0x38b056),_0x4a073d['end']['isEqual'](_0x3d37e9[_0x1a02a7]['nextPosition'])&&_0x3d37e9[_0x1a02a7]['markersEnd']['push'](_0x38b056);}['_joinTapes'](_0x5bd506,_0x4b5d9a){let _0x1c97a4=[],_0x1a455c=0x0,_0x537b32=0x0;for(;_0x1a455c<_0x5bd506['length']||_0x537b32<_0x4b5d9a['length'];){const _0x58f56d=_0x5bd506[_0x1a455c]||{},_0x55fdd8=_0x4b5d9a[_0x537b32]||{};if(_0x58f56d['id']==_0x55fdd8['id'])_0x1a455c++,_0x537b32++,_0x1c97a4['push'](_0x58f56d);else{if(_0x55fdd8['isRemoved']&&_0x58f56d['isAdded']){const {commonTape:_0x222141,iEnd:_0xd86223,jEnd:_0x2a9eca}=this['_threeWayMerge'](_0x5bd506,_0x1a455c,_0x4b5d9a,_0x537b32);_0x1c97a4=_0x1c97a4['concat'](_0x222141),_0x1a455c=_0xd86223,_0x537b32=_0x2a9eca;}else _0x55fdd8['isRemoved']?(_0x537b32++,_0x1c97a4['push'](_0x55fdd8)):(_0x1a455c++,_0x1c97a4['push'](_0x58f56d));}}return _0x1c97a4;}_markSuggestions(_0x5dc5b6,_0x3bee32,_0x21879a){const _0x10e760=[];for(let _0x4940a3=0x0;_0x4940a3<_0x5dc5b6['length'];_0x4940a3++){for(let _0x2666a7=0x0;_0x2666a7<_0x5dc5b6[_0x4940a3]['markersStart']['length'];_0x2666a7++){const _0x13cfae=_0x5dc5b6[_0x4940a3]['markersStart'][_0x2666a7];if(!_0x3bee32['has'](_0x13cfae))continue;const {group:_0x5653ca,type:_0x292619,authorId:_0xec1ae3}=_0x26f1bd(_0x13cfae);if('revision-suggestion'!=_0x5653ca||'insertion'!=_0x292619&&'deletion'!=_0x292619)continue;const _0x549036=_0x21879a['suggestion:'+_0x13cfae['slice'](0x14)]||null;_0x10e760['unshift']({'type':_0x292619,'name':_0x13cfae,'userId':_0xec1ae3,'aiSource':_0x549036}),_0x5dc5b6[_0x4940a3]['markersStart']['splice'](_0x2666a7,0x1),_0x2666a7--;}_0x465b9a(_0x5dc5b6[_0x4940a3]);for(let _0x4613ce=0x0;_0x4613ce<_0x5dc5b6[_0x4940a3]['markersEnd']['length'];_0x4613ce++){const _0x16a2d0=_0x5dc5b6[_0x4940a3]['markersEnd'][_0x4613ce];if(!_0x3bee32['has'](_0x16a2d0))continue;const {group:_0x3fa628,type:_0x2f7841}=_0x26f1bd(_0x16a2d0);if('revision-suggestion'!=_0x3fa628||'insertion'!=_0x2f7841&&'deletion'!=_0x2f7841)continue;_0x5dc5b6[_0x4940a3]['markersEnd']['splice'](_0x4613ce,0x1),_0x4613ce--;const _0x521154=_0x10e760['findIndex'](_0x18ac62=>_0x18ac62['name']==_0x16a2d0);_0x521154>-0x1&&_0x10e760['splice'](_0x521154,0x1);}}function _0x26f1bd(_0x37e78c){const _0x13e42a=_0x37e78c['split'](':');return{'group':_0x13e42a[0x0],'type':_0x13e42a[0x1],'subType':_0x13e42a['length']>=0x5?_0x13e42a[0x2]:null,'id':_0x13e42a['length']<0x5?_0x13e42a[0x2]:_0x13e42a[0x3],'authorId':_0x13e42a['length']<0x5?_0x13e42a[0x3]:_0x13e42a[0x4],'markerCount':0x6==_0x13e42a['length']?_0x13e42a[0x5]:null};}function _0x465b9a(_0x30b9a5){for(let _0x1d2a78=0x0;_0x1d2a78<_0x10e760['length'];_0x1d2a78++){if(_0x30b9a5['isAdded']&&'insertion'==_0x10e760[_0x1d2a78]['type']&&_0x30b9a5['isAdded']['userId']==_0x10e760[_0x1d2a78]['userId'])return _0x30b9a5['isAddSuggestion']={..._0x10e760[_0x1d2a78],'aiSource':_0x30b9a5['isAdded']['aiSource']||_0x10e760[_0x1d2a78]['aiSource']},void delete _0x30b9a5['isAdded'];if(!_0x30b9a5['isAdded']&&!_0x30b9a5['isRemoved']&&'deletion'==_0x10e760[_0x1d2a78]['type'])return void(_0x30b9a5['isRemoveSuggestion']=_0x10e760[_0x1d2a78]);}}}_setDistance(_0x30b5fa,_0x43f358){let _0x53dcaf=0x0,_0xd1808a=!0x1;const _0x21e8ea=new Map();for(const _0x4d8522 of _0x30b5fa)_0x4d8522[_0x43f358]?_0xd1808a&&(_0x53dcaf++,_0xd1808a=!0x1):(_0x53dcaf++,_0xd1808a=!0x0),_0x21e8ea['set'](_0x4d8522['id'],_0x53dcaf);for(let _0x5f40e8=0x0;_0x5f40e8<_0x30b5fa['length'];_0x5f40e8++){if('isRemoved'==_0x43f358&&_0x30b5fa[_0x5f40e8]['isAdded']||'isAdded'==_0x43f358&&_0x30b5fa[_0x5f40e8]['isRemoved'])continue;if('text'==_0x30b5fa[_0x5f40e8]['type']){_0x30b5fa[_0x5f40e8]['distance']=0x0;continue;}const _0x3b7180=_0x21e8ea['get'](_0x30b5fa[_0x5f40e8]['pairId']),_0x10100d=_0x21e8ea['get'](_0x30b5fa[_0x5f40e8]['id']);_0x30b5fa[_0x5f40e8]['distance']=_0x3b7180-_0x10100d;}}_getRevisionsRange(_0x2e8aaf,_0x435671,_0x5b8daa=!0x1){const _0x2e9114=[];let _0x5e5816=this['repository']['getIndex'](_0x2e8aaf),_0x77845a=this['repository']['getIndex'](_0x435671);for(-0x1==_0x77845a&&(_0x77845a=this['repository']['_revisions']['length'],_0x5b8daa=!0x1);_0x5e5816<_0x77845a;)_0x2e9114['push'](this['repository']['getRevision'](_0x5e5816)),_0x5e5816++;return _0x5b8daa&&_0x2e9114['push'](this['repository']['getRevision'](_0x5e5816)),_0x2e9114;}_threeWayMerge(_0x123e9b,_0x4712d3,_0x55ae42,_0x5b6c7e){const _0x70054c=this['editor']['model']['schema'];let _0x2ddabf=_0x4712d3;for(;_0x123e9b[_0x2ddabf]&&_0x123e9b[_0x2ddabf]['isAdded'];)_0x2ddabf++;let _0x8a9915=_0x5b6c7e;for(;_0x55ae42[_0x8a9915]&&_0x55ae42[_0x8a9915]['isRemoved'];)_0x8a9915++;_0x40fea8(_0x123e9b,_0x4712d3,_0x2ddabf),_0x40fea8(_0x55ae42,_0x5b6c7e,_0x8a9915);const _0x2e4ec6=_0x55ae42['slice'](_0x5b6c7e,_0x8a9915)['concat'](_0x123e9b['slice'](_0x4712d3,_0x2ddabf));return _0x2e4ec6['sort']((_0x1218ef,_0x103819)=>_0x1218ef['side']!=_0x103819['side']?_0x1218ef['side']-_0x103819['side']:_0x1218ef['level']!=_0x103819['level']?_0x1218ef['level']-_0x103819['level']:_0x1218ef['distance']!=_0x103819['distance']?_0x103819['distance']-_0x1218ef['distance']:!!_0x1218ef['isAdded']!=!!_0x103819['isAdded']?-0x1==_0x1218ef['side']||0x0==_0x1218ef['side']?_0x1218ef['isAdded']?-0x1:0x1:_0x1218ef['isAdded']?0x1:-0x1:_0x1218ef['index']-_0x103819['index']),{'commonTape':_0x2e4ec6,'iEnd':_0x2ddabf,'jEnd':_0x8a9915};function _0x40fea8(_0x48a98,_0x3a6214,_0x59e7bc){let _0x30d203=-0x1,_0x52e8ce=Number['POSITIVE_INFINITY'],_0x33ee52=!0x0;for(let _0x43fc6b=_0x3a6214;_0x43fc6b<_0x59e7bc;_0x43fc6b++)if(_0x70054c['isInline'](_0x48a98[_0x43fc6b]['item'])||(_0x33ee52=!0x1),_0x48a98[_0x43fc6b]['item']['startIndex']<_0x3a6214&&(_0x30d203=_0x43fc6b),_0x48a98[_0x43fc6b]['item']['endIndex']>=_0x59e7bc){_0x52e8ce=_0x43fc6b;break;}_0x33ee52&&(_0x30d203=_0x59e7bc-0x1);for(let _0x5ae7f4=_0x3a6214;_0x5ae7f4<_0x59e7bc;_0x5ae7f4++)_0x48a98[_0x5ae7f4]['side']=_0x5ae7f4<=_0x30d203?-0x1:_0x5ae7f4<_0x52e8ce?0x0:0x1,_0x48a98[_0x5ae7f4]['index']=_0x5ae7f4;let _0x424abf=0x0;for(let _0x2ff3fc=_0x3a6214;_0x2ff3fc<=_0x30d203;_0x2ff3fc++)0x0==_0x48a98[_0x2ff3fc]['distance']?_0x48a98[_0x2ff3fc]['level']=_0x424abf:(_0x424abf++,_0x48a98[_0x2ff3fc]['level']=_0x424abf,_0x424abf++);for(let _0x2a78ed=_0x3a6214;_0x2a78ed<_0x59e7bc;_0x2a78ed++)0x0==_0x48a98[_0x2a78ed]['side']&&(_0x48a98[_0x2a78ed]['level']=_0x424abf);_0x424abf=0x0;for(let _0x2a65e8=_0x59e7bc-0x1;_0x2a65e8>=_0x52e8ce;_0x2a65e8--)0x0==_0x48a98[_0x2a65e8]['distance']?_0x48a98[_0x2a65e8]['level']=_0x424abf:(_0x424abf--,_0x48a98[_0x2a65e8]['level']=_0x424abf,_0x424abf--);}}_fixObsoleteTags(_0x4e1ffa){const _0x500ef3=new Map(),_0x282032=this['editor']['model']['schema'];for(let _0x24f1fa=0x1;_0x24f1fa<_0x4e1ffa['length'];_0x24f1fa++){let _0x4c9522,_0x3db97e,_0x29cce1;const _0x5360cd=_0x4e1ffa[_0x24f1fa],_0x5c5861=_0x4e1ffa[_0x24f1fa-0x1];if('text'==_0x5360cd['type'])continue;if(_0x5360cd['type']!=_0x5c5861['type'])continue;if(!_0x282032['isBlock'](_0x5c5861['item'])||_0x282032['isLimit'](_0x5c5861['item']))continue;if(!_0x282032['isBlock'](_0x5360cd['item'])||_0x282032['isLimit'](_0x5360cd['item']))continue;if((_0x4e1ffa[_0x24f1fa]['isAdded']||_0x4e1ffa[_0x24f1fa]['isAddSuggestion'])&&_0x4e1ffa[_0x24f1fa-0x1]['isRemoved'])_0x4c9522=_0x4e1ffa[_0x24f1fa],_0x3db97e=_0x4e1ffa[_0x24f1fa-0x1],_0x29cce1=_0x24f1fa-0x1;else{if(!_0x4e1ffa[_0x24f1fa]['isRemoved']||!_0x4e1ffa[_0x24f1fa-0x1]['isAdded']&&!_0x4e1ffa[_0x24f1fa-0x1]['isAddSuggestion'])continue;_0x4c9522=_0x4e1ffa[_0x24f1fa-0x1],_0x3db97e=_0x4e1ffa[_0x24f1fa],_0x29cce1=_0x24f1fa;}const _0x3925c5=_0x4c9522['level']==_0x3db97e['level'],_0x2ff26f=Math['abs'](_0x4c9522['level'])<Math['abs'](_0x3db97e['level'])&&0x0==_0x3db97e['distance'];(_0x3925c5||_0x2ff26f)&&(_0x500ef3['set'](_0x3db97e['id'],_0x4c9522['id']),_0x4e1ffa['splice'](_0x29cce1,0x1),_0x24f1fa--,_0x4c9522['isAdded']=!0x1);}for(let _0xb1bffd=0x0;_0xb1bffd<_0x4e1ffa['length'];_0xb1bffd++)_0x500ef3['has'](_0x4e1ffa[_0xb1bffd]['pairId'])&&(_0x4e1ffa[_0xb1bffd]['pairId']=_0x500ef3['get'](_0x4e1ffa[_0xb1bffd]['pairId']));}['_removeMissingPairs'](_0x3ccefa){const _0x37504c=new Set(_0x3ccefa['map'](_0x1388bb=>_0x1388bb['id']));for(let _0x355fa6=0x0;_0x355fa6<_0x3ccefa['length'];_0x355fa6++)_0x37504c['has'](_0x3ccefa[_0x355fa6]['pairId'])||0x0==_0x3ccefa[_0x355fa6]['distance']||(_0x3ccefa[_0x355fa6]['isIncorrect']=!0x0);return _0x3ccefa['filter'](_0x4f8000=>!_0x4f8000['isIncorrect']);}_markMismatchedRemovedTags(_0x5960f8){const _0x2e865e=new Set();for(let _0x43b449=0x0;_0x43b449<_0x5960f8['length'];_0x43b449++){if(_0x2e865e['has'](_0x5960f8[_0x43b449]['id'])&&_0x5960f8[_0x43b449]['isRemoved']&&(_0x5960f8[_0x43b449]['isIncorrect']=!0x0),_0x5960f8[_0x43b449]['isIncorrect'])continue;if(0x0==_0x5960f8[_0x43b449]['distance'])continue;if('elementStart'!=_0x5960f8[_0x43b449]['type'])continue;if(null==_0x5960f8[_0x43b449]['pairId'])continue;let _0x4ea03d=_0x43b449+0x1,_0x56dde6=0x0;for(;_0x5960f8[_0x4ea03d]['id']!=_0x5960f8[_0x43b449]['pairId'];)'elementStart'==_0x5960f8[_0x4ea03d]['type']?_0x56dde6++:'elementEnd'==_0x5960f8[_0x4ea03d]['type']&&_0x56dde6--,_0x4ea03d++;if(0x0!=_0x56dde6){if(_0x5960f8[_0x43b449]['isRemoved'])_0x5960f8[_0x43b449]['isIncorrect']=!0x0;else{for(;_0x4ea03d!=_0x43b449;)_0x5960f8[_0x4ea03d]['isRemoved']&&0x0!=_0x5960f8[_0x4ea03d]['distance']&&(_0x5960f8[_0x4ea03d]['isIncorrect']=!0x0,_0x2e865e['add'](_0x5960f8[_0x4ea03d]['pairId'])),_0x4ea03d--;}}}return _0x5960f8['filter'](_0x1a03be=>!_0x1a03be['isIncorrect']);}_removeUnsupportedChanges(_0x6cee7c){const _0x4f9ed9=this['editor']['model']['schema'];for(let _0x11e34e=0x0;_0x11e34e<_0x6cee7c['length'];_0x11e34e++){if(!(_0x6cee7c[_0x11e34e]['isAdded']||_0x6cee7c[_0x11e34e]['isAddSuggestion']||_0x6cee7c[_0x11e34e]['isRemoved']||_0x6cee7c[_0x11e34e]['isRemoveSuggestion']))continue;if(0x0==_0x6cee7c[_0x11e34e]['distance'])continue;const _0x72183f=_0x6cee7c[_0x11e34e]['item'];_0x4f9ed9['isBlock'](_0x72183f)||_0x4f9ed9['isLimit'](_0x72183f)||(_0x6cee7c[_0x11e34e]['isAdded']&&delete _0x6cee7c[_0x11e34e]['isAdded'],_0x6cee7c[_0x11e34e]['isAddSuggestion']&&delete _0x6cee7c[_0x11e34e]['isAddSuggestion'],_0x6cee7c[_0x11e34e]['isRemoveSuggestion']&&delete _0x6cee7c[_0x11e34e]['isRemoveSuggestion'],_0x6cee7c[_0x11e34e]['isRemoved']&&(_0x6cee7c[_0x11e34e]['isIncorrect']=!0x0));}return _0x6cee7c['filter'](_0x21f1e6=>!_0x21f1e6['isIncorrect']);}['_makeModelFromTape'](_0x154440,_0x3b0c0a,_0x1ff4ce,_0x525323){const _0x10ceed=new _0x258ac8(),_0x39ef3d=[],_0x2a17d9=new Map(),_0x5e6d09=this['editor']['model'],_0x26080b=_0x5e6d09['schema'],_0x29fb6f=[_0x10ceed],_0x469613={},_0x3d277b={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x10ceed['name']=_0x525323;let _0x1d2958=null;const _0x39eb89=[0x0];for(let _0x5bd280=0x0;_0x5bd280<_0x154440['length'];_0x5bd280++)if('elementStart'===_0x154440[_0x5bd280]['type']){_0x154440[_0x5bd280]['previousPosition']=_0x5e6d09['createPositionFromPath'](_0x10ceed,_0x39eb89);const _0xf41799=new _0x1868f7(_0x154440[_0x5bd280]['item']['name'],_0x154440[_0x5bd280]['item']['getAttributes']());_0x29fb6f[0x0]['_appendChild'](_0xf41799),_0x39eb89['push'](0x0),_0x29fb6f['unshift'](_0xf41799),_0x154440[_0x5bd280]['nextPosition']=_0x5e6d09['createPositionFromPath'](_0x10ceed,_0x39eb89);}else'elementEnd'===_0x154440[_0x5bd280]['type']?(_0x29fb6f['shift'](),_0x154440[_0x5bd280]['previousPosition']=_0x5e6d09['createPositionFromPath'](_0x10ceed,_0x39eb89),_0x39eb89['pop'](),_0x39eb89[_0x39eb89['length']-0x1]++,_0x154440[_0x5bd280]['nextPosition']=_0x5e6d09['createPositionFromPath'](_0x10ceed,_0x39eb89)):(_0x154440[_0x5bd280]['previousPosition']=_0x5e6d09['createPositionFromPath'](_0x10ceed,_0x39eb89),_0x1d2958?_0x1d2958['_data']+=_0x154440[_0x5bd280]['item']['data']:_0x1d2958=new _0x3ec4fc(_0x154440[_0x5bd280]['item']['data'],_0x154440[_0x5bd280]['item']['getAttributes']()),_0x154440[_0x5bd280+0x1]&&'text'===_0x154440[_0x5bd280+0x1]['type']&&_0x5da356(_0x1d2958,_0x154440[_0x5bd280+0x1]['item'])||(_0x29fb6f[0x0]['_appendChild'](_0x1d2958),_0x1d2958=null),_0x39eb89[_0x39eb89['length']-0x1]+=_0x154440[_0x5bd280]['item']['offsetSize'],_0x154440[_0x5bd280]['nextPosition']=_0x5e6d09['createPositionFromPath'](_0x10ceed,_0x39eb89));for(let _0x44d5d4=0x0;_0x44d5d4<_0x154440['length'];_0x44d5d4++){const _0x57900a=_0x154440[_0x44d5d4]['previousPosition'],_0x44b93d=_0x154440[_0x44d5d4]['nextPosition'];for(const _0x9bf3ef of _0x154440[_0x44d5d4]['markersStart'])_0x2a17d9['set'](_0x9bf3ef,{'start':_0x57900a,'end':null});_0x216a2d('isRemoveSuggestion',_0x44d5d4,_0x57900a,_0x44b93d),_0x216a2d('isAddSuggestion',_0x44d5d4,_0x57900a,_0x44b93d),_0x216a2d('isRemoved',_0x44d5d4,_0x57900a,_0x44b93d),_0x216a2d('isAdded',_0x44d5d4,_0x57900a,_0x44b93d);for(const _0x36c2ad of _0x154440[_0x44d5d4]['markersEnd']){const _0x371127=_0x2a17d9['get'](_0x36c2ad);_0x371127?_0x371127['end']=_0x44b93d:_0x2a17d9['set'](_0x36c2ad,{'start':_0x44b93d,'end':_0x44b93d});}}for(const [_0x1eb6bf,_0x37a5e7]of _0x2a17d9){const _0x2300f8=this['editor']['model']['createRange'](_0x37a5e7['start'],_0x37a5e7['end']);_0x10ceed['markers']['set'](_0x1eb6bf,_0x2300f8);}return _0x39ef3d['sort']((_0x35b011,_0x948188)=>{const _0x44e004=_0x10ceed['markers']['get']('revision:'+_0x35b011['id']),_0x274c15=_0x10ceed['markers']['get']('revision:'+_0x948188['id']);return _0x44e004['start']['isBefore'](_0x274c15['start'])?-0x1:_0x44e004['start']['isAfter'](_0x274c15['start'])?0x1:_0x44e004['end']['isBefore'](_0x274c15['end'])?-0x1:_0x44e004['end']['isAfter'](_0x274c15['end'])?0x1:'add'===_0x35b011['type']?-0x1:0x1;}),{'root':_0x10ceed,'changes':_0x39ef3d};function _0x216a2d(_0x6865ff,_0x370086,_0x4c961c,_0x263c69){const _0x3fe6eb=!!_0x154440[_0x370086][_0x6865ff],_0x1f0a9e=_0x3fe6eb?_0x154440[_0x370086][_0x6865ff]['userId']:null,_0x36a02e=_0x3fe6eb&&_0x154440[_0x370086][_0x6865ff]['aiSource']||null,_0x1ee195=_0x370086===_0x154440['length']-0x1,_0x2d3c97=_0x3d277b[_0x6865ff][0x0],_0x3d61ec=_0x26080b['isObject'](_0x154440[_0x370086]['item']);!_0x469613[_0x6865ff]&&_0x3fe6eb?_0x469613[_0x6865ff]={'start':_0x4c961c,'tapeItem':_0x154440[_0x370086],'userId':_0x1f0a9e,'aiSource':_0x36a02e,'type':_0x6865ff}:_0x469613[_0x6865ff]&&!_0x3fe6eb?(_0x469613[_0x6865ff]['end']=_0x4c961c,_0x1c43eb(_0x469613[_0x6865ff]),_0x469613[_0x6865ff]=null):_0x469613[_0x6865ff]&&_0x3fe6eb&&(_0x469613[_0x6865ff]['userId']!==_0x1f0a9e||_0x469613[_0x6865ff]['aiSource']!==_0x36a02e)&&(_0x469613[_0x6865ff]['end']=_0x4c961c,_0x2d3c97&&_0x2d3c97['userId']===_0x469613[_0x6865ff]['userId']?_0x2d3c97['change']['aiSource']=_0x2d3c97['change']['aiSource']||_0x469613[_0x6865ff]['aiSource']:_0x1c43eb(_0x469613[_0x6865ff]),_0x469613[_0x6865ff]={'start':_0x4c961c,'tapeItem':_0x154440[_0x370086],'userId':_0x1f0a9e,'aiSource':_0x36a02e,'type':_0x6865ff}),_0x469613[_0x6865ff]&&_0x3d61ec&&('elementStart'!==_0x154440[_0x370086]['type']||_0x2d3c97&&_0x2d3c97['userId']===_0x1f0a9e||_0x3d277b[_0x6865ff]['unshift']({'userId':_0x1f0a9e,'object':_0x154440[_0x370086]['item'],'change':_0x469613[_0x6865ff]}),'elementEnd'===_0x154440[_0x370086]['type']&&_0x2d3c97&&_0x2d3c97['object']===_0x154440[_0x370086]['item']&&(_0x3d277b[_0x6865ff]['shift'](),_0x469613[_0x6865ff]=_0x2d3c97['change'])),_0x469613[_0x6865ff]&&_0x1ee195&&(_0x469613[_0x6865ff]['end']=_0x263c69,_0x1c43eb(_0x469613[_0x6865ff]),_0x469613[_0x6865ff]=null);}function _0x1c43eb({start:_0x40f8ca,end:_0x3c96d3,tapeItem:_0x3077a7,userId:_0x46405a,aiSource:_0x44b631,type:_0x527300}){const _0x1ba895=_0x3077a7['item'],_0x13c0cc=_0x5e6d09['schema']['isBlock'](_0x1ba895)&&!_0x5e6d09['schema']['isLimit'](_0x1ba895),_0x2a7124=_0x40f8ca['nodeAfter']==_0x3c96d3['parent']&&_0x3c96d3['isAtStart'];if(_0x13c0cc&&_0x2a7124)return;const _0x47bddc=_0x5e6d09['createRange'](_0x40f8ca,_0x3c96d3),_0x1cd187=_0x3b0c0a['get'](_0x46405a),_0x110cf6=new Mt({'author':_0x1cd187,'type':'isAdded'==_0x527300||'isAddSuggestion'==_0x527300?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x527300||'isRemoveSuggestion'==_0x527300,'aiSource':_0x44b631||null},'createdAt':new Date(),'rootName':_0x1ff4ce});_0x39ef3d['push'](_0x110cf6),_0x10ceed['markers']['set']('revision:'+_0x110cf6['id'],_0x47bddc);}function _0x5da356(_0x5f3c2d,_0x4c8f81){const _0x1ee057=_0x5f3c2d['getAttributes'](),_0x2facce=_0x4c8f81['getAttributes']();for(const _0x3a8d6b of _0x1ee057){if(_0x3a8d6b[0x1]!==_0x4c8f81['getAttribute'](_0x3a8d6b[0x0]))return!0x1;_0x2facce['next']();}return _0x2facce['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x477584=>{const _0x208b12=_0x477584['markerName']['split'](':')[0x1],_0xbd550f=this['_getChangeFromId'](_0x208b12);if(!_0xbd550f)return null;const _0x32ec02='add'==_0xbd550f['type']?'insertion':'deletion',_0x3eb843=['ck-suggestion-marker','ck-suggestion-marker-'+_0x32ec02];return _0xbd550f['data']['isSuggestion']&&_0x3eb843['push']('ck-suggestion-marker-'+_0x32ec02+'-new'),this['activeChange']==_0xbd550f&&_0x3eb843['push']('ck-suggestion-marker--active'),{'classes':_0x3eb843,'attributes':{'data-change-id':_0x208b12}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x5b2071=>{_0x5b2071['on']('element:pre',(_0x323da9,_0x2db847,_0x2b3877)=>{const _0x9754cb=_0x2db847['viewItem']['getChild'](0x0);if(!_0x9754cb||!_0x9754cb['is']('element','code'))return;if(!_0x2b3877['consumable']['consume'](_0x9754cb,{'attributes':['vid_start','vid_end']}))return;const _0x4744f5=_0x2db847['modelRange']['start']['nodeAfter'];_0x2b3877['writer']['setAttribute']('vid_start',_0x9754cb['getAttribute']('vid_start'),_0x4744f5),_0x2b3877['writer']['setAttribute']('vid_end',_0x9754cb['getAttribute']('vid_end'),_0x4744f5);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x266844=>{_0x266844['on']('element',(_0x2b40a1,_0x2ff70f,_0x47c2a0)=>{if(!_0x47c2a0['consumable']['consume'](_0x2ff70f['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x2ff70f['modelRange']['isCollapsed'])return;const _0x24b2bd=_0x2ff70f['modelRange']['start']['nodeAfter'];_0x24b2bd['hasAttribute']('vid_start')||_0x24b2bd['hasAttribute']('vid')||(_0x47c2a0['writer']['setAttribute']('vid_start',_0x2ff70f['viewItem']['getAttribute']('vid_start'),_0x24b2bd),_0x47c2a0['writer']['setAttribute']('vid_end',_0x2ff70f['viewItem']['getAttribute']('vid_end'),_0x24b2bd));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x50c436=>_0x50c436['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x4c8955,[,_0x5cf186])=>{['vid_start','vid_end','vid']['includes'](_0x5cf186)&&(_0x4c8955['return']=!0x0,_0x4c8955['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x1f5d20=>{_0x1f5d20['on']('attribute:vid',(_0x43b44b,_0xe4bda6,_0x5bc081)=>{if('\x20'!=_0xe4bda6['item']['data']||_0xe4bda6['item']['parent']['maxOffset']>0x1)return;if(!_0x5bc081['consumable']['consume'](_0xe4bda6['item'],_0x43b44b['name']))return;const _0x2f3f09=_0x5bc081['writer'],_0x39abf2=_0x5bc081['mapper']['toViewRange'](_0xe4bda6['range']);_0x2f3f09['wrap'](_0x39abf2,_0x2f3f09['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x3cadd6){const _0x4dac16=_0x3cadd6['plugins']['get']('RevisionViewer');return(_0x29d56e,_0x3b8189,_0x1568c5)=>{const _0xa87a3b=_0x3b8189['markerName']['split'](':')[0x1],_0x3e32dd=_0x4dac16['_getChangeFromId'](_0xa87a3b);if(!_0x3e32dd)return null;const _0x44b3c5='add'==_0x3e32dd['type']?'split':'merge';if(!_0x1568c5['consumable']['test'](_0x3b8189['markerRange'],_0x29d56e['name']))return;const _0x1de971=_0x3b8189['markerRange']['getWalker'](),_0x5f39e1=_0x3b8189['markerRange']['start'],_0x5653e7=_0x3cadd6['model']['schema'];let _0x1ac287=null,_0x1a268a=null,_0x56ec3d=!0x1,_0x40efdc=!0x1;for(const _0x2f4e80 of _0x1de971){const _0x209f09=_0x2f4e80['item'];_0x56ec3d=_0x56ec3d||_0x5653e7['isContent'](_0x209f09);const _0x3a912c=_0x1568c5['mapper']['toViewElement'](_0x209f09);if(_0x3a912c&&_0x3a912c['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x2f4e80['type']&&(_0x5653e7['isBlock'](_0x209f09)&&!_0x5653e7['isLimit'](_0x209f09)&&(_0x209f09['nextSibling']||_0x5f39e1['isAtEnd']?_0x1ac287&&_0x1ac287['parent']==_0x209f09||(_0x1ac287=_0x209f09,_0x521d37(_0x2f4e80['previousPosition']),_0x40efdc=!0x0):_0x1a268a=_0x1a268a||_0x2f4e80['previousPosition']));}function _0x521d37(_0x40795c){const _0x16f855=_0x1568c5['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x44b3c5}),_0x327cf6=_0x1568c5['mapper']['toViewPosition'](_0x40795c);_0x3e32dd['data']['isSuggestion']&&_0x1568c5['writer']['addClass']('ck-suggestion-marker-'+_0x44b3c5+'-new',_0x16f855),_0x4dac16['activeChange']==_0x3e32dd&&_0x1568c5['writer']['addClass']('ck-suggestion-marker--active',_0x16f855),_0x1568c5['writer']['insert'](_0x327cf6,_0x16f855),_0x1568c5['mapper']['bindElementToMarker'](_0x16f855,_0x3b8189['markerName']);}_0x56ec3d||_0x40efdc||!_0x1a268a||_0x521d37(_0x1a268a);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x106ea1,_0x348169,_0x115944)=>{const _0x4e3c6b=_0x115944['mapper']['markerNameToElements'](_0x348169['markerName']);if(_0x4e3c6b){for(const _0x33f930 of _0x4e3c6b)(_0x33f930['hasClass']('ck-suggestion-marker-split')||_0x33f930['hasClass']('ck-suggestion-marker-merge'))&&(_0x115944['mapper']['unbindElementFromMarkerName'](_0x33f930,_0x348169['markerName']),_0x115944['writer']['remove'](_0x33f930));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x54b013,_0x862380,_0x39b8c7)=>{const _0x518719=_0x862380['markerName']['split'](':')[0x1],_0x412f44=this['_getChangeFromId'](_0x518719);if(!_0x412f44)return null;const _0x5bcc26='add'==_0x412f44['type']?'split':'merge';if(_0x39b8c7['consumable']['test'](_0x862380['markerRange'],_0x54b013['name']))for(const _0x2753b4 of _0x862380['markerRange']['getItems']()){if(!_0x2753b4['is']('element','softBreak'))continue;const _0x3b93a2=_0x39b8c7['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x5bcc26}),_0x5914e1=_0x39b8c7['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x2753b4));_0x412f44['data']['isSuggestion']&&_0x39b8c7['writer']['addClass']('ck-suggestion-marker-'+_0x5bcc26+'-new',_0x3b93a2),this['activeChange']==_0x412f44&&_0x39b8c7['writer']['addClass']('ck-suggestion-marker--active',_0x3b93a2),_0x39b8c7['writer']['insert'](_0x5914e1,_0x3b93a2),_0x39b8c7['mapper']['bindElementToMarker'](_0x3b93a2,_0x862380['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x546db7=>{for(const _0x3e17c8 of this['editor']['model']['document']['getRootNames']()){const _0x5caea6=this['editor']['model']['document']['getRoot'](_0x3e17c8),_0x2a9dec=this['editor']['editing']['view']['document']['getRoot'](_0x3e17c8);if(_0x2a9dec){const _0x2ccea8=_0x5caea6['getAttribute']('revisionHistoryAttachChange');if(_0x546db7['removeAttribute']('data-change-id',_0x2a9dec),_0x546db7['removeClass']('ck-revision-history-root-add',_0x2a9dec),_0x546db7['removeClass']('ck-revision-history-root-remove',_0x2a9dec),_0x546db7['removeClass']('ck-revision-history-root--active',_0x2a9dec),_0x2ccea8){const _0x5d6061=this['_getChangeFromId'](_0x2ccea8);if(!_0x5d6061)return null;_0x546db7['setAttribute']('data-change-id',_0x2ccea8,_0x2a9dec),_0x546db7['addClass']('ck-revision-history-root-'+_0x5d6061['type'],_0x2a9dec),this['activeChange']==_0x5d6061&&_0x546db7['addClass']('ck-revision-history-root--active',_0x2a9dec);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x3dbb6a=>'revision-comment:'+_0x3dbb6a,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x69c43f=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x69c43f['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x543f34=>'revision-suggestion:'+_0x543f34,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x5d051f=>({'name':'suggestion:'+_0x5d051f,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x9377bf=>{const _0x3ed651=_0x9377bf['markerName']['split'](':')[0x1];return'insertion'!=_0x3ed651&&'deletion'!=_0x3ed651?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x3ed651]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Lt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Lt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x3a3aaa,_0x261c89,_0x46418f)=>{const _0x29c7b5=_0x46418f['mapper']['markerNameToElements'](_0x261c89['markerName']);if(_0x29c7b5){for(const _0x2f7d45 of _0x29c7b5)_0x2f7d45['is']('uiElement')&&(_0x46418f['mapper']['unbindElementFromMarkerName'](_0x2f7d45,_0x261c89['markerName']),_0x46418f['writer']['remove'](_0x2f7d45));}},{'priority':'high'});}_getChangeFromId(_0x15b612){return this['_changeIdToChange']['get'](_0x15b612);}_getViewForChange(_0x3930ba){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x3930ba,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x49fee7,_0xbc9a05,_0x193251,_0x1e0a75)=>{_0x1e0a75&&this['_balloon']['remove'](_0x1e0a75),_0x193251&&(this['_balloon']['add']({'view':_0x193251,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x5e536f=this['editor']['editing'],_0x1b5347=this['_getChangeFromId'](_0x193251['changeId']);let _0x31205a;if(_0x1b5347['data']['isOnRoot']){const _0x1a481b=_0x5e536f['view']['getDomRoot'](_0x1b5347['rootName']);_0x31205a=Array['from'](_0x1a481b['getClientRects']());}else{const _0x27660d=this['editor']['model']['markers']['get']('revision:'+_0x193251['changeId']);_0x31205a=Array['from'](_0x5e536f['mapper']['markerNameToElements'](_0x27660d['name']))['map'](_0x4315c7=>_0x5e536f['view']['domConverter']['mapViewToDom'](_0x4315c7))['map'](_0x1f83a5=>Array['from'](_0x1f83a5['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x31205a['find'](_0x3019e3=>_0x3019e3['top']-0x3<=this['_activeViewTarget']['y']&&_0x3019e3['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x3019e3['left']-0x3<=this['_activeViewTarget']['x']&&_0x3019e3['right']+0x3>=this['_activeViewTarget']['x'])||_0x31205a[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x44746f,_0x1c8b32,_0x34436b,_0x2ef5de)=>{this['activeView']=_0x34436b?this['_getViewForChange'](_0x34436b):null,this['editor']['model']['change'](()=>{const _0x5379a9=this['editor']['editing'];_0x2ef5de&&(_0x2ef5de['data']['isOnRoot']?_0x5379a9['view']['change'](_0x3ff623=>{_0x3ff623['removeClass']('ck-revision-history-root--active',_0x5379a9['view']['document']['getRoot'](_0x2ef5de['rootName']));}):_0x5379a9['reconvertMarker']('revision:'+_0x2ef5de['id'])),_0x34436b&&(_0x34436b['data']['isOnRoot']?_0x5379a9['view']['change'](_0xe3c692=>{_0xe3c692['addClass']('ck-revision-history-root--active',_0x5379a9['view']['document']['getRoot'](_0x34436b['rootName']));}):_0x5379a9['reconvertMarker']('revision:'+_0x34436b['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0xed9a9a,_0x2c2deb)=>{if(this['activeChange'])return;const _0x422106=this['_findChangeIdFromDomTarget'](_0x2c2deb['target']),_0x2f757f=this['_changeIdToChange']['get'](_0x422106);_0x2f757f?(this['_activeViewTarget']={'x':_0x2c2deb['domEvent']['x'],'y':_0x2c2deb['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x2f757f)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x1dd6f5,_0x19965c)=>{const _0x173f74=this['_findChangeIdFromDomTarget'](_0x19965c['target']),_0x53b541=this['_changeIdToChange']['get'](_0x173f74);_0x53b541?(this['_activeViewTarget']={'x':_0x19965c['domEvent']['x'],'y':_0x19965c['domEvent']['y']},_0x53b541===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x53b541):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x338e5a){do{const _0x6e1b2a=_0x338e5a['getAttribute']('data-change-id');if(_0x6e1b2a)return _0x6e1b2a;_0x338e5a=_0x338e5a['parent'];}while(_0x338e5a);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x4a2639=>{for(const _0x42e858 of this['editor']['model']['markers'])_0x4a2639['removeMarker'](_0x42e858);});}};function Ut(_0x5c564a){return _0x5c564a['split'](':')[0x1];}function Lt(_0x222422,_0x9301b4){return(_0x2c29b9,_0x3872e9,_0x3278a2)=>{if(!_0x3278a2['consumable']['test'](_0x3872e9['markerRange'],_0x2c29b9['name']))return;const _0x5307a1=_0x3872e9['markerRange']['getWalker'](),_0x2735a2=_0x3872e9['markerRange']['start'],_0x2ed2b0=_0x222422['model']['schema'];let _0x3c3a8=null,_0x54aac1=null,_0x261e71=!0x1,_0xd0080b=!0x1;for(const _0x5b1594 of _0x5307a1){const _0x47f424=_0x5b1594['item'];_0x261e71=_0x261e71||_0x2ed2b0['isContent'](_0x47f424);const _0x4bfa5=_0x3278a2['mapper']['toViewElement'](_0x47f424);if(_0x4bfa5&&_0x4bfa5['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x5b1594['type']&&(_0x2ed2b0['isBlock'](_0x47f424)&&!_0x2ed2b0['isLimit'](_0x47f424)&&(_0x47f424['nextSibling']||_0x2735a2['isAtEnd']?_0x3c3a8&&_0x3c3a8['parent']==_0x47f424||(_0x3c3a8=_0x47f424,_0x32eca4(_0x5b1594['previousPosition']),_0xd0080b=!0x0):_0x54aac1=_0x54aac1||_0x5b1594['previousPosition']));}function _0x32eca4(_0x2f7aab){const _0xeeabbf=_0x3278a2['mapper']['toViewPosition'](_0x2f7aab),_0x5101bb=_0x3278a2['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x9301b4});_0x3278a2['writer']['insert'](_0xeeabbf,_0x5101bb),_0x3278a2['mapper']['bindElementToMarker'](_0x5101bb,_0x3872e9['markerName']);}_0x261e71||_0xd0080b||!_0x54aac1||_0x32eca4(_0x54aac1);};}var Ft=class extends _0x83b002{constructor(_0xe54933){super(_0xe54933);const _0x1d7fc5=_0xe54933['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x1d7fc5,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x1d7fc5,'change:isEnabled',()=>this['refresh']());}execute(){const _0x1af481=this['editor'],_0x448253=_0x1af481['plugins']['get'](Pt),_0x9c3834=_0x448253['isReady']?_0x448253['diff']['newRevisionId']:null;_0x1af481['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x9c3834);}['refresh'](){const {isReady:_0x17d24e,isEnabled:_0x3c6a62,repository:_0x23fb15,diff:_0x3a12f4}=this['editor']['plugins']['get'](Pt),_0xb530ed=_0x3a12f4&&_0x23fb15['getLaterVisibleRevision'](_0x3a12f4['newRevisionId']);this['isEnabled']=_0x17d24e&&_0x3c6a62&&Boolean(_0xb530ed);}},$t=class extends _0x83b002{_step;constructor(_0x1c6d12,{direction:_0x2d7cc3}){super(_0x1c6d12);const _0x53336e=_0x1c6d12['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x2d7cc3?0x1:-0x1,this['listenTo'](_0x53336e,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x53336e,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x53336e,'change:activeChange',()=>this['refresh']());}execute(){const _0x49eaef=this['editor'],_0x3e124c=_0x49eaef['plugins']['get'](Pt),{isNavigationMode:_0x56f6c6,currentChangeNumber:_0x280b90}=_0x3e124c;let _0x8f5f38;if(_0x3e124c['activeChange']=_0x56f6c6?_0x3e124c['diff']['changes']['get'](_0x280b90+this['_step']):_0x3e124c['diff']['changes']['first'],_0x3e124c['activeChange']['data']['isOnRoot'])_0x8f5f38=_0x49eaef['editing']['view']['getDomRoot'](_0x3e124c['activeChange']['rootName']);else{const _0x430ecd=_0x49eaef['model']['markers']['get']('revision:'+_0x3e124c['activeChange']['id']);_0x8f5f38=_0x1f8b1e(_0x49eaef['editing'],_0x430ecd);}_0xe8b9b6({'target':_0x8f5f38,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x445a2e,currentChangeNumber:_0x3cd44e,numberOfChanges:_0x2d7ea9,isReady:_0x330025,isEnabled:_0x18c54d}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0x18c54d&&_0x330025&&_0x2d7ea9)&&(!_0x445a2e||(0x1===this['_step']?_0x3cd44e<_0x2d7ea9-0x1:_0x3cd44e>0x0));}},Bt=class extends dt{constructor(_0x25aa95){super(_0x25aa95);const _0x41ddee=this['bindTemplate'],_0x22af27=new _0x3e9ea0(_0x25aa95),_0x1be4fd=new _0x3e9ea0(_0x25aa95);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',(_0x15a6b3,_0x28d9b1)=>_0x15a6b3&&_0x28d9b1>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x5e5d33,_0xc869a8,_0x5275be,_0x41d63f)=>{if(!_0x5e5d33)return kt(_0x25aa95,'Loading...');if(!_0x5275be)return kt(_0x25aa95,'No\x20changes');const _0x21752b=kt(_0x25aa95,'NUMBER_OF_CHANGES',_0x5275be);return _0x41d63f?kt(_0x25aa95,'X_OF_Y_CHANGES',[_0xc869a8+0x1,_0x5275be]):_0x21752b;}),_0x22af27['set']({'label':kt(_0x25aa95,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x4ec9c5}),_0x1be4fd['set']({'label':kt(_0x25aa95,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x18ab4e}),_0x22af27['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x1be4fd['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x22af27['on']('execute',()=>this['fire']('execute','backward')),_0x1be4fd['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',_0x41ddee['if']('_isStatusLabelVisible','ck-hidden',_0x40ed12=>!_0x40ed12)]},'children':[{'text':_0x41ddee['to']('isNavigationMode',_0xf6e2ed=>_0xf6e2ed?kt(_0x25aa95,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x25aa95,'Total')+':\x20')}]},{'text':_0x41ddee['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x22af27,_0x1be4fd]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0x15eb24{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x44a824=this['editor']['editing']['view'];_0x44a824['change'](_0x274a9e=>{for(const _0x40cdb2 of _0x44a824['document']['roots'])_0x274a9e['addClass'](jt,_0x40cdb2);});}['hide'](){const _0x577102=this['editor']['editing']['view'];_0x577102['change'](_0x19d02e=>{for(const _0x36ef73 of _0x577102['document']['roots'])_0x19d02e['removeClass'](jt,_0x36ef73);});}},Kt=class extends _0x15eb24{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0xbf0a88=this['editor'],_0x2d8589=_0xbf0a88['plugins']['get'](Pt),_0x1da7d9=_0xbf0a88['plugins']['get'](Gt);_0xbf0a88['ui']['componentFactory']['add']('exitToEditing',_0x56f53a=>{const _0x52029c=new _0x3e9ea0(_0x56f53a);return _0x52029c['set']({'label':kt(_0x56f53a,'Back\x20to\x20editing'),'icon':_0xe2d6ce,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x52029c,'execute',()=>{_0xbf0a88['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x52029c;}),_0xbf0a88['ui']['componentFactory']['add']('restoreRevision',_0x56a232=>{const _0x1d63f0=new _0x3e9ea0(_0x56a232);return _0x1d63f0['set']({'label':kt(_0x56a232,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x1d63f0['bind']('isEnabled')['to'](_0xbf0a88['commands']['get']('restoreRevision')),this['listenTo'](_0x1d63f0,'execute',()=>_0xbf0a88['execute']('restoreRevision')),_0x1d63f0;}),_0xbf0a88['ui']['componentFactory']['add']('changesNavigation',_0x580abc=>{const _0x55d19c=new Bt(_0x580abc),_0x257276=_0xbf0a88['commands']['get']('showPreviousChange'),_0x12d09f=_0xbf0a88['commands']['get']('showNextChange');return _0x55d19c['bind']('isBackwardNavigationEnabled')['to'](_0x257276,'isEnabled'),_0x55d19c['bind']('isForwardNavigationEnabled')['to'](_0x12d09f,'isEnabled'),_0x55d19c['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x2d8589),this['listenTo'](_0x55d19c,'execute',(_0x5417a4,_0xcf0428)=>{_0xbf0a88['execute']('forward'===_0xcf0428?'showNextChange':'showPreviousChange');}),_0x55d19c;}),_0x1da7d9['show'](),_0x2d8589['on']('change:isReady',(_0xd813b6,_0x15f564,_0xc793de)=>{_0xc793de?_0x1da7d9['hide']():_0x1da7d9['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x49a785,_0x13e90d){super(_0x49a785,_0x13e90d);const _0x390df9=this['bindTemplate'];this['set']({'label':kt(_0x49a785,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x49a785,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x390df9['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x108a54(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x4a276c=this['fieldView']['element'];this['_tooltipString']=_0x4a276c['scrollWidth']>_0x4a276c['clientWidth']&&_0x4a276c['value']||'';}},Yt=class extends dt{constructor(_0x24562a,_0x52fbc5,_0x55cd18){super(_0x24562a);const _0x447a2c=new _0x57a8a0();_0x447a2c['set']({'content':_0x25562b,'viewBox':'0\x200\x2011\x2010'});const _0x26af5b=['ck','ck-revision-history-sidebar__revision-author'];_0x55cd18&&_0x26af5b['push']('ck-revision-history-sidebar__revision-author_creator');const _0x1a13f9=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0x24562a,_0x55cd18?'Revision\x20creator':'Revision\x20author')},'children':[_0x447a2c,_0x52fbc5['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x26af5b},'children':_0x1a13f9});}};function Jt(_0x2d1584,_0x1f9d12){const _0x5c1734=_0x2d1584['bindTemplate'],_0x37541d=_0x2d1584['locale'],_0x1eac41=vt(_0x37541d);_0x1eac41['panelPosition']='sw';const _0x2cdca6=function(_0x3b3c55,_0x5d1ee3){const _0x4b5b8c=function(_0x5cb40e,_0x363d2b){const _0x405b01=_0x5cb40e['locale'],_0x1fe11d={'Compare\x20against\x20selected':kt(_0x405b01,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x405b01,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x405b01,'Restore\x20this\x20revision')};return _0x363d2b['map'](_0x2859f5=>{const _0x435cc0=_0x1fe11d[_0x2859f5['name']];return _0x435cc0&&_0x435cc0!==_0x2859f5['name']&&(_0x2859f5['name']=_0x435cc0),_0x2859f5;});}(_0x3b3c55,_0x5d1ee3),_0x4d0876=new _0x393ab3();for(const _0x5d7ff2 of _0x4b5b8c){const _0x5438d6={'type':'button','model':new ut({'label':_0x5d7ff2['name'],'class':_0x5d7ff2['class'],'withText':!0x0,'role':'menuitem','_action':_0x5d7ff2['action']})};_0x5438d6['model']['bind']('isEnabled')['to'](_0x3b3c55,'isActionsDropdownOpen',_0x16a7e4=>'function'!=typeof _0x5d7ff2['isEnabled']||(!_0x16a7e4||_0x5d7ff2['isEnabled'](_0x3b3c55))),_0x4d0876['add'](_0x5438d6);}return _0x4d0876;}(_0x2d1584,_0x1f9d12);return _0x2d1584['bind']('isActionsDropdownOpen')['to'](_0x1eac41,'isOpen'),_0x1eac41['buttonView']['set']({'label':kt(_0x37541d,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x52e55d}),_0x1eac41['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x5c1734['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x5c1734['to'](_0x24abf5=>_0x24abf5['stopPropagation']())}}),_0x1eac41['on']('execute',_0x1e76c6=>{_0x2d1584['isReady']&&'function'==typeof _0x1e76c6['source']['_action']&&_0x1e76c6['source']['_action'](_0x2d1584);}),ft(_0x1eac41,_0x2cdca6,{'role':'menu'}),_0x1eac41['listenTo'](_0x2d1584,'change:isActionsDropdownOpen',(_0x31a85d,_0x370988,_0x285d54)=>{if(_0x285d54)for(const _0x4cc39a of _0x1eac41['listView']['items']){const _0x1e853b=_0x4cc39a['children']['first'],_0x45b563=_0x1f9d12['find'](_0x45b356=>_0x45b356['action']===_0x1e853b['_action'])['isVisible'];_0x4cc39a['isVisible']=void 0x0===_0x45b563||_0x45b563(_0x2d1584);}}),_0x1eac41;}const Wt=/* #__PURE__ -- @preserve */
27
+ _0x2c1eae(dt);var Xt=class extends Wt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0xb817bc,_0x1d4c3c,_0x5d0382,_0x398d69,_0x557de1=!0x1){super(_0xb817bc);const _0x34c558=this['bindTemplate'],_0x1d8c2f=function(_0x3908bf,_0x238078){const _0x2ca6b5=Array['from'](_0x238078['authors'])['filter'](_0x236c90=>_0x236c90!=_0x238078['creator']);return _0x238078['creator']&&_0x2ca6b5['unshift'](_0x238078['creator']),_0x2ca6b5['map'](_0x37ebe8=>new Yt(_0x3908bf,_0x37ebe8,_0x37ebe8==_0x238078['creator']));}(_0xb817bc,_0x1d4c3c);this['id']=_0x1d4c3c['id'],this['_revision']=_0x1d4c3c,this['_requireRevisionName']=_0x398d69,this['bind']('_isAiGenerated')['to'](_0x1d4c3c,'attributes',_0x2e6679=>!(!_0x2e6679||!_0x2e6679['@ai'])),this['bind']('name','createdAt')['to'](_0x1d4c3c),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x26b915=>{return _0x515d0a=_0xb817bc['uiLanguage'],(_0x5a2490=_0x26b915)['toLocaleDateString'](_0x515d0a,{'month':'long','day':'numeric'})+',\x20'+_0x5a2490['toLocaleTimeString'](_0x515d0a,{'hour':'numeric','minute':'numeric'});var _0x515d0a,_0x5a2490;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new qt(_0xb817bc,gt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x13c1c2=>_0x13c1c2||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x218d9e,_0x468411)=>_0x218d9e&&_0x468411),this['revisionActionsView']=_0x5d0382&&_0x5d0382['length']?Jt(this,_0x5d0382):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x557de1?this['_createAiPillView'](_0xb817bc):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x34c558['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x34c558['if']('isEnabled','ck-disabled',_0x1b36c9=>!_0x1b36c9),_0x34c558['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x34c558['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x34c558['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':_0x34c558['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':_0x1d8c2f}]},..._0x557de1?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x34c558['if']('_isAiGenerated','ck-hidden',_0x225fd5=>!_0x225fd5)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x34c558['to'](_0x51e899=>{_0x51e899['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x35edb4){const _0x255566=new _0x1892fd(_0x35edb4);return _0x255566['set']({'icon':_0x525b57,'label':kt(_0x35edb4,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':kt(_0x35edb4,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','size':'small','class':'ck-pill_ai'}),_0x255566['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x255566;}['render'](){super['render']();const _0xd01a32=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0xd01a32,'change',()=>{this['_requireRevisionName']&&!_0xd01a32['value']||this['fire']('setName',{'id':this['id'],'name':_0xd01a32['value']}),_0xd01a32['value']||(_0xd01a32['value']=this['name']?this['name']:this['_createdAtFormatted']);});}select(){this['isSelected']=!0x0;}deselect(){this['isSelected']=!0x1;}highlight(){this['isHighlighted']=!0x0;}unhighlight(){this['isHighlighted']=!0x1;}};function Qt(_0x35bdaf,_0x2fef60){const _0x23a884=wt['fromJSDate'](_0x35bdaf)['setLocale'](_0x2fef60),_0x4c66f2=wt['local'](),_0x15f4f7=_0x4c66f2['minus']({'days':0x1})['startOf']('day');let _0x4c24cc,_0x2bac10;return _0x23a884['hasSame'](_0x4c66f2,'day')?(_0x4c24cc=_0x23a884['startOf']('day')['toJSDate'](),_0x2bac10=_0x23a884['toRelativeCalendar']()):_0x23a884['hasSame'](_0x15f4f7,'day')?(_0x4c24cc=_0x15f4f7['toJSDate'](),_0x2bac10=_0x23a884['toRelativeCalendar']()):_0x23a884['hasSame'](_0x4c66f2,'week')?(_0x4c24cc=_0x23a884['startOf']('week')['toJSDate'](),_0x2bac10=_0x23a884['weekdayLong']||''):_0x23a884['hasSame'](_0x4c66f2,'year')?(_0x4c24cc=_0x23a884['startOf']('month')['toJSDate'](),_0x2bac10=_0x23a884['monthLong']||''):(_0x4c24cc=_0x23a884['startOf']('year')['toJSDate'](),_0x2bac10=String(_0x23a884['year'])),{'startDate':_0x4c24cc,'localizedPeriodName':_0x2bac10};}var zt=class extends dt{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x1c34cb,_0x29c210,_0x474111,_0x353461,_0x126141){super(_0x1c34cb);const _0xe8caff=Qt(_0x29c210,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x29c210,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x474111,this['_requireRevisionName']=_0x353461,this['_showAISource']=_0x126141,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':_0xe8caff}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x464937){const _0xcafa46=new Xt(this['locale'],_0x464937,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0xcafa46);}['removeRevision'](_0x3f93d0){const _0x55a822=this['revisionViews']['find'](_0x1f2eae=>_0x1f2eae['id']===_0x3f93d0['id']);this['revisionViews']['remove'](_0x55a822);}},Zt=class extends dt{constructor(_0x3995ca){super(_0x3995ca);const _0x271693=new _0x57a8a0();_0x271693['content']=_0x74b43d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x271693,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[kt(_0x3995ca,'Revision\x20history')]}]});}},ti=class extends dt{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x2e4748,_0xe9212d,_0x452db3,_0xd4bcb4,_0x2ce1da){super(_0x2e4748);const _0x4af38d=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0xe9212d,this['_revisionActions']=_0x452db3,this['_requireRevisionName']=_0xd4bcb4,this['_showAISource']=_0x2ce1da,this['on']('select',(_0x489b2e,_0x56b245)=>{this['fire']('revisionSelected',_0x56b245);}),this['on']('setName',(_0x291196,_0x1b0ea2)=>{this['fire']('revisionSetName',_0x1b0ea2);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Zt(_0x2e4748),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x4af38d['if']('isEnabled','ck-disabled',_0x1b555a=>!_0x1b555a)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0x387070 of this['_revisions'])this['_addRevision'](_0x387070);this['_revisions']['on']('add',(_0x112558,_0x5added)=>{this['_addRevision'](_0x5added);}),this['_revisions']['on']('remove',(_0x4383ac,_0x26ac5d)=>{this['_removeRevision'](_0x26ac5d);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x29d1a2=>_0x29d1a2['revisionViews']['map'](_0x451184=>_0x451184))['flat']();}selectRevision(_0x4d74e2){for(const _0x3f4ec1 of this['revisionViews'])_0x4d74e2&&_0x4d74e2['id']===_0x3f4ec1['id']?_0x3f4ec1['select']():_0x3f4ec1['deselect']();}highlightRevisions(_0x2fed16){for(const _0x5d6f92 of this['revisionViews'])_0x2fed16['some'](({id:_0x13cd5d})=>_0x13cd5d===_0x5d6f92['id'])?_0x5d6f92['highlight']():_0x5d6f92['unhighlight']();}['_addRevision'](_0x2baaba){const _0xc0246a=Qt(_0x2baaba['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x2ecade=this['_getTimePeriodViewByStartDate'](_0xc0246a);_0x2ecade||(_0x2ecade=new zt(this['locale'],_0xc0246a,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x2ecade)),_0x2ecade['addRevision'](_0x2baaba);}['_removeRevision'](_0xad3cc1){const _0xea26b4=Qt(_0xad3cc1['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0xea26b4)['removeRevision'](_0xad3cc1);}_getTimePeriodViewByStartDate(_0xbb869a){return this['timePeriodViews']['find'](_0x1d71a8=>_0x1d71a8['startDate']['getTime']()===_0xbb869a['getTime']());}},ii=class RevisionsSidebar extends _0x15eb24{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
28
28
  ((()=>['compareAgainstSelected','restoreRevision','nameRevision'])());static availableRevisionActions=/* #__PURE__ -- @preserve */
29
- ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(_0x4446e3){super(_0x4446e3),this['_revisionViewer']=_0x4446e3['plugins']['get'](Pt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x2d751c=this['_revisionsRepository']['_revisions'],_0x15a11c=this['_createRevisionActions'](),_0x2e3e80=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new ti(this['editor']['locale'],_0x2d751c,_0x15a11c,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',(_0x2cb3f8,_0x361e8f)=>{_0x361e8f['revisionViews']['on']('add',(_0x466bf7,_0x438f43)=>{_0x438f43['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)),_0x2e3e80['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x4ad828=this['_revisionsRepository']['getRevision'](0x0);if(_0x4ad828){const _0x101db3=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x4ad828['id']);this['_revisionViewer']['compare'](_0x4ad828,_0x101db3);}}_handleRevisionSelected(_0x5864bb,_0x2e3726){const _0x3b006e=this['_revisionsRepository']['getRevision'](_0x2e3726['id']),_0x1ec7a9=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x3b006e['id']);this['_revisionViewer']['compare'](_0x3b006e,_0x1ec7a9);}_handleRevisionSetName(_0x1e8a4e,_0x51c772){this['_revisionsRepository']['getRevision'](_0x51c772['id'])['setName'](_0x51c772['name']);}['_handleDiffChange'](_0x1b7fd8,_0x807777,_0x4f617c){const _0x5e8523=this['_revisionsRepository']['getRevisionsInDiff'](_0x4f617c);_0x5e8523['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x5e8523),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x5e8523[0x0]));}_createRevisionActions(){const _0x44f2b3=this['editor'],_0x398dbf=RevisionsSidebar['availableRevisionActions'],_0x2dc319=_0x44f2b3['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x2dc319['length'])return _0x2dc319['map'](_0x22e212=>{const _0x48c557='string'==typeof _0x22e212?Object['assign']({},_0x398dbf[_0x22e212]):_0x22e212;return _0x48c557['action']=_0x48c557['action']['bind'](this,_0x44f2b3),_0x48c557['isVisible']&&(_0x48c557['isVisible']=_0x48c557['isVisible']['bind'](this,_0x44f2b3)),_0x48c557;});}};function ei(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x285b8b},_0x4e6151)=>{const _0x1a32bd=_0x285b8b['get'](Pt),_0x4f3556=_0x1a32bd['repository'];let _0x1a01c3=_0x1a32bd['diff']['newRevisionId'],_0x3a75d7=_0x4e6151['id'];_0x4f3556['getIndex'](_0x1a01c3)>_0x4f3556['getIndex'](_0x3a75d7)&&([_0x1a01c3,_0x3a75d7]=[_0x3a75d7,_0x1a01c3]),_0x1a32bd['compare'](_0x1a01c3,_0x3a75d7);},'isVisible':({plugins:_0x3650bf},_0x28bb0a)=>{const _0x1c5a43=_0x3650bf['get'](Pt);return!(_0x1c5a43['repository']['getRevisionsInDiff'](_0x1c5a43['diff'])['length']>0x2)&&!_0x28bb0a['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x29491a,{id:_0x24692a})=>{_0x29491a['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x24692a);},'isVisible':({plugins:_0xda6c0b},_0x4efec8)=>!!_0xda6c0b['get'](Pt)['repository']['getLaterVisibleRevision'](_0x4efec8['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x12e994},{id:_0x11fc75,revisionNameView:_0x80806e})=>{const _0x170298=_0x12e994['get'](Pt),_0x2601f1=_0x170298['repository']['getEarlierVisibleRevision'](_0x11fc75);_0x170298['compare'](_0x11fc75,_0x2601f1),_0x80806e['focus'](),_0x80806e['fieldView']['select']();}}};}var si=class extends _0x337f72{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x26e7e4,_0x3e5c39){super(_0x26e7e4),this['_view']=_0x3e5c39,this['_toolbarConfig']=mt(_0x26e7e4['config']['get']('toolbar')),this['_elementReplacer']=new _0x382013();}get element(){return this['view']['element'];}init(_0x164a73){const _0x595e72=this['editor'],_0x4a9621=this['view'],_0x365070=_0x595e72['editing']['view'],_0x4f402f=_0x4a9621['editable'];_0x4f402f['name']=_0x365070['document']['getRoot']()['rootName'],_0x4f402f['isMainFrameEditingRoot']=!0x0,_0x4a9621['render']();const _0x12a405=_0x4f402f['element'];this['setEditableElement'](_0x4f402f['name'],_0x12a405),_0x4a9621['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x365070['attachDomRoot'](_0x12a405),this['_elementReplacer']['replace'](_0x164a73,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x5289c1=this['view'],_0x6a4acb=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x6a4acb['detachDomRoot'](_0x5289c1['editable']['name']),_0x5289c1['destroy']();}_initToolbar(){const _0x336036=this['view'];_0x336036['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x336036['stickyPanel']['limiterElement']=_0x336036['element'],_0x336036['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x3e442c})=>_0x3e442c),_0x336036['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x336036['toolbar']);}},ni=class extends _0xc58078{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x343b00,_0x1ce57d,_0x43b7bc={}){super(_0x343b00),this['stickyPanel']=new ht(_0x343b00),this['toolbar']=new lt(_0x343b00,{'shouldGroupWhenFull':_0x43b7bc['shouldToolbarGroupWhenFull']}),this['_editable']=new tt(_0x343b00,_0x1ce57d);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const oi=/* #__PURE__ -- @preserve */
30
- _0x26e01a(_0x106ed9);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x37bb9e,_0x44b692){super(_0x44b692),this['sourceElement']=_0x37bb9e,this['model']['document']['createRoot']();const _0xef1723=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0xef1723);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x545375,_0x2675cc){const _0xe6382f=new this(_0x545375,_0x2675cc);return await _0xe6382f['initPlugins'](),await _0xe6382f['ui']['init'](_0x545375),await _0xe6382f['data']['init'](_0xe6382f['config']['get']('initialData')||''),_0xe6382f['fire']('ready'),_0xe6382f;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0xc8641b{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2eb63e){super(_0x2eb63e),this['result']='end',_0x2eb63e['editing']['view']['_overlayModeHint']='auto',_0x2eb63e['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0xc8641b{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0x4a86b7){if(super(_0x4a86b7),!this['editor']['config']['get']('revisionHistory'))throw new _0x3aa143('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x2b9428=>this['_showRevisionViewer']({..._0x2b9428,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x1e2408=>this['_closeRevisionViewer'](_0x1e2408)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x1f278a=>this['_restoreRevision'](_0x1f278a)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x460635){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x460635;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0xf0148f){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0xf0148f);}getRevision(_0x49b381){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x49b381);}getRevisions(_0x412337){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x412337||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x4e884a=this['editor'],_0x59212d=_0x4dfb55(_0x4e884a,ai),_0x16d46d=_0x4e884a['plugins']['get']('RevisionTracker'),_0x38114f=_0x4e884a['plugins']['get'](_0x1ee77a)['users'];return _0x59212d['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x59212d['lazyRoots'],(_0x59212d['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0xc8641b{static get requires(){return[Pt,_0x1ee77a];}init(){const _0x44ac1f=this['editor']['plugins']['get'](_0x1ee77a);for(const _0x49f841 of _0x38114f)_0x49f841['isAnonymous']||_0x44ac1f['getUser'](_0x49f841['id'])||_0x44ac1f['addUser'](_0x49f841);const _0x66ec89=_0x16d46d['repository']['getRevisions']();let _0x475722=null;const _0x7b2a0b=this['editor']['plugins']['get']('RevisionViewer');if(_0x7b2a0b['adapter']=_0x16d46d['adapter'],_0x7b2a0b['bind']('isEnabled')['to'](_0x16d46d),_0x4e884a['plugins']['has']('CommentsRepository')){const _0x36b747=_0x4e884a['plugins']['get']('CommentsRepository');_0x7b2a0b['_getVisibleCommentThreadIds']=()=>new Set(_0x36b747['getCommentThreads']()['filter'](_0x2b7ee4=>!_0x2b7ee4['isResolved'])['map'](_0x4e29e3=>_0x4e29e3['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x4e884a,'isReadOnly',_0xed86bf=>!_0xed86bf);for(const _0x573e89 of _0x66ec89){const _0x3ef316=null===_0x573e89['creator'];if(_0x3ef316&&_0x573e89['toVersion']===_0x573e89['fromVersion'])continue;const _0x201272=_0x573e89['toJSON']();_0x7b2a0b['addRevisionData'](_0x201272,(_0xcfbc3a,_0xedc2e6,_0x3cef21)=>{if(_0x3ef316){if(_0x475722)_0x475722['_update'](_0xcfbc3a,_0xedc2e6);else{if(!_0xedc2e6){const _0x3fa000=_0x3cef21['toJSON']();_0x3fa000['id']=_0x30d584(),_0x16d46d['saveRevision'](_0x3fa000,_0x3cef21['toVersion'])['then'](_0x4a1445=>{_0x475722=_0x4a1445;});}}}else _0x573e89['_update'](_0xcfbc3a,_0xedc2e6);});}}},ii),_0x59212d);}['_enhanceShowRevisionViewerCallback'](){const _0x4d1987=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x3f4687=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x3f4687['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x2ff694=this['editor']['plugins']['get']('Dialog');_0x2ff694['isOpen']&&_0x2ff694['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x26aaef=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x2bc1dd of _0x26aaef)_0x2bc1dd['class']=_0x2bc1dd['class']?_0x2bc1dd['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x2ffc1d=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x2ffc1d&&_0x2ffc1d['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0xf4dc42=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0xf4dc42&&_0xf4dc42['setAttribute']('tabindex','-1');}}const _0x1212d0=this['_getRevisionViewerEditorConfig']();return _0x4d1987(_0x1212d0)['then'](_0x387885=>(this['_viewerEditor']=_0x387885,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'),_0x387885))['catch'](_0x3fa54a=>(console['error'](_0x3fa54a),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x4bd2fd=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 _0x39c4fe=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0xa8f1d8 of _0x39c4fe)_0xa8f1d8['class']='ck-tab-panel_disabled'===_0xa8f1d8['class']?'':_0xa8f1d8['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x5c14cf=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x5c14cf&&_0x5c14cf['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x3a5028=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x3a5028&&_0x3a5028['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x4bd2fd(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x2f9f0f=this['editor']['plugins']['get']('Annotations');_0x2f9f0f['refreshVisibility'](),_0x2f9f0f['refreshPositioning']();}});});}['_showRevisionViewer'](_0x4b0802){const _0x77c3ba=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x39e386=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x4adb62=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x4adb62,_0x4b0802)['then'](_0x1f0b2d=>(_0x39e386['style']['display']='block',_0x77c3ba['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x1f0b2d));}['_closeRevisionViewer'](_0x37d0d4){const _0x118834=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x118834['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x37d0d4['destroy']();}async _restoreRevision(_0x5e4fdf){const _0x2c0a7f=this['editor'],_0x5bc304=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x436346=_0x2c0a7f['plugins']['get']('RevisionTracker'),_0x4f8508=_0x2c0a7f['plugins']['get']('RevisionHistoryUtils'),_0x5c13af=_0x5bc304['repository']['getRevision'](_0x5e4fdf);let _0x56d5b8,_0x4b888a,_0x2ef739;try{await _0x4f8508['loadRevisionData'](_0x5c13af,this['adapter']),_0x56d5b8=_0x4f8508['getRevisionDocumentData'](_0x5c13af),_0x4b888a=_0x4f8508['getRevisionRootsAttributes'](_0x5c13af);}catch(_0x15233a){return void console['error'](_0x15233a);}_0x2c0a7f['model']['change'](_0x331001=>{for(const _0x2ab7d9 of Array['from'](_0x2c0a7f['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x331001['removeMarker'](_0x2ab7d9);}),_0x5bc304['isReady']=!0x1,_0x2c0a7f['model']['enqueueChange'](_0x2060dc=>{_0x2060dc['setSelection'](null),_0x2060dc['removeSelectionAttribute'](_0x2c0a7f['model']['document']['selection']['getAttributeKeys']());const _0x3661da=Object['keys'](_0x56d5b8);for(const _0x3e4170 of _0x2c0a7f['model']['document']['roots'])'$graveyard'!=_0x3e4170['rootName']&&_0x3e4170['isAttached']()&&!_0x3661da['includes'](_0x3e4170['rootName'])&&_0x2060dc['detachRoot'](_0x3e4170);for(const _0x242ea9 of _0x3661da){let _0x5498d6=_0x2c0a7f['model']['document']['getRoot'](_0x242ea9);if(!_0x5498d6||!_0x5498d6['isAttached']()){const _0x543105=_0x5c13af['diffData']?.[_0x242ea9]?.['rootElementName']||'$root';_0x5498d6=_0x2060dc['addRoot'](_0x242ea9,_0x543105);}const _0x2241a9=_0x4b888a[_0x242ea9],_0x4b962d=Object['keys'](_0x2241a9),_0x27ad3e=_0x56d5b8[_0x242ea9];for(const _0x36c55f of _0x5498d6['getAttributeKeys']())_0x4b962d['includes'](_0x36c55f)||_0x2060dc['removeAttribute'](_0x36c55f,_0x5498d6);for(const _0x3dd661 of _0x4b962d)_0x2060dc['setAttribute'](_0x3dd661,_0x4b888a[_0x242ea9][_0x3dd661],_0x5498d6);_0x2060dc['remove'](_0x2060dc['createRangeIn'](_0x5498d6)),_0x2060dc['insert'](_0x2c0a7f['data']['parse'](_0x27ad3e,_0x5498d6),_0x5498d6,0x0);}});const _0xd4429e=kt(_0x2c0a7f['locale'],'Restored');if(_0x5c13af['name'])_0x2ef739=-0x1==_0x5c13af['name']['indexOf'](_0xd4429e)?_0xd4429e+':\x20'+_0x5c13af['name']:_0x5c13af['name'];else _0x2ef739=_0xd4429e+':\x20'+(_0x5c13af['createdAt']['toLocaleDateString'](_0x2c0a7f['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x5c13af['createdAt']['toLocaleTimeString'](_0x2c0a7f['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x436346['saveRevision']({'name':_0x2ef739}),_0x5bc304['isReady']=!0x0,_0x2c0a7f['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Ft as RestoreRevisionCommand,yt as Revision,ci as RevisionHistory,Dt as RevisionHistoryUI,Rt as RevisionHistoryUtils,At as RevisionTracker,Pt as RevisionViewer,ri as RevisionViewerEditor,hi as RevisionViewerIntegration,Gt as RevisionViewerLoadingOverlay,Kt as RevisionViewerUI,bt as RevisionsRepository,ii as RevisionsSidebar,$t as ShowChangeCommand};
29
+ ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(_0x1c30bd){super(_0x1c30bd),this['_revisionViewer']=_0x1c30bd['plugins']['get'](Pt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x3703f1=this['_revisionsRepository']['_revisions'],_0x5e26ab=this['_createRevisionActions'](),_0x3905d5=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new ti(this['editor']['locale'],_0x3703f1,_0x5e26ab,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',(_0x4ddc13,_0x55ff60)=>{_0x55ff60['revisionViews']['on']('add',(_0x4cdb29,_0x6f0e9a)=>{_0x6f0e9a['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)),_0x3905d5['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x299a1f=this['_revisionsRepository']['getRevision'](0x0);if(_0x299a1f){const _0x2c1e05=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x299a1f['id']);this['_revisionViewer']['compare'](_0x299a1f,_0x2c1e05);}}_handleRevisionSelected(_0x203a90,_0x396328){const _0x22dfa3=this['_revisionsRepository']['getRevision'](_0x396328['id']),_0x338e67=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x22dfa3['id']);this['_revisionViewer']['compare'](_0x22dfa3,_0x338e67);}_handleRevisionSetName(_0x35cd32,_0x1369dd){this['_revisionsRepository']['getRevision'](_0x1369dd['id'])['setName'](_0x1369dd['name']);}['_handleDiffChange'](_0x39b22c,_0x3cf1a5,_0x266332){const _0x2ec04b=this['_revisionsRepository']['getRevisionsInDiff'](_0x266332);_0x2ec04b['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x2ec04b),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x2ec04b[0x0]));}_createRevisionActions(){const _0x2f87d2=this['editor'],_0x1c372e=RevisionsSidebar['availableRevisionActions'],_0x4af86f=_0x2f87d2['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x4af86f['length'])return _0x4af86f['map'](_0x55b069=>{const _0x458461='string'==typeof _0x55b069?Object['assign']({},_0x1c372e[_0x55b069]):_0x55b069;return _0x458461['action']=_0x458461['action']['bind'](this,_0x2f87d2),_0x458461['isVisible']&&(_0x458461['isVisible']=_0x458461['isVisible']['bind'](this,_0x2f87d2)),_0x458461;});}};function ei(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x1732a1},_0x35f9a0)=>{const _0x2e34f9=_0x1732a1['get'](Pt),_0x3b60b2=_0x2e34f9['repository'];let _0x43c394=_0x2e34f9['diff']['newRevisionId'],_0x3fd668=_0x35f9a0['id'];_0x3b60b2['getIndex'](_0x43c394)>_0x3b60b2['getIndex'](_0x3fd668)&&([_0x43c394,_0x3fd668]=[_0x3fd668,_0x43c394]),_0x2e34f9['compare'](_0x43c394,_0x3fd668);},'isVisible':({plugins:_0x4cdc3a},_0x3e30fe)=>{const _0x3d79f2=_0x4cdc3a['get'](Pt);return!(_0x3d79f2['repository']['getRevisionsInDiff'](_0x3d79f2['diff'])['length']>0x2)&&!_0x3e30fe['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x1e22d2,{id:_0x2ab7b9})=>{_0x1e22d2['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x2ab7b9);},'isVisible':({plugins:_0x525ff9},_0x3cb8ad)=>!!_0x525ff9['get'](Pt)['repository']['getLaterVisibleRevision'](_0x3cb8ad['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x559690},{id:_0x8ab4fc,revisionNameView:_0xc012d6})=>{const _0x16b45e=_0x559690['get'](Pt),_0x80e016=_0x16b45e['repository']['getEarlierVisibleRevision'](_0x8ab4fc);_0x16b45e['compare'](_0x8ab4fc,_0x80e016),_0xc012d6['focus'](),_0xc012d6['fieldView']['select']();}}};}var si=class extends _0x145983{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x268ec8,_0x2faf99){super(_0x268ec8),this['_view']=_0x2faf99,this['_toolbarConfig']=mt(_0x268ec8['config']['get']('toolbar')),this['_elementReplacer']=new _0x493518();}get element(){return this['view']['element'];}init(_0x3b16c8){const _0x171e49=this['editor'],_0x4b641e=this['view'],_0x15d357=_0x171e49['editing']['view'],_0x476b3d=_0x4b641e['editable'];_0x476b3d['name']=_0x15d357['document']['getRoot']()['rootName'],_0x476b3d['isMainFrameEditingRoot']=!0x0,_0x4b641e['render']();const _0x193f77=_0x476b3d['element'];this['setEditableElement'](_0x476b3d['name'],_0x193f77),_0x4b641e['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x15d357['attachDomRoot'](_0x193f77),this['_elementReplacer']['replace'](_0x3b16c8,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0xc44410=this['view'],_0x198669=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x198669['detachDomRoot'](_0xc44410['editable']['name']),_0xc44410['destroy']();}_initToolbar(){const _0x2f195b=this['view'];_0x2f195b['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x2f195b['stickyPanel']['limiterElement']=_0x2f195b['element'],_0x2f195b['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x356e6a})=>_0x356e6a),_0x2f195b['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x2f195b['toolbar']);}},ni=class extends _0x26cd40{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0xe9c7b8,_0x536f71,_0x13f487={}){super(_0xe9c7b8),this['stickyPanel']=new ht(_0xe9c7b8),this['toolbar']=new lt(_0xe9c7b8,{'shouldGroupWhenFull':_0x13f487['shouldToolbarGroupWhenFull']}),this['_editable']=new tt(_0xe9c7b8,_0x536f71);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const oi=/* #__PURE__ -- @preserve */
30
+ _0x5c9264(_0x400523);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x12e222,_0x30433d){super(_0x30433d),this['sourceElement']=_0x12e222,this['model']['document']['createRoot']();const _0x1bfefb=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0x1bfefb);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x2e035e,_0x87a3e9){const _0x48c8e9=new this(_0x2e035e,_0x87a3e9);return await _0x48c8e9['initPlugins'](),await _0x48c8e9['ui']['init'](_0x2e035e),await _0x48c8e9['data']['init'](_0x48c8e9['config']['get']('initialData')||''),_0x48c8e9['fire']('ready'),_0x48c8e9;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0x15eb24{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d2658){super(_0x4d2658),this['result']='end',_0x4d2658['editing']['view']['_overlayModeHint']='auto',_0x4d2658['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0x15eb24{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0x23b6bb){if(super(_0x23b6bb),!this['editor']['config']['get']('revisionHistory'))throw new _0x8716b1('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x2f60e4=>this['_showRevisionViewer']({..._0x2f60e4,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x3ed2b2=>this['_closeRevisionViewer'](_0x3ed2b2)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x203fce=>this['_restoreRevision'](_0x203fce)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0xa6f792){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0xa6f792;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x42df3d){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x42df3d);}getRevision(_0x9260f1){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x9260f1);}getRevisions(_0x54418c){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x54418c||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x461018=this['editor'],_0x418cf2=_0xed521e(_0x461018,ai),_0x2de090=_0x461018['plugins']['get']('RevisionTracker'),_0x4e1f6e=_0x461018['plugins']['get'](_0x4fd2f9)['users'];return _0x418cf2['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x418cf2['lazyRoots'],(_0x418cf2['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0x15eb24{static get requires(){return[Pt,_0x4fd2f9];}init(){const _0x3ec4ea=this['editor']['plugins']['get'](_0x4fd2f9);for(const _0x23ff67 of _0x4e1f6e)_0x23ff67['isAnonymous']||_0x3ec4ea['getUser'](_0x23ff67['id'])||_0x3ec4ea['addUser'](_0x23ff67);const _0x513a38=_0x2de090['repository']['getRevisions']();let _0x3d1238=null;const _0x37beab=this['editor']['plugins']['get']('RevisionViewer');if(_0x37beab['adapter']=_0x2de090['adapter'],_0x37beab['bind']('isEnabled')['to'](_0x2de090),_0x461018['plugins']['has']('CommentsRepository')){const _0x56083f=_0x461018['plugins']['get']('CommentsRepository');_0x37beab['_getVisibleCommentThreadIds']=()=>new Set(_0x56083f['getCommentThreads']()['filter'](_0x37e9f8=>!_0x37e9f8['isResolved'])['map'](_0x4241aa=>_0x4241aa['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x461018,'isReadOnly',_0x189e34=>!_0x189e34);for(const _0x53787c of _0x513a38){const _0x11ebdf=null===_0x53787c['creator'];if(_0x11ebdf&&_0x53787c['toVersion']===_0x53787c['fromVersion'])continue;const _0x40090e=_0x53787c['toJSON']();_0x37beab['addRevisionData'](_0x40090e,(_0x583cd1,_0x5eec5c,_0x18d21b)=>{if(_0x11ebdf){if(_0x3d1238)_0x3d1238['_update'](_0x583cd1,_0x5eec5c);else{if(!_0x5eec5c){const _0x4bfbd2=_0x18d21b['toJSON']();_0x4bfbd2['id']=_0x1502a4(),_0x2de090['saveRevision'](_0x4bfbd2,_0x18d21b['toVersion'])['then'](_0x3ad331=>{_0x3d1238=_0x3ad331;});}}}else _0x53787c['_update'](_0x583cd1,_0x5eec5c);});}}},ii),_0x418cf2);}['_enhanceShowRevisionViewerCallback'](){const _0x3f30b6=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x35fe35=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x35fe35['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x3fc486=this['editor']['plugins']['get']('Dialog');_0x3fc486['isOpen']&&_0x3fc486['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x10d6a5=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x24beb1 of _0x10d6a5)_0x24beb1['class']=_0x24beb1['class']?_0x24beb1['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x3d0e42=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x3d0e42&&_0x3d0e42['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x5bae0b=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x5bae0b&&_0x5bae0b['setAttribute']('tabindex','-1');}}const _0x37b71a=this['_getRevisionViewerEditorConfig']();return _0x3f30b6(_0x37b71a)['then'](_0xf161b1=>(this['_viewerEditor']=_0xf161b1,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'),_0xf161b1))['catch'](_0x490f53=>(console['error'](_0x490f53),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x8fa609=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 _0x501180=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x215afc of _0x501180)_0x215afc['class']='ck-tab-panel_disabled'===_0x215afc['class']?'':_0x215afc['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0xfac890=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0xfac890&&_0xfac890['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x25fd46=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x25fd46&&_0x25fd46['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x8fa609(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x47761b=this['editor']['plugins']['get']('Annotations');_0x47761b['refreshVisibility'](),_0x47761b['refreshPositioning']();}});});}['_showRevisionViewer'](_0x59561f){const _0x5103e2=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x2b07e7=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x2822ba=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x2822ba,_0x59561f)['then'](_0xa970d4=>(_0x2b07e7['style']['display']='block',_0x5103e2['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0xa970d4));}['_closeRevisionViewer'](_0x1a21d6){const _0x134868=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x134868['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x1a21d6['destroy']();}async _restoreRevision(_0x1796a6){const _0x484a77=this['editor'],_0xa25360=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x1ccde3=_0x484a77['plugins']['get']('RevisionTracker'),_0x9df9ce=_0x484a77['plugins']['get']('RevisionHistoryUtils'),_0x41c559=_0xa25360['repository']['getRevision'](_0x1796a6);let _0x437b0d,_0x38ec57,_0x5004ee;try{await _0x9df9ce['loadRevisionData'](_0x41c559,this['adapter']),_0x437b0d=_0x9df9ce['getRevisionDocumentData'](_0x41c559),_0x38ec57=_0x9df9ce['getRevisionRootsAttributes'](_0x41c559);}catch(_0x8f8434){return void console['error'](_0x8f8434);}_0x484a77['model']['change'](_0x308ec8=>{for(const _0x2f4b55 of Array['from'](_0x484a77['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x308ec8['removeMarker'](_0x2f4b55);}),_0xa25360['isReady']=!0x1,_0x484a77['model']['enqueueChange'](_0x97ccc1=>{_0x97ccc1['setSelection'](null),_0x97ccc1['removeSelectionAttribute'](_0x484a77['model']['document']['selection']['getAttributeKeys']());const _0x5b2684=Object['keys'](_0x437b0d);for(const _0x1000c3 of _0x484a77['model']['document']['roots'])'$graveyard'!=_0x1000c3['rootName']&&_0x1000c3['isAttached']()&&!_0x5b2684['includes'](_0x1000c3['rootName'])&&_0x97ccc1['detachRoot'](_0x1000c3);for(const _0x312cd0 of _0x5b2684){let _0x39bd02=_0x484a77['model']['document']['getRoot'](_0x312cd0);if(!_0x39bd02||!_0x39bd02['isAttached']()){const _0x4d31ce=_0x41c559['diffData']?.[_0x312cd0]?.['rootElementName']||'$root';_0x39bd02=_0x97ccc1['addRoot'](_0x312cd0,_0x4d31ce);}const _0x4beee6=_0x38ec57[_0x312cd0],_0x4ccc48=Object['keys'](_0x4beee6),_0x296c3d=_0x437b0d[_0x312cd0];for(const _0x2e382a of _0x39bd02['getAttributeKeys']())_0x4ccc48['includes'](_0x2e382a)||_0x97ccc1['removeAttribute'](_0x2e382a,_0x39bd02);for(const _0x1755c4 of _0x4ccc48)_0x97ccc1['setAttribute'](_0x1755c4,_0x38ec57[_0x312cd0][_0x1755c4],_0x39bd02);_0x97ccc1['remove'](_0x97ccc1['createRangeIn'](_0x39bd02)),_0x97ccc1['insert'](_0x484a77['data']['parse'](_0x296c3d,_0x39bd02),_0x39bd02,0x0);}});const _0x36a5e8=kt(_0x484a77['locale'],'Restored');if(_0x41c559['name'])_0x5004ee=-0x1==_0x41c559['name']['indexOf'](_0x36a5e8)?_0x36a5e8+':\x20'+_0x41c559['name']:_0x41c559['name'];else _0x5004ee=_0x36a5e8+':\x20'+(_0x41c559['createdAt']['toLocaleDateString'](_0x484a77['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x41c559['createdAt']['toLocaleTimeString'](_0x484a77['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x1ccde3['saveRevision']({'name':_0x5004ee}),_0xa25360['isReady']=!0x0,_0x484a77['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Ft as RestoreRevisionCommand,yt as Revision,ci as RevisionHistory,Dt as RevisionHistoryUI,Rt as RevisionHistoryUtils,At as RevisionTracker,Pt as RevisionViewer,ri as RevisionViewerEditor,hi as RevisionViewerIntegration,Gt as RevisionViewerLoadingOverlay,Kt as RevisionViewerUI,bt as RevisionsRepository,ii as RevisionsSidebar,$t as ShowChangeCommand};