@ckeditor/ckeditor5-revision-history 49.0.0 → 49.0.1

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 _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 */
23
+ import{CKEditorError as _0x3d550e,Collection as _0x32a4f2,ElementReplacer as _0x19597b,FocusTracker as _0x4e4794,KeystrokeHandler as _0x53888f,ObservableMixin as _0x135b6a,ResizeObserver as _0x5c360a,logWarning as _0x11b5c9,scrollViewportToShowTarget as _0x60056,trustedHtml as _0x5c60d8,uid as _0x240cc1}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x346ba8,isEqual as _0x235614,set as _0x1d4419,unset as _0x309af8}from'es-toolkit/compat';import{Command as _0x2158cb,Editor as _0x27c387,ElementApiMixin as _0x5ed66b,PendingActions as _0x3f141d,Plugin as _0x544bf8}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x3e5ba7,PillView as _0x30468e,Users as _0x157f26,getMarkerDomElement as _0x4df91e,reRootOperation as _0x1c16f5,reRootPosition as _0x3e4f67,reRootRange as _0x146304,sanitizeEditorConfig as _0x1db4df}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x3bdc31,ModelElement as _0x19c548,ModelRange as _0x31969d,ModelText as _0x7943a3,ViewAttributeElement as _0x23c0b4,ViewContainerElement as _0x32bc61,ViewDocumentFragment as _0x443d07,ViewElement as _0x2eab9a,ViewEmptyElement as _0x147194,ViewRawElement as _0x2f30ee,ViewText as _0x1f997e,ViewUIElement as _0x26cf79}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0x4c5074,IconChevronUp as _0x194704,IconHistory as _0x1cebb3,IconSparkle as _0x237d30,IconThreeVerticalDots as _0x500df1,IconUndo as _0x53c7c8,IconUser as _0x5a8ed6}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x121443,ButtonView as _0xefa108,ContextualBalloon as _0x25d16b,CssTransitionDisablerMixin as _0x1dd50d,EditorUI as _0x108803,IconView as _0x1d6039,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
+ _0x135b6a();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x29617a){super(),this['id']=_0x29617a['id']||_0x240cc1(),this['creator']=_0x29617a['creator']||null,this['authors']=_0x29617a['authors']||[],this['diffData']=_0x29617a['diffData']||null,this['toVersion']=_0x29617a['toVersion']||0x0,this['fromVersion']=_0x29617a['fromVersion']||0x0,this['set']('name',_0x29617a['name']||''),this['set']('createdAt',_0x29617a['createdAt']||new Date()),this['set']('attributes',_0x29617a['attributes']||{});}setName(_0x41a6fe){this['_update']({'name':_0x41a6fe});}setAttribute(_0xe962ba,_0x39bc2c){const _0xb828a8=_0x346ba8(this['attributes']);_0x1d4419(_0xb828a8,_0xe962ba,_0x39bc2c),this['_update']({'attributes':_0xb828a8});}removeAttribute(_0x605124){const _0x1a127b=_0x346ba8(this['attributes']);_0x309af8(_0x1a127b,_0x605124),this['_update']({'attributes':_0x1a127b});}_update(_0x5cb0a2,_0x162817=!0x1){let _0xae0ceb=!0x1;const _0x495526={'id':this['id']};for(const _0x55ee8f of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x148d5a=_0x5cb0a2[_0x55ee8f];void 0x0!==_0x148d5a&&_0x148d5a!==this[_0x55ee8f]&&(this[_0x55ee8f]=_0x148d5a,_0x495526[_0x55ee8f]=_0x148d5a,_0xae0ceb=!0x0);}_0xae0ceb&&(_0x495526['authors']&&(_0x495526['authorsIds']=_0x495526['authors']['map'](_0x221d43=>_0x221d43['id']),delete _0x495526['authors']),this['fire']('_update',_0x495526,_0x162817));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x2908e8=>_0x2908e8['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0x544bf8{['_revisions'];static get requires(){return[_0x157f26];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x16ea63){super(_0x16ea63),this['_revisions']=new _0x32a4f2();}afterInit(){!async function(_0x343bf3){const _0xe4580f='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x5747a1=0xeb829,_0xa705f5=0x79998,_0x4a0d25={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x1c71d9(_0x36e1ee){const _0x49d942=new window['Promise'](_0x15a6a9=>{_0x36e1ee['once']('ready',_0x15a6a9);}),_0x4ef59e=window['Date']['now'](),_0x485ed4=_0x36e1ee['config']['get']('licenseKey');async function _0x186a5c(){let _0x3d2ac9,_0x431690=null,_0x177de6=null;try{return'GPL'==_0x485ed4?'NotAllowed':(_0x3d2ac9=_0x175133(),_0x3d2ac9?(_0x3d2ac9['usageEndpoint']&&(_0x177de6=_0x113528(_0x3d2ac9['usageEndpoint'],_0x3d2ac9['jti'])),await _0x3af323()?_0xa692d0()?_0x3059b9()?'Expired':_0x376eb1()?('evaluation'==_0x3d2ac9['licenseType']&&(_0x431690=_0x2f1f8d('EvaluationLimit')),await _0x4c776a()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3059b9(){const _0x1cfe8e=['evaluation','trial']['includes'](_0x3d2ac9['licenseType'])?_0x4ef59e/0x3e8:0xe10*_0xa705f5;return _0x3d2ac9['exp']<_0x1cfe8e;}function _0xa692d0(){const _0x265dfe=_0x3d2ac9['features'];if(!_0x265dfe)return!0x1;if(_0x265dfe['includes']('*'))return!0x0;if(_0x265dfe['includes']('RH'))return!0x0;if(_0x265dfe['includes']('RRH')){if(_0x14d7d2())return!0x0;if(_0x3af8c1()||_0x482f45())return!0x0;}return!0x1;}function _0x376eb1(){const _0x51c001=_0x3d2ac9['licensedHosts'];if(!_0x51c001||0x0==_0x51c001['length'])return!0x0;const {hostname:_0x26c2d0}=new URL(window['location']['href']);if(_0x51c001['includes'](_0x26c2d0))return!0x0;const _0x42a057=_0x26c2d0['split']('.');return _0x51c001['filter'](_0x237fce=>_0x237fce['includes']('*'))['map'](_0x37b848=>_0x37b848['split']('.'))['filter'](_0x3547e1=>_0x3547e1['length']<=_0x42a057['length'])['map'](_0x2b60fc=>Array(_0x42a057['length']-_0x2b60fc['length'])['fill']('*'===_0x2b60fc[0x0]?'*':'')['concat'](_0x2b60fc))['some'](_0x2eca76=>_0x42a057['every']((_0xc3667d,_0x1bb347)=>_0x2eca76[_0x1bb347]===_0xc3667d||'*'===_0x2eca76[_0x1bb347]));}function _0x4c776a(){return _0x431690&&_0x177de6?new window['Promise']((_0x1a01ab,_0x198844)=>{_0x431690['then'](_0x1a01ab,_0x198844),_0x177de6['then'](_0x548e43=>{'Valid'!=_0x548e43&&_0x1a01ab(_0x548e43);},_0x198844);}):_0x431690||_0x177de6||'Valid';}}function _0x113528(_0x350150,_0x409a22){return new window['Promise'](_0x595ce0=>{if(_0x42f0df())return _0x595ce0('Valid');_0x2cd756(),_0x36e1ee['decorate']('_sendUsageRequest');let _0x371e12=!0x1;const _0x2c4f7c=_0x240cc1();function _0x2268f4(_0x16142f){return!!_0x16142f&&('object'==typeof _0x16142f||'function'==typeof _0x16142f)&&'function'==typeof _0x16142f['then']&&'function'==typeof _0x16142f['catch'];}function _0x29fd73(_0x424026){_0x177893(_0x424026)['then'](_0x3ee003=>_0x3ee003&&'ok'==_0x3ee003['status']?_0x331cf7(_0x2d001a(_0x2c4f7c+_0x409a22))!=_0x3ee003['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2b71ec=>(_0x25882a(),_0x2b71ec),()=>{const _0x4cab9c=_0x269c8b();return null==_0x4cab9c?(_0x25882a(),'Valid'):_0x4ef59e-_0x4cab9c>0x240c8400?'UsageLimit':'Valid';})['then'](_0x595ce0)['catch'](()=>{_0x595ce0('UsageLimit');});const _0x455261=0x36ee80;function _0x25882a(){const _0x4a581b='llct-'+_0x331cf7(_0x2d001a(_0x350150)),_0x2d44eb=_0x235871(_0x331cf7(window['Math']['ceil'](_0x4ef59e/_0x455261)));window['localStorage']['setItem'](_0x4a581b,_0x2d44eb);}function _0x269c8b(){const _0x4de932='llct-'+_0x331cf7(_0x2d001a(_0x350150)),_0x43df4e=window['localStorage']['getItem'](_0x4de932);return _0x43df4e?window['parseInt'](_0x235871(_0x43df4e),0x10)*_0x455261:null;}function _0x177893(_0xaff3a3){return new window['Promise']((_0x3ae2be,_0x27284)=>{_0xaff3a3['then'](_0x3ae2be,_0x27284),window['setTimeout'](_0x27284,0x1d4c0);});}}_0x36e1ee['on']('_sendUsageRequest',(_0x556acb,_0x27bd1b)=>{if(_0x27bd1b[0x0]!=_0x350150)return _0x595ce0('UsageLimit');_0x27bd1b[0x1]={..._0x27bd1b[0x1],'requestId':_0x2c4f7c};},{'priority':'high'}),_0x36e1ee['on']('_sendUsageRequest',_0x4a871e=>{_0x2268f4(_0x4a871e['return'])&&(_0x371e12=!0x0,_0x29fd73(_0x4a871e['return']));},{'priority':'low'}),_0x49d942['then'](()=>{_0x371e12||_0x595ce0('UsageLimit');});});function _0x42f0df(){return'auto'==_0x36e1ee['editing']['view']['_overlayModeHint'];}function _0x2cd756(){_0x36e1ee['editing']['view']['_overlayModeHint']='auto';}}function _0x2f1f8d(_0xd77f96){const _0x3587eb=[new window['Promise'](_0x4b3851=>setTimeout(_0x4b3851,0x93ecc)),_0x49d942['then'](()=>new window['Promise'](_0x3b7dcc=>{const _0x3cb083=0x7,_0x2c213f=_0x343bf3['_revisions'];function _0x4af154(){_0x2c213f['length']>=_0x3cb083&&_0x3b7dcc();}_0x4af154(),_0x2c213f['on']('add',_0x4af154);})),new window['Promise'](_0x5833c4=>{function _0x1848f0(){for(const _0x266f12 in window)if(window['Number']['isNaN'](window['Number'](_0x266f12))&&window[_0x266f12]==_0x5747a1)return _0x5833c4();'destroyed'!=_0x36e1ee['state']&&window['setTimeout'](_0x1848f0,0x1388);}_0x14b5f7('RevisionViewer')&&_0x1848f0();})];return window['Promise']['race'](_0x3587eb)['then'](()=>_0xd77f96);}async function _0x45c11f(){if(await _0x49d942,_0x14b5f7('RevisionViewer')){const _0x477588=_0x343bf3['getRevision'](0x0),_0x5d4d4f=_0x343bf3['getEarlierVisibleRevision'](_0x477588['id']),_0x414916=_0xa43825('RevisionViewer');return await _0x414916['compare'](_0x477588['id'],_0x5d4d4f?_0x5d4d4f['id']:null,!0x0),_0x414916['unbind']('isEnabled'),_0x414916['isEnabled']=!0x1,_0x414916['compare']=_0x138f10,void(_0x414916['_getDiff']=_0x138f10);}if(_0x14b5f7('RevisionTracker')){const _0x3668c0=_0xa43825('RevisionTracker');_0x3668c0['unbind']('isEnabled'),_0x3668c0['isEnabled']=!0x1,_0x3668c0['update']=_0x138f10,_0x3668c0['saveRevision']=_0x138f10;}_0x36e1ee['model']['change']=_0x138f10,_0x36e1ee['model']['enqueueChange']=_0x138f10,_0x36e1ee['enableReadOnlyMode']('model');}function _0x14d7d2(){return _0x14b5f7('WebSocketGateway')&&'connected'==_0xa43825('WebSocketGateway')['state'];}function _0x3af8c1(){return _0x14b5f7('RevisionViewerIntegration');}function _0x482f45(){return _0x14b5f7('TrackChangesDataGetter');}function _0x248f36(_0x43adb5){const _0x9d672f=_0x5b1389();_0x36e1ee[_0x9d672f]='revisionHistoryLicenseKey'+_0x43adb5,_0x43adb5['endsWith']('Limit')&&(window[_0x5b1389()]=_0x5747a1),'Valid'!=_0x43adb5&&_0x45c11f();}function _0x5b1389(){const _0x1e7c47=window['String'](window['performance']['now']())['replace']('.','');let _0x2adc98='N';for(let _0x4ba0d7=0x0;_0x4ba0d7<_0x1e7c47['length'];_0x4ba0d7+=0x2){let _0x4153b6=window['parseInt'](_0x1e7c47['substring'](_0x4ba0d7,_0x4ba0d7+0x2));_0x4153b6>=0x3e&&(_0x4153b6-=0x3e),_0x2adc98+=_0xe4580f[_0x4153b6];}return _0x2adc98;}function _0x175133(){const _0x5a1aef=_0x485ed4['split']('.');if(0x3!=_0x5a1aef['length'])return null;return _0x4d7bb9(_0x5a1aef[0x1]);function _0x4d7bb9(_0x3d578c){const _0x4afe81=_0x4a1879(_0x3d578c);return _0x4afe81&&_0xc11b40()?_0x4afe81:null;function _0xc11b40(){const _0x542586=_0x4afe81['jti'],_0x3051a2=window['parseInt'](_0x542586['substring'](_0x542586['length']-0x8),0x10),_0x5e9bcd={..._0x4afe81,'jti':_0x542586['substring'](0x0,_0x542586['length']-0x8)};return delete _0x5e9bcd['vc'],_0x2d001a(_0x5e9bcd)==_0x3051a2;}}}async function _0x3af323(){let _0x4003ad=!0x0;try{const [_0x2db9ce,_0x4b2883,_0x275c80]=_0x485ed4['split']('.');return _0x2507cc(_0x2db9ce),await _0x1145fe(_0x2db9ce,_0x4b2883,_0x275c80),_0x4003ad;}catch{return!0x1;}function _0x2507cc(_0x236eb6){const _0x41743d=_0x4a1879(_0x236eb6);_0x41743d&&'ES256'==_0x41743d['alg']||(_0x4003ad=!0x1);}async function _0x1145fe(_0x20b598,_0x4bb56f,_0x2e5789){const _0x4adce8=window['Uint8Array']['from'](_0x1a4368(_0x2e5789),_0x53bbcb=>_0x53bbcb['charCodeAt'](0x0)),_0x20cdcc=new window['TextEncoder']()['encode'](_0x20b598+'.'+_0x4bb56f),_0x505909=window['crypto']['subtle'];if(!_0x505909)return;const _0xb32150=await _0x505909['importKey']('jwk',_0x4a0d25,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x505909['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xb32150,_0x4adce8,_0x20cdcc)||(_0x4003ad=!0x1);}}function _0x4a1879(_0x2e2de9){return _0x2e2de9['startsWith']('ey')?JSON['parse'](_0x1a4368(_0x2e2de9)):null;}function _0x1a4368(_0x2f57f8){return window['atob'](_0x2f57f8['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2d001a(_0x41f0ab){let _0x1dd4fa=0x1505;function _0x4780b4(_0x1e71fb){for(let _0x3ed205=0x0;_0x3ed205<_0x1e71fb['length'];_0x3ed205++){const _0x1fae52=_0x1e71fb['charCodeAt'](_0x3ed205);_0x1dd4fa=(_0x1dd4fa<<0x5)+_0x1dd4fa+_0x1fae52,_0x1dd4fa&=_0x1dd4fa;}}function _0xa002db(_0x4a5756){Array['isArray'](_0x4a5756)?_0x4a5756['forEach'](_0xa002db):_0x4a5756&&'object'==typeof _0x4a5756?Object['entries'](_0x4a5756)['sort']()['forEach'](([_0x410454,_0x420143])=>{_0x4780b4(_0x410454),_0xa002db(_0x420143);}):_0x4780b4(window['String'](_0x4a5756));}return _0xa002db(_0x41f0ab),_0x1dd4fa>>>0x0;}function _0x331cf7(_0x545467){return _0x545467['toString'](0x10)['padStart'](0x8,'0');}function _0x235871(_0x333af1){return _0x333af1['split']('')['reverse']()['join']('');}function _0x14b5f7(_0x38ea90){return _0x36e1ee['plugins']['has'](_0x38ea90);}function _0xa43825(_0x152f16){return _0x36e1ee['plugins']['get'](_0x152f16);}function _0x138f10(){}_0x248f36(await _0x186a5c());}_0x1c71d9(_0x343bf3['editor']);}(this);}createRevision(_0xed96f9){const _0x1df3f5=this['editor']['plugins']['get']('Users');return new yt({'id':_0xed96f9['id'],'name':_0xed96f9['name'],'creator':_0xed96f9['creatorId']?_0x1df3f5['getUser'](_0xed96f9['creatorId']):null,'diffData':_0xed96f9['diffData']||_0xed96f9['data'],'authors':_0xed96f9['authorsIds']['map'](_0x3c42bf=>_0x1df3f5['getUser'](_0x3c42bf)),'createdAt':new Date(_0xed96f9['createdAt']),'attributes':_0xed96f9['attributes'],'fromVersion':_0xed96f9['fromVersion'],'toVersion':_0xed96f9['toVersion']});}['addRevision'](_0x23fdcc,_0x2287cc=0x0){this['_revisions']['add'](_0x23fdcc,_0x2287cc);}getRevision(_0x3ea385){return this['_revisions']['get'](_0x3ea385);}getRevisions(_0x34c6be={'toJSON':!0x1}){const _0x4048c2=Array['from'](this['_revisions']);return _0x4048c2['reverse'](),_0x34c6be['toJSON']?_0x4048c2['map'](_0x4a0411=>_0x4a0411['toJSON']()):_0x4048c2;}getIndex(_0x1c2f7f){return this['_revisions']['getIndex'](_0x1c2f7f);}getEarlierVisibleRevision(_0x4343a6){const [,_0x28a3a3]=this['getRevisionsIterator'](_0x4343a6,{'direction':'earlier'});return _0x28a3a3;}getLaterVisibleRevision(_0x5a3bec){const [,_0x1364a7]=this['getRevisionsIterator'](_0x5a3bec,{'direction':'later'});return _0x1364a7;}getRevisionsInDiff(_0x45c956){const _0x27a745=[];for(const _0x59598b of this['getRevisionsIterator'](_0x45c956['newRevisionId']))if(_0x27a745['push'](_0x59598b),_0x59598b['id']===_0x45c956['oldRevisionId'])break;return _0x27a745;}*getRevisionsIterator(_0x24acea,{direction:_0x5dc7bd='earlier',filter:_0x1c10fc=()=>!0x0}={}){const _0x1662d9='earlier'===_0x5dc7bd?0x1:-0x1;let _0x1c0238=this['_revisions']['get'](_0x24acea),_0x3ea865=this['getIndex'](_0x1c0238);for(yield _0x1c0238;_0x1c0238;){if(_0x3ea865+=_0x1662d9,_0x1c0238=this['getRevision'](_0x3ea865),!_0x1c0238)return;_0x1c10fc(_0x1c0238)&&(yield _0x1c0238);}}},Rt=class extends _0x544bf8{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x32bc61,'c'],[_0x23c0b4,'a'],[_0x147194,'e'],[_0x2f30ee,'r'],[_0x26cf79,'u']]);_typeCharToViewClass=new Map([['c',_0x32bc61],['a',_0x23c0b4],['e',_0x147194],['r',_0x2f30ee],['u',_0x26cf79]]);async loadRevisionData(_0x2a86cb,_0xc71fb4){if(_0x2a86cb['diffData']||!_0xc71fb4)return;const _0x38c483=this['editor']['config']['get']('collaboration.channelId');_0x2a86cb['diffData']=(await _0xc71fb4['getRevision']({'channelId':_0x38c483,'revisionId':_0x2a86cb['id']}))['diffData'];}getRevisionDocumentData(_0x2dc053){const _0x59b7e1={};for(const _0x395c17 in _0x2dc053['diffData']){if(_0x2dc053['diffData'][_0x395c17]['attachChange']&&!_0x2dc053['diffData'][_0x395c17]['attachChange']['isAttached'])continue;const _0x5cb966=this['_removeRevisionMarkers'](JSON['parse'](_0x2dc053['diffData'][_0x395c17]['insertions'])),_0x3ca10d=this['editor']['editing']['view']['document'],_0x209efa=new _0x443d07(_0x3ca10d,_0x5cb966['map'](_0xa15510=>this['_getViewFromDiffObj'](_0xa15510,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x59b7e1[_0x395c17]=this['editor']['data']['processor']['toData'](_0x209efa),this['editor']['data']['processor']['useFillerType']('default');}return _0x59b7e1;}getRevisionRootsAttributes(_0x8a0453){const _0x77f074={};for(const _0x578059 in _0x8a0453['diffData'])_0x8a0453['diffData'][_0x578059]['attachChange']&&!_0x8a0453['diffData'][_0x578059]['attachChange']['isAttached']||(_0x77f074[_0x578059]=_0x8a0453['diffData'][_0x578059]['attributesAfter']||{});return _0x77f074;}getRevisionRootsModelElements(_0x59153a){const _0x4217f1={};for(const _0x39a8a2 in _0x59153a['diffData']){if(_0x59153a['diffData'][_0x39a8a2]['attachChange']&&!_0x59153a['diffData'][_0x39a8a2]['attachChange']['isAttached'])continue;const _0x26612c=_0x59153a['diffData'][_0x39a8a2]['rootElementName'];_0x26612c&&(_0x4217f1[_0x39a8a2]=_0x26612c);}return _0x4217f1;}_getTypeCharForViewElement(_0x80f4f){return this['_viewClassToTypeChar']['get'](_0x80f4f['constructor']);}_getViewFromDiffObj(_0x38f2f3,_0x5e86b6){const _0x1662a0=this['editor']['editing']['view']['document'];if('string'==typeof _0x38f2f3)return new _0x1f997e(_0x1662a0,_0x38f2f3);{let _0x46cd5a,_0x28c762;_0x28c762='u'==_0x38f2f3['type']||'r'==_0x38f2f3['type']?[]:_0x38f2f3['children']['map'](_0x58030c=>this['_getViewFromDiffObj'](_0x58030c,_0x5e86b6));const _0x59a619=this['_typeCharToViewClass']['get'](_0x38f2f3['type'])||_0x2eab9a,_0xdff69b=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x46cd5a=new _0x59a619(_0x1662a0,_0x38f2f3['name'],_0x38f2f3['attributes'],_0x28c762),'u'==_0x38f2f3['type']&&_0x38f2f3['children'][0x0]){const _0x42f548=_0x38f2f3['children'][0x0];if(_0x46cd5a['render']=function(_0x3e18a0){const _0x20f41c=_0x3e18a0['createElement']('div');return _0x20f41c['innerHTML']=_0x5c60d8(_0x42f548),_0x20f41c['childNodes'][0x0];},_0x5e86b6){const _0x22f4ff=new _0x443d07(_0x1662a0);_0x22f4ff['_appendChild'](_0x46cd5a);const _0x21d7c3=Array['from'](_0xdff69b['viewChildrenToDom'](_0x22f4ff,{'bind':!0x1})),_0x26e870=_0xdff69b['domDocument']['createElement']('div');_0x26e870['append'](..._0x21d7c3),_0x46cd5a=Array['from'](_0xdff69b['domChildrenToView'](_0x26e870))[0x0];}}else{if('r'==_0x38f2f3['type']&&_0x38f2f3['children'][0x0]){const _0x31badc=_0x38f2f3['children'][0x0];if(_0x46cd5a['render']=function(_0xb11d1f){_0xb11d1f['innerHTML']=_0x5c60d8(_0x31badc);},_0x5e86b6){const _0x211b11=new _0x443d07(_0x1662a0);_0x211b11['_appendChild'](_0x46cd5a);const _0x1a7c97=Array['from'](_0xdff69b['viewChildrenToDom'](_0x211b11,{'bind':!0x1})),_0x22c0cf=_0xdff69b['domDocument']['createElement']('div');_0x22c0cf['append'](..._0x1a7c97);const _0x3ddd85=Array['from'](_0xdff69b['domChildrenToView'](_0x22c0cf));_0x3ddd85['length']>0x1?_0x46cd5a['_appendChild'](_0x3ddd85):_0x46cd5a=_0x3ddd85[0x0];}}}if(_0x38f2f3['customProperties']){for(const [_0x47539b,_0x400edf]of _0x38f2f3['customProperties'])_0x46cd5a['_setCustomProperty'](_0x47539b,_0x400edf);}const _0x57975d=void 0x0===_0x38f2f3['fillerOffset']?null:_0x38f2f3['fillerOffset'];return null!==_0x57975d&&(_0x46cd5a['getFillerOffset']=()=>_0x57975d),_0x46cd5a;}}_makeModelFromViewString(_0xe8f0ca,_0x39ff31){const _0x371e70=JSON['parse'](_0xe8f0ca),_0x27a409=this['editor']['editing']['view']['document'],_0xc9cb44=new _0x443d07(_0x27a409,_0x371e70['map'](_0x19b949=>this['_getViewFromDiffObj'](_0x19b949,!0x0))),_0x43995a=this['editor']['data']['toModel'](_0xc9cb44,_0x39ff31);return _0x43995a['name']=_0x39ff31,_0x43995a;}['_removeRevisionMarkers'](_0x1f9195){return(_0x1f9195=_0x1f9195['filter'](_0x1dbcf5=>!_0x1dbcf5['name']||'revision-start'!==_0x1dbcf5['name']&&'revision-end'!==_0x1dbcf5['name']))['forEach'](_0x217dff=>{'string'!=typeof _0x217dff&&(_0x217dff['children']=this['_removeRevisionMarkers'](_0x217dff['children']),_0x217dff['attributes']=_0x217dff['attributes']['filter'](_0x185731=>!_0x185731[0x0]['startsWith']('data-revision-')));}),_0x1f9195;}};function kt(_0x403f21,_0x34f475,_0x3c10ca){const t=_0x403f21['t'];switch(_0x34f475){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'},_0x3c10ca);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x3c10ca);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'},_0x3c10ca);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x3c10ca);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x3c10ca);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0x544bf8{['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[_0x157f26,bt,Rt,_0x3f141d];}constructor(_0x4e4da4){super(_0x4e4da4),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 _0x5e51fa=_0x240cc1();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x5e51fa},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 _0x58f4f0=this['repository']['getRevision'](0x0),_0x1cd97e=_0x58f4f0&&null===_0x58f4f0['creator']?_0x58f4f0:null;if(this['_continueCurrentRevision']=!!_0x1cd97e&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x5308b2=this['_source']['getCurrentRevisionId'](),_0x59ebe3=this['repository']['getRevision'](_0x5308b2);if(_0x59ebe3)this['_startingVersion']=_0x59ebe3['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0xd2f94c=this['_source']['history']['_operations']['find'](_0xb7011b=>!_0xb7011b['_isInit']),_0x2aff48=_0xd2f94c?_0xd2f94c['baseVersion']:this['_source']['history']['version'];_0x58f4f0?(_0x58f4f0['toVersion']<_0x2aff48&&_0x58f4f0['_update']({'toVersion':_0x2aff48}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x1cd97e['id'],this['_startingVersion']=_0x1cd97e['fromVersion']):(this['_startingVersion']=_0x58f4f0['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x2aff48,this['_continueCurrentRevision']=!0x1);}}else _0x1cd97e&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x1cd97e['toVersion'],this['editor']['model']['document']['history']['version']),_0x1cd97e['fromVersion']===_0x1cd97e['toVersion']?(0x0!==_0x1cd97e['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x1cd97e['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x1cd97e['id'],this['_startingVersion']=_0x1cd97e['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',_0x166deb=>!_0x166deb),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x5a10a5=[this['editor']];for(const _0x2321c3 of _0x5a10a5){let _0x433bb6;for(const _0x4ebb3b in _0x2321c3){const _0x3fc7bf=_0x4ebb3b,_0x3b6348=_0x2321c3[_0x3fc7bf];if('revisionHistoryLicenseKeyValid'==_0x3b6348||'revisionHistoryLicenseKeyInvalid'==_0x3b6348||'revisionHistoryLicenseKeyExpired'==_0x3b6348||'revisionHistoryLicenseKeyDomainLimit'==_0x3b6348||'revisionHistoryLicenseKeyNotAllowed'==_0x3b6348||'revisionHistoryLicenseKeyEvaluationLimit'==_0x3b6348||'revisionHistoryLicenseKeyUsageLimit'==_0x3b6348){delete _0x2321c3[_0x3fc7bf],_0x433bb6=_0x3b6348,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x433bb6&&_0x2321c3['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x433bb6&&_0x2321c3['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x433bb6&&_0x2321c3['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x433bb6&&_0x2321c3['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x433bb6&&_0x2321c3['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x433bb6&&_0x2321c3['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x58f5f7=this['repository']['getRevision'](0x0),_0x6b10d3=await this['getRevisionDocumentData'](_0x58f5f7),_0x21d928=await this['getRevisionRootsAttributes'](_0x58f5f7),_0x1c82d2=this['_utils']['getRevisionRootsModelElements'](_0x58f5f7);this['_replaceEditorDataWithRevisionData'](_0x6b10d3,_0x21d928,_0x1c82d2);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x5dd816){this['_source']=_0x5dd816;}async update(){const _0x39cb05=await this['_source']['getLatestVersion']();if(_0x39cb05>this['currentRevision']['toVersion']){await this['_loadState']();const _0x37b3a8=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x39cb05});_0x37b3a8['authors']=_0x37b3a8['authorsIds']['map'](_0x34caa8=>this['editor']['plugins']['get']('Users')['getUser'](_0x34caa8)),this['currentRevision']['_update'](_0x37b3a8);}}async['saveRevision'](_0x189476={},_0x3f07b4=null){const _0x14524b=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x3f07b4>this['currentRevision']['toVersion']&&(_0x3f07b4=null),null===_0x3f07b4&&(_0x3f07b4=await this['_source']['getLatestVersion']());const _0xd05603=this['_getFromVersion'](_0x3f07b4),_0x56ddaa=this['buildRevisionData']({'from':_0xd05603,'to':_0x3f07b4});if(this['currentRevision']['toVersion']<_0x3f07b4){const _0x7b2353=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x3f07b4,'to':_0x3f07b4});_0x7b2353['authors']=[],_0x7b2353['authorsIds']=[],_0x7b2353['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x7b2353,!0x0),delete _0x7b2353['authors'],_0x14524b['push'](_0x7b2353);}const _0x62d760={..._0x189476,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x189476['name']||null,'id':_0x189476['id']||_0x240cc1(),..._0x56ddaa,'attributes':{..._0x189476['attributes'],..._0x56ddaa['attributes']}},_0x3591d9=this['addRevisionData'](_0x62d760);_0x14524b['push'](_0x62d760);const _0x2aff4a=this['repository']['getIndex'](_0x3591d9);if(0x0!==_0x2aff4a){const _0x507f97=this['repository']['getRevision'](_0x2aff4a-0x1);if(_0x507f97['fromVersion']!==_0x3f07b4){const _0x12ca78=this['_revisionDataBuilder']['getData'](_0x3f07b4,_0x507f97['toVersion']),_0x29ec8b={'id':_0x507f97['id'],'diffData':_0x12ca78['diffData'],'authorsIds':_0x12ca78['authorsIds'],'authors':_0x12ca78['authorsIds']['map'](_0x5e158b=>this['editor']['plugins']['get']('Users')['getUser'](_0x5e158b)),'fromVersion':_0x3f07b4};this['_stampAiAttribute'](_0x29ec8b,_0x507f97,!!_0x12ca78['hasAIChanges']),_0x507f97===this['currentRevision']&&(_0x29ec8b['createdAt']=new Date(_0x62d760['createdAt']['getTime']()+0xa)),_0x507f97['_update'](_0x29ec8b,!0x0),delete _0x29ec8b['authors'],_0x14524b['push'](_0x29ec8b);}}if(this['adapter']){for(const _0x2747b7 of _0x14524b)this['_bufferUpdate'](_0x2747b7['id'],_0x2747b7,!0x0);this['sendBufferedUpdates']();}return _0x3591d9;}addRevisionData(_0x47f244){const _0x36a6eb=this['repository']['createRevision'](_0x47f244);return this['adapter']&&_0x36a6eb['on']('_update',(_0x375c89,_0xfc28f7,_0x1a3d2b)=>{_0x1a3d2b||(this['_bufferUpdate'](_0xfc28f7['id'],_0xfc28f7,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x36a6eb,this['_findInsertionIndex'](_0x36a6eb)),_0x36a6eb;}async getRevisionDocumentData(_0x3b1539){return await this['_utils']['loadRevisionData'](_0x3b1539,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x3b1539);}async getRevisionRootsAttributes(_0xae9886){return await this['_utils']['loadRevisionData'](_0xae9886,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0xae9886);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x4e1534=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x59d855=0x0;_0x59d855<_0x4e1534['length'];_0x59d855++){const _0x185f97=_0x4e1534[_0x59d855];let _0x235640=!0x1;for(const _0x3422c2 of Object['keys'](_0x185f97))void 0x0===_0x185f97[_0x3422c2]?delete _0x185f97[_0x3422c2]:'id'!==_0x3422c2&&(_0x235640=!0x0);_0x235640||(_0x4e1534[_0x59d855]=null);}if(_0x4e1534=_0x4e1534['filter'](_0x38eb8f=>null!==_0x38eb8f),!_0x4e1534['length'])return;for(let _0x3c95ac=0x0;_0x3c95ac<_0x4e1534['length'];_0x3c95ac++){const _0x4b19c8=_0x4e1534[_0x3c95ac];void 0x0!==_0x4b19c8['fromVersion']&&void 0x0===_0x4b19c8['toVersion']&&(_0x4b19c8['toVersion']=this['repository']['getRevision'](_0x4b19c8['id'])['toVersion']),void 0x0!==_0x4b19c8['toVersion']&&void 0x0===_0x4b19c8['fromVersion']&&(_0x4b19c8['fromVersion']=this['repository']['getRevision'](_0x4b19c8['id'])['fromVersion']);}const _0x326917=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x4e1534,_0x326917)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x4d40ce=>{if(_0x4d40ce){for(const _0x321ebc of _0x4d40ce)this['setRevisionData']({'id':_0x321ebc['id'],'createdAt':_0x321ebc['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x30dd60,_0x273b65,_0x131a38){if(_0x131a38===(!!_0x273b65&&!!_0x273b65['attributes']['@ai']))return;const _0xe83619={..._0x273b65?_0x273b65['attributes']:{},..._0x30dd60['attributes']};_0x131a38?_0xe83619['@ai']=!0x0:delete _0xe83619['@ai'],_0x30dd60['attributes']=_0xe83619;}buildRevisionData({revision:_0x9beaed=null,from:_0x3c0c90=null,to:_0x31fa0d=null}){_0x3c0c90=null!==_0x3c0c90?_0x3c0c90:_0x9beaed['fromVersion'],_0x31fa0d=null!==_0x31fa0d?_0x31fa0d:_0x9beaed['toVersion'];const _0x219761=this['_revisionDataBuilder']['getData'](_0x3c0c90,_0x31fa0d),_0x2bacda={'diffData':_0x219761['diffData'],'authorsIds':_0x219761['authorsIds'],'fromVersion':_0x3c0c90,'toVersion':_0x31fa0d};if(this['_stampAiAttribute'](_0x2bacda,_0x9beaed,!!_0x219761['hasAIChanges']),!_0x9beaed||_0x31fa0d!==_0x9beaed['toVersion']){const _0x842257=_0x31fa0d-0x1,_0x439461=this['_source']['history']['getOperation'](_0x842257);_0x2bacda['createdAt']=_0x439461&&_0x439461['createdAt']||new Date();}if(this['_loadedStateData']&&_0x3c0c90===this['_loadedStateData']['fromVersion']){for(const _0x36d85f of this['_loadedStateData']['authors'])_0x2bacda['authorsIds']['includes'](_0x36d85f['id'])||_0x2bacda['authorsIds']['push'](_0x36d85f['id']);}return _0x2bacda;}_bufferUpdate(_0x1c2ce5,_0x2a3383,_0x2b20b2){if(this['_bufferedUpdates']['has'](_0x1c2ce5)){const _0x4bbaa2=this['_bufferedUpdates']['get'](_0x1c2ce5);_0x2a3383=_0x2b20b2?{..._0x4bbaa2,..._0x2a3383}:{..._0x2a3383,..._0x4bbaa2};}this['_bufferedUpdates']['set'](_0x1c2ce5,_0x2a3383);}setRevisionData(_0x2065ec){const _0x2e07b6=this['repository']['getRevision'](_0x2065ec['id']);if(_0x2065ec['createdAt']&&(_0x2065ec['createdAt']=new Date(_0x2065ec['createdAt'])),_0x2065ec['authorsIds']){const _0x4d97d7=this['editor']['plugins']['get']('Users');_0x2065ec['authors']=_0x2065ec['authorsIds']['map'](_0x36bc26=>_0x4d97d7['getUser'](_0x36bc26));}_0x2e07b6['_update'](_0x2065ec,!0x0);}_createInitialRevision(_0x59c331){const _0x5e8ce4=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x5e8ce4)this['_initialRevisionId']=_0x5e8ce4['id'];else{const _0x29c10c=!this['editor']['model']['document']['roots']['find'](_0x2b0938=>this['editor']['model']['hasContent'](_0x2b0938)),_0x3ce312=this['editor']['plugins']['get']('Users')['me']['id'],_0x2eab13=kt(this['editor']['locale'],_0x29c10c?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x59c331,'to':_0x59c331,'id':this['_initialRevisionId'],'name':_0x2eab13,'creatorId':_0x3ce312});}}_createCurrentRevision(_0x8c762c){const _0xe4809e=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0xe4809e),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x8c762c,'to':_0x8c762c,'id':_0xe4809e,'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(_0x51e608,_0x18bce3,_0x247513){const _0x4b9535={},_0x2939ff={},_0x2945af={},_0x209878=this['editor']['config']['get']('roots')||{};for(const [_0xd64f5d,_0x4bae7f]of Object['entries'](_0x209878))_0x4bae7f['lazyLoad']||(_0x4b9535[_0xd64f5d]=_0x4bae7f['initialData']??'',_0x2939ff[_0xd64f5d]=_0x4bae7f['modelAttributes']||{},_0x4bae7f['modelElement']&&(_0x2945af[_0xd64f5d]=_0x4bae7f['modelElement']));for(const _0x28cb01 of this['editor']['model']['document']['getRootNames']())_0x4b9535[_0x28cb01]??='',_0x2939ff[_0x28cb01]??={};let _0x1efe70=!0x1;const _0x3c5f79=Object['keys'](_0x4b9535),_0x5ce580=Object['keys'](_0x51e608);for(const _0x2786de of _0x3c5f79){if(_0x4b9535[_0x2786de]!==_0x51e608[_0x2786de]&&''!==_0x4b9535[_0x2786de]['trim']()){_0x1efe70=!0x0;break;}if(!_0x235614(_0x2939ff[_0x2786de],_0x18bce3[_0x2786de])&&Object['keys'](_0x2939ff[_0x2786de])['length']>0x0){_0x1efe70=!0x0;break;}const _0x2d99e8=_0x2945af[_0x2786de],_0x4a6e13=_0x247513[_0x2786de];if(_0x2d99e8&&_0x4a6e13&&_0x2d99e8!==_0x4a6e13){_0x1efe70=!0x0;break;}}_0x1efe70||(_0x1efe70=_0x5ce580['some'](_0x36935b=>!this['editor']['model']['document']['getRoot'](_0x36935b))),_0x1efe70&&_0x11b5c9('editor-initial-data-replaced-with-revision-data',{'editorData':_0x4b9535,'editorRootsAttributes':_0x2939ff,'editorRootsModelElements':_0x2945af,'revisionData':_0x51e608,'revisionRootsAttributes':_0x18bce3,'revisionRootsModelElements':_0x247513});for(const [_0x1ead3a,_0x7e98d2]of Object['entries'](_0x51e608))this['editor']['config']['set']('roots.'+_0x1ead3a+'.initialData',_0x7e98d2);for(const [_0x2b7cfb,_0x3bc9b3]of Object['entries'](_0x18bce3))this['editor']['config']['set']('roots.'+_0x2b7cfb+'.modelAttributes',_0x3bc9b3);const _0x3deb60=this['editor']['model']['document'];for(const [_0x906be1,_0xebccb2]of Object['entries'](_0x247513)){this['editor']['config']['set']('roots.'+_0x906be1+'.modelElement',_0xebccb2);const _0x345272=_0x3deb60['getRoot'](_0x906be1);_0x345272&&_0x345272['name']!==_0xebccb2&&(_0x3deb60['roots']['remove'](_0x906be1),_0x3deb60['createRoot'](_0xebccb2,_0x906be1));}}_addPendingAction(){if(!this['_pendingAction']){const _0x45f321=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x45f321['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x266780){const _0x451456=this['repository']['getRevisions']();_0x451456['reverse']();let _0x3d343c=0x0;for(;_0x3d343c<_0x451456['length'];){const _0x4ddfe4=_0x451456[_0x3d343c];if(_0x4ddfe4===this['currentRevision']){_0x3d343c++;continue;}if(_0x4ddfe4['id']===this['_initialRevisionId'])break;const _0x56f3ae=_0x266780['toVersion']-_0x4ddfe4['toVersion']||_0x266780['fromVersion']-_0x4ddfe4['fromVersion'];if(_0x56f3ae>0x0)break;if(_0x56f3ae<0x0)_0x3d343c++;else{if(!_0x266780['creator']&&_0x4ddfe4['creator'])break;if(_0x4ddfe4['creator']||!_0x266780['creator']){if(_0x266780['createdAt']>_0x4ddfe4['createdAt'])break;_0x3d343c++;}else _0x3d343c++;}}return _0x3d343c;}_getFromVersion(_0x39c3bb){const _0x24ff05=this['repository']['getRevisions']();_0x24ff05['reverse'](),_0x24ff05['shift']();const _0x107eb2=_0x24ff05['find'](_0x14b848=>_0x14b848['toVersion']<=_0x39c3bb)['toVersion'];return _0x107eb2<this['_startingVersion']?this['_startingVersion']:_0x107eb2;}['_makeRevision']({name:_0x499e0b,from:_0x1b2bf9,to:_0x10ef18,creatorId:_0x37b5f6,id:_0x3e8c91}){const _0x3e4c39=this['buildRevisionData']({'from':_0x1b2bf9,'to':_0x10ef18});_0x3e4c39['name']=_0x499e0b,_0x3e4c39['creatorId']=_0x37b5f6,_0x3e4c39['id']=_0x3e8c91;const _0x3eacf7=this['addRevisionData'](_0x3e4c39);return this['adapter']&&this['_bufferUpdate'](_0x3e4c39['id'],_0x3e4c39,!0x0),_0x3eacf7;}_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(_0x9e06b5){this['editor']=_0x9e06b5,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(_0x3226fc){this['source']=_0x3226fc;const _0x4d8a4c=new Map(),_0x5217dc=new Map(),_0xd518f5=this['editor']['model']['document']['roots']['map'](_0x317a41=>_0x317a41['rootName']);for(const _0xca0a6 of _0xd518f5){const _0x13c497=this['editor']['model']['document']['getRoot'](_0xca0a6),_0x3667b4=St(_0x13c497);_0x4d8a4c['set'](_0xca0a6,_0x3667b4),_0x5217dc['set'](_0xca0a6,Object['fromEntries'](_0x13c497['getAttributes']()));}const _0x2f6732=Array['from'](this['editor']['model']['markers'])['map'](_0x5d8ffc=>[_0x5d8ffc['name'],_0x5d8ffc['getRange']()]),_0x456911=this['source']['version'];this['_saveMetaData'](_0x456911,_0x4d8a4c,_0x2f6732,_0x5217dc),this['_startingRevisionId']=this['_revisionId'];const _0x17691f=new Map(),_0x3f24cb=new Map();for(const _0x395503 of _0xd518f5){const _0x5bde14=Et(_0x395503,this['editor']['model']['document']['getRoot'](_0x395503)['name']);_0x17691f['set'](_0x395503,_0x5bde14),_0x3f24cb['set'](_0x395503,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x17691f,[],_0x3f24cb);}getData(_0x237fa1,_0x2973fc){if(this['_lastFrom']===_0x237fa1&&this['_lastTo']<=_0x2973fc)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x2973fc,!0x0);else{if(!this['_savedMetaData']['has'](_0x237fa1)){const _0x36b6be=this['_getPreviousFrom'](_0x237fa1);this['_calculateMetaData'](_0x36b6be,_0x237fa1,!0x1);}this['_calculateMetaData'](_0x237fa1,_0x2973fc,!0x0);}return this['_lastFrom']=_0x237fa1,this['_lastTo']=_0x2973fc,this['_getState']();}loadState(_0x820279){if(!this['_savedMetaData']['has'](_0x820279['fromVersion'])){const _0x11b4d7=this['_getPreviousFrom'](_0x820279['fromVersion']);this['_calculateMetaData'](_0x11b4d7,_0x820279['fromVersion'],!0x1);}this['_calculateMetaData'](_0x820279['fromVersion'],_0x820279['toVersion'],!0x1);const _0xed68fa=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x820279['fromVersion'],this['_lastTo']=_0x820279['toVersion'];for(const _0x548399 in _0x820279['diffData']){const _0x349361=_0x820279['diffData'][_0x548399]['attachChange'],_0x56a693=_0x346ba8(_0x820279['diffData'][_0x548399]['attributesBefore'])||{},_0x112418=_0x820279['diffData'][_0x548399],_0x23e99b=_0xed68fa['_makeModelFromViewString'](_0x112418['deletions'],_0x112418['rootElementName']||'$root');_0x23e99b['rootName']=_0x548399,_0x23e99b['_isAttached']=!_0x349361||!_0x349361['isAttached'],_0x23e99b['isAttached']=()=>_0x23e99b['_isAttached'],this['_baseRoots']['set'](_0x548399,_0x23e99b),this['_baseRootsAttributes']['set'](_0x548399,_0x56a693),_0x349361&&this['_touchedRoots']['set'](_0x548399,_0x349361);const _0x1b4e8d=this['_makeIdsRoot'](_0x23e99b);this['_baseIdsRoots']['set'](_0x548399,_0x1b4e8d);for(const [_0x916544,_0xacf40d]of _0x23e99b['markers']){if(!_0x916544['startsWith']('revision:'))continue;const _0x54c7bd=_0x916544['split'](':')[0x2],_0xee82bf=_0x112418['aiSources']?.[_0x916544]||null;for(const _0x377923 of _0xacf40d['getWalker']({'singleCharacters':!0x0})){const _0x18868e=this['_getVidAttributeName'](_0x377923),_0x532e80='elementEnd'==_0x377923['type']?_0x377923['previousPosition']['path']['slice'](0x0,-0x1):_0x377923['previousPosition']['path'],_0x49d7e9=_0x1b4e8d['getNodeByPath'](_0x532e80)['getAttribute'](_0x18868e);this['_touched']['set'](_0x49d7e9,{'userId':_0x54c7bd,'aiSource':_0xee82bf});}_0x23e99b['markers']['delete'](_0x916544);}}this['_startingRevisionId']=this['_revisionId'];const _0xe758d9=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x5cc23c=>!this['_touched']['has'](_0x5cc23c));let _0x45b0f7=0x0;const _0x37c4c6=new Map();for(const _0x449d35 in _0x820279['diffData']){const _0x586bbd=_0x820279['diffData'][_0x449d35]['attachChange'],_0x455b2f=_0x346ba8(_0x820279['diffData'][_0x449d35]['attributesAfter'])||{},_0x5eafdb=_0x820279['diffData'][_0x449d35],_0x32b3f6=_0xed68fa['_makeModelFromViewString'](_0x5eafdb['insertions'],_0x5eafdb['rootElementName']||'$root');_0x32b3f6['rootName']=_0x449d35,_0x32b3f6['_isAttached']=!_0x586bbd||_0x586bbd['isAttached'],_0x32b3f6['isAttached']=()=>_0x32b3f6['_isAttached'],this['_diffRoots']['set'](_0x449d35,_0x32b3f6),this['_diffRootsAttributes']['set'](_0x449d35,_0x455b2f);const _0x941c68=this['_makeIdsRoot'](_0x32b3f6,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x449d35,_0x941c68),_0x37c4c6['set'](_0x449d35,_0x32b3f6['isAttached']()?_0x455b2f:{});for(const [_0x214af4,_0x3a7cdb]of _0x32b3f6['markers']){if(!_0x214af4['startsWith']('revision:'))continue;const _0x1fc3bc=_0x214af4['split'](':')[0x2],_0x3bb6d5=_0x5eafdb['aiSources']?.[_0x214af4]||null;for(const _0x490f45 of _0x3a7cdb['getWalker']({'singleCharacters':!0x0})){const _0x1db6a6=this['_getVidAttributeName'](_0x490f45),_0x5d89be=this['_revisionId']++,_0x121e34='elementEnd'==_0x490f45['type']?_0x490f45['previousPosition']['path']['slice'](0x0,-0x1):_0x490f45['previousPosition']['path'];_0x941c68['getNodeByPath'](_0x121e34)['_setAttribute'](_0x1db6a6,_0x5d89be),this['_touched']['set'](_0x5d89be,{'userId':_0x1fc3bc,'aiSource':_0x3bb6d5});}_0x32b3f6['markers']['delete'](_0x214af4);}for(const _0x341899 of this['editor']['model']['createRangeIn'](_0x32b3f6)['getWalker']({'singleCharacters':!0x0})){const _0x46b573=this['_getVidAttributeName'](_0x341899),_0x5d59ff='elementEnd'==_0x341899['type']?_0x341899['previousPosition']['path']['slice'](0x0,-0x1):_0x341899['previousPosition']['path'],_0xd3ef2f=_0x941c68['getNodeByPath'](_0x5d59ff);_0xd3ef2f['getAttribute'](_0x46b573)>0x0||_0xd3ef2f['_setAttribute'](_0x46b573,_0xe758d9[_0x45b0f7++]);}for(const [_0x31a0e5,_0xa9c0dd]of _0x32b3f6['markers'])_0x31a0e5['startsWith']('revision:')||this['_markers']['set'](_0x31a0e5,_0xa9c0dd);}const {roots:_0x2ae2a8}=this['_savedMetaData']['get'](_0x820279['fromVersion']),{roots:_0x2cab53}=this['_savedMetaData']['get'](_0x820279['toVersion']),_0x6da703=St(_0x2ae2a8['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x6da703),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x6da703,Number['NEGATIVE_INFINITY']));const _0x55bf98=St(_0x2cab53['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x55bf98),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x55bf98));const _0x381ed0=Array['from'](this['_diffRoots'])['map'](([_0x375b49,_0x5e1673])=>[_0x375b49,St(_0x5e1673)]);this['_saveMetaData'](this['_lastTo'],_0x381ed0,this['_markers'],_0x37c4c6);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x2e99ad,_0x4f1daa,_0x52bdfd,_0x4221ab){const _0x77584a=new Map(_0x4f1daa),_0x56a978=new Map(_0x346ba8(_0x4221ab)),_0x138134=new Map();for(const [_0x5d3002,_0x2a667e]of _0x52bdfd)_0x138134['set'](_0x5d3002,{'start':_0x2a667e['start']['clone'](),'end':_0x2a667e['end']['clone'](),'rootName':_0x2a667e['root']['rootName']});this['_savedMetaData']['set'](_0x2e99ad,{'roots':_0x77584a,'markers':_0x138134,'rootsAttributes':_0x56a978});}_removeMetaData(_0x18e1a9){this['_savedMetaData']['delete'](_0x18e1a9);}_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(_0x1dcb0b,_0xda10d=null){let _0x399ab1=null;_0x1dcb0b['is']('documentFragment')||(_0x399ab1=new _0x19c548(_0x1dcb0b['name'],{'vid_start':null===_0xda10d?this['_revisionId']++:_0xda10d++}));const _0x3e3cbc=[];for(const _0xfd073f of _0x1dcb0b['getChildren']())if(_0xfd073f['is']('element')){_0x3e3cbc['push'](this['_makeIdsRoot'](_0xfd073f,_0xda10d));const _0x1efa36=_0x3e3cbc[_0x3e3cbc['length']-0x1];null!==_0xda10d&&(_0xda10d=_0x1efa36['is']('element','$text')?_0x1efa36['getAttribute']('vid')+0x1:_0x1efa36['getAttribute']('vid_end')+0x1);}else{for(let _0x513322=0x0;_0x513322<_0xfd073f['offsetSize'];_0x513322++)_0x3e3cbc['push'](new _0x19c548('$text',{'vid':null===_0xda10d?this['_revisionId']++:_0xda10d++}));}if(_0x1dcb0b['is']('documentFragment')){const _0x5f516d=Et(_0x1dcb0b['rootName'],_0x1dcb0b['name']);return _0x5f516d['_insertChild'](0x0,_0x3e3cbc),_0x5f516d;}return _0x399ab1['_setAttribute']('vid_end',null===_0xda10d?this['_revisionId']++:_0xda10d),_0x399ab1['_insertChild'](0x0,_0x3e3cbc),_0x399ab1;}_calculateMetaData(_0x3ea2de,_0x4ccdb9,_0x5eeb4f){this['_reset']();const {roots:_0x3f1304,markers:_0x25bc0d,rootsAttributes:_0x5bfee8}=this['_savedMetaData']['get'](_0x3ea2de);this['_baseRoots']=new Map(_0x3f1304),this['_baseRootsAttributes']=new Map(_0x346ba8(_0x5bfee8));for(const [_0x343a3d,_0x3f47ef]of this['_baseRoots'])if('$graveyard'!==_0x343a3d&&(this['_diffRoots']['set'](_0x343a3d,St(_0x3f47ef)),this['_diffRootsAttributes']=new Map(_0x346ba8(_0x5bfee8)),_0x5eeb4f)){const _0x29b692=this['_revisionId'];this['_idsRoots']['set'](_0x343a3d,this['_makeIdsRoot'](_0x3f47ef)),this['_baseIdsRoots']['set'](_0x343a3d,this['_makeIdsRoot'](_0x3f47ef,_0x29b692));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x5eeb4f&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x1776fd,_0x22b162]of _0x25bc0d){const _0x596004=this['_baseRoots']['get'](_0x22b162['rootName']),_0x456849=this['_diffRoots']['get'](_0x22b162['rootName']),_0x54714f=new _0x31969d(_0x3e4f67(_0x22b162['start'],_0x596004),_0x3e4f67(_0x22b162['end'],_0x596004)),_0x1c0b3d=_0x146304(_0x54714f,_0x456849);_0x596004['markers']['set'](_0x1776fd,_0x54714f),this['_markers']['set'](_0x1776fd,_0x1c0b3d);}this['_applyOperations'](_0x3ea2de,_0x4ccdb9,_0x5eeb4f);}_applyOperations(_0x1dee82,_0x1b13c0,_0x18007f){for(const _0x2fa478 of this['source']['getOperations'](_0x1dee82,_0x1b13c0))this['_handleOperation'](_0x2fa478,_0x18007f);for(const _0x5480ef of this['_diffRoots']['values']())_0x5480ef['markers']['clear']();for(const [_0x163fb8,_0x250e29]of this['_markers'])this['_diffRoots']['get'](_0x250e29['root']['rootName'])['markers']['set'](_0x163fb8,_0x250e29['clone']());const _0x3aca41=new Map(),_0x48bdcb=new Map();for(const [_0xddc765,_0x39859f]of this['_diffRoots'])_0x3aca41['set'](_0xddc765,St(_0x39859f)),_0x48bdcb['set'](_0xddc765,this['_diffRootsAttributes']['get'](_0xddc765));this['_saveMetaData'](_0x1b13c0,_0x3aca41,this['_markers'],_0x48bdcb);}_getPreviousFrom(_0x4ee88c){const _0x4bb947=Array['from'](this['_savedMetaData']['keys']());_0x4bb947['sort']((_0x38c8e1,_0x3ae8b8)=>_0x38c8e1-_0x3ae8b8),_0x4bb947['reverse']();for(const _0x24eddb of _0x4bb947)if(_0x24eddb<_0x4ee88c)return _0x24eddb;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x5c8c73,_0x535a64){const _0x53c60f=Array['from'](_0x535a64['markers'])['map'](([_0x25a775,_0x3ae813])=>[_0x25a775,_0x146304(_0x3ae813,_0x5c8c73)]);_0x5c8c73['markers']=new Map(_0x53c60f);}_transformMarkers(_0x24f8f6){for(const _0x3c9576 of this['_markers']['values']()){const _0x32cb7b=_0x3c9576['getTransformedByOperation'](_0x24f8f6),_0x30c39b=_0x31969d['_createFromRanges'](_0x32cb7b);_0x3c9576['start']=_0x30c39b['start'],_0x3c9576['end']=_0x30c39b['end'];}}_handleOperation(_0xb419fb,_0x1ffe83){if('addRoot'!=_0xb419fb['type']&&'detachRoot'!=_0xb419fb['type']){if('insert'==_0xb419fb['type']){const _0x3eeb65=_0xb419fb['position']['root'],_0x5e119c=_0x3eeb65['rootName'],_0x33d78f=_0x3eeb65['name'];this['_diffRoots']['has'](_0x5e119c)||(this['_diffRoots']['set'](_0x5e119c,Et(_0x5e119c,_0x33d78f,!0x0)),this['_diffRootsAttributes']['set'](_0x5e119c,{}),_0x1ffe83&&this['_idsRoots']['set'](_0x5e119c,Et(_0x5e119c,_0x33d78f,!0x0)));}else{if('addRootAttribute'==_0xb419fb['type']||'removeRootAttribute'==_0xb419fb['type']||'changeRootAttribute'==_0xb419fb['type'])return void this['_handleRootAttributeOperation'](_0xb419fb);'marker'==_0xb419fb['type']&&this['_handleMarkerOperation'](_0xb419fb);}if('marker'!==_0xb419fb['type']){const _0xc66f4b=this['_cloneOperation'](_0xb419fb,this['_diffRoots']);_0xc66f4b['_execute'](),this['_transformMarkers'](_0xc66f4b);}if(_0x1ffe83)switch(_0xb419fb['type']){case'insert':this['_handleInsertOperation'](_0xb419fb);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0xb419fb);break;case'merge':this['_handleMergeOperation'](_0xb419fb);break;case'split':this['_handleSplitOperation'](_0xb419fb);}}else this['_handleRootOperation'](_0xb419fb,_0x1ffe83);}_cloneOperation(_0x4e8155,_0x1a3338){const _0x448ee0=_0x4e8155['clone']();return _0x448ee0['_authorId']=_0x4e8155['_authorId'],_0x448ee0['_aiSource']=_0x4e8155['_aiSource'],_0x448ee0['baseVersion']=null,_0x1c16f5(_0x448ee0,_0x1a3338),_0x448ee0;}_getBaseVids(_0x4d3f46){return _0x4d3f46['map'](_0x3c1862=>{const _0x2c00a4=this['_getVidAttributeName'](_0x3c1862);return Number(_0x3c1862['item']['getAttribute'](_0x2c00a4));});}_generateTape(_0x2e01b2,_0x1d3d50){if(_0x2e01b2['is']('element','$text'))_0x1d3d50['push']({'item':_0x2e01b2,'type':'text'});else{_0x2e01b2['is']('element')&&_0x1d3d50['push']({'item':_0x2e01b2,'type':'elementStart'});for(const _0x2588f0 of _0x2e01b2['getChildren']())this['_generateTape'](_0x2588f0,_0x1d3d50);_0x2e01b2['is']('element')&&_0x1d3d50['push']({'item':_0x2e01b2,'type':'elementEnd'});}return _0x1d3d50;}_getState(){const _0x45a73a=new Map(this['_touched']),_0x2868fd=new Map(_0x45a73a),_0x2b8cdb=new Map(),_0x37d9cb={'insertions':{},'deletions':{}},_0x5759c0={'insertions':{},'deletions':{}},_0x544568=new Map(),_0x38ca98=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x28c0e7=new Map();_0x38ca98['delete']('$graveyard');for(const _0x3b08ac of _0x38ca98){const _0x26b6ec=(this['_diffRoots']['get'](_0x3b08ac)??this['_baseRoots']['get'](_0x3b08ac))['name'],_0x50079c=this['_diffRoots']['get'](_0x3b08ac)||Et(_0x3b08ac,_0x26b6ec,!0x1),_0x36f75c=this['_baseRoots']['get'](_0x3b08ac)||Et(_0x3b08ac,_0x26b6ec,!0x1);_0x50079c['isAttached']()||_0x36f75c['isAttached']()?(_0x28c0e7['set'](_0x3b08ac,_0x26b6ec),_0x37d9cb['insertions'][_0x3b08ac]=St(_0x50079c),_0x37d9cb['deletions'][_0x3b08ac]=St(_0x36f75c),this['_copyMarkers'](_0x37d9cb['deletions'][_0x3b08ac],_0x36f75c),this['_copyMarkers'](_0x37d9cb['insertions'][_0x3b08ac],_0x50079c),_0x5759c0['insertions'][_0x3b08ac]=this['_generateTape'](this['_idsRoots']['get'](_0x3b08ac),[]),_0x5759c0['deletions'][_0x3b08ac]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x3b08ac)||Et(_0x3b08ac,_0x26b6ec,!0x1),[])):_0x38ca98['delete'](_0x3b08ac);}for(const _0x1dc7f6 of _0x38ca98){const _0x53bba1=_0x5759c0['insertions'][_0x1dc7f6];for(const _0x36375f of _0x53bba1){const _0x5231e9=this['_getVidAttributeName'](_0x36375f),_0x3693e7=_0x36375f['item']['getAttribute'](_0x5231e9);_0x2868fd['delete'](_0x3693e7),_0x3693e7>=this['_startingRevisionId']&&_0x2b8cdb['set'](_0x3693e7,_0x45a73a['get'](_0x3693e7));}}for(const _0x15111c of _0x38ca98){const _0x2cab99=_0x5759c0['insertions'][_0x15111c],_0xa8f2e2=this['_getBaseVids'](_0x5759c0['deletions'][_0x15111c]);let _0x22b219=0x0;for(const _0x5e5268 of _0x2cab99){const _0x3ad70e=this['_getVidAttributeName'](_0x5e5268),_0x2ddf14=_0x5e5268['item']['getAttribute'](_0x3ad70e);if(!_0x2b8cdb['has'](_0x2ddf14)&&!_0x544568['has'](_0x2ddf14)){if(_0x2868fd['has'](_0x2ddf14))_0x22b219++;else{if(_0x2ddf14!=_0xa8f2e2[_0x22b219]){const _0x4b5e3b=_0x45a73a['get'](_0x2ddf14)||_0x45a73a['get'](_0xa8f2e2[_0x22b219]);for(;_0x2ddf14!=_0xa8f2e2[_0x22b219];)_0x2868fd['has'](_0xa8f2e2[_0x22b219])||(_0x544568['set'](_0xa8f2e2[_0x22b219],_0x4b5e3b),_0x45a73a['set'](_0xa8f2e2[_0x22b219],_0x4b5e3b)),_0x22b219++;}_0x22b219++;}}}}for(const _0x38e034 of _0x38ca98){const _0xe07abd=_0x5759c0['insertions'][_0x38e034];for(const _0x24bf7a of _0xe07abd){const _0xba73b9=this['_getVidAttributeName'](_0x24bf7a),_0x512c81=_0x24bf7a['item']['getAttribute'](_0xba73b9);if(_0x544568['has'](_0x512c81)){const _0x11d6e2=_0x544568['get'](_0x512c81);_0x2868fd['has'](_0x512c81)||_0x2868fd['set'](_0x512c81,{..._0x11d6e2}),_0x2b8cdb['set'](_0x512c81,{..._0x11d6e2});}}}for(const _0x6a1bf1 of _0x2868fd['keys']())_0x6a1bf1>=this['_startingRevisionId']&&_0x2868fd['delete'](_0x6a1bf1);const _0xaf0ec3=new Map();for(const _0x1cbc27 of _0x38ca98){let _0x127764=_0x5759c0['insertions'][_0x1cbc27];for(const _0x39798c of _0x127764)if(_0x39798c['item']['is']('element','tableCell')){const _0x4100df=this['_getVidAttributeName'](_0x39798c),_0x1ae1b5=_0x39798c['item']['getAttribute'](_0x4100df);if(_0x2b8cdb['has'](_0x1ae1b5)){const _0x50bce9=_0x39798c['item']['parent']['parent']['getAttribute']('vid_start'),_0x205ca0=_0x2b8cdb['get'](_0x1ae1b5),_0x59c2d7=_0xaf0ec3['get'](_0x50bce9)||{'users':new Set(),'aiSource':null};_0x59c2d7['users']['add'](_0x205ca0['userId']),_0x59c2d7['aiSource']=_0x59c2d7['aiSource']||_0x205ca0['aiSource']||null,_0xaf0ec3['set'](_0x50bce9,_0x59c2d7);}}_0x127764=_0x5759c0['deletions'][_0x1cbc27];for(const _0x4e8413 of _0x127764)if(_0x4e8413['item']['is']('element','tableCell')){const _0x2a1571=this['_getVidAttributeName'](_0x4e8413),_0x5d9724=_0x4e8413['item']['getAttribute'](_0x2a1571);if(_0x2868fd['has'](_0x5d9724)){const _0x52274c=_0x4e8413['item']['parent']['parent']['getAttribute']('vid_start'),_0x479754=_0x2868fd['get'](_0x5d9724),_0x396d00=_0xaf0ec3['get'](_0x52274c)||{'users':new Set(),'aiSource':null};_0x396d00['users']['add'](_0x479754['userId']),_0x396d00['aiSource']=_0x396d00['aiSource']||_0x479754['aiSource']||null,_0xaf0ec3['set'](_0x52274c,_0x396d00);}}for(const _0x339bbe of _0xaf0ec3['keys']())(_0x2b8cdb['has'](_0x339bbe)||_0x2868fd['has'](_0x339bbe))&&_0xaf0ec3['delete'](_0x339bbe);}for(const _0x5d46de of _0x38ca98){const _0x2124bd=_0x5759c0['insertions'][_0x5d46de];let _0x275322=null,_0x281cc5=null,_0x4afb3f=null;for(const _0x5e6f9e of _0x2124bd){const _0x195f57=this['_getVidAttributeName'](_0x5e6f9e),_0x5f467c=_0x5e6f9e['item']['getAttribute'](_0x195f57),_0x526b43=_0xaf0ec3['get'](_0x5f467c);if(_0x526b43&&'elementStart'==_0x5e6f9e['type']&&(_0x275322=Array['from'](_0x526b43['users'])[0x0],_0x281cc5=_0x526b43['aiSource'],_0x4afb3f=_0x5e6f9e['item']['getAttribute']('vid_end')),_0x275322){const _0xe740bc=_0x281cc5||_0x2868fd['get'](_0x5f467c)?.['aiSource']||null,_0x271707=_0x281cc5||_0x2b8cdb['get'](_0x5f467c)?.['aiSource']||null;_0x2868fd['set'](_0x5f467c,{'userId':_0x275322,'aiSource':_0xe740bc}),_0x2b8cdb['set'](_0x5f467c,{'userId':_0x275322,'aiSource':_0x271707});}_0x5f467c==_0x4afb3f&&(_0x275322=null,_0x4afb3f=null);}}const _0x107a93={},_0x14fbba=new Set();for(const _0x30c622 of _0x38ca98){const _0x5f716b=_0x37d9cb['deletions'][_0x30c622],_0x389bb7=_0x37d9cb['insertions'][_0x30c622];for(const {userId:_0x51f7fd}of this['_touchedMarkers']['values']())null!==_0x51f7fd&&_0x14fbba['add'](_0x51f7fd);for(const {userId:_0x3bd4b9}of this['_touchedRoots']['values']())null!==_0x3bd4b9&&_0x14fbba['add'](_0x3bd4b9);const _0x3ce816={};this['_markChanges'](_0x389bb7,_0x5759c0['insertions'][_0x30c622],_0x2b8cdb,'insertion',_0x14fbba,_0x3ce816),this['_markChanges'](_0x5f716b,_0x5759c0['deletions'][_0x30c622],_0x2868fd,'deletion',_0x14fbba,_0x3ce816),this['_collectSuggestionAiSources'](_0x389bb7,_0x3ce816),this['_collectSuggestionAiSources'](_0x5f716b,_0x3ce816),_0x107a93[_0x30c622]={'insertions':this['_prepareViewToSave'](_0x389bb7),'deletions':this['_prepareViewToSave'](_0x5f716b),'attachChange':this['_touchedRoots']['get'](_0x30c622)||null,'attributesBefore':_0x346ba8(this['_baseRootsAttributes']['get'](_0x30c622))||{},'attributesAfter':_0x346ba8(this['_diffRootsAttributes']['get'](_0x30c622)),'rootElementName':_0x28c0e7['get'](_0x30c622),'aiSources':_0x3ce816};}const _0x1e2a6d=Array['from'](_0x2b8cdb['values']())['some'](_0x30008f=>!(!_0x30008f||!_0x30008f['aiSource']))||Array['from'](_0x2868fd['values']())['some'](_0xbf060e=>!(!_0xbf060e||!_0xbf060e['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x1193cd=>this['_aiTouchedMarkers']['has'](_0x1193cd));return{'diffData':_0x107a93,'authorsIds':Array['from'](_0x14fbba),'hasAIChanges':_0x1e2a6d};}_collectSuggestionAiSources(_0x3ca32b,_0x215484){const _0x39d065=_0x3ca32b['markers'];for(const _0x88dce6 of _0x39d065['keys']()){if(!_0x88dce6['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x88dce6))continue;const _0x4e321e=this['_aiTouchedMarkers']['get'](_0x88dce6);_0x4e321e&&(_0x215484[_0x88dce6]=_0x4e321e);}}_processRootBeforeSave(_0x5b0b46){for(const [,_0x2ba3c5]of _0x5b0b46['markers']){const _0x5cf961=_0x2ba3c5['start']['getAncestors']()['filter'](_0x2c3c24=>'tableCell'==_0x2c3c24['name']);for(const _0x7c0e88 of _0x5cf961)0x1==_0x7c0e88['childCount']&&_0x7c0e88['getChild'](0x0)['is']('element','paragraph')&&_0x7c0e88['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x477532){this['_processRootBeforeSave'](_0x477532);const _0x310a45=this['editor']['data']['toView'](_0x477532,{}),_0x10da7f=Array['from'](_0x310a45['getChildren']())['map'](_0x153400=>this['_getViewJson'](_0x153400));return JSON['stringify'](_0x10da7f);}_getViewJson(_0x3d11b5){if(_0x3d11b5['is']('$text'))return _0x3d11b5['data'];{const _0x245ba8=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x330b64=_0x3d11b5,_0x36e0b5=this['editor']['data']['htmlProcessor']['domConverter'],_0x399ad6={'type':_0x245ba8['_getTypeCharForViewElement'](_0x330b64),'name':_0x330b64['name'],'attributes':Array['from'](_0x330b64['getAttributes']()),'children':Array['from'](_0x330b64['getChildren']())['map'](_0x1b2cb6=>this['_getViewJson'](_0x1b2cb6))};if(_0x3d11b5['is']('uiElement')&&'$comment'!=_0x3d11b5['name']){const _0x4c93d7=_0x3d11b5['render'](_0x36e0b5['domDocument'],_0x36e0b5);_0x399ad6['children']['push'](_0x4c93d7['outerHTML']);}else{if(_0x3d11b5['is']('rawElement')){const _0xa670e1=_0x36e0b5['domDocument']['createElement'](_0x330b64['name']);_0x3d11b5['render'](_0xa670e1,_0x36e0b5),_0x399ad6['children']['push'](_0xa670e1['innerHTML']);}}const _0xd279de=Array['from'](_0x330b64['getCustomProperties']());_0xd279de['length']>0x0&&(_0x399ad6['customProperties']=_0xd279de);const _0x1b6e8d=_0x330b64['getFillerOffset']();return null!==_0x1b6e8d&&(_0x399ad6['fillerOffset']=_0x1b6e8d),_0x399ad6;}}['_markChanges'](_0x1a3da9,_0x57a0d5,_0x3e1b4f,_0x264bc2,_0x43d25d,_0x9ff15){let _0x4c6598=null,_0x327877=null,_0x3e727c=0x0;const _0x171012=this['editor']['model'];for(let _0x468640=0x0;_0x468640<_0x57a0d5['length'];_0x468640++){const _0x9f0304=this['_getVidAttributeName'](_0x57a0d5[_0x468640]),_0x419557=_0x57a0d5[_0x468640]['item']['getAttribute'](_0x9f0304),_0x4a78f8=_0x3e1b4f['get'](_0x419557),_0x3eff9d=_0x468640==_0x57a0d5['length']-0x1;!_0x4c6598&&_0x4a78f8&&(_0x4c6598=_0x4a78f8,_0x327877=_0x57a0d5[_0x468640]);const _0x212d23=!!_0x4c6598&&!!_0x4a78f8&&_0x4a78f8['userId']!=_0x4c6598['userId'],_0x35ab32=!!_0x4c6598&&!!_0x4a78f8&&_0x4a78f8['aiSource']!=_0x4c6598['aiSource'];_0x4c6598&&(!_0x4a78f8||_0x212d23||_0x35ab32)&&(_0x873e73(_0x4a78f8,Ot(_0x327877,_0x1a3da9,_0x171012),Ot(_0x57a0d5[_0x468640],_0x1a3da9,_0x171012)),_0x4c6598=_0x4a78f8||null,_0x327877=_0x4a78f8?_0x57a0d5[_0x468640]:null),_0x4c6598&&_0x3eff9d&&_0x873e73(_0x4a78f8,Ot(_0x327877,_0x1a3da9,_0x171012),Ct(_0x57a0d5[_0x468640],_0x1a3da9,_0x171012));}function _0x873e73(_0xf9b43f,_0x3edfb3,_0x45eaa9){const _0x252deb=_0x4c6598['userId'],_0xf859f8=_0x4c6598['aiSource'],_0x4024d0='revision:'+_0x264bc2+':'+_0x252deb+':'+_0x3e727c++,_0x17282e=_0x171012['createRange'](_0x3edfb3,_0x45eaa9);_0x1a3da9['markers']['set'](_0x4024d0,_0x17282e),_0xf859f8&&(_0x9ff15[_0x4024d0]=_0xf859f8),null!==_0x252deb&&_0x43d25d['add'](_0x252deb);}}_getVidAttributeName(_0x4d15a6){switch(_0x4d15a6['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x1b6625){const _0x5b5c85=this['_idsRoots']['get'](_0x1b6625['position']['root']['rootName']),_0x3de03a=_0x3e4f67(_0x1b6625['position'],_0x5b5c85),_0x50feaa=null===_0x1b6625['_authorId']?null:_0x1b6625['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x8d775=_0x1b6625['_aiSource']||null,_0x2f7075=_0x3de03a['parent'],_0x3893fa=this['_revisionId'],_0x4601c0=[];for(const _0x4be8ba of _0x1b6625['nodes'])if(_0x4be8ba['is']('element'))_0x4601c0['push'](this['_makeIdsRoot'](_0x4be8ba));else{for(let _0x3c2783=0x0;_0x3c2783<_0x4be8ba['offsetSize'];_0x3c2783++)_0x4601c0['push'](new _0x19c548('$text',{'vid':this['_revisionId']++}));}const _0x2fa530=this['_revisionId'];for(let _0x433669=_0x3893fa;_0x433669<_0x2fa530;_0x433669++)this['_touched']['set'](_0x433669,{'userId':_0x50feaa,'aiSource':_0x8d775});_0x2f7075['_insertChild'](_0x3de03a['offset'],_0x4601c0);}_setTouched(_0x34c2e7,_0x582004,_0x4254c7){this['_touched']['set'](_0x34c2e7,{'userId':_0x582004,'aiSource':_0x4254c7||this['_touched']['get'](_0x34c2e7)?.['aiSource']||null});}_handleMoveOperation(_0x3eb1a4){(_0x3eb1a4=this['_cloneOperation'](_0x3eb1a4,this['_idsRoots']))['_execute']();const _0x39a781=null===_0x3eb1a4['_authorId']?null:_0x3eb1a4['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xe3a71e=_0x3eb1a4['_aiSource']||null,_0x113906=_0x3eb1a4['getMovedRangeStart'](),_0x89ed2e=_0x113906['parent'],_0x4703f2=_0x113906['offset'],_0x5901ba=(_0x402721,_0x1a054b,_0x2626b9)=>{for(let _0x1dbd75=_0x1a054b;_0x1dbd75<_0x2626b9;_0x1dbd75++){const _0x487fc0=_0x402721['getChild'](_0x1dbd75);_0x487fc0['is']('element','$text')?this['_setTouched'](_0x487fc0['getAttribute']('vid'),_0x39a781,_0xe3a71e):(this['_setTouched'](_0x487fc0['getAttribute']('vid_start'),_0x39a781,_0xe3a71e),_0x5901ba(_0x487fc0,0x0,_0x487fc0['childCount']),this['_setTouched'](_0x487fc0['getAttribute']('vid_end'),_0x39a781,_0xe3a71e));}};_0x5901ba(_0x89ed2e,_0x4703f2,_0x4703f2+_0x3eb1a4['howMany']);}_handleMergeOperation(_0x1e4b66){const _0x331986=null===(_0x1e4b66=this['_cloneOperation'](_0x1e4b66,this['_idsRoots']))['_authorId']?null:_0x1e4b66['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x55ccaf=_0x1e4b66['_aiSource']||null,_0xfba969=_0x1e4b66['targetPosition']['parent'],_0x4ed0fa=_0x1e4b66['sourcePosition']['parent'],_0x4dfaaf=_0xfba969['getAttribute']('vid_end'),_0x29d89d=_0x4ed0fa['getAttribute']('vid_start');_0xfba969['_setAttribute']('vid_end',_0x4ed0fa['getAttribute']('vid_end')),_0x4ed0fa['_setAttribute']('vid_end',_0x4dfaaf),this['_setTouched'](_0x29d89d,_0x331986,_0x55ccaf),this['_setTouched'](_0x4dfaaf,_0x331986,_0x55ccaf),_0x1e4b66['_execute']();}_handleSplitOperation(_0x31c3de){const _0x134b4d=null===(_0x31c3de=this['_cloneOperation'](_0x31c3de,this['_idsRoots']))['_authorId']?null:_0x31c3de['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2a45df=_0x31c3de['_aiSource']||null,_0xca235b=_0x31c3de['graveyardPosition'],_0x16cac5=_0x31c3de['splitPosition']['parent'];_0x31c3de['_execute']();const _0x55aebb=_0x16cac5['getAttribute']('vid_end'),_0x27d7d9=_0x31c3de['insertionPosition']['nodeAfter'];if(_0xca235b){const _0x56ad5c=_0x27d7d9['getAttribute']('vid_end'),_0x58e212=_0x16cac5['getAttribute']('vid_end');_0x16cac5['_setAttribute']('vid_end',_0x56ad5c),_0x27d7d9['_setAttribute']('vid_end',_0x58e212),this['_setTouched'](_0x16cac5['getAttribute']('vid_end'),_0x134b4d,_0x2a45df),this['_setTouched'](_0x27d7d9['getAttribute']('vid_start'),_0x134b4d,_0x2a45df);}else{const _0x401f3a=this['_revisionId']++,_0x2ace6e=this['_revisionId']++;_0x16cac5['_setAttribute']('vid_end',_0x401f3a),_0x27d7d9['_setAttribute']('vid_start',_0x2ace6e),_0x27d7d9['_setAttribute']('vid_end',_0x55aebb),this['_setTouched'](_0x401f3a,_0x134b4d,_0x2a45df),this['_setTouched'](_0x2ace6e,_0x134b4d,_0x2a45df);}}_handleMarkerOperation(_0x498a43){if(!_0x498a43['affectsData'])return;const _0x2d0f39=(_0x498a43=this['_cloneOperation'](_0x498a43,this['_diffRoots']))['oldRange']?_0x498a43['oldRange']['root']:null,_0x58bcd3=_0x498a43['newRange']?_0x498a43['newRange']['root']:null;_0x2d0f39&&this['_markers']['delete'](_0x498a43['name']),_0x58bcd3&&this['_markers']['set'](_0x498a43['name'],_0x498a43['newRange']['clone']());const _0x4ac08e=null===_0x498a43['_authorId']?null:_0x498a43['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x3ccffe=_0x498a43['name'];if(_0x498a43['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x3ccffe,_0x498a43['_aiSource']),!this['_touchedMarkers']['has'](_0x3ccffe))return void this['_touchedMarkers']['set'](_0x3ccffe,{'range':_0x498a43['oldRange'],'userId':_0x4ac08e});const _0x3868e5=this['_touchedMarkers']['get'](_0x3ccffe),_0x498cec=_0x3868e5['range'],_0x530eb6=_0x498a43['newRange'];null==_0x498cec&&null==_0x530eb6||_0x498cec&&_0x530eb6&&_0x498cec['isEqual'](_0x530eb6)?this['_touchedMarkers']['delete'](_0x498a43['name']):_0x3868e5['userId']=_0x4ac08e;}_handleRootOperation(_0x2bf07c,_0x5a5834){this['_diffRoots']['has'](_0x2bf07c['rootName'])?this['_diffRoots']['get'](_0x2bf07c['rootName'])['_isAttached']=_0x2bf07c['isAdd']:(this['_diffRoots']['set'](_0x2bf07c['rootName'],Et(_0x2bf07c['rootName'],_0x2bf07c['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x2bf07c['rootName'],{}),_0x5a5834&&this['_idsRoots']['set'](_0x2bf07c['rootName'],Et(_0x2bf07c['rootName'],_0x2bf07c['elementName'],!0x0)));const _0x167e79=null===_0x2bf07c['_authorId']?null:_0x2bf07c['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x5abb66=this['_touchedRoots']['get'](_0x2bf07c['rootName']);_0x5abb66&&_0x5abb66['userId']===_0x167e79?this['_touchedRoots']['delete'](_0x2bf07c['rootName']):this['_touchedRoots']['set'](_0x2bf07c['rootName'],{'userId':_0x167e79,'isAttached':_0x2bf07c['isAdd']});}_handleRootAttributeOperation(_0x5937ac){const _0x3d302c=this['_diffRootsAttributes']['get'](_0x5937ac['root']['rootName']);null===_0x5937ac['newValue']?delete _0x3d302c[_0x5937ac['key']]:_0x3d302c[_0x5937ac['key']]=_0x5937ac['newValue'];}};function St(_0x1feeeb){const _0x186626=Et(_0x1feeeb['rootName'],_0x1feeeb['name'],_0x1feeeb['isAttached']());for(const _0x1de001 of _0x1feeeb['getChildren']()){const _0x27d0c4=_0x1de001['_clone'](!0x0);_0x186626['_appendChild'](_0x27d0c4);}return _0x186626;}function Et(_0x28772e,_0x949fff,_0x36601c=!0x0){const _0x85e067=new _0x3bdc31();return _0x85e067['rootName']=_0x28772e,_0x85e067['name']=_0x949fff,_0x85e067['_isAttached']=_0x36601c,_0x85e067['isAttached']=()=>_0x85e067['_isAttached'],_0x85e067;}function Ot(_0x2462a9,_0x4b14f9,_0x62ef08){const _0x82a28='elementEnd'==_0x2462a9['type']?_0x62ef08['createPositionAt'](_0x2462a9['item'],'end'):_0x62ef08['createPositionBefore'](_0x2462a9['item']);return _0x62ef08['createPositionFromPath'](_0x4b14f9,_0x82a28['path'],_0x82a28['stickiness']);}function Ct(_0x5e1da2,_0x1643c3,_0x2e2d47){const _0x14287d='elementStart'==_0x5e1da2['type']?_0x2e2d47['createPositionAt'](_0x5e1da2['item'],0x0):_0x2e2d47['createPositionAfter'](_0x5e1da2['item']);return _0x2e2d47['createPositionFromPath'](_0x1643c3,_0x14287d['path'],_0x14287d['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
25
+ _0x1dd50d(dt);var xt=class extends Nt{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0xda416c,_0x5da1e5){super(_0xda416c),this['focusTracker']=new _0x4e4794(),this['keystrokes']=new _0x53888f(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x5da1e5),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 _0x22419a=_0x2bf4fc=>_0x2bf4fc['stopPropagation']();this['keystrokes']['set']('arrowright',_0x22419a),this['keystrokes']['set']('arrowleft',_0x22419a),this['keystrokes']['set']('arrowup',_0x22419a),this['keystrokes']['set']('arrowdown',_0x22419a);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x5e061b){this['revisionNameInputView']['fieldView']['element']['value']=_0x5e061b['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x19a134){const _0x572cf6=new it(this['locale'],gt),_0x31e001=_0x572cf6['fieldView'];_0x31e001['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x315378=kt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x19a134&&(_0x315378+='\x20('+kt(this['locale'],'optional')+')'),(_0x572cf6['label']=_0x315378,_0x31e001['on']('input',()=>{this['revisionNameInputValue']=_0x31e001['element']['value']['trim']();}),_0x572cf6);}},Dt=class extends _0x544bf8{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At];}['_saveRevisionFormView'];init(){const _0x676b8e=this['editor'],_0x67a427=_0x676b8e['plugins']['get']('RevisionTracker');_0x676b8e['ui']['componentFactory']['add']('revisionHistory',_0x35d2a3=>{const _0x1673fc=vt(_0x35d2a3),_0x23b037=_0x1673fc['panelView']['children'],_0x101e47=new st(_0x35d2a3),_0x4cfde0=new et(_0x35d2a3),_0x51af70=this['_createSaveRevisionButton'](_0xefa108),_0x296928=new et(_0x35d2a3),_0x27f533=this['_createOpenRevisionButton'](_0xefa108);return _0x1673fc['bind']('isEnabled')['to'](_0x67a427,'isReady',_0x67a427,'isEnabled',_0x676b8e,'isReadOnly',(_0x1feac3,_0xbc7ecd,_0x129426)=>_0x1feac3&&_0xbc7ecd&&!_0x129426),_0x1673fc['buttonView']['set']({'icon':_0x1cebb3,'label':kt(_0x35d2a3,'Revision\x20history'),'tooltip':!0x0}),_0x51af70['set']({'withText':!0x0,'role':'menuitem'}),_0x27f533['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x27f533,'execute',()=>{_0x1673fc['isOpen']=!0x1,_0x676b8e['editing']['view']['focus']();},{'priority':'low'}),_0x4cfde0['children']['add'](_0x51af70),_0x296928['children']['add'](_0x27f533),_0x101e47['role']='menu',_0x101e47['items']['addMany']([_0x4cfde0,_0x296928]),_0x23b037['add'](_0x101e47),_0x1673fc;}),_0x676b8e['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x221a8a=this['editor'],_0x131f9c=_0x221a8a['locale'],_0x2aa5ae=_0x221a8a['plugins']['get']('RevisionTracker'),_0x542ce7=new at(_0x131f9c),_0x5098f5=new rt(_0x131f9c);_0x542ce7['bind']('isEnabled')['to'](_0x2aa5ae,'isReady',_0x2aa5ae,'isEnabled',_0x221a8a,'isReadOnly',(_0x140c13,_0x5312c8,_0x14cfa6)=>_0x140c13&&_0x5312c8&&!_0x14cfa6),_0x542ce7['buttonView']['set']({'icon':_0x1cebb3,'label':kt(_0x131f9c,'Revision\x20history')});const _0x51f85f=new ot(_0x131f9c,_0x542ce7),_0x6b83c0=this['_createSaveRevisionButton'](nt);_0x6b83c0['delegate']('execute')['to'](_0x542ce7),_0x51f85f['children']['add'](_0x6b83c0),_0x5098f5['items']['add'](_0x51f85f);const _0x29da1c=new ot(_0x131f9c,_0x542ce7),_0x1b2007=this['_createOpenRevisionButton'](nt);return _0x1b2007['delegate']('execute')['to'](_0x542ce7),_0x29da1c['children']['add'](_0x1b2007),_0x5098f5['items']['add'](_0x29da1c),_0x542ce7['panelView']['children']['add'](_0x5098f5),_0x542ce7;}_createSaveRevisionButton(_0xb2d989){const _0x2e7619=this['editor'],_0x1d081d=_0x2e7619['plugins']['get']('RevisionTracker'),_0x57a79c=new _0xb2d989(_0x2e7619['locale']);return _0x57a79c['set']({'label':kt(_0x2e7619['locale'],'Save\x20current\x20revision')}),_0x57a79c['bind']('isEnabled')['to'](_0x1d081d,'isReady',_0x1d081d,'isEnabled',_0x2e7619,'isReadOnly',(_0x95a641,_0x31e4e6,_0x198f81)=>_0x95a641&&_0x31e4e6&&!_0x198f81),this['listenTo'](_0x57a79c,'execute',()=>{this['_showDialog']();}),_0x57a79c;}_createOpenRevisionButton(_0x9cf5d2){const _0x14dbe7=this['editor'],_0x418840=_0x14dbe7['plugins']['get']('RevisionTracker'),_0x5bfde3=new _0x9cf5d2(_0x14dbe7['locale']);return _0x5bfde3['set']({'label':kt(_0x14dbe7['locale'],'Open\x20revision\x20history')}),_0x5bfde3['bind']('isEnabled')['to'](_0x418840,'isReady',_0x14dbe7,'isReadOnly',(_0x49cfae,_0x59569c)=>_0x49cfae&&!_0x59569c),this['listenTo'](_0x5bfde3,'execute',()=>{_0x14dbe7['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x5bfde3;}['_showDialog'](){const _0x2b58c4=this['editor'],_0x4906e3=_0x2b58c4['locale'],_0x2be0c2=_0x2b58c4['plugins']['get']('Dialog'),_0x435371=_0x2b58c4['plugins']['get']('RevisionTracker');function _0x5410d5(_0x378bb1){_0x2b58c4['config']['get']('revisionHistory.requireRevisionName')&&''===_0x378bb1['revisionName']?_0x378bb1['revisionNameInputView']['errorText']=kt(_0x4906e3,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x2b58c4['plugins']['get'](At)['saveRevision']({'name':_0x378bb1['revisionName']}),_0x2be0c2['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x5410d5(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x2be0c2['show']({'id':'revisionSave','title':kt(_0x4906e3,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':kt(_0x2b58c4['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x2be0c2['hide']()},{'label':kt(_0x2b58c4['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0xb7f7bf){_0xb7f7bf['bind']('isEnabled')['to'](_0x435371,'isReady',_0x435371,'isEnabled',_0x2b58c4,'isReadOnly',(_0x11a87f,_0x32d675,_0x25243f)=>_0x11a87f&&_0x32d675&&!_0x25243f);},'onExecute':()=>_0x5410d5(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0xda876=this['editor'],_0x47ef1d=_0xda876['locale'];this['_saveRevisionFormView']=new xt(_0x47ef1d,_0xda876['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Vt=class extends dt{['changeId'];['_model'];constructor(_0x363a98,_0x1b8245,_0x5b2b7f=!0x1){super(_0x363a98),this['_model']=_0x1b8245,this['changeId']=_0x1b8245['id'];const _0x4f7256=this['bindTemplate'],_0x3b325c=_0x5b2b7f&&!!_0x1b8245['data']['aiSource'],_0x22e39b=_0x3b325c?this['_createAiIconView'](_0x363a98):null;this['set']('type',_0x1b8245['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x4f7256['to']('type',_0x4634fb=>'ck-revision-change__'+_0x4634fb),..._0x3b325c?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x3b325c?[this['_createAiDescriptionView'](_0x363a98,_0x1b8245),_0x22e39b]:this['_getDescriptionChildren'](_0x363a98,_0x1b8245)}]});}_getDescriptionChildren(_0x139134,_0x224ebf){let _0x37eba1='Removed\x20by';return _0x224ebf['data']['isSuggestion']?_0x37eba1='Suggested\x20by':'add'==_0x224ebf['type']&&(_0x37eba1='Added\x20by'),[this['_createLabel'](kt(_0x139134,_0x37eba1)),{'text':'\x20'+_0x224ebf['author']['name']}];}_createAiDescriptionView(_0x429d67,_0x3ff71f){let _0x5a2c58='AI_SOURCE_REMOVED_BY';_0x3ff71f['data']['isSuggestion']?_0x5a2c58='AI_SOURCE_SUGGESTED_BY':'add'==_0x3ff71f['type']&&(_0x5a2c58='AI_SOURCE_ADDED_BY');const _0x150091=new dt(_0x429d67);return _0x150091['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x150091['render'](),_0x150091['element']['innerHTML']=_0x5c60d8(kt(_0x429d67,_0x5a2c58,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+kt(_0x429d67,'AI_SOURCE_AI')+'</span>'])),_0x150091['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x3ff71f['author']['name'],_0x150091;}_createLabel(_0x5b1a20){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x5b1a20}]};}_createAiIconView(_0x36b397){const _0x3232a9=new _0x1d6039();return _0x3232a9['content']=_0x237d30,_0x3232a9['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':kt(_0x36b397,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x3232a9;}['focus'](){this['element']['focus']();}};const Tt=/* #__PURE__ -- @preserve */
26
+ _0x135b6a();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x46873d){super(),this['id']=_0x46873d['id']||_0x240cc1(),this['author']=_0x46873d['author'],this['type']=_0x46873d['type'],this['data']=_0x46873d['data']||{},this['rootName']=_0x46873d['rootName'],this['set']('createdAt',_0x46873d['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(_0x246bdf,_0x522efe){this['newRevisionId']=_0x246bdf,this['oldRevisionId']=_0x522efe,this['changes']=new _0x32a4f2();}_setChanges(_0xfbdbfa){for(const _0x37d24d of _0xfbdbfa)this['changes']['add'](_0x37d24d);}},Pt=class extends _0x544bf8{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[_0x157f26,_0x25d16b,bt,Rt];}constructor(_0x1c3fd7){super(_0x1c3fd7),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',(_0x3e9318,_0x43be07,_0x3a6613)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x4e46ef=>{for(const _0x5b540b of this['editor']['editing']['view']['document']['roots'])_0x3a6613?_0x4e46ef['removeClass']('ck-editor__editable__overlay',_0x5b540b):_0x4e46ef['addClass']('ck-editor__editable__overlay',_0x5b540b);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x25a48c=>null!==_0x25a48c),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x3bfef3,_0x5b6f2d,_0x301349)=>_0x3bfef3&&_0x301349?_0x5b6f2d['changes']['getIndex'](_0x301349):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x4160e5,_0x2f3a15)=>_0x4160e5?_0x2f3a15['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x25d16b),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x3b3002=this['editor'],_0x48bdff=new $t(_0x3b3002,{'direction':'backward'}),_0x37f2cd=new $t(_0x3b3002,{'direction':'forward'});_0x3b3002['commands']['add']('showPreviousChange',_0x48bdff),_0x3b3002['commands']['add']('showNextChange',_0x37f2cd),_0x3b3002['commands']['add']('restoreRevision',new Ft(_0x3b3002)),this['on']('change:numberOfChanges',()=>{_0x48bdff['refresh'](),_0x37f2cd['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x3b3002['enableReadOnlyMode']('revision-viewer'),_0x3b3002['plugins']['has']('WidgetToolbarRepository')&&_0x3b3002['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x184c71){return await this['_utils']['loadRevisionData'](_0x184c71,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x184c71);}async getRevisionRootsAttributes(_0x445131){return await this['_utils']['loadRevisionData'](_0x445131,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x445131);}async['compare'](_0x38d48b,_0x5ced3d,_0x56d7f9=!0x1){if(!this['isEnabled'])return;const _0x1b9546=this['diff'],_0x470004=this['repository'],_0x26b628='string'==typeof _0x38d48b?_0x470004['getRevision'](_0x38d48b):_0x38d48b,_0x140b4f='string'==typeof _0x5ced3d?_0x470004['getRevision'](_0x5ced3d):_0x5ced3d,_0x4ab7c8=_0x26b628['id'],_0x24bf05=_0x140b4f?_0x140b4f['id']:null;if(!_0x56d7f9&&this['diff']&&this['diff']['newRevisionId']===_0x4ab7c8&&this['diff']['oldRevisionId']===_0x24bf05)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x4ab7c8,_0x24bf05);const _0x5490fd=this['_getRevisionsRange'](_0x26b628,_0x140b4f,!0x0)['map'](_0x2ef36c=>this['_utils']['loadRevisionData'](_0x2ef36c,this['adapter']));return _0x5490fd['push'](new Promise(_0x4cfde=>{setTimeout(_0x4cfde,0x14);})),Promise['all'](_0x5490fd)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x397826=this['_getDiff'](_0x4ab7c8,_0x24bf05);this['_cleanUpCommentMarkers'](_0x397826);for(const _0x2e8f04 of _0x397826['changes'])this['_changeIdToChange']['set'](_0x2e8f04['id'],_0x2e8f04);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x4a680e=>{for(const _0x2f9f98 of this['editor']['model']['document']['getRootNames']())_0x4a680e['detachRoot'](_0x2f9f98);for(const _0x4c25db of Object['keys'](_0x397826['model'])){const _0x57217a=_0x397826['model'][_0x4c25db]['name'],_0x2f5310=_0x4a680e['addRoot'](_0x4c25db,_0x57217a);for(const _0x4e28e8 of Object['keys'](_0x397826['attributes'][_0x4c25db]))_0x4a680e['setAttribute'](_0x4e28e8,_0x397826['attributes'][_0x4c25db][_0x4e28e8],_0x2f5310);_0x4a680e['insert'](_0x397826['model'][_0x4c25db],_0x2f5310,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x397826['changes'])),this['isReady']=!0x0;})['catch'](_0x5f5350=>{console['error'](_0x5f5350),this['_cleanUp'](),_0x1b9546&&(this['diff']=_0x1b9546),this['isReady']=!0x0;});}addRevisionData(_0x4abd38,_0x1c94b5){const _0x4220b4=this['repository']['createRevision'](_0x4abd38);return _0x4220b4['on']('_update',(_0xf5b10f,_0x32c16d,_0x100680)=>_0x1c94b5(_0x32c16d,_0x100680,_0x4220b4)),this['repository']['addRevision'](_0x4220b4),_0x4220b4;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x16989b=>{for(const _0x4674ad of this['editor']['model']['document']['getRootNames']())_0x16989b['detachRoot'](_0x4674ad);});}_cleanUpCommentMarkers(_0x537e0a){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x1f5fec=this['_getVisibleCommentThreadIds']();for(const _0x687437 of Object['values'](_0x537e0a['model']))for(const _0x35ca79 of Array['from'](_0x687437['markers']['keys']()))_0x35ca79['startsWith']('revision-comment:')&&!_0x1f5fec['has'](Ut(_0x35ca79))&&_0x687437['markers']['delete'](_0x35ca79);}_sortAndFilterDiffChanges(_0x101ba8){const _0x2ecf35=[],_0x3235dd=new Map();for(const _0xb7aca of this['editor']['model']['document']['getRootNames']()){const _0x46d2dc=this['editor']['editing']['view']['getDomRoot'](_0xb7aca);if(!_0x46d2dc)continue;const _0x2817a9=_0x46d2dc['getClientRects']()['item'](0x0);_0x2817a9&&(_0x2ecf35['push'](_0xb7aca),_0x3235dd['set'](_0xb7aca,_0x2817a9));}return _0x2ecf35['sort']((_0x2138b9,_0x513d88)=>{const _0x383725=_0x3235dd['get'](_0x2138b9),_0x486e7d=_0x3235dd['get'](_0x513d88);return _0x383725['y']-_0x486e7d['y']||_0x383725['x']-_0x486e7d['x'];}),(_0x101ba8=_0x101ba8['filter'](_0x429f8b=>_0x2ecf35['includes'](_0x429f8b['rootName'])))['sort']((_0xf69d53,_0x2adef1)=>_0x2ecf35['indexOf'](_0xf69d53['rootName'])-_0x2ecf35['indexOf'](_0x2adef1['rootName'])),_0x101ba8;}['_makeTape'](_0x56375c,_0x11c2e7={}){const _0x37a39a=Array['from'](_0x56375c['markers'])['filter'](([_0x1e201e,_0x40f1cd])=>_0x1e201e['startsWith']('revision:')&&!_0x40f1cd['isCollapsed']),_0x3b638a=Array['from'](this['editor']['model']['createRangeIn'](_0x56375c)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x37a39a['length'])for(const _0x3c441d of _0x3b638a){const [_0x5dbe3f,_0x3997df]=_0x37a39a[0x0],[,_0x5345e4,_0x9f8496]=_0x5dbe3f['split'](':'),_0xe023a3=_0x11c2e7[_0x5dbe3f]||null;if(_0x3997df['end']['isEqual'](_0x3c441d['nextPosition'])&&_0x37a39a['shift'](),(_0x3c441d['previousPosition']['isEqual'](_0x3997df['start'])||_0x3c441d['previousPosition']['isAfter'](_0x3997df['start']))&&('insertion'==_0x5345e4?_0x3c441d['isAdded']={'userId':_0x9f8496,'aiSource':_0xe023a3}:'deletion'==_0x5345e4&&(_0x3c441d['isRemoved']={'userId':_0x9f8496,'aiSource':_0xe023a3})),0x0==_0x37a39a['length'])break;}return _0x3b638a;}_refreshStartEndIndex(_0x474857){const _0x341f61=new Map();for(let _0x58e973=0x0;_0x58e973<_0x474857['length'];_0x58e973++)'text'===_0x474857[_0x58e973]['type']?(_0x474857[_0x58e973]['item']['startIndex']=_0x58e973,_0x474857[_0x58e973]['item']['endIndex']=_0x58e973):('elementStart'===_0x474857[_0x58e973]['type']?_0x474857[_0x58e973]['item']['startIndex']=_0x58e973:'elementEnd'===_0x474857[_0x58e973]['type']&&(_0x474857[_0x58e973]['item']['endIndex']=_0x58e973),_0x341f61['set'](_0x474857[_0x58e973]['id'],_0x58e973));for(const _0x299399 of _0x341f61['values']())'elementStart'===_0x474857[_0x299399]['type']?_0x474857[_0x299399]['item']['endIndex']=_0x341f61['get'](_0x474857[_0x299399]['pairId']):'elementEnd'===_0x474857[_0x299399]['type']&&(_0x474857[_0x299399]['item']['startIndex']=_0x341f61['get'](_0x474857[_0x299399]['pairId']));}['_processTape'](_0x1aad7f){for(let _0x1586d6=0x0;_0x1586d6<_0x1aad7f['length'];_0x1586d6++){if('elementStart'===_0x1aad7f[_0x1586d6]['type'])_0x1aad7f[_0x1586d6]['item']['startIndex']=_0x1586d6;else{if('elementEnd'===_0x1aad7f[_0x1586d6]['type']){_0x1aad7f[_0x1586d6]['item']['endIndex']=_0x1586d6;const _0x27e8c7=_0x1aad7f[_0x1586d6]['item']['startIndex'];_0x1aad7f[_0x27e8c7]['pairId']=_0x1aad7f[_0x1586d6]['id'],_0x1aad7f[_0x1586d6]['pairId']=_0x1aad7f[_0x27e8c7]['id'];}else _0x1aad7f[_0x1586d6]['item']['startIndex']=_0x1586d6,_0x1aad7f[_0x1586d6]['item']['endIndex']=_0x1586d6,_0x1aad7f[_0x1586d6]['pairId']=null;}_0x1aad7f[_0x1586d6]['markersStart']||(_0x1aad7f[_0x1586d6]['markersStart']=[],_0x1aad7f[_0x1586d6]['markersEnd']=[]);}}_markInsertions(_0x1878cd,_0x711575){const _0x38fe53=_0x1878cd['filter'](_0x377a81=>!_0x377a81['isAdded']);for(let _0x5a76c0=0x0;_0x5a76c0<_0x711575['length'];_0x5a76c0++)_0x711575[_0x5a76c0]['isAdded']&&(_0x38fe53[_0x5a76c0]['isAdded']=_0x711575[_0x5a76c0]['isAdded']);}_getDiff(_0x1c05b8,_0x2c31e6=null){const _0x131006=this['repository']['getRevision'](_0x1c05b8),_0x290355=_0x2c31e6?this['repository']['getRevision'](_0x2c31e6):null,_0x489d2b=this['_getRevisionsRange'](_0x131006,_0x290355),_0x3df9d4=_0x489d2b[_0x489d2b['length']-0x1],_0x1897c4=new Map(),_0x25cfb1={'model':{},'attributes':{},'changes':[]},_0x2fa7b0=new Set(),_0xe216cc=new Map();for(let _0x3042ef=_0x489d2b['length']-0x1;_0x3042ef>=0x0;_0x3042ef--){const _0x12c3d5=_0x489d2b[_0x3042ef];for(const _0x4e27a0 of Object['keys'](_0x12c3d5['diffData']))if(_0x12c3d5['diffData'][_0x4e27a0]['attachChange']){const _0x38508e=_0x12c3d5['diffData'][_0x4e27a0]['attachChange'];_0x38508e['isAttached']?(_0x2fa7b0['add'](_0x4e27a0),_0xe216cc['has'](_0x4e27a0)&&_0xe216cc['get'](_0x4e27a0)['userId']==_0x38508e['userId']?_0xe216cc['delete'](_0x4e27a0):_0xe216cc['set'](_0x4e27a0,_0x38508e)):_0xe216cc['has'](_0x4e27a0)?(_0x2fa7b0['delete'](_0x4e27a0),_0xe216cc['delete'](_0x4e27a0)):(_0x2fa7b0['add'](_0x4e27a0),_0xe216cc['set'](_0x4e27a0,_0x38508e));}else _0x2fa7b0['add'](_0x4e27a0);}for(const _0x3f645f of _0x2fa7b0){const _0x511471=_0xe216cc['has'](_0x3f645f)&&!_0xe216cc['get'](_0x3f645f)['isAttached'];let _0x14203b=_0x511471?_0x489d2b['length']-0x1:0x0;const _0x401977=_0x511471?-0x1:0x1;for(;_0x489d2b[_0x14203b];){const _0x551f20=_0x489d2b[_0x14203b];if(_0x551f20['diffData'][_0x3f645f]){const _0x8b185a=_0x511471?_0x551f20['diffData'][_0x3f645f]['attributesBefore']:_0x551f20['diffData'][_0x3f645f]['attributesAfter'];_0x25cfb1['attributes'][_0x3f645f]=_0x8b185a?_0x346ba8(_0x8b185a):{};break;}_0x14203b+=_0x401977;}}for(const _0x199e6f of _0x489d2b){_0x199e6f['model']={};for(const _0x9fe7c2 of _0x199e6f['authors'])_0x1897c4['set'](_0x9fe7c2['id'],_0x9fe7c2);for(const _0x52d0e1 of _0x2fa7b0){const _0x568502=_0x199e6f['diffData'][_0x52d0e1]?_0x199e6f['diffData'][_0x52d0e1]['insertions']:'[]',_0x36c730=_0x199e6f['diffData'][_0x52d0e1]?_0x199e6f['diffData'][_0x52d0e1]['deletions']:'[]',_0x4c80ec=_0x199e6f['diffData'][_0x52d0e1]?.['rootElementName']||'$root';_0x199e6f['model'][_0x52d0e1]={'insertions':this['_utils']['_makeModelFromViewString'](_0x568502,_0x4c80ec),'deletions':this['_utils']['_makeModelFromViewString'](_0x36c730,_0x4c80ec)};}}for(const _0xa7482e of _0x2fa7b0){let _0x31417c=null,_0x4864a8=0x0;const _0x460f19=_0x489d2b['map'](_0x2827ac=>_0x2827ac['diffData'][_0xa7482e]?.['rootElementName'])['find'](_0x3cc4d7=>void 0x0!==_0x3cc4d7)||'$root',_0x301a4b=new Map(Array['from'](_0x131006['model'][_0xa7482e]['insertions']['markers'])['filter'](([_0x4604df])=>!_0x4604df['startsWith']('revision:')));let _0x358287=0x0;for(const _0x44e921 of _0x489d2b){const _0x168996=_0x44e921['diffData'][_0xa7482e]?.['aiSources']||{},_0x1542f8=this['_makeTape'](_0x44e921['model'][_0xa7482e]['insertions'],_0x168996);_0x44e921==_0x131006?(_0x31417c=_0x1542f8,_0x4864a8=_0x31417c['length'],_0x31417c['forEach'](_0x58432a=>{_0x58432a['id']=_0x358287++;}),this['_processTape'](_0x31417c)):this['_markInsertions'](_0x31417c,_0x1542f8);const _0x33aaa0=_0x31417c['filter'](_0x253657=>!_0x253657['isAdded'])['map'](_0x17b470=>_0x17b470['id']);let _0x36f07d=0x0;const _0x5809fa=this['_makeTape'](_0x44e921['model'][_0xa7482e]['deletions'],_0x168996);_0x5809fa['forEach'](_0x4349b7=>{_0x4349b7['isRemoved']?_0x4349b7['id']=_0x4864a8++:_0x4349b7['id']=_0x33aaa0[_0x36f07d++];}),this['_processTape'](_0x5809fa),this['_setDistance'](_0x31417c,'isAdded'),this['_setDistance'](_0x5809fa,'isRemoved'),_0x44e921==_0x131006&&this['_markMarkers'](_0x31417c,_0x301a4b),_0x31417c=this['_joinTapes'](_0x31417c,_0x5809fa),this['_refreshStartEndIndex'](_0x31417c),this['_setDistance'](_0x31417c,'isRemoved');}_0x31417c=_0x31417c['filter'](_0x2b4802=>!(_0x2b4802['isAdded']&&_0x2b4802['isRemoved']));const _0x30eef7=new Map(_0x3df9d4['model'][_0xa7482e]['deletions']['markers']),_0x193ad3=new Set(_0x301a4b['keys']());for(const _0x3681e8 of _0x30eef7['keys']())_0x193ad3['delete'](_0x3681e8);const _0x42fdd3=Object['assign']({},..._0x489d2b['map'](_0x66cf0b=>_0x66cf0b['diffData'][_0xa7482e]?.['aiSources']));this['_markSuggestions'](_0x31417c,_0x193ad3,_0x42fdd3),this['_fixObsoleteTags'](_0x31417c),_0x31417c=this['_removeMissingPairs'](_0x31417c),_0x31417c=this['_markMismatchedRemovedTags'](_0x31417c),_0x31417c=this['_removeUnsupportedChanges'](_0x31417c);const {root:_0x140157,changes:_0x1cf70c}=this['_makeModelFromTape'](_0x31417c,_0x1897c4,_0xa7482e,_0x460f19);_0x25cfb1['model'][_0xa7482e]=_0x140157;const _0x98db1f=_0xe216cc['get'](_0xa7482e);if(_0x98db1f){const _0x5abf0a=_0x1897c4['get'](_0x98db1f['userId']),_0x55b049=new Mt({'author':_0x5abf0a,'type':_0x98db1f['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0xa7482e});_0x1cf70c['unshift'](_0x55b049),_0x25cfb1['attributes'][_0xa7482e]['revisionHistoryAttachChange']=_0x55b049['id'];}_0x25cfb1['changes']=_0x25cfb1['changes']['concat'](_0x1cf70c);}return _0x25cfb1;}['_markMarkers'](_0x351391,_0x4e1cd4){for(let _0x16c280=0x0;_0x16c280<_0x351391['length'];_0x16c280++)for(const [_0x448afc,_0x551072]of _0x4e1cd4)!_0x551072['isCollapsed']&&_0x551072['start']['isEqual'](_0x351391[_0x16c280]['previousPosition'])&&_0x351391[_0x16c280]['markersStart']['push'](_0x448afc),_0x551072['end']['isEqual'](_0x351391[_0x16c280]['nextPosition'])&&_0x351391[_0x16c280]['markersEnd']['push'](_0x448afc);}['_joinTapes'](_0x22fcbd,_0x41851c){let _0x370620=[],_0x13a8b4=0x0,_0x56aa0d=0x0;for(;_0x13a8b4<_0x22fcbd['length']||_0x56aa0d<_0x41851c['length'];){const _0x4e8b11=_0x22fcbd[_0x13a8b4]||{},_0x2dfb2d=_0x41851c[_0x56aa0d]||{};if(_0x4e8b11['id']==_0x2dfb2d['id'])_0x13a8b4++,_0x56aa0d++,_0x370620['push'](_0x4e8b11);else{if(_0x2dfb2d['isRemoved']&&_0x4e8b11['isAdded']){const {commonTape:_0xb7ec1f,iEnd:_0x404578,jEnd:_0x398456}=this['_threeWayMerge'](_0x22fcbd,_0x13a8b4,_0x41851c,_0x56aa0d);_0x370620=_0x370620['concat'](_0xb7ec1f),_0x13a8b4=_0x404578,_0x56aa0d=_0x398456;}else _0x2dfb2d['isRemoved']?(_0x56aa0d++,_0x370620['push'](_0x2dfb2d)):(_0x13a8b4++,_0x370620['push'](_0x4e8b11));}}return _0x370620;}_markSuggestions(_0xfd6d67,_0x17bf81,_0x2f85f7){const _0x977d6a=[];for(let _0x15d8a6=0x0;_0x15d8a6<_0xfd6d67['length'];_0x15d8a6++){for(let _0x411e8c=0x0;_0x411e8c<_0xfd6d67[_0x15d8a6]['markersStart']['length'];_0x411e8c++){const _0x19da1d=_0xfd6d67[_0x15d8a6]['markersStart'][_0x411e8c];if(!_0x17bf81['has'](_0x19da1d))continue;const {group:_0x409270,type:_0x4e52e8,authorId:_0xf86bdc}=_0x419c98(_0x19da1d);if('revision-suggestion'!=_0x409270||'insertion'!=_0x4e52e8&&'deletion'!=_0x4e52e8)continue;const _0xe0f399=_0x2f85f7['suggestion:'+_0x19da1d['slice'](0x14)]||null;_0x977d6a['unshift']({'type':_0x4e52e8,'name':_0x19da1d,'userId':_0xf86bdc,'aiSource':_0xe0f399}),_0xfd6d67[_0x15d8a6]['markersStart']['splice'](_0x411e8c,0x1),_0x411e8c--;}_0x2130fa(_0xfd6d67[_0x15d8a6]);for(let _0x3258a0=0x0;_0x3258a0<_0xfd6d67[_0x15d8a6]['markersEnd']['length'];_0x3258a0++){const _0x22a76f=_0xfd6d67[_0x15d8a6]['markersEnd'][_0x3258a0];if(!_0x17bf81['has'](_0x22a76f))continue;const {group:_0x4c51d7,type:_0x43ae05}=_0x419c98(_0x22a76f);if('revision-suggestion'!=_0x4c51d7||'insertion'!=_0x43ae05&&'deletion'!=_0x43ae05)continue;_0xfd6d67[_0x15d8a6]['markersEnd']['splice'](_0x3258a0,0x1),_0x3258a0--;const _0x3911aa=_0x977d6a['findIndex'](_0x4d2210=>_0x4d2210['name']==_0x22a76f);_0x3911aa>-0x1&&_0x977d6a['splice'](_0x3911aa,0x1);}}function _0x419c98(_0x412e9f){const _0x2e92e7=_0x412e9f['split'](':');return{'group':_0x2e92e7[0x0],'type':_0x2e92e7[0x1],'subType':_0x2e92e7['length']>=0x5?_0x2e92e7[0x2]:null,'id':_0x2e92e7['length']<0x5?_0x2e92e7[0x2]:_0x2e92e7[0x3],'authorId':_0x2e92e7['length']<0x5?_0x2e92e7[0x3]:_0x2e92e7[0x4],'markerCount':0x6==_0x2e92e7['length']?_0x2e92e7[0x5]:null};}function _0x2130fa(_0xde4857){for(let _0x16976f=0x0;_0x16976f<_0x977d6a['length'];_0x16976f++){if(_0xde4857['isAdded']&&'insertion'==_0x977d6a[_0x16976f]['type']&&_0xde4857['isAdded']['userId']==_0x977d6a[_0x16976f]['userId'])return _0xde4857['isAddSuggestion']={..._0x977d6a[_0x16976f],'aiSource':_0xde4857['isAdded']['aiSource']||_0x977d6a[_0x16976f]['aiSource']},void delete _0xde4857['isAdded'];if(!_0xde4857['isAdded']&&!_0xde4857['isRemoved']&&'deletion'==_0x977d6a[_0x16976f]['type'])return void(_0xde4857['isRemoveSuggestion']=_0x977d6a[_0x16976f]);}}}_setDistance(_0x54955f,_0x29bf18){let _0x710aa5=0x0,_0x241685=!0x1;const _0x2b91ec=new Map();for(const _0x12fab7 of _0x54955f)_0x12fab7[_0x29bf18]?_0x241685&&(_0x710aa5++,_0x241685=!0x1):(_0x710aa5++,_0x241685=!0x0),_0x2b91ec['set'](_0x12fab7['id'],_0x710aa5);for(let _0x5f1ea1=0x0;_0x5f1ea1<_0x54955f['length'];_0x5f1ea1++){if('isRemoved'==_0x29bf18&&_0x54955f[_0x5f1ea1]['isAdded']||'isAdded'==_0x29bf18&&_0x54955f[_0x5f1ea1]['isRemoved'])continue;if('text'==_0x54955f[_0x5f1ea1]['type']){_0x54955f[_0x5f1ea1]['distance']=0x0;continue;}const _0x9813b2=_0x2b91ec['get'](_0x54955f[_0x5f1ea1]['pairId']),_0x397233=_0x2b91ec['get'](_0x54955f[_0x5f1ea1]['id']);_0x54955f[_0x5f1ea1]['distance']=_0x9813b2-_0x397233;}}_getRevisionsRange(_0x12c045,_0x8d51f4,_0x1e6d36=!0x1){const _0x1313a9=[];let _0x39d84e=this['repository']['getIndex'](_0x12c045),_0x3c2c30=this['repository']['getIndex'](_0x8d51f4);for(-0x1==_0x3c2c30&&(_0x3c2c30=this['repository']['_revisions']['length'],_0x1e6d36=!0x1);_0x39d84e<_0x3c2c30;)_0x1313a9['push'](this['repository']['getRevision'](_0x39d84e)),_0x39d84e++;return _0x1e6d36&&_0x1313a9['push'](this['repository']['getRevision'](_0x39d84e)),_0x1313a9;}_threeWayMerge(_0x199078,_0x2f51d9,_0x3e19d6,_0x139ba5){const _0x268a2c=this['editor']['model']['schema'];let _0x46ea54=_0x2f51d9;for(;_0x199078[_0x46ea54]&&_0x199078[_0x46ea54]['isAdded'];)_0x46ea54++;let _0x1c472f=_0x139ba5;for(;_0x3e19d6[_0x1c472f]&&_0x3e19d6[_0x1c472f]['isRemoved'];)_0x1c472f++;_0xfd06d4(_0x199078,_0x2f51d9,_0x46ea54),_0xfd06d4(_0x3e19d6,_0x139ba5,_0x1c472f);const _0x4ea9ec=_0x3e19d6['slice'](_0x139ba5,_0x1c472f)['concat'](_0x199078['slice'](_0x2f51d9,_0x46ea54));return _0x4ea9ec['sort']((_0x9f1c8b,_0xc6c951)=>_0x9f1c8b['side']!=_0xc6c951['side']?_0x9f1c8b['side']-_0xc6c951['side']:_0x9f1c8b['level']!=_0xc6c951['level']?_0x9f1c8b['level']-_0xc6c951['level']:_0x9f1c8b['distance']!=_0xc6c951['distance']?_0xc6c951['distance']-_0x9f1c8b['distance']:!!_0x9f1c8b['isAdded']!=!!_0xc6c951['isAdded']?-0x1==_0x9f1c8b['side']||0x0==_0x9f1c8b['side']?_0x9f1c8b['isAdded']?-0x1:0x1:_0x9f1c8b['isAdded']?0x1:-0x1:_0x9f1c8b['index']-_0xc6c951['index']),{'commonTape':_0x4ea9ec,'iEnd':_0x46ea54,'jEnd':_0x1c472f};function _0xfd06d4(_0x1354f6,_0x1dd81e,_0x287dca){let _0x5cda02=-0x1,_0x103064=Number['POSITIVE_INFINITY'],_0x3f4ea3=!0x0;for(let _0x2b6b3e=_0x1dd81e;_0x2b6b3e<_0x287dca;_0x2b6b3e++)if(_0x268a2c['isInline'](_0x1354f6[_0x2b6b3e]['item'])||(_0x3f4ea3=!0x1),_0x1354f6[_0x2b6b3e]['item']['startIndex']<_0x1dd81e&&(_0x5cda02=_0x2b6b3e),_0x1354f6[_0x2b6b3e]['item']['endIndex']>=_0x287dca){_0x103064=_0x2b6b3e;break;}_0x3f4ea3&&(_0x5cda02=_0x287dca-0x1);for(let _0x109d97=_0x1dd81e;_0x109d97<_0x287dca;_0x109d97++)_0x1354f6[_0x109d97]['side']=_0x109d97<=_0x5cda02?-0x1:_0x109d97<_0x103064?0x0:0x1,_0x1354f6[_0x109d97]['index']=_0x109d97;let _0x2f9e5d=0x0;for(let _0xd88be=_0x1dd81e;_0xd88be<=_0x5cda02;_0xd88be++)0x0==_0x1354f6[_0xd88be]['distance']?_0x1354f6[_0xd88be]['level']=_0x2f9e5d:(_0x2f9e5d++,_0x1354f6[_0xd88be]['level']=_0x2f9e5d,_0x2f9e5d++);for(let _0x11403b=_0x1dd81e;_0x11403b<_0x287dca;_0x11403b++)0x0==_0x1354f6[_0x11403b]['side']&&(_0x1354f6[_0x11403b]['level']=_0x2f9e5d);_0x2f9e5d=0x0;for(let _0x3b9ab7=_0x287dca-0x1;_0x3b9ab7>=_0x103064;_0x3b9ab7--)0x0==_0x1354f6[_0x3b9ab7]['distance']?_0x1354f6[_0x3b9ab7]['level']=_0x2f9e5d:(_0x2f9e5d--,_0x1354f6[_0x3b9ab7]['level']=_0x2f9e5d,_0x2f9e5d--);}}_fixObsoleteTags(_0x9fb815){const _0x3e87b8=new Map(),_0x383a20=this['editor']['model']['schema'];for(let _0x421525=0x1;_0x421525<_0x9fb815['length'];_0x421525++){let _0x2ad0f9,_0x552755,_0x8ca2b5;const _0x41efc6=_0x9fb815[_0x421525],_0x18d51d=_0x9fb815[_0x421525-0x1];if('text'==_0x41efc6['type'])continue;if(_0x41efc6['type']!=_0x18d51d['type'])continue;if(!_0x383a20['isBlock'](_0x18d51d['item'])||_0x383a20['isLimit'](_0x18d51d['item']))continue;if(!_0x383a20['isBlock'](_0x41efc6['item'])||_0x383a20['isLimit'](_0x41efc6['item']))continue;if((_0x9fb815[_0x421525]['isAdded']||_0x9fb815[_0x421525]['isAddSuggestion'])&&_0x9fb815[_0x421525-0x1]['isRemoved'])_0x2ad0f9=_0x9fb815[_0x421525],_0x552755=_0x9fb815[_0x421525-0x1],_0x8ca2b5=_0x421525-0x1;else{if(!_0x9fb815[_0x421525]['isRemoved']||!_0x9fb815[_0x421525-0x1]['isAdded']&&!_0x9fb815[_0x421525-0x1]['isAddSuggestion'])continue;_0x2ad0f9=_0x9fb815[_0x421525-0x1],_0x552755=_0x9fb815[_0x421525],_0x8ca2b5=_0x421525;}const _0x24f070=_0x2ad0f9['level']==_0x552755['level'],_0xb28b7c=Math['abs'](_0x2ad0f9['level'])<Math['abs'](_0x552755['level'])&&0x0==_0x552755['distance'];(_0x24f070||_0xb28b7c)&&(_0x3e87b8['set'](_0x552755['id'],_0x2ad0f9['id']),_0x9fb815['splice'](_0x8ca2b5,0x1),_0x421525--,_0x2ad0f9['isAdded']=!0x1);}for(let _0x1bb1de=0x0;_0x1bb1de<_0x9fb815['length'];_0x1bb1de++)_0x3e87b8['has'](_0x9fb815[_0x1bb1de]['pairId'])&&(_0x9fb815[_0x1bb1de]['pairId']=_0x3e87b8['get'](_0x9fb815[_0x1bb1de]['pairId']));}['_removeMissingPairs'](_0x11cd4e){const _0x437d2e=new Set(_0x11cd4e['map'](_0x307d6b=>_0x307d6b['id']));for(let _0x913647=0x0;_0x913647<_0x11cd4e['length'];_0x913647++)_0x437d2e['has'](_0x11cd4e[_0x913647]['pairId'])||0x0==_0x11cd4e[_0x913647]['distance']||(_0x11cd4e[_0x913647]['isIncorrect']=!0x0);return _0x11cd4e['filter'](_0x394a63=>!_0x394a63['isIncorrect']);}_markMismatchedRemovedTags(_0x4a4961){const _0xf76fd9=new Set();for(let _0x1e5269=0x0;_0x1e5269<_0x4a4961['length'];_0x1e5269++){if(_0xf76fd9['has'](_0x4a4961[_0x1e5269]['id'])&&_0x4a4961[_0x1e5269]['isRemoved']&&(_0x4a4961[_0x1e5269]['isIncorrect']=!0x0),_0x4a4961[_0x1e5269]['isIncorrect'])continue;if(0x0==_0x4a4961[_0x1e5269]['distance'])continue;if('elementStart'!=_0x4a4961[_0x1e5269]['type'])continue;if(null==_0x4a4961[_0x1e5269]['pairId'])continue;let _0x12b69d=_0x1e5269+0x1,_0x478841=0x0;for(;_0x4a4961[_0x12b69d]['id']!=_0x4a4961[_0x1e5269]['pairId'];)'elementStart'==_0x4a4961[_0x12b69d]['type']?_0x478841++:'elementEnd'==_0x4a4961[_0x12b69d]['type']&&_0x478841--,_0x12b69d++;if(0x0!=_0x478841){if(_0x4a4961[_0x1e5269]['isRemoved'])_0x4a4961[_0x1e5269]['isIncorrect']=!0x0;else{for(;_0x12b69d!=_0x1e5269;)_0x4a4961[_0x12b69d]['isRemoved']&&0x0!=_0x4a4961[_0x12b69d]['distance']&&(_0x4a4961[_0x12b69d]['isIncorrect']=!0x0,_0xf76fd9['add'](_0x4a4961[_0x12b69d]['pairId'])),_0x12b69d--;}}}return _0x4a4961['filter'](_0x36716c=>!_0x36716c['isIncorrect']);}_removeUnsupportedChanges(_0x1f18bc){const _0x629b6f=this['editor']['model']['schema'];for(let _0x5135e1=0x0;_0x5135e1<_0x1f18bc['length'];_0x5135e1++){if(!(_0x1f18bc[_0x5135e1]['isAdded']||_0x1f18bc[_0x5135e1]['isAddSuggestion']||_0x1f18bc[_0x5135e1]['isRemoved']||_0x1f18bc[_0x5135e1]['isRemoveSuggestion']))continue;if(0x0==_0x1f18bc[_0x5135e1]['distance'])continue;const _0x376d59=_0x1f18bc[_0x5135e1]['item'];_0x629b6f['isBlock'](_0x376d59)||_0x629b6f['isLimit'](_0x376d59)||(_0x1f18bc[_0x5135e1]['isAdded']&&delete _0x1f18bc[_0x5135e1]['isAdded'],_0x1f18bc[_0x5135e1]['isAddSuggestion']&&delete _0x1f18bc[_0x5135e1]['isAddSuggestion'],_0x1f18bc[_0x5135e1]['isRemoveSuggestion']&&delete _0x1f18bc[_0x5135e1]['isRemoveSuggestion'],_0x1f18bc[_0x5135e1]['isRemoved']&&(_0x1f18bc[_0x5135e1]['isIncorrect']=!0x0));}return _0x1f18bc['filter'](_0x46710e=>!_0x46710e['isIncorrect']);}['_makeModelFromTape'](_0x3028f0,_0x49b1cd,_0x2ba6cc,_0xd681ef){const _0x5a483c=new _0x3bdc31(),_0x8da001=[],_0x1b1c21=new Map(),_0x27b577=this['editor']['model'],_0x3ff698=_0x27b577['schema'],_0x8ecf1f=[_0x5a483c],_0x2d8820={},_0x147eea={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x5a483c['name']=_0xd681ef;let _0x34b968=null;const _0x56eafd=[0x0];for(let _0x5d05d2=0x0;_0x5d05d2<_0x3028f0['length'];_0x5d05d2++)if('elementStart'===_0x3028f0[_0x5d05d2]['type']){_0x3028f0[_0x5d05d2]['previousPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd);const _0x5cb14b=new _0x19c548(_0x3028f0[_0x5d05d2]['item']['name'],_0x3028f0[_0x5d05d2]['item']['getAttributes']());_0x8ecf1f[0x0]['_appendChild'](_0x5cb14b),_0x56eafd['push'](0x0),_0x8ecf1f['unshift'](_0x5cb14b),_0x3028f0[_0x5d05d2]['nextPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd);}else'elementEnd'===_0x3028f0[_0x5d05d2]['type']?(_0x8ecf1f['shift'](),_0x3028f0[_0x5d05d2]['previousPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd),_0x56eafd['pop'](),_0x56eafd[_0x56eafd['length']-0x1]++,_0x3028f0[_0x5d05d2]['nextPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd)):(_0x3028f0[_0x5d05d2]['previousPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd),_0x34b968?_0x34b968['_data']+=_0x3028f0[_0x5d05d2]['item']['data']:_0x34b968=new _0x7943a3(_0x3028f0[_0x5d05d2]['item']['data'],_0x3028f0[_0x5d05d2]['item']['getAttributes']()),_0x3028f0[_0x5d05d2+0x1]&&'text'===_0x3028f0[_0x5d05d2+0x1]['type']&&_0x3bd842(_0x34b968,_0x3028f0[_0x5d05d2+0x1]['item'])||(_0x8ecf1f[0x0]['_appendChild'](_0x34b968),_0x34b968=null),_0x56eafd[_0x56eafd['length']-0x1]+=_0x3028f0[_0x5d05d2]['item']['offsetSize'],_0x3028f0[_0x5d05d2]['nextPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd));for(let _0x2ba97b=0x0;_0x2ba97b<_0x3028f0['length'];_0x2ba97b++){const _0x32bec6=_0x3028f0[_0x2ba97b]['previousPosition'],_0x2d14d1=_0x3028f0[_0x2ba97b]['nextPosition'];for(const _0x344c99 of _0x3028f0[_0x2ba97b]['markersStart'])_0x1b1c21['set'](_0x344c99,{'start':_0x32bec6,'end':null});_0x597304('isRemoveSuggestion',_0x2ba97b,_0x32bec6,_0x2d14d1),_0x597304('isAddSuggestion',_0x2ba97b,_0x32bec6,_0x2d14d1),_0x597304('isRemoved',_0x2ba97b,_0x32bec6,_0x2d14d1),_0x597304('isAdded',_0x2ba97b,_0x32bec6,_0x2d14d1);for(const _0x35456e of _0x3028f0[_0x2ba97b]['markersEnd']){const _0x431c91=_0x1b1c21['get'](_0x35456e);_0x431c91?_0x431c91['end']=_0x2d14d1:_0x1b1c21['set'](_0x35456e,{'start':_0x2d14d1,'end':_0x2d14d1});}}for(const [_0x4a24d9,_0x3c5163]of _0x1b1c21){const _0x4377de=this['editor']['model']['createRange'](_0x3c5163['start'],_0x3c5163['end']);_0x5a483c['markers']['set'](_0x4a24d9,_0x4377de);}return _0x8da001['sort']((_0x2b59af,_0xeaf05b)=>{const _0x561206=_0x5a483c['markers']['get']('revision:'+_0x2b59af['id']),_0x101c5b=_0x5a483c['markers']['get']('revision:'+_0xeaf05b['id']);return _0x561206['start']['isBefore'](_0x101c5b['start'])?-0x1:_0x561206['start']['isAfter'](_0x101c5b['start'])?0x1:_0x561206['end']['isBefore'](_0x101c5b['end'])?-0x1:_0x561206['end']['isAfter'](_0x101c5b['end'])?0x1:'add'===_0x2b59af['type']?-0x1:0x1;}),{'root':_0x5a483c,'changes':_0x8da001};function _0x597304(_0x1687a9,_0x59cdf4,_0x19aebe,_0x53477f){const _0x179c02=!!_0x3028f0[_0x59cdf4][_0x1687a9],_0x283e57=_0x179c02?_0x3028f0[_0x59cdf4][_0x1687a9]['userId']:null,_0xc90e0d=_0x179c02&&_0x3028f0[_0x59cdf4][_0x1687a9]['aiSource']||null,_0x3bb3f6=_0x59cdf4===_0x3028f0['length']-0x1,_0x3ab1b9=_0x147eea[_0x1687a9][0x0],_0x43fd8d=_0x3ff698['isObject'](_0x3028f0[_0x59cdf4]['item']);!_0x2d8820[_0x1687a9]&&_0x179c02?_0x2d8820[_0x1687a9]={'start':_0x19aebe,'tapeItem':_0x3028f0[_0x59cdf4],'userId':_0x283e57,'aiSource':_0xc90e0d,'type':_0x1687a9}:_0x2d8820[_0x1687a9]&&!_0x179c02?(_0x2d8820[_0x1687a9]['end']=_0x19aebe,_0x4a7e65(_0x2d8820[_0x1687a9]),_0x2d8820[_0x1687a9]=null):_0x2d8820[_0x1687a9]&&_0x179c02&&(_0x2d8820[_0x1687a9]['userId']!==_0x283e57||_0x2d8820[_0x1687a9]['aiSource']!==_0xc90e0d)&&(_0x2d8820[_0x1687a9]['end']=_0x19aebe,_0x3ab1b9&&_0x3ab1b9['userId']===_0x2d8820[_0x1687a9]['userId']?_0x3ab1b9['change']['aiSource']=_0x3ab1b9['change']['aiSource']||_0x2d8820[_0x1687a9]['aiSource']:_0x4a7e65(_0x2d8820[_0x1687a9]),_0x2d8820[_0x1687a9]={'start':_0x19aebe,'tapeItem':_0x3028f0[_0x59cdf4],'userId':_0x283e57,'aiSource':_0xc90e0d,'type':_0x1687a9}),_0x2d8820[_0x1687a9]&&_0x43fd8d&&('elementStart'!==_0x3028f0[_0x59cdf4]['type']||_0x3ab1b9&&_0x3ab1b9['userId']===_0x283e57||_0x147eea[_0x1687a9]['unshift']({'userId':_0x283e57,'object':_0x3028f0[_0x59cdf4]['item'],'change':_0x2d8820[_0x1687a9]}),'elementEnd'===_0x3028f0[_0x59cdf4]['type']&&_0x3ab1b9&&_0x3ab1b9['object']===_0x3028f0[_0x59cdf4]['item']&&(_0x147eea[_0x1687a9]['shift'](),_0x2d8820[_0x1687a9]=_0x3ab1b9['change'])),_0x2d8820[_0x1687a9]&&_0x3bb3f6&&(_0x2d8820[_0x1687a9]['end']=_0x53477f,_0x4a7e65(_0x2d8820[_0x1687a9]),_0x2d8820[_0x1687a9]=null);}function _0x4a7e65({start:_0x2497ff,end:_0x3bb505,tapeItem:_0x1ce21d,userId:_0x5aa7e1,aiSource:_0x4a9884,type:_0x1fc896}){const _0x63798e=_0x1ce21d['item'],_0x139ec0=_0x27b577['schema']['isBlock'](_0x63798e)&&!_0x27b577['schema']['isLimit'](_0x63798e),_0x5c0a9c=_0x2497ff['nodeAfter']==_0x3bb505['parent']&&_0x3bb505['isAtStart'];if(_0x139ec0&&_0x5c0a9c)return;const _0x3b4070=_0x27b577['createRange'](_0x2497ff,_0x3bb505),_0x5a88be=_0x49b1cd['get'](_0x5aa7e1),_0x3c85f4=new Mt({'author':_0x5a88be,'type':'isAdded'==_0x1fc896||'isAddSuggestion'==_0x1fc896?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x1fc896||'isRemoveSuggestion'==_0x1fc896,'aiSource':_0x4a9884||null},'createdAt':new Date(),'rootName':_0x2ba6cc});_0x8da001['push'](_0x3c85f4),_0x5a483c['markers']['set']('revision:'+_0x3c85f4['id'],_0x3b4070);}function _0x3bd842(_0x10d663,_0x2382d5){const _0xd95345=_0x10d663['getAttributes'](),_0xfeb5ce=_0x2382d5['getAttributes']();for(const _0x2ff98c of _0xd95345){if(_0x2ff98c[0x1]!==_0x2382d5['getAttribute'](_0x2ff98c[0x0]))return!0x1;_0xfeb5ce['next']();}return _0xfeb5ce['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x57276a=>{const _0x36fd1b=_0x57276a['markerName']['split'](':')[0x1],_0x38c6dc=this['_getChangeFromId'](_0x36fd1b);if(!_0x38c6dc)return null;const _0x213dc7='add'==_0x38c6dc['type']?'insertion':'deletion',_0x41c74a=['ck-suggestion-marker','ck-suggestion-marker-'+_0x213dc7];return _0x38c6dc['data']['isSuggestion']&&_0x41c74a['push']('ck-suggestion-marker-'+_0x213dc7+'-new'),this['activeChange']==_0x38c6dc&&_0x41c74a['push']('ck-suggestion-marker--active'),{'classes':_0x41c74a,'attributes':{'data-change-id':_0x36fd1b}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x2466f0=>{_0x2466f0['on']('element:pre',(_0x15a6bf,_0x28d296,_0x38446f)=>{const _0x87f684=_0x28d296['viewItem']['getChild'](0x0);if(!_0x87f684||!_0x87f684['is']('element','code'))return;if(!_0x38446f['consumable']['consume'](_0x87f684,{'attributes':['vid_start','vid_end']}))return;const _0x1e18fb=_0x28d296['modelRange']['start']['nodeAfter'];_0x38446f['writer']['setAttribute']('vid_start',_0x87f684['getAttribute']('vid_start'),_0x1e18fb),_0x38446f['writer']['setAttribute']('vid_end',_0x87f684['getAttribute']('vid_end'),_0x1e18fb);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x3e9861=>{_0x3e9861['on']('element',(_0x224895,_0x940b,_0x10e53f)=>{if(!_0x10e53f['consumable']['consume'](_0x940b['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x940b['modelRange']['isCollapsed'])return;const _0xd25257=_0x940b['modelRange']['start']['nodeAfter'];_0xd25257['hasAttribute']('vid_start')||_0xd25257['hasAttribute']('vid')||(_0x10e53f['writer']['setAttribute']('vid_start',_0x940b['viewItem']['getAttribute']('vid_start'),_0xd25257),_0x10e53f['writer']['setAttribute']('vid_end',_0x940b['viewItem']['getAttribute']('vid_end'),_0xd25257));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x92659f=>_0x92659f['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x208410,[,_0x38f245])=>{['vid_start','vid_end','vid']['includes'](_0x38f245)&&(_0x208410['return']=!0x0,_0x208410['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x106fad=>{_0x106fad['on']('attribute:vid',(_0x500838,_0x5257bc,_0x4b2067)=>{if('\x20'!=_0x5257bc['item']['data']||_0x5257bc['item']['parent']['maxOffset']>0x1)return;if(!_0x4b2067['consumable']['consume'](_0x5257bc['item'],_0x500838['name']))return;const _0x3986d2=_0x4b2067['writer'],_0x7054fd=_0x4b2067['mapper']['toViewRange'](_0x5257bc['range']);_0x3986d2['wrap'](_0x7054fd,_0x3986d2['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x4b9340){const _0x1482b7=_0x4b9340['plugins']['get']('RevisionViewer');return(_0x10b4b7,_0x4c2eb9,_0x267625)=>{const _0x2f31b1=_0x4c2eb9['markerName']['split'](':')[0x1],_0x3615bd=_0x1482b7['_getChangeFromId'](_0x2f31b1);if(!_0x3615bd)return null;const _0x45bd14='add'==_0x3615bd['type']?'split':'merge';if(!_0x267625['consumable']['test'](_0x4c2eb9['markerRange'],_0x10b4b7['name']))return;const _0x394b6b=_0x4c2eb9['markerRange']['getWalker'](),_0x22cdc0=_0x4c2eb9['markerRange']['start'],_0x1058ac=_0x4b9340['model']['schema'];let _0x1cae96=null,_0x30b6f4=null,_0x2552fe=!0x1,_0x4494c0=!0x1;for(const _0x3743bb of _0x394b6b){const _0x54f292=_0x3743bb['item'];_0x2552fe=_0x2552fe||_0x1058ac['isContent'](_0x54f292);const _0x2a0fde=_0x267625['mapper']['toViewElement'](_0x54f292);if(_0x2a0fde&&_0x2a0fde['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x3743bb['type']&&(_0x1058ac['isBlock'](_0x54f292)&&!_0x1058ac['isLimit'](_0x54f292)&&(_0x54f292['nextSibling']||_0x22cdc0['isAtEnd']?_0x1cae96&&_0x1cae96['parent']==_0x54f292||(_0x1cae96=_0x54f292,_0x5e4099(_0x3743bb['previousPosition']),_0x4494c0=!0x0):_0x30b6f4=_0x30b6f4||_0x3743bb['previousPosition']));}function _0x5e4099(_0x22088f){const _0x4063b4=_0x267625['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x45bd14}),_0x286cae=_0x267625['mapper']['toViewPosition'](_0x22088f);_0x3615bd['data']['isSuggestion']&&_0x267625['writer']['addClass']('ck-suggestion-marker-'+_0x45bd14+'-new',_0x4063b4),_0x1482b7['activeChange']==_0x3615bd&&_0x267625['writer']['addClass']('ck-suggestion-marker--active',_0x4063b4),_0x267625['writer']['insert'](_0x286cae,_0x4063b4),_0x267625['mapper']['bindElementToMarker'](_0x4063b4,_0x4c2eb9['markerName']);}_0x2552fe||_0x4494c0||!_0x30b6f4||_0x5e4099(_0x30b6f4);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x318f97,_0x20d816,_0x39d18b)=>{const _0x2f4f57=_0x39d18b['mapper']['markerNameToElements'](_0x20d816['markerName']);if(_0x2f4f57){for(const _0x18b749 of _0x2f4f57)(_0x18b749['hasClass']('ck-suggestion-marker-split')||_0x18b749['hasClass']('ck-suggestion-marker-merge'))&&(_0x39d18b['mapper']['unbindElementFromMarkerName'](_0x18b749,_0x20d816['markerName']),_0x39d18b['writer']['remove'](_0x18b749));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x2c01b7,_0x2593d7,_0x4b9383)=>{const _0x1e65e1=_0x2593d7['markerName']['split'](':')[0x1],_0xd302a8=this['_getChangeFromId'](_0x1e65e1);if(!_0xd302a8)return null;const _0x23269d='add'==_0xd302a8['type']?'split':'merge';if(_0x4b9383['consumable']['test'](_0x2593d7['markerRange'],_0x2c01b7['name']))for(const _0x309f95 of _0x2593d7['markerRange']['getItems']()){if(!_0x309f95['is']('element','softBreak'))continue;const _0x274580=_0x4b9383['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x23269d}),_0x285250=_0x4b9383['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x309f95));_0xd302a8['data']['isSuggestion']&&_0x4b9383['writer']['addClass']('ck-suggestion-marker-'+_0x23269d+'-new',_0x274580),this['activeChange']==_0xd302a8&&_0x4b9383['writer']['addClass']('ck-suggestion-marker--active',_0x274580),_0x4b9383['writer']['insert'](_0x285250,_0x274580),_0x4b9383['mapper']['bindElementToMarker'](_0x274580,_0x2593d7['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x207b0d=>{for(const _0x3b638e of this['editor']['model']['document']['getRootNames']()){const _0x552d25=this['editor']['model']['document']['getRoot'](_0x3b638e),_0x410a27=this['editor']['editing']['view']['document']['getRoot'](_0x3b638e);if(_0x410a27){const _0x14ad3b=_0x552d25['getAttribute']('revisionHistoryAttachChange');if(_0x207b0d['removeAttribute']('data-change-id',_0x410a27),_0x207b0d['removeClass']('ck-revision-history-root-add',_0x410a27),_0x207b0d['removeClass']('ck-revision-history-root-remove',_0x410a27),_0x207b0d['removeClass']('ck-revision-history-root--active',_0x410a27),_0x14ad3b){const _0x1eb6d6=this['_getChangeFromId'](_0x14ad3b);if(!_0x1eb6d6)return null;_0x207b0d['setAttribute']('data-change-id',_0x14ad3b,_0x410a27),_0x207b0d['addClass']('ck-revision-history-root-'+_0x1eb6d6['type'],_0x410a27),this['activeChange']==_0x1eb6d6&&_0x207b0d['addClass']('ck-revision-history-root--active',_0x410a27);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x3d5f09=>'revision-comment:'+_0x3d5f09,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x397dab=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x397dab['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0xd94fd=>'revision-suggestion:'+_0xd94fd,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x41a97a=>({'name':'suggestion:'+_0x41a97a,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x140fd1=>{const _0x24746b=_0x140fd1['markerName']['split'](':')[0x1];return'insertion'!=_0x24746b&&'deletion'!=_0x24746b?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x24746b]};}}),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',(_0xf43999,_0x3efac2,_0x35af24)=>{const _0x44902a=_0x35af24['mapper']['markerNameToElements'](_0x3efac2['markerName']);if(_0x44902a){for(const _0x66a15c of _0x44902a)_0x66a15c['is']('uiElement')&&(_0x35af24['mapper']['unbindElementFromMarkerName'](_0x66a15c,_0x3efac2['markerName']),_0x35af24['writer']['remove'](_0x66a15c));}},{'priority':'high'});}_getChangeFromId(_0x17db62){return this['_changeIdToChange']['get'](_0x17db62);}_getViewForChange(_0x44484f){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x44484f,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x1eecf6,_0x4e3fbc,_0x576aba,_0xab11d4)=>{_0xab11d4&&this['_balloon']['remove'](_0xab11d4),_0x576aba&&(this['_balloon']['add']({'view':_0x576aba,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x4c4886=this['editor']['editing'],_0x2bd6ee=this['_getChangeFromId'](_0x576aba['changeId']);let _0x17b921;if(_0x2bd6ee['data']['isOnRoot']){const _0x3f1832=_0x4c4886['view']['getDomRoot'](_0x2bd6ee['rootName']);_0x17b921=Array['from'](_0x3f1832['getClientRects']());}else{const _0x51b6f1=this['editor']['model']['markers']['get']('revision:'+_0x576aba['changeId']);_0x17b921=Array['from'](_0x4c4886['mapper']['markerNameToElements'](_0x51b6f1['name']))['map'](_0x4f0ead=>_0x4c4886['view']['domConverter']['mapViewToDom'](_0x4f0ead))['map'](_0x5c9510=>Array['from'](_0x5c9510['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x17b921['find'](_0x277300=>_0x277300['top']-0x3<=this['_activeViewTarget']['y']&&_0x277300['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x277300['left']-0x3<=this['_activeViewTarget']['x']&&_0x277300['right']+0x3>=this['_activeViewTarget']['x'])||_0x17b921[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x3d9822,_0x3a12f9,_0x1482aa,_0xae8039)=>{this['activeView']=_0x1482aa?this['_getViewForChange'](_0x1482aa):null,this['editor']['model']['change'](()=>{const _0x5ea9d8=this['editor']['editing'];_0xae8039&&(_0xae8039['data']['isOnRoot']?_0x5ea9d8['view']['change'](_0x35c39d=>{_0x35c39d['removeClass']('ck-revision-history-root--active',_0x5ea9d8['view']['document']['getRoot'](_0xae8039['rootName']));}):_0x5ea9d8['reconvertMarker']('revision:'+_0xae8039['id'])),_0x1482aa&&(_0x1482aa['data']['isOnRoot']?_0x5ea9d8['view']['change'](_0x2e7714=>{_0x2e7714['addClass']('ck-revision-history-root--active',_0x5ea9d8['view']['document']['getRoot'](_0x1482aa['rootName']));}):_0x5ea9d8['reconvertMarker']('revision:'+_0x1482aa['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x5c17da,_0x2b9dda)=>{if(this['activeChange'])return;const _0x25ccc1=this['_findChangeIdFromDomTarget'](_0x2b9dda['target']),_0x3093f2=this['_changeIdToChange']['get'](_0x25ccc1);_0x3093f2?(this['_activeViewTarget']={'x':_0x2b9dda['domEvent']['x'],'y':_0x2b9dda['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x3093f2)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x5995e2,_0x54c49c)=>{const _0x2e8524=this['_findChangeIdFromDomTarget'](_0x54c49c['target']),_0x5e4000=this['_changeIdToChange']['get'](_0x2e8524);_0x5e4000?(this['_activeViewTarget']={'x':_0x54c49c['domEvent']['x'],'y':_0x54c49c['domEvent']['y']},_0x5e4000===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x5e4000):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x18a4e9){do{const _0x47225f=_0x18a4e9['getAttribute']('data-change-id');if(_0x47225f)return _0x47225f;_0x18a4e9=_0x18a4e9['parent'];}while(_0x18a4e9);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x1d3a84=>{for(const _0x6d1d25 of this['editor']['model']['markers'])_0x1d3a84['removeMarker'](_0x6d1d25);});}};function Ut(_0x3677b9){return _0x3677b9['split'](':')[0x1];}function Lt(_0x46ba00,_0x389278){return(_0x5744c8,_0x3dd766,_0x5bea18)=>{if(!_0x5bea18['consumable']['test'](_0x3dd766['markerRange'],_0x5744c8['name']))return;const _0x2be4be=_0x3dd766['markerRange']['getWalker'](),_0x2e3d55=_0x3dd766['markerRange']['start'],_0x57a205=_0x46ba00['model']['schema'];let _0x3deda0=null,_0xee7465=null,_0x2b6839=!0x1,_0x4bc246=!0x1;for(const _0x2cf264 of _0x2be4be){const _0x50159d=_0x2cf264['item'];_0x2b6839=_0x2b6839||_0x57a205['isContent'](_0x50159d);const _0x42c4c7=_0x5bea18['mapper']['toViewElement'](_0x50159d);if(_0x42c4c7&&_0x42c4c7['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x2cf264['type']&&(_0x57a205['isBlock'](_0x50159d)&&!_0x57a205['isLimit'](_0x50159d)&&(_0x50159d['nextSibling']||_0x2e3d55['isAtEnd']?_0x3deda0&&_0x3deda0['parent']==_0x50159d||(_0x3deda0=_0x50159d,_0x4ce0c4(_0x2cf264['previousPosition']),_0x4bc246=!0x0):_0xee7465=_0xee7465||_0x2cf264['previousPosition']));}function _0x4ce0c4(_0x30a094){const _0x16f23e=_0x5bea18['mapper']['toViewPosition'](_0x30a094),_0x345680=_0x5bea18['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x389278});_0x5bea18['writer']['insert'](_0x16f23e,_0x345680),_0x5bea18['mapper']['bindElementToMarker'](_0x345680,_0x3dd766['markerName']);}_0x2b6839||_0x4bc246||!_0xee7465||_0x4ce0c4(_0xee7465);};}var Ft=class extends _0x2158cb{constructor(_0x3743cf){super(_0x3743cf);const _0x3c642a=_0x3743cf['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x3c642a,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x3c642a,'change:isEnabled',()=>this['refresh']());}execute(){const _0x321535=this['editor'],_0xaf0b80=_0x321535['plugins']['get'](Pt),_0x41850a=_0xaf0b80['isReady']?_0xaf0b80['diff']['newRevisionId']:null;_0x321535['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x41850a);}['refresh'](){const {isReady:_0x5480f9,isEnabled:_0x3dce5b,repository:_0x1402a3,diff:_0x2428f4}=this['editor']['plugins']['get'](Pt),_0xd6e26c=_0x2428f4&&_0x1402a3['getLaterVisibleRevision'](_0x2428f4['newRevisionId']);this['isEnabled']=_0x5480f9&&_0x3dce5b&&Boolean(_0xd6e26c);}},$t=class extends _0x2158cb{_step;constructor(_0x59515a,{direction:_0x341f1a}){super(_0x59515a);const _0x574122=_0x59515a['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x341f1a?0x1:-0x1,this['listenTo'](_0x574122,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x574122,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x574122,'change:activeChange',()=>this['refresh']());}execute(){const _0x37e0b1=this['editor'],_0x114a29=_0x37e0b1['plugins']['get'](Pt),{isNavigationMode:_0x54b147,currentChangeNumber:_0xeb2a4b}=_0x114a29;let _0x5c6e9e;if(_0x114a29['activeChange']=_0x54b147?_0x114a29['diff']['changes']['get'](_0xeb2a4b+this['_step']):_0x114a29['diff']['changes']['first'],_0x114a29['activeChange']['data']['isOnRoot'])_0x5c6e9e=_0x37e0b1['editing']['view']['getDomRoot'](_0x114a29['activeChange']['rootName']);else{const _0x2bbc19=_0x37e0b1['model']['markers']['get']('revision:'+_0x114a29['activeChange']['id']);_0x5c6e9e=_0x4df91e(_0x37e0b1['editing'],_0x2bbc19);}_0x60056({'target':_0x5c6e9e,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x348efb,currentChangeNumber:_0x4a9d91,numberOfChanges:_0x50c112,isReady:_0x1b8305,isEnabled:_0xa777da}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0xa777da&&_0x1b8305&&_0x50c112)&&(!_0x348efb||(0x1===this['_step']?_0x4a9d91<_0x50c112-0x1:_0x4a9d91>0x0));}},Bt=class extends dt{constructor(_0x1d4c33){super(_0x1d4c33);const _0xed2dd2=this['bindTemplate'],_0x52adab=new _0xefa108(_0x1d4c33),_0x1ec8de=new _0xefa108(_0x1d4c33);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',(_0x2bef3d,_0x5705ff)=>_0x2bef3d&&_0x5705ff>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x3f85cb,_0x1f5166,_0x3f022e,_0x33e21b)=>{if(!_0x3f85cb)return kt(_0x1d4c33,'Loading...');if(!_0x3f022e)return kt(_0x1d4c33,'No\x20changes');const _0xd037de=kt(_0x1d4c33,'NUMBER_OF_CHANGES',_0x3f022e);return _0x33e21b?kt(_0x1d4c33,'X_OF_Y_CHANGES',[_0x1f5166+0x1,_0x3f022e]):_0xd037de;}),_0x52adab['set']({'label':kt(_0x1d4c33,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x194704}),_0x1ec8de['set']({'label':kt(_0x1d4c33,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x4c5074}),_0x52adab['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x1ec8de['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x52adab['on']('execute',()=>this['fire']('execute','backward')),_0x1ec8de['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',_0xed2dd2['if']('_isStatusLabelVisible','ck-hidden',_0x34d529=>!_0x34d529)]},'children':[{'text':_0xed2dd2['to']('isNavigationMode',_0x50f4ed=>_0x50f4ed?kt(_0x1d4c33,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x1d4c33,'Total')+':\x20')}]},{'text':_0xed2dd2['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x52adab,_0x1ec8de]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0x544bf8{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x1210f9=this['editor']['editing']['view'];_0x1210f9['change'](_0x25147e=>{for(const _0x36fcd1 of _0x1210f9['document']['roots'])_0x25147e['addClass'](jt,_0x36fcd1);});}['hide'](){const _0x3d806d=this['editor']['editing']['view'];_0x3d806d['change'](_0x216df6=>{for(const _0x11da95 of _0x3d806d['document']['roots'])_0x216df6['removeClass'](jt,_0x11da95);});}},Kt=class extends _0x544bf8{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0x4e65b1=this['editor'],_0x3c464c=_0x4e65b1['plugins']['get'](Pt),_0x5163c9=_0x4e65b1['plugins']['get'](Gt);_0x4e65b1['ui']['componentFactory']['add']('exitToEditing',_0x5da2bf=>{const _0x4025db=new _0xefa108(_0x5da2bf);return _0x4025db['set']({'label':kt(_0x5da2bf,'Back\x20to\x20editing'),'icon':_0x53c7c8,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x4025db,'execute',()=>{_0x4e65b1['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x4025db;}),_0x4e65b1['ui']['componentFactory']['add']('restoreRevision',_0x4b1bb5=>{const _0x293cf8=new _0xefa108(_0x4b1bb5);return _0x293cf8['set']({'label':kt(_0x4b1bb5,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x293cf8['bind']('isEnabled')['to'](_0x4e65b1['commands']['get']('restoreRevision')),this['listenTo'](_0x293cf8,'execute',()=>_0x4e65b1['execute']('restoreRevision')),_0x293cf8;}),_0x4e65b1['ui']['componentFactory']['add']('changesNavigation',_0x58b204=>{const _0x2bfd9e=new Bt(_0x58b204),_0xdf8566=_0x4e65b1['commands']['get']('showPreviousChange'),_0x39b0df=_0x4e65b1['commands']['get']('showNextChange');return _0x2bfd9e['bind']('isBackwardNavigationEnabled')['to'](_0xdf8566,'isEnabled'),_0x2bfd9e['bind']('isForwardNavigationEnabled')['to'](_0x39b0df,'isEnabled'),_0x2bfd9e['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x3c464c),this['listenTo'](_0x2bfd9e,'execute',(_0xc3b977,_0x1fd178)=>{_0x4e65b1['execute']('forward'===_0x1fd178?'showNextChange':'showPreviousChange');}),_0x2bfd9e;}),_0x5163c9['show'](),_0x3c464c['on']('change:isReady',(_0x2c7b1c,_0x3acef7,_0x5f5abe)=>{_0x5f5abe?_0x5163c9['hide']():_0x5163c9['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x3f1a59,_0x5d9ebb){super(_0x3f1a59,_0x5d9ebb);const _0x3bcd4a=this['bindTemplate'];this['set']({'label':kt(_0x3f1a59,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x3f1a59,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x3bcd4a['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x5c360a(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x21ec22=this['fieldView']['element'];this['_tooltipString']=_0x21ec22['scrollWidth']>_0x21ec22['clientWidth']&&_0x21ec22['value']||'';}},Yt=class extends dt{constructor(_0x2a20bf,_0x555a24,_0x5d5f8f){super(_0x2a20bf);const _0x4ba438=new _0x1d6039();_0x4ba438['set']({'content':_0x5a8ed6,'viewBox':'0\x200\x2011\x2010'});const _0xe27e6a=['ck','ck-revision-history-sidebar__revision-author'];_0x5d5f8f&&_0xe27e6a['push']('ck-revision-history-sidebar__revision-author_creator');const _0x192dd5=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0x2a20bf,_0x5d5f8f?'Revision\x20creator':'Revision\x20author')},'children':[_0x4ba438,_0x555a24['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0xe27e6a},'children':_0x192dd5});}};function Jt(_0x206e90,_0x32288e){const _0x1d4376=_0x206e90['bindTemplate'],_0x4eb3da=_0x206e90['locale'],_0x477c7e=vt(_0x4eb3da);_0x477c7e['panelPosition']='sw';const _0x5a5509=function(_0x5df6aa,_0x2d1981){const _0x21cbfd=function(_0x2f984a,_0x17354e){const _0x4c0c30=_0x2f984a['locale'],_0x20d852={'Compare\x20against\x20selected':kt(_0x4c0c30,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x4c0c30,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x4c0c30,'Restore\x20this\x20revision')};return _0x17354e['map'](_0x128a3d=>{const _0xac4d76=_0x20d852[_0x128a3d['name']];return _0xac4d76&&_0xac4d76!==_0x128a3d['name']&&(_0x128a3d['name']=_0xac4d76),_0x128a3d;});}(_0x5df6aa,_0x2d1981),_0xab6a8=new _0x32a4f2();for(const _0x41538f of _0x21cbfd){const _0x58cfca={'type':'button','model':new ut({'label':_0x41538f['name'],'class':_0x41538f['class'],'withText':!0x0,'role':'menuitem','_action':_0x41538f['action']})};_0x58cfca['model']['bind']('isEnabled')['to'](_0x5df6aa,'isActionsDropdownOpen',_0x5dcc21=>'function'!=typeof _0x41538f['isEnabled']||(!_0x5dcc21||_0x41538f['isEnabled'](_0x5df6aa))),_0xab6a8['add'](_0x58cfca);}return _0xab6a8;}(_0x206e90,_0x32288e);return _0x206e90['bind']('isActionsDropdownOpen')['to'](_0x477c7e,'isOpen'),_0x477c7e['buttonView']['set']({'label':kt(_0x4eb3da,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x500df1}),_0x477c7e['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x1d4376['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x1d4376['to'](_0x3f1f82=>_0x3f1f82['stopPropagation']())}}),_0x477c7e['on']('execute',_0x475702=>{_0x206e90['isReady']&&'function'==typeof _0x475702['source']['_action']&&_0x475702['source']['_action'](_0x206e90);}),ft(_0x477c7e,_0x5a5509,{'role':'menu'}),_0x477c7e['listenTo'](_0x206e90,'change:isActionsDropdownOpen',(_0x234a6b,_0x2e082b,_0x3c0604)=>{if(_0x3c0604)for(const _0x1664fa of _0x477c7e['listView']['items']){const _0x46c746=_0x1664fa['children']['first'],_0x22ccfa=_0x32288e['find'](_0xeb72b8=>_0xeb72b8['action']===_0x46c746['_action'])['isVisible'];_0x1664fa['isVisible']=void 0x0===_0x22ccfa||_0x22ccfa(_0x206e90);}}),_0x477c7e;}const Wt=/* #__PURE__ -- @preserve */
27
+ _0x3e5ba7(dt);var Xt=class extends Wt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0x315a6f,_0x19a2fa,_0x2e9800,_0x4b13cc,_0x917632=!0x1){super(_0x315a6f);const _0x45bb89=this['bindTemplate'],_0x2b394a=function(_0x12d98e,_0x3fb935){const _0x408b48=Array['from'](_0x3fb935['authors'])['filter'](_0x36763c=>_0x36763c!=_0x3fb935['creator']);return _0x3fb935['creator']&&_0x408b48['unshift'](_0x3fb935['creator']),_0x408b48['map'](_0x545f7c=>new Yt(_0x12d98e,_0x545f7c,_0x545f7c==_0x3fb935['creator']));}(_0x315a6f,_0x19a2fa);this['id']=_0x19a2fa['id'],this['_revision']=_0x19a2fa,this['_requireRevisionName']=_0x4b13cc,this['bind']('_isAiGenerated')['to'](_0x19a2fa,'attributes',_0x2354a1=>!(!_0x2354a1||!_0x2354a1['@ai'])),this['bind']('name','createdAt')['to'](_0x19a2fa),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x7b483a=>{return _0x47003b=_0x315a6f['uiLanguage'],(_0x3f79e5=_0x7b483a)['toLocaleDateString'](_0x47003b,{'month':'long','day':'numeric'})+',\x20'+_0x3f79e5['toLocaleTimeString'](_0x47003b,{'hour':'numeric','minute':'numeric'});var _0x47003b,_0x3f79e5;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new qt(_0x315a6f,gt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x254da5=>_0x254da5||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x1e7ccf,_0x22a166)=>_0x1e7ccf&&_0x22a166),this['revisionActionsView']=_0x2e9800&&_0x2e9800['length']?Jt(this,_0x2e9800):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x917632?this['_createAiPillView'](_0x315a6f):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x45bb89['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x45bb89['if']('isEnabled','ck-disabled',_0x298498=>!_0x298498),_0x45bb89['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x45bb89['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x45bb89['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':_0x45bb89['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':_0x2b394a}]},..._0x917632?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x45bb89['if']('_isAiGenerated','ck-hidden',_0x38a8a4=>!_0x38a8a4)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x45bb89['to'](_0x3a52a2=>{_0x3a52a2['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x33f862){const _0x1bbd29=new _0x30468e(_0x33f862);return _0x1bbd29['set']({'icon':_0x237d30,'label':kt(_0x33f862,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':kt(_0x33f862,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','size':'small','class':'ck-pill_ai'}),_0x1bbd29['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x1bbd29;}['render'](){super['render']();const _0x45d69d=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x45d69d,'change',()=>{this['_requireRevisionName']&&!_0x45d69d['value']||this['fire']('setName',{'id':this['id'],'name':_0x45d69d['value']}),_0x45d69d['value']||(_0x45d69d['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(_0x49cb1d,_0x42a145){const _0x197459=wt['fromJSDate'](_0x49cb1d)['setLocale'](_0x42a145),_0x46705f=wt['local'](),_0x1de78c=_0x46705f['minus']({'days':0x1})['startOf']('day');let _0x470ad7,_0x3f3ef3;return _0x197459['hasSame'](_0x46705f,'day')?(_0x470ad7=_0x197459['startOf']('day')['toJSDate'](),_0x3f3ef3=_0x197459['toRelativeCalendar']()):_0x197459['hasSame'](_0x1de78c,'day')?(_0x470ad7=_0x1de78c['toJSDate'](),_0x3f3ef3=_0x197459['toRelativeCalendar']()):_0x197459['hasSame'](_0x46705f,'week')?(_0x470ad7=_0x197459['startOf']('week')['toJSDate'](),_0x3f3ef3=_0x197459['weekdayLong']||''):_0x197459['hasSame'](_0x46705f,'year')?(_0x470ad7=_0x197459['startOf']('month')['toJSDate'](),_0x3f3ef3=_0x197459['monthLong']||''):(_0x470ad7=_0x197459['startOf']('year')['toJSDate'](),_0x3f3ef3=String(_0x197459['year'])),{'startDate':_0x470ad7,'localizedPeriodName':_0x3f3ef3};}var zt=class extends dt{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x28ec24,_0x146d87,_0x2196cb,_0x51949a,_0x241022){super(_0x28ec24);const _0x2504be=Qt(_0x146d87,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x146d87,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x2196cb,this['_requireRevisionName']=_0x51949a,this['_showAISource']=_0x241022,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':_0x2504be}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x23a897){const _0x35f601=new Xt(this['locale'],_0x23a897,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0x35f601);}['removeRevision'](_0x838e8f){const _0x3fb4a3=this['revisionViews']['find'](_0x1595b4=>_0x1595b4['id']===_0x838e8f['id']);this['revisionViews']['remove'](_0x3fb4a3);}},Zt=class extends dt{constructor(_0x2ccf2d){super(_0x2ccf2d);const _0x437da6=new _0x1d6039();_0x437da6['content']=_0x1cebb3,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x437da6,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[kt(_0x2ccf2d,'Revision\x20history')]}]});}},ti=class extends dt{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x4df72d,_0x27bc47,_0x54e93e,_0x589d37,_0x4dd2ed){super(_0x4df72d);const _0x3b04c4=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x27bc47,this['_revisionActions']=_0x54e93e,this['_requireRevisionName']=_0x589d37,this['_showAISource']=_0x4dd2ed,this['on']('select',(_0x37db6a,_0x4d5933)=>{this['fire']('revisionSelected',_0x4d5933);}),this['on']('setName',(_0x499bbf,_0x50938f)=>{this['fire']('revisionSetName',_0x50938f);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Zt(_0x4df72d),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x3b04c4['if']('isEnabled','ck-disabled',_0x152b22=>!_0x152b22)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0xf9fcad of this['_revisions'])this['_addRevision'](_0xf9fcad);this['_revisions']['on']('add',(_0x2496e6,_0x3cc51a)=>{this['_addRevision'](_0x3cc51a);}),this['_revisions']['on']('remove',(_0x45aefc,_0x170a4a)=>{this['_removeRevision'](_0x170a4a);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x24ec5a=>_0x24ec5a['revisionViews']['map'](_0x4caaef=>_0x4caaef))['flat']();}selectRevision(_0x15c953){for(const _0x2a0b4f of this['revisionViews'])_0x15c953&&_0x15c953['id']===_0x2a0b4f['id']?_0x2a0b4f['select']():_0x2a0b4f['deselect']();}highlightRevisions(_0x426042){for(const _0x1add07 of this['revisionViews'])_0x426042['some'](({id:_0x59c59a})=>_0x59c59a===_0x1add07['id'])?_0x1add07['highlight']():_0x1add07['unhighlight']();}['_addRevision'](_0x3bcb20){const _0x2865a6=Qt(_0x3bcb20['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x26a441=this['_getTimePeriodViewByStartDate'](_0x2865a6);_0x26a441||(_0x26a441=new zt(this['locale'],_0x2865a6,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x26a441)),_0x26a441['addRevision'](_0x3bcb20);}['_removeRevision'](_0x21cc4a){const _0x1e510f=Qt(_0x21cc4a['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x1e510f)['removeRevision'](_0x21cc4a);}_getTimePeriodViewByStartDate(_0x47fbfa){return this['timePeriodViews']['find'](_0x115cb9=>_0x115cb9['startDate']['getTime']()===_0x47fbfa['getTime']());}},ii=class RevisionsSidebar extends _0x544bf8{['_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(_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};
29
+ ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(_0xa45d7f){super(_0xa45d7f),this['_revisionViewer']=_0xa45d7f['plugins']['get'](Pt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x175d4d=this['_revisionsRepository']['_revisions'],_0xd9c64f=this['_createRevisionActions'](),_0x5c4383=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new ti(this['editor']['locale'],_0x175d4d,_0xd9c64f,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',(_0x23b8fe,_0x27e35d)=>{_0x27e35d['revisionViews']['on']('add',(_0x597d5b,_0x1569dc)=>{_0x1569dc['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)),_0x5c4383['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x4d1d4e=this['_revisionsRepository']['getRevision'](0x0);if(_0x4d1d4e){const _0x9ae245=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x4d1d4e['id']);this['_revisionViewer']['compare'](_0x4d1d4e,_0x9ae245);}}_handleRevisionSelected(_0x1f3947,_0x18eaa8){const _0x39ddbc=this['_revisionsRepository']['getRevision'](_0x18eaa8['id']),_0x50a902=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x39ddbc['id']);this['_revisionViewer']['compare'](_0x39ddbc,_0x50a902);}_handleRevisionSetName(_0x309aea,_0x761fcb){this['_revisionsRepository']['getRevision'](_0x761fcb['id'])['setName'](_0x761fcb['name']);}['_handleDiffChange'](_0x326e1b,_0x3d15bc,_0x1b7ccd){const _0x51358f=this['_revisionsRepository']['getRevisionsInDiff'](_0x1b7ccd);_0x51358f['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x51358f),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x51358f[0x0]));}_createRevisionActions(){const _0xc92f4d=this['editor'],_0x50bacf=RevisionsSidebar['availableRevisionActions'],_0x56a40f=_0xc92f4d['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x56a40f['length'])return _0x56a40f['map'](_0x4fba6b=>{const _0x4ded90='string'==typeof _0x4fba6b?Object['assign']({},_0x50bacf[_0x4fba6b]):_0x4fba6b;return _0x4ded90['action']=_0x4ded90['action']['bind'](this,_0xc92f4d),_0x4ded90['isVisible']&&(_0x4ded90['isVisible']=_0x4ded90['isVisible']['bind'](this,_0xc92f4d)),_0x4ded90;});}};function ei(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x57b899},_0x3bcf76)=>{const _0x52b70a=_0x57b899['get'](Pt),_0x12bb80=_0x52b70a['repository'];let _0xdb596c=_0x52b70a['diff']['newRevisionId'],_0x540eeb=_0x3bcf76['id'];_0x12bb80['getIndex'](_0xdb596c)>_0x12bb80['getIndex'](_0x540eeb)&&([_0xdb596c,_0x540eeb]=[_0x540eeb,_0xdb596c]),_0x52b70a['compare'](_0xdb596c,_0x540eeb);},'isVisible':({plugins:_0x2a2014},_0x459fbe)=>{const _0x9eea6b=_0x2a2014['get'](Pt);return!(_0x9eea6b['repository']['getRevisionsInDiff'](_0x9eea6b['diff'])['length']>0x2)&&!_0x459fbe['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x19fa75,{id:_0x1b41eb})=>{_0x19fa75['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x1b41eb);},'isVisible':({plugins:_0xd83de2},_0x1582ff)=>!!_0xd83de2['get'](Pt)['repository']['getLaterVisibleRevision'](_0x1582ff['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x507edf},{id:_0x357d42,revisionNameView:_0x4a14e4})=>{const _0x4919c6=_0x507edf['get'](Pt),_0x3ca7bc=_0x4919c6['repository']['getEarlierVisibleRevision'](_0x357d42);_0x4919c6['compare'](_0x357d42,_0x3ca7bc),_0x4a14e4['focus'](),_0x4a14e4['fieldView']['select']();}}};}var si=class extends _0x108803{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x4e4a59,_0x485b1b){super(_0x4e4a59),this['_view']=_0x485b1b,this['_toolbarConfig']=mt(_0x4e4a59['config']['get']('toolbar')),this['_elementReplacer']=new _0x19597b();}get element(){return this['view']['element'];}init(_0x478463){const _0x482ab1=this['editor'],_0x2dd587=this['view'],_0x400693=_0x482ab1['editing']['view'],_0x5f1774=_0x2dd587['editable'];_0x5f1774['name']=_0x400693['document']['getRoot']()['rootName'],_0x5f1774['isMainFrameEditingRoot']=!0x0,_0x2dd587['render']();const _0x2a8f03=_0x5f1774['element'];this['setEditableElement'](_0x5f1774['name'],_0x2a8f03),_0x2dd587['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x400693['attachDomRoot'](_0x2a8f03),this['_elementReplacer']['replace'](_0x478463,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x1bfc38=this['view'],_0x258246=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x258246['detachDomRoot'](_0x1bfc38['editable']['name']),_0x1bfc38['destroy']();}_initToolbar(){const _0x2f62de=this['view'];_0x2f62de['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x2f62de['stickyPanel']['limiterElement']=_0x2f62de['element'],_0x2f62de['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x1127d8})=>_0x1127d8),_0x2f62de['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x2f62de['toolbar']);}},ni=class extends _0x121443{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x3aa1a2,_0x23fb8a,_0x2343f0={}){super(_0x3aa1a2),this['stickyPanel']=new ht(_0x3aa1a2),this['toolbar']=new lt(_0x3aa1a2,{'shouldGroupWhenFull':_0x2343f0['shouldToolbarGroupWhenFull']}),this['_editable']=new tt(_0x3aa1a2,_0x23fb8a);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const oi=/* #__PURE__ -- @preserve */
30
+ _0x5ed66b(_0x27c387);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x5ea6c9,_0x1bcf6f){super(_0x1bcf6f),this['sourceElement']=_0x5ea6c9,this['model']['document']['createRoot']();const _0x2a498d=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0x2a498d);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x5792cf,_0x1cec9f){const _0x285610=new this(_0x5792cf,_0x1cec9f);return await _0x285610['initPlugins'](),await _0x285610['ui']['init'](_0x5792cf),await _0x285610['data']['init'](_0x285610['config']['get']('initialData')||''),_0x285610['fire']('ready'),_0x285610;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0x544bf8{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11d676){super(_0x11d676),this['result']='end',_0x11d676['editing']['view']['_overlayModeHint']='auto',_0x11d676['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0x544bf8{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0x241a7b){if(super(_0x241a7b),!this['editor']['config']['get']('revisionHistory'))throw new _0x3d550e('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x295495=>this['_showRevisionViewer']({..._0x295495,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x407501=>this['_closeRevisionViewer'](_0x407501)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x43649b=>this['_restoreRevision'](_0x43649b)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x388631){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x388631;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x232b25){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x232b25);}getRevision(_0x1a5174){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x1a5174);}getRevisions(_0x5c5924){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x5c5924||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x4adbbd=this['editor'],_0x481f36=_0x1db4df(_0x4adbbd,ai),_0x223178=_0x4adbbd['plugins']['get']('RevisionTracker'),_0x250604=_0x4adbbd['plugins']['get'](_0x157f26)['users'];return _0x481f36['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x481f36['lazyRoots'],(_0x481f36['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0x544bf8{static get requires(){return[Pt,_0x157f26];}init(){const _0x5b680b=this['editor']['plugins']['get'](_0x157f26);for(const _0x5f127d of _0x250604)_0x5f127d['isAnonymous']||_0x5b680b['getUser'](_0x5f127d['id'])||_0x5b680b['addUser'](_0x5f127d);const _0xff34eb=_0x223178['repository']['getRevisions']();let _0x20e7f4=null;const _0x2d4dbc=this['editor']['plugins']['get']('RevisionViewer');if(_0x2d4dbc['adapter']=_0x223178['adapter'],_0x2d4dbc['bind']('isEnabled')['to'](_0x223178),_0x4adbbd['plugins']['has']('CommentsRepository')){const _0x4313ce=_0x4adbbd['plugins']['get']('CommentsRepository');_0x2d4dbc['_getVisibleCommentThreadIds']=()=>new Set(_0x4313ce['getCommentThreads']()['filter'](_0x468ffb=>!_0x468ffb['isResolved'])['map'](_0x4b45d9=>_0x4b45d9['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x4adbbd,'isReadOnly',_0x4487aa=>!_0x4487aa);for(const _0x58be12 of _0xff34eb){const _0x502db1=null===_0x58be12['creator'];if(_0x502db1&&_0x58be12['toVersion']===_0x58be12['fromVersion'])continue;const _0x1e62b0=_0x58be12['toJSON']();_0x2d4dbc['addRevisionData'](_0x1e62b0,(_0x3b45ce,_0x6e033f,_0xc58d96)=>{if(_0x502db1){if(_0x20e7f4)_0x20e7f4['_update'](_0x3b45ce,_0x6e033f);else{if(!_0x6e033f){const _0x187543=_0xc58d96['toJSON']();_0x187543['id']=_0x240cc1(),_0x223178['saveRevision'](_0x187543,_0xc58d96['toVersion'])['then'](_0x37ee6f=>{_0x20e7f4=_0x37ee6f;});}}}else _0x58be12['_update'](_0x3b45ce,_0x6e033f);});}}},ii),_0x481f36);}['_enhanceShowRevisionViewerCallback'](){const _0x52ae95=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x6bc29a=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x6bc29a['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x1d5915=this['editor']['plugins']['get']('Dialog');_0x1d5915['isOpen']&&_0x1d5915['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x5b03c7=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x319ff5 of _0x5b03c7)_0x319ff5['class']=_0x319ff5['class']?_0x319ff5['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x275023=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x275023&&_0x275023['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x53d119=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x53d119&&_0x53d119['setAttribute']('tabindex','-1');}}const _0x48fa5d=this['_getRevisionViewerEditorConfig']();return _0x52ae95(_0x48fa5d)['then'](_0x397e0f=>(this['_viewerEditor']=_0x397e0f,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'),_0x397e0f))['catch'](_0x105473=>(console['error'](_0x105473),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x2e988f=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 _0x5c998c=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x252ffb of _0x5c998c)_0x252ffb['class']='ck-tab-panel_disabled'===_0x252ffb['class']?'':_0x252ffb['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x3badb5=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x3badb5&&_0x3badb5['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0xc5ff2b=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0xc5ff2b&&_0xc5ff2b['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x2e988f(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x2c5867=this['editor']['plugins']['get']('Annotations');_0x2c5867['refreshVisibility'](),_0x2c5867['refreshPositioning']();}});});}['_showRevisionViewer'](_0x548c89){const _0x52674b=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x1c8b46=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x47c980=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x47c980,_0x548c89)['then'](_0x53e1bd=>(_0x1c8b46['style']['display']='block',_0x52674b['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x53e1bd));}['_closeRevisionViewer'](_0x2fd714){const _0x204cc6=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x204cc6['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x2fd714['destroy']();}async _restoreRevision(_0x50c780){const _0x4c441f=this['editor'],_0x2ce0a8=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x21cfb3=_0x4c441f['plugins']['get']('RevisionTracker'),_0x2cb25a=_0x4c441f['plugins']['get']('RevisionHistoryUtils'),_0x45a163=_0x2ce0a8['repository']['getRevision'](_0x50c780);let _0x5d291d,_0x5a6851,_0x42d70a;try{await _0x2cb25a['loadRevisionData'](_0x45a163,this['adapter']),_0x5d291d=_0x2cb25a['getRevisionDocumentData'](_0x45a163),_0x5a6851=_0x2cb25a['getRevisionRootsAttributes'](_0x45a163);}catch(_0x15cf14){return void console['error'](_0x15cf14);}_0x4c441f['model']['change'](_0x2e3770=>{for(const _0x2ae94f of Array['from'](_0x4c441f['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x2e3770['removeMarker'](_0x2ae94f);}),_0x2ce0a8['isReady']=!0x1,_0x4c441f['model']['enqueueChange'](_0x42b0e6=>{_0x42b0e6['setSelection'](null),_0x42b0e6['removeSelectionAttribute'](_0x4c441f['model']['document']['selection']['getAttributeKeys']());const _0x4428ac=Object['keys'](_0x5d291d);for(const _0x5478a2 of _0x4c441f['model']['document']['roots'])'$graveyard'!=_0x5478a2['rootName']&&_0x5478a2['isAttached']()&&!_0x4428ac['includes'](_0x5478a2['rootName'])&&_0x42b0e6['detachRoot'](_0x5478a2);for(const _0x17dc43 of _0x4428ac){let _0x2469e6=_0x4c441f['model']['document']['getRoot'](_0x17dc43);if(!_0x2469e6||!_0x2469e6['isAttached']()){const _0x52afad=_0x45a163['diffData']?.[_0x17dc43]?.['rootElementName']||'$root';_0x2469e6=_0x42b0e6['addRoot'](_0x17dc43,_0x52afad);}const _0x497a98=_0x5a6851[_0x17dc43],_0xc83379=Object['keys'](_0x497a98),_0x414282=_0x5d291d[_0x17dc43];for(const _0x670482 of _0x2469e6['getAttributeKeys']())_0xc83379['includes'](_0x670482)||_0x42b0e6['removeAttribute'](_0x670482,_0x2469e6);for(const _0x1ec9e9 of _0xc83379)_0x42b0e6['setAttribute'](_0x1ec9e9,_0x5a6851[_0x17dc43][_0x1ec9e9],_0x2469e6);_0x42b0e6['remove'](_0x42b0e6['createRangeIn'](_0x2469e6)),_0x42b0e6['insert'](_0x4c441f['data']['parse'](_0x414282,_0x2469e6),_0x2469e6,0x0);}});const _0x29b7da=kt(_0x4c441f['locale'],'Restored');if(_0x45a163['name'])_0x42d70a=-0x1==_0x45a163['name']['indexOf'](_0x29b7da)?_0x29b7da+':\x20'+_0x45a163['name']:_0x45a163['name'];else _0x42d70a=_0x29b7da+':\x20'+(_0x45a163['createdAt']['toLocaleDateString'](_0x4c441f['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x45a163['createdAt']['toLocaleTimeString'](_0x4c441f['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x21cfb3['saveRevision']({'name':_0x42d70a}),_0x2ce0a8['isReady']=!0x0,_0x4c441f['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};