@ckeditor/ckeditor5-source-editing-enhanced 49.0.0-alpha.3 → 49.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x2f4ed9,PendingActions as _0x5e4207,Plugin as _0x14892f}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x34854f,env as _0x23e998,formatHtml as _0x160925,uid as _0x4fe58a}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x551c78}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x563611,MenuBarMenuListItemButtonView as _0x4e76c7,View as _0x1782b1}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x47c287,crosshairCursor as _0x35a7e4,drawSelection as _0x4428ca,dropCursor as _0x473925,highlightActiveLine as _0x320ba3,highlightActiveLineGutter as _0x5256e7,highlightSpecialChars as _0x1b9a0c,keymap as _0x5afec6,lineNumbers as _0x3fa8f0,rectangularSelection as _0x2047b7}from'@codemirror/view';import{Compartment as _0x109dce,Transaction as _0x230fe5}from'@codemirror/state';import{bracketMatching as _0x8a76c0,defaultHighlightStyle as _0x141a9b,foldGutter as _0x3e1ca9,foldKeymap as _0x458de8,indentOnInput as _0x5c8842,syntaxHighlighting as _0x2e6883}from'@codemirror/language';import{defaultKeymap as _0x38530f,history as _0x4108d8,historyKeymap as _0x298b9d,indentLess as _0x5be1b8,indentMore as _0xa1698e,redo as _0xb14ed1,toggleTabFocusMode as _0x20210d,undo as _0x54a467}from'@codemirror/commands';import{autocompletion as _0x5d3cfe,closeBrackets as _0x4d561a,closeBracketsKeymap as _0x3c4a81,completionKeymap as _0x55baf9}from'@codemirror/autocomplete';import{html as _0x284810}from'@codemirror/lang-html';import{markdown as _0x161d80}from'@codemirror/lang-markdown';import{oneDark as _0xb261ba}from'@codemirror/theme-one-dark';function Q(_0x16fbdf,_0x565a51){const t=_0x16fbdf['t'];switch(_0x565a51){case'Edit\x20source\x20modal\x20label':return t({'string':'Edit\x20source','id':'Edit\x20source\x20modal\x20label'});case'Source':return t('Source');case'Source\x20Editing\x20Enhanced':return t('Source\x20Editing\x20Enhanced');case'Copy\x20line\x20down':return t('Copy\x20line\x20down');case'Copy\x20line\x20up':return t('Copy\x20line\x20up');case'Delete\x20line':return t('Delete\x20line');case'Indent\x20less':return t('Indent\x20less');case'Indent\x20more':return t('Indent\x20more');case'Fold\x20all':return t('Fold\x20all');case'Fold\x20code\x20(current\x20level)':return t('Fold\x20code\x20(current\x20level)');case'Move\x20line\x20down':return t('Move\x20line\x20down');case'Move\x20line\x20up':return t('Move\x20line\x20up');case'Redo\x20(keystroke)':return t({'id':'Redo\x20(keystroke)','string':'Redo'});case'Select\x20line':return t('Select\x20line');case'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode':return t('Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode');case'Toggle\x20block\x20comment':return t('Toggle\x20block\x20comment');case'Toggle\x20comment':return t('Toggle\x20comment');case'Undo\x20(keystroke)':return t({'id':'Undo\x20(keystroke)','string':'Undo'});case'Unfold\x20all':return t('Unfold\x20all');case'Unfold\x20code\x20(current\x20level)':return t('Unfold\x20code\x20(current\x20level)');case'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.':return t('Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.');case'Cancel':return t('Cancel');case'Save':return t('Save');default:return _0x565a51;}}function B(_0x39d038){const _0x23b458=_0x39d038['editing']['view']['document']['roots'],_0x29f372=_0x23b458['length'];if(0x0===_0x29f372)throw new _0x34854f('source-editing-enhanced-editor-no-root',_0x39d038);return 0x1===_0x29f372?_0x23b458['first']['rootName']:Array['from'](_0x39d038['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x43f3b8){return J(_0x43f3b8['replace'](/^[\n\s]*/g,''))?_0x43f3b8['replace'](/\s+/g,''):_0x43f3b8;}function J(_0x51dad2){return _0x51dad2['startsWith']('<');}function X(_0x320e8f){const _0x56f1d1=[_0x47c287['lineWrapping'],_0x5d3cfe(),_0x8a76c0(),_0x4d561a(),_0x35a7e4(),_0x4428ca(),_0x473925(),_0x3fa8f0(),_0x3e1ca9(),_0x320ba3(),_0x5256e7(),_0x1b9a0c(),_0x4108d8(),_0x5c8842(),_0x2047b7(),_0x2e6883(_0x141a9b,{'fallback':!0x0})],_0x4f352a=new _0x109dce();_0x56f1d1['push'](_0x4f352a['of'](_0x47c287['editable']['of'](!0x0))),'html'===_0x320e8f['syntaxLanguage']?_0x56f1d1['push'](_0x284810()):_0x56f1d1['push'](_0x161d80());const _0x94cce5=(_0x3dfa7c=_0x320e8f['theme'])&&'default'!==_0x3dfa7c?'dark'===_0x3dfa7c?_0xb261ba:_0x3dfa7c:null;var _0x3dfa7c;_0x94cce5&&_0x56f1d1['push'](_0x94cce5),_0x56f1d1['push'](_0x5afec6['of']([..._0x3c4a81,..._0x38530f,..._0x298b9d,..._0x458de8,..._0x55baf9,{'key':'Tab','run':_0xa1698e,'shift':_0x5be1b8,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0xb14ed1,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0xb14ed1,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x54a467,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x1acdce=new _0x47c287({'extensions':_0x56f1d1,'parent':_0x320e8f['parent']});return _0x20210d(_0x1acdce),{'focus':()=>{_0x1acdce['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x1acdce['focus']();},'getData':()=>_0x1acdce['state']['doc']['toString'](),'setData':_0x29aea4=>{_0x1acdce['dispatch']({'changes':{'from':0x0,'to':_0x1acdce['state']['doc']['length'],'insert':_0x29aea4},'annotations':_0x230fe5['addToHistory']['of'](!0x1)});},'setReadOnly':_0x1afe46=>{_0x1acdce['dispatch']({'effects':[_0x4f352a['reconfigure'](_0x47c287['editable']['of'](!_0x1afe46))]});},'destroy':()=>{_0x1acdce['destroy']();},'instance':_0x1acdce};}var Z=class extends _0x1782b1{_codeEditorApi=null;_options;constructor(_0x312248,_0x32127e){super(_0x312248),this['_options']=_0x32127e,this['set']('isReadOnly',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-code-editor'],'tabindex':-0x1}});}['render'](){super['render'](),this['_codeEditorApi']=X({'parent':this['element'],'syntaxLanguage':this['_options']['syntaxLanguage'],'theme':this['_options']['theme']}),this['on']('change:isReadOnly',(_0x56f4fb,_0x1053b2,_0x468125)=>{this['setReadOnly'](_0x468125);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x2aefa8){this['_codeEditorApi']['setData'](_0x2aefa8);}setReadOnly(_0x4c56c4){this['_codeEditorApi']['setReadOnly'](_0x4c56c4);}};const G='SourceEditingEnhancedMode';var W=class extends _0x2f4ed9{constructor(_0x4a504a){super(_0x4a504a),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x5e4207)['on']('change:hasAny',(_0x55d9c5,_0x4f802e,_0x1b7565)=>{_0x1b7565?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x4970be=this['editor'];for(const _0x555832 of _0x4970be['commands']['names']())['replaceSource','editSource']['includes'](_0x555832)||_0x4970be['commands']['get'](_0x555832)['forceDisabled'](G);}['_enableCommands'](){const _0x53a42b=this['editor'];for(const _0x161b95 of _0x53a42b['commands']['commands']())_0x161b95['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x11b0cb=this['editor'],_0x5e52cf=_0x11b0cb['locale'],_0x11e796=_0x11b0cb['plugins']['get']('Dialog'),_0x633fd1=B(_0x11b0cb),_0x10d5a1=_0x11b0cb['data']['get']({'rootName':_0x633fd1}),_0x9b9bfd=J(_0x456e32=_0x10d5a1)?_0x160925(_0x456e32):_0x456e32;var _0x456e32;const _0x384fc1=new Z(_0x5e52cf,{'syntaxLanguage':_0x11b0cb['plugins']['has']('Markdown')?'markdown':'html','theme':_0x11b0cb['config']['get']('sourceEditingEnhanced.theme')});let _0xdaed60=!0x0;const _0x11ea37=_0x40bfaf=>{if(!_0xdaed60)return;return Y(_0x384fc1['getData']())!==Y(_0x9b9bfd)?window['confirm'](Q(_0x5e52cf,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x40bfaf['stop']():void 0x0;};_0x11e796['show']({'id':'sourceEditingEnhanced','title':Q(_0x5e52cf,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x384fc1,'actionButtons':[{'label':Q(_0x5e52cf,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x11e796['hide']();}},{'label':Q(_0x5e52cf,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x54884b=Y(_0x384fc1['getData']())!==Y(_0x9b9bfd);_0x54884b&&_0x11b0cb['execute']('replaceSource',_0x384fc1['getData']()),_0xdaed60=!0x1,_0x11e796['hide'](),_0x54884b&&'editables'in _0x11b0cb['ui']['view']&&_0x11b0cb['ui']['view']['editables'][_0x633fd1]['element']['focus']();},'onCreate':_0x5658c7=>{_0x5658c7['set']('isEnabled',!_0x11b0cb['isReadOnly']),_0x5658c7['bind']('isEnabled')['to'](_0x11b0cb,'isReadOnly',this,'isEnabled',(_0x55fcc1,_0x2d39be)=>!_0x55fcc1&&_0x2d39be);}}],'onHide':()=>{this['_enableCommands'](),_0x11e796['off']('hide',_0x11ea37),_0x384fc1['destroy']();},'onShow':()=>{_0x384fc1['bind']('isReadOnly')['to'](_0x11b0cb,'isReadOnly',this,'isEnabled',(_0x165b7c,_0x26e8c0)=>_0x165b7c||!_0x26e8c0),_0x384fc1['setData'](_0x9b9bfd),_0x384fc1['focus'](),_0x11e796['on']('hide',_0x11ea37,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x14892f{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x5e4207];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x41b8d8=this['editor'],_0x2f1117=_0x41b8d8['locale'],_0x423f06=new W(_0x41b8d8);_0x41b8d8['commands']['add']('editSource',_0x423f06),_0x41b8d8['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x2fa345=this['_createButton'](_0x563611,_0x423f06);return _0x2fa345['set']({'label':Q(_0x2f1117,'Source'),'icon':_0x551c78,'tooltip':Q(_0x2f1117,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x2fa345;}),_0x41b8d8['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x626b=this['_createButton'](_0x4e76c7,_0x423f06,!0x0);return _0x626b['set']({'label':Q(_0x2f1117,'Edit\x20source\x20modal\x20label'),'icon':_0x551c78,'role':'menuitemcheckbox'}),_0x626b;}),this['_registerKeybindings']();}afterInit(){!async function(_0x4ead9d){const _0x2db398='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x3b217f=0x79758,_0x33c009={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x4044c8(_0xb8fdba){const _0x5244d9=new window['Promise'](_0x3694bf=>{_0xb8fdba['once']('ready',_0x3694bf);}),_0x39bb61=window['Date']['now'](),_0x274130=_0xb8fdba['config']['get']('licenseKey');async function _0x25afac(){let _0x54b15d,_0x3ec88e=null,_0x5b6ce5=null;try{return'GPL'==_0x274130?'NotAllowed':(_0x54b15d=_0xec7587(),_0x54b15d?(_0x54b15d['usageEndpoint']&&(_0x5b6ce5=_0x53ab7a(_0x54b15d['usageEndpoint'],_0x54b15d['jti'])),await _0x3e7447()?_0x1c5408()?_0x3acafd()?'Expired':_0x1a90d2()?('evaluation'==_0x54b15d['licenseType']&&(_0x3ec88e=_0x37e604('EvaluationLimit')),await _0x1d0e3c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3acafd(){const _0xbeb6b6=['evaluation','trial']['includes'](_0x54b15d['licenseType'])?_0x39bb61/0x3e8:0xe10*_0x3b217f;return _0x54b15d['exp']<_0xbeb6b6;}function _0x1c5408(){const _0x96f318=_0x54b15d['features'];return!!_0x96f318&&(!!_0x96f318['includes']('*')||!!_0x96f318['includes']('SEE'));}function _0x1a90d2(){const _0x3ca4da=_0x54b15d['licensedHosts'];if(!_0x3ca4da||0x0==_0x3ca4da['length'])return!0x0;const {hostname:_0x507969}=new URL(window['location']['href']);if(_0x3ca4da['includes'](_0x507969))return!0x0;const _0x42c633=_0x507969['split']('.');return _0x3ca4da['filter'](_0x515e3a=>_0x515e3a['includes']('*'))['map'](_0x3cb7dd=>_0x3cb7dd['split']('.'))['filter'](_0x13b13e=>_0x13b13e['length']<=_0x42c633['length'])['map'](_0x5d2c3c=>Array(_0x42c633['length']-_0x5d2c3c['length'])['fill']('*'===_0x5d2c3c[0x0]?'*':'')['concat'](_0x5d2c3c))['some'](_0x19443e=>_0x42c633['every']((_0x2245e9,_0x592f06)=>_0x19443e[_0x592f06]===_0x2245e9||'*'===_0x19443e[_0x592f06]));}function _0x1d0e3c(){return _0x3ec88e&&_0x5b6ce5?new window['Promise']((_0xf11bdd,_0x3265bf)=>{_0x3ec88e['then'](_0xf11bdd,_0x3265bf),_0x5b6ce5['then'](_0x5eb289=>{'Valid'!=_0x5eb289&&_0xf11bdd(_0x5eb289);},_0x3265bf);}):_0x3ec88e||_0x5b6ce5||'Valid';}}function _0x53ab7a(_0x1c3987,_0x377a10){return new window['Promise'](_0x5e6eaa=>{if(_0x3b7136())return _0x5e6eaa('Valid');_0x1c62e9(),_0xb8fdba['decorate']('_sendUsageRequest');let _0x3b914e=!0x1;const _0x486cd8=_0x4fe58a();function _0x33d900(_0xd07637){return!!_0xd07637&&('object'==typeof _0xd07637||'function'==typeof _0xd07637)&&'function'==typeof _0xd07637['then']&&'function'==typeof _0xd07637['catch'];}function _0x1bb4af(_0x169447){_0x4282ca(_0x169447)['then'](_0x4b02d0=>_0x4b02d0&&'ok'==_0x4b02d0['status']?_0x582187(_0x1e5d4f(_0x486cd8+_0x377a10))!=_0x4b02d0['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x6ea70=>(_0x1867ea(),_0x6ea70),()=>{const _0x3ca449=_0x561c36();return null==_0x3ca449?(_0x1867ea(),'Valid'):_0x39bb61-_0x3ca449>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5e6eaa)['catch'](()=>{_0x5e6eaa('UsageLimit');});const _0x495949=0x36ee80;function _0x1867ea(){const _0x50e702='llct-'+_0x582187(_0x1e5d4f(_0x1c3987)),_0x668ba2=_0xc1510f(_0x582187(window['Math']['ceil'](_0x39bb61/_0x495949)));window['localStorage']['setItem'](_0x50e702,_0x668ba2);}function _0x561c36(){const _0x5aae9b='llct-'+_0x582187(_0x1e5d4f(_0x1c3987)),_0xf9b8a=window['localStorage']['getItem'](_0x5aae9b);return _0xf9b8a?window['parseInt'](_0xc1510f(_0xf9b8a),0x10)*_0x495949:null;}function _0x4282ca(_0x56bea0){return new window['Promise']((_0x24fc28,_0x39d513)=>{_0x56bea0['then'](_0x24fc28,_0x39d513),window['setTimeout'](_0x39d513,0x1d4c0);});}}_0xb8fdba['on']('_sendUsageRequest',(_0x56b973,_0xf9661a)=>{if(_0xf9661a[0x0]!=_0x1c3987)return _0x5e6eaa('UsageLimit');_0xf9661a[0x1]={..._0xf9661a[0x1],'requestId':_0x486cd8};},{'priority':'high'}),_0xb8fdba['on']('_sendUsageRequest',_0x447c78=>{_0x33d900(_0x447c78['return'])&&(_0x3b914e=!0x0,_0x1bb4af(_0x447c78['return']));},{'priority':'low'}),_0x5244d9['then'](()=>{_0x3b914e||_0x5e6eaa('UsageLimit');});});function _0x3b7136(){return'auto'==_0xb8fdba['editing']['view']['_overlayModeHint'];}function _0x1c62e9(){_0xb8fdba['editing']['view']['_overlayModeHint']='auto';}}function _0x37e604(_0xdc9c31){const _0x57a9a7=[new window['Promise'](_0x3beec0=>setTimeout(_0x3beec0,0x93ecc)),_0x5244d9['then'](()=>new window['Promise'](_0x152b4c=>{let _0x30298f=0x0;_0xb8fdba['model']['on']('applyOperation',(_0x2fc05b,_0x304ae8)=>{_0x304ae8[0x0]['isDocumentOperation']&&_0x30298f++,0x5e8==_0x30298f&&(_0x152b4c(),_0x2fc05b['off']());});}))];return window['Promise']['race'](_0x57a9a7)['then'](()=>_0xdc9c31);}async function _0x1e9845(){await _0x5244d9,_0xb8fdba['model']['change']=_0x33534b,_0xb8fdba['model']['enqueueChange']=_0x33534b,_0xb8fdba['enableReadOnlyMode']('model');}function _0x12fdd5(_0x1a0963){const _0x32c391=_0x1959e0();_0xb8fdba[_0x32c391]='sourceEditingEnhancedLicenseKey'+_0x1a0963,'Valid'!=_0x1a0963&&_0x1e9845();}function _0x1959e0(){const _0x3ddab8=window['String'](window['performance']['now']())['replace']('.','');let _0x411ec0='R';for(let _0x1076df=0x0;_0x1076df<_0x3ddab8['length'];_0x1076df+=0x2){let _0x5a13a3=window['parseInt'](_0x3ddab8['substring'](_0x1076df,_0x1076df+0x2));_0x5a13a3>=0x3e&&(_0x5a13a3-=0x3e),_0x411ec0+=_0x2db398[_0x5a13a3];}return _0x411ec0;}function _0xec7587(){const _0x33d3cf=_0x274130['split']('.');if(0x3!=_0x33d3cf['length'])return null;return _0x133a84(_0x33d3cf[0x1]);function _0x133a84(_0x515586){const _0x4d6afd=_0x103931(_0x515586);return _0x4d6afd&&_0x4ed7d2()?_0x4d6afd:null;function _0x4ed7d2(){const _0x5a9d0f=_0x4d6afd['jti'],_0x1897f3=window['parseInt'](_0x5a9d0f['substring'](_0x5a9d0f['length']-0x8),0x10),_0x298ae3={..._0x4d6afd,'jti':_0x5a9d0f['substring'](0x0,_0x5a9d0f['length']-0x8)};return delete _0x298ae3['vc'],_0x1e5d4f(_0x298ae3)==_0x1897f3;}}}async function _0x3e7447(){let _0x1f8e92=!0x0;try{const [_0x4484cd,_0x2ec505,_0x3f6709]=_0x274130['split']('.');return _0x63a81d(_0x4484cd),await _0x368b8d(_0x4484cd,_0x2ec505,_0x3f6709),_0x1f8e92;}catch{return!0x1;}function _0x63a81d(_0x20fb20){const _0x4fb48e=_0x103931(_0x20fb20);_0x4fb48e&&'ES256'==_0x4fb48e['alg']||(_0x1f8e92=!0x1);}async function _0x368b8d(_0x1bb66e,_0x181933,_0x1af3cf){const _0x4ca720=window['Uint8Array']['from'](_0x1f76a4(_0x1af3cf),_0x31d5b2=>_0x31d5b2['charCodeAt'](0x0)),_0x434e9c=new window['TextEncoder']()['encode'](_0x1bb66e+'.'+_0x181933),_0x4450cb=window['crypto']['subtle'];if(!_0x4450cb)return;const _0x3dd184=await _0x4450cb['importKey']('jwk',_0x33c009,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4450cb['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3dd184,_0x4ca720,_0x434e9c)||(_0x1f8e92=!0x1);}}function _0x103931(_0x25490a){return _0x25490a['startsWith']('ey')?JSON['parse'](_0x1f76a4(_0x25490a)):null;}function _0x1f76a4(_0x52f31f){return window['atob'](_0x52f31f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1e5d4f(_0x475c9d){let _0x273d05=0x1505;function _0x3a70c5(_0x3b6728){for(let _0x4291c7=0x0;_0x4291c7<_0x3b6728['length'];_0x4291c7++){const _0x416fd8=_0x3b6728['charCodeAt'](_0x4291c7);_0x273d05=(_0x273d05<<0x5)+_0x273d05+_0x416fd8,_0x273d05&=_0x273d05;}}function _0x4ca301(_0x4efc14){Array['isArray'](_0x4efc14)?_0x4efc14['forEach'](_0x4ca301):_0x4efc14&&'object'==typeof _0x4efc14?Object['entries'](_0x4efc14)['sort']()['forEach'](([_0x5c7342,_0x5226df])=>{_0x3a70c5(_0x5c7342),_0x4ca301(_0x5226df);}):_0x3a70c5(window['String'](_0x4efc14));}return _0x4ca301(_0x475c9d),_0x273d05>>>0x0;}function _0x582187(_0x4d02ad){return _0x4d02ad['toString'](0x10)['padStart'](0x8,'0');}function _0xc1510f(_0x5c8ceb){return _0x5c8ceb['split']('')['reverse']()['join']('');}function _0x33534b(){}_0x12fdd5(await _0x25afac());}_0x4044c8(_0x4ead9d['editor']);}(this);}_createButton(_0x2c00f9,_0x5af4d6,_0x597ee1=!0x1){const _0x3e0aac=new _0x2c00f9(this['editor']['locale']);return _0x3e0aac['set']({'withText':_0x597ee1,'isToggleable':!0x1}),_0x3e0aac['bind']('isEnabled')['to'](_0x5af4d6,'isEnabled'),this['listenTo'](_0x3e0aac,'execute',()=>_0x5af4d6['execute']()),_0x3e0aac;}_registerKeybindings(){const _0xd51149=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0xd51149,'Source\x20Editing\x20Enhanced')});const _0x426810=_0x23e998['isMac']||_0x23e998['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0xd51149,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0xd51149,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0xd51149,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0xd51149,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0xd51149,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0xd51149,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0xd51149,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x426810?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0xd51149,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0xd51149,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0xd51149,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0xd51149,'Select\x20line'),'keystroke':_0x426810?'Ctrl!+L':'Alt+L'},{'label':Q(_0xd51149,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x426810?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0xd51149,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0xd51149,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0xd51149,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0xd51149,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0xd51149,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x426810?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x2f4ed9{constructor(_0x1027d2){super(_0x1027d2),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x31e05c,_0x16bd78){const _0x47fe0a=this['editor'],_0x1461f2=_0x16bd78?.['rootName']??B(_0x47fe0a);_0x47fe0a['data']['set']({[_0x1461f2]:_0x31e05c},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x14892f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x104d3a){super(_0x104d3a),_0x104d3a['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x3d7401=[this['editor']];for(const _0xf46445 of _0x3d7401){let _0x1b8df9;for(const _0x26ee26 in _0xf46445){const _0x4339c9=_0x26ee26,_0xce6dfb=_0xf46445[_0x4339c9];if('sourceEditingEnhancedLicenseKeyValid'==_0xce6dfb||'sourceEditingEnhancedLicenseKeyInvalid'==_0xce6dfb||'sourceEditingEnhancedLicenseKeyExpired'==_0xce6dfb||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0xce6dfb||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0xce6dfb||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0xce6dfb||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0xce6dfb){delete _0xf46445[_0x4339c9],_0x1b8df9=_0xce6dfb,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x1b8df9&&_0xf46445['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x1b8df9&&_0xf46445['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x1b8df9&&_0xf46445['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x1b8df9&&_0xf46445['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x1b8df9&&_0xf46445['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x1b8df9&&_0xf46445['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x1fde96=this['editor'],_0x1e9bb8=_0x1fde96['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x1e9bb8&&_0x1fde96['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x34854f('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x1e9bb8&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x20ca65=>_0x1fde96['plugins']['has'](_0x20ca65))&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20at\x20least\x20one\x20of\x20the\x20collaboration\x20features.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20collaboration\x20features.'),_0x1fde96['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
23
+ import{Command as _0x119cd7,PendingActions as _0x22a08c,Plugin as _0x15a87c}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4ebc5a,env as _0x32e0a3,formatHtml as _0x5709be,uid as _0x71e61b}from'@ckeditor/ckeditor5-utils';import{IconSource as _0xf835ce}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x4a3f71,MenuBarMenuListItemButtonView as _0x561e12,View as _0x514047}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x492f15,crosshairCursor as _0x5b72d5,drawSelection as _0x198eeb,dropCursor as _0x5ae3de,highlightActiveLine as _0x4955c8,highlightActiveLineGutter as _0x55c989,highlightSpecialChars as _0x4d11c5,keymap as _0x11b9c0,lineNumbers as _0x2a0a79,rectangularSelection as _0x5a1293}from'@codemirror/view';import{Compartment as _0x2c5cdb,Transaction as _0xa29599}from'@codemirror/state';import{bracketMatching as _0x51b222,defaultHighlightStyle as _0x31c501,foldGutter as _0x63e159,foldKeymap as _0x1baaf8,indentOnInput as _0x534fa8,syntaxHighlighting as _0x5c226f}from'@codemirror/language';import{defaultKeymap as _0x3d5677,history as _0x37a242,historyKeymap as _0x16ccf9,indentLess as _0x4b9c2c,indentMore as _0x4a4f88,redo as _0x53d86b,toggleTabFocusMode as _0x5d1e29,undo as _0xf2fae2}from'@codemirror/commands';import{autocompletion as _0x2a4d60,closeBrackets as _0x1de736,closeBracketsKeymap as _0x21d4e1,completionKeymap as _0x314f2b}from'@codemirror/autocomplete';import{html as _0x358c96}from'@codemirror/lang-html';import{markdown as _0x430fe9}from'@codemirror/lang-markdown';import{oneDark as _0xb3c72f}from'@codemirror/theme-one-dark';function Q(_0x541e5c,_0xfe935){const t=_0x541e5c['t'];switch(_0xfe935){case'Edit\x20source\x20modal\x20label':return t({'string':'Edit\x20source','id':'Edit\x20source\x20modal\x20label'});case'Source':return t('Source');case'Source\x20Editing\x20Enhanced':return t('Source\x20Editing\x20Enhanced');case'Copy\x20line\x20down':return t('Copy\x20line\x20down');case'Copy\x20line\x20up':return t('Copy\x20line\x20up');case'Delete\x20line':return t('Delete\x20line');case'Indent\x20less':return t('Indent\x20less');case'Indent\x20more':return t('Indent\x20more');case'Fold\x20all':return t('Fold\x20all');case'Fold\x20code\x20(current\x20level)':return t('Fold\x20code\x20(current\x20level)');case'Move\x20line\x20down':return t('Move\x20line\x20down');case'Move\x20line\x20up':return t('Move\x20line\x20up');case'Redo\x20(keystroke)':return t({'id':'Redo\x20(keystroke)','string':'Redo'});case'Select\x20line':return t('Select\x20line');case'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode':return t('Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode');case'Toggle\x20block\x20comment':return t('Toggle\x20block\x20comment');case'Toggle\x20comment':return t('Toggle\x20comment');case'Undo\x20(keystroke)':return t({'id':'Undo\x20(keystroke)','string':'Undo'});case'Unfold\x20all':return t('Unfold\x20all');case'Unfold\x20code\x20(current\x20level)':return t('Unfold\x20code\x20(current\x20level)');case'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.':return t('Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.');case'Cancel':return t('Cancel');case'Save':return t('Save');default:return _0xfe935;}}function B(_0x48675a){const _0x5a48be=_0x48675a['editing']['view']['document']['roots'],_0x3d8f50=_0x5a48be['length'];if(0x0===_0x3d8f50)throw new _0x4ebc5a('source-editing-enhanced-editor-no-root',_0x48675a);return 0x1===_0x3d8f50?_0x5a48be['first']['rootName']:Array['from'](_0x48675a['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x4f147c){return J(_0x4f147c['replace'](/^[\n\s]*/g,''))?_0x4f147c['replace'](/\s+/g,''):_0x4f147c;}function J(_0x56e1c7){return _0x56e1c7['startsWith']('<');}function X(_0x119d6e){const _0x435e5c=[_0x492f15['lineWrapping'],_0x2a4d60(),_0x51b222(),_0x1de736(),_0x5b72d5(),_0x198eeb(),_0x5ae3de(),_0x2a0a79(),_0x63e159(),_0x4955c8(),_0x55c989(),_0x4d11c5(),_0x37a242(),_0x534fa8(),_0x5a1293(),_0x5c226f(_0x31c501,{'fallback':!0x0})],_0x19a98f=new _0x2c5cdb();_0x435e5c['push'](_0x19a98f['of'](_0x492f15['editable']['of'](!0x0))),'html'===_0x119d6e['syntaxLanguage']?_0x435e5c['push'](_0x358c96()):_0x435e5c['push'](_0x430fe9());const _0xe111b7=(_0x1cd05a=_0x119d6e['theme'])&&'default'!==_0x1cd05a?'dark'===_0x1cd05a?_0xb3c72f:_0x1cd05a:null;var _0x1cd05a;_0xe111b7&&_0x435e5c['push'](_0xe111b7),_0x435e5c['push'](_0x11b9c0['of']([..._0x21d4e1,..._0x3d5677,..._0x16ccf9,..._0x1baaf8,..._0x314f2b,{'key':'Tab','run':_0x4a4f88,'shift':_0x4b9c2c,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x53d86b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x53d86b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xf2fae2,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x4cb562=new _0x492f15({'extensions':_0x435e5c,'parent':_0x119d6e['parent']});return _0x5d1e29(_0x4cb562),{'focus':()=>{_0x4cb562['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x4cb562['focus']();},'getData':()=>_0x4cb562['state']['doc']['toString'](),'setData':_0x3880c8=>{_0x4cb562['dispatch']({'changes':{'from':0x0,'to':_0x4cb562['state']['doc']['length'],'insert':_0x3880c8},'annotations':_0xa29599['addToHistory']['of'](!0x1)});},'setReadOnly':_0x4c01fc=>{_0x4cb562['dispatch']({'effects':[_0x19a98f['reconfigure'](_0x492f15['editable']['of'](!_0x4c01fc))]});},'destroy':()=>{_0x4cb562['destroy']();},'instance':_0x4cb562};}var Z=class extends _0x514047{_codeEditorApi=null;_options;constructor(_0x3b3b10,_0x3dd93a){super(_0x3b3b10),this['_options']=_0x3dd93a,this['set']('isReadOnly',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-code-editor'],'tabindex':-0x1}});}['render'](){super['render'](),this['_codeEditorApi']=X({'parent':this['element'],'syntaxLanguage':this['_options']['syntaxLanguage'],'theme':this['_options']['theme']}),this['on']('change:isReadOnly',(_0x56e0a2,_0x433483,_0x115c24)=>{this['setReadOnly'](_0x115c24);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x4d4187){this['_codeEditorApi']['setData'](_0x4d4187);}setReadOnly(_0xd739cc){this['_codeEditorApi']['setReadOnly'](_0xd739cc);}};const G='SourceEditingEnhancedMode';var W=class extends _0x119cd7{constructor(_0x501100){super(_0x501100),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x22a08c)['on']('change:hasAny',(_0x47c542,_0x26d66a,_0x1b1aa8)=>{_0x1b1aa8?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x458a50=this['editor'];for(const _0x49340f of _0x458a50['commands']['names']())['replaceSource','editSource']['includes'](_0x49340f)||_0x458a50['commands']['get'](_0x49340f)['forceDisabled'](G);}['_enableCommands'](){const _0x5c0c99=this['editor'];for(const _0x19b70f of _0x5c0c99['commands']['commands']())_0x19b70f['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x1e78c2=this['editor'],_0x1c336b=_0x1e78c2['locale'],_0x29a7c2=_0x1e78c2['plugins']['get']('Dialog'),_0x173167=B(_0x1e78c2),_0x357797=_0x1e78c2['data']['get']({'rootName':_0x173167}),_0x13d6d1=J(_0x299f37=_0x357797)?_0x5709be(_0x299f37):_0x299f37;var _0x299f37;const _0x4c9801=new Z(_0x1c336b,{'syntaxLanguage':_0x1e78c2['plugins']['has']('Markdown')?'markdown':'html','theme':_0x1e78c2['config']['get']('sourceEditingEnhanced.theme')});let _0x233c9f=!0x0;const _0x1dd9e7=_0x2e14d2=>{if(!_0x233c9f)return;return Y(_0x4c9801['getData']())!==Y(_0x13d6d1)?window['confirm'](Q(_0x1c336b,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x2e14d2['stop']():void 0x0;};_0x29a7c2['show']({'id':'sourceEditingEnhanced','title':Q(_0x1c336b,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x4c9801,'actionButtons':[{'label':Q(_0x1c336b,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x29a7c2['hide']();}},{'label':Q(_0x1c336b,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x52da99=Y(_0x4c9801['getData']())!==Y(_0x13d6d1);_0x52da99&&_0x1e78c2['execute']('replaceSource',_0x4c9801['getData']()),_0x233c9f=!0x1,_0x29a7c2['hide'](),_0x52da99&&'editables'in _0x1e78c2['ui']['view']&&_0x1e78c2['ui']['view']['editables'][_0x173167]['element']['focus']();},'onCreate':_0x5f4d74=>{_0x5f4d74['set']('isEnabled',!_0x1e78c2['isReadOnly']),_0x5f4d74['bind']('isEnabled')['to'](_0x1e78c2,'isReadOnly',this,'isEnabled',(_0x4bc29d,_0x91d191)=>!_0x4bc29d&&_0x91d191);}}],'onHide':()=>{this['_enableCommands'](),_0x29a7c2['off']('hide',_0x1dd9e7),_0x4c9801['destroy']();},'onShow':()=>{_0x4c9801['bind']('isReadOnly')['to'](_0x1e78c2,'isReadOnly',this,'isEnabled',(_0x5e94d2,_0x8b85ab)=>_0x5e94d2||!_0x8b85ab),_0x4c9801['setData'](_0x13d6d1),_0x4c9801['focus'](),_0x29a7c2['on']('hide',_0x1dd9e7,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x15a87c{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x22a08c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x463c1e=this['editor'],_0x5b96c9=_0x463c1e['locale'],_0x4195e0=new W(_0x463c1e);_0x463c1e['commands']['add']('editSource',_0x4195e0),_0x463c1e['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x4f478c=this['_createButton'](_0x4a3f71,_0x4195e0);return _0x4f478c['set']({'label':Q(_0x5b96c9,'Source'),'icon':_0xf835ce,'tooltip':Q(_0x5b96c9,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x4f478c;}),_0x463c1e['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x532c12=this['_createButton'](_0x561e12,_0x4195e0,!0x0);return _0x532c12['set']({'label':Q(_0x5b96c9,'Edit\x20source\x20modal\x20label'),'icon':_0xf835ce,'role':'menuitemcheckbox'}),_0x532c12;}),this['_registerKeybindings']();}afterInit(){!async function(_0x1f823c){const _0x187c9e='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x3417ea=0x79770,_0x519fde={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x38b966(_0x43b8cf){const _0x1799cf=new window['Promise'](_0x52f9e8=>{_0x43b8cf['once']('ready',_0x52f9e8);}),_0x33646e=window['Date']['now'](),_0x240680=_0x43b8cf['config']['get']('licenseKey');async function _0x4529e2(){let _0x56a932,_0x5f1976=null,_0x641ce3=null;try{return'GPL'==_0x240680?'NotAllowed':(_0x56a932=_0x352fe1(),_0x56a932?(_0x56a932['usageEndpoint']&&(_0x641ce3=_0x20c154(_0x56a932['usageEndpoint'],_0x56a932['jti'])),await _0x5b8449()?_0x4556ce()?_0x3358c5()?'Expired':_0x35a0a7()?('evaluation'==_0x56a932['licenseType']&&(_0x5f1976=_0xc3a3a0('EvaluationLimit')),await _0x54b8a0()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3358c5(){const _0x125cf9=['evaluation','trial']['includes'](_0x56a932['licenseType'])?_0x33646e/0x3e8:0xe10*_0x3417ea;return _0x56a932['exp']<_0x125cf9;}function _0x4556ce(){const _0x4203e6=_0x56a932['features'];return!!_0x4203e6&&(!!_0x4203e6['includes']('*')||!!_0x4203e6['includes']('SEE'));}function _0x35a0a7(){const _0x548822=_0x56a932['licensedHosts'];if(!_0x548822||0x0==_0x548822['length'])return!0x0;const {hostname:_0xd39279}=new URL(window['location']['href']);if(_0x548822['includes'](_0xd39279))return!0x0;const _0x4aac7a=_0xd39279['split']('.');return _0x548822['filter'](_0x2af245=>_0x2af245['includes']('*'))['map'](_0x227efa=>_0x227efa['split']('.'))['filter'](_0x581d56=>_0x581d56['length']<=_0x4aac7a['length'])['map'](_0x284988=>Array(_0x4aac7a['length']-_0x284988['length'])['fill']('*'===_0x284988[0x0]?'*':'')['concat'](_0x284988))['some'](_0xea80dd=>_0x4aac7a['every']((_0x497daa,_0x3e7af7)=>_0xea80dd[_0x3e7af7]===_0x497daa||'*'===_0xea80dd[_0x3e7af7]));}function _0x54b8a0(){return _0x5f1976&&_0x641ce3?new window['Promise']((_0x33788a,_0x3c93bf)=>{_0x5f1976['then'](_0x33788a,_0x3c93bf),_0x641ce3['then'](_0x3afb20=>{'Valid'!=_0x3afb20&&_0x33788a(_0x3afb20);},_0x3c93bf);}):_0x5f1976||_0x641ce3||'Valid';}}function _0x20c154(_0x1b7efd,_0x5877f3){return new window['Promise'](_0x4c1631=>{if(_0x593213())return _0x4c1631('Valid');_0x45722b(),_0x43b8cf['decorate']('_sendUsageRequest');let _0x3ff29f=!0x1;const _0xeef80c=_0x71e61b();function _0x5185a8(_0x5e6446){return!!_0x5e6446&&('object'==typeof _0x5e6446||'function'==typeof _0x5e6446)&&'function'==typeof _0x5e6446['then']&&'function'==typeof _0x5e6446['catch'];}function _0x5d3a1a(_0x5356aa){_0x373743(_0x5356aa)['then'](_0x571cde=>_0x571cde&&'ok'==_0x571cde['status']?_0x535288(_0x157e2a(_0xeef80c+_0x5877f3))!=_0x571cde['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2362b3=>(_0x202493(),_0x2362b3),()=>{const _0x42f6be=_0x2fab94();return null==_0x42f6be?(_0x202493(),'Valid'):_0x33646e-_0x42f6be>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4c1631)['catch'](()=>{_0x4c1631('UsageLimit');});const _0x11ec55=0x36ee80;function _0x202493(){const _0x450fb8='llct-'+_0x535288(_0x157e2a(_0x1b7efd)),_0x5ee42e=_0x4759af(_0x535288(window['Math']['ceil'](_0x33646e/_0x11ec55)));window['localStorage']['setItem'](_0x450fb8,_0x5ee42e);}function _0x2fab94(){const _0x25c11e='llct-'+_0x535288(_0x157e2a(_0x1b7efd)),_0x42a5a8=window['localStorage']['getItem'](_0x25c11e);return _0x42a5a8?window['parseInt'](_0x4759af(_0x42a5a8),0x10)*_0x11ec55:null;}function _0x373743(_0x3618cd){return new window['Promise']((_0x2e6104,_0x43c243)=>{_0x3618cd['then'](_0x2e6104,_0x43c243),window['setTimeout'](_0x43c243,0x1d4c0);});}}_0x43b8cf['on']('_sendUsageRequest',(_0x289fb0,_0x8601e6)=>{if(_0x8601e6[0x0]!=_0x1b7efd)return _0x4c1631('UsageLimit');_0x8601e6[0x1]={..._0x8601e6[0x1],'requestId':_0xeef80c};},{'priority':'high'}),_0x43b8cf['on']('_sendUsageRequest',_0xbd5c3d=>{_0x5185a8(_0xbd5c3d['return'])&&(_0x3ff29f=!0x0,_0x5d3a1a(_0xbd5c3d['return']));},{'priority':'low'}),_0x1799cf['then'](()=>{_0x3ff29f||_0x4c1631('UsageLimit');});});function _0x593213(){return'auto'==_0x43b8cf['editing']['view']['_overlayModeHint'];}function _0x45722b(){_0x43b8cf['editing']['view']['_overlayModeHint']='auto';}}function _0xc3a3a0(_0x4b80e8){const _0x3d9afd=[new window['Promise'](_0x630d2=>setTimeout(_0x630d2,0x93ecc)),_0x1799cf['then'](()=>new window['Promise'](_0x2e934a=>{let _0x5aa56a=0x0;_0x43b8cf['model']['on']('applyOperation',(_0x5ef77e,_0x50af65)=>{_0x50af65[0x0]['isDocumentOperation']&&_0x5aa56a++,0x5e8==_0x5aa56a&&(_0x2e934a(),_0x5ef77e['off']());});}))];return window['Promise']['race'](_0x3d9afd)['then'](()=>_0x4b80e8);}async function _0x165352(){await _0x1799cf,_0x43b8cf['model']['change']=_0x2d6680,_0x43b8cf['model']['enqueueChange']=_0x2d6680,_0x43b8cf['enableReadOnlyMode']('model');}function _0x12c88f(_0x22bf6e){const _0x3c23ad=_0x25d6c5();_0x43b8cf[_0x3c23ad]='sourceEditingEnhancedLicenseKey'+_0x22bf6e,'Valid'!=_0x22bf6e&&_0x165352();}function _0x25d6c5(){const _0x4dc20e=window['String'](window['performance']['now']())['replace']('.','');let _0x46a751='R';for(let _0x21e22a=0x0;_0x21e22a<_0x4dc20e['length'];_0x21e22a+=0x2){let _0x4e30b4=window['parseInt'](_0x4dc20e['substring'](_0x21e22a,_0x21e22a+0x2));_0x4e30b4>=0x3e&&(_0x4e30b4-=0x3e),_0x46a751+=_0x187c9e[_0x4e30b4];}return _0x46a751;}function _0x352fe1(){const _0x590c33=_0x240680['split']('.');if(0x3!=_0x590c33['length'])return null;return _0x28f256(_0x590c33[0x1]);function _0x28f256(_0x104365){const _0x5b044e=_0x232d9c(_0x104365);return _0x5b044e&&_0x504253()?_0x5b044e:null;function _0x504253(){const _0x536000=_0x5b044e['jti'],_0x47abb1=window['parseInt'](_0x536000['substring'](_0x536000['length']-0x8),0x10),_0x2ba1bc={..._0x5b044e,'jti':_0x536000['substring'](0x0,_0x536000['length']-0x8)};return delete _0x2ba1bc['vc'],_0x157e2a(_0x2ba1bc)==_0x47abb1;}}}async function _0x5b8449(){let _0x4e3822=!0x0;try{const [_0x1bbe3c,_0x2b4e05,_0x12044c]=_0x240680['split']('.');return _0x439627(_0x1bbe3c),await _0x35b743(_0x1bbe3c,_0x2b4e05,_0x12044c),_0x4e3822;}catch{return!0x1;}function _0x439627(_0x3a6c2c){const _0x16a9f2=_0x232d9c(_0x3a6c2c);_0x16a9f2&&'ES256'==_0x16a9f2['alg']||(_0x4e3822=!0x1);}async function _0x35b743(_0xf44e54,_0x11f9cf,_0x2404f2){const _0x537519=window['Uint8Array']['from'](_0x3e2611(_0x2404f2),_0x6677fc=>_0x6677fc['charCodeAt'](0x0)),_0x38fdc0=new window['TextEncoder']()['encode'](_0xf44e54+'.'+_0x11f9cf),_0x4353dc=window['crypto']['subtle'];if(!_0x4353dc)return;const _0xcdd0dd=await _0x4353dc['importKey']('jwk',_0x519fde,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4353dc['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xcdd0dd,_0x537519,_0x38fdc0)||(_0x4e3822=!0x1);}}function _0x232d9c(_0x2fd7fd){return _0x2fd7fd['startsWith']('ey')?JSON['parse'](_0x3e2611(_0x2fd7fd)):null;}function _0x3e2611(_0x3d9f62){return window['atob'](_0x3d9f62['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x157e2a(_0x32390d){let _0xe4ea37=0x1505;function _0x296886(_0x525378){for(let _0x4649c2=0x0;_0x4649c2<_0x525378['length'];_0x4649c2++){const _0x1612de=_0x525378['charCodeAt'](_0x4649c2);_0xe4ea37=(_0xe4ea37<<0x5)+_0xe4ea37+_0x1612de,_0xe4ea37&=_0xe4ea37;}}function _0x2c4d8b(_0x4b6b01){Array['isArray'](_0x4b6b01)?_0x4b6b01['forEach'](_0x2c4d8b):_0x4b6b01&&'object'==typeof _0x4b6b01?Object['entries'](_0x4b6b01)['sort']()['forEach'](([_0x2a635f,_0x226be1])=>{_0x296886(_0x2a635f),_0x2c4d8b(_0x226be1);}):_0x296886(window['String'](_0x4b6b01));}return _0x2c4d8b(_0x32390d),_0xe4ea37>>>0x0;}function _0x535288(_0x5116d3){return _0x5116d3['toString'](0x10)['padStart'](0x8,'0');}function _0x4759af(_0x2766bb){return _0x2766bb['split']('')['reverse']()['join']('');}function _0x2d6680(){}_0x12c88f(await _0x4529e2());}_0x38b966(_0x1f823c['editor']);}(this);}_createButton(_0x1739a8,_0x42bd51,_0x89268e=!0x1){const _0x5b2e1d=new _0x1739a8(this['editor']['locale']);return _0x5b2e1d['set']({'withText':_0x89268e,'isToggleable':!0x1}),_0x5b2e1d['bind']('isEnabled')['to'](_0x42bd51,'isEnabled'),this['listenTo'](_0x5b2e1d,'execute',()=>_0x42bd51['execute']()),_0x5b2e1d;}_registerKeybindings(){const _0x520d77=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x520d77,'Source\x20Editing\x20Enhanced')});const _0x1f03b1=_0x32e0a3['isMac']||_0x32e0a3['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x520d77,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x520d77,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x520d77,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x520d77,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x520d77,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x520d77,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x520d77,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x1f03b1?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x520d77,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x520d77,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x520d77,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x520d77,'Select\x20line'),'keystroke':_0x1f03b1?'Ctrl!+L':'Alt+L'},{'label':Q(_0x520d77,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x1f03b1?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x520d77,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x520d77,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x520d77,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x520d77,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x520d77,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x1f03b1?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x119cd7{constructor(_0x372d4d){super(_0x372d4d),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x5ba9ee,_0x5eb0ec){const _0x1c7129=this['editor'],_0x4187c9=_0x5eb0ec?.['rootName']??B(_0x1c7129);_0x1c7129['data']['set']({[_0x4187c9]:_0x5ba9ee},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x15a87c{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x447e70){super(_0x447e70),_0x447e70['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x55aba8=[this['editor']];for(const _0x2941f9 of _0x55aba8){let _0x3e4801;for(const _0x1b2ce5 in _0x2941f9){const _0x163906=_0x1b2ce5,_0x285794=_0x2941f9[_0x163906];if('sourceEditingEnhancedLicenseKeyValid'==_0x285794||'sourceEditingEnhancedLicenseKeyInvalid'==_0x285794||'sourceEditingEnhancedLicenseKeyExpired'==_0x285794||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x285794||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x285794||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x285794||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x285794){delete _0x2941f9[_0x163906],_0x3e4801=_0x285794,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x3e4801&&_0x2941f9['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x3e4801&&_0x2941f9['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3e4801&&_0x2941f9['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3e4801&&_0x2941f9['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3e4801&&_0x2941f9['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3e4801&&_0x2941f9['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x3e1614=this['editor'],_0x40138b=_0x3e1614['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x40138b&&_0x3e1614['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x4ebc5a('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x40138b&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x840f6d=>_0x3e1614['plugins']['has'](_0x840f6d))&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20at\x20least\x20one\x20of\x20the\x20collaboration\x20features.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20collaboration\x20features.'),_0x3e1614['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-source-editing-enhanced",
3
- "version": "49.0.0-alpha.3",
3
+ "version": "49.0.0-alpha.4",
4
4
  "description": "Source editing enhanced feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,11 +26,11 @@
26
26
  "dist/translations/*.umd.js"
27
27
  ],
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "49.0.0-alpha.3",
30
- "@ckeditor/ckeditor5-engine": "49.0.0-alpha.3",
31
- "@ckeditor/ckeditor5-icons": "49.0.0-alpha.3",
32
- "@ckeditor/ckeditor5-ui": "49.0.0-alpha.3",
33
- "@ckeditor/ckeditor5-utils": "49.0.0-alpha.3",
29
+ "@ckeditor/ckeditor5-core": "49.0.0-alpha.4",
30
+ "@ckeditor/ckeditor5-engine": "49.0.0-alpha.4",
31
+ "@ckeditor/ckeditor5-icons": "49.0.0-alpha.4",
32
+ "@ckeditor/ckeditor5-ui": "49.0.0-alpha.4",
33
+ "@ckeditor/ckeditor5-utils": "49.0.0-alpha.4",
34
34
  "@codemirror/autocomplete": "^6.7.1",
35
35
  "@codemirror/commands": "6.8.1",
36
36
  "@codemirror/lang-html": "^6.0.0",